LLVMFuzzerTestOneInput:
    7|  23.8k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    8|       |  // Invalid files generate a lot of warnings, so switch off logging.
    9|  23.8k|  Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
   10|       |
   11|  23.8k|  try {
   12|  23.8k|    Exiv2::DataBuf data_copy(data, size);
   13|  23.8k|    Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(data_copy.c_data(), size);
   14|  23.8k|    assert(image.get() != 0);
   15|       |
   16|  23.8k|    image->readMetadata();
   17|  23.8k|    image->writeMetadata();
   18|       |
   19|  23.8k|  } catch (...) {
   20|       |    // Exiv2 throws an exception if the metadata is invalid.
   21|  12.3k|  }
   22|       |
   23|  23.8k|  return 0;
   24|  23.8k|}

_ZN5Exiv28AsfVideo7GUIDTagC2EjttNSt3__15arrayIhLm8EEE:
   81|    124|        data1_(data1), data2_(data2), data3_(data3), data4_(data4) {
   82|    124|    }
_ZNK5Exiv28AsfVideo12HeaderReader7getSizeEv:
  104|  5.81k|    [[nodiscard]] uint64_t getSize() const {
  105|  5.81k|      return size_;
  106|  5.81k|    }
_ZNK5Exiv28AsfVideo12HeaderReader16getRemainingSizeEv:
  108|  1.80k|    [[nodiscard]] uint64_t getRemainingSize() const {
  109|  1.80k|      return remaining_size_;
  110|  1.80k|    }
_ZN5Exiv28AsfVideo12HeaderReader5getIdEv:
  112|  5.58k|    [[nodiscard]] DataBuf& getId() {
  113|  5.58k|      return IdBuf_;
  114|  5.58k|    }

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

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

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|    530|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    530|    setMsg(1);
  245|    530|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|    530|std::basic_string<charT> toBasicString(const T& arg) {
  154|    530|  std::basic_ostringstream<charT> os;
  155|    530|  os << arg;
  156|    530|  return os.str();
  157|    530|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  2.53k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  2.53k|  std::basic_ostringstream<charT> os;
  155|  2.53k|  os << arg;
  156|  2.53k|  return os.str();
  157|  2.53k|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|    132|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    132|    setMsg(1);
  245|    132|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    132|std::basic_string<charT> toBasicString(const T& arg) {
  154|    132|  std::basic_ostringstream<charT> os;
  155|    132|  os << arg;
  156|    132|  return os.str();
  157|    132|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|  1.19k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.19k|    setMsg(1);
  245|  1.19k|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  1.19k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.19k|  std::basic_ostringstream<charT> os;
  155|  1.19k|  os << arg;
  156|  1.19k|  return os.str();
  157|  1.19k|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|  2.53k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  2.53k|    setMsg(1);
  245|  2.53k|  }
_ZN5Exiv25ErrorC2IA13_cEENS_9ErrorCodeERKT_:
  243|      1|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|      1|    setMsg(1);
  245|      1|  }
_ZN5Exiv213toBasicStringIcA13_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|      1|std::basic_string<charT> toBasicString(const T& arg) {
  154|      1|  std::basic_ostringstream<charT> os;
  155|      1|  os << arg;
  156|      1|  return os.str();
  157|      1|}
_ZN5Exiv213toBasicStringIcPKcEENSt3__112basic_stringIT_NS3_11char_traitsIS5_EENS3_9allocatorIS5_EEEERKT0_:
  153|     24|std::basic_string<charT> toBasicString(const T& arg) {
  154|     24|  std::basic_ostringstream<charT> os;
  155|     24|  os << arg;
  156|     24|  return os.str();
  157|     24|}
_ZN5Exiv25ErrorC2IPKcEENS_9ErrorCodeERKT_:
  243|     24|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|     24|    setMsg(1);
  245|     24|  }

_ZN5Exiv28ExifData5beginEv:
  437|  96.7k|  iterator begin() {
  438|  96.7k|    return exifMetadata_.begin();
  439|  96.7k|  }
_ZN5Exiv28ExifData3endEv:
  441|  6.48M|  iterator end() {
  442|  6.48M|    return exifMetadata_.end();
  443|  6.48M|  }
_ZNK5Exiv28ExifData5beginEv:
  454|  2.41k|  [[nodiscard]] const_iterator begin() const {
  455|  2.41k|    return exifMetadata_.begin();
  456|  2.41k|  }
_ZNK5Exiv28ExifData3endEv:
  458|   205k|  [[nodiscard]] const_iterator end() const {
  459|   205k|    return exifMetadata_.end();
  460|   205k|  }
_ZNK5Exiv28ExifData5emptyEv:
  467|  10.7k|  [[nodiscard]] bool empty() const {
  468|  10.7k|    return exifMetadata_.empty();
  469|  10.7k|  }
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ByteOrderERNS_8ExifDataE:
  562|  5.06k|  static void encode(Blob& blob, ByteOrder byteOrder, ExifData& exifData) {
  563|  5.06k|    encode(blob, nullptr, 0, byteOrder, exifData);
  564|  5.06k|  }

_ZNK5Exiv25Image17iccProfileDefinedEv:
  215|  8.25k|  [[nodiscard]] virtual bool iccProfileDefined() const {
  216|  8.25k|    return !iccProfile_.empty();
  217|  8.25k|  }
_ZN5Exiv25Image16setTypeSupportedENS_9ImageTypeEt:
  456|    108|  void setTypeSupported(ImageType imageType, uint16_t supportedMetadata) {
  457|    108|    imageType_ = imageType;
  458|    108|    supportedMetadata_ = supportedMetadata;
  459|    108|  }

_ZN5Exiv28IptcData5clearEv:
  199|  31.0k|  void clear() {
  200|  31.0k|    iptcMetadata_.clear();
  201|  31.0k|  }
_ZN5Exiv28IptcData3endEv:
  211|   155k|  iterator end() {
  212|   155k|    return iptcMetadata_.end();
  213|   155k|  }
_ZNK5Exiv28IptcData5beginEv:
  229|  2.59k|  [[nodiscard]] const_iterator begin() const {
  230|  2.59k|    return iptcMetadata_.begin();
  231|  2.59k|  }
_ZNK5Exiv28IptcData3endEv:
  233|  4.46k|  [[nodiscard]] const_iterator end() const {
  234|  4.46k|    return iptcMetadata_.end();
  235|  4.46k|  }
_ZNK5Exiv28IptcData5emptyEv:
  247|  29.6k|  [[nodiscard]] bool empty() const {
  248|  29.6k|    return iptcMetadata_.empty();
  249|  29.6k|  }

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

_ZN5Exiv29MetadatumC2Ev:
  261|  7.32M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  10.5M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   465k|  Key(const Key&) = default;

_ZN5Exiv212PreviewImageD2Ev:
   54|  1.02k|  ~PreviewImage() = default;

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  6.71M|  [[nodiscard]] auto begin() noexcept {
  151|  6.71M|    return pData_.begin();
  152|  6.71M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  78.9k|  [[nodiscard]] auto end() noexcept {
  155|  78.9k|    return pData_.end();
  156|  78.9k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  20.5k|  [[nodiscard]] auto begin() const noexcept {
  159|  20.5k|    return pData_.begin();
  160|  20.5k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  20.2k|  [[nodiscard]] auto end() const noexcept {
  163|  20.2k|    return pData_.end();
  164|  20.2k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  5.97M|  [[nodiscard]] size_t size() const {
  167|  5.97M|    return pData_.size();
  168|  5.97M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  63.2k|  [[nodiscard]] bool empty() const {
  195|  63.2k|    return pData_.empty();
  196|  63.2k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.22M|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  33.4k|const T* find(T (&src)[N], const K& key) {
  448|  33.4k|  static_assert(N > 0, "Passed zero length find");
  449|  33.4k|  auto rc = std::find(src, src + N, key);
  450|  33.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 33.4k]
  ------------------
  451|  33.4k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   111k|std::string toString(const T& arg) {
  467|   111k|  return toStringHelper(arg, std::is_integral<T>());
  468|   111k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   111k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   111k|  return std::to_string(arg);
  457|   111k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  11.3M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  11.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 2.05M, False: 9.31M]
  ------------------
  229|  2.05M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  2.05M|  }
  231|  9.31M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  11.3M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|   493k|const T* find(T (&src)[N], const K& key) {
  448|   493k|  static_assert(N > 0, "Passed zero length find");
  449|   493k|  auto rc = std::find(src, src + N, key);
  450|   493k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 482k, False: 11.1k]
  ------------------
  451|   493k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  6.64M|const T* find(T (&src)[N], const K& key) {
  448|  6.64M|  static_assert(N > 0, "Passed zero length find");
  449|  6.64M|  auto rc = std::find(src, src + N, key);
  450|  6.64M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.90M, False: 4.74M]
  ------------------
  451|  6.64M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|      6|T stringTo(const std::string& s, bool& ok) {
  483|      6|  std::istringstream is(s);
  484|      6|  T tmp = T();
  485|      6|  ok = static_cast<bool>(is >> tmp);
  486|      6|  std::string rest;
  487|      6|  is >> std::skipws >> rest;
  488|      6|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 0, False: 6]
  ------------------
  489|      0|    ok = false;
  490|      6|  return tmp;
  491|      6|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  31.4k|std::string toString(const T& arg) {
  467|  31.4k|  return toStringHelper(arg, std::is_integral<T>());
  468|  31.4k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  31.4k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  31.4k|  return std::to_string(arg);
  457|  31.4k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  2.41k|std::string toString(const T& arg) {
  467|  2.41k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.41k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  2.41k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  2.41k|  return std::to_string(arg);
  457|  2.41k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   194k|std::string toString(const T& arg) {
  467|   194k|  return toStringHelper(arg, std::is_integral<T>());
  468|   194k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   194k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   194k|  return std::to_string(arg);
  457|   194k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  3.21k|std::string toString(const T& arg) {
  467|  3.21k|  return toStringHelper(arg, std::is_integral<T>());
  468|  3.21k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  3.21k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  3.21k|  std::ostringstream os;
  462|  3.21k|  os << arg;
  463|  3.21k|  return os.str();
  464|  3.21k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   176k|std::string toString(const T& arg) {
  467|   176k|  return toStringHelper(arg, std::is_integral<T>());
  468|   176k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|   176k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   176k|  std::ostringstream os;
  462|   176k|  os << arg;
  463|   176k|  return os.str();
  464|   176k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  71.7k|std::string toString(const T& arg) {
  467|  71.7k|  return toStringHelper(arg, std::is_integral<T>());
  468|  71.7k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  71.7k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  71.7k|  return std::to_string(arg);
  457|  71.7k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  1.19k|const T* find(T (&src)[N], const K& key) {
  448|  1.19k|  static_assert(N > 0, "Passed zero length find");
  449|  1.19k|  auto rc = std::find(src, src + N, key);
  450|  1.19k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 584, False: 613]
  ------------------
  451|  1.19k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|    496|const T* find(T (&src)[N], const K& key) {
  448|    496|  static_assert(N > 0, "Passed zero length find");
  449|    496|  auto rc = std::find(src, src + N, key);
  450|    496|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 210, False: 286]
  ------------------
  451|    496|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    776|const T* find(T (&src)[N], const K& key) {
  448|    776|  static_assert(N > 0, "Passed zero length find");
  449|    776|  auto rc = std::find(src, src + N, key);
  450|    776|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 745, False: 31]
  ------------------
  451|    776|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|   146k|const T* find(T (&src)[N], const K& key) {
  448|   146k|  static_assert(N > 0, "Passed zero length find");
  449|   146k|  auto rc = std::find(src, src + N, key);
  450|   146k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 932, False: 145k]
  ------------------
  451|   146k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  2.23k|const T* find(T (&src)[N], const K& key) {
  448|  2.23k|  static_assert(N > 0, "Passed zero length find");
  449|  2.23k|  auto rc = std::find(src, src + N, key);
  450|  2.23k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.37k, False: 862]
  ------------------
  451|  2.23k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  4.79k|const T* find(T (&src)[N], const K& key) {
  448|  4.79k|  static_assert(N > 0, "Passed zero length find");
  449|  4.79k|  auto rc = std::find(src, src + N, key);
  450|  4.79k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.47k, False: 1.32k]
  ------------------
  451|  4.79k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  8.17k|const T* find(T (&src)[N], const K& key) {
  448|  8.17k|  static_assert(N > 0, "Passed zero length find");
  449|  8.17k|  auto rc = std::find(src, src + N, key);
  450|  8.17k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 7.24k, False: 924]
  ------------------
  451|  8.17k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  4.54k|std::string toString(const T& arg) {
  467|  4.54k|  return toStringHelper(arg, std::is_integral<T>());
  468|  4.54k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  4.54k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  4.54k|  std::ostringstream os;
  462|  4.54k|  os << arg;
  463|  4.54k|  return os.str();
  464|  4.54k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  2.55k|std::string toString(const T& arg) {
  467|  2.55k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.55k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  2.55k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  2.55k|  return std::to_string(arg);
  457|  2.55k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|  1.22M|std::string toString(const T& arg) {
  467|  1.22M|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.22M|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|  1.22M|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.22M|  std::ostringstream os;
  462|  1.22M|  os << arg;
  463|  1.22M|  return os.str();
  464|  1.22M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|  1.30k|const T* find(T (&src)[N], const K& key) {
  448|  1.30k|  static_assert(N > 0, "Passed zero length find");
  449|  1.30k|  auto rc = std::find(src, src + N, key);
  450|  1.30k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.27k, False: 35]
  ------------------
  451|  1.30k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|  10.6k|const T* find(T (&src)[N], const K& key) {
  448|  10.6k|  static_assert(N > 0, "Passed zero length find");
  449|  10.6k|  auto rc = std::find(src, src + N, key);
  450|  10.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 6.47k, False: 4.16k]
  ------------------
  451|  10.6k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|  10.6k|const T* find(T (&src)[N], const K& key) {
  448|  10.6k|  static_assert(N > 0, "Passed zero length find");
  449|  10.6k|  auto rc = std::find(src, src + N, key);
  450|  10.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 9.98k, False: 651]
  ------------------
  451|  10.6k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  9.03k|const T* find(T (&src)[N], const K& key) {
  448|  9.03k|  static_assert(N > 0, "Passed zero length find");
  449|  9.03k|  auto rc = std::find(src, src + N, key);
  450|  9.03k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.65k, False: 4.37k]
  ------------------
  451|  9.03k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|   113k|const T* find(T (&src)[N], const K& key) {
  448|   113k|  static_assert(N > 0, "Passed zero length find");
  449|   113k|  auto rc = std::find(src, src + N, key);
  450|   113k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 102k, False: 11.3k]
  ------------------
  451|   113k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  27.8k|const T* find(T (&src)[N], const K& key) {
  448|  27.8k|  static_assert(N > 0, "Passed zero length find");
  449|  27.8k|  auto rc = std::find(src, src + N, key);
  450|  27.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 13.0k, False: 14.7k]
  ------------------
  451|  27.8k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  4.52k|const T* find(T (&src)[N], const K& key) {
  448|  4.52k|  static_assert(N > 0, "Passed zero length find");
  449|  4.52k|  auto rc = std::find(src, src + N, key);
  450|  4.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.53k, False: 990]
  ------------------
  451|  4.52k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  4.52k|const T* find(T (&src)[N], const K& key) {
  448|  4.52k|  static_assert(N > 0, "Passed zero length find");
  449|  4.52k|  auto rc = std::find(src, src + N, key);
  450|  4.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.13k, False: 1.39k]
  ------------------
  451|  4.52k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|    472|const T* find(T (&src)[N], const K& key) {
  448|    472|  static_assert(N > 0, "Passed zero length find");
  449|    472|  auto rc = std::find(src, src + N, key);
  450|    472|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 199, False: 273]
  ------------------
  451|    472|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   497k|const T* find(T (&src)[N], const K& key) {
  448|   497k|  static_assert(N > 0, "Passed zero length find");
  449|   497k|  auto rc = std::find(src, src + N, key);
  450|   497k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 484k, False: 12.9k]
  ------------------
  451|   497k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|   110k|const T* find(T (&src)[N], const K& key) {
  448|   110k|  static_assert(N > 0, "Passed zero length find");
  449|   110k|  auto rc = std::find(src, src + N, key);
  450|   110k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 104k, False: 5.67k]
  ------------------
  451|   110k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  3.49k|const T* find(T (&src)[N], const K& key) {
  448|  3.49k|  static_assert(N > 0, "Passed zero length find");
  449|  3.49k|  auto rc = std::find(src, src + N, key);
  450|  3.49k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 585, False: 2.91k]
  ------------------
  451|  3.49k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  8.93k|const T* find(T (&src)[N], const K& key) {
  448|  8.93k|  static_assert(N > 0, "Passed zero length find");
  449|  8.93k|  auto rc = std::find(src, src + N, key);
  450|  8.93k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.23k, False: 6.70k]
  ------------------
  451|  8.93k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  5.41M|const T* find(T (&src)[N], const K& key) {
  448|  5.41M|  static_assert(N > 0, "Passed zero length find");
  449|  5.41M|  auto rc = std::find(src, src + N, key);
  450|  5.41M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 5.41M]
  ------------------
  451|  5.41M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  5.06M|const T* find(T (&src)[N], const K& key) {
  448|  5.06M|  static_assert(N > 0, "Passed zero length find");
  449|  5.06M|  auto rc = std::find(src, src + N, key);
  450|  5.06M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 5.06M]
  ------------------
  451|  5.06M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  4.17M|const T* find(T (&src)[N], const K& key) {
  448|  4.17M|  static_assert(N > 0, "Passed zero length find");
  449|  4.17M|  auto rc = std::find(src, src + N, key);
  450|  4.17M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.15M, False: 13.4k]
  ------------------
  451|  4.17M|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|  63.6k|const T* find(T (&src)[N], const K& key) {
  448|  63.6k|  static_assert(N > 0, "Passed zero length find");
  449|  63.6k|  auto rc = std::find(src, src + N, key);
  450|  63.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.86k, False: 57.8k]
  ------------------
  451|  63.6k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|  1.03M|const T* find(T (&src)[N], const K& key) {
  448|  1.03M|  static_assert(N > 0, "Passed zero length find");
  449|  1.03M|  auto rc = std::find(src, src + N, key);
  450|  1.03M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 24, False: 1.03M]
  ------------------
  451|  1.03M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  15.1k|const T* find(T (&src)[N], const K& key) {
  448|  15.1k|  static_assert(N > 0, "Passed zero length find");
  449|  15.1k|  auto rc = std::find(src, src + N, key);
  450|  15.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.59k, False: 9.52k]
  ------------------
  451|  15.1k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  447|  7.79k|const T* find(T (&src)[N], const K& key) {
  448|  7.79k|  static_assert(N > 0, "Passed zero length find");
  449|  7.79k|  auto rc = std::find(src, src + N, key);
  450|  7.79k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 7.79k]
  ------------------
  451|  7.79k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|  1.45k|const T* find(T (&src)[N], const K& key) {
  448|  1.45k|  static_assert(N > 0, "Passed zero length find");
  449|  1.45k|  auto rc = std::find(src, src + N, key);
  450|  1.45k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 369, False: 1.08k]
  ------------------
  451|  1.45k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|    157|T stringTo(const std::string& s, bool& ok) {
  483|    157|  std::istringstream is(s);
  484|    157|  T tmp = T();
  485|    157|  ok = static_cast<bool>(is >> tmp);
  486|    157|  std::string rest;
  487|    157|  is >> std::skipws >> rest;
  488|    157|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 90, False: 67]
  ------------------
  489|     90|    ok = false;
  490|    157|  return tmp;
  491|    157|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     97|const T* find(T (&src)[N], const K& key) {
  448|     97|  static_assert(N > 0, "Passed zero length find");
  449|     97|  auto rc = std::find(src, src + N, key);
  450|     97|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 97, False: 0]
  ------------------
  451|     97|}

_ZNK5Exiv25Value6typeIdEv:
   85|  6.68M|  TypeId typeId() const {
   86|  6.68M|    return type_;
   87|  6.68M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  10.1M|  UniquePtr clone() const {
   94|  10.1M|    return UniquePtr(clone_());
   95|  10.1M|  }
_ZNK5Exiv25Value2okEv:
  181|   105k|  bool ok() const {
  182|   105k|    return ok_;
  183|   105k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  26.3k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  26.3k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 16.6k, False: 9.68k]
  ------------------
  797|  16.6k|      return str1.size() > str2.size();
  798|       |
  799|  9.68k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  9.68k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  26.3k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  49.6k|inline TypeId getType<uint16_t>() {
 1084|  49.6k|  return unsignedShort;
 1085|  49.6k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  3.40k|inline TypeId getType<uint32_t>() {
 1089|  3.40k|  return unsignedLong;
 1090|  3.40k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  11.9k|inline TypeId getType<URational>() {
 1094|  11.9k|  return unsignedRational;
 1095|  11.9k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  16.9k|inline TypeId getType<int16_t>() {
 1099|  16.9k|  return signedShort;
 1100|  16.9k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  25.7k|inline TypeId getType<int32_t>() {
 1104|  25.7k|  return signedLong;
 1105|  25.7k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  10.1k|inline TypeId getType<Rational>() {
 1109|  10.1k|  return signedRational;
 1110|  10.1k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  7.02k|inline TypeId getType<float>() {
 1114|  7.02k|  return tiffFloat;
 1115|  7.02k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  11.3k|inline TypeId getType<double>() {
 1119|  11.3k|  return tiffDouble;
 1120|  11.3k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.40M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.40M|  return getUShort(buf, byteOrder);
 1316|  1.40M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  1.45M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  1.45M|  return getULong(buf, byteOrder);
 1321|  1.45M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   137k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   137k|  return getURational(buf, byteOrder);
 1326|   137k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|  93.7k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|  93.7k|  return getShort(buf, byteOrder);
 1331|  93.7k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   617k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   617k|  return getLong(buf, byteOrder);
 1336|   617k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   223k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   223k|  return getRational(buf, byteOrder);
 1341|   223k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  43.6k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  43.6k|  return getFloat(buf, byteOrder);
 1346|  43.6k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   341k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   341k|  return getDouble(buf, byteOrder);
 1351|   341k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  1.85M|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  1.85M|  return us2Data(buf, t, byteOrder);
 1374|  1.85M|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|   415k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|   415k|  return ul2Data(buf, t, byteOrder);
 1382|   415k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   157k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   157k|  return ur2Data(buf, t, byteOrder);
 1390|   157k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   134k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   134k|  return s2Data(buf, t, byteOrder);
 1398|   134k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   467k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   467k|  return l2Data(buf, t, byteOrder);
 1406|   467k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   133k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   133k|  return r2Data(buf, t, byteOrder);
 1414|   133k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  32.7k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  32.7k|  return f2Data(buf, t, byteOrder);
 1422|  32.7k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   338k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   338k|  return d2Data(buf, t, byteOrder);
 1430|   338k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  2.01k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  2.01k|  return float_to_integer_helper<int64_t>(n);
 1550|  2.01k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  8.06k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  8.06k|  return float_to_integer_helper<uint32_t>(n);
 1555|  8.06k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  2.68k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  2.68k|  return float_to_integer_helper<int64_t>(n);
 1560|  2.68k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  11.3k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  11.3k|  return float_to_integer_helper<uint32_t>(n);
 1564|  11.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  1.33k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  1.33k|  return rational_to_integer_helper<int64_t>(n);
 1569|  1.33k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  16.7k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  16.7k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  16.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  7.75k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  7.75k|  return rational_to_integer_helper<int64_t>(n);
 1578|  7.75k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  51.8k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  51.8k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  51.8k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  2.01k|  I float_to_integer_helper(size_t n) const {
 1213|  2.01k|    const auto v = value_.at(n);
 1214|  2.01k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 1.69k, False: 319]
  ------------------
 1215|  1.69k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 956, False: 740]
  ------------------
 1216|    956|      return static_cast<I>(std::lround(v));
 1217|    956|    }
 1218|  1.05k|    return 0;
 1219|  2.01k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  8.06k|  I float_to_integer_helper(size_t n) const {
 1213|  8.06k|    const auto v = value_.at(n);
 1214|  8.06k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.97k, False: 1.08k]
  ------------------
 1215|  6.97k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 5.26k, False: 1.71k]
  ------------------
 1216|  5.26k|      return static_cast<I>(std::lround(v));
 1217|  5.26k|    }
 1218|  2.79k|    return 0;
 1219|  8.06k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  2.68k|  I float_to_integer_helper(size_t n) const {
 1213|  2.68k|    const auto v = value_.at(n);
 1214|  2.68k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 2.35k, False: 326]
  ------------------
 1215|  2.35k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 1.93k, False: 424]
  ------------------
 1216|  1.93k|      return static_cast<I>(std::lround(v));
 1217|  1.93k|    }
 1218|    750|    return 0;
 1219|  2.68k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  11.3k|  I float_to_integer_helper(size_t n) const {
 1213|  11.3k|    const auto v = value_.at(n);
 1214|  11.3k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 8.10k, False: 3.24k]
  ------------------
 1215|  8.10k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 7.25k, False: 849]
  ------------------
 1216|  7.25k|      return static_cast<I>(std::lround(v));
 1217|  7.25k|    }
 1218|  4.09k|    return 0;
 1219|  11.3k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  1.33k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.33k|    auto a = value_.at(n).first;
 1225|  1.33k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.33k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 496, False: 842]
  ------------------
 1229|    496|      return 0;
 1230|    496|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|    842|#ifdef __cpp_if_constexpr
 1234|    842|    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|    842|      const auto imin = std::numeric_limits<I>::min();
 1240|    842|      const auto imax = std::numeric_limits<I>::max();
 1241|    842|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 842]
  |  Branch (1241:23): [True: 0, False: 842]
  |  Branch (1241:35): [True: 0, False: 842]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|    842|#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|    842|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.33k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  16.7k|  I rational_to_integer_helper(size_t n) const {
 1224|  16.7k|    auto a = value_.at(n).first;
 1225|  16.7k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  16.7k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.77k, False: 14.0k]
  ------------------
 1229|  2.77k|      return 0;
 1230|  2.77k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  14.0k|#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|  14.0k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  14.0k|      const auto imax = std::numeric_limits<I>::max();
 1257|  14.0k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 1.01k, False: 12.9k]
  ------------------
 1258|  1.01k|        return 0;
 1259|  1.01k|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  12.9k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  12.9k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  12.9k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 12.9k]
  |  Branch (1263:25): [True: 0, False: 12.9k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  12.9k|    }
 1267|       |
 1268|  12.9k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  16.7k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  7.75k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.75k|    auto a = value_.at(n).first;
 1225|  7.75k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.75k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 390, False: 7.36k]
  ------------------
 1229|    390|      return 0;
 1230|    390|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  7.36k|#ifdef __cpp_if_constexpr
 1234|       |    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|       |      const auto imin = std::numeric_limits<I>::min();
 1240|       |      const auto imax = std::numeric_limits<I>::max();
 1241|       |      if (imax < b || a < imin || imax < a) {
 1242|       |        return 0;
 1243|       |      }
 1244|       |#ifdef __cpp_if_constexpr
 1245|  7.36k|    } 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|  7.36k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  7.36k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 7.36k]
  |  Branch (1251:23): [True: 0, False: 7.36k]
  ------------------
 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|  7.36k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.75k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  51.8k|  I rational_to_integer_helper(size_t n) const {
 1224|  51.8k|    auto a = value_.at(n).first;
 1225|  51.8k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  51.8k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.51k, False: 50.3k]
  ------------------
 1229|  1.51k|      return 0;
 1230|  1.51k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  50.3k|#ifdef __cpp_if_constexpr
 1234|  50.3k|    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|  50.3k|      const auto imin = std::numeric_limits<I>::min();
 1240|  50.3k|      const auto imax = std::numeric_limits<I>::max();
 1241|  50.3k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 50.3k]
  |  Branch (1241:23): [True: 0, False: 50.3k]
  |  Branch (1241:35): [True: 0, False: 50.3k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  50.3k|#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|  50.3k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  51.8k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  49.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  49.6k|}
_ZN5Exiv25ValueD2Ev:
   43|  12.5M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  48.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  48.5k|  value_.clear();
 1469|  48.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  48.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 48.5k, False: 0]
  |  Branch (1470:17): [True: 356, False: 48.1k]
  ------------------
 1471|    356|    len = (len / ts) * ts;
 1472|  1.45M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.40M, False: 48.5k]
  ------------------
 1473|  1.40M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.40M|  }
 1475|  48.5k|  return 0;
 1476|  48.5k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.07k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.07k|  std::istringstream is(buf);
 1481|  1.07k|  T tmp;
 1482|  1.07k|  ValueList val;
 1483|  1.73k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 662, False: 1.07k]
  ------------------
 1484|    662|    val.push_back(tmp);
 1485|  1.07k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 7, False: 1.06k]
  ------------------
 1486|      7|    return 1;
 1487|  1.06k|  value_ = std::move(val);
 1488|  1.06k|  return 0;
 1489|  1.07k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.87k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.87k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.24k, False: 628]
  ------------------
 1651|  1.24k|    pDataArea_ = Blob(buf, buf + len);
 1652|    628|  else
 1653|    628|    pDataArea_.clear();
 1654|  1.87k|  return 0;
 1655|  1.87k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  40.5k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  40.5k|  size_t offset = 0;
 1494|  1.85M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.85M, False: 40.5k]
  ------------------
 1495|  1.85M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.85M|  }
 1497|  40.5k|  return offset;
 1498|  40.5k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   190k|size_t ValueType<T>::count() const {
 1502|   190k|  return value_.size();
 1503|   190k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   178k|size_t ValueType<T>::size() const {
 1507|   178k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   178k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    469|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    469|  auto end = value_.end();
 1518|    469|  auto i = value_.begin();
 1519|  8.65k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 8.18k, False: 469]
  ------------------
 1520|  8.18k|    os << std::setprecision(15) << *i;
 1521|  8.18k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 7.96k, False: 217]
  ------------------
 1522|  7.96k|      os << " ";
 1523|  8.18k|  }
 1524|    469|  return os;
 1525|    469|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  88.8k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  88.8k|  ok_ = true;
 1537|  88.8k|  return static_cast<int64_t>(value_.at(n));
 1538|  88.8k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   100k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   100k|  ok_ = true;
 1542|   100k|  return static_cast<uint32_t>(value_.at(n));
 1543|   100k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  3.85k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.85k|  return pDataArea_.size();
 1641|  3.85k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    785|DataBuf ValueType<T>::dataArea() const {
 1645|    785|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    785|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   131k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   131k|  return new ValueType<T>(*this);
 1513|   131k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   131k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   131k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.77k, False: 128k]
  ------------------
 1449|  2.77k|    pDataArea_ = rhs.pDataArea_;
 1450|   131k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  9.62M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  45.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  45.7k|  value_.clear();
 1469|  45.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  45.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 45.7k, False: 0]
  |  Branch (1470:17): [True: 70, False: 45.7k]
  ------------------
 1471|     70|    len = (len / ts) * ts;
 1472|  1.50M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.45M, False: 45.7k]
  ------------------
 1473|  1.45M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.45M|  }
 1475|  45.7k|  return 0;
 1476|  45.7k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    650|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    650|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 359, False: 291]
  ------------------
 1651|    359|    pDataArea_ = Blob(buf, buf + len);
 1652|    291|  else
 1653|    291|    pDataArea_.clear();
 1654|    650|  return 0;
 1655|    650|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  31.7k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  31.7k|  size_t offset = 0;
 1494|   415k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 415k, False: 31.7k]
  ------------------
 1495|   415k|    offset += toData(buf + offset, val, byteOrder);
 1496|   415k|  }
 1497|  31.7k|  return offset;
 1498|  31.7k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   134k|size_t ValueType<T>::count() const {
 1502|   134k|  return value_.size();
 1503|   134k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   130k|size_t ValueType<T>::size() const {
 1507|   130k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   130k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  3.30k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  3.30k|  auto end = value_.end();
 1518|  3.30k|  auto i = value_.begin();
 1519|  51.1k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 47.8k, False: 3.30k]
  ------------------
 1520|  47.8k|    os << std::setprecision(15) << *i;
 1521|  47.8k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 44.9k, False: 2.92k]
  ------------------
 1522|  44.9k|      os << " ";
 1523|  47.8k|  }
 1524|  3.30k|  return os;
 1525|  3.30k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  6.70k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  6.70k|  ok_ = true;
 1537|  6.70k|  return static_cast<int64_t>(value_.at(n));
 1538|  6.70k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  59.3k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  59.3k|  ok_ = true;
 1542|  59.3k|  return static_cast<uint32_t>(value_.at(n));
 1543|  59.3k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  5.33k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.33k|  return pDataArea_.size();
 1641|  5.33k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    771|DataBuf ValueType<T>::dataArea() const {
 1645|    771|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    771|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   157k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   157k|  return new ValueType<T>(*this);
 1513|   157k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   157k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   157k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 297, False: 157k]
  ------------------
 1449|    297|    pDataArea_ = rhs.pDataArea_;
 1450|   157k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  11.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.9k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  11.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  11.5k|  value_.clear();
 1469|  11.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  11.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 11.5k, False: 0]
  |  Branch (1470:17): [True: 0, False: 11.5k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   149k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 137k, False: 11.5k]
  ------------------
 1473|   137k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   137k|  }
 1475|  11.5k|  return 0;
 1476|  11.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    995|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    995|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 751, False: 244]
  ------------------
 1651|    751|    pDataArea_ = Blob(buf, buf + len);
 1652|    244|  else
 1653|    244|    pDataArea_.clear();
 1654|    995|  return 0;
 1655|    995|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  10.5k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  10.5k|  size_t offset = 0;
 1494|   157k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 157k, False: 10.5k]
  ------------------
 1495|   157k|    offset += toData(buf + offset, val, byteOrder);
 1496|   157k|  }
 1497|  10.5k|  return offset;
 1498|  10.5k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  71.4k|size_t ValueType<T>::count() const {
 1502|  71.4k|  return value_.size();
 1503|  71.4k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  26.6k|size_t ValueType<T>::size() const {
 1507|  26.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  26.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    637|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    637|  auto end = value_.end();
 1518|    637|  auto i = value_.begin();
 1519|   134k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 134k, False: 637]
  ------------------
 1520|   134k|    os << std::setprecision(15) << *i;
 1521|   134k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 133k, False: 416]
  ------------------
 1522|   133k|      os << " ";
 1523|   134k|  }
 1524|    637|  return os;
 1525|    637|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  1.93k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.93k|  return pDataArea_.size();
 1641|  1.93k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    292|DataBuf ValueType<T>::dataArea() const {
 1645|    292|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    292|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  35.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  35.4k|  return new ValueType<T>(*this);
 1513|  35.4k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  35.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  35.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.80k, False: 33.6k]
  ------------------
 1449|  1.80k|    pDataArea_ = rhs.pDataArea_;
 1450|  35.4k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  16.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  16.9k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  12.6k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.6k|  value_.clear();
 1469|  12.6k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.6k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.6k, False: 0]
  |  Branch (1470:17): [True: 27, False: 12.6k]
  ------------------
 1471|     27|    len = (len / ts) * ts;
 1472|   106k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 93.7k, False: 12.6k]
  ------------------
 1473|  93.7k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  93.7k|  }
 1475|  12.6k|  return 0;
 1476|  12.6k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  4.24k|int ValueType<T>::read(const std::string& buf) {
 1480|  4.24k|  std::istringstream is(buf);
 1481|  4.24k|  T tmp;
 1482|  4.24k|  ValueList val;
 1483|  11.6k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 7.42k, False: 4.24k]
  ------------------
 1484|  7.42k|    val.push_back(tmp);
 1485|  4.24k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 4.24k]
  ------------------
 1486|      0|    return 1;
 1487|  4.24k|  value_ = std::move(val);
 1488|  4.24k|  return 0;
 1489|  4.24k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    707|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    707|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 366, False: 341]
  ------------------
 1651|    366|    pDataArea_ = Blob(buf, buf + len);
 1652|    341|  else
 1653|    341|    pDataArea_.clear();
 1654|    707|  return 0;
 1655|    707|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  7.00k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  7.00k|  size_t offset = 0;
 1494|   134k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 134k, False: 7.00k]
  ------------------
 1495|   134k|    offset += toData(buf + offset, val, byteOrder);
 1496|   134k|  }
 1497|  7.00k|  return offset;
 1498|  7.00k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  40.9k|size_t ValueType<T>::count() const {
 1502|  40.9k|  return value_.size();
 1503|  40.9k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  24.9k|size_t ValueType<T>::size() const {
 1507|  24.9k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  24.9k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    531|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    531|  auto end = value_.end();
 1518|    531|  auto i = value_.begin();
 1519|  3.10k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 2.57k, False: 531]
  ------------------
 1520|  2.57k|    os << std::setprecision(15) << *i;
 1521|  2.57k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 2.25k, False: 320]
  ------------------
 1522|  2.25k|      os << " ";
 1523|  2.57k|  }
 1524|    531|  return os;
 1525|    531|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  3.37k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  3.37k|  ok_ = true;
 1537|  3.37k|  return static_cast<int64_t>(value_.at(n));
 1538|  3.37k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  67.3k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  67.3k|  ok_ = true;
 1542|  67.3k|  return static_cast<uint32_t>(value_.at(n));
 1543|  67.3k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.58k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.58k|  return pDataArea_.size();
 1641|  1.58k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    386|DataBuf ValueType<T>::dataArea() const {
 1645|    386|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    386|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  40.9k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  40.9k|  return new ValueType<T>(*this);
 1513|  40.9k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  40.9k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  40.9k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 600, False: 40.3k]
  ------------------
 1449|    600|    pDataArea_ = rhs.pDataArea_;
 1450|  40.9k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  25.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  25.7k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  25.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  25.7k|  value_.clear();
 1469|  25.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  25.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 25.7k, False: 0]
  |  Branch (1470:17): [True: 80, False: 25.6k]
  ------------------
 1471|     80|    len = (len / ts) * ts;
 1472|   643k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 617k, False: 25.7k]
  ------------------
 1473|   617k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   617k|  }
 1475|  25.7k|  return 0;
 1476|  25.7k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    846|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    846|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 511, False: 335]
  ------------------
 1651|    511|    pDataArea_ = Blob(buf, buf + len);
 1652|    335|  else
 1653|    335|    pDataArea_.clear();
 1654|    846|  return 0;
 1655|    846|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  20.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  20.3k|  size_t offset = 0;
 1494|   467k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 467k, False: 20.3k]
  ------------------
 1495|   467k|    offset += toData(buf + offset, val, byteOrder);
 1496|   467k|  }
 1497|  20.3k|  return offset;
 1498|  20.3k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  79.8k|size_t ValueType<T>::count() const {
 1502|  79.8k|  return value_.size();
 1503|  79.8k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   145k|size_t ValueType<T>::size() const {
 1507|   145k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   145k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    374|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    374|  auto end = value_.end();
 1518|    374|  auto i = value_.begin();
 1519|   216k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 216k, False: 374]
  ------------------
 1520|   216k|    os << std::setprecision(15) << *i;
 1521|   216k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 215k, False: 278]
  ------------------
 1522|   215k|      os << " ";
 1523|   216k|  }
 1524|    374|  return os;
 1525|    374|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  6.49k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  6.49k|  ok_ = true;
 1537|  6.49k|  return static_cast<int64_t>(value_.at(n));
 1538|  6.49k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  12.0k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  12.0k|  ok_ = true;
 1542|  12.0k|  return static_cast<uint32_t>(value_.at(n));
 1543|  12.0k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  3.74k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.74k|  return pDataArea_.size();
 1641|  3.74k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    485|DataBuf ValueType<T>::dataArea() const {
 1645|    485|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    485|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|  80.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  80.1k|  return new ValueType<T>(*this);
 1513|  80.1k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|  80.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  80.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.13k, False: 79.0k]
  ------------------
 1449|  1.13k|    pDataArea_ = rhs.pDataArea_;
 1450|  80.1k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  10.1k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  10.1k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  10.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  10.1k|  value_.clear();
 1469|  10.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  10.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 10.1k, False: 0]
  |  Branch (1470:17): [True: 0, False: 10.1k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   233k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 223k, False: 10.1k]
  ------------------
 1473|   223k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   223k|  }
 1475|  10.1k|  return 0;
 1476|  10.1k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    877|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    877|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 721, False: 156]
  ------------------
 1651|    721|    pDataArea_ = Blob(buf, buf + len);
 1652|    156|  else
 1653|    156|    pDataArea_.clear();
 1654|    877|  return 0;
 1655|    877|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  7.13k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  7.13k|  size_t offset = 0;
 1494|   133k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 133k, False: 7.13k]
  ------------------
 1495|   133k|    offset += toData(buf + offset, val, byteOrder);
 1496|   133k|  }
 1497|  7.13k|  return offset;
 1498|  7.13k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  23.6k|size_t ValueType<T>::count() const {
 1502|  23.6k|  return value_.size();
 1503|  23.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  19.6k|size_t ValueType<T>::size() const {
 1507|  19.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  19.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    902|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    902|  auto end = value_.end();
 1518|    902|  auto i = value_.begin();
 1519|  5.05k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.15k, False: 902]
  ------------------
 1520|  4.15k|    os << std::setprecision(15) << *i;
 1521|  4.15k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.47k, False: 681]
  ------------------
 1522|  3.47k|      os << " ";
 1523|  4.15k|  }
 1524|    902|  return os;
 1525|    902|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  1.50k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.50k|  return pDataArea_.size();
 1641|  1.50k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     84|DataBuf ValueType<T>::dataArea() const {
 1645|     84|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     84|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  30.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  30.2k|  return new ValueType<T>(*this);
 1513|  30.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  30.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  30.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.16k, False: 29.1k]
  ------------------
 1449|  1.16k|    pDataArea_ = rhs.pDataArea_;
 1450|  30.2k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  7.02k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.02k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  7.02k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  7.02k|  value_.clear();
 1469|  7.02k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  7.02k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 7.02k, False: 0]
  |  Branch (1470:17): [True: 0, False: 7.02k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  50.6k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 43.6k, False: 7.02k]
  ------------------
 1473|  43.6k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  43.6k|  }
 1475|  7.02k|  return 0;
 1476|  7.02k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.51k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.51k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.30k, False: 205]
  ------------------
 1651|  1.30k|    pDataArea_ = Blob(buf, buf + len);
 1652|    205|  else
 1653|    205|    pDataArea_.clear();
 1654|  1.51k|  return 0;
 1655|  1.51k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  4.50k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  4.50k|  size_t offset = 0;
 1494|  32.7k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 32.7k, False: 4.50k]
  ------------------
 1495|  32.7k|    offset += toData(buf + offset, val, byteOrder);
 1496|  32.7k|  }
 1497|  4.50k|  return offset;
 1498|  4.50k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  29.4k|size_t ValueType<T>::count() const {
 1502|  29.4k|  return value_.size();
 1503|  29.4k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  11.6k|size_t ValueType<T>::size() const {
 1507|  11.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  11.6k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    454|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    454|  auto end = value_.end();
 1518|    454|  auto i = value_.begin();
 1519|  69.4k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 68.9k, False: 454]
  ------------------
 1520|  68.9k|    os << std::setprecision(15) << *i;
 1521|  68.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 68.5k, False: 384]
  ------------------
 1522|  68.5k|      os << " ";
 1523|  68.9k|  }
 1524|    454|  return os;
 1525|    454|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  5.00k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.00k|  return pDataArea_.size();
 1641|  5.00k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    270|DataBuf ValueType<T>::dataArea() const {
 1645|    270|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    270|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  23.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  23.8k|  return new ValueType<T>(*this);
 1513|  23.8k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 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.85k, False: 22.0k]
  ------------------
 1449|  1.85k|    pDataArea_ = rhs.pDataArea_;
 1450|  23.8k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  11.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.3k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  11.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  11.3k|  value_.clear();
 1469|  11.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  11.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 11.3k, False: 0]
  |  Branch (1470:17): [True: 0, False: 11.3k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   352k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 341k, False: 11.3k]
  ------------------
 1473|   341k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   341k|  }
 1475|  11.3k|  return 0;
 1476|  11.3k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    738|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    738|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 559, False: 179]
  ------------------
 1651|    559|    pDataArea_ = Blob(buf, buf + len);
 1652|    179|  else
 1653|    179|    pDataArea_.clear();
 1654|    738|  return 0;
 1655|    738|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  6.34k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.34k|  size_t offset = 0;
 1494|   338k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 338k, False: 6.34k]
  ------------------
 1495|   338k|    offset += toData(buf + offset, val, byteOrder);
 1496|   338k|  }
 1497|  6.34k|  return offset;
 1498|  6.34k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  32.0k|size_t ValueType<T>::count() const {
 1502|  32.0k|  return value_.size();
 1503|  32.0k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  20.6k|size_t ValueType<T>::size() const {
 1507|  20.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  20.6k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    300|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    300|  auto end = value_.end();
 1518|    300|  auto i = value_.begin();
 1519|  1.10k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 808, False: 300]
  ------------------
 1520|    808|    os << std::setprecision(15) << *i;
 1521|    808|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 584, False: 224]
  ------------------
 1522|    584|      os << " ";
 1523|    808|  }
 1524|    300|  return os;
 1525|    300|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  6.04k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.04k|  return pDataArea_.size();
 1641|  6.04k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    913|DataBuf ValueType<T>::dataArea() const {
 1645|    913|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    913|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  35.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  35.5k|  return new ValueType<T>(*this);
 1513|  35.5k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  35.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  35.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.41k, False: 34.1k]
  ------------------
 1449|  1.41k|    pDataArea_ = rhs.pDataArea_;
 1450|  35.5k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   163k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  3.40k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  3.40k|}

_ZNK5Exiv27XmpData9usePacketEv:
  215|  19.3k|  [[nodiscard]] bool usePacket() const {
  216|  19.3k|    return usePacket_;
  217|  19.3k|  }
_ZN5Exiv27XmpData9usePacketEb:
  220|  15.2k|  bool usePacket(bool b) {
  221|  15.2k|    bool r = usePacket_;
  222|  15.2k|    usePacket_ = b;
  223|  15.2k|    return r;
  224|  15.2k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  226|  9.38k|  void setPacket(std::string xmpPacket) {
  227|  9.38k|    xmpPacket_ = std::move(xmpPacket);
  228|  9.38k|    usePacket(false);
  229|  9.38k|  }
_ZN5Exiv27XmpDataC2Ev:
  139|  42.1k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  366|  22.1k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|  22.1k|    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  22.1k|  return *this;
  376|  22.1k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  366|  86.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|  86.6k|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  86.6k|  return *this;
  376|  86.6k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  366|   176k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|   176k|    setValue(Exiv2::toString(value));
  375|   176k|  return *this;
  376|   176k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  366|  13.5k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  13.5k|    setValue(Exiv2::toString(value));
  375|  13.5k|  return *this;
  376|  13.5k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  366|  31.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  31.4k|    setValue(Exiv2::toString(value));
  375|  31.4k|  return *this;
  376|  31.4k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  366|  4.54k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  4.54k|    setValue(Exiv2::toString(value));
  375|  4.54k|  return *this;
  376|  4.54k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  366|  1.09k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|  1.09k|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  1.09k|  return *this;
  376|  1.09k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  366|  2.55k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  2.55k|    setValue(Exiv2::toString(value));
  375|  2.55k|  return *this;
  376|  2.55k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  366|  3.21k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  3.21k|    setValue(Exiv2::toString(value));
  375|  3.21k|  return *this;
  376|  3.21k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  366|    544|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|    544|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|    544|  return *this;
  376|    544|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  366|   111k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|   111k|    setValue(Exiv2::toString(value));
  375|   111k|  return *this;
  376|   111k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  366|  2.41k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|  2.41k|    setValue(Exiv2::toString(value));
  375|  2.41k|  return *this;
  376|  2.41k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  366|   178k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|   178k|    setValue(Exiv2::toString(value));
  375|   178k|  return *this;
  376|   178k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  366|  33.3k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|  33.3k|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  33.3k|  return *this;
  376|  33.3k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  366|   190k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|       |    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|   190k|    setValue(Exiv2::toString(value));
  375|   190k|  return *this;
  376|   190k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  366|     13|Xmpdatum& Xmpdatum::operator=(const T& value) {
  367|       |  if constexpr (std::is_same_v<T, bool>)
  368|       |    setValue(value ? "True" : "False");
  369|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  370|     13|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|     13|  return *this;
  376|     13|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  9.31k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  9.31k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 3.28k, False: 6.02k]
  |  Branch (43:36): [True: 3.27k, False: 13]
  |  Branch (43:62): [True: 3.26k, False: 11]
  |  Branch (43:88): [True: 3.25k, False: 7]
  ------------------
   44|  9.31k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  15.7k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  15.7k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  15.7k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  15.7k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  15.7k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  15.7k|}
_ZNK5Exiv28AsfVideo7GUIDTag9to_stringEv:
   53|    382|std::string AsfVideo::GUIDTag::to_string() const {
   54|       |  // Concatenate all strings into a single string
   55|       |  // Convert the string to uppercase
   56|       |  // Example of output 399595EC-8667-4E2D-8FDB-98814CE76C1E
   57|    382|  return stringFormat("{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}", data1_, data2_, data3_,
  ------------------
  |  |   18|    382|#define stringFormat std::format
  ------------------
   58|    382|                      data4_[0], data4_[1], data4_[2], data4_[3], data4_[4], data4_[5], data4_[6], data4_[7]);
   59|    382|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  42.1k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  42.1k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 31.5k, False: 10.5k]
  ------------------
   63|  31.5k|    return data1_ < other.data1_;
   64|  10.5k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 231, False: 10.3k]
  ------------------
   65|    231|    return data2_ < other.data2_;
   66|  10.3k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 470, False: 9.88k]
  ------------------
   67|    470|    return data3_ < other.data3_;
   68|  9.88k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  10.3k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  182|  1.08k|AsfVideo::AsfVideo(BasicIo::UniquePtr io) : Image(ImageType::asf, mdNone, std::move(io)) {
  183|  1.08k|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  185|  1.08k|std::string AsfVideo::mimeType() const {
  186|  1.08k|  return "video/asf";
  187|  1.08k|}
_ZN5Exiv28AsfVideo13writeMetadataEv:
  189|      4|void AsfVideo::writeMetadata() {
  190|      4|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  192|  1.08k|void AsfVideo::readMetadata() {
  193|  1.08k|  if (io_->open() != 0)
  ------------------
  |  Branch (193:7): [True: 0, False: 1.08k]
  ------------------
  194|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  195|       |
  196|       |  // Ensure that this is the correct image type
  197|  1.08k|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (197:7): [True: 0, False: 1.08k]
  ------------------
  198|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  |  Branch (198:25): [True: 0, False: 0]
  ------------------
  199|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  200|      0|    throw Error(ErrorCode::kerNotAnImage, "ASF");
  201|      0|  }
  202|       |
  203|  1.08k|  IoCloser closer(*io_);
  204|  1.08k|  clearMetadata();
  205|  1.08k|  io_->seek(0, BasicIo::beg);
  206|  1.08k|  height_ = width_ = 1;
  207|       |
  208|  1.08k|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  209|  1.08k|  xmpData()["Xmp.video.MimeType"] = mimeType();
  210|       |
  211|  1.08k|  decodeBlock();
  212|       |
  213|  1.08k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  214|  1.08k|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  216|  5.81k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  217|  5.81k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (217:7): [True: 5.81k, False: 0]
  ------------------
  218|  5.81k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  219|       |
  220|  5.81k|    size_ = readQWORDTag(io);
  221|  5.81k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (221:9): [True: 4.43k, False: 1.38k]
  ------------------
  222|  4.43k|      remaining_size_ = size_ - GUID - QWORD;
  223|  5.81k|  }
  224|  5.81k|}
_ZN5Exiv28AsfVideo11decodeBlockEv:
  226|  5.86k|void AsfVideo::decodeBlock() {
  227|  5.86k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  228|  5.86k|  HeaderReader objectHeader(io_);
  229|       |#ifdef EXIV2_DEBUG_MESSAGES
  230|       |  EXV_INFO << "decodeBlock = " << GUIDTag(objectHeader.getId().data()).to_string()
  231|       |           << "\tsize= " << objectHeader.getSize() << "\t " << io_->tell() << "/" << io_->size() << '\n';
  232|       |#endif
  233|  5.86k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  234|  5.86k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  235|       |
  236|  5.86k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (236:7): [True: 3.97k, False: 1.88k]
  ------------------
  237|  3.97k|    if (tag->second == "Header")
  ------------------
  |  Branch (237:9): [True: 1.28k, False: 2.69k]
  ------------------
  238|  1.28k|      decodeHeader();
  239|  2.69k|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (239:14): [True: 393, False: 2.30k]
  ------------------
  240|    393|      fileProperties();
  241|  2.30k|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (241:14): [True: 444, False: 1.85k]
  ------------------
  242|    444|      streamProperties();
  243|  1.85k|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (243:14): [True: 306, False: 1.55k]
  ------------------
  244|    306|      headerExtension();
  245|  1.55k|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (245:14): [True: 242, False: 1.30k]
  ------------------
  246|    242|      codecList();
  247|  1.30k|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (247:14): [True: 611, False: 697]
  ------------------
  248|    611|      extendedContentDescription();
  249|    697|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (249:14): [True: 414, False: 283]
  ------------------
  250|    414|      contentDescription();
  251|    283|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (251:14): [True: 84, False: 199]
  ------------------
  252|     84|      extendedStreamProperties();
  253|    199|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (253:14): [True: 0, False: 199]
  ------------------
  254|      0|      DegradableJPEGMedia();
  255|    199|    else {  // tag found but not processed
  256|       |      // Make sure that the remaining size is non-zero, so that we won't
  257|       |      // keep revisiting the same location in the file.
  258|    199|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  259|    199|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  260|    199|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  261|    199|    }
  262|  3.97k|  } else {  // tag not found
  263|       |    // Make sure that the remaining size is non-zero, so that we won't keep
  264|       |    // revisiting the same location in the file.
  265|  1.88k|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  266|  1.88k|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  267|  1.88k|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  268|  1.88k|  }
  269|       |
  270|  5.86k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEv:
  272|  1.28k|void AsfVideo::decodeHeader() {
  273|  1.28k|  DataBuf nbHeadersBuf(DWORD + 1);
  274|  1.28k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|       |
  276|  1.28k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  277|  1.28k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  278|  1.28k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  279|  1.28k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  280|  6.06k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (280:24): [True: 4.78k, False: 1.28k]
  ------------------
  281|  4.78k|    decodeBlock();
  282|  4.78k|  }
  283|  1.28k|}
_ZN5Exiv28AsfVideo24extendedStreamPropertiesEv:
  285|     84|void AsfVideo::extendedStreamProperties() {
  286|     84|  xmpData()["Xmp.video.StartTimecode"] = readQWORDTag(io_);  // Start Time
  287|     84|  xmpData()["Xmp.video.EndTimecode"] = readWORDTag(io_);     // End Time
  288|       |
  289|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Data Bitrate
  290|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Buffer Size
  291|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Initial Buffer Fullness
  292|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Data Bitrate
  293|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Buffer Size
  294|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Initial Buffer Fullness
  295|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Maximum Object Size
  296|     84|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Flags Buffer Size
  297|     84|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Flags Stream Number
  298|     84|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Stream Language ID Index
  299|       |
  300|     84|  xmpData()["Xmp.video.FrameRate"] = readWORDTag(io_);  // Average Time Per Frame
  301|     84|  uint16_t stream_name_count = readWORDTag(io_);
  302|     84|  uint16_t payload_ext_sys_count = readWORDTag(io_);
  303|       |
  304|  1.11k|  for (uint16_t i = 0; i < stream_name_count; i++) {
  ------------------
  |  Branch (304:24): [True: 1.03k, False: 84]
  ------------------
  305|  1.03k|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Language ID Index
  306|  1.03k|    uint16_t stream_length = readWORDTag(io_);
  307|  1.03k|    if (stream_length)
  ------------------
  |  Branch (307:9): [True: 639, False: 394]
  ------------------
  308|    639|      io_->seek(io_->tell() + stream_length, BasicIo::beg);  // ignore Stream name
  309|  1.03k|  }
  310|       |
  311|    770|  for (uint16_t i = 0; i < payload_ext_sys_count; i++) {
  ------------------
  |  Branch (311:24): [True: 686, False: 84]
  ------------------
  312|    686|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Extension System ID
  313|    686|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Extension Data Size
  314|    686|    uint16_t ext_sys_info_length = readWORDTag(io_);
  315|    686|    if (ext_sys_info_length)
  ------------------
  |  Branch (315:9): [True: 391, False: 295]
  ------------------
  316|    391|      io_->seek(io_->tell() + ext_sys_info_length, BasicIo::beg);  // ignore Extension System Info
  317|    686|  }
  318|     84|}  // AsfVideo::extendedStreamProperties
_ZN5Exiv28AsfVideo16streamPropertiesEv:
  335|    444|void AsfVideo::streamProperties() {
  336|    444|  DataBuf streamTypedBuf(GUID);
  337|    444|  io_->readOrThrow(streamTypedBuf.data(), streamTypedBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  338|       |
  339|    444|  enum class streamTypeInfo { Audio = 1, Video = 2 };
  340|    444|  auto stream = streamTypeInfo{0};
  341|       |
  342|    444|  auto tag_stream_type = GUIDReferenceTags.find(GUIDTag(streamTypedBuf.data()));
  343|    444|  if (tag_stream_type != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (343:7): [True: 65, False: 379]
  ------------------
  344|     65|    if (tag_stream_type->second == "Audio_Media")
  ------------------
  |  Branch (344:9): [True: 3, False: 62]
  ------------------
  345|      3|      stream = streamTypeInfo::Audio;
  346|     62|    else if (tag_stream_type->second == "Video_Media")
  ------------------
  |  Branch (346:14): [True: 22, False: 40]
  ------------------
  347|     22|      stream = streamTypeInfo::Video;
  348|       |
  349|     65|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Error Correction Type
  350|       |
  351|     65|    uint64_t time_offset = readQWORDTag(io_);
  352|     65|    if (stream == streamTypeInfo::Video)
  ------------------
  |  Branch (352:9): [True: 22, False: 43]
  ------------------
  353|     22|      xmpData()["Xmp.video.TimeOffset"] = time_offset;
  354|     43|    else if (stream == streamTypeInfo::Audio)
  ------------------
  |  Branch (354:14): [True: 3, False: 40]
  ------------------
  355|      3|      xmpData()["Xmp.audio.TimeOffset"] = time_offset;
  356|       |
  357|     65|    auto specific_data_length = readDWORDTag(io_);
  358|     65|    auto correction_data_length = readDWORDTag(io_);
  359|       |
  360|     65|    io_->seek(io_->tell() + WORD /*Flags*/ + DWORD /*Reserved*/ + specific_data_length + correction_data_length,
  361|     65|              BasicIo::beg);
  362|     65|  }
  363|       |
  364|    444|}  // AsfVideo::streamProperties
_ZN5Exiv28AsfVideo9codecListEv:
  366|    242|void AsfVideo::codecList() {
  367|    242|  io_->seek(io_->tell() + GUID /*reserved*/, BasicIo::beg);
  368|    242|  auto entries_count = readDWORDTag(io_);
  369|  1.55k|  for (uint32_t i = 0; i < entries_count; i++) {
  ------------------
  |  Branch (369:24): [True: 1.31k, False: 242]
  ------------------
  370|  1.31k|    uint16_t codec_type = readWORDTag(io_) * 2;
  371|  1.31k|    std::string codec = (codec_type == 1) ? "Xmp.video" : "Xmp.audio";
  ------------------
  |  Branch (371:25): [True: 0, False: 1.31k]
  ------------------
  372|       |
  373|  1.31k|    if (uint16_t codec_name_length = readWORDTag(io_) * 2)
  ------------------
  |  Branch (373:18): [True: 926, False: 391]
  ------------------
  374|    926|      xmpData()[codec + std::string(".CodecName")] = readStringWcharTag(io_, codec_name_length);
  375|       |
  376|  1.31k|    if (uint16_t codec_desc_length = readWORDTag(io_))
  ------------------
  |  Branch (376:18): [True: 995, False: 322]
  ------------------
  377|    995|      xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
  378|       |
  379|  1.31k|    uint16_t codec_info_length = readWORDTag(io_);
  380|  1.31k|    Internal::enforce(codec_info_length && codec_info_length < io_->size() - io_->tell(),
  ------------------
  |  Branch (380:23): [True: 1.15k, False: 163]
  |  Branch (380:44): [True: 1.10k, False: 46]
  ------------------
  381|  1.31k|                      Exiv2::ErrorCode::kerCorruptedMetadata);
  382|  1.31k|    xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
  383|  1.31k|  }
  384|    242|}  // AsfVideo::codecList
_ZNK5Exiv28AsfVideo15headerExtensionEv:
  386|    306|void AsfVideo::headerExtension() const {
  387|    306|  io_->seek(io_->tell() + GUID /*reserved1*/ + WORD /*Reserved2*/, BasicIo::beg);
  388|    306|  auto header_ext_data_length = readDWORDTag(io_);
  389|    306|  io_->seek(io_->tell() + header_ext_data_length, BasicIo::beg);
  390|    306|}  // AsfVideo::headerExtension
_ZN5Exiv28AsfVideo26extendedContentDescriptionEv:
  392|    611|void AsfVideo::extendedContentDescription() {
  393|    611|  uint16_t content_descriptor_count = readWORDTag(io_);
  394|    611|  std::string value;
  395|       |
  396|  48.1k|  for (uint16_t i = 0; i < content_descriptor_count; i++) {
  ------------------
  |  Branch (396:24): [True: 47.6k, False: 551]
  ------------------
  397|  47.6k|    if (uint16_t descriptor_name_length = readWORDTag(io_))
  ------------------
  |  Branch (397:18): [True: 21.7k, False: 25.8k]
  ------------------
  398|  21.7k|      value += readStringWcharTag(io_, descriptor_name_length);  // Descriptor Name
  399|       |
  400|  47.6k|    uint16_t descriptor_value_data_type = readWORDTag(io_);
  401|  47.6k|    if (uint16_t descriptor_value_length = readWORDTag(io_)) {
  ------------------
  |  Branch (401:18): [True: 24.0k, False: 23.5k]
  ------------------
  402|       |      // Descriptor Value
  403|  24.0k|      switch (descriptor_value_data_type) {
  ------------------
  |  Branch (403:15): [True: 4.76k, False: 19.3k]
  ------------------
  404|  2.43k|        case 0 /*Unicode string */:
  ------------------
  |  Branch (404:9): [True: 2.43k, False: 21.6k]
  ------------------
  405|  2.43k|          value += std::string(": ") + readStringWcharTag(io_, descriptor_value_length);
  406|  2.43k|          break;
  407|    102|        case 1 /*BYTE array  */:
  ------------------
  |  Branch (407:9): [True: 102, False: 23.9k]
  ------------------
  408|    102|          value += std::string(": ") + readStringTag(io_, descriptor_value_length);
  409|    102|          break;
  410|    382|        case 2 /*BOOL*/:
  ------------------
  |  Branch (410:9): [True: 382, False: 23.6k]
  ------------------
  411|    382|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  412|    382|          break;
  413|    162|        case 3 /*DWORD */:
  ------------------
  |  Branch (413:9): [True: 162, False: 23.9k]
  ------------------
  414|    162|          value += std::string(": ") + std::to_string(readDWORDTag(io_));
  415|    162|          break;
  416|    259|        case 4 /*QWORD */:
  ------------------
  |  Branch (416:9): [True: 259, False: 23.8k]
  ------------------
  417|    259|          value += std::string(": ") + std::to_string(readQWORDTag(io_));
  418|    259|          break;
  419|  1.43k|        case 5 /*WORD*/:
  ------------------
  |  Branch (419:9): [True: 1.43k, False: 22.6k]
  ------------------
  420|  1.43k|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  421|  1.43k|          break;
  422|  24.0k|      }
  423|  24.0k|    }
  424|  47.5k|    value += std::string(", ");
  425|  47.5k|  }
  426|       |
  427|    551|  xmpData()["Xmp.video.ExtendedContentDescription"] = value;
  428|    551|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  430|    414|void AsfVideo::contentDescription() {
  431|    414|  uint16_t title_length = readWORDTag(io_);
  432|    414|  uint16_t author_length = readWORDTag(io_);
  433|    414|  uint16_t copyright_length = readWORDTag(io_);
  434|    414|  uint16_t desc_length = readWORDTag(io_);
  435|    414|  uint16_t rating_length = readWORDTag(io_);
  436|       |
  437|    414|  if (title_length)
  ------------------
  |  Branch (437:7): [True: 274, False: 140]
  ------------------
  438|    274|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  439|       |
  440|    414|  if (author_length)
  ------------------
  |  Branch (440:7): [True: 141, False: 273]
  ------------------
  441|    141|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  442|       |
  443|    414|  if (copyright_length)
  ------------------
  |  Branch (443:7): [True: 59, False: 355]
  ------------------
  444|     59|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  445|       |
  446|    414|  if (desc_length)
  ------------------
  |  Branch (446:7): [True: 128, False: 286]
  ------------------
  447|    128|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  448|       |
  449|    414|  if (rating_length)
  ------------------
  |  Branch (449:7): [True: 115, False: 299]
  ------------------
  450|    115|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  451|       |
  452|    414|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo14filePropertiesEv:
  454|    393|void AsfVideo::fileProperties() {
  455|    393|  DataBuf FileIddBuf(GUID);
  456|    393|  io_->readOrThrow(FileIddBuf.data(), FileIddBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  457|    393|  xmpData()["Xmp.video.FileID"] = GUIDTag(FileIddBuf.data()).to_string();
  458|    393|  xmpData()["Xmp.video.FileLength"] = readQWORDTag(io_);
  459|    393|  xmpData()["Xmp.video.CreationDate"] = readQWORDTag(io_);
  460|    393|  xmpData()["Xmp.video.DataPackets"] = readQWORDTag(io_);
  461|    393|  xmpData()["Xmp.video.duration"] = readQWORDTag(io_);
  462|    393|  xmpData()["Xmp.video.SendDuration"] = readQWORDTag(io_);
  463|    393|  xmpData()["Xmp.video.Preroll"] = readQWORDTag(io_);
  464|       |
  465|    393|  io_->seek(io_->tell() + DWORD + DWORD + DWORD,
  466|    393|            BasicIo::beg);  // ignore Flags, Minimum Data Packet Size and Maximum Data Packet Size
  467|    393|  xmpData()["Xmp.video.MaxBitRate"] = readDWORDTag(io_);
  468|    393|}  // AsfVideo::fileProperties
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  470|  1.08k|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, bool /*create*/) {
  471|  1.08k|  auto image = std::make_unique<AsfVideo>(std::move(io));
  472|  1.08k|  if (!image->good()) {
  ------------------
  |  Branch (472:7): [True: 0, False: 1.08k]
  ------------------
  473|      0|    return nullptr;
  474|      0|  }
  475|  1.08k|  return image;
  476|  1.08k|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  478|  9.66k|bool isAsfType(BasicIo& iIo, bool advance) {
  479|  9.66k|  byte buf[GUID];
  480|  9.66k|  iIo.read(buf, GUID);
  481|       |
  482|  9.66k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (482:7): [True: 0, False: 9.66k]
  |  Branch (482:22): [True: 342, False: 9.31k]
  ------------------
  483|    342|    return false;
  484|    342|  }
  485|       |
  486|  9.31k|  bool matched = isASFType(buf);
  487|  9.31k|  if (!advance || !matched) {
  ------------------
  |  Branch (487:7): [True: 9.31k, False: 0]
  |  Branch (487:19): [True: 0, False: 0]
  ------------------
  488|  9.31k|    iIo.seek(0, BasicIo::beg);
  489|  9.31k|  }
  490|       |
  491|  9.31k|  return matched;
  492|  9.66k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  9.31k|static bool isASFType(const byte buf[]) {
  179|  9.31k|  return Header == AsfVideo::GUIDTag(buf);
  180|  9.31k|}

_ZN5Exiv27BasicIoD2Ev:
   53|  68.8k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   55|  3.56M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   56|  3.56M|  const size_t nread = read(buf, rcount);
   57|  3.56M|  Internal::enforce(nread == rcount, err);
   58|  3.56M|  Internal::enforce(!error(), err);
   59|  3.56M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   61|  16.5k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   62|  16.5k|  const int r = seek(offset, pos);
   63|  16.5k|  Internal::enforce(r == 0, err);
   64|  16.5k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  617|  33.9k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  618|  33.9k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  671|  5.92M|void MemIo::Impl::reserve(size_t wcount) {
  672|  5.92M|  const size_t need = wcount + idx_;
  673|  5.92M|  size_t blockSize = 32 * 1024;  // 32768
  674|  5.92M|  const size_t maxBlockSize = 4 * 1024 * 1024;
  675|       |
  676|  5.92M|  if (!isMalloced_) {
  ------------------
  |  Branch (676:7): [True: 25.2k, False: 5.90M]
  ------------------
  677|       |    // Minimum size for 1st block
  678|  25.2k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  679|  25.2k|    auto data = static_cast<byte*>(std::malloc(size));
  680|  25.2k|    if (!data) {
  ------------------
  |  Branch (680:9): [True: 0, False: 25.2k]
  ------------------
  681|      0|      throw Error(ErrorCode::kerMallocFailed);
  682|      0|    }
  683|  25.2k|    if (data_) {
  ------------------
  |  Branch (683:9): [True: 0, False: 25.2k]
  ------------------
  684|      0|      std::memcpy(data, data_, size_);
  685|      0|    }
  686|  25.2k|    data_ = data;
  687|  25.2k|    sizeAlloced_ = size;
  688|  25.2k|    isMalloced_ = true;
  689|  25.2k|  }
  690|       |
  691|  5.92M|  if (need > size_) {
  ------------------
  |  Branch (691:7): [True: 5.03M, False: 895k]
  ------------------
  692|  5.03M|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (692:9): [True: 16.6k, False: 5.01M]
  ------------------
  693|  16.6k|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  694|       |      // Allocate in blocks
  695|  16.6k|      size_t want = blockSize * (1 + need / blockSize);
  696|  16.6k|      data_ = static_cast<byte*>(std::realloc(data_, want));
  697|  16.6k|      if (!data_) {
  ------------------
  |  Branch (697:11): [True: 0, False: 16.6k]
  ------------------
  698|      0|        throw Error(ErrorCode::kerMallocFailed);
  699|      0|      }
  700|  16.6k|      sizeAlloced_ = want;
  701|  16.6k|    }
  702|  5.03M|    size_ = need;
  703|  5.03M|  }
  704|  5.92M|}
_ZN5Exiv25MemIoC2Ev:
  706|  34.9k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  707|  34.9k|}
_ZN5Exiv25MemIoC2EPKhm:
  709|  33.9k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  710|  33.9k|}
_ZN5Exiv25MemIoD2Ev:
  712|  68.8k|MemIo::~MemIo() {
  713|  68.8k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (713:7): [True: 24.9k, False: 43.8k]
  ------------------
  714|  24.9k|    std::free(p_->data_);
  715|  24.9k|  }
  716|  68.8k|}
_ZN5Exiv25MemIo5writeEPKhm:
  718|  5.89M|size_t MemIo::write(const byte* data, size_t wcount) {
  719|  5.89M|  p_->reserve(wcount);
  720|  5.89M|  if (data) {
  ------------------
  |  Branch (720:7): [True: 5.00M, False: 894k]
  ------------------
  721|  5.00M|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  722|  5.00M|  }
  723|  5.89M|  p_->idx_ += wcount;
  724|  5.89M|  return wcount;
  725|  5.89M|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  727|  17.3k|void MemIo::transfer(BasicIo& src) {
  728|  17.3k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (728:12): [True: 17.3k, False: 0]
  ------------------
  729|       |    // Optimization if src is another instance of MemIo
  730|  17.3k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (730:9): [True: 310, False: 17.0k]
  ------------------
  731|    310|      std::free(p_->data_);
  732|    310|    }
  733|  17.3k|    p_->idx_ = 0;
  734|  17.3k|    p_->data_ = memIo->p_->data_;
  735|  17.3k|    p_->size_ = memIo->p_->size_;
  736|  17.3k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  737|  17.3k|    memIo->p_->idx_ = 0;
  738|  17.3k|    memIo->p_->data_ = nullptr;
  739|  17.3k|    memIo->p_->size_ = 0;
  740|  17.3k|    memIo->p_->isMalloced_ = false;
  741|  17.3k|  } else {
  742|       |    // Generic reopen to reset position to start
  743|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (743:9): [True: 0, False: 0]
  ------------------
  744|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  745|      0|    }
  746|      0|    p_->idx_ = 0;
  747|      0|    write(src);
  748|      0|    src.close();
  749|      0|  }
  750|  17.3k|  if (error() || src.error())
  ------------------
  |  Branch (750:7): [True: 0, False: 17.3k]
  |  Branch (750:18): [True: 0, False: 17.3k]
  ------------------
  751|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  752|  17.3k|}
_ZN5Exiv25MemIo4putbEh:
  772|  29.9k|int MemIo::putb(byte data) {
  773|  29.9k|  p_->reserve(1);
  774|  29.9k|  p_->data_[p_->idx_++] = data;
  775|  29.9k|  return data;
  776|  29.9k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  778|  1.08M|int MemIo::seek(int64_t offset, Position pos) {
  779|  1.08M|  int64_t newIdx = 0;
  780|       |
  781|  1.08M|  switch (pos) {
  ------------------
  |  Branch (781:11): [True: 1.08M, False: 0]
  ------------------
  782|   736k|    case BasicIo::cur:
  ------------------
  |  Branch (782:5): [True: 736k, False: 343k]
  ------------------
  783|   736k|      newIdx = p_->idx_ + offset;
  784|   736k|      break;
  785|   343k|    case BasicIo::beg:
  ------------------
  |  Branch (785:5): [True: 343k, False: 736k]
  ------------------
  786|   343k|      newIdx = offset;
  787|   343k|      break;
  788|    206|    case BasicIo::end:
  ------------------
  |  Branch (788:5): [True: 206, False: 1.08M]
  ------------------
  789|    206|      newIdx = p_->size_ + offset;
  790|    206|      break;
  791|  1.08M|  }
  792|       |
  793|  1.08M|  if (newIdx < 0)
  ------------------
  |  Branch (793:7): [True: 0, False: 1.08M]
  ------------------
  794|      0|    return 1;
  795|       |
  796|  1.08M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (796:7): [True: 6.74k, False: 1.07M]
  ------------------
  797|  6.74k|    p_->eof_ = true;
  798|  6.74k|    return 1;
  799|  6.74k|  }
  800|       |
  801|  1.07M|  p_->idx_ = static_cast<size_t>(newIdx);
  802|  1.07M|  p_->eof_ = false;
  803|  1.07M|  return 0;
  804|  1.08M|}
_ZN5Exiv25MemIo4mmapEb:
  806|  50.2k|byte* MemIo::mmap(bool /*isWriteable*/) {
  807|  50.2k|  return p_->data_;
  808|  50.2k|}
_ZNK5Exiv25MemIo4tellEv:
  814|   876k|size_t MemIo::tell() const {
  815|   876k|  return p_->idx_;
  816|   876k|}
_ZNK5Exiv25MemIo4sizeEv:
  818|   637k|size_t MemIo::size() const {
  819|   637k|  return p_->size_;
  820|   637k|}
_ZN5Exiv25MemIo4openEv:
  822|   126k|int MemIo::open() {
  823|   126k|  p_->idx_ = 0;
  824|   126k|  p_->eof_ = false;
  825|   126k|  return 0;
  826|   126k|}
_ZNK5Exiv25MemIo6isopenEv:
  828|  98.1k|bool MemIo::isopen() const {
  829|  98.1k|  return true;
  830|  98.1k|}
_ZN5Exiv25MemIo5closeEv:
  832|  96.2k|int MemIo::close() {
  833|  96.2k|  return 0;
  834|  96.2k|}
_ZN5Exiv25MemIo4readEm:
  836|   222k|DataBuf MemIo::read(size_t rcount) {
  837|   222k|  DataBuf buf(rcount);
  838|   222k|  size_t readCount = read(buf.data(), buf.size());
  839|   222k|  buf.resize(readCount);
  840|   222k|  return buf;
  841|   222k|}
_ZN5Exiv25MemIo4readEPhm:
  843|  5.42M|size_t MemIo::read(byte* buf, size_t rcount) {
  844|  5.42M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  845|  5.42M|  const auto allow = std::min<size_t>(rcount, avail);
  846|  5.42M|  if (allow > 0) {
  ------------------
  |  Branch (846:7): [True: 5.09M, False: 328k]
  ------------------
  847|  5.09M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  848|  5.09M|  }
  849|  5.42M|  p_->idx_ += allow;
  850|  5.42M|  if (rcount > avail) {
  ------------------
  |  Branch (850:7): [True: 17.0k, False: 5.41M]
  ------------------
  851|  17.0k|    p_->eof_ = true;
  852|  17.0k|  }
  853|  5.42M|  return allow;
  854|  5.42M|}
_ZN5Exiv25MemIo4getbEv:
  856|  8.55M|int MemIo::getb() {
  857|  8.55M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (857:7): [True: 907, False: 8.55M]
  ------------------
  858|    907|    p_->eof_ = true;
  859|    907|    return EOF;
  860|    907|  }
  861|  8.55M|  return p_->data_[p_->idx_++];
  862|  8.55M|}
_ZNK5Exiv25MemIo5errorEv:
  864|  5.30M|int MemIo::error() const {
  865|  5.30M|  return 0;
  866|  5.30M|}
_ZNK5Exiv25MemIo3eofEv:
  868|  1.20M|bool MemIo::eof() const {
  869|  1.20M|  return p_->eof_;
  870|  1.20M|}
_ZNK5Exiv25MemIo4pathEv:
  872|  11.9k|const std::string& MemIo::path() const noexcept {
  873|  11.9k|  static std::string _path{"MemIo"};
  874|  11.9k|  return _path;
  875|  11.9k|}
_ZN5Exiv25MemIo16populateFakeDataEv:
  877|    246|void MemIo::populateFakeData() {
  878|    246|}
_ZN5Exiv25MemIo4ImplC2Ev:
  597|  34.9k|  Impl() = default;                     //!< Default constructor

_ZN5Exiv29BmffImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEbm:
   87|  2.27k|    Image(ImageType::bmff, mdExif | mdIptc | mdXmp, std::move(io)), max_box_depth_(max_box_depth) {
   88|  2.27k|}  // BmffImage::BmffImage
_ZN5Exiv29BmffImage7fullBoxEj:
  109|  38.8k|bool BmffImage::fullBox(uint32_t box) {
  110|  38.8k|  return box == TAG::meta || box == TAG::iinf || box == TAG::iloc || box == TAG::thmb || box == TAG::prvw;
  ------------------
  |  Branch (110:10): [True: 1.64k, False: 37.2k]
  |  Branch (110:30): [True: 513, False: 36.6k]
  |  Branch (110:50): [True: 1.29k, False: 35.4k]
  |  Branch (110:70): [True: 1.66k, False: 33.7k]
  |  Branch (110:90): [True: 188, False: 33.5k]
  ------------------
  111|  38.8k|}
_ZNK5Exiv29BmffImage10pixelWidthEv:
  151|     74|uint32_t BmffImage::pixelWidth() const {
  152|     74|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
  153|     74|  if (imageWidth == exifData_.end() || imageWidth->count() == 0)
  ------------------
  |  Branch (153:7): [True: 68, False: 6]
  |  Branch (153:7): [True: 71, False: 3]
  |  Branch (153:40): [True: 3, False: 3]
  ------------------
  154|     71|    return pixelWidth_;
  155|      3|  return imageWidth->toUint32();
  156|     74|}
_ZNK5Exiv29BmffImage11pixelHeightEv:
  158|     74|uint32_t BmffImage::pixelHeight() const {
  159|     74|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
  160|     74|  if (imageHeight == exifData_.end() || imageHeight->count() == 0)
  ------------------
  |  Branch (160:7): [True: 68, False: 6]
  |  Branch (160:7): [True: 71, False: 3]
  |  Branch (160:41): [True: 3, False: 3]
  ------------------
  161|     71|    return pixelHeight_;
  162|      3|  return imageHeight->toUint32();
  163|     74|}
_ZN5Exiv29BmffImage8uuidNameERKNS_7DataBufE:
  165|    833|std::string BmffImage::uuidName(const Exiv2::DataBuf& uuid) {
  166|    833|  const char* uuidCano = "\x85\xC0\xB6\x87\x82\xF\x11\xE0\x81\x11\xF4\xCE\x46\x2B\x6A\x48";
  167|    833|  const char* uuidXmp = "\xBE\x7A\xCF\xCB\x97\xA9\x42\xE8\x9C\x71\x99\x94\x91\xE3\xAF\xAC";
  168|    833|  const char* uuidCanp = "\xEA\xF4\x2B\x5E\x1C\x98\x4B\x88\xB9\xFB\xB7\xDC\x40\x6E\x4D\x16";
  169|    833|  if (uuid.cmpBytes(0, uuidCano, 16) == 0)
  ------------------
  |  Branch (169:7): [True: 7, False: 826]
  ------------------
  170|      7|    return "cano";
  171|    826|  if (uuid.cmpBytes(0, uuidXmp, 16) == 0)
  ------------------
  |  Branch (171:7): [True: 199, False: 627]
  ------------------
  172|    199|    return "xmp";
  173|    627|  if (uuid.cmpBytes(0, uuidCanp, 16) == 0)
  ------------------
  |  Branch (173:7): [True: 491, False: 136]
  ------------------
  174|    491|    return "canp";
  175|    136|  return "";
  176|    627|}
_ZN5Exiv29BmffImage16brotliUncompressEPKhmRNS_7DataBufE:
  184|    185|void BmffImage::brotliUncompress(const byte* compressedBuf, size_t compressedBufSize, DataBuf& arr) {
  185|    185|  auto decoder = BrotliDecoder(BrotliDecoderCreateInstance(nullptr, nullptr, nullptr), BrotliDecoderDestroyInstance);
  186|    185|  size_t uncompressedLen = compressedBufSize * 2;  // just a starting point
  187|    185|  BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
  188|    185|  int dos = 0;
  189|    185|  size_t available_in = compressedBufSize;
  190|    185|  const byte* next_in = compressedBuf;
  191|    185|  size_t available_out;
  192|    185|  byte* next_out;
  193|    185|  size_t total_out = 0;
  194|       |
  195|    622|  while (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (195:10): [True: 509, False: 113]
  ------------------
  196|    509|    arr.alloc(uncompressedLen);
  197|    509|    available_out = uncompressedLen - total_out;
  198|    509|    next_out = arr.data() + total_out;
  199|    509|    result =
  200|    509|        BrotliDecoderDecompressStream(decoder.get(), &available_in, &next_in, &available_out, &next_out, &total_out);
  201|    509|    if (result == BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (201:9): [True: 113, False: 396]
  ------------------
  202|    113|      arr.resize(total_out);
  203|    396|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
  ------------------
  |  Branch (203:16): [True: 354, False: 42]
  ------------------
  204|    354|      uncompressedLen *= 2;
  205|       |      // DoS protection - can't be bigger than 128k
  206|    354|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (206:11): [True: 69, False: 285]
  ------------------
  207|     69|        if (++dos > 1 || total_out > 131072)
  ------------------
  |  Branch (207:13): [True: 29, False: 40]
  |  Branch (207:26): [True: 1, False: 39]
  ------------------
  208|     30|          break;
  209|     39|        uncompressedLen = 131072;
  210|     39|      }
  211|    354|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
  ------------------
  |  Branch (211:16): [True: 18, False: 24]
  ------------------
  212|       |      // compressed input buffer in incomplete
  213|     18|      throw Error(ErrorCode::kerFailedToReadImageData);
  214|     24|    } else {
  215|       |      // something bad happened
  216|     24|      throw Error(ErrorCode::kerErrorMessage, BrotliDecoderErrorString(BrotliDecoderGetErrorCode(decoder.get())));
  217|     24|    }
  218|    509|  }
  219|       |
  220|    143|  if (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (220:7): [True: 30, False: 113]
  ------------------
  221|     30|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|     30|  }
  223|    143|}
_ZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmm:
  227|  40.0k|                               uint64_t pbox_end, size_t depth) {
  228|  40.0k|  const size_t address = io_->tell();
  229|       |  // never visit a box twice!
  230|  40.0k|  if (depth == 0)
  ------------------
  |  Branch (230:7): [True: 19.0k, False: 20.9k]
  ------------------
  231|  19.0k|    visits_.clear();
  232|  40.0k|  if (visits_.contains(address) || visits_.size() > visits_max_ || depth >= max_box_depth_) {
  ------------------
  |  Branch (232:7): [True: 0, False: 40.0k]
  |  Branch (232:36): [True: 61, False: 39.9k]
  |  Branch (232:68): [True: 1, False: 39.9k]
  ------------------
  233|     62|    throw Error(ErrorCode::kerCorruptedMetadata);
  234|     62|  }
  235|  39.9k|  visits_.insert(address);
  236|       |
  237|       |#ifdef EXIV2_DEBUG_MESSAGES
  238|       |  bool bTrace = true;
  239|       |#else
  240|  39.9k|  bool bTrace = option == kpsBasic || option == kpsRecursive;
  ------------------
  |  Branch (240:17): [True: 0, False: 39.9k]
  |  Branch (240:39): [True: 0, False: 39.9k]
  ------------------
  241|  39.9k|#endif
  242|       |
  243|       |  // 8-byte buffer for parsing the box length and type.
  244|  39.9k|  byte hdrbuf[2 * sizeof(uint32_t)];
  245|       |
  246|  39.9k|  size_t hdrsize = sizeof(hdrbuf);
  247|  39.9k|  Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  248|  39.9k|  if (io_->read(hdrbuf, sizeof(hdrbuf)) != sizeof(hdrbuf))
  ------------------
  |  Branch (248:7): [True: 0, False: 39.9k]
  ------------------
  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|  39.9k|  uint64_t box_length = getULong(&hdrbuf[0], endian_);
  254|  39.9k|  uint32_t box_type = getULong(&hdrbuf[sizeof(uint32_t)], endian_);
  255|  39.9k|  bool bLF = true;
  256|       |
  257|  39.9k|  if (bTrace) {
  ------------------
  |  Branch (257:7): [True: 0, False: 39.9k]
  ------------------
  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|  39.9k|  if (box_length == 1) {
  ------------------
  |  Branch (263:7): [True: 216, False: 39.7k]
  ------------------
  264|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  265|    216|    hdrsize += 8;
  266|    216|    Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  267|    216|    DataBuf data(8);
  268|    216|    io_->read(data.data(), data.size());
  269|    216|    box_length = data.read_uint64(0, endian_);
  270|    216|  }
  271|       |
  272|  39.9k|  if (box_length == 0) {
  ------------------
  |  Branch (272:7): [True: 18.6k, False: 21.2k]
  ------------------
  273|       |    // Zero length is also valid and indicates box extends to the end of file.
  274|  18.6k|    box_length = pbox_end - address;
  275|  18.6k|  }
  276|       |
  277|       |  // read data in box and restore file position
  278|  39.9k|  const size_t restore = io_->tell();
  279|  39.9k|  Internal::enforce(box_length >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  39.9k|  Internal::enforce(box_length - hdrsize <= pbox_end - restore, Exiv2::ErrorCode::kerCorruptedMetadata);
  281|       |
  282|  39.9k|  const auto buffer_size = box_length - hdrsize;
  283|  39.9k|  if (skipBox(box_type)) {
  ------------------
  |  Branch (283:7): [True: 357, False: 39.5k]
  ------------------
  284|    357|    if (bTrace) {
  ------------------
  |  Branch (284:9): [True: 0, False: 357]
  ------------------
  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|    357|    return restore + buffer_size;
  290|    357|  }
  291|       |
  292|  39.5k|  DataBuf data(static_cast<size_t>(buffer_size));
  293|  39.5k|  const size_t box_end = restore + data.size();
  294|  39.5k|  io_->read(data.data(), data.size());
  295|  39.5k|  io_->seek(restore, BasicIo::beg);
  296|       |
  297|  39.5k|  size_t skip = 0;  // read position in data.pData_
  298|  39.5k|  uint8_t version = 0;
  299|  39.5k|  uint32_t flags = 0;
  300|       |
  301|  39.5k|  if (fullBox(box_type)) {
  ------------------
  |  Branch (301:7): [True: 5.30k, False: 34.2k]
  ------------------
  302|  5.30k|    Internal::enforce(data.size() - skip >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  303|  5.30k|    flags = data.read_uint32(skip, endian_);  // version/flags
  304|  5.30k|    version = static_cast<uint8_t>(flags >> 24);
  305|  5.30k|    flags &= 0x00ffffff;
  306|  5.30k|    skip += 4;
  307|  5.30k|  }
  308|       |
  309|  39.5k|  switch (box_type) {
  310|       |    //  See notes in skipBox()
  311|  4.55k|    case TAG::ftyp: {
  ------------------
  |  Branch (311:5): [True: 4.55k, False: 35.0k]
  ------------------
  312|  4.55k|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  313|  4.55k|      fileType_ = data.read_uint32(0, endian_);
  314|  4.55k|      if (bTrace) {
  ------------------
  |  Branch (314:11): [True: 0, False: 4.55k]
  ------------------
  315|      0|        out << "brand: " << toAscii(fileType_);
  316|      0|      }
  317|  4.55k|    } break;
  318|       |
  319|       |    // 8.11.6.1
  320|    513|    case TAG::iinf: {
  ------------------
  |  Branch (320:5): [True: 513, False: 39.0k]
  ------------------
  321|    513|      if (bTrace) {
  ------------------
  |  Branch (321:11): [True: 0, False: 513]
  ------------------
  322|      0|        out << '\n';
  323|      0|        bLF = false;
  324|      0|      }
  325|       |
  326|    513|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  327|    513|      uint16_t n = data.read_uint16(skip, endian_);
  328|    513|      skip += 2;
  329|       |
  330|    513|      io_->seek(skip, BasicIo::cur);
  331|  1.52k|      while (n-- > 0) {
  ------------------
  |  Branch (331:14): [True: 1.00k, False: 513]
  ------------------
  332|  1.00k|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  333|  1.00k|      }
  334|    513|    } break;
  335|       |
  336|       |    // 8.11.6.2
  337|  1.21k|    case TAG::infe: {  // .__._.__hvc1_ 2 0 0 1 0 1 0 0 104 118 99 49 0
  ------------------
  |  Branch (337:5): [True: 1.21k, False: 38.3k]
  ------------------
  338|  1.21k|      Internal::enforce(data.size() - skip >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  339|  1.21k|      /* getULong (data.pData_+skip,endian_) ; */ skip += 4;
  340|  1.21k|      uint16_t ID = data.read_uint16(skip, endian_);
  341|  1.21k|      skip += 2;
  342|  1.21k|      /* getShort(data.pData_+skip,endian_) ; */ skip += 2;  // protection
  343|  1.21k|      std::string id;
  344|       |      // Check that the string has a '\0' terminator.
  345|  1.21k|      const char* str = data.c_str(skip);
  346|  1.21k|      const size_t maxlen = data.size() - skip;
  347|  1.21k|      Internal::enforce(maxlen > 0 && strnlen(str, maxlen) < maxlen, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (347:25): [True: 1.20k, False: 7]
  |  Branch (347:39): [True: 1.20k, False: 3]
  ------------------
  348|  1.21k|      std::string name(str);
  349|  1.21k|      if (Internal::contains(name, "Exif")) {  // "Exif" or "ExifExif"
  ------------------
  |  Branch (349:11): [True: 521, False: 689]
  ------------------
  350|    521|        exifID_ = ID;
  351|    521|        id = " *** Exif ***";
  352|    689|      } else if (Internal::contains(name, "mime\0xmp") || Internal::contains(name, "mime\0application/rdf+xml")) {
  ------------------
  |  Branch (352:18): [True: 397, False: 292]
  |  Branch (352:59): [True: 0, False: 292]
  ------------------
  353|    387|        xmpID_ = ID;
  354|    387|        id = " *** XMP ***";
  355|    387|      }
  356|  1.21k|      if (bTrace) {
  ------------------
  |  Branch (356:11): [True: 0, False: 1.21k]
  ------------------
  357|      0|        out << stringFormat("ID = {:3} {} {}", ID, name, id);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  358|      0|      }
  359|  1.21k|    } break;
  360|       |
  361|     79|    case TAG::moov:
  ------------------
  |  Branch (361:5): [True: 79, False: 39.5k]
  ------------------
  362|     90|    case TAG::iprp:
  ------------------
  |  Branch (362:5): [True: 11, False: 39.5k]
  ------------------
  363|  15.6k|    case TAG::ipco:
  ------------------
  |  Branch (363:5): [True: 15.5k, False: 24.0k]
  ------------------
  364|  17.2k|    case TAG::meta: {
  ------------------
  |  Branch (364:5): [True: 1.64k, False: 37.9k]
  ------------------
  365|  17.2k|      if (bTrace) {
  ------------------
  |  Branch (365:11): [True: 0, False: 17.2k]
  ------------------
  366|      0|        out << '\n';
  367|      0|        bLF = false;
  368|      0|      }
  369|  17.2k|      io_->seek(skip, BasicIo::cur);
  370|  36.7k|      while (io_->tell() < box_end) {
  ------------------
  |  Branch (370:14): [True: 19.4k, False: 17.2k]
  ------------------
  371|  19.4k|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  372|  19.4k|      }
  373|       |      // post-process meta box to recover Exif and XMP
  374|  17.2k|      if (box_type == TAG::meta) {
  ------------------
  |  Branch (374:11): [True: 1.28k, False: 15.9k]
  ------------------
  375|  1.28k|        auto ilo = ilocs_.find(exifID_);
  376|  1.28k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (376:13): [True: 9, False: 1.27k]
  ------------------
  377|      9|          const Iloc& iloc = ilo->second;
  378|      9|          if (bTrace) {
  ------------------
  |  Branch (378:15): [True: 0, False: 9]
  ------------------
  379|      0|            out << Internal::indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString() << '\n';
  380|      0|          }
  381|      9|          parseTiff(Internal::Tag::root, iloc.length_, iloc.start_);
  382|      9|        }
  383|  1.28k|        ilo = ilocs_.find(xmpID_);
  384|  1.28k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (384:13): [True: 142, False: 1.14k]
  ------------------
  385|    142|          const Iloc& iloc = ilo->second;
  386|    142|          if (bTrace) {
  ------------------
  |  Branch (386:15): [True: 0, False: 142]
  ------------------
  387|      0|            out << Internal::indent(depth) << "Exiv2::BMFF XMP: " << iloc.toString() << '\n';
  388|      0|          }
  389|    142|          parseXmp(iloc.length_, iloc.start_);
  390|    142|        }
  391|  1.28k|        ilocs_.clear();
  392|  1.28k|      }
  393|  17.2k|    } break;
  394|       |
  395|       |    // 8.11.3.1
  396|  1.29k|    case TAG::iloc: {
  ------------------
  |  Branch (396:5): [True: 1.29k, False: 38.2k]
  ------------------
  397|  1.29k|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  398|  1.29k|      uint8_t u = data.read_uint8(skip++);
  399|  1.29k|      uint16_t offsetSize = u >> 4;
  400|  1.29k|      uint16_t lengthSize = u & 0xF;
  401|       |#if 0
  402|       |                uint16_t indexSize  = 0       ;
  403|       |                u             = data.read_uint8(skip++);
  404|       |                if ( version == 1 || version == 2 ) {
  405|       |                    indexSize = u & 0xF ;
  406|       |                }
  407|       |#else
  408|  1.29k|      skip++;
  409|  1.29k|#endif
  410|  1.29k|      Internal::enforce(data.size() - skip >= (version < 2u ? 2u : 4u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (410:48): [True: 1.20k, False: 91]
  ------------------
  411|  1.29k|      uint32_t itemCount = version < 2 ? data.read_uint16(skip, endian_) : data.read_uint32(skip, endian_);
  ------------------
  |  Branch (411:28): [True: 1.20k, False: 91]
  ------------------
  412|  1.29k|      skip += version < 2 ? 2 : 4;
  ------------------
  |  Branch (412:15): [True: 1.20k, False: 91]
  ------------------
  413|  1.29k|      if (itemCount && itemCount < box_length / 14 && offsetSize == 4 && lengthSize == 4 &&
  ------------------
  |  Branch (413:11): [True: 1.08k, False: 206]
  |  Branch (413:24): [True: 893, False: 193]
  |  Branch (413:55): [True: 883, False: 10]
  |  Branch (413:74): [True: 724, False: 159]
  ------------------
  414|    724|          ((box_length - 16) % itemCount) == 0) {
  ------------------
  |  Branch (414:11): [True: 656, False: 68]
  ------------------
  415|    656|        if (bTrace) {
  ------------------
  |  Branch (415:13): [True: 0, False: 656]
  ------------------
  416|      0|          out << '\n';
  417|      0|          bLF = false;
  418|      0|        }
  419|    656|        auto step = (static_cast<size_t>(box_length) - 16) / itemCount;  // length of data per item.
  420|    656|        size_t base = skip;
  421|  7.89k|        for (uint32_t i = 0; i < itemCount; i++) {
  ------------------
  |  Branch (421:30): [True: 7.24k, False: 656]
  ------------------
  422|  7.24k|          skip = base + (i * step);  // move in 14, 16 or 18 byte steps
  423|  7.24k|          Internal::enforce(data.size() - skip >= (version > 2u ? 4u : 2u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (423:52): [True: 873, False: 6.37k]
  ------------------
  424|  7.24k|          Internal::enforce(data.size() - skip >= step, Exiv2::ErrorCode::kerCorruptedMetadata);
  425|  7.24k|          uint32_t ID = version > 2 ? data.read_uint32(skip, endian_) : data.read_uint16(skip, endian_);
  ------------------
  |  Branch (425:25): [True: 828, False: 6.41k]
  ------------------
  426|  7.24k|          auto offset = [&data, skip, step] {
  427|  7.24k|            if (step == 14 || step == 16)
  428|  7.24k|              return data.read_uint32(skip + step - 8, endian_);
  429|  7.24k|            if (step == 18)
  430|  7.24k|              return data.read_uint32(skip + 4, endian_);
  431|  7.24k|            return 0u;
  432|  7.24k|          }();
  433|       |
  434|  7.24k|          uint32_t ldata = data.read_uint32(skip + step - 4, endian_);
  435|  7.24k|          if (bTrace) {
  ------------------
  |  Branch (435:15): [True: 0, False: 7.24k]
  ------------------
  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.24k|          if (offset && ldata && ID != unknownID_) {
  ------------------
  |  Branch (440:15): [True: 6.30k, False: 935]
  |  Branch (440:25): [True: 6.11k, False: 197]
  |  Branch (440:34): [True: 5.71k, False: 400]
  ------------------
  441|  5.71k|            ilocs_[ID] = Iloc{ID, offset, ldata};
  442|  5.71k|          }
  443|  7.24k|        }
  444|    656|      }
  445|  1.29k|    } break;
  446|       |
  447|    554|    case TAG::ispe: {
  ------------------
  |  Branch (447:5): [True: 554, False: 39.0k]
  ------------------
  448|    554|      Internal::enforce(data.size() - skip >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  449|    554|      skip += 4;
  450|    554|      uint32_t width = data.read_uint32(skip, endian_);
  451|    554|      skip += 4;
  452|    554|      uint32_t height = data.read_uint32(skip, endian_);
  453|    554|      skip += 4;
  454|    554|      if (bTrace) {
  ------------------
  |  Branch (454:11): [True: 0, False: 554]
  ------------------
  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|    554|      if (width > pixelWidth_ && height > pixelHeight_) {
  ------------------
  |  Branch (459:11): [True: 322, False: 232]
  |  Branch (459:34): [True: 58, False: 264]
  ------------------
  460|     58|        pixelWidth_ = width;
  461|     58|        pixelHeight_ = height;
  462|     58|      }
  463|    554|    } break;
  464|       |
  465|       |    // 12.1.5.2
  466|    339|    case TAG::colr: {
  ------------------
  |  Branch (466:5): [True: 339, False: 39.2k]
  ------------------
  467|    339|      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: 269, False: 70]
  ------------------
  468|       |        // https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf
  469|    269|        uint8_t meth = data.read_uint8(skip + 0);
  470|    269|        uint8_t prec = data.read_uint8(skip + 1);
  471|    269|        uint8_t approx = data.read_uint8(skip + 2);
  472|    269|        auto colour_type = std::string(data.c_str(), 4);
  473|    269|        skip += 4;
  474|    269|        if (colour_type == "rICC" || colour_type == "prof") {
  ------------------
  |  Branch (474:13): [True: 7, False: 262]
  |  Branch (474:38): [True: 42, False: 220]
  ------------------
  475|     49|          DataBuf profile(data.c_data(skip), data.size() - skip);
  476|     49|          setIccProfile(std::move(profile));
  477|    220|        } else if (meth == 2 && prec == 0 && approx == 0) {
  ------------------
  |  Branch (477:20): [True: 122, False: 98]
  |  Branch (477:33): [True: 107, False: 15]
  |  Branch (477:46): [True: 97, False: 10]
  ------------------
  478|       |          // JP2000 files have a 3 byte head // 2 0 0 icc......
  479|     97|          skip -= 1;
  480|     97|          DataBuf profile(data.c_data(skip), data.size() - skip);
  481|     97|          setIccProfile(std::move(profile));
  482|     97|        }
  483|    269|      }
  484|    339|    } break;
  485|       |
  486|    833|    case TAG::uuid: {
  ------------------
  |  Branch (486:5): [True: 833, False: 38.7k]
  ------------------
  487|    833|      DataBuf uuid(16);
  488|    833|      io_->read(uuid.data(), uuid.size());
  489|    833|      std::string name = uuidName(uuid);
  490|    833|      if (bTrace) {
  ------------------
  |  Branch (490:11): [True: 0, False: 833]
  ------------------
  491|      0|        out << " uuidName " << name << '\n';
  492|      0|        bLF = false;
  493|      0|      }
  494|    833|      if (name == "cano" || name == "canp") {
  ------------------
  |  Branch (494:11): [True: 7, False: 826]
  |  Branch (494:29): [True: 491, False: 335]
  ------------------
  495|    498|        if (name == "canp") {
  ------------------
  |  Branch (495:13): [True: 491, False: 7]
  ------------------
  496|       |          // based on
  497|       |          // https://github.com/lclevy/canon_cr3/blob/7be75d6/parse_cr3.py#L271
  498|    491|          io_->seek(8, BasicIo::cur);
  499|    491|        }
  500|  1.00k|        while (io_->tell() < box_end) {
  ------------------
  |  Branch (500:16): [True: 507, False: 498]
  ------------------
  501|    507|          io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  502|    507|        }
  503|    498|      } else if (name == "xmp") {
  ------------------
  |  Branch (503:18): [True: 199, False: 136]
  ------------------
  504|    199|        parseXmp(box_length, io_->tell());
  505|    199|      }
  506|    833|    } break;
  507|       |
  508|    742|    case TAG::cmt1:
  ------------------
  |  Branch (508:5): [True: 742, False: 38.8k]
  ------------------
  509|    742|      parseTiff(Internal::Tag::root, box_length);
  510|    742|      break;
  511|  2.05k|    case TAG::cmt2:
  ------------------
  |  Branch (511:5): [True: 2.05k, False: 37.5k]
  ------------------
  512|  2.05k|      parseTiff(Internal::Tag::cmt2, box_length);
  513|  2.05k|      break;
  514|    501|    case TAG::cmt3:
  ------------------
  |  Branch (514:5): [True: 501, False: 39.0k]
  ------------------
  515|    501|      parseTiff(Internal::Tag::cmt3, box_length);
  516|    501|      break;
  517|    838|    case TAG::cmt4:
  ------------------
  |  Branch (517:5): [True: 838, False: 38.7k]
  ------------------
  518|    838|      parseTiff(Internal::Tag::cmt4, box_length);
  519|    838|      break;
  520|  2.15k|    case TAG::exif:
  ------------------
  |  Branch (520:5): [True: 2.15k, False: 37.4k]
  ------------------
  521|  2.15k|      parseTiff(Internal::Tag::root, buffer_size, io_->tell());
  522|  2.15k|      break;
  523|    242|    case TAG::xml:
  ------------------
  |  Branch (523:5): [True: 242, False: 39.3k]
  ------------------
  524|    242|      parseXmp(buffer_size, io_->tell());
  525|    242|      break;
  526|    186|    case TAG::brob: {
  ------------------
  |  Branch (526:5): [True: 186, False: 39.4k]
  ------------------
  527|    186|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  528|    186|      uint32_t realType = data.read_uint32(0, endian_);
  529|    186|      if (bTrace) {
  ------------------
  |  Branch (529:11): [True: 0, False: 186]
  ------------------
  530|      0|        out << "type: " << toAscii(realType);
  531|      0|      }
  532|    186|#ifdef EXV_HAVE_BROTLI
  533|    186|      DataBuf arr;
  534|    186|      brotliUncompress(data.c_data(4), data.size() - 4, arr);
  535|    186|      if (realType == TAG::exif) {
  ------------------
  |  Branch (535:11): [True: 1, False: 185]
  ------------------
  536|      1|        uint32_t offset = Safe::add(arr.read_uint32(0, endian_), 4u);
  537|      1|        Internal::enforce(Safe::add(offset, 4u) < arr.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  538|      1|        Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), arr.c_data(offset), arr.size() - offset,
  539|      1|                                           Internal::Tag::root, Internal::TiffMapping::findDecoder);
  540|    185|      } else if (realType == TAG::xml) {
  ------------------
  |  Branch (540:18): [True: 17, False: 168]
  ------------------
  541|     17|        try {
  542|     17|          Exiv2::XmpParser::decode(xmpData(), std::string(arr.c_str(), arr.size()));
  543|     17|        } catch (...) {
  544|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  545|      0|        }
  546|     17|      }
  547|    186|#endif
  548|    186|    } break;
  549|  1.65k|    case TAG::thmb:
  ------------------
  |  Branch (549:5): [True: 1.65k, False: 37.9k]
  ------------------
  550|  1.65k|      switch (version) {
  551|  1.17k|        case 0:  // JPEG
  ------------------
  |  Branch (551:9): [True: 1.17k, False: 481]
  ------------------
  552|  1.17k|          parseCr3Preview(data, out, bTrace, version, skip, skip + 2, skip + 4, skip + 12);
  553|  1.17k|          break;
  554|     18|        case 1:  // HDR
  ------------------
  |  Branch (554:9): [True: 18, False: 1.63k]
  ------------------
  555|     18|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  556|     18|          break;
  557|    463|        default:
  ------------------
  |  Branch (557:9): [True: 463, False: 1.19k]
  ------------------
  558|    463|          break;
  559|  1.65k|      }
  560|  1.65k|      break;
  561|  1.65k|    case TAG::prvw:
  ------------------
  |  Branch (561:5): [True: 187, False: 39.3k]
  ------------------
  562|    187|      switch (version) {
  563|    164|        case 0:  // JPEG
  ------------------
  |  Branch (563:9): [True: 164, False: 23]
  ------------------
  564|    164|        case 1:  // HDR
  ------------------
  |  Branch (564:9): [True: 0, False: 187]
  ------------------
  565|    164|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  566|    164|          break;
  567|     23|        default:
  ------------------
  |  Branch (567:9): [True: 23, False: 164]
  ------------------
  568|     23|          break;
  569|    187|      }
  570|    187|      break;
  571|       |
  572|  3.70k|    default:
  ------------------
  |  Branch (572:5): [True: 3.70k, False: 35.8k]
  ------------------
  573|  3.70k|      break; /* do nothing */
  574|  39.5k|  }
  575|  27.4k|  if (bLF && bTrace)
  ------------------
  |  Branch (575:7): [True: 27.4k, False: 0]
  |  Branch (575:14): [True: 0, False: 27.4k]
  ------------------
  576|      0|    out << '\n';
  577|       |
  578|       |  // return address of next box
  579|  27.4k|  return box_end;
  580|  39.5k|}
_ZN5Exiv29BmffImage9parseTiffEjmm:
  582|  2.16k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length, uint64_t start) {
  583|  2.16k|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  584|  2.16k|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  585|  2.16k|  Internal::enforce(start <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()),
  586|  2.16k|                    ErrorCode::kerCorruptedMetadata);
  587|  2.16k|  Internal::enforce(length <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  588|       |
  589|       |  // read and parse exif data
  590|  2.16k|  const size_t restore = io_->tell();
  591|  2.16k|  DataBuf exif(static_cast<size_t>(length));
  592|  2.16k|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  593|  2.16k|  if (exif.size() > 8 && io_->read(exif.data(), exif.size()) == exif.size()) {
  ------------------
  |  Branch (593:7): [True: 1.93k, False: 228]
  |  Branch (593:26): [True: 1.93k, False: 0]
  ------------------
  594|       |    // hunt for "II" or "MM"
  595|  1.93k|    const size_t eof = std::numeric_limits<size_t>::max();  // impossible value for punt
  596|  1.93k|    size_t punt = eof;
  597|   737k|    for (size_t i = 0; i < exif.size() - 9 && punt == eof; ++i) {
  ------------------
  |  Branch (597:24): [True: 736k, False: 1.27k]
  |  Branch (597:47): [True: 735k, False: 662]
  ------------------
  598|   735k|      auto charCurrent = exif.read_uint8(i);
  599|   735k|      auto charNext = exif.read_uint8(i + 1);
  600|   735k|      if (charCurrent == charNext && (charCurrent == 'I' || charCurrent == 'M'))
  ------------------
  |  Branch (600:11): [True: 518k, False: 217k]
  |  Branch (600:39): [True: 194, False: 517k]
  |  Branch (600:61): [True: 862, False: 517k]
  ------------------
  601|  1.05k|        punt = i;
  602|   735k|    }
  603|  1.93k|    if (punt != eof) {
  ------------------
  |  Branch (603:9): [True: 1.05k, False: 881]
  ------------------
  604|  1.05k|      Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), exif.c_data(punt), exif.size() - punt,
  605|  1.05k|                                         root_tag, Internal::TiffMapping::findDecoder);
  606|  1.05k|    }
  607|  1.93k|  }
  608|  2.16k|  io_->seek(restore, BasicIo::beg);
  609|  2.16k|}
_ZN5Exiv29BmffImage9parseTiffEjm:
  611|  4.13k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length) {
  612|  4.13k|  if (length > 8) {
  ------------------
  |  Branch (612:7): [True: 278, False: 3.85k]
  ------------------
  613|    278|    Internal::enforce(length - 8 <= io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  614|    278|    Internal::enforce(length - 8 <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  615|    278|    DataBuf data(static_cast<size_t>(length - 8u));
  616|    278|    const size_t bufRead = io_->read(data.data(), data.size());
  617|       |
  618|    278|    if (io_->error())
  ------------------
  |  Branch (618:9): [True: 0, False: 278]
  ------------------
  619|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  620|    278|    if (bufRead != data.size())
  ------------------
  |  Branch (620:9): [True: 0, False: 278]
  ------------------
  621|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  622|       |
  623|    278|    Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), data.c_data(), data.size(), root_tag,
  624|    278|                                       Internal::TiffMapping::findDecoder);
  625|    278|  }
  626|  4.13k|}
_ZN5Exiv29BmffImage8parseXmpEmm:
  628|    583|void BmffImage::parseXmp(uint64_t length, uint64_t start) {
  629|    583|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  630|    583|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  631|       |
  632|    583|  const size_t restore = io_->tell();
  633|    583|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  634|       |
  635|    583|  auto lengthSizeT = static_cast<size_t>(length);
  636|    583|  DataBuf xmp(lengthSizeT + 1);
  637|    583|  xmp.write_uint8(lengthSizeT, 0);  // ensure xmp is null terminated!
  638|    583|  if (io_->read(xmp.data(), lengthSizeT) != lengthSizeT)
  ------------------
  |  Branch (638:7): [True: 0, False: 583]
  ------------------
  639|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  640|    583|  if (io_->error())
  ------------------
  |  Branch (640:7): [True: 0, False: 583]
  ------------------
  641|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  642|    583|  try {
  643|    583|    Exiv2::XmpParser::decode(xmpData(), std::string(xmp.c_str()));
  644|    583|  } catch (...) {
  645|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  646|      0|  }
  647|       |
  648|    535|  io_->seek(restore, BasicIo::beg);
  649|    535|}
_ZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmm:
  654|  1.35k|                                size_t relative_position) {
  655|       |  // Derived from https://github.com/lclevy/canon_cr3
  656|  1.35k|  const size_t here = io_->tell();
  657|  1.35k|  Internal::enforce(here <= std::numeric_limits<size_t>::max() - relative_position, ErrorCode::kerCorruptedMetadata);
  658|  1.35k|  NativePreview nativePreview;
  659|  1.35k|  nativePreview.position_ = here + relative_position;
  660|  1.35k|  nativePreview.width_ = data.read_uint16(width_offset, endian_);
  661|  1.35k|  nativePreview.height_ = data.read_uint16(height_offset, endian_);
  662|  1.35k|  nativePreview.size_ = data.read_uint32(size_offset, endian_);
  663|  1.35k|  nativePreview.filter_ = "";
  664|  1.35k|  nativePreview.mimeType_ = [version] {
  665|  1.35k|    if (version == 0)
  666|  1.35k|      return "image/jpeg";
  667|  1.35k|    return "application/octet-stream";
  668|  1.35k|  }();
  669|  1.35k|  if (bTrace) {
  ------------------
  |  Branch (669:7): [True: 0, False: 1.35k]
  ------------------
  670|      0|    out << stringFormat("width,height,size = {},{},{}", nativePreview.width_, nativePreview.height_,
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  671|      0|                        nativePreview.size_);
  672|      0|  }
  673|  1.35k|  nativePreviews_.push_back(std::move(nativePreview));
  674|  1.35k|}
_ZNK5Exiv29BmffImage11openOrThrowEv:
  693|  2.27k|void BmffImage::openOrThrow() const {
  694|  2.27k|  if (io_->open() != 0) {
  ------------------
  |  Branch (694:7): [True: 0, False: 2.27k]
  ------------------
  695|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  696|      0|  }
  697|       |  // Ensure that this is the correct image type
  698|  2.27k|  if (!isBmffType(*io_, false)) {
  ------------------
  |  Branch (698:7): [True: 0, False: 2.27k]
  ------------------
  699|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (699:9): [True: 0, False: 0]
  |  Branch (699:25): [True: 0, False: 0]
  ------------------
  700|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  701|      0|    throw Error(ErrorCode::kerNotAnImage, "BMFF");
  702|      0|  }
  703|  2.27k|}
_ZN5Exiv29BmffImage12readMetadataEv:
  705|  2.27k|void BmffImage::readMetadata() {
  706|  2.27k|  openOrThrow();
  707|  2.27k|  IoCloser closer(*io_);
  708|       |
  709|  2.27k|  clearMetadata();
  710|  2.27k|  ilocs_.clear();
  711|  2.27k|  visits_max_ = io_->size() / 16;
  712|  2.27k|  unknownID_ = 0xffff;
  713|  2.27k|  exifID_ = unknownID_;
  714|  2.27k|  xmpID_ = unknownID_;
  715|       |
  716|  2.27k|  uint64_t address = 0;
  717|  2.27k|  const auto file_end = io_->size();
  718|  21.3k|  while (address < file_end) {
  ------------------
  |  Branch (718:10): [True: 19.0k, False: 2.27k]
  ------------------
  719|  19.0k|    io_->seek(address, BasicIo::beg);
  720|  19.0k|    address = boxHandler(std::cout, kpsNone, file_end, 0);
  721|  19.0k|  }
  722|  2.27k|  bReadMetadata_ = true;
  723|  2.27k|}  // BmffImage::readMetadata
_ZN5Exiv29BmffImage13writeMetadataEv:
  761|    985|void BmffImage::writeMetadata() {
  762|       |  // bmff files are read-only
  763|    985|  throw(Error(ErrorCode::kerWritingImageFormatUnsupported, "BMFF"));
  764|    985|}  // BmffImage::writeMetadata
_ZN5Exiv215newBmffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  768|  2.27k|Image::UniquePtr newBmffInstance(BasicIo::UniquePtr io, bool create) {
  769|  2.27k|  auto image = std::make_unique<BmffImage>(std::move(io), create);
  770|  2.27k|  if (!image->good()) {
  ------------------
  |  Branch (770:7): [True: 0, False: 2.27k]
  ------------------
  771|      0|    return nullptr;
  772|      0|  }
  773|  2.27k|  return image;
  774|  2.27k|}
_ZN5Exiv210isBmffTypeERNS_7BasicIoEb:
  776|  7.62k|bool isBmffType(BasicIo& iIo, bool advance) {
  777|  7.62k|  const int32_t len = 12;
  778|  7.62k|  byte buf[len];
  779|  7.62k|  iIo.read(buf, len);
  780|  7.62k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (780:7): [True: 0, False: 7.62k]
  |  Branch (780:22): [True: 342, False: 7.28k]
  ------------------
  781|    342|    return false;
  782|    342|  }
  783|       |
  784|       |  // bmff should start with "ftyp"
  785|  7.28k|  bool const is_ftyp = (buf[4] == 'f' && buf[5] == 't' && buf[6] == 'y' && buf[7] == 'p');
  ------------------
  |  Branch (785:25): [True: 6.86k, False: 416]
  |  Branch (785:42): [True: 6.82k, False: 38]
  |  Branch (785:59): [True: 6.80k, False: 24]
  |  Branch (785:76): [True: 6.79k, False: 5]
  ------------------
  786|       |  // jxl files have a special start indicator of "JXL "
  787|  7.28k|  bool const is_jxl = (buf[4] == 'J' && buf[5] == 'X' && buf[6] == 'L' && buf[7] == ' ');
  ------------------
  |  Branch (787:24): [True: 63, False: 7.21k]
  |  Branch (787:41): [True: 36, False: 27]
  |  Branch (787:58): [True: 24, False: 12]
  |  Branch (787:75): [True: 18, False: 6]
  ------------------
  788|       |
  789|  7.28k|  bool matched = is_jxl || is_ftyp;
  ------------------
  |  Branch (789:18): [True: 18, False: 7.26k]
  |  Branch (789:28): [True: 6.79k, False: 465]
  ------------------
  790|  7.28k|  if (!advance || !matched) {
  ------------------
  |  Branch (790:7): [True: 7.28k, False: 0]
  |  Branch (790:19): [True: 0, False: 0]
  ------------------
  791|  7.28k|    iIo.seek(0, BasicIo::beg);
  792|  7.28k|  }
  793|  7.28k|  return matched;
  794|  7.62k|}
bmffimage.cpp:_ZN5Exiv2L7skipBoxEj:
  113|  39.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|  39.2k|  return box == 0 || box == TAG::mdat;  // mdat is where the main image lives and can be huge
  ------------------
  |  Branch (117:10): [True: 115, False: 39.0k]
  |  Branch (117:22): [True: 242, False: 38.8k]
  ------------------
  118|  39.2k|}
bmffimage.cpp:_ZZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmmENK3$_0clEv:
  426|  7.19k|          auto offset = [&data, skip, step] {
  427|  7.19k|            if (step == 14 || step == 16)
  ------------------
  |  Branch (427:17): [True: 4.61k, False: 2.58k]
  |  Branch (427:31): [True: 1.06k, False: 1.51k]
  ------------------
  428|  5.68k|              return data.read_uint32(skip + step - 8, endian_);
  429|  1.51k|            if (step == 18)
  ------------------
  |  Branch (429:17): [True: 1.01k, False: 507]
  ------------------
  430|  1.01k|              return data.read_uint32(skip + 4, endian_);
  431|    507|            return 0u;
  432|  1.51k|          }();
bmffimage.cpp:_ZZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmmENK3$_0clEv:
  664|  1.35k|  nativePreview.mimeType_ = [version] {
  665|  1.35k|    if (version == 0)
  ------------------
  |  Branch (665:9): [True: 1.33k, False: 18]
  ------------------
  666|  1.33k|      return "image/jpeg";
  667|     18|    return "application/octet-stream";
  668|  1.35k|  }();

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

_ZN5Exiv28Internal7canonEvEl:
 3041|    422|float canonEv(int64_t val) {
 3042|       |  // temporarily remove sign
 3043|    422|  int sign = 1;
 3044|    422|  if (val < 0) {
  ------------------
  |  Branch (3044:7): [True: 0, False: 422]
  ------------------
 3045|      0|    sign = -1;
 3046|      0|    val = -val;
 3047|      0|  }
 3048|       |  // remove fraction
 3049|    422|  const auto remainder = val & 0x1f;
 3050|    422|  val -= remainder;
 3051|    422|  auto frac = static_cast<float>(remainder);
 3052|       |  // convert 1/3 (0x0c) and 2/3 (0x14) codes
 3053|    422|  if (frac == 0x0c) {
  ------------------
  |  Branch (3053:7): [True: 30, False: 392]
  ------------------
 3054|     30|    frac = 32.0F / 3;
 3055|    392|  } else if (frac == 0x14) {
  ------------------
  |  Branch (3055:14): [True: 31, False: 361]
  ------------------
 3056|     31|    frac = 64.0F / 3;
 3057|    361|  } else if ((val == 160) && (frac == 0x08)) {  // for Sigma f/6.3 lenses that report f/6.2 to camera
  ------------------
  |  Branch (3057:14): [True: 12, False: 349]
  |  Branch (3057:30): [True: 3, False: 9]
  ------------------
 3058|      3|    frac = 30.0F / 3;
 3059|      3|  }
 3060|    422|  return sign * (val + frac) / 32.0F;
 3061|    422|}

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   194k|  static constexpr auto tagList() {
   39|   194k|    return tagInfo_;
   40|   194k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  2.43k|  static constexpr auto tagListCs() {
   43|  2.43k|    return tagInfoCs_;
   44|  2.43k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  2.69k|  static constexpr auto tagListSi() {
   47|  2.69k|    return tagInfoSi_;
   48|  2.69k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|    510|  static constexpr auto tagListCf() {
   55|    510|    return tagInfoCf_;
   56|    510|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|    583|  static constexpr auto tagListPi() {
   59|    583|    return tagInfoPi_;
   60|    583|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    348|  static constexpr auto tagListTi() {
   63|    348|    return tagInfoTi_;
   64|    348|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|    327|  static constexpr auto tagListFi() {
   67|    327|    return tagInfoFi_;
   68|    327|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    219|  static constexpr auto tagListPa() {
   51|    219|    return tagInfoPa_;
   52|    219|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    406|  static constexpr auto tagListPr() {
   71|    406|    return tagInfoPr_;
   72|    406|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|  2.28k|  static constexpr auto tagListVigCor2() {
  135|  2.28k|    return tagInfoVigCor2_;
  136|  2.28k|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    549|  static constexpr auto tagListLiOp() {
  139|    549|    return tagInfoLiOp_;
  140|    549|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    295|  static constexpr auto tagListAfMiAdj() {
  127|    295|    return tagInfoAfMiAdj_;
  128|    295|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|    387|  static constexpr auto tagListLe() {
  143|    387|    return tagInfoLe_;
  144|    387|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    691|  static constexpr auto tagListAm() {
  147|    691|    return tagInfoAm_;
  148|    691|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    305|  static constexpr auto tagListFil() {
  155|    305|    return tagInfoFil_;
  156|    305|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    550|  static constexpr auto tagListMe() {
  151|    550|    return tagInfoMe_;
  152|    550|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    261|  static constexpr auto tagListHdr() {
  159|    261|    return tagInfoHdr_;
  160|    261|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    363|  static constexpr auto tagListAfC() {
  163|    363|    return tagInfoAfC_;
  164|    363|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|     79|  static constexpr auto tagListRawB() {
  167|     79|    return tagInfoRawB_;
  168|     79|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  3.82k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  3.82k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  3.81k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  3.81k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  3.73k|void Converter::cnvToXmp() {
  503|   470k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 470k, False: 3.73k]
  ------------------
  504|   470k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 388k, False: 82.0k]
  |  Branch (504:37): [True: 194k, False: 194k]
  |  Branch (504:52): [True: 82.0k, False: 194k]
  |  Branch (504:79): [True: 40.9k, False: 41.0k]
  ------------------
  505|   235k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   235k|    }
  507|   470k|  }
  508|  3.73k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.90k|void Converter::cnvFromXmp() {
  511|   491k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 491k, False: 3.90k]
  ------------------
  512|   491k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 406k, False: 85.8k]
  |  Branch (512:37): [True: 203k, False: 203k]
  |  Branch (512:52): [True: 85.8k, False: 203k]
  |  Branch (512:79): [True: 42.9k, False: 42.9k]
  ------------------
  513|   245k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   245k|    }
  515|   491k|  }
  516|  3.90k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  3.73k|void Converter::cnvNone(const char*, const char*) {
  519|  3.73k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  4.69k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  4.69k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  4.69k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 4.69k, False: 0]
  ------------------
  524|  4.69k|    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|    886|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    886|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    886|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 886, False: 0]
  ------------------
  534|    886|    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|}
_ZN5Exiv29Converter16prepareXmpTargetEPKcb:
  543|    867|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|    867|  auto pos = xmpData_->findKey(XmpKey(to));
  545|    867|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 867]
  ------------------
  546|      0|    return true;
  547|    867|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 867]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|    867|  xmpData_->erase(pos);
  550|    867|  return true;
  551|    867|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   168k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   168k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   168k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 167k, False: 319]
  ------------------
  556|   167k|    return;
  557|    319|  std::string value = pos->toString();
  558|    319|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 319]
  ------------------
  559|      0|#ifndef SUPPRESS_WARNINGS
  560|      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()
  ------------------
  561|      0|#endif
  562|      0|    return;
  563|      0|  }
  564|    319|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 319]
  ------------------
  565|      0|    return;
  566|    319|  (*xmpData_)[to] = value;
  567|    319|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 319]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    319|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  1.86k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  1.86k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  1.86k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 1.86k, False: 0]
  ------------------
  574|  1.86k|    return;
  575|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|    return;
  577|      0|  const auto cv = dynamic_cast<const CommentValue*>(&pos->value());
  578|      0|  if (!cv) {
  ------------------
  |  Branch (578:7): [True: 0, False: 0]
  ------------------
  579|      0|#ifndef SUPPRESS_WARNINGS
  580|      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()
  ------------------
  581|      0|#endif
  582|      0|    return;
  583|      0|  }
  584|       |  // Todo: Convert to UTF-8 if necessary
  585|      0|  try {
  586|      0|    (*xmpData_)[to] = cv->comment();
  587|      0|  } catch (const Error&) {
  588|      0|#ifndef SUPPRESS_WARNINGS
  589|      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()
  ------------------
  590|      0|#endif
  591|      0|  }
  592|      0|  if (erase_)
  ------------------
  |  Branch (592:7): [True: 0, False: 0]
  ------------------
  593|      0|    exifData_->erase(pos);
  594|      0|}
_ZN5Exiv29Converter12cnvExifArrayEPKcS2_:
  596|  1.86k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  1.86k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  1.86k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 1.86k, False: 0]
  ------------------
  599|  1.86k|    return;
  600|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (600:7): [True: 0, False: 0]
  ------------------
  601|      0|    return;
  602|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (602:22): [True: 0, False: 0]
  ------------------
  603|      0|    std::string value = pos->toString(i);
  604|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (604:9): [True: 0, False: 0]
  ------------------
  605|      0|#ifndef SUPPRESS_WARNINGS
  606|      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()
  ------------------
  607|      0|#endif
  608|      0|      return;
  609|      0|    }
  610|      0|    (*xmpData_)[to] = value;
  611|      0|  }
  612|      0|  if (erase_)
  ------------------
  |  Branch (612:7): [True: 0, False: 0]
  ------------------
  613|      0|    exifData_->erase(pos);
  614|      0|}
_ZN5Exiv29Converter11cnvExifDateEPKcS2_:
  616|  7.47k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  7.47k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  7.47k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 7.36k, False: 110]
  ------------------
  619|  7.36k|    return;
  620|    110|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 110]
  ------------------
  621|      0|    return;
  622|    110|  int year = 0;
  623|    110|  int month = 0;
  624|    110|  int day = 0;
  625|    110|  int hour = 0;
  626|    110|  int min = 0;
  627|    110|  int sec = 0;
  628|    110|  std::string subsec;
  629|       |
  630|    110|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 110, False: 0]
  ------------------
  631|    110|    std::string value = pos->toString();
  632|    110|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 110]
  ------------------
  633|      0|#ifndef SUPPRESS_WARNINGS
  634|      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()
  ------------------
  635|      0|#endif
  636|      0|      return;
  637|      0|    }
  638|    110|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 110]
  ------------------
  639|      0|#ifndef SUPPRESS_WARNINGS
  640|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << ", unable to parse '" << value << "'\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()
  ------------------
  641|      0|#endif
  642|      0|      return;
  643|      0|    }
  644|    110|  } else {  // "Exif.GPSInfo.GPSTimeStamp"
  645|      0|    bool ok = true;
  646|      0|    if (pos->count() != 3)
  ------------------
  |  Branch (646:9): [True: 0, False: 0]
  ------------------
  647|      0|      ok = false;
  648|      0|    if (ok) {
  ------------------
  |  Branch (648:9): [True: 0, False: 0]
  ------------------
  649|      0|      for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (649:23): [True: 0, False: 0]
  ------------------
  650|      0|        if (pos->toRational(i).second == 0) {
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  ------------------
  651|      0|          ok = false;
  652|      0|          break;
  653|      0|        }
  654|      0|      }
  655|      0|    }
  656|      0|    if (!ok) {
  ------------------
  |  Branch (656:9): [True: 0, False: 0]
  ------------------
  657|      0|#ifndef SUPPRESS_WARNINGS
  658|      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()
  ------------------
  659|      0|#endif
  660|      0|      return;
  661|      0|    }
  662|       |
  663|      0|    double dhour = pos->toFloat(0);
  664|      0|    double dmin = pos->toFloat(1);
  665|       |    // Hack: Need Value::toDouble
  666|      0|    auto [r, s] = pos->toRational(2);
  667|      0|    double dsec = static_cast<double>(r) / s;
  668|       |
  669|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (669:9): [True: 0, False: 0]
  ------------------
  670|      0|#ifndef SUPPRESS_WARNINGS
  671|      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()
  ------------------
  672|      0|#endif
  673|      0|      return;
  674|      0|    }
  675|       |
  676|      0|    dsec += dhour * 3600.0;
  677|      0|    dsec += dmin * 60.0;
  678|       |
  679|      0|    hour = static_cast<int>(dsec / 3600.0);
  680|      0|    dsec -= hour * 3600;
  681|      0|    min = static_cast<int>(dsec / 60.0);
  682|      0|    dsec -= min * 60;
  683|      0|    sec = static_cast<int>(dsec);
  684|      0|    dsec -= sec;
  685|       |
  686|      0|    subsec = stringFormat(".{:09.0f}", dsec * 1'000'000'000);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  687|       |
  688|      0|    auto datePos = exifData_->findKey(ExifKey("Exif.GPSInfo.GPSDateStamp"));
  689|      0|    if (datePos == exifData_->end()) {
  ------------------
  |  Branch (689:9): [True: 0, False: 0]
  ------------------
  690|      0|      datePos = exifData_->findKey(ExifKey("Exif.Photo.DateTimeOriginal"));
  691|      0|    }
  692|      0|    if (datePos == exifData_->end()) {
  ------------------
  |  Branch (692:9): [True: 0, False: 0]
  ------------------
  693|      0|      datePos = exifData_->findKey(ExifKey("Exif.Photo.DateTimeDigitized"));
  694|      0|    }
  695|      0|    if (datePos == exifData_->end()) {
  ------------------
  |  Branch (695:9): [True: 0, False: 0]
  ------------------
  696|      0|#ifndef SUPPRESS_WARNINGS
  697|      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()
  ------------------
  698|      0|#endif
  699|      0|      return;
  700|      0|    }
  701|      0|    std::string value = datePos->toString();
  702|      0|    if (sscanf(value.c_str(), "%d:%d:%d", &year, &month, &day) != 3) {
  ------------------
  |  Branch (702:9): [True: 0, False: 0]
  ------------------
  703|      0|#ifndef SUPPRESS_WARNINGS
  704|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << ", unable to parse '" << value << "'\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()
  ------------------
  705|      0|#endif
  706|      0|      return;
  707|      0|    }
  708|      0|  }
  709|       |
  710|    110|  const char* subsecTag = nullptr;
  711|    110|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 13, False: 97]
  ------------------
  712|     13|    subsecTag = "Exif.Photo.SubSecTime";
  713|     97|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 33, False: 64]
  ------------------
  714|     33|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|     64|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 64, False: 0]
  ------------------
  716|     64|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|     64|  }
  718|       |
  719|    110|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 110, False: 0]
  ------------------
  720|    110|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    110|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 6, False: 104]
  ------------------
  722|      6|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 6, False: 0]
  ------------------
  723|      6|        std::string ss = subsec_pos->toString();
  724|      6|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 6, False: 0]
  ------------------
  725|      6|          bool ok = false;
  726|      6|          stringTo<long>(ss, ok);
  727|      6|          if (ok)
  ------------------
  |  Branch (727:15): [True: 6, False: 0]
  ------------------
  728|      6|            subsec = std::string(".") + ss;
  729|      6|        }
  730|      6|      }
  731|      6|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 6]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|      6|    }
  734|    110|  }
  735|       |
  736|    110|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 110]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    110|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    110|#define stringFormat std::format
  ------------------
  740|    110|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 110]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    110|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  3.73k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  3.73k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  3.73k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 3.73k, False: 0]
  ------------------
  747|  3.73k|    return;
  748|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (748:7): [True: 0, False: 0]
  ------------------
  749|      0|    return;
  750|      0|  auto count = pos->count();
  751|      0|  std::string value;
  752|      0|  value.reserve(count);
  753|      0|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (753:22): [True: 0, False: 0]
  ------------------
  754|      0|    value.push_back(pos->toUint32(i));
  755|      0|  }
  756|      0|  (*xmpData_)[to] = value;
  757|      0|  if (erase_)
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|    exifData_->erase(pos);
  759|      0|}
_ZN5Exiv29Converter17cnvExifGPSVersionEPKcS2_:
  761|  1.86k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  1.86k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  1.86k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 1.86k, False: 0]
  ------------------
  764|  1.86k|    return;
  765|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (765:7): [True: 0, False: 0]
  ------------------
  766|      0|    return;
  767|      0|  std::string value;
  768|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (768:22): [True: 0, False: 0]
  ------------------
  769|      0|    if (i > 0)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|      value += '.';
  771|      0|    value += std::to_string(pos->toInt64(i));
  772|      0|  }
  773|      0|  (*xmpData_)[to] = value;
  774|      0|  if (erase_)
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  775|      0|    exifData_->erase(pos);
  776|      0|}
_ZN5Exiv29Converter12cnvExifFlashEPKcS2_:
  778|  1.86k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  1.86k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  1.86k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 1.86k, False: 0]
  |  Branch (780:7): [True: 1.86k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  1.86k|    return;
  782|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (782:7): [True: 0, False: 0]
  ------------------
  783|      0|    return;
  784|      0|  auto value = pos->toUint32();
  785|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 0]
  ------------------
  786|      0|#ifndef SUPPRESS_WARNINGS
  787|      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()
  ------------------
  788|      0|#endif
  789|      0|    return;
  790|      0|  }
  791|       |
  792|      0|  (*xmpData_)["Xmp.exif.Flash/exif:Fired"] = static_cast<bool>(value & 1);
  793|      0|  (*xmpData_)["Xmp.exif.Flash/exif:Return"] = (value >> 1) & 3;
  794|      0|  (*xmpData_)["Xmp.exif.Flash/exif:Mode"] = (value >> 3) & 3;
  795|      0|  (*xmpData_)["Xmp.exif.Flash/exif:Function"] = static_cast<bool>((value >> 5) & 1);
  796|      0|  (*xmpData_)["Xmp.exif.Flash/exif:RedEyeMode"] = static_cast<bool>((value >> 6) & 1);
  797|       |
  798|      0|  if (erase_)
  ------------------
  |  Branch (798:7): [True: 0, False: 0]
  ------------------
  799|      0|    exifData_->erase(pos);
  800|      0|}
_ZN5Exiv29Converter15cnvExifGPSCoordEPKcS2_:
  802|  7.46k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  7.46k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  7.46k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 7.46k, False: 0]
  ------------------
  805|  7.46k|    return;
  806|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (806:7): [True: 0, False: 0]
  ------------------
  807|      0|    return;
  808|      0|  if (pos->count() != 3) {
  ------------------
  |  Branch (808:7): [True: 0, False: 0]
  ------------------
  809|      0|#ifndef SUPPRESS_WARNINGS
  810|      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()
  ------------------
  811|      0|#endif
  812|      0|    return;
  813|      0|  }
  814|      0|  auto refPos = exifData_->findKey(ExifKey(std::string(from) + "Ref"));
  815|      0|  if (refPos == exifData_->end()) {
  ------------------
  |  Branch (815:7): [True: 0, False: 0]
  ------------------
  816|      0|#ifndef SUPPRESS_WARNINGS
  817|      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()
  ------------------
  818|      0|#endif
  819|      0|    return;
  820|      0|  }
  821|      0|  double deg[3];
  822|      0|  for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (822:19): [True: 0, False: 0]
  ------------------
  823|      0|    const auto [z, d] = pos->toRational(i);
  824|      0|    if (d == 0) {
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  ------------------
  825|      0|#ifndef SUPPRESS_WARNINGS
  826|      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()
  ------------------
  827|      0|#endif
  828|      0|      return;
  829|      0|    }
  830|       |    // Hack: Need Value::toDouble
  831|      0|    deg[i] = static_cast<double>(z) / d;
  832|      0|  }
  833|      0|  double min = (deg[0] * 60.0) + deg[1] + (deg[2] / 60.0);
  834|      0|  auto ideg = static_cast<int>(min / 60.0);
  835|      0|  min -= ideg * 60;
  836|      0|  (*xmpData_)[to] = stringFormat("{},{:.7f}{}", ideg, min, refPos->toString().front());
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  837|       |
  838|      0|  if (erase_)
  ------------------
  |  Branch (838:7): [True: 0, False: 0]
  ------------------
  839|      0|    exifData_->erase(pos);
  840|      0|  if (erase_)
  ------------------
  |  Branch (840:7): [True: 0, False: 0]
  ------------------
  841|      0|    exifData_->erase(refPos);
  842|      0|}
_ZN5Exiv29Converter11cnvXmpValueEPKcS2_:
  844|   175k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   175k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   175k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 175k, False: 443]
  ------------------
  847|   175k|    return;
  848|    443|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 443]
  ------------------
  849|      0|    return;
  850|    443|  std::string value;
  851|    443|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 117, False: 326]
  ------------------
  852|    117|#ifndef SUPPRESS_WARNINGS
  853|    117|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    117|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 117]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    117|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    117|#endif
  855|    117|    return;
  856|    117|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    326|  ExifKey key(to);
  859|    326|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 319, False: 7]
  ------------------
  860|    319|    exifData_->add(ed);
  861|    319|  }
  862|    326|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 326]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    326|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.95k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.95k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.95k]
  ------------------
  868|      0|    return;
  869|  1.95k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.95k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.95k, False: 0]
  ------------------
  871|  1.95k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  1.95k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.95k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.95k]
  ------------------
  887|      0|    return;
  888|  1.95k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.95k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.95k, False: 0]
  ------------------
  890|  1.95k|    return;
  891|      0|  std::string array;
  892|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (892:22): [True: 0, False: 0]
  ------------------
  893|      0|    std::string value = pos->toString(i);
  894|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (894:9): [True: 0, False: 0]
  ------------------
  895|      0|#ifndef SUPPRESS_WARNINGS
  896|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  897|      0|#endif
  898|      0|      return;
  899|      0|    }
  900|      0|    array += value;
  901|      0|    if (i != pos->count() - 1)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|      array += " ";
  903|      0|  }
  904|      0|  (*exifData_)[to] = array;
  905|      0|  if (erase_)
  ------------------
  |  Branch (905:7): [True: 0, False: 0]
  ------------------
  906|      0|    xmpData_->erase(pos);
  907|      0|}
_ZN5Exiv29Converter10cnvXmpDateEPKcS2_:
  909|  7.80k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  7.80k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  7.80k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 7.46k, False: 341]
  ------------------
  912|  7.46k|    return;
  913|    341|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 341]
  ------------------
  914|      0|    return;
  915|    341|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    341|  std::string value = pos->toString();
  917|    341|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 341]
  ------------------
  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|    341|  XMP_DateTime datetime;
  924|    341|  try {
  925|    341|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    341|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 111, False: 230]
  ------------------
  927|    111|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    111|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    111|#define stringFormat std::format
  ------------------
  930|    111|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    111|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 6, False: 105]
  ------------------
  933|      6|        const char* subsecTag = nullptr;
  934|      6|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 0, False: 6]
  ------------------
  935|      0|          subsecTag = "Exif.Photo.SubSecTime";
  936|      6|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 5, False: 1]
  ------------------
  937|      5|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|      5|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 1, False: 0]
  ------------------
  939|      1|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|      1|        }
  941|      6|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 6, False: 0]
  ------------------
  942|      6|          prepareExifTarget(subsecTag, true);
  943|      6|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|      6|        }
  945|      6|      }
  946|    230|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    230|      URational rhour(datetime.hour, 1);
  950|    230|      URational rmin(datetime.minute, 1);
  951|    230|      URational rsec(datetime.second, 1);
  952|    230|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 230]
  ------------------
  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|    230|      std::ostringstream array;
  964|    230|      array << rhour << " " << rmin << " " << rsec;
  965|    230|      (*exifData_)[to] = array.str();
  966|       |
  967|    230|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    230|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    230|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    230|#define stringFormat std::format
  ------------------
  970|    230|    }
  971|    341|  }
  972|    341|#ifndef SUPPRESS_WARNINGS
  973|    341|  catch (const XMP_Error& e) {
  974|    231|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    231|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 231]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    231|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    231|    return;
  976|    231|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    110|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 110]
  ------------------
  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|    110|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  3.90k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.90k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.90k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.90k, False: 0]
  ------------------
  995|  3.90k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  1.95k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.95k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.95k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.95k, False: 0]
  ------------------
 1015|  1.95k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  1.95k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.95k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.95k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.95k, False: 0]
  ------------------
 1035|  1.95k|    return;
 1036|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1036:7): [True: 0, False: 0]
  ------------------
 1037|      0|    return;
 1038|      0|  unsigned short value = 0;
 1039|       |
 1040|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:33): [True: 0, False: 0]
  ------------------
 1041|      0|    auto fired = pos->toUint32();
 1042|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1042:9): [True: 0, False: 0]
  ------------------
 1043|      0|      value |= fired & 1;
 1044|      0|#ifndef SUPPRESS_WARNINGS
 1045|      0|    else
 1046|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Fired"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1047|      0|                  << " to " << to << "\n";
 1048|      0|#endif
 1049|      0|  }
 1050|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Return"));
 1051|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:33): [True: 0, False: 0]
  ------------------
 1052|      0|    auto ret = pos->toUint32();
 1053|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1053:9): [True: 0, False: 0]
  ------------------
 1054|      0|      value |= (ret & 3) << 1;
 1055|      0|#ifndef SUPPRESS_WARNINGS
 1056|      0|    else
 1057|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Return"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1058|      0|                  << " to " << to << "\n";
 1059|      0|#endif
 1060|      0|  }
 1061|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Mode"));
 1062|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:33): [True: 0, False: 0]
  ------------------
 1063|      0|    auto mode = pos->toUint32();
 1064|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      value |= (mode & 3) << 3;
 1066|      0|#ifndef SUPPRESS_WARNINGS
 1067|      0|    else
 1068|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Mode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1069|      0|                  << " to " << to << "\n";
 1070|      0|#endif
 1071|      0|  }
 1072|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Function"));
 1073|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:33): [True: 0, False: 0]
  ------------------
 1074|      0|    auto function = pos->toUint32();
 1075|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1075:9): [True: 0, False: 0]
  ------------------
 1076|      0|      value |= (function & 1) << 5;
 1077|      0|#ifndef SUPPRESS_WARNINGS
 1078|      0|    else
 1079|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Function"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1080|      0|                  << " to " << to << "\n";
 1081|      0|#endif
 1082|      0|  }
 1083|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:RedEyeMode"));
 1084|      0|  if (pos != xmpData_->end()) {
  ------------------
  |  Branch (1084:7): [True: 0, False: 0]
  ------------------
 1085|      0|    if (pos->count() > 0) {
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|      auto red = pos->toUint32();
 1087|      0|      if (pos->value().ok())
  ------------------
  |  Branch (1087:11): [True: 0, False: 0]
  ------------------
 1088|      0|        value |= (red & 1) << 6;
 1089|      0|#ifndef SUPPRESS_WARNINGS
 1090|      0|      else
 1091|      0|        EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:RedEyeMode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1092|      0|                    << " to " << to << "\n";
 1093|      0|#endif
 1094|      0|    }
 1095|      0|    if (erase_)
  ------------------
  |  Branch (1095:9): [True: 0, False: 0]
  ------------------
 1096|      0|      xmpData_->erase(pos);
 1097|      0|  }
 1098|       |
 1099|      0|  (*exifData_)[to] = value;
 1100|      0|}
_ZN5Exiv29Converter14cnvXmpGPSCoordEPKcS2_:
 1102|  7.80k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  7.80k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  7.80k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 7.80k, False: 0]
  ------------------
 1105|  7.80k|    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|}
_ZN5Exiv29Converter12cnvIptcValueEPKcS2_:
 1165|  37.2k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  37.2k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  37.2k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 36.7k, False: 438]
  ------------------
 1168|  36.7k|    return;
 1169|    438|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 438]
  ------------------
 1170|      0|    return;
 1171|   101k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 101k, False: 438]
  ------------------
 1172|   101k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 51.2k, False: 49.9k]
  ------------------
 1173|  51.2k|      std::string value = pos->toString();
 1174|  51.2k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 51.2k]
  ------------------
 1175|      0|#ifndef SUPPRESS_WARNINGS
 1176|      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()
  ------------------
 1177|      0|#endif
 1178|      0|        ++pos;
 1179|      0|        continue;
 1180|      0|      }
 1181|  51.2k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 51.2k, False: 0]
  ------------------
 1182|  51.2k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  51.2k|      (*xmpData_)[to] = value;
 1184|  51.2k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 51.2k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  51.2k|    }
 1189|   101k|    ++pos;
 1190|   101k|  }
 1191|    438|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  42.9k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  42.9k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  42.9k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 42.0k, False: 886]
  ------------------
 1196|  42.0k|    return;
 1197|    886|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 886]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    886|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 247, False: 639]
  |  Branch (1200:35): [True: 425, False: 214]
  ------------------
 1201|    672|    std::string value;
 1202|    672|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 133, False: 539]
  ------------------
 1203|    133|#ifndef SUPPRESS_WARNINGS
 1204|    133|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    133|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 133]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    133|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    133|#endif
 1206|    133|      return;
 1207|    133|    }
 1208|    539|    (*iptcData_)[to] = value;
 1209|    539|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    539|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 539]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    539|    return;
 1213|    672|  }
 1214|       |
 1215|    214|  size_t count = pos->count();
 1216|    214|  bool added = false;
 1217|  51.7k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 51.5k, False: 214]
  ------------------
 1218|  51.5k|    std::string value = pos->toString(i);
 1219|  51.5k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 51.5k]
  ------------------
 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|  51.5k|    IptcKey key(to);
 1226|  51.5k|    Iptcdatum id(key);
 1227|  51.5k|    id.setValue(value);
 1228|  51.5k|    iptcData_->add(id);
 1229|  51.5k|    added = true;
 1230|  51.5k|  }
 1231|    214|  if (added)
  ------------------
  |  Branch (1231:7): [True: 206, False: 8]
  ------------------
 1232|    206|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    214|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 214]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    214|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  1.87k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1317|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1318|       |  /// effect
 1319|  1.87k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  1.87k|  converter.cnvToXmp();
 1321|  1.87k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.95k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.95k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.95k|  converter.cnvFromXmp();
 1333|  1.95k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  1.86k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  1.86k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 1.86k, False: 0]
  ------------------
 1349|  1.86k|    iptcCharset = iptcData.detectCharset();
 1350|  1.86k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 1.86k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  1.86k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  1.86k|  converter.cnvToXmp();
 1355|  1.86k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.95k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.95k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.95k|  converter.cnvFromXmp();
 1371|  1.95k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  97.1k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  97.1k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 51.2k, False: 45.9k]
  ------------------
 1382|  51.2k|    return true;  // nothing to do
 1383|  45.9k|#ifdef EXV_HAVE_ICONV
 1384|  45.9k|  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|  97.1k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  45.9k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  45.9k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 45.9k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  45.9k|  bool ret = true;
 1407|  45.9k|  auto cd = iconv_open(to.data(), from.data());
 1408|  45.9k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 45.9k]
  ------------------
 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|  45.9k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  45.9k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  45.9k|#endif
 1420|  45.9k|  size_t inbytesleft = str.length();
 1421|  64.8k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 57.5k, False: 7.34k]
  ------------------
 1422|  57.5k|    char outbuf[256];
 1423|  57.5k|    char* outptr = outbuf;
 1424|  57.5k|    size_t outbytesleft = sizeof(outbuf);
 1425|  57.5k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  57.5k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  57.5k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 51.2k, False: 6.28k]
  |  Branch (1427:53): [True: 38.5k, False: 12.6k]
  ------------------
 1428|  38.5k|#ifndef SUPPRESS_WARNINGS
 1429|  38.5k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  38.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 38.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  38.5k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  38.5k|#endif
 1431|  38.5k|      ret = false;
 1432|  38.5k|      break;
 1433|  38.5k|    }
 1434|  18.9k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  18.9k|  }
 1436|       |
 1437|  45.9k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 45.9k, False: 0]
  ------------------
 1438|  45.9k|    iconv_close(cd);
 1439|       |
 1440|  45.9k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 7.34k, False: 38.5k]
  ------------------
 1441|  7.34k|    str = std::move(outstr);
 1442|  45.9k|  return ret;
 1443|  45.9k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|  1.11k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|  1.11k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 440, False: 675]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    440|    value = pos->toString(0);
 1596|    440|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 393, False: 47]
  |  Branch (1596:31): [True: 143, False: 250]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    143|      value = pos->toString();
 1600|    143|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 143, False: 0]
  |  Branch (1600:32): [True: 143, False: 0]
  ------------------
 1601|    143|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    143|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 143, False: 0]
  ------------------
 1603|    143|          value = value.substr(first_space_pos + 1);
 1604|    143|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    143|      }
 1608|    143|    }
 1609|    675|  } else {
 1610|    675|    value = pos->toString();
 1611|    675|  }
 1612|  1.11k|  return pos->value().ok();
 1613|  1.11k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  33.7k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  33.7k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  33.7k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  33.7k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 33.7k]
  |  Branch (18:17): [True: 0, False: 33.7k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  33.7k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 2.30k, False: 31.4k]
  |  Branch (22:26): [True: 2.26k, False: 39]
  ------------------
   23|  2.26k|    setByteOrder(littleEndian);
   24|  31.4k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 11.3k, False: 20.1k]
  |  Branch (24:33): [True: 11.3k, False: 61]
  ------------------
   25|  11.3k|    setByteOrder(bigEndian);
   26|  20.1k|  } else {
   27|  20.1k|    return false;
   28|  20.1k|  }
   29|  13.5k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 5.68k, False: 7.88k]
  ------------------
   30|  5.68k|    return false;
   31|  7.88k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  7.88k|  if (0 != memcmp(pData + 8, cr2sig_.data(), 4))
  ------------------
  |  Branch (32:7): [True: 6.43k, False: 1.44k]
  ------------------
   33|  6.43k|    return false;
   34|  1.44k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  1.44k|  return true;
   37|  7.88k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    147|DataBuf Cr2Header::write() const {
   40|    147|  DataBuf buf(16);
   41|    147|  switch (byteOrder()) {
   42|    109|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 109, False: 38]
  ------------------
   43|    109|      buf.write_uint8(0, 'I');
   44|    109|      break;
   45|     38|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 38, False: 109]
  ------------------
   46|     38|      buf.write_uint8(0, 'M');
   47|     38|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 147]
  ------------------
   49|      0|      break;
   50|    147|  }
   51|    147|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    147|  buf.write_uint16(2, tag(), byteOrder());
   54|    147|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    147|  std::copy(cr2sig_.begin(), cr2sig_.end(), buf.begin() + 8);
   56|       |  // Write a dummy value for the RAW IFD offset. The offset-writer is used to set this offset in a second pass.
   57|    147|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    147|  return buf;
   59|    147|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  48.3k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  48.3k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 459, False: 47.8k]
  |  Branch (63:33): [True: 646, False: 47.2k]
  ------------------
   64|  1.10k|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  47.2k|  return isTiffImageTag(tag, group);
   67|  48.3k|}

_ZN5Exiv28Internal9Cr2Header11offset2addrEv:
   53|    173|  static uint32_t offset2addr() {
   54|    173|    return 12;
   55|    173|  }

_ZN5Exiv28Cr2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   24|    232|    Image(ImageType::cr2, mdExif | mdIptc | mdXmp, std::move(io)) {
   25|    232|}  // Cr2Image::Cr2Image
_ZNK5Exiv28Cr2Image10pixelWidthEv:
   31|     37|uint32_t Cr2Image::pixelWidth() const {
   32|     37|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
   33|     37|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (33:7): [True: 0, False: 37]
  |  Branch (33:7): [True: 0, False: 37]
  |  Branch (33:40): [True: 0, False: 0]
  ------------------
   34|      0|    return imageWidth->toUint32();
   35|      0|  }
   36|     37|  return 0;
   37|     37|}
_ZNK5Exiv28Cr2Image11pixelHeightEv:
   39|     37|uint32_t Cr2Image::pixelHeight() const {
   40|     37|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
   41|     37|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 37]
  |  Branch (41:7): [True: 0, False: 37]
  |  Branch (41:41): [True: 0, False: 0]
  ------------------
   42|      0|    return imageHeight->toUint32();
   43|      0|  }
   44|     37|  return 0;
   45|     37|}
_ZN5Exiv28Cr2Image12readMetadataEv:
   59|    232|void Cr2Image::readMetadata() {
   60|       |#ifdef EXIV2_DEBUG_MESSAGES
   61|       |  std::cerr << "Reading CR2 file " << io_->path() << "\n";
   62|       |#endif
   63|    232|  if (io_->open() != 0) {
  ------------------
  |  Branch (63:7): [True: 0, False: 232]
  ------------------
   64|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   65|      0|  }
   66|    232|  IoCloser closer(*io_);
   67|       |  // Ensure that this is the correct image type
   68|    232|  if (!isCr2Type(*io_, false)) {
  ------------------
  |  Branch (68:7): [True: 0, False: 232]
  ------------------
   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|    232|  clearMetadata();
   74|    232|  ByteOrder bo = Cr2Parser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
   75|    232|  setByteOrder(bo);
   76|    232|}  // Cr2Image::readMetadata
_ZN5Exiv28Cr2Image13writeMetadataEv:
   78|    173|void Cr2Image::writeMetadata() {
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |  std::cerr << "Writing CR2 file " << io_->path() << "\n";
   81|       |#endif
   82|    173|  ByteOrder bo = byteOrder();
   83|    173|  const byte* pData = nullptr;
   84|    173|  size_t size = 0;
   85|    173|  IoCloser closer(*io_);
   86|       |  // Ensure that this is the correct image type
   87|    173|  if (io_->open() == 0 && isCr2Type(*io_, false)) {
  ------------------
  |  Branch (87:7): [True: 173, False: 0]
  |  Branch (87:27): [True: 173, False: 0]
  ------------------
   88|    173|    pData = io_->mmap(true);
   89|    173|    size = io_->size();
   90|    173|    Internal::Cr2Header cr2Header;
   91|    173|    if (0 == cr2Header.read(pData, 16)) {
  ------------------
  |  Branch (91:9): [True: 0, False: 173]
  ------------------
   92|      0|      bo = cr2Header.byteOrder();
   93|      0|    }
   94|    173|  }
   95|    173|  if (bo == invalidByteOrder) {
  ------------------
  |  Branch (95:7): [True: 0, False: 173]
  ------------------
   96|      0|    bo = littleEndian;
   97|      0|  }
   98|    173|  setByteOrder(bo);
   99|    173|  Cr2Parser::encode(*io_, pData, size, bo, exifData_, iptcData_, xmpData_);  // may throw
  100|    173|}  // Cr2Image::writeMetadata
_ZN5Exiv29Cr2Parser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  102|    232|ByteOrder Cr2Parser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  103|    232|  Internal::Cr2Header cr2Header;
  104|    232|  return Internal::TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Internal::Tag::root,
  105|    232|                                            Internal::TiffMapping::findDecoder, &cr2Header);
  106|    232|}
_ZN5Exiv29Cr2Parser6encodeERNS_7BasicIoEPKhmNS_9ByteOrderERNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataE:
  109|    173|                              const IptcData& iptcData, const XmpData& xmpData) {
  110|       |  // Delete IFDs which do not occur in TIFF images
  111|    173|  static constexpr auto filteredIfds = std::array{
  112|    173|      IfdId::panaRawId,
  113|    173|  };
  114|    173|  for (auto&& filteredIfd : filteredIfds) {
  ------------------
  |  Branch (114:27): [True: 173, False: 173]
  ------------------
  115|       |#ifdef EXIV2_DEBUG_MESSAGES
  116|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  117|       |#endif
  118|    173|    exifData.erase(std::remove_if(exifData.begin(), exifData.end(), Internal::FindExifdatum(filteredIfd)),
  119|    173|                   exifData.end());
  120|    173|  }
  121|       |
  122|    173|  auto header = Internal::Cr2Header(byteOrder);
  123|    173|  Internal::OffsetWriter offsetWriter;
  124|    173|  offsetWriter.setOrigin(Internal::OffsetWriter::cr2RawIfdOffset, Internal::Cr2Header::offset2addr(), byteOrder);
  125|    173|  return Internal::TiffParserWorker::encode(io, pData, size, exifData, iptcData, xmpData, Internal::Tag::root,
  126|    173|                                            Internal::TiffMapping::findEncoder, &header, &offsetWriter);
  127|    173|}
_ZN5Exiv214newCr2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  131|    232|Image::UniquePtr newCr2Instance(BasicIo::UniquePtr io, bool create) {
  132|    232|  auto image = std::make_unique<Cr2Image>(std::move(io), create);
  133|    232|  if (!image->good()) {
  ------------------
  |  Branch (133:7): [True: 0, False: 232]
  ------------------
  134|      0|    return nullptr;
  135|      0|  }
  136|    232|  return image;
  137|    232|}
_ZN5Exiv29isCr2TypeERNS_7BasicIoEb:
  139|  33.3k|bool isCr2Type(BasicIo& iIo, bool advance) {
  140|  33.3k|  const int32_t len = 16;
  141|  33.3k|  byte buf[len];
  142|  33.3k|  iIo.read(buf, len);
  143|  33.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (143:7): [True: 0, False: 33.3k]
  |  Branch (143:22): [True: 149, False: 33.1k]
  ------------------
  144|    149|    return false;
  145|    149|  }
  146|  33.1k|  Internal::Cr2Header header;
  147|  33.1k|  bool rc = header.read(buf, len);
  148|  33.1k|  if (!advance || !rc) {
  ------------------
  |  Branch (148:7): [True: 33.1k, False: 0]
  |  Branch (148:19): [True: 0, False: 0]
  ------------------
  149|  33.1k|    iIo.seek(-len, BasicIo::cur);
  150|  33.1k|  }
  151|  33.1k|  return rc;
  152|  33.3k|}

_ZN5Exiv28CrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   26|    567|CrwImage::CrwImage(BasicIo::UniquePtr io, bool /*create*/) : Image(ImageType::crw, mdExif | mdComment, std::move(io)) {
   27|    567|}  // CrwImage::CrwImage
_ZNK5Exiv28CrwImage10pixelWidthEv:
   33|     25|uint32_t CrwImage::pixelWidth() const {
   34|     25|  auto widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
   35|     25|  if (widthIter != exifData_.end() && widthIter->count() > 0) {
  ------------------
  |  Branch (35:7): [True: 0, False: 25]
  |  Branch (35:7): [True: 0, False: 25]
  |  Branch (35:39): [True: 0, False: 0]
  ------------------
   36|      0|    return widthIter->toUint32();
   37|      0|  }
   38|     25|  return 0;
   39|     25|}
_ZNK5Exiv28CrwImage11pixelHeightEv:
   41|     25|uint32_t CrwImage::pixelHeight() const {
   42|     25|  auto heightIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
   43|     25|  if (heightIter != exifData_.end() && heightIter->count() > 0) {
  ------------------
  |  Branch (43:7): [True: 0, False: 25]
  |  Branch (43:7): [True: 0, False: 25]
  |  Branch (43:40): [True: 0, False: 0]
  ------------------
   44|      0|    return heightIter->toUint32();
   45|      0|  }
   46|     25|  return 0;
   47|     25|}
_ZN5Exiv28CrwImage12readMetadataEv:
   54|    567|void CrwImage::readMetadata() {
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |  std::cerr << "Reading CRW file " << io_->path() << "\n";
   57|       |#endif
   58|    567|  if (io_->open()) {
  ------------------
  |  Branch (58:7): [True: 0, False: 567]
  ------------------
   59|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   60|      0|  }
   61|    567|  IoCloser closer(*io_);
   62|       |  // Ensure that this is the correct image type
   63|    567|  if (!isCrwType(*io_, false)) {
  ------------------
  |  Branch (63:7): [True: 0, False: 567]
  ------------------
   64|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (64:9): [True: 0, False: 0]
  |  Branch (64:25): [True: 0, False: 0]
  ------------------
   65|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   66|      0|    throw Error(ErrorCode::kerNotACrwImage);
   67|      0|  }
   68|    567|  clearMetadata();
   69|    567|  DataBuf file(io().size());
   70|    567|  io_->read(file.data(), file.size());
   71|       |
   72|    567|  CrwParser::decode(this, io_->mmap(), io_->size());
   73|       |
   74|    567|}  // CrwImage::readMetadata
_ZN5Exiv28CrwImage13writeMetadataEv:
   76|    205|void CrwImage::writeMetadata() {
   77|       |#ifdef EXIV2_DEBUG_MESSAGES
   78|       |  std::cerr << "Writing CRW file " << io_->path() << "\n";
   79|       |#endif
   80|       |  // Read existing image
   81|    205|  DataBuf buf;
   82|    205|  if (io_->open() == 0) {
  ------------------
  |  Branch (82:7): [True: 205, False: 0]
  ------------------
   83|    205|    IoCloser closer(*io_);
   84|       |    // Ensure that this is the correct image type
   85|    205|    if (isCrwType(*io_, false)) {
  ------------------
  |  Branch (85:9): [True: 205, False: 0]
  ------------------
   86|       |      // Read the image into a memory buffer
   87|    205|      buf.alloc(io_->size());
   88|    205|      io_->read(buf.data(), buf.size());
   89|    205|      if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (89:11): [True: 0, False: 205]
  |  Branch (89:27): [True: 0, False: 205]
  ------------------
   90|      0|        buf.reset();
   91|      0|      }
   92|    205|    }
   93|    205|  }
   94|       |
   95|    205|  Blob blob;
   96|    205|  CrwParser::encode(blob, buf.c_data(), buf.size(), this);
   97|       |
   98|       |  // Write new buffer to file
   99|    205|  MemIo tempIo;
  100|    205|  tempIo.write((!blob.empty() ? blob.data() : nullptr), blob.size());
  ------------------
  |  Branch (100:17): [True: 200, False: 5]
  ------------------
  101|    205|  io_->close();
  102|    205|  io_->transfer(tempIo);  // may throw
  103|       |
  104|    205|}  // CrwImage::writeMetadata
_ZN5Exiv29CrwParser6decodeEPNS_8CrwImageEPKhm:
  106|    567|void CrwParser::decode(CrwImage* pCrwImage, const byte* pData, size_t size) {
  107|       |  // Parse the image, starting with a CIFF header component
  108|    567|  Internal::CiffHeader header;
  109|    567|  header.read(pData, size);
  110|    567|  header.decode(*pCrwImage);
  111|       |
  112|       |  // a hack to get absolute offset of preview image inside CRW structure
  113|    567|  if (auto preview = header.findComponent(0x2007, 0x0000)) {
  ------------------
  |  Branch (113:12): [True: 6, False: 561]
  ------------------
  114|      6|    (pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = static_cast<uint32_t>(preview->pData() - pData);
  115|      6|    (pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(preview->size());
  116|      6|  }
  117|    567|}  // CrwParser::decode
_ZN5Exiv29CrwParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmPKNS_8CrwImageE:
  119|    205|void CrwParser::encode(Blob& blob, const byte* pData, size_t size, const CrwImage* pCrwImage) {
  120|       |  // Parse image, starting with a CIFF header component
  121|    205|  Internal::CiffHeader header;
  122|    205|  if (size != 0) {
  ------------------
  |  Branch (122:7): [True: 205, False: 0]
  ------------------
  123|    205|    header.read(pData, size);
  124|    205|  }
  125|       |
  126|       |  // Encode Exif tags from image into the CRW parse tree and write the
  127|       |  // structure to the binary image blob
  128|    205|  Internal::CrwMap::encode(header, *pCrwImage);
  129|    205|  header.write(blob);
  130|    205|}
_ZN5Exiv214newCrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  134|    567|Image::UniquePtr newCrwInstance(BasicIo::UniquePtr io, bool create) {
  135|    567|  auto image = std::make_unique<CrwImage>(std::move(io), create);
  136|    567|  if (!image->good()) {
  ------------------
  |  Branch (136:7): [True: 0, False: 567]
  ------------------
  137|      0|    return nullptr;
  138|      0|  }
  139|    567|  return image;
  140|    567|}
_ZN5Exiv29isCrwTypeERNS_7BasicIoEb:
  142|  33.8k|bool isCrwType(BasicIo& iIo, bool advance) {
  143|  33.8k|  bool result = true;
  144|  33.8k|  byte tmpBuf[14];
  145|  33.8k|  iIo.read(tmpBuf, 14);
  146|  33.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (146:7): [True: 0, False: 33.8k]
  |  Branch (146:22): [True: 149, False: 33.6k]
  ------------------
  147|    149|    return false;
  148|    149|  }
  149|  33.6k|  if (('I' != tmpBuf[0] || 'I' != tmpBuf[1]) && ('M' != tmpBuf[0] || 'M' != tmpBuf[1])) {
  ------------------
  |  Branch (149:8): [True: 31.4k, False: 2.24k]
  |  Branch (149:28): [True: 39, False: 2.20k]
  |  Branch (149:50): [True: 20.1k, False: 11.3k]
  |  Branch (149:70): [True: 61, False: 11.2k]
  ------------------
  150|  20.1k|    result = false;
  151|  20.1k|  }
  152|  33.6k|  if (result && std::memcmp(tmpBuf + 6, Internal::CiffHeader::signature(), 8) != 0) {
  ------------------
  |  Branch (152:7): [True: 13.4k, False: 20.1k]
  |  Branch (152:17): [True: 11.5k, False: 1.90k]
  ------------------
  153|  11.5k|    result = false;
  154|  11.5k|  }
  155|  33.6k|  if (!advance || !result)
  ------------------
  |  Branch (155:7): [True: 33.6k, False: 0]
  |  Branch (155:19): [True: 0, False: 0]
  ------------------
  156|  33.6k|    iIo.seek(-14, BasicIo::cur);
  157|  33.6k|  return result;
  158|  33.8k|}

_ZN5Exiv28Internal13CiffComponentC2Ett:
  123|    443|CiffComponent::CiffComponent(uint16_t tag, uint16_t dir) : dir_(dir), tag_(tag) {
  124|    443|}
_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  126|  55.3k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  127|  55.3k|  return doAdd(std::move(component));
  128|  55.3k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  134|  55.3k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  135|  55.3k|  return components_.emplace_back(std::move(component));
  136|  55.3k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  140|    772|void CiffHeader::read(const byte* pData, size_t size) {
  141|    772|  if (size < 14)
  ------------------
  |  Branch (141:7): [True: 0, False: 772]
  ------------------
  142|      0|    throw Error(ErrorCode::kerNotACrwImage);
  143|       |
  144|    772|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (144:7): [True: 558, False: 214]
  |  Branch (144:26): [True: 558, False: 0]
  ------------------
  145|    558|    byteOrder_ = littleEndian;
  146|    558|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (146:14): [True: 214, False: 0]
  |  Branch (146:33): [True: 214, False: 0]
  ------------------
  147|    214|    byteOrder_ = bigEndian;
  148|    214|  } else {
  149|      0|    throw Error(ErrorCode::kerNotACrwImage);
  150|      0|  }
  151|    772|  offset_ = getULong(pData + 2, byteOrder_);
  152|    772|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (152:7): [True: 21, False: 751]
  |  Branch (152:23): [True: 48, False: 703]
  ------------------
  153|     69|    throw Error(ErrorCode::kerNotACrwImage);
  154|    703|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (154:7): [True: 0, False: 703]
  ------------------
  155|      0|    throw Error(ErrorCode::kerNotACrwImage);
  156|      0|  }
  157|       |
  158|    703|  pPadding_.clear();
  159|    703|  if (offset_ > 14) {
  ------------------
  |  Branch (159:7): [True: 535, False: 168]
  ------------------
  160|    535|    pPadding_.resize(offset_ - 14);
  161|    535|    padded_ = offset_ - 14;
  162|    535|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  163|    535|  }
  164|       |
  165|    703|  pRootDir_ = std::make_unique<CiffDirectory>();
  166|    703|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  167|    703|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  169|  55.1k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  170|  55.1k|  doRead(pData, size, start, byteOrder);
  171|  55.1k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  173|  55.1k|void CiffComponent::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  174|       |  // We're going read 10 bytes. Make sure they won't be out-of-bounds.
  175|  55.1k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (175:11): [True: 55.1k, False: 0]
  |  Branch (175:25): [True: 55.1k, False: 0]
  ------------------
  176|  55.1k|  tag_ = getUShort(pData + start, byteOrder);
  177|       |
  178|  55.1k|  DataLocId dl = dataLocation();
  179|       |
  180|  55.1k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (180:7): [True: 3.61k, False: 51.5k]
  ------------------
  181|  3.61k|    size_ = getULong(pData + start + 2, byteOrder);
  182|  3.61k|    offset_ = getULong(pData + start + 6, byteOrder);
  183|       |
  184|       |    // Make sure that the sub-region does not overlap with the 10 bytes
  185|       |    // that we just read. (Otherwise a malicious file could cause an
  186|       |    // infinite recursion.) There are two cases two consider because
  187|       |    // the sub-region is allowed to be either before or after the 10
  188|       |    // bytes in memory.
  189|  3.61k|    if (offset_ < start) {
  ------------------
  |  Branch (189:9): [True: 3.06k, False: 558]
  ------------------
  190|       |      // Sub-region is before in memory.
  191|  3.06k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  192|  3.06k|    } else {
  193|       |      // Sub-region is after in memory.
  194|    558|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  195|    558|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  196|    558|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  197|    558|    }
  198|  3.61k|  }
  199|  55.1k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (199:7): [True: 51.4k, False: 3.64k]
  ------------------
  200|  51.4k|    size_ = 8;
  201|  51.4k|    offset_ = start + 2;
  202|  51.4k|  }
  203|  55.1k|  pData_ = pData + offset_;
  204|       |#ifdef EXIV2_DEBUG_MESSAGES
  205|       |  std::cout << "  Entry for tag 0x" << std::hex << tagId() << " (0x" << tag() << "), " << std::dec << size_
  206|       |            << " Bytes, Offset is " << offset_ << "\n";
  207|       |#endif
  208|       |
  209|  55.1k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  211|  2.02k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  212|  2.02k|  CiffComponent::doRead(pData, size, start, byteOrder);
  213|       |#ifdef EXIV2_DEBUG_MESSAGES
  214|       |  std::cout << "Reading directory 0x" << std::hex << tag() << "\n";
  215|       |#endif
  216|  2.02k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (216:7): [True: 0, False: 2.02k]
  ------------------
  217|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  218|       |
  219|  2.02k|  readDirectory(pData + offset(), this->size(), byteOrder);
  220|       |#ifdef EXIV2_DEBUG_MESSAGES
  221|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  222|       |#endif
  223|  2.02k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  225|  2.68k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  226|  2.68k|  if (size < 4)
  ------------------
  |  Branch (226:7): [True: 16, False: 2.67k]
  ------------------
  227|     16|    throw Error(ErrorCode::kerCorruptedMetadata);
  228|  2.67k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  229|  2.67k|  if (o > size - 2)
  ------------------
  |  Branch (229:7): [True: 33, False: 2.63k]
  ------------------
  230|     33|    throw Error(ErrorCode::kerCorruptedMetadata);
  231|  2.63k|  uint16_t count = getUShort(pData + o, byteOrder);
  232|       |#ifdef EXIV2_DEBUG_MESSAGES
  233|       |  std::cout << "Directory at offset " << std::dec << o << ", " << count << " entries \n";
  234|       |#endif
  235|  2.63k|  o += 2;
  236|  2.63k|  if (count * 10u > size - o)
  ------------------
  |  Branch (236:7): [True: 25, False: 2.61k]
  ------------------
  237|     25|    throw Error(ErrorCode::kerCorruptedMetadata);
  238|       |
  239|  57.7k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (239:24): [True: 55.1k, False: 2.61k]
  ------------------
  240|  55.1k|    uint16_t tag = getUShort(pData + o, byteOrder);
  241|  55.1k|    auto m = [this, tag]() -> UniquePtr {
  242|  55.1k|      if (this->typeId(tag) == TypeId::directory)
  243|  55.1k|        return std::make_unique<CiffDirectory>();
  244|  55.1k|      return std::make_unique<CiffEntry>();
  245|  55.1k|    }();
  246|  55.1k|    m->setDir(this->tag());
  247|  55.1k|    m->read(pData, size, o, byteOrder);
  248|  55.1k|    add(std::move(m));
  249|  55.1k|    o += 10;
  250|  55.1k|  }
  251|  2.61k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  253|    237|void CiffHeader::decode(Image& image) const {
  254|       |  // Nothing to decode from the header itself, just add correct byte order
  255|    237|  if (pRootDir_)
  ------------------
  |  Branch (255:7): [True: 237, False: 0]
  ------------------
  256|    237|    pRootDir_->decode(image, byteOrder_);
  257|    237|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  259|  27.1k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  260|  27.1k|  doDecode(image, byteOrder);
  261|  27.1k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  263|  25.9k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  264|  25.9k|  CrwMap::decode(*this, image, byteOrder);
  265|  25.9k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  267|  1.22k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  268|  26.8k|  for (auto&& component : components_) {
  ------------------
  |  Branch (268:25): [True: 26.8k, False: 1.22k]
  ------------------
  269|  26.8k|    component->decode(image, byteOrder);
  270|  26.8k|  }
  271|  1.22k|}  // CiffDirectory::doDecode
_ZNK5Exiv28Internal10CiffHeader5writeERNSt3__16vectorIhNS2_9allocatorIhEEEE:
  273|    200|void CiffHeader::write(Blob& blob) const {
  274|    200|  if (byteOrder_ == littleEndian) {
  ------------------
  |  Branch (274:7): [True: 188, False: 12]
  ------------------
  275|    188|    blob.push_back('I');
  276|    188|    blob.push_back('I');
  277|    188|  } else {
  278|     12|    blob.push_back('M');
  279|     12|    blob.push_back('M');
  280|     12|  }
  281|    200|  uint32_t o = 2;
  282|    200|  byte buf[4];
  283|    200|  ul2Data(buf, offset_, byteOrder_);
  284|    200|  append(blob, buf, 4);
  285|    200|  o += 4;
  286|    200|  append(blob, signature_, 8);
  287|    200|  o += 8;
  288|       |  // Pad as needed
  289|    200|  if (!pPadding_.empty()) {
  ------------------
  |  Branch (289:7): [True: 189, False: 11]
  ------------------
  290|    189|    append(blob, pPadding_.data(), padded_);
  291|    189|  } else {
  292|     11|    for (uint32_t i = o; i < offset_; ++i) {
  ------------------
  |  Branch (292:26): [True: 0, False: 11]
  ------------------
  293|      0|      blob.push_back(0);
  294|      0|      ++o;
  295|      0|    }
  296|     11|  }
  297|    200|  if (pRootDir_) {
  ------------------
  |  Branch (297:7): [True: 200, False: 0]
  ------------------
  298|    200|    pRootDir_->write(blob, byteOrder_, offset_);
  299|    200|  }
  300|    200|}
_ZN5Exiv28Internal13CiffComponent5writeERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  302|  27.3k|size_t CiffComponent::write(Blob& blob, ByteOrder byteOrder, size_t offset) {
  303|  27.3k|  return doWrite(blob, byteOrder, offset);
  304|  27.3k|}
_ZN5Exiv28Internal9CiffEntry7doWriteERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  306|  26.0k|size_t CiffEntry::doWrite(Blob& blob, ByteOrder /*byteOrder*/, size_t offset) {
  307|  26.0k|  return writeValueData(blob, offset);
  308|  26.0k|}
_ZN5Exiv28Internal13CiffComponent14writeValueDataERNSt3__16vectorIhNS2_9allocatorIhEEEEm:
  310|  26.0k|size_t CiffComponent::writeValueData(Blob& blob, size_t offset) {
  311|  26.0k|  if (dataLocation() == DataLocId::valueData) {
  ------------------
  |  Branch (311:7): [True: 1.26k, False: 24.7k]
  ------------------
  312|       |#ifdef EXIV2_DEBUG_MESSAGES
  313|       |    std::cout << "  Data for tag 0x" << std::hex << tagId() << ", " << std::dec << size_ << " Bytes\n";
  314|       |#endif
  315|  1.26k|    offset_ = offset;
  316|  1.26k|    append(blob, pData_, size_);
  317|  1.26k|    offset += size_;
  318|       |    // Pad the value to an even number of bytes
  319|  1.26k|    if (size_ % 2 == 1) {
  ------------------
  |  Branch (319:9): [True: 142, False: 1.12k]
  ------------------
  320|    142|      blob.push_back(0);
  321|    142|      ++offset;
  322|    142|    }
  323|  1.26k|  }
  324|  26.0k|  return offset;
  325|  26.0k|}
_ZN5Exiv28Internal13CiffDirectory7doWriteERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  327|  1.37k|size_t CiffDirectory::doWrite(Blob& blob, ByteOrder byteOrder, size_t offset) {
  328|       |#ifdef EXIV2_DEBUG_MESSAGES
  329|       |  std::cout << "Writing directory 0x" << std::hex << tag() << "---->\n";
  330|       |#endif
  331|       |  // Ciff offsets are relative to the start of the directory
  332|  1.37k|  size_t dirOffset = 0;
  333|       |
  334|       |  // Value data
  335|  27.1k|  for (auto&& component : components_) {
  ------------------
  |  Branch (335:25): [True: 27.1k, False: 1.37k]
  ------------------
  336|  27.1k|    dirOffset = component->write(blob, byteOrder, dirOffset);
  337|  27.1k|  }
  338|  1.37k|  const auto dirStart = static_cast<uint32_t>(dirOffset);
  339|       |
  340|       |  // Number of directory entries
  341|  1.37k|  byte buf[4];
  342|  1.37k|  us2Data(buf, static_cast<uint16_t>(components_.size()), byteOrder);
  343|  1.37k|  append(blob, buf, 2);
  344|  1.37k|  dirOffset += 2;
  345|       |
  346|       |  // Directory entries
  347|  27.1k|  for (auto&& component : components_) {
  ------------------
  |  Branch (347:25): [True: 27.1k, False: 1.37k]
  ------------------
  348|  27.1k|    component->writeDirEntry(blob, byteOrder);
  349|  27.1k|    dirOffset += 10;
  350|  27.1k|  }
  351|       |
  352|       |  // Offset of directory
  353|  1.37k|  ul2Data(buf, dirStart, byteOrder);
  354|  1.37k|  append(blob, buf, 4);
  355|  1.37k|  dirOffset += 4;
  356|       |
  357|       |  // Update directory entry
  358|  1.37k|  setOffset(offset);
  359|  1.37k|  setSize(dirOffset);
  360|       |
  361|       |#ifdef EXIV2_DEBUG_MESSAGES
  362|       |  std::cout << "Directory is at offset " << std::dec << dirStart << ", " << components_.size() << " entries\n"
  363|       |            << "<---- 0x" << std::hex << tag() << "\n";
  364|       |#endif
  365|  1.37k|  return offset + dirOffset;
  366|  1.37k|}  // CiffDirectory::doWrite
_ZNK5Exiv28Internal13CiffComponent13writeDirEntryERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderE:
  368|  27.1k|void CiffComponent::writeDirEntry(Blob& blob, ByteOrder byteOrder) const {
  369|       |#ifdef EXIV2_DEBUG_MESSAGES
  370|       |  std::cout << "  Directory entry for tag 0x" << std::hex << tagId() << " (0x" << tag() << "), " << std::dec << size_
  371|       |            << " Bytes, Offset is " << offset_ << "\n";
  372|       |#endif
  373|  27.1k|  byte buf[4];
  374|       |
  375|  27.1k|  DataLocId dl = dataLocation();
  376|       |
  377|  27.1k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (377:7): [True: 2.05k, False: 25.1k]
  ------------------
  378|  2.05k|    us2Data(buf, tag_, byteOrder);
  379|  2.05k|    append(blob, buf, 2);
  380|       |
  381|  2.05k|    ul2Data(buf, static_cast<uint32_t>(size_), byteOrder);
  382|  2.05k|    append(blob, buf, 4);
  383|       |
  384|  2.05k|    ul2Data(buf, static_cast<uint32_t>(offset_), byteOrder);
  385|  2.05k|    append(blob, buf, 4);
  386|  2.05k|  }
  387|       |
  388|  27.1k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (388:7): [True: 25.1k, False: 2.05k]
  ------------------
  389|       |    // Only 8 bytes fit in the directory entry
  390|       |
  391|  25.1k|    us2Data(buf, tag_, byteOrder);
  392|  25.1k|    append(blob, buf, 2);
  393|       |    // Copy value instead of size and offset
  394|  25.1k|    append(blob, pData_, size_);
  395|       |    // Pad with 0s
  396|  25.9k|    for (size_t i = size_; i < 8; ++i) {
  ------------------
  |  Branch (396:28): [True: 766, False: 25.1k]
  ------------------
  397|    766|      blob.push_back(0);
  398|    766|    }
  399|  25.1k|  }
  400|  27.1k|}  // CiffComponent::writeDirEntry
_ZN5Exiv28Internal13CiffComponent8setValueEONS_7DataBufE:
  426|    235|void CiffComponent::setValue(DataBuf&& buf) {
  427|    235|  storage_ = std::move(buf);
  428|    235|  pData_ = storage_.c_data();
  429|    235|  size_ = storage_.size();
  430|    235|  if (size_ > 8 && dataLocation() == DataLocId::directoryData) {
  ------------------
  |  Branch (430:7): [True: 71, False: 164]
  |  Branch (430:20): [True: 5, False: 66]
  ------------------
  431|      5|    tag_ &= 0x3fff;
  432|      5|  }
  433|    235|}
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  435|  56.8k|TypeId CiffComponent::typeId(uint16_t tag) {
  436|  56.8k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (436:11): [True: 56.3k, False: 421]
  ------------------
  437|  1.30k|    case 0x0000:
  ------------------
  |  Branch (437:5): [True: 1.30k, False: 55.5k]
  ------------------
  438|  1.30k|      return unsignedByte;
  439|  2.12k|    case 0x0800:
  ------------------
  |  Branch (439:5): [True: 2.12k, False: 54.6k]
  ------------------
  440|  2.12k|      return asciiString;
  441|  45.0k|    case 0x1000:
  ------------------
  |  Branch (441:5): [True: 45.0k, False: 11.7k]
  ------------------
  442|  45.0k|      return unsignedShort;
  443|  3.12k|    case 0x1800:
  ------------------
  |  Branch (443:5): [True: 3.12k, False: 53.6k]
  ------------------
  444|  3.12k|      return unsignedLong;
  445|  2.77k|    case 0x2000:
  ------------------
  |  Branch (445:5): [True: 2.77k, False: 54.0k]
  ------------------
  446|  2.77k|      return undefined;
  447|    645|    case 0x2800:
  ------------------
  |  Branch (447:5): [True: 645, False: 56.1k]
  ------------------
  448|  2.02k|    case 0x3000:
  ------------------
  |  Branch (448:5): [True: 1.38k, False: 55.4k]
  ------------------
  449|  2.02k|      return directory;
  450|  56.8k|  }
  451|    421|  return invalidTypeId;
  452|  56.8k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  454|   108k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  455|   108k|  switch (tag & 0xc000) {
  456|  7.00k|    case 0x0000:
  ------------------
  |  Branch (456:5): [True: 7.00k, False: 101k]
  ------------------
  457|  7.00k|      return DataLocId::valueData;
  458|   101k|    case 0x4000:
  ------------------
  |  Branch (458:5): [True: 101k, False: 7.02k]
  ------------------
  459|   101k|      return DataLocId::directoryData;
  460|     24|    default:
  ------------------
  |  Branch (460:5): [True: 24, False: 108k]
  ------------------
  461|     24|      throw Error(ErrorCode::kerCorruptedMetadata);
  462|   108k|  }
  463|   108k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  470|    646|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  471|    646|  if (!pRootDir_)
  ------------------
  |  Branch (471:7): [True: 0, False: 646]
  ------------------
  472|      0|    return nullptr;
  473|    646|  return pRootDir_->findComponent(crwTagId, crwDir);
  474|    646|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  476|  81.4k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  477|  81.4k|  return doFindComponent(crwTagId, crwDir);
  478|  81.4k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  480|  77.7k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  481|  77.7k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (481:7): [True: 61, False: 77.6k]
  |  Branch (481:30): [True: 23, False: 38]
  ------------------
  482|     23|    return this;
  483|     23|  }
  484|  77.6k|  return nullptr;
  485|  77.7k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  487|  3.76k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  488|  80.8k|  for (auto&& component : components_) {
  ------------------
  |  Branch (488:25): [True: 80.8k, False: 3.72k]
  ------------------
  489|  80.8k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (489:14): [True: 40, False: 80.7k]
  ------------------
  490|     40|      return cc;
  491|  80.8k|  }
  492|  3.72k|  return nullptr;
  493|  3.76k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal10CiffHeader3addEttONS_7DataBufE:
  495|    235|void CiffHeader::add(uint16_t crwTagId, uint16_t crwDir, DataBuf&& buf) {
  496|    235|  CrwDirs crwDirs;
  497|    235|  CrwMap::loadStack(crwDirs, crwDir);
  498|    235|  crwDirs.pop();
  499|    235|  if (!pRootDir_) {
  ------------------
  |  Branch (499:7): [True: 0, False: 235]
  ------------------
  500|      0|    pRootDir_ = std::make_unique<CiffDirectory>();
  501|      0|  }
  502|    235|  if (const auto& child = pRootDir_->add(crwDirs, crwTagId)) {
  ------------------
  |  Branch (502:19): [True: 235, False: 0]
  ------------------
  503|    235|    child->setValue(std::move(buf));
  504|    235|  }
  505|    235|}  // CiffHeader::add
_ZN5Exiv28Internal13CiffComponent3addERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  507|    695|const CiffComponent::UniquePtr& CiffComponent::add(CrwDirs& crwDirs, uint16_t crwTagId) {
  508|    695|  return doAdd(crwDirs, crwTagId);
  509|    695|}  // CiffComponent::add
_ZN5Exiv28Internal13CiffDirectory5doAddERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  515|    695|const CiffComponent::UniquePtr& CiffDirectory::doAdd(CrwDirs& crwDirs, uint16_t crwTagId) {
  516|       |  /*
  517|       |    add()
  518|       |      if stack not empty
  519|       |        pop from stack
  520|       |        find dir among components
  521|       |        if not found, create it
  522|       |        add()
  523|       |      else
  524|       |        find tag among components
  525|       |        if not found, create it
  526|       |        set value
  527|       |  */
  528|    695|  if (!crwDirs.empty()) {
  ------------------
  |  Branch (528:7): [True: 460, False: 235]
  ------------------
  529|    460|    auto dir = crwDirs.top();
  530|    460|    crwDirs.pop();
  531|       |    // Find the directory
  532|    460|    for (const auto& c : components_)
  ------------------
  |  Branch (532:24): [True: 2.02k, False: 232]
  ------------------
  533|  2.02k|      if (c->tag() == dir.dir) {
  ------------------
  |  Branch (533:11): [True: 228, False: 1.79k]
  ------------------
  534|       |        // Recursive call to next lower level directory
  535|    228|        return c->add(crwDirs, crwTagId);
  536|    228|      }
  537|       |
  538|       |    // Directory doesn't exist yet, add it
  539|    232|    auto m = std::make_unique<CiffDirectory>(dir.dir, dir.parent);
  540|    232|    return add(std::move(m))->add(crwDirs, crwTagId);
  541|    460|  }
  542|       |
  543|       |  // Find the tag
  544|    235|  for (const auto& c : components_)
  ------------------
  |  Branch (544:22): [True: 263, False: 211]
  ------------------
  545|    263|    if (c->tagId() == crwTagId) {
  ------------------
  |  Branch (545:9): [True: 24, False: 239]
  ------------------
  546|     24|      return c;
  547|     24|    }
  548|       |
  549|       |  // Tag doesn't exist yet, add it
  550|    211|  auto m = std::make_unique<CiffEntry>(crwTagId, tag());
  551|    211|  return add(std::move(m));
  552|    235|}  // CiffDirectory::doAdd
_ZNK5Exiv28Internal10CiffHeader6removeEtt:
  554|  4.76k|void CiffHeader::remove(uint16_t crwTagId, uint16_t crwDir) const {
  555|  4.76k|  if (pRootDir_) {
  ------------------
  |  Branch (555:7): [True: 4.76k, False: 0]
  ------------------
  556|  4.76k|    CrwDirs crwDirs;
  557|  4.76k|    CrwMap::loadStack(crwDirs, crwDir);
  558|  4.76k|    crwDirs.pop();
  559|  4.76k|    pRootDir_->remove(crwDirs, crwTagId);
  560|  4.76k|  }
  561|  4.76k|}  // CiffHeader::remove
_ZN5Exiv28Internal13CiffComponent6removeERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  563|  7.90k|void CiffComponent::remove(CrwDirs& crwDirs, uint16_t crwTagId) {
  564|  7.90k|  doRemove(crwDirs, crwTagId);
  565|  7.90k|}  // CiffComponent::remove
_ZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  571|  7.90k|void CiffDirectory::doRemove(CrwDirs& crwDirs, uint16_t crwTagId) {
  572|  7.90k|  if (!crwDirs.empty()) {
  ------------------
  |  Branch (572:7): [True: 6.74k, False: 1.16k]
  ------------------
  573|  6.74k|    auto dir = crwDirs.top();
  574|  6.74k|    crwDirs.pop();
  575|       |    // Find the directory
  576|  6.74k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == dir.dir; });
  577|  6.74k|    if (it != components_.end()) {
  ------------------
  |  Branch (577:9): [True: 3.13k, False: 3.60k]
  ------------------
  578|       |      // Recursive call to next lower level directory
  579|  3.13k|      (*it)->remove(crwDirs, crwTagId);
  580|  3.13k|      if ((*it)->empty())
  ------------------
  |  Branch (580:11): [True: 19, False: 3.11k]
  ------------------
  581|     19|        components_.erase(it);
  582|  3.13k|    }
  583|  6.74k|  } else {
  584|       |    // Find the tag
  585|  1.16k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == crwTagId; });
  586|  1.16k|    if (it != components_.end()) {
  ------------------
  |  Branch (586:9): [True: 10, False: 1.15k]
  ------------------
  587|     10|      components_.erase(it);
  588|     10|    }
  589|  1.16k|  }
  590|  7.90k|}  // CiffDirectory::doRemove
_ZNK5Exiv28Internal13CiffComponent5emptyEv:
  592|  3.13k|bool CiffComponent::empty() const {
  593|  3.13k|  return doEmpty();
  594|  3.13k|}
_ZNK5Exiv28Internal13CiffDirectory7doEmptyEv:
  600|  3.13k|bool CiffDirectory::doEmpty() const {
  601|  3.13k|  return components_.empty();
  602|  3.13k|}
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  604|  25.9k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  605|  25.9k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  606|  25.9k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (606:7): [True: 929, False: 24.9k]
  |  Branch (606:14): [True: 929, False: 0]
  ------------------
  607|    929|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  608|    929|  }
  609|  25.9k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  611|  25.9k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  612|   557k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (612:19): [True: 557k, False: 24.9k]
  ------------------
  613|   557k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (613:9): [True: 34.7k, False: 523k]
  |  Branch (613:34): [True: 929, False: 33.8k]
  ------------------
  614|    929|      return &crw;
  615|    929|    }
  616|   557k|  }
  617|  24.9k|  return nullptr;
  618|  25.9k|}  // CrwMap::crwMapping
_ZN5Exiv28Internal6CrwMap12decode0x0805ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  621|     39|                          ByteOrder /*byteOrder*/) {
  622|     39|  auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
  623|     39|  image.setComment(s);
  624|     39|}  // CrwMap::decode0x0805
_ZN5Exiv28Internal6CrwMap12decode0x080aERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  627|     72|                          ByteOrder byteOrder) {
  628|     72|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (628:7): [True: 0, False: 72]
  ------------------
  629|      0|    return;
  630|       |
  631|       |  // Make
  632|     72|  ExifKey key1("Exif.Image.Make");
  633|     72|  auto value1 = Value::create(ciffComponent.typeId());
  634|     72|  uint32_t i = 0;
  635|    426|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (635:10): [True: 407, False: 19]
  ------------------
  636|    407|    ++i;
  637|    407|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (637:9): [True: 53, False: 354]
  ------------------
  638|     53|      break;
  639|     53|    }
  640|    407|  }
  641|     72|  value1->read(ciffComponent.pData(), i, byteOrder);
  642|     72|  image.exifData().add(key1, value1.get());
  643|       |
  644|       |  // Model
  645|     72|  ExifKey key2("Exif.Image.Model");
  646|     72|  auto value2 = Value::create(ciffComponent.typeId());
  647|     72|  uint32_t j = i;
  648|    203|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (648:10): [True: 158, False: 45]
  ------------------
  649|    158|    ++i;
  650|    158|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (650:9): [True: 27, False: 131]
  ------------------
  651|     27|      break;
  652|     27|    }
  653|    158|  }
  654|     72|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  655|     72|  image.exifData().add(key2, value2.get());
  656|     72|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  659|    425|                         ByteOrder byteOrder) {
  660|    425|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (660:7): [True: 0, False: 425]
  ------------------
  661|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  662|      0|    return;
  663|      0|  }
  664|       |
  665|    425|  int64_t aperture = 0;
  666|    425|  int64_t shutterSpeed = 0;
  667|       |
  668|    425|  auto ifdId = [pCrwMapping] {
  669|    425|    if (pCrwMapping->tag_ == 0x0001)
  670|    425|      return IfdId::canonCsId;
  671|    425|    if (pCrwMapping->tag_ == 0x0004)
  672|    425|      return IfdId::canonSiId;
  673|    425|    if (pCrwMapping->tag_ == 0x000f)
  674|    425|      return IfdId::canonCfId;
  675|    425|    if (pCrwMapping->tag_ == 0x0012)
  676|    425|      return IfdId::canonPiId;
  677|    425|    return IfdId::ifdIdNotSet;
  678|    425|  }();
  679|       |
  680|    425|  std::string groupName(Internal::groupName(ifdId));
  681|    425|  const size_t component_size = ciffComponent.size();
  682|    425|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  683|    425|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  684|    425|          ErrorCode::kerCorruptedMetadata);
  685|    425|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  686|    425|  uint16_t c = 1;
  687|  4.61k|  while (c < num_components) {
  ------------------
  |  Branch (687:10): [True: 4.19k, False: 425]
  ------------------
  688|  4.19k|    uint16_t n = 1;
  689|  4.19k|    ExifKey key(c, groupName);
  690|  4.19k|    UShortValue value;
  691|  4.19k|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (691:9): [True: 919, False: 3.27k]
  |  Branch (691:38): [True: 25, False: 894]
  |  Branch (691:49): [True: 15, False: 10]
  ------------------
  692|     15|      n = 3;
  693|  4.19k|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  694|  4.19k|    image.exifData().add(key, &value);
  695|  4.19k|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (695:9): [True: 2.59k, False: 1.59k]
  |  Branch (695:38): [True: 81, False: 2.51k]
  ------------------
  696|     81|      aperture = value.toInt64();
  697|  4.19k|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (697:9): [True: 2.59k, False: 1.59k]
  |  Branch (697:38): [True: 81, False: 2.51k]
  ------------------
  698|     81|      shutterSpeed = value.toInt64();
  699|  4.19k|    c += n;
  700|  4.19k|  }
  701|       |
  702|    425|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (702:7): [True: 211, False: 214]
  ------------------
  703|       |    // Exif.Photo.FNumber
  704|    211|    float f = fnumber(canonEv(aperture));
  705|    211|    auto [r, s] = floatToRationalCast(f);
  706|    211|    auto ur = URational(r, s);
  707|    211|    URationalValue fn;
  708|    211|    fn.value_.push_back(ur);
  709|    211|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  710|       |
  711|       |    // Exif.Photo.ExposureTime
  712|    211|    ur = exposureTime(canonEv(shutterSpeed));
  713|    211|    URationalValue et;
  714|    211|    et.value_.push_back(ur);
  715|    211|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  716|    211|  }
  717|    425|}  // CrwMap::decodeArray
_ZN5Exiv28Internal6CrwMap12decode0x180eERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  720|     27|                          ByteOrder byteOrder) {
  721|     27|  if (ciffComponent.size() < 8 || ciffComponent.typeId() != unsignedLong) {
  ------------------
  |  Branch (721:7): [True: 7, False: 20]
  |  Branch (721:35): [True: 0, False: 20]
  ------------------
  722|      7|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  723|      7|    return;
  724|      7|  }
  725|     20|  ULongValue v;
  726|     20|  v.read(ciffComponent.pData(), 8, byteOrder);
  727|     20|  time_t t = v.value_.at(0);
  728|     20|  std::tm r;
  729|       |#ifdef _WIN32
  730|       |  auto tm = localtime_s(&r, &t) ? nullptr : &r;
  731|       |#else
  732|     20|  auto tm = localtime_r(&t, &r);
  733|     20|#endif
  734|     20|  if (!tm)
  ------------------
  |  Branch (734:7): [True: 0, False: 20]
  ------------------
  735|      0|    return;
  736|     20|  const size_t m = 20;
  737|     20|  char s[m];
  738|     20|  std::strftime(s, m, "%Y:%m:%d %T", tm);
  739|       |
  740|     20|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  741|     20|  AsciiValue value;
  742|     20|  value.read(s);
  743|     20|  image.exifData().add(key, &value);
  744|     20|}  // CrwMap::decode0x180e
_ZN5Exiv28Internal6CrwMap12decode0x1810ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  747|     12|                          ByteOrder byteOrder) {
  748|     12|  if (ciffComponent.typeId() != unsignedLong || ciffComponent.size() < 28) {
  ------------------
  |  Branch (748:7): [True: 0, False: 12]
  |  Branch (748:49): [True: 12, False: 0]
  ------------------
  749|     12|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  750|     12|    return;
  751|     12|  }
  752|       |
  753|      0|  ExifKey key1("Exif.Photo.PixelXDimension");
  754|      0|  ULongValue value1;
  755|      0|  value1.read(ciffComponent.pData(), 4, byteOrder);
  756|      0|  image.exifData().add(key1, &value1);
  757|       |
  758|      0|  ExifKey key2("Exif.Photo.PixelYDimension");
  759|      0|  ULongValue value2;
  760|      0|  value2.read(ciffComponent.pData() + 4, 4, byteOrder);
  761|      0|  image.exifData().add(key2, &value2);
  762|       |
  763|      0|  int32_t r = getLong(ciffComponent.pData() + 12, byteOrder);
  764|      0|  uint16_t o = RotationMap::orientation(r);
  765|      0|  image.exifData()["Exif.Image.Orientation"] = o;
  766|       |
  767|      0|}  // CrwMap::decode0x1810
_ZN5Exiv28Internal6CrwMap12decode0x2008ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  770|     38|                          ByteOrder /*byteOrder*/) {
  771|     38|  ExifThumb exifThumb(image.exifData());
  772|     38|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  773|     38|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  776|    335|                         ByteOrder byteOrder) {
  777|       |  // create a key and value pair
  778|    335|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  779|    335|  Value::UniquePtr value;
  780|    335|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (780:7): [True: 335, False: 0]
  ------------------
  781|    335|    value = Value::create(ciffComponent.typeId());
  782|    335|    size_t size = 0;
  783|    335|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (783:9): [True: 7, False: 328]
  ------------------
  784|      7|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  785|    328|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (785:16): [True: 133, False: 195]
  ------------------
  786|       |      // determine size from the data, by looking for the first 0
  787|    133|      uint32_t i = 0;
  788|    954|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (788:14): [True: 890, False: 64]
  ------------------
  789|    890|        ++i;
  790|    890|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (790:13): [True: 69, False: 821]
  ------------------
  791|     69|          break;
  792|     69|        }
  793|    890|      }
  794|    133|      size = i;
  795|    195|    } else {
  796|       |      // by default, use the size from the directory entry
  797|    195|      size = ciffComponent.size();
  798|    195|    }
  799|    335|    value->read(ciffComponent.pData(), size, byteOrder);
  800|    335|  }
  801|       |  // Add metadatum to exif data
  802|    335|  image.exifData().add(key, value.get());
  803|    335|}  // CrwMap::decodeBasic
_ZN5Exiv28Internal6CrwMap9loadStackERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  805|  5.00k|void CrwMap::loadStack(CrwDirs& crwDirs, uint16_t crwDir) {
  806|  40.0k|  for (auto&& crw : crwSubDir_) {
  ------------------
  |  Branch (806:19): [True: 40.0k, False: 5.00k]
  ------------------
  807|  40.0k|    auto&& [dir, parent] = crw;
  808|  40.0k|    if (dir == crwDir) {
  ------------------
  |  Branch (808:9): [True: 14.4k, False: 25.6k]
  ------------------
  809|  14.4k|      crwDirs.push(crw);
  810|  14.4k|      crwDir = parent;
  811|  14.4k|    }
  812|  40.0k|  }
  813|  5.00k|}  // CrwMap::loadStack
_ZN5Exiv28Internal6CrwMap6encodeERNS0_10CiffHeaderERKNS_5ImageE:
  815|    205|void CrwMap::encode(CiffHeader& pHead, const Image& image) {
  816|  4.49k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (816:19): [True: 4.49k, False: 205]
  ------------------
  817|  4.49k|    if (crw.fromExif_) {
  ------------------
  |  Branch (817:9): [True: 4.49k, False: 0]
  ------------------
  818|  4.49k|      crw.fromExif_(image, crw, pHead);
  819|  4.49k|    }
  820|  4.49k|  }
  821|    205|}  // CrwMap::encode
_ZN5Exiv28Internal6CrwMap11encodeBasicERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  823|  3.36k|void CrwMap::encodeBasic(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  824|       |  // Determine the source Exif metadatum
  825|  3.36k|  ExifKey ek(pCrwMapping.tag_, Internal::groupName(pCrwMapping.ifdId_));
  826|  3.36k|  auto ed = image.exifData().findKey(ek);
  827|       |
  828|       |  // Set the new value or remove the entry
  829|  3.36k|  if (ed != image.exifData().end() && ed->size() > 0) {
  ------------------
  |  Branch (829:7): [True: 94, False: 3.26k]
  |  Branch (829:7): [True: 83, False: 3.27k]
  |  Branch (829:39): [True: 83, False: 11]
  ------------------
  830|     83|    DataBuf buf(ed->size());
  831|     83|    ed->copy(buf.data(), pHead.byteOrder());
  832|     83|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  833|  3.27k|  } else {
  834|  3.27k|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  835|  3.27k|  }
  836|  3.36k|}  // CrwMap::encodeBasic
_ZN5Exiv28Internal6CrwMap12encode0x0805ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  838|    205|void CrwMap::encode0x0805(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  839|    205|  std::string comment = image.comment();
  840|       |
  841|    205|  auto cc = pHead.findComponent(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  842|    205|  if (!comment.empty()) {
  ------------------
  |  Branch (842:7): [True: 12, False: 193]
  ------------------
  843|     12|    auto size = comment.size();
  844|     12|    if (cc && cc->size() > size)
  ------------------
  |  Branch (844:9): [True: 12, False: 0]
  |  Branch (844:15): [True: 0, False: 12]
  ------------------
  845|      0|      size = cc->size();
  846|     12|    DataBuf buf(size);
  847|     12|    std::move(comment.begin(), comment.end(), buf.begin());
  848|     12|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  849|    193|  } else {
  850|    193|    if (cc) {
  ------------------
  |  Branch (850:9): [True: 0, False: 193]
  ------------------
  851|       |      // Just delete the value, do not remove the tag
  852|      0|      DataBuf buf(cc->size());
  853|      0|      cc->setValue(std::move(buf));
  854|      0|    }
  855|    193|  }
  856|    205|}  // CrwMap::encode0x0805
_ZN5Exiv28Internal6CrwMap12encode0x080aERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  858|    205|void CrwMap::encode0x080a(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  859|    205|  const ExifKey k1("Exif.Image.Make");
  860|    205|  const ExifKey k2("Exif.Image.Model");
  861|    205|  const auto ed1 = image.exifData().findKey(k1);
  862|    205|  const auto ed2 = image.exifData().findKey(k2);
  863|    205|  const auto edEnd = image.exifData().end();
  864|       |
  865|    205|  size_t size{0};
  866|    205|  if (ed1 != edEnd)
  ------------------
  |  Branch (866:7): [True: 17, False: 188]
  ------------------
  867|     17|    size += ed1->size();
  868|    205|  if (ed2 != edEnd)
  ------------------
  |  Branch (868:7): [True: 17, False: 188]
  ------------------
  869|     17|    size += ed2->size();
  870|    205|  if (size != 0) {
  ------------------
  |  Branch (870:7): [True: 17, False: 188]
  ------------------
  871|     17|    DataBuf buf(size);
  872|     17|    size_t pos{0};
  873|     17|    if (ed1 != edEnd) {
  ------------------
  |  Branch (873:9): [True: 17, False: 0]
  ------------------
  874|     17|      ed1->copy(buf.data(), pHead.byteOrder());
  875|     17|      pos += ed1->size();
  876|     17|    }
  877|     17|    if (ed2 != edEnd) {
  ------------------
  |  Branch (877:9): [True: 17, False: 0]
  ------------------
  878|     17|      ed2->copy(buf.data(pos), pHead.byteOrder());
  879|     17|      pos += ed2->size();
  880|     17|    }
  881|     17|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  882|    188|  } else {
  883|    188|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  884|    188|  }
  885|    205|}
_ZN5Exiv28Internal6CrwMap11encodeArrayERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  887|    820|void CrwMap::encodeArray(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  888|    820|  auto ifdId = [=] {
  889|    820|    switch (pCrwMapping.tag_) {
  890|    820|      case 0x0001:
  891|    820|        return IfdId::canonCsId;
  892|    820|      case 0x0004:
  893|    820|        return IfdId::canonSiId;
  894|    820|      case 0x000f:
  895|    820|        return IfdId::canonCfId;
  896|    820|      case 0x0012:
  897|    820|        return IfdId::canonPiId;
  898|    820|    }
  899|    820|    return IfdId::ifdIdNotSet;
  900|    820|  }();
  901|    820|  DataBuf buf = packIfdId(image.exifData(), ifdId, pHead.byteOrder());
  902|    820|  if (buf.empty()) {
  ------------------
  |  Branch (902:7): [True: 707, False: 113]
  ------------------
  903|       |    // Try the undecoded tag
  904|    707|    encodeBasic(image, pCrwMapping, pHead);
  905|    707|  }
  906|    820|  if (!buf.empty()) {
  ------------------
  |  Branch (906:7): [True: 113, False: 707]
  ------------------
  907|       |    // Write the number of shorts to the beginning of buf
  908|    113|    buf.write_uint16(0, static_cast<uint16_t>(buf.size()), pHead.byteOrder());
  909|    113|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  910|    707|  } else {
  911|    707|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  912|    707|  }
  913|    820|}  // CrwMap::encodeArray
_ZN5Exiv28Internal6CrwMap12encode0x180eERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  915|    205|void CrwMap::encode0x180e(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  916|    205|  time_t t = 0;
  917|    205|  const ExifKey key(pCrwMapping.tag_, Internal::groupName(pCrwMapping.ifdId_));
  918|    205|  if (auto ed = image.exifData().findKey(key); ed != image.exifData().end()) {
  ------------------
  |  Branch (918:48): [True: 9, False: 196]
  ------------------
  919|      9|    std::tm tm = {};
  920|      9|    if (exifTime(ed->toString().c_str(), &tm) == 0) {
  ------------------
  |  Branch (920:9): [True: 6, False: 3]
  ------------------
  921|      6|      t = ::mktime(&tm);
  922|      6|    }
  923|      9|  }
  924|    205|  if (t != 0) {
  ------------------
  |  Branch (924:7): [True: 5, False: 200]
  ------------------
  925|      5|    DataBuf buf(12);
  926|      5|    buf.write_uint32(0, static_cast<uint32_t>(t), pHead.byteOrder());
  927|      5|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  928|    200|  } else {
  929|    200|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  930|    200|  }
  931|    205|}  // CrwMap::encode0x180e
_ZN5Exiv28Internal6CrwMap12encode0x1810ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  933|    205|void CrwMap::encode0x1810(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  934|    205|  const ExifKey kX("Exif.Photo.PixelXDimension");
  935|    205|  const ExifKey kY("Exif.Photo.PixelYDimension");
  936|    205|  const ExifKey kO("Exif.Image.Orientation");
  937|    205|  const ExifData& exivData = image.exifData();
  938|    205|  const auto edX = exivData.findKey(kX);
  939|    205|  const auto edY = exivData.findKey(kY);
  940|    205|  const auto edO = exivData.findKey(kO);
  941|    205|  const auto edEnd = exivData.end();
  942|       |
  943|    205|  auto cc = pHead.findComponent(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  944|    205|  if (edX != edEnd || edY != edEnd || edO != edEnd) {
  ------------------
  |  Branch (944:7): [True: 5, False: 200]
  |  Branch (944:23): [True: 0, False: 200]
  |  Branch (944:39): [True: 0, False: 200]
  ------------------
  945|      5|    size_t size = 28;
  946|      5|    if (cc) {
  ------------------
  |  Branch (946:9): [True: 5, False: 0]
  ------------------
  947|      5|      if (cc->size() < size)
  ------------------
  |  Branch (947:11): [True: 5, False: 0]
  ------------------
  948|      5|        throw Error(ErrorCode::kerCorruptedMetadata);
  949|      0|      size = cc->size();
  950|      0|    }
  951|      0|    DataBuf buf(size);
  952|      0|    if (cc)
  ------------------
  |  Branch (952:9): [True: 0, False: 0]
  ------------------
  953|      0|      std::copy_n(cc->pData() + 8, cc->size() - 8, buf.begin() + 8);
  954|      0|    if (edX != edEnd && edX->size() == 4) {
  ------------------
  |  Branch (954:9): [True: 0, False: 0]
  |  Branch (954:25): [True: 0, False: 0]
  ------------------
  955|      0|      edX->copy(buf.data(), pHead.byteOrder());
  956|      0|    }
  957|      0|    if (edY != edEnd && edY->size() == 4) {
  ------------------
  |  Branch (957:9): [True: 0, False: 0]
  |  Branch (957:25): [True: 0, False: 0]
  ------------------
  958|      0|      edY->copy(buf.data(4), pHead.byteOrder());
  959|      0|    }
  960|      0|    int32_t d = 0;
  961|      0|    if (edO != edEnd && edO->count() > 0 && edO->typeId() == unsignedShort) {
  ------------------
  |  Branch (961:9): [True: 0, False: 0]
  |  Branch (961:25): [True: 0, False: 0]
  |  Branch (961:45): [True: 0, False: 0]
  ------------------
  962|      0|      d = RotationMap::degrees(static_cast<uint16_t>(edO->toInt64()));
  963|      0|    }
  964|      0|    buf.write_uint32(12, d, pHead.byteOrder());
  965|      0|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  966|    200|  } else {
  967|    200|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  968|    200|  }
  969|    205|}  // CrwMap::encode0x1810
_ZN5Exiv28Internal6CrwMap12encode0x2008ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  971|    200|void CrwMap::encode0x2008(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  972|    200|  ExifThumbC exifThumb(image.exifData());
  973|    200|  DataBuf buf = exifThumb.copy();
  974|    200|  if (!buf.empty()) {
  ------------------
  |  Branch (974:7): [True: 5, False: 195]
  ------------------
  975|      5|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  976|    195|  } else {
  977|    195|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  978|    195|  }
  979|    200|}  // CrwMap::encode0x2008
_ZN5Exiv28Internal9packIfdIdERKNS_8ExifDataENS_5IfdIdENS_9ByteOrderE:
  983|    820|DataBuf packIfdId(const ExifData& exifData, IfdId ifdId, ByteOrder byteOrder) {
  984|    820|  const uint16_t size = 1024;
  985|    820|  DataBuf buf(size);
  986|       |
  987|    820|  uint16_t len = 0;
  988|       |
  989|  20.4k|  for (auto&& exif : exifData) {
  ------------------
  |  Branch (989:20): [True: 20.4k, False: 820]
  ------------------
  990|  20.4k|    if (exif.ifdId() != ifdId)
  ------------------
  |  Branch (990:9): [True: 16.3k, False: 4.16k]
  ------------------
  991|  16.3k|      continue;
  992|  4.16k|    const uint16_t s = (exif.tag() * 2) + static_cast<uint16_t>(exif.size());
  993|  4.16k|    if (s <= size) {
  ------------------
  |  Branch (993:9): [True: 4.16k, False: 0]
  ------------------
  994|  4.16k|      len = std::max(len, s);
  995|  4.16k|      exif.copy(buf.data(exif.tag() * 2), byteOrder);
  996|  4.16k|    } else {
  997|      0|      EXV_ERROR << "packIfdId out-of-bounds error: s = " << std::dec << s << "\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()
  ------------------
  998|      0|    }
  999|  4.16k|  }
 1000|       |  // Round the size to make it even.
 1001|    820|  buf.resize(len + (len % 2));
 1002|    820|  return buf;
 1003|    820|}
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  241|  55.1k|    auto m = [this, tag]() -> UniquePtr {
  242|  55.1k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (242:11): [True: 2.02k, False: 53.1k]
  ------------------
  243|  2.02k|        return std::make_unique<CiffDirectory>();
  244|  53.1k|      return std::make_unique<CiffEntry>();
  245|  55.1k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEtENK3$_0clINS2_10unique_ptrINS0_13CiffComponentENS2_14default_deleteISE_EEEEEEDaRKT_:
  576|   544k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == dir.dir; });
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEtENK3$_1clINS2_10unique_ptrINS0_13CiffComponentENS2_14default_deleteISE_EEEEEEDaRKT_:
  585|  24.4k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == crwTagId; });
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderEENK3$_0clEv:
  668|    425|  auto ifdId = [pCrwMapping] {
  669|    425|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (669:9): [True: 141, False: 284]
  ------------------
  670|    141|      return IfdId::canonCsId;
  671|    284|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (671:9): [True: 211, False: 73]
  ------------------
  672|    211|      return IfdId::canonSiId;
  673|     73|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (673:9): [True: 42, False: 31]
  ------------------
  674|     42|      return IfdId::canonCfId;
  675|     31|    if (pCrwMapping->tag_ == 0x0012)
  ------------------
  |  Branch (675:9): [True: 31, False: 0]
  ------------------
  676|     31|      return IfdId::canonPiId;
  677|      0|    return IfdId::ifdIdNotSet;
  678|     31|  }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11encodeArrayERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderEENK3$_0clEv:
  888|    820|  auto ifdId = [=] {
  889|    820|    switch (pCrwMapping.tag_) {
  ------------------
  |  Branch (889:13): [True: 820, False: 0]
  ------------------
  890|    205|      case 0x0001:
  ------------------
  |  Branch (890:7): [True: 205, False: 615]
  ------------------
  891|    205|        return IfdId::canonCsId;
  892|    205|      case 0x0004:
  ------------------
  |  Branch (892:7): [True: 205, False: 615]
  ------------------
  893|    205|        return IfdId::canonSiId;
  894|    205|      case 0x000f:
  ------------------
  |  Branch (894:7): [True: 205, False: 615]
  ------------------
  895|    205|        return IfdId::canonCfId;
  896|    205|      case 0x0012:
  ------------------
  |  Branch (896:7): [True: 205, False: 615]
  ------------------
  897|    205|        return IfdId::canonPiId;
  898|    820|    }
  899|      0|    return IfdId::ifdIdNotSet;
  900|    820|  }();

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  6.23k|  [[nodiscard]] const byte* pData() const {
  214|  6.23k|    return pData_;
  215|  6.23k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  6.31k|  [[nodiscard]] size_t size() const {
  204|  6.31k|    return size_;
  205|  6.31k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  14.1k|  static auto signature() {
  419|  14.1k|    return signature_;
  420|  14.1k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  55.1k|  void setDir(uint16_t dir) {
  147|  55.1k|    dir_ = dir;
  148|  55.1k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  25.9k|  [[nodiscard]] uint16_t dir() const {
  184|  25.9k|    return dir_;
  185|  25.9k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|   626k|  [[nodiscard]] uint16_t tag() const {
  189|   626k|    return tag_;
  190|   626k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  3.96k|  [[nodiscard]] size_t offset() const {
  209|  3.96k|    return offset_;
  210|  3.96k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|   103k|  [[nodiscard]] uint16_t tagId() const {
  219|   103k|    return tag_ & 0x3fff;
  220|   103k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  1.67k|  [[nodiscard]] TypeId typeId() const {
  224|  1.67k|    return typeId(tag_);
  225|  1.67k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|   108k|  [[nodiscard]] DataLocId dataLocation() const {
  229|   108k|    return dataLocation(tag_);
  230|   108k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.37k|  void setSize(size_t size) {
  254|  1.37k|    size_ = size;
  255|  1.37k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.37k|  void setOffset(size_t offset) {
  258|  1.37k|    offset_ = offset;
  259|  1.37k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.05k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.05k|    return byteOrder_;
  446|  1.05k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  55.8k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  56.2k|  virtual ~CiffComponent() = default;

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

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

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

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

_ZN5Exiv29ExifdatumC2ERKNS_7ExifKeyEPKNS_5ValueE:
  157|  1.43M|Exifdatum::Exifdatum(const ExifKey& key, const Value* pValue) : key_(key.clone()) {
  158|  1.43M|  if (pValue)
  ------------------
  |  Branch (158:7): [True: 1.43M, False: 5.00k]
  ------------------
  159|  1.43M|    value_ = pValue->clone();
  160|  1.43M|}
_ZN5Exiv29ExifdatumC2ERKS0_:
  162|  5.19M|Exifdatum::Exifdatum(const Exifdatum& rhs) {
  163|  5.19M|  if (rhs.key_)
  ------------------
  |  Branch (163:7): [True: 5.19M, False: 0]
  ------------------
  164|  5.19M|    key_ = rhs.key_->clone();  // deep copy
  165|  5.19M|  if (rhs.value_)
  ------------------
  |  Branch (165:7): [True: 5.19M, False: 0]
  ------------------
  166|  5.19M|    value_ = rhs.value_->clone();  // deep copy
  167|  5.19M|}
_ZN5Exiv29ExifdatumD2Ev:
  169|  6.62M|Exifdatum::~Exifdatum() = default;
_ZNK5Exiv29Exifdatum5valueEv:
  203|  37.7k|const Value& Exifdatum::value() const {
  204|  37.7k|  if (!value_)
  ------------------
  |  Branch (204:7): [True: 0, False: 37.7k]
  ------------------
  205|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  206|  37.7k|  return *value_;
  207|  37.7k|}
_ZN5Exiv29ExifdatumaSERKS0_:
  209|  16.1k|Exifdatum& Exifdatum::operator=(const Exifdatum& rhs) {
  210|  16.1k|  if (this == &rhs)
  ------------------
  |  Branch (210:7): [True: 0, False: 16.1k]
  ------------------
  211|      0|    return *this;
  212|       |
  213|  16.1k|  key_.reset();
  214|  16.1k|  if (rhs.key_)
  ------------------
  |  Branch (214:7): [True: 16.1k, False: 0]
  ------------------
  215|  16.1k|    key_ = rhs.key_->clone();  // deep copy
  216|       |
  217|  16.1k|  value_.reset();
  218|  16.1k|  if (rhs.value_)
  ------------------
  |  Branch (218:7): [True: 16.1k, False: 0]
  ------------------
  219|  16.1k|    value_ = rhs.value_->clone();  // deep copy
  220|       |
  221|  16.1k|  return *this;
  222|  16.1k|}  // Exifdatum::operator=
_ZN5Exiv29ExifdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  224|  3.24k|Exifdatum& Exifdatum::operator=(const std::string& value) {
  225|  3.24k|  setValue(value);
  226|  3.24k|  return *this;
  227|  3.24k|}
_ZN5Exiv29ExifdatumaSERKt:
  229|     38|Exifdatum& Exifdatum::operator=(const uint16_t& value) {
  230|     38|  return Exiv2::setValue(*this, value);
  231|     38|}
_ZN5Exiv29ExifdatumaSERKj:
  233|  3.38k|Exifdatum& Exifdatum::operator=(const uint32_t& value) {
  234|  3.38k|  return Exiv2::setValue(*this, value);
  235|  3.38k|}
_ZN5Exiv29ExifdatumaSERKNS_5ValueE:
  253|  5.31k|Exifdatum& Exifdatum::operator=(const Value& value) {
  254|  5.31k|  setValue(&value);
  255|  5.31k|  return *this;
  256|  5.31k|}
_ZN5Exiv29Exifdatum8setValueEPKNS_5ValueE:
  258|  5.32k|void Exifdatum::setValue(const Value* pValue) {
  259|  5.32k|  value_.reset();
  260|  5.32k|  if (pValue)
  ------------------
  |  Branch (260:7): [True: 5.32k, False: 0]
  ------------------
  261|  5.32k|    value_ = pValue->clone();
  262|  5.32k|}
_ZN5Exiv29Exifdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  264|  3.56k|int Exifdatum::setValue(const std::string& value) {
  265|  3.56k|  if (!value_) {
  ------------------
  |  Branch (265:7): [True: 2.27k, False: 1.29k]
  ------------------
  266|  2.27k|    TypeId type = key_->defaultTypeId();
  267|  2.27k|    value_ = Value::create(type);
  268|  2.27k|  }
  269|  3.56k|  return value_->read(value);
  270|  3.56k|}
_ZNK5Exiv29Exifdatum11setDataAreaEPKhm:
  272|     38|int Exifdatum::setDataArea(const byte* buf, size_t len) const {
  273|     38|  return value_ ? value_->setDataArea(buf, len) : -1;
  ------------------
  |  Branch (273:10): [True: 38, False: 0]
  ------------------
  274|     38|}
_ZNK5Exiv29Exifdatum3keyEv:
  276|  81.5M|std::string Exifdatum::key() const {
  277|  81.5M|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (277:10): [True: 81.5M, False: 0]
  ------------------
  278|  81.5M|}
_ZNK5Exiv29Exifdatum9groupNameEv:
  284|  3.08M|std::string Exifdatum::groupName() const {
  285|  3.08M|  return key_ ? key_->groupName() : "";
  ------------------
  |  Branch (285:10): [True: 3.08M, False: 0]
  ------------------
  286|  3.08M|}
_ZNK5Exiv29Exifdatum7tagNameEv:
  288|    335|std::string Exifdatum::tagName() const {
  289|    335|  return key_ ? key_->tagName() : "";
  ------------------
  |  Branch (289:10): [True: 335, False: 0]
  ------------------
  290|    335|}
_ZNK5Exiv29Exifdatum3tagEv:
  300|  8.36M|uint16_t Exifdatum::tag() const {
  301|  8.36M|  return key_ ? key_->tag() : 0xffff;
  ------------------
  |  Branch (301:10): [True: 8.36M, False: 0]
  ------------------
  302|  8.36M|}
_ZNK5Exiv29Exifdatum5ifdIdEv:
  304|  15.3M|IfdId Exifdatum::ifdId() const {
  305|  15.3M|  return key_ ? key_->ifdId() : IfdId::ifdIdNotSet;
  ------------------
  |  Branch (305:10): [True: 15.3M, False: 0]
  ------------------
  306|  15.3M|}
_ZNK5Exiv29Exifdatum3idxEv:
  312|  3.14M|int Exifdatum::idx() const {
  313|  3.14M|  return key_ ? key_->idx() : 0;
  ------------------
  |  Branch (313:10): [True: 3.14M, False: 0]
  ------------------
  314|  3.14M|}
_ZNK5Exiv29Exifdatum4copyEPhNS_9ByteOrderE:
  316|  4.37k|size_t Exifdatum::copy(byte* buf, ByteOrder byteOrder) const {
  317|  4.37k|  return value_ ? value_->copy(buf, byteOrder) : 0;
  ------------------
  |  Branch (317:10): [True: 4.37k, False: 0]
  ------------------
  318|  4.37k|}
_ZNK5Exiv29Exifdatum6typeIdEv:
  320|    191|TypeId Exifdatum::typeId() const {
  321|    191|  return value_ ? value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 191, False: 0]
  ------------------
  322|    191|}
_ZNK5Exiv29Exifdatum8typeSizeEv:
  328|    100|size_t Exifdatum::typeSize() const {
  329|    100|  return TypeInfo::typeSize(typeId());
  330|    100|}
_ZNK5Exiv29Exifdatum5countEv:
  332|  73.3k|size_t Exifdatum::count() const {
  333|  73.3k|  return value_ ? value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 73.3k, False: 0]
  ------------------
  334|  73.3k|}
_ZNK5Exiv29Exifdatum4sizeEv:
  336|  4.55M|size_t Exifdatum::size() const {
  337|  4.55M|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (337:10): [True: 4.55M, False: 0]
  ------------------
  338|  4.55M|}
_ZNK5Exiv29Exifdatum8toStringEv:
  340|  20.0k|std::string Exifdatum::toString() const {
  341|  20.0k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 20.0k, False: 0]
  ------------------
  342|  20.0k|}
_ZNK5Exiv29Exifdatum7toInt64Em:
  348|  82.8k|int64_t Exifdatum::toInt64(size_t n) const {
  349|  82.8k|  return value_ ? value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 82.8k, False: 0]
  ------------------
  350|  82.8k|}
_ZNK5Exiv29Exifdatum8getValueEv:
  360|  2.77M|Value::UniquePtr Exifdatum::getValue() const {
  361|  2.77M|  return value_ ? value_->clone() : nullptr;
  ------------------
  |  Branch (361:10): [True: 2.77M, False: 0]
  ------------------
  362|  2.77M|}
_ZNK5Exiv29Exifdatum12sizeDataAreaEv:
  364|     85|size_t Exifdatum::sizeDataArea() const {
  365|     85|  return value_ ? value_->sizeDataArea() : 0;
  ------------------
  |  Branch (365:10): [True: 85, False: 0]
  ------------------
  366|     85|}
_ZNK5Exiv29Exifdatum8dataAreaEv:
  368|     85|DataBuf Exifdatum::dataArea() const {
  369|     85|  return value_ ? value_->dataArea() : DataBuf(nullptr, 0);
  ------------------
  |  Branch (369:10): [True: 85, False: 0]
  ------------------
  370|     85|}
_ZN5Exiv210ExifThumbCC2ERKNS_8ExifDataE:
  372|    238|ExifThumbC::ExifThumbC(const ExifData& exifData) : exifData_(exifData) {
  373|    238|}
_ZNK5Exiv210ExifThumbC4copyEv:
  375|    200|DataBuf ExifThumbC::copy() const {
  376|    200|  auto thumbnail = Thumbnail::create(exifData_);
  377|    200|  if (!thumbnail)
  ------------------
  |  Branch (377:7): [True: 188, False: 12]
  ------------------
  378|    188|    return {};
  379|     12|  return thumbnail->copy(exifData_);
  380|    200|}
_ZN5Exiv29ExifThumbC2ERNS_8ExifDataE:
  411|     38|ExifThumb::ExifThumb(ExifData& exifData) : ExifThumbC(exifData), exifData_(exifData) {
  412|     38|}
_ZN5Exiv29ExifThumb16setJpegThumbnailEPKhm:
  435|     38|void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
  436|     38|  exifData_["Exif.Thumbnail.Compression"] = std::uint16_t{6};
  437|     38|  Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
  438|     38|  format = 0U;
  439|     38|  format.setDataArea(buf, size);
  440|     38|  exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
  441|     38|}
_ZN5Exiv28ExifDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  447|  15.1k|Exifdatum& ExifData::operator[](const std::string& key) {
  448|  15.1k|  ExifKey exifKey(key);
  449|  15.1k|  auto pos = findKey(exifKey);
  450|  15.1k|  if (pos == end()) {
  ------------------
  |  Branch (450:7): [True: 4.68k, False: 10.4k]
  ------------------
  451|  4.68k|    return exifMetadata_.emplace_back(exifKey);
  452|  4.68k|  }
  453|  10.4k|  return *pos;
  454|  15.1k|}
_ZN5Exiv28ExifData3addERKNS_7ExifKeyEPKNS_5ValueE:
  456|  1.43M|void ExifData::add(const ExifKey& key, const Value* pValue) {
  457|  1.43M|  add(Exifdatum(key, pValue));
  458|  1.43M|}
_ZN5Exiv28ExifData3addERKNS_9ExifdatumE:
  460|  1.57M|void ExifData::add(const Exifdatum& exifdatum) {
  461|       |  // allow duplicates
  462|  1.57M|  exifMetadata_.push_back(exifdatum);
  463|  1.57M|}
_ZNK5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  465|   203k|ExifData::const_iterator ExifData::findKey(const ExifKey& key) const {
  466|   203k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  467|   203k|}
_ZN5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  469|   635k|ExifData::iterator ExifData::findKey(const ExifKey& key) {
  470|   635k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  471|   635k|}
_ZN5Exiv28ExifData5clearEv:
  473|  28.8k|void ExifData::clear() {
  474|  28.8k|  exifMetadata_.clear();
  475|  28.8k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEES5_:
  485|  76.0k|ExifData::iterator ExifData::erase(ExifData::iterator beg, ExifData::iterator end) {
  486|  76.0k|  return exifMetadata_.erase(beg, end);
  487|  76.0k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEE:
  489|  66.1k|ExifData::iterator ExifData::erase(ExifData::iterator pos) {
  490|  66.1k|  return exifMetadata_.erase(pos);
  491|  66.1k|}
_ZN5Exiv210ExifParser6decodeERNS_8ExifDataEPKhm:
  493|    239|ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size) {
  494|    239|  IptcData iptcData;
  495|    239|  XmpData xmpData;
  496|    239|  ByteOrder bo = TiffParser::decode(exifData, iptcData, xmpData, pData, size);
  497|    239|#ifndef SUPPRESS_WARNINGS
  498|    239|  if (!iptcData.empty()) {
  ------------------
  |  Branch (498:7): [True: 16, False: 223]
  ------------------
  499|     16|    EXV_WARNING << "Ignoring IPTC information encoded in the Exif data.\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()
  ------------------
  500|     16|  }
  501|    239|  if (!xmpData.empty()) {
  ------------------
  |  Branch (501:7): [True: 8, False: 231]
  ------------------
  502|      8|    EXV_WARNING << "Ignoring XMP information encoded in the Exif data.\n";
  ------------------
  |  |  138|      8|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      8|  LogMsg(LogMsg::warn).os()
  ------------------
  503|      8|  }
  504|    239|#endif
  505|    239|  return bo;
  506|    239|}
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataE:
  512|  5.11k|WriteMethod ExifParser::encode(Blob& blob, const byte* pData, size_t size, ByteOrder byteOrder, ExifData& exifData) {
  513|       |  // Delete IFD0 tags that are "not recorded" in compressed images
  514|       |  // Reference: Exif 2.2 specs, 4.6.8 Tag Support Levels, section A
  515|  5.11k|  static constexpr auto filteredIfd0Tags = std::array{
  516|  5.11k|      "Exif.Image.PhotometricInterpretation",
  517|  5.11k|      "Exif.Image.StripOffsets",
  518|  5.11k|      "Exif.Image.RowsPerStrip",
  519|  5.11k|      "Exif.Image.StripByteCounts",
  520|  5.11k|      "Exif.Image.JPEGInterchangeFormat",
  521|  5.11k|      "Exif.Image.JPEGInterchangeFormatLength",
  522|  5.11k|      "Exif.Image.SubIFDs",
  523|       |      // Issue 981.  Never allow manufactured data to be written
  524|  5.11k|      "Exif.Canon.AFInfoSize",
  525|  5.11k|      "Exif.Canon.AFAreaMode",
  526|  5.11k|      "Exif.Canon.AFNumPoints",
  527|  5.11k|      "Exif.Canon.AFValidPoints",
  528|  5.11k|      "Exif.Canon.AFCanonImageWidth",
  529|  5.11k|      "Exif.Canon.AFCanonImageHeight",
  530|  5.11k|      "Exif.Canon.AFImageWidth",
  531|  5.11k|      "Exif.Canon.AFImageHeight",
  532|  5.11k|      "Exif.Canon.AFAreaWidths",
  533|  5.11k|      "Exif.Canon.AFAreaHeights",
  534|  5.11k|      "Exif.Canon.AFXPositions",
  535|  5.11k|      "Exif.Canon.AFYPositions",
  536|  5.11k|      "Exif.Canon.AFPointsInFocus",
  537|  5.11k|      "Exif.Canon.AFPointsSelected",
  538|  5.11k|      "Exif.Canon.AFPointsUnusable",
  539|  5.11k|      "Exif.Canon.AFFineRotation",
  540|  5.11k|  };
  541|   117k|  for (auto&& filteredIfd0Tag : filteredIfd0Tags) {
  ------------------
  |  Branch (541:31): [True: 117k, False: 5.11k]
  ------------------
  542|   117k|    auto pos = exifData.findKey(ExifKey(filteredIfd0Tag));
  543|   117k|    if (pos != exifData.end()) {
  ------------------
  |  Branch (543:9): [True: 659, False: 117k]
  ------------------
  544|       |#ifdef EXIV2_DEBUG_MESSAGES
  545|       |      std::cerr << "Warning: Exif tag " << pos->key() << " not encoded\n";
  546|       |#endif
  547|    659|      exifData.erase(pos);
  548|    659|    }
  549|   117k|  }
  550|       |
  551|       |  // Delete IFDs which do not occur in JPEGs
  552|  5.11k|  static constexpr auto filteredIfds = std::array{
  553|  5.11k|      IfdId::subImage1Id, IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id,
  554|  5.11k|      IfdId::subImage6Id, IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id, IfdId::subThumb1Id,
  555|  5.11k|      IfdId::panaRawId,   IfdId::ifd2Id,      IfdId::ifd3Id,
  556|  5.11k|  };
  557|  66.5k|  for (auto&& filteredIfd : filteredIfds) {
  ------------------
  |  Branch (557:27): [True: 66.5k, False: 5.11k]
  ------------------
  558|       |#ifdef EXIV2_DEBUG_MESSAGES
  559|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  560|       |#endif
  561|  66.5k|    eraseIfd(exifData, filteredIfd);
  562|  66.5k|  }
  563|       |
  564|       |  // IPTC and XMP are stored elsewhere, not in the Exif APP1 segment.
  565|  5.11k|  IptcData emptyIptc;
  566|  5.11k|  XmpData emptyXmp;
  567|       |
  568|       |  // Encode and check if the result fits into a JPEG Exif APP1 segment
  569|  5.11k|  MemIo mio1;
  570|  5.11k|  TiffHeader header(byteOrder, 0x00000008, false);
  571|  5.11k|  WriteMethod wm = TiffParserWorker::encode(mio1, pData, size, exifData, emptyIptc, emptyXmp, Tag::root,
  572|  5.11k|                                            TiffMapping::findEncoder, &header, nullptr);
  573|  5.11k|  if (mio1.size() <= 65527) {
  ------------------
  |  Branch (573:7): [True: 2.58k, False: 2.53k]
  ------------------
  574|  2.58k|    append(blob, mio1.mmap(), mio1.size());
  575|  2.58k|    return wm;
  576|  2.58k|  }
  577|       |
  578|       |  // If it doesn't fit, remove additional tags
  579|       |
  580|       |  // Delete preview tags if the preview is larger than 32kB.
  581|       |  // Todo: Enhance preview classes to be able to write and delete previews and use that instead.
  582|       |  // Table must be sorted by preview, the first tag in each group is the size
  583|  2.53k|  static constexpr auto filteredPvTags = std::array{
  584|  2.53k|      std::pair(pttLen, "Exif.Minolta.ThumbnailLength"),
  585|  2.53k|      std::pair(pttTag, "Exif.Minolta.ThumbnailOffset"),
  586|  2.53k|      std::pair(pttLen, "Exif.Minolta.Thumbnail"),
  587|  2.53k|      std::pair(pttLen, "Exif.NikonPreview.JPEGInterchangeFormatLength"),
  588|  2.53k|      std::pair(pttIfd, "NikonPreview"),
  589|  2.53k|      std::pair(pttLen, "Exif.Olympus.ThumbnailLength"),
  590|  2.53k|      std::pair(pttTag, "Exif.Olympus.ThumbnailOffset"),
  591|  2.53k|      std::pair(pttLen, "Exif.Olympus.ThumbnailImage"),
  592|  2.53k|      std::pair(pttLen, "Exif.Olympus.Thumbnail"),
  593|  2.53k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailLength"),
  594|  2.53k|      std::pair(pttTag, "Exif.Olympus2.ThumbnailOffset"),
  595|  2.53k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailImage"),
  596|  2.53k|      std::pair(pttLen, "Exif.Olympus2.Thumbnail"),
  597|  2.53k|      std::pair(pttLen, "Exif.OlympusCs.PreviewImageLength"),
  598|  2.53k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageStart"),
  599|  2.53k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageValid"),
  600|  2.53k|      std::pair(pttLen, "Exif.Pentax.PreviewLength"),
  601|  2.53k|      std::pair(pttTag, "Exif.Pentax.PreviewOffset"),
  602|  2.53k|      std::pair(pttTag, "Exif.Pentax.PreviewResolution"),
  603|  2.53k|      std::pair(pttLen, "Exif.PentaxDng.PreviewLength"),
  604|  2.53k|      std::pair(pttTag, "Exif.PentaxDng.PreviewOffset"),
  605|  2.53k|      std::pair(pttTag, "Exif.PentaxDng.PreviewResolution"),
  606|  2.53k|      std::pair(pttLen, "Exif.SamsungPreview.JPEGInterchangeFormatLength"),
  607|  2.53k|      std::pair(pttIfd, "SamsungPreview"),
  608|  2.53k|      std::pair(pttLen, "Exif.Thumbnail.StripByteCounts"),
  609|  2.53k|      std::pair(pttIfd, "Thumbnail"),
  610|  2.53k|      std::pair(pttLen, "Exif.Thumbnail.JPEGInterchangeFormatLength"),
  611|  2.53k|      std::pair(pttIfd, "Thumbnail"),
  612|  2.53k|  };
  613|  2.53k|  bool delTags = false;
  614|  70.6k|  for (auto&& [ptt, key] : filteredPvTags) {
  ------------------
  |  Branch (614:26): [True: 70.6k, False: 2.53k]
  ------------------
  615|  70.6k|    switch (ptt) {
  ------------------
  |  Branch (615:13): [True: 70.6k, False: 0]
  ------------------
  616|  37.8k|      case pttLen: {
  ------------------
  |  Branch (616:7): [True: 37.8k, False: 32.8k]
  ------------------
  617|  37.8k|        delTags = false;
  618|  37.8k|        if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end() && sumToLong(*pos) > 32768) {
  ------------------
  |  Branch (618:56): [True: 1.36k, False: 36.5k]
  |  Branch (618:56): [True: 28, False: 37.8k]
  |  Branch (618:81): [True: 28, False: 1.33k]
  ------------------
  619|     28|          delTags = true;
  620|     28|#ifndef SUPPRESS_WARNINGS
  621|     28|          EXV_WARNING << "Exif tag " << pos->key() << " not encoded\n";
  ------------------
  |  |  138|     28|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 28]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     28|  LogMsg(LogMsg::warn).os()
  ------------------
  622|     28|#endif
  623|     28|          exifData.erase(pos);
  624|     28|        }
  625|  37.8k|        break;
  626|      0|      }
  627|  22.7k|      case pttTag: {
  ------------------
  |  Branch (627:7): [True: 22.7k, False: 47.9k]
  ------------------
  628|  22.7k|        if (delTags) {
  ------------------
  |  Branch (628:13): [True: 19, False: 22.7k]
  ------------------
  629|     19|          if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end()) {
  ------------------
  |  Branch (629:58): [True: 11, False: 8]
  ------------------
  630|     11|#ifndef SUPPRESS_WARNINGS
  631|     11|            EXV_WARNING << "Exif tag " << pos->key() << " not encoded\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  632|     11|#endif
  633|     11|            exifData.erase(pos);
  634|     11|          }
  635|     19|        }
  636|  22.7k|        break;
  637|      0|      }
  638|  10.0k|      case pttIfd:
  ------------------
  |  Branch (638:7): [True: 10.0k, False: 60.5k]
  ------------------
  639|  10.0k|        if (delTags) {
  ------------------
  |  Branch (639:13): [True: 1, False: 10.0k]
  ------------------
  640|      1|#ifndef SUPPRESS_WARNINGS
  641|      1|          EXV_WARNING << "Exif IFD " << key << " not encoded\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()
  ------------------
  642|      1|#endif
  643|      1|          eraseIfd(exifData, Internal::groupId(key));
  644|      1|        }
  645|  10.0k|        break;
  646|  70.6k|    }
  647|  70.6k|  }
  648|       |
  649|       |  // Delete unknown tags larger than 4kB and known tags larger than 20kB.
  650|  2.53k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  651|  2.53k|  exifData.erase(std::remove_if(exifData.begin(), exifData.end(), f), exifData.end());
  652|       |
  653|       |  // Encode the remaining Exif tags again, don't care if it fits this time
  654|  2.53k|  MemIo mio2;
  655|  2.53k|  wm = TiffParserWorker::encode(mio2, pData, size, exifData, emptyIptc, emptyXmp, Tag::root, TiffMapping::findEncoder,
  656|  2.53k|                                &header, nullptr);
  657|  2.53k|  append(blob, mio2.mmap(), mio2.size());
  658|       |#ifdef EXIV2_DEBUG_MESSAGES
  659|       |  if (wm == wmIntrusive) {
  660|       |    std::cerr << "SIZE OF EXIF DATA IS " << std::dec << mio2.size() << " BYTES\n";
  661|       |  } else {
  662|       |    std::cerr << "SIZE DOESN'T MATTER, NON-INTRUSIVE WRITING USED\n";
  663|       |  }
  664|       |#endif
  665|  2.53k|  return wm;
  666|       |
  667|  2.53k|}  // ExifParser::encode
exif.cpp:_ZNK12_GLOBAL__N_118FindExifdatumByKeyclERKN5Exiv29ExifdatumE:
   45|  81.5M|  bool operator()(const Exiv2::Exifdatum& exifdatum) const {
   46|  81.5M|    return key_ == exifdatum.key();
   47|  81.5M|  }
exif.cpp:_ZN12_GLOBAL__N_118FindExifdatumByKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   39|   838k|  explicit FindExifdatumByKey(std::string key) : key_(std::move(key)) {
   40|   838k|  }
exif.cpp:_ZZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataEENK3$_0clINS_9ExifdatumEEEDaRKT_:
  650|   889k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  ------------------
  |  Branch (650:42): [True: 335, False: 888k]
  |  Branch (650:63): [True: 233, False: 102]
  |  Branch (650:99): [True: 31, False: 888k]
  ------------------
exif.cpp:_ZN12_GLOBAL__N_19Thumbnail6createERKN5Exiv28ExifDataE:
  675|    200|Thumbnail::UniquePtr Thumbnail::create(const Exiv2::ExifData& exifData) {
  676|    200|  const Exiv2::ExifKey k1("Exif.Thumbnail.Compression");
  677|    200|  auto pos = exifData.findKey(k1);
  678|    200|  if (pos != exifData.end()) {
  ------------------
  |  Branch (678:7): [True: 12, False: 188]
  ------------------
  679|     12|    if (pos->count() == 0)
  ------------------
  |  Branch (679:9): [True: 0, False: 12]
  ------------------
  680|      0|      return nullptr;
  681|     12|    if (pos->toInt64() == 6)
  ------------------
  |  Branch (681:9): [True: 12, False: 0]
  ------------------
  682|     12|      return std::make_unique<JpegThumbnail>();
  683|      0|    return std::make_unique<TiffThumbnail>();
  684|     12|  }
  685|       |
  686|    188|  const Exiv2::ExifKey k2("Exif.Thumbnail.JPEGInterchangeFormat");
  687|    188|  pos = exifData.findKey(k2);
  688|    188|  if (pos != exifData.end())
  ------------------
  |  Branch (688:7): [True: 0, False: 188]
  ------------------
  689|      0|    return std::make_unique<JpegThumbnail>();
  690|    188|  return nullptr;
  691|    188|}
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailC2Ev:
   67|     12|  Thumbnail() = default;
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailD2Ev:
   69|     12|  virtual ~Thumbnail() = default;
exif.cpp:_ZNK12_GLOBAL__N_113JpegThumbnail4copyERKN5Exiv28ExifDataE:
  726|     12|Exiv2::DataBuf JpegThumbnail::copy(const Exiv2::ExifData& exifData) const {
  727|     12|  Exiv2::ExifKey key("Exif.Thumbnail.JPEGInterchangeFormat");
  728|     12|  auto format = exifData.findKey(key);
  729|     12|  if (format == exifData.end())
  ------------------
  |  Branch (729:7): [True: 0, False: 12]
  ------------------
  730|      0|    return {};
  731|     12|  return format->dataArea();
  732|     12|}
exif.cpp:_ZN12_GLOBAL__N_19sumToLongERKN5Exiv29ExifdatumE:
  734|  1.36k|int64_t sumToLong(const Exiv2::Exifdatum& md) {
  735|  1.36k|  int64_t sum = 0;
  736|  43.0k|  for (size_t i = 0; i < md.count(); ++i) {
  ------------------
  |  Branch (736:22): [True: 41.6k, False: 1.36k]
  ------------------
  737|  41.6k|    sum = Safe::add(sum, md.toInt64(i));
  738|  41.6k|  }
  739|  1.36k|  return sum;
  740|  1.36k|}
exif.cpp:_ZN12_GLOBAL__N_18eraseIfdERN5Exiv28ExifDataENS0_5IfdIdE:
  742|  66.5k|void eraseIfd(Exiv2::ExifData& ed, Exiv2::IfdId ifdId) {
  743|  66.5k|  ed.erase(std::remove_if(ed.begin(), ed.end(), Exiv2::FindExifdatum(ifdId)), ed.end());
  744|  66.5k|}
_ZN5Exiv28setValueItEERNS_9ExifdatumES2_RKT_:
  150|     38|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|     38|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|     38|  v->value_.push_back(value);
  153|     38|  exifDatum.value_ = std::move(v);
  154|     38|  return exifDatum;
  155|     38|}
_ZN5Exiv28setValueIjEERNS_9ExifdatumES2_RKT_:
  150|  3.38k|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|  3.38k|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|  3.38k|  v->value_.push_back(value);
  153|  3.38k|  exifDatum.value_ = std::move(v);
  154|  3.38k|  return exifDatum;
  155|  3.38k|}

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

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

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

_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  140|  33.2k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  141|  33.2k|}
_ZN5Exiv25ImageD2Ev:
  143|  33.2k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  181|    774|bool Image::isBigEndianPlatform() {
  182|    774|  return std::endian::native == std::endian::big;
  183|    774|}
_ZN5Exiv25Image8byteSwapEjb:
  205|  3.54k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  206|       |#ifdef __cpp_lib_byteswap
  207|       |  return bSwap ? std::byteswap(value) : value;
  208|       |#elif defined(_MSC_VER)
  209|       |  return bSwap ? _byteswap_ulong(value) : value;
  210|       |#else
  211|  3.54k|  uint32_t result = 0;
  212|  3.54k|  result |= (value & 0x000000FFU) << 24;
  213|  3.54k|  result |= (value & 0x0000FF00U) << 8;
  214|  3.54k|  result |= (value & 0x00FF0000U) >> 8;
  215|  3.54k|  result |= (value & 0xFF000000U) >> 24;
  216|  3.54k|  return bSwap ? result : value;
  ------------------
  |  Branch (216:10): [True: 0, False: 3.54k]
  ------------------
  217|  3.54k|#endif
  218|  3.54k|}
_ZN5Exiv25Image13clearMetadataEv:
  537|  28.4k|void Image::clearMetadata() {
  538|  28.4k|  clearExifData();
  539|  28.4k|  clearIptcData();
  540|  28.4k|  clearXmpPacket();
  541|  28.4k|  clearXmpData();
  542|  28.4k|  clearComment();
  543|  28.4k|  clearIccProfile();
  544|  28.4k|}
_ZN5Exiv25Image8exifDataEv:
  546|  9.77k|ExifData& Image::exifData() {
  547|  9.77k|  return exifData_;
  548|  9.77k|}
_ZN5Exiv25Image8iptcDataEv:
  550|  3.61k|IptcData& Image::iptcData() {
  551|  3.61k|  return iptcData_;
  552|  3.61k|}
_ZN5Exiv25Image7xmpDataEv:
  554|  20.7k|XmpData& Image::xmpData() {
  555|  20.7k|  return xmpData_;
  556|  20.7k|}
_ZN5Exiv25Image9xmpPacketEv:
  558|    753|std::string& Image::xmpPacket() {
  559|       |  // Serialize the current XMP
  560|    753|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (560:7): [True: 1, False: 752]
  |  Branch (560:28): [True: 1, False: 0]
  ------------------
  561|      1|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  562|      1|  }
  563|    753|  return xmpPacket_;
  564|    753|}
_ZN5Exiv25Image13clearExifDataEv:
  586|  28.4k|void Image::clearExifData() {
  587|  28.4k|  exifData_.clear();
  588|  28.4k|}
_ZN5Exiv25Image11setExifDataERKNS_8ExifDataE:
  590|    315|void Image::setExifData(const ExifData& exifData) {
  591|    315|  exifData_ = exifData;
  592|    315|}
_ZN5Exiv25Image13clearIptcDataEv:
  594|  28.4k|void Image::clearIptcData() {
  595|  28.4k|  iptcData_.clear();
  596|  28.4k|}
_ZN5Exiv25Image11setIptcDataERKNS_8IptcDataE:
  598|    315|void Image::setIptcData(const IptcData& iptcData) {
  599|    315|  iptcData_ = iptcData;
  600|    315|}
_ZN5Exiv25Image14clearXmpPacketEv:
  602|  28.4k|void Image::clearXmpPacket() {
  603|  28.4k|  xmpPacket_.clear();
  604|  28.4k|  writeXmpFromPacket(true);
  605|  28.4k|}
_ZN5Exiv25Image12clearXmpDataEv:
  614|  28.4k|void Image::clearXmpData() {
  615|  28.4k|  xmpData_.clear();
  616|  28.4k|  writeXmpFromPacket(false);
  617|  28.4k|}
_ZN5Exiv25Image10setXmpDataERKNS_7XmpDataE:
  619|    315|void Image::setXmpData(const XmpData& xmpData) {
  620|    315|  xmpData_ = xmpData;
  621|    315|  writeXmpFromPacket(false);
  622|    315|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  625|  57.1k|void Image::writeXmpFromPacket(bool flag) {
  626|  57.1k|  writeXmpFromPacket_ = flag;
  627|  57.1k|}
_ZN5Exiv25Image12clearCommentEv:
  633|  28.4k|void Image::clearComment() {
  634|  28.4k|  comment_.erase();
  635|  28.4k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  637|    164|void Image::setComment(const std::string& comment) {
  638|    164|  comment_ = comment;
  639|    164|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  641|    276|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  642|    276|  iccProfile_ = std::move(iccProfile);
  643|    276|  if (bTestValid) {
  ------------------
  |  Branch (643:7): [True: 276, False: 0]
  ------------------
  644|    276|    checkIccProfile();
  645|    276|  }
  646|    276|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  648|  5.07k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  649|  5.07k|  if (size == 0) {
  ------------------
  |  Branch (649:7): [True: 70, False: 5.00k]
  ------------------
  650|     70|    return;
  651|     70|  }
  652|  5.00k|  const size_t start = iccProfile_.size();
  653|  5.00k|  iccProfile_.resize(Safe::add(start, size));
  654|  5.00k|  memcpy(iccProfile_.data(start), bytes, size);
  655|  5.00k|  if (bTestValid) {
  ------------------
  |  Branch (655:7): [True: 35, False: 4.96k]
  ------------------
  656|     35|    checkIccProfile();
  657|     35|  }
  658|  5.00k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  660|    311|void Image::checkIccProfile() const {
  661|    311|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (661:7): [True: 11, False: 300]
  ------------------
  662|     11|    throw Error(ErrorCode::kerInvalidIccProfile);
  663|     11|  }
  664|    300|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  665|    300|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (665:7): [True: 29, False: 271]
  ------------------
  666|     29|    throw Error(ErrorCode::kerInvalidIccProfile);
  667|     29|  }
  668|    300|}
_ZN5Exiv25Image15clearIccProfileEv:
  670|  28.4k|void Image::clearIccProfile() {
  671|  28.4k|  iccProfile_.reset();
  672|  28.4k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  674|  17.9k|void Image::setByteOrder(ByteOrder byteOrder) {
  675|  17.9k|  byteOrder_ = byteOrder;
  676|  17.9k|}
_ZNK5Exiv25Image9byteOrderEv:
  678|  5.51k|ByteOrder Image::byteOrder() const {
  679|  5.51k|  return byteOrder_;
  680|  5.51k|}
_ZNK5Exiv25Image10pixelWidthEv:
  682|  1.14k|uint32_t Image::pixelWidth() const {
  683|  1.14k|  return pixelWidth_;
  684|  1.14k|}
_ZNK5Exiv25Image11pixelHeightEv:
  686|  1.14k|uint32_t Image::pixelHeight() const {
  687|  1.14k|  return pixelHeight_;
  688|  1.14k|}
_ZNK5Exiv25Image8exifDataEv:
  690|   200k|const ExifData& Image::exifData() const {
  691|   200k|  return exifData_;
  692|   200k|}
_ZNK5Exiv25Image7xmpDataEv:
  698|  4.81k|const XmpData& Image::xmpData() const {
  699|  4.81k|  return xmpData_;
  700|  4.81k|}
_ZNK5Exiv25Image7commentEv:
  702|  1.58k|std::string Image::comment() const {
  703|  1.58k|  return comment_;
  704|  1.58k|}
_ZNK5Exiv25Image2ioEv:
  710|  25.3k|BasicIo& Image::io() const {
  711|  25.3k|  return *io_;
  712|  25.3k|}
_ZNK5Exiv25Image18writeXmpFromPacketEv:
  714|  17.7k|bool Image::writeXmpFromPacket() const {
  715|  17.7k|  return writeXmpFromPacket_;
  716|  17.7k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  718|  19.4k|const NativePreviewList& Image::nativePreviews() const {
  719|  19.4k|  return nativePreviews_;
  720|  19.4k|}
_ZNK5Exiv25Image4goodEv:
  722|  33.1k|bool Image::good() const {
  723|  33.1k|  if (io_->open() != 0)
  ------------------
  |  Branch (723:7): [True: 0, False: 33.1k]
  ------------------
  724|      0|    return false;
  725|  33.1k|  IoCloser closer(*io_);
  726|  33.1k|  return ImageFactory::checkType(imageType_, *io_, false);
  727|  33.1k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  777|  33.1k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  778|  33.1k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (778:12): [True: 33.1k, False: 0]
  ------------------
  779|  33.1k|    return r->isThisType_(io, advance);
  780|      0|  return false;
  781|  33.1k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  863|  33.8k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  864|  33.8k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  865|  33.8k|  if (!image)
  ------------------
  |  Branch (865:7): [True: 854, False: 32.9k]
  ------------------
  866|    854|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  867|  32.9k|  return image;
  868|  33.8k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  870|  33.8k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  871|  33.8k|  if (io->open() != 0) {
  ------------------
  |  Branch (871:7): [True: 0, False: 33.8k]
  ------------------
  872|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  873|      0|  }
  874|   586k|  for (const auto& r : registry) {
  ------------------
  |  Branch (874:22): [True: 586k, False: 1.03k]
  ------------------
  875|   586k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (875:9): [True: 32.8k, False: 553k]
  ------------------
  876|  32.8k|      return r.newInstance_(std::move(io), false);
  877|  32.8k|    }
  878|   586k|  }
  879|  1.03k|  return nullptr;
  880|  33.8k|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeE:
  899|    315|Image::UniquePtr ImageFactory::create(ImageType type) {
  900|    315|  auto image = create(type, std::make_unique<MemIo>());
  901|    315|  if (!image)
  ------------------
  |  Branch (901:7): [True: 0, False: 315]
  ------------------
  902|      0|    throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
  903|    315|  return image;
  904|    315|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  906|    315|Image::UniquePtr ImageFactory::create(ImageType type, BasicIo::UniquePtr io) {
  907|       |  // BasicIo instance does not need to be open
  908|    315|  if (type == ImageType::none)
  ------------------
  |  Branch (908:7): [True: 0, False: 315]
  ------------------
  909|      0|    return {};
  910|    315|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (910:12): [True: 315, False: 0]
  ------------------
  911|    315|    return r->newInstance_(std::move(io), true);
  912|      0|  return {};
  913|    315|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  918|  80.1k|void append(Blob& blob, const byte* buf, size_t len) {
  919|  80.1k|  if (len != 0) {
  ------------------
  |  Branch (919:7): [True: 76.5k, False: 3.57k]
  ------------------
  920|  76.5k|    Blob::size_type size = blob.size();
  921|  76.5k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (921:9): [True: 6.08k, False: 70.5k]
  ------------------
  922|  6.08k|      blob.reserve(size + 65536);
  923|  6.08k|    }
  924|  76.5k|    blob.resize(size + len);
  925|  76.5k|    std::copy_n(buf, len, blob.begin() + size);
  926|  76.5k|  }
  927|  80.1k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   569k|  bool operator==(const ImageType& imageType) const {
   67|   569k|    return imageType == imageType_;
   68|   569k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  78.0k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  78.0k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 25.3k, False: 52.6k]
  ------------------
   58|  25.3k|    value_ = pValue->clone();
   59|  78.0k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   288k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   288k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 288k, False: 0]
  ------------------
   63|   288k|    key_ = rhs.key_->clone();  // deep copy
   64|   288k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 288k, False: 0]
  ------------------
   65|   288k|    value_ = rhs.value_->clone();  // deep copy
   66|   288k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   366k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|   101k|std::string Iptcdatum::key() const {
   79|   101k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 101k, False: 0]
  ------------------
   80|   101k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   487k|uint16_t Iptcdatum::record() const {
   87|   487k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 487k, False: 0]
  ------------------
   88|   487k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|  1.35M|uint16_t Iptcdatum::tag() const {
  111|  1.35M|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 1.35M, False: 0]
  ------------------
  112|  1.35M|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|  65.9k|size_t Iptcdatum::size() const {
  131|  65.9k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 65.9k, False: 0]
  ------------------
  132|  65.9k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  51.7k|std::string Iptcdatum::toString() const {
  135|  51.7k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 51.7k, False: 0]
  ------------------
  136|  51.7k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  84.7k|const Value& Iptcdatum::value() const {
  159|  84.7k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 84.7k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  84.7k|  return *value_;
  162|  84.7k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|  98.5k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|  98.5k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 98.5k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|  98.5k|  key_.reset();
  169|  98.5k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 98.5k, False: 0]
  ------------------
  170|  98.5k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|  98.5k|  value_.reset();
  173|  98.5k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 98.5k, False: 0]
  ------------------
  174|  98.5k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|  98.5k|  return *this;
  177|  98.5k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.28k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.28k|  setValue(value);
  188|  1.28k|  return *this;
  189|  1.28k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  52.8k|int Iptcdatum::setValue(const std::string& value) {
  203|  52.8k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 52.6k, False: 218]
  ------------------
  204|  52.6k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  52.6k|    value_ = Value::create(type);
  206|  52.6k|  }
  207|  52.8k|  return value_->read(value);
  208|  52.8k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.28k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.28k|  IptcKey iptcKey(key);
  212|  1.28k|  auto pos = findKey(iptcKey);
  213|  1.28k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.06k, False: 218]
  ------------------
  214|  1.06k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.06k|  }
  216|    218|  return *pos;
  217|  1.28k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|  1.25k|size_t IptcData::size() const {
  220|  1.25k|  size_t newSize = 0;
  221|  32.9k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 32.9k, False: 1.25k]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  32.9k|    newSize += 5;
  224|  32.9k|    size_t dataSize = iptc.size();
  225|  32.9k|    newSize += dataSize;
  226|  32.9k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 32.9k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  32.9k|  }
  231|  1.25k|  return newSize;
  232|  1.25k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  25.3k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  25.3k|  return add(Iptcdatum(key, value));
  236|  25.3k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  76.9k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  76.9k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 14.7k, False: 62.2k]
  |  Branch (239:7): [True: 11.3k, False: 65.5k]
  ------------------
  240|  14.7k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 11.3k, False: 3.34k]
  ------------------
  241|  11.3k|    return 6;
  242|  11.3k|  }
  243|       |  // allow duplicates
  244|  65.5k|  iptcMetadata_.push_back(iptcDatum);
  245|  65.5k|  return 0;
  246|  76.9k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  1.86k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  1.86k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  1.86k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  39.4k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  39.4k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  39.4k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  14.7k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  14.7k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  14.7k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  1.86k|const char* IptcData::detectCharset() const {
  305|  1.86k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  1.86k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 524, False: 1.34k]
  ------------------
  307|    524|    const std::string value = pos->toString();
  308|    524|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 524, False: 0]
  |  Branch (308:30): [True: 524, False: 0]
  ------------------
  309|    524|      return "UTF-8";
  310|    524|  }
  311|       |
  312|  1.34k|  bool ascii = true;
  313|  1.34k|  bool utf8 = true;
  314|       |
  315|  1.34k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 1.34k]
  ------------------
  316|      0|    std::string value = key.toString();
  317|      0|    if (key.value().ok()) {
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|      int seqCount = 0;
  319|      0|      for (auto c : value) {
  ------------------
  |  Branch (319:19): [True: 0, False: 0]
  ------------------
  320|      0|        if (seqCount) {
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  ------------------
  321|      0|          if ((c & 0xc0) != 0x80) {
  ------------------
  |  Branch (321:15): [True: 0, False: 0]
  ------------------
  322|      0|            utf8 = false;
  323|      0|            break;
  324|      0|          }
  325|      0|          --seqCount;
  326|      0|        } else {
  327|      0|          if (c & 0x80)
  ------------------
  |  Branch (327:15): [True: 0, False: 0]
  ------------------
  328|      0|            ascii = false;
  329|      0|          else
  330|      0|            continue;  // ascii character
  331|       |
  332|      0|          if ((c & 0xe0) == 0xc0)
  ------------------
  |  Branch (332:15): [True: 0, False: 0]
  ------------------
  333|      0|            seqCount = 1;
  334|      0|          else if ((c & 0xf0) == 0xe0)
  ------------------
  |  Branch (334:20): [True: 0, False: 0]
  ------------------
  335|      0|            seqCount = 2;
  336|      0|          else if ((c & 0xf8) == 0xf0)
  ------------------
  |  Branch (336:20): [True: 0, False: 0]
  ------------------
  337|      0|            seqCount = 3;
  338|      0|          else if ((c & 0xfc) == 0xf8)
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      0|            seqCount = 4;
  340|      0|          else if ((c & 0xfe) == 0xfc)
  ------------------
  |  Branch (340:20): [True: 0, False: 0]
  ------------------
  341|      0|            seqCount = 5;
  342|      0|          else {
  343|      0|            utf8 = false;
  344|      0|            break;
  345|      0|          }
  346|      0|        }
  347|      0|      }
  348|      0|      if (seqCount)
  ------------------
  |  Branch (348:11): [True: 0, False: 0]
  ------------------
  349|      0|        utf8 = false;  // unterminated seq
  350|      0|      if (!utf8)
  ------------------
  |  Branch (350:11): [True: 0, False: 0]
  ------------------
  351|      0|        break;
  352|      0|    }
  353|      0|  }
  354|       |
  355|  1.34k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 1.34k, False: 0]
  ------------------
  356|  1.34k|    return "ASCII";
  357|      0|  if (utf8)
  ------------------
  |  Branch (357:7): [True: 0, False: 0]
  ------------------
  358|      0|    return "UTF-8";
  359|      0|  return nullptr;
  360|      0|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  2.13k|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.13k|  auto pRead = pData;
  367|  2.13k|  const auto pEnd = pData + size;
  368|  2.13k|  iptcData.clear();
  369|       |
  370|  2.13k|  uint16_t record = 0;
  371|  2.13k|  uint16_t dataSet = 0;
  372|  2.13k|  uint32_t sizeData = 0;
  373|  2.13k|  byte extTest = 0;
  374|       |
  375|   928k|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 927k, False: 1.40k]
  ------------------
  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|   927k|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 900k, False: 26.1k]
  ------------------
  380|   900k|      continue;
  381|  26.1k|    record = *pRead++;
  382|  26.1k|    dataSet = *pRead++;
  383|       |
  384|  26.1k|    extTest = *pRead;
  385|  26.1k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 754, False: 25.3k]
  ------------------
  386|       |      // extended dataset
  387|    754|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|    754|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 180, False: 574]
  ------------------
  389|    180|        return 5;
  390|    574|      pRead += 2;
  391|    574|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 6, False: 568]
  ------------------
  392|      6|        return 6;
  393|    568|      sizeData = 0;
  394|  1.11k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 547, False: 568]
  ------------------
  395|    547|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|    547|      }
  397|  25.3k|    } else {
  398|       |      // standard dataset
  399|  25.3k|      sizeData = getUShort(pRead, bigEndian);
  400|  25.3k|      pRead += 2;
  401|  25.3k|    }
  402|  25.9k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 25.4k, False: 539]
  ------------------
  403|  25.4k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  25.4k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 25.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|  25.4k|    } else {
  410|    539|#ifndef SUPPRESS_WARNINGS
  411|    539|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    539|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 539]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    539|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    539|#endif
  413|    539|      return 7;
  414|    539|    }
  415|  25.4k|    pRead += sizeData;
  416|  25.4k|  }
  417|       |
  418|  1.40k|  return 0;
  419|  2.13k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  20.4k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  20.4k|  DataBuf buf;
  423|  20.4k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 19.2k, False: 1.25k]
  ------------------
  424|  19.2k|    return buf;
  425|       |
  426|  1.25k|  buf = DataBuf(iptcData.size());
  427|  1.25k|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|  1.25k|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|  1.25k|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|  1.25k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  32.9k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 32.9k, False: 1.25k]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  32.9k|    *pWrite++ = marker_;
  437|  32.9k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  32.9k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  32.9k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 32.9k]
  ------------------
  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|  32.9k|    } else {
  449|  32.9k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  32.9k|      pWrite += 2;
  451|  32.9k|    }
  452|  32.9k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  32.9k|  }
  454|       |
  455|  1.25k|  return buf;
  456|  20.4k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|  1.17M|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|  1.17M|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 16.1k, False: 1.16M]
  |  Branch (42:43): [True: 12.5k, False: 3.60k]
  ------------------
   43|  1.17M|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  55.9k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  55.9k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  25.4k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  25.4k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  25.4k|  auto value = Exiv2::Value::create(type);
  466|  25.4k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  25.4k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 16.2k, False: 9.14k]
  ------------------
  468|  16.2k|    Exiv2::IptcKey key(dataSet, record);
  469|  16.2k|    iptcData.add(key, value.get());
  470|  16.2k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 9.10k, False: 40]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  9.10k|    value = Exiv2::Value::create(Exiv2::string);
  473|  9.10k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  9.10k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 9.10k, False: 0]
  ------------------
  475|  9.10k|      Exiv2::IptcKey key(dataSet, record);
  476|  9.10k|      iptcData.add(key, value.get());
  477|  9.10k|    }
  478|  9.10k|  }
  479|  25.4k|  return rc;
  480|  25.4k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|   147k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

_ZN5Exiv28Jp2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  100|  1.30k|Jp2Image::Jp2Image(BasicIo::UniquePtr io, bool create) : Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io)) {
  101|  1.30k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (101:7): [True: 0, False: 1.30k]
  |  Branch (101:17): [True: 0, False: 0]
  ------------------
  102|       |#ifdef EXIV2_DEBUG_MESSAGES
  103|       |    std::cerr << "Exiv2::Jp2Image:: Creating JPEG2000 image to memory" << '\n';
  104|       |#endif
  105|      0|    IoCloser closer(*io_);
  106|      0|    if (io_->write(Jp2Blank.data(), Jp2Blank.size()) != Jp2Blank.size()) {
  ------------------
  |  Branch (106:9): [True: 0, False: 0]
  ------------------
  107|       |#ifdef EXIV2_DEBUG_MESSAGES
  108|       |      std::cerr << "Exiv2::Jp2Image:: Failed to create JPEG2000 image on memory" << '\n';
  109|       |#endif
  110|      0|    }
  111|      0|  }
  112|  1.30k|}
_ZN5Exiv28Jp2Image12readMetadataEv:
  134|  1.30k|void Jp2Image::readMetadata() {
  135|       |#ifdef EXIV2_DEBUG_MESSAGES
  136|       |  std::cerr << "Exiv2::Jp2Image::readMetadata: Reading JPEG-2000 file " << io_->path() << '\n';
  137|       |#endif
  138|  1.30k|  if (io_->open() != 0) {
  ------------------
  |  Branch (138:7): [True: 0, False: 1.30k]
  ------------------
  139|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  140|      0|  }
  141|  1.30k|  IoCloser closer(*io_);
  142|  1.30k|  if (!isJp2Type(*io_, false)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 1.30k]
  ------------------
  143|      0|    throw Error(ErrorCode::kerNotAnImage, "JPEG-2000");
  144|      0|  }
  145|       |
  146|  1.30k|  Internal::Jp2BoxHeader box = {0, 0};
  147|  1.30k|  Internal::Jp2BoxHeader subBox = {0, 0};
  148|  1.30k|  Internal::Jp2ImageHeaderBox ihdr = {0, 0, 0, 0, 0, 0, 0};
  149|  1.30k|  Internal::Jp2UuidBox uuid = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  150|  1.30k|  size_t boxesCount = 0;
  151|  1.30k|  const size_t boxem = 1000;  // boxes max
  152|  1.30k|  uint32_t lastBoxTypeRead = 0;
  153|  1.30k|  bool boxSignatureFound = false;
  154|  1.30k|  bool boxFileTypeFound = false;
  155|       |
  156|  18.7k|  while (io_->read(reinterpret_cast<byte*>(&box), boxHSize) == boxHSize) {
  ------------------
  |  Branch (156:10): [True: 18.3k, False: 378]
  ------------------
  157|  18.3k|    boxes_check(boxesCount++, boxem);
  158|  18.3k|    const size_t position = io_->tell();
  159|  18.3k|    box.length = getULong(reinterpret_cast<byte*>(&box.length), bigEndian);
  160|  18.3k|    box.type = getULong(reinterpret_cast<byte*>(&box.type), bigEndian);
  161|       |#ifdef EXIV2_DEBUG_MESSAGES
  162|       |    std::cout << "Exiv2::Jp2Image::readMetadata: Position: " << position << " box type: " << toAscii(box.type)
  163|       |              << " length: " << box.length << '\n';
  164|       |#endif
  165|  18.3k|    Internal::enforce(box.length <= boxHSize + io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  166|       |
  167|  18.3k|    if (box.length == 0)
  ------------------
  |  Branch (167:9): [True: 376, False: 18.0k]
  ------------------
  168|    376|      return;
  169|       |
  170|  18.0k|    if (box.length == 1) {
  ------------------
  |  Branch (170:9): [True: 36, False: 17.9k]
  ------------------
  171|       |      /// \todo In this case, the real box size is given in XLBox (bytes 8-15)
  172|     36|    }
  173|       |
  174|  18.0k|    switch (box.type) {
  175|  1.32k|      case kJp2BoxType::Signature: {
  ------------------
  |  Branch (175:7): [True: 1.32k, False: 16.6k]
  ------------------
  176|  1.32k|        if (boxSignatureFound)  // Only one is allowed
  ------------------
  |  Branch (176:13): [True: 21, False: 1.30k]
  ------------------
  177|     21|          throw Error(ErrorCode::kerCorruptedMetadata);
  178|  1.30k|        boxSignatureFound = true;
  179|  1.30k|        break;
  180|  1.32k|      }
  181|    156|      case kJp2BoxType::FileTypeBox: {
  ------------------
  |  Branch (181:7): [True: 156, False: 17.8k]
  ------------------
  182|       |        // This box shall immediately follow the JPEG 2000 Signature box
  183|    156|        if (boxFileTypeFound || lastBoxTypeRead != kJp2BoxType::Signature) {  // Only one is allowed
  ------------------
  |  Branch (183:13): [True: 1, False: 155]
  |  Branch (183:33): [True: 27, False: 128]
  ------------------
  184|     28|          throw Error(ErrorCode::kerCorruptedMetadata);
  185|     28|        }
  186|    128|        boxFileTypeFound = true;
  187|    128|        Blob boxData(box.length - boxHSize);
  188|    128|        io_->readOrThrow(boxData.data(), boxData.size(), ErrorCode::kerCorruptedMetadata);
  189|    128|        if (!Internal::isValidBoxFileType(boxData))
  ------------------
  |  Branch (189:13): [True: 125, False: 3]
  ------------------
  190|    125|          throw Error(ErrorCode::kerCorruptedMetadata);
  191|      3|        brand_ = getULong(boxData.data(), bigEndian);
  192|      3|        break;
  193|    128|      }
  194|  5.51k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (194:7): [True: 5.51k, False: 12.5k]
  ------------------
  195|       |#ifdef EXIV2_DEBUG_MESSAGES
  196|       |        std::cout << "Exiv2::Jp2Image::readMetadata: JP2Header box found\n";
  197|       |#endif
  198|  5.51k|        size_t restore = io_->tell();
  199|       |
  200|   108k|        while (io_->read(reinterpret_cast<byte*>(&subBox), boxHSize) == boxHSize && subBox.length) {
  ------------------
  |  Branch (200:16): [True: 107k, False: 1.74k]
  |  Branch (200:85): [True: 103k, False: 3.65k]
  ------------------
  201|   103k|          boxes_check(boxesCount++, boxem);
  202|   103k|          subBox.length = getULong(reinterpret_cast<byte*>(&subBox.length), bigEndian);
  203|   103k|          subBox.type = getULong(reinterpret_cast<byte*>(&subBox.type), bigEndian);
  204|   103k|          if (subBox.length > io_->size()) {
  ------------------
  |  Branch (204:15): [True: 64, False: 103k]
  ------------------
  205|     64|            throw Error(ErrorCode::kerCorruptedMetadata);
  206|     64|          }
  207|       |#ifdef EXIV2_DEBUG_MESSAGES
  208|       |          std::cout << "Exiv2::Jp2Image::readMetadata: "
  209|       |                    << "subBox = " << toAscii(subBox.type) << " length = " << subBox.length << '\n';
  210|       |#endif
  211|   103k|          if (subBox.type == kJp2BoxType::ColorSpec && subBox.length != 15) {
  ------------------
  |  Branch (211:15): [True: 452, False: 102k]
  |  Branch (211:56): [True: 135, False: 317]
  ------------------
  212|       |#ifdef EXIV2_DEBUG_MESSAGES
  213|       |            std::cout << "Exiv2::Jp2Image::readMetadata: "
  214|       |                      << "Color data found" << '\n';
  215|       |#endif
  216|       |
  217|    135|            const size_t pad = 3;  // 3 padding bytes 2 0 0
  218|    135|            const size_t data_length = Safe::add(subBox.length, 8u);
  219|       |            // data_length makes no sense if it is larger than the rest of the file
  220|    135|            if (data_length > io_->size() - io_->tell()) {
  ------------------
  |  Branch (220:17): [True: 4, False: 131]
  ------------------
  221|      4|              throw Error(ErrorCode::kerCorruptedMetadata);
  222|      4|            }
  223|    131|            DataBuf data(data_length);
  224|    131|            io_->read(data.data(), data.size());
  225|    131|            const size_t iccLength = data.read_uint32(pad, bigEndian);
  226|       |            // subtracting pad from data.size() is safe:
  227|       |            // data.size() is at least 8 and pad = 3
  228|    131|            if (iccLength > data.size() - pad) {
  ------------------
  |  Branch (228:17): [True: 7, False: 124]
  ------------------
  229|      7|              throw Error(ErrorCode::kerCorruptedMetadata);
  230|      7|            }
  231|    124|            DataBuf icc(iccLength);
  232|    124|            std::copy_n(data.begin() + pad, icc.size(), icc.begin());
  233|       |#ifdef EXIV2_DEBUG_MESSAGES
  234|       |            const char* iccPath = "/tmp/libexiv2_jp2.icc";
  235|       |            if (auto f = std::ofstream(iccPath, std::ios::binary)) {
  236|       |              f.write(reinterpret_cast<const char*>(icc.c_data()), static_cast<std::streamsize>(icc.size()));
  237|       |              f.close();
  238|       |              std::cout << "Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size() << " bytes to " << iccPath
  239|       |                        << '\n';
  240|       |            }
  241|       |#endif
  242|    124|            setIccProfile(std::move(icc));
  243|    124|          }
  244|       |
  245|   103k|          if (subBox.type == kJp2BoxType::ImageHeader) {
  ------------------
  |  Branch (245:15): [True: 91, False: 103k]
  ------------------
  246|     91|            io_->read(reinterpret_cast<byte*>(&ihdr), sizeof(ihdr));
  247|       |#ifdef EXIV2_DEBUG_MESSAGES
  248|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Ihdr data found" << '\n';
  249|       |#endif
  250|     91|            ihdr.imageHeight = getULong(reinterpret_cast<byte*>(&ihdr.imageHeight), bigEndian);
  251|     91|            ihdr.imageWidth = getULong(reinterpret_cast<byte*>(&ihdr.imageWidth), bigEndian);
  252|     91|            ihdr.componentCount = getShort(reinterpret_cast<byte*>(&ihdr.componentCount), bigEndian);
  253|     91|            Internal::enforce(ihdr.c == 7, ErrorCode::kerCorruptedMetadata);
  254|       |
  255|     91|            pixelWidth_ = ihdr.imageWidth;
  256|     91|            pixelHeight_ = ihdr.imageHeight;
  257|     91|          }
  258|       |
  259|   103k|          io_->seek(restore, BasicIo::beg);
  260|   103k|          if (io_->seek(subBox.length, BasicIo::cur) != 0) {
  ------------------
  |  Branch (260:15): [True: 32, False: 103k]
  ------------------
  261|     32|            throw Error(ErrorCode::kerCorruptedMetadata);
  262|     32|          }
  263|   103k|          restore = io_->tell();
  264|   103k|        }
  265|  5.40k|        break;
  266|  5.51k|      }
  267|       |
  268|  5.40k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (268:7): [True: 2.89k, False: 15.1k]
  ------------------
  269|       |#ifdef EXIV2_DEBUG_MESSAGES
  270|       |        std::cout << "Exiv2::Jp2Image::readMetadata: UUID box found" << '\n';
  271|       |#endif
  272|       |
  273|  2.89k|        if (io_->read(reinterpret_cast<byte*>(&uuid), sizeof(uuid)) == sizeof(uuid)) {
  ------------------
  |  Branch (273:13): [True: 2.89k, False: 1]
  ------------------
  274|  2.89k|          DataBuf rawData;
  275|  2.89k|          size_t bufRead;
  276|  2.89k|          bool bIsExif = uuid.uuid == kJp2UuidExif;
  277|  2.89k|          bool bIsIPTC = uuid.uuid == kJp2UuidIptc;
  278|  2.89k|          bool bIsXMP = uuid.uuid == kJp2UuidXmp;
  279|       |
  280|  2.89k|          if (bIsExif) {
  ------------------
  |  Branch (280:15): [True: 820, False: 2.07k]
  ------------------
  281|       |#ifdef EXIV2_DEBUG_MESSAGES
  282|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Exif data found" << '\n';
  283|       |#endif
  284|    820|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  285|    820|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  286|    820|            bufRead = io_->read(rawData.data(), rawData.size());
  287|    820|            if (io_->error())
  ------------------
  |  Branch (287:17): [True: 0, False: 820]
  ------------------
  288|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  289|    820|            if (bufRead != rawData.size())
  ------------------
  |  Branch (289:17): [True: 0, False: 820]
  ------------------
  290|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  291|       |
  292|    820|            if (rawData.size() > 8)  // "II*\0long"
  ------------------
  |  Branch (292:17): [True: 759, False: 61]
  ------------------
  293|    759|            {
  294|       |              // Find the position of Exif header in bytes array.
  295|    759|              const char a = rawData.read_uint8(0);
  296|    759|              const char b = rawData.read_uint8(1);
  297|    759|              const size_t notfound = std::numeric_limits<size_t>::max();
  298|    759|              size_t pos = (a == b && (a == 'I' || a == 'M')) ? 0 : notfound;
  ------------------
  |  Branch (298:29): [True: 710, False: 49]
  |  Branch (298:40): [True: 33, False: 677]
  |  Branch (298:52): [True: 282, False: 395]
  ------------------
  299|       |
  300|       |              // #1242  Forgive having Exif\0\0 in rawData.pData_
  301|    759|              std::array<byte, 6> exifHeader{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  302|  45.4k|              for (size_t i = 0; pos == notfound && i < (rawData.size() - exifHeader.size()); i++) {
  ------------------
  |  Branch (302:34): [True: 44.7k, False: 699]
  |  Branch (302:53): [True: 44.6k, False: 60]
  ------------------
  303|  44.6k|                if (rawData.cmpBytes(i, exifHeader.data(), exifHeader.size()) == 0) {
  ------------------
  |  Branch (303:21): [True: 384, False: 44.2k]
  ------------------
  304|    384|                  pos = i + sizeof(exifHeader);
  305|    384|#ifndef SUPPRESS_WARNINGS
  306|    384|                  EXV_WARNING << "Reading non-standard UUID-EXIF_bad box in " << io_->path() << '\n';
  ------------------
  |  |  138|    384|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 384]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    384|  LogMsg(LogMsg::warn).os()
  ------------------
  307|    384|#endif
  308|    384|                }
  309|  44.6k|              }
  310|       |
  311|       |              // If found it, store only these data at from this place.
  312|    759|              if (pos != notfound) {
  ------------------
  |  Branch (312:19): [True: 699, False: 60]
  ------------------
  313|       |#ifdef EXIV2_DEBUG_MESSAGES
  314|       |                std::cout << "Exiv2::Jp2Image::readMetadata: Exif header found at position " << pos << '\n';
  315|       |#endif
  316|    699|                ByteOrder bo =
  317|    699|                    TiffParser::decode(exifData(), iptcData(), xmpData(), rawData.c_data(pos), rawData.size() - pos);
  318|    699|                setByteOrder(bo);
  319|    699|              }
  320|    759|            } else {
  321|     61|#ifndef SUPPRESS_WARNINGS
  322|     61|              EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|     61|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 61]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     61|  LogMsg(LogMsg::warn).os()
  ------------------
  323|     61|#endif
  324|     61|              exifData_.clear();
  325|     61|            }
  326|    820|          }
  327|       |
  328|  2.89k|          if (bIsIPTC) {
  ------------------
  |  Branch (328:15): [True: 1.23k, False: 1.66k]
  ------------------
  329|       |#ifdef EXIV2_DEBUG_MESSAGES
  330|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Iptc data found" << '\n';
  331|       |#endif
  332|  1.23k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  333|  1.23k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  334|  1.23k|            bufRead = io_->read(rawData.data(), rawData.size());
  335|  1.23k|            if (io_->error())
  ------------------
  |  Branch (335:17): [True: 0, False: 1.23k]
  ------------------
  336|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  337|  1.23k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (337:17): [True: 0, False: 1.23k]
  ------------------
  338|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  339|       |
  340|  1.23k|            if (IptcParser::decode(iptcData_, rawData.c_data(), rawData.size())) {
  ------------------
  |  Branch (340:17): [True: 376, False: 855]
  ------------------
  341|    376|#ifndef SUPPRESS_WARNINGS
  342|    376|              EXV_WARNING << "Failed to decode IPTC metadata." << '\n';
  ------------------
  |  |  138|    376|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 376]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    376|  LogMsg(LogMsg::warn).os()
  ------------------
  343|    376|#endif
  344|    376|              iptcData_.clear();
  345|    376|            }
  346|  1.23k|          }
  347|       |
  348|  2.89k|          if (bIsXMP) {
  ------------------
  |  Branch (348:15): [True: 500, False: 2.39k]
  ------------------
  349|       |#ifdef EXIV2_DEBUG_MESSAGES
  350|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Xmp data found" << '\n';
  351|       |#endif
  352|    500|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  353|    500|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  354|    500|            bufRead = io_->read(rawData.data(), rawData.size());
  355|    500|            if (io_->error())
  ------------------
  |  Branch (355:17): [True: 0, False: 500]
  ------------------
  356|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  357|    500|            if (bufRead != rawData.size())
  ------------------
  |  Branch (357:17): [True: 0, False: 500]
  ------------------
  358|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  359|    500|            xmpPacket_.assign(rawData.c_str(), rawData.size());
  360|       |
  361|    500|            if (auto idx = xmpPacket_.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (361:59): [True: 118, False: 382]
  |  Branch (361:87): [True: 115, False: 3]
  ------------------
  362|    115|#ifndef SUPPRESS_WARNINGS
  363|    115|              EXV_WARNING << "Removing " << static_cast<uint32_t>(idx)
  ------------------
  |  |  138|    115|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 115]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    115|  LogMsg(LogMsg::warn).os()
  ------------------
  364|      0|                          << " characters from the beginning of the XMP packet" << '\n';
  365|    115|#endif
  366|    115|              xmpPacket_ = xmpPacket_.substr(idx);
  367|    115|            }
  368|       |
  369|    500|            if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (369:17): [True: 146, False: 354]
  |  Branch (369:40): [True: 142, False: 4]
  ------------------
  370|    142|#ifndef SUPPRESS_WARNINGS
  371|    142|              EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|    142|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 142]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    142|  LogMsg(LogMsg::warn).os()
  ------------------
  372|    142|#endif
  373|    142|            }
  374|    500|          }
  375|  2.89k|        }
  376|  2.89k|        break;
  377|  2.89k|      }
  378|       |
  379|  7.91k|      default:
  ------------------
  |  Branch (379:7): [True: 7.91k, False: 10.0k]
  ------------------
  380|  7.91k|        break;
  381|  18.0k|    }
  382|  17.4k|    lastBoxTypeRead = box.type;
  383|       |
  384|       |    // Move to the next box.
  385|  17.4k|    io_->seek(static_cast<int64_t>(position - boxHSize + box.length), BasicIo::beg);
  386|  17.4k|    if (io_->error())
  ------------------
  |  Branch (386:9): [True: 0, False: 17.4k]
  ------------------
  387|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  388|  17.4k|  }
  389|       |
  390|  1.30k|}  // Jp2Image::readMetadata
_ZN5Exiv28Jp2Image13writeMetadataEv:
  583|    714|void Jp2Image::writeMetadata() {
  584|    714|  if (io_->open() != 0) {
  ------------------
  |  Branch (584:7): [True: 0, False: 714]
  ------------------
  585|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  586|      0|  }
  587|    714|  IoCloser closer(*io_);
  588|    714|  MemIo tempIo;
  589|       |
  590|    714|  doWriteMetadata(tempIo);  // may throw
  591|    714|  io_->close();
  592|    714|  io_->transfer(tempIo);  // may throw
  593|       |
  594|    714|}  // Jp2Image::writeMetadata
_ZN5Exiv28Jp2Image15encodeJp2HeaderERKNS_7DataBufERS1_:
  596|  5.31k|void Jp2Image::encodeJp2Header(const DataBuf& boxBuf, DataBuf& outBuf) {
  597|  5.31k|  DataBuf output(boxBuf.size() + iccProfile_.size() + 100);  // allocate sufficient space
  598|  5.31k|  size_t outlen = boxHSize;                                  // now many bytes have we written to output?
  599|  5.31k|  size_t inlen = boxHSize;                                   // how many bytes have we read from boxBuf?
  600|  5.31k|  Internal::enforce(boxHSize <= output.size(), ErrorCode::kerCorruptedMetadata);
  601|  5.31k|  uint32_t length = getULong(boxBuf.c_data(0), bigEndian);
  602|  5.31k|  Internal::enforce(length <= output.size(), ErrorCode::kerCorruptedMetadata);
  603|  5.31k|  uint32_t count = boxHSize;
  604|  5.31k|  bool bWroteColor = false;
  605|       |
  606|  5.77k|  while (count < length && !bWroteColor) {
  ------------------
  |  Branch (606:10): [True: 501, False: 5.27k]
  |  Branch (606:28): [True: 457, False: 44]
  ------------------
  607|    457|    Internal::enforce(boxHSize <= length - count, ErrorCode::kerCorruptedMetadata);
  608|    457|    Internal::Jp2BoxHeader subBox;
  609|    457|    std::memcpy(&subBox, boxBuf.c_data(count), boxHSize);
  610|    457|    Internal::Jp2BoxHeader newBox = subBox;
  611|       |
  612|    457|    if (count < length) {
  ------------------
  |  Branch (612:9): [True: 452, False: 5]
  ------------------
  613|    452|      subBox.length = getULong(boxBuf.c_data(count), bigEndian);
  614|    452|      subBox.type = getULong(boxBuf.c_data(count + 4), bigEndian);
  615|       |#ifdef EXIV2_DEBUG_MESSAGES
  616|       |      std::cout << "Jp2Image::encodeJp2Header subbox: " << toAscii(subBox.type) << " length = " << subBox.length
  617|       |                << '\n';
  618|       |#endif
  619|    452|      Internal::enforce(subBox.length > 0, ErrorCode::kerCorruptedMetadata);
  620|    452|      Internal::enforce(subBox.length <= length - count, ErrorCode::kerCorruptedMetadata);
  621|    452|      count += subBox.length;
  622|    452|      newBox.type = subBox.type;
  623|    452|    } else {
  624|      5|      subBox.length = 0;
  625|      5|      newBox.type = kJp2BoxType::ColorSpec;
  626|      5|      count = length;
  627|      5|    }
  628|       |
  629|    457|    size_t newlen = subBox.length;
  630|    457|    if (newBox.type == kJp2BoxType::ColorSpec) {
  ------------------
  |  Branch (630:9): [True: 44, False: 413]
  ------------------
  631|     44|      bWroteColor = true;
  632|     44|      if (!iccProfileDefined()) {
  ------------------
  |  Branch (632:11): [True: 7, False: 37]
  ------------------
  633|      7|        const char* pad = "\x01\x00\x00\x00\x00\x00\x10\x00\x00\x05\x1cuuid";
  634|      7|        uint32_t psize = 15;
  635|      7|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  636|      7|        ul2Data(reinterpret_cast<byte*>(&newBox.length), psize, bigEndian);
  637|      7|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  638|      7|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  639|      7|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  640|     37|      } else {
  641|     37|        const char* pad = "\x02\x00\x00";
  642|     37|        uint32_t psize = 3;
  643|     37|        newlen = sizeof(newBox) + psize + iccProfile_.size();
  644|     37|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  645|     37|        ul2Data(reinterpret_cast<byte*>(&newBox.length), static_cast<uint32_t>(newlen), bigEndian);
  646|     37|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  647|     37|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  648|     37|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  649|     37|        std::copy(iccProfile_.begin(), iccProfile_.end(), output.begin() + outlen + sizeof(newBox) + psize);
  650|     37|      }
  651|    413|    } else {
  652|    413|      Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  653|    413|      std::copy_n(boxBuf.begin() + inlen, subBox.length, output.begin() + outlen);
  654|    413|    }
  655|       |
  656|    457|    outlen += newlen;
  657|    457|    inlen += subBox.length;
  658|    457|  }
  659|       |
  660|       |  // allocate the correct number of bytes, copy the data and update the box header
  661|  5.31k|  outBuf.alloc(outlen);
  662|  5.31k|  std::copy_n(output.begin(), outlen, outBuf.begin());
  663|  5.31k|  ul2Data(outBuf.data(0), static_cast<uint32_t>(outlen), bigEndian);
  664|  5.31k|  ul2Data(outBuf.data(4), kJp2BoxType::Header, bigEndian);
  665|  5.31k|}
_ZN5Exiv28Jp2Image15doWriteMetadataERNS_7BasicIoE:
  667|    714|void Jp2Image::doWriteMetadata(BasicIo& outIo) {
  668|    714|  if (!io_->isopen())
  ------------------
  |  Branch (668:7): [True: 0, False: 714]
  ------------------
  669|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  670|    714|  if (!outIo.isopen())
  ------------------
  |  Branch (670:7): [True: 0, False: 714]
  ------------------
  671|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  672|       |
  673|       |#ifdef EXIV2_DEBUG_MESSAGES
  674|       |  std::cout << "Exiv2::Jp2Image::doWriteMetadata: Writing JPEG-2000 file " << io_->path() << '\n';
  675|       |  std::cout << "Exiv2::Jp2Image::doWriteMetadata: tmp file created " << outIo.path() << '\n';
  676|       |#endif
  677|       |
  678|       |  // Ensure that this is the correct image type
  679|    714|  if (!isJp2Type(*io_, true)) {
  ------------------
  |  Branch (679:7): [True: 0, False: 714]
  ------------------
  680|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  681|      0|  }
  682|       |
  683|       |  // Write JPEG2000 Signature (This is the 1st box)
  684|    714|  if (outIo.write(Jp2Signature.data(), Jp2Signature.size()) != 12)
  ------------------
  |  Branch (684:7): [True: 0, False: 714]
  ------------------
  685|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  686|       |
  687|       |#ifdef EXIV2_DEBUG_MESSAGES
  688|       |  std::cout << "Jp2Image::doWriteMetadata: JPEG 2000 Signature box written" << '\n';
  689|       |#endif
  690|       |
  691|    714|  Internal::Jp2BoxHeader box = {0, 0};
  692|       |
  693|    714|  std::array<byte, 4> boxDataSize;
  694|    714|  std::array<byte, 4> boxUUIDtype;
  695|    714|  DataBuf bheaderBuf(8);
  696|       |
  697|  15.4k|  while (io_->tell() < io_->size()) {
  ------------------
  |  Branch (697:10): [True: 14.9k, False: 454]
  ------------------
  698|       |#ifdef EXIV2_DEBUG_MESSAGES
  699|       |    std::cout << "Exiv2::Jp2Image::doWriteMetadata: Position: " << io_->tell() << " / " << io_->size() << '\n';
  700|       |#endif
  701|       |
  702|       |    // Read chunk header.
  703|  14.9k|    io_->readOrThrow(bheaderBuf.data(), bheaderBuf.size(), ErrorCode::kerInputDataReadFailed);
  704|       |
  705|       |    // Decode box header.
  706|  14.9k|    box.length = bheaderBuf.read_uint32(0, bigEndian);
  707|  14.9k|    box.type = bheaderBuf.read_uint32(4, bigEndian);
  708|       |
  709|       |#ifdef EXIV2_DEBUG_MESSAGES
  710|       |    std::cout << "Exiv2::Jp2Image::doWriteMetadata: box type: " << toAscii(box.type) << " length: " << box.length
  711|       |              << '\n';
  712|       |#endif
  713|       |
  714|  14.9k|    if (box.length == 0) {
  ------------------
  |  Branch (714:9): [True: 340, False: 14.6k]
  ------------------
  715|       |#ifdef EXIV2_DEBUG_MESSAGES
  716|       |      std::cout << "Exiv2::Jp2Image::doWriteMetadata: Null Box size has been found. "
  717|       |                   "This is the last box of file."
  718|       |                << '\n';
  719|       |#endif
  720|    340|      box.length = static_cast<uint32_t>(io_->size() - io_->tell() + 8);
  721|    340|    }
  722|  14.9k|    if (box.length < 8) {
  ------------------
  |  Branch (722:9): [True: 3, False: 14.9k]
  ------------------
  723|       |      // box is broken, so there is nothing we can do here
  724|      3|      throw Error(ErrorCode::kerCorruptedMetadata);
  725|      3|    }
  726|       |
  727|       |    // Prevent a malicious file from causing a large memory allocation.
  728|  14.9k|    Internal::enforce(box.length - 8 <= io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  729|       |
  730|       |    // Read whole box : Box header + Box data (not fixed size - can be null).
  731|  14.9k|    DataBuf boxBuf(box.length);                                       // Box header (8 bytes) + box data.
  732|  14.9k|    std::copy(bheaderBuf.begin(), bheaderBuf.end(), boxBuf.begin());  // Copy header.
  733|  14.9k|    io_->readOrThrow(boxBuf.data(8), box.length - 8, ErrorCode::kerInputDataReadFailed);  // Extract box data.
  734|       |
  735|  14.9k|    switch (box.type) {
  736|  5.31k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (736:7): [True: 5.31k, False: 9.65k]
  ------------------
  737|  5.31k|        DataBuf newBuf;
  738|  5.31k|        encodeJp2Header(boxBuf, newBuf);
  739|       |#ifdef EXIV2_DEBUG_MESSAGES
  740|       |        std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write JP2Header box (length: " << box.length << ")\n";
  741|       |#endif
  742|  5.31k|        if (outIo.write(newBuf.data(), newBuf.size()) != newBuf.size())
  ------------------
  |  Branch (742:13): [True: 0, False: 5.31k]
  ------------------
  743|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  744|       |
  745|       |        // Write all updated metadata here, just after JP2Header.
  746|       |
  747|  5.31k|        if (!exifData_.empty()) {
  ------------------
  |  Branch (747:13): [True: 4.88k, False: 430]
  ------------------
  748|       |          // Update Exif data to a new UUID box
  749|       |
  750|  4.88k|          Blob blob;
  751|  4.88k|          ExifParser::encode(blob, littleEndian, exifData_);
  752|  4.88k|          if (!blob.empty()) {
  ------------------
  |  Branch (752:15): [True: 4.87k, False: 15]
  ------------------
  753|  4.87k|            DataBuf rawExif(blob.size());
  754|  4.87k|            std::copy(blob.begin(), blob.end(), rawExif.begin());
  755|       |
  756|  4.87k|            DataBuf boxData(8 + 16 + rawExif.size());
  757|  4.87k|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  758|  4.87k|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  759|  4.87k|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  760|  4.87k|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  761|  4.87k|            std::copy(kJp2UuidExif.begin(), kJp2UuidExif.end(), boxData.begin() + 8);
  762|  4.87k|            std::copy(rawExif.begin(), rawExif.end(), boxData.begin() + 8 + 16);
  763|       |
  764|       |#ifdef EXIV2_DEBUG_MESSAGES
  765|       |            std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write box with Exif metadata (length: " << boxData.size()
  766|       |                      << '\n';
  767|       |#endif
  768|  4.87k|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (768:17): [True: 0, False: 4.87k]
  ------------------
  769|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  770|  4.87k|          }
  771|  4.88k|        }
  772|       |
  773|  5.31k|        if (!iptcData_.empty()) {
  ------------------
  |  Branch (773:13): [True: 513, False: 4.80k]
  ------------------
  774|       |          // Update Iptc data to a new UUID box
  775|       |
  776|    513|          DataBuf rawIptc = IptcParser::encode(iptcData_);
  777|    513|          if (!rawIptc.empty()) {
  ------------------
  |  Branch (777:15): [True: 513, False: 0]
  ------------------
  778|    513|            DataBuf boxData(8 + 16 + rawIptc.size());
  779|    513|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  780|    513|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  781|    513|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  782|    513|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  783|    513|            std::copy(kJp2UuidIptc.begin(), kJp2UuidIptc.end(), boxData.begin() + 8);
  784|    513|            std::copy(rawIptc.begin(), rawIptc.end(), boxData.begin() + 8 + 16);
  785|       |
  786|       |#ifdef EXIV2_DEBUG_MESSAGES
  787|       |            std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write box with Iptc metadata (length: " << boxData.size()
  788|       |                      << '\n';
  789|       |#endif
  790|    513|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (790:17): [True: 0, False: 513]
  ------------------
  791|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  792|    513|          }
  793|    513|        }
  794|       |
  795|  5.31k|        if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (795:13): [True: 5.29k, False: 21]
  |  Branch (795:38): [True: 0, False: 5.29k]
  ------------------
  796|      0|#ifndef SUPPRESS_WARNINGS
  797|      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()
  ------------------
  798|      0|#endif
  799|      0|        }
  800|  5.31k|        if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (800:13): [True: 179, False: 5.13k]
  ------------------
  801|       |          // Update Xmp data to a new UUID box
  802|       |
  803|    179|          DataBuf xmp(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size());
  804|    179|          DataBuf boxData(8 + 16 + xmp.size());
  805|    179|          ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  806|    179|          ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  807|    179|          std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  808|    179|          std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  809|    179|          std::copy(kJp2UuidXmp.begin(), kJp2UuidXmp.end(), boxData.begin() + 8);
  810|    179|          std::copy(xmp.begin(), xmp.end(), boxData.begin() + 8 + 16);
  811|       |
  812|       |#ifdef EXIV2_DEBUG_MESSAGES
  813|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write box with XMP metadata (length: " << boxData.size()
  814|       |                    << ")" << '\n';
  815|       |#endif
  816|    179|          if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (816:15): [True: 0, False: 179]
  ------------------
  817|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  818|    179|        }
  819|       |
  820|  5.31k|        break;
  821|  5.31k|      }
  822|       |
  823|  5.31k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (823:7): [True: 1.45k, False: 13.5k]
  ------------------
  824|  1.45k|        Internal::enforce(boxBuf.size() >= 24, ErrorCode::kerCorruptedMetadata);
  825|  1.45k|        if (boxBuf.cmpBytes(8, kJp2UuidExif.data(), 16) == 0) {
  ------------------
  |  Branch (825:13): [True: 550, False: 900]
  ------------------
  826|       |#ifdef EXIV2_DEBUG_MESSAGES
  827|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Exif Uuid box" << '\n';
  828|       |#endif
  829|    900|        } else if (boxBuf.cmpBytes(8, kJp2UuidIptc.data(), 16) == 0) {
  ------------------
  |  Branch (829:20): [True: 365, False: 535]
  ------------------
  830|       |#ifdef EXIV2_DEBUG_MESSAGES
  831|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Iptc Uuid box" << '\n';
  832|       |#endif
  833|    535|        } else if (boxBuf.cmpBytes(8, kJp2UuidXmp.data(), 16) == 0) {
  ------------------
  |  Branch (833:20): [True: 288, False: 247]
  ------------------
  834|       |#ifdef EXIV2_DEBUG_MESSAGES
  835|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Xmp Uuid box" << '\n';
  836|       |#endif
  837|    288|        } else {
  838|       |#ifdef EXIV2_DEBUG_MESSAGES
  839|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: write Uuid box (length: " << box.length << ")" << '\n';
  840|       |#endif
  841|    247|          if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (841:15): [True: 0, False: 247]
  ------------------
  842|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  843|    247|        }
  844|  1.45k|        break;
  845|  1.45k|      }
  846|       |
  847|  7.97k|      default: {
  ------------------
  |  Branch (847:7): [True: 7.97k, False: 7.00k]
  ------------------
  848|       |#ifdef EXIV2_DEBUG_MESSAGES
  849|       |        std::cout << "Exiv2::Jp2Image::doWriteMetadata: write box (length: " << box.length << ")" << '\n';
  850|       |#endif
  851|  7.97k|        if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (851:13): [True: 0, False: 7.97k]
  ------------------
  852|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  853|       |
  854|  7.97k|        break;
  855|  7.97k|      }
  856|  14.9k|    }
  857|  14.9k|  }
  858|       |
  859|       |#ifdef EXIV2_DEBUG_MESSAGES
  860|       |  std::cout << "Exiv2::Jp2Image::doWriteMetadata: EOF" << '\n';
  861|       |#endif
  862|       |
  863|    714|}  // Jp2Image::doWriteMetadata
_ZN5Exiv214newJp2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  867|  1.30k|Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, bool create) {
  868|  1.30k|  auto image = std::make_unique<Jp2Image>(std::move(io), create);
  869|  1.30k|  if (!image->good()) {
  ------------------
  |  Branch (869:7): [True: 6, False: 1.30k]
  ------------------
  870|      6|    return nullptr;
  871|      6|  }
  872|  1.30k|  return image;
  873|  1.30k|}
_ZN5Exiv29isJp2TypeERNS_7BasicIoEb:
  875|  15.1k|bool isJp2Type(BasicIo& iIo, bool advance) {
  876|  15.1k|  std::array<byte, Jp2Signature.size()> buf;
  877|  15.1k|  const size_t bytesRead = iIo.read(buf.data(), Jp2Signature.size());
  878|  15.1k|  if (iIo.error() || iIo.eof() || bytesRead != Jp2Signature.size()) {
  ------------------
  |  Branch (878:7): [True: 0, False: 15.1k]
  |  Branch (878:22): [True: 342, False: 14.8k]
  |  Branch (878:35): [True: 0, False: 14.8k]
  ------------------
  879|    342|    return false;
  880|    342|  }
  881|  14.8k|  bool matched = buf == Jp2Signature;
  882|  14.8k|  if (!advance || !matched) {
  ------------------
  |  Branch (882:7): [True: 14.1k, False: 714]
  |  Branch (882:19): [True: 0, False: 714]
  ------------------
  883|  14.1k|    iIo.seek(-static_cast<int64_t>(Jp2Signature.size()), BasicIo::cur);  // Return to original position
  884|  14.1k|  }
  885|  14.8k|  return matched;
  886|  15.1k|}
jp2image.cpp:_ZN5Exiv212_GLOBAL__N_111boxes_checkEmm:
   89|   121k|void boxes_check(size_t b, size_t m) {
   90|   121k|  if (b > m) {
  ------------------
  |  Branch (90:7): [True: 2, False: 121k]
  ------------------
   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|   121k|}

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    127|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|    127|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 6, False: 121]
  |  Branch (15:29): [True: 8, False: 113]
  ------------------
   16|     14|    return false;
   17|     14|  }
   18|       |
   19|    113|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    113|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    113|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    113|  bool clWithRightBrand = false;
   24|  1.01k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 912, False: 107]
  ------------------
   25|    912|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|    912|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 130, False: 782]
  |  Branch (26:31): [True: 2, False: 128]
  |  Branch (26:66): [True: 291, False: 619]
  |  Branch (26:87): [True: 4, False: 287]
  ------------------
   27|      6|      clWithRightBrand = true;
   28|      6|      break;
   29|      6|    }
   30|    912|  }
   31|    113|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 20, False: 93]
  |  Branch (31:32): [True: 2, False: 18]
  ------------------
   32|    127|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEEbPKhm:
  116|  1.24k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
  117|  1.24k|  if (create) {
  ------------------
  |  Branch (117:7): [True: 0, False: 1.24k]
  ------------------
  118|      0|    initImage(initData, dataSize);
  119|      0|  }
  120|  1.24k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  133|  2.39M|byte JpegBase::advanceToMarker(ErrorCode err) const {
  134|  2.39M|  int c = -1;
  135|       |  // Skips potential padding between markers
  136|  5.57M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (136:10): [True: 3.17M, False: 2.39M]
  ------------------
  137|  3.17M|    if (c == EOF)
  ------------------
  |  Branch (137:9): [True: 836, False: 3.17M]
  ------------------
  138|    836|      throw Error(err);
  139|  3.17M|  }
  140|       |
  141|       |  // Markers can start with any number of 0xff
  142|  2.98M|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (142:10): [True: 586k, False: 2.39M]
  ------------------
  143|   586k|  }
  144|  2.39M|  if (c == EOF)
  ------------------
  |  Branch (144:7): [True: 71, False: 2.39M]
  ------------------
  145|     71|    throw Error(err);
  146|       |
  147|  2.39M|  return static_cast<byte>(c);
  148|  2.39M|}
_ZN5Exiv28JpegBase12readMetadataEv:
  150|  1.24k|void JpegBase::readMetadata() {
  151|  1.24k|  int rc = 0;  // Todo: this should be the return value
  152|       |
  153|  1.24k|  if (io_->open() != 0)
  ------------------
  |  Branch (153:7): [True: 0, False: 1.24k]
  ------------------
  154|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  155|  1.24k|  IoCloser closer(*io_);
  156|       |  // Ensure that this is the correct image type
  157|  1.24k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (157:7): [True: 77, False: 1.16k]
  ------------------
  158|     77|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (158:9): [True: 0, False: 77]
  |  Branch (158:25): [True: 0, False: 77]
  ------------------
  159|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  160|     77|    throw Error(ErrorCode::kerNotAJpeg);
  161|     77|  }
  162|  1.16k|  clearMetadata();
  163|  1.16k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  164|  1.16k|  Blob psBlob;
  165|  1.16k|  bool foundCompletePsData = false;
  166|  1.16k|  bool foundExifData = false;
  167|  1.16k|  bool foundXmpData = false;
  168|  1.16k|  bool foundIccData = false;
  169|       |
  170|       |  // Read section marker
  171|  1.16k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  172|       |
  173|   494k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (173:10): [True: 494k, False: 158]
  |  Branch (173:28): [True: 494k, False: 168]
  |  Branch (173:46): [True: 494k, False: 13]
  ------------------
  174|   494k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  175|       |
  176|       |    // Read the rest of the segment.
  177|   494k|    DataBuf buf(size);
  178|       |    // check if the segment is not empty
  179|   494k|    if (size > 2) {
  ------------------
  |  Branch (179:9): [True: 29.2k, False: 464k]
  ------------------
  180|  29.2k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  181|  29.2k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  182|  29.2k|    }
  183|       |
  184|   494k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (184:14): [True: 11.1k, False: 482k]
  ------------------
  185|  11.1k|      sof_encoding_process_ = itSofMarker->label_;
  186|  11.1k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (186:11): [True: 1.07k, False: 10.0k]
  |  Branch (186:24): [True: 859, False: 219]
  ------------------
  187|    859|        num_color_components_ = *buf.c_data(7);
  188|    859|      }
  189|  11.1k|    }
  190|       |
  191|   494k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (191:9): [True: 493k, False: 865]
  |  Branch (191:27): [True: 1.47k, False: 491k]
  |  Branch (191:46): [True: 1.02k, False: 454]
  ------------------
  192|  1.02k|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (192:12): [True: 108, False: 916]
  ------------------
  193|    108|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8);
  194|    108|      setByteOrder(bo);
  195|    108|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (195:11): [True: 71, False: 37]
  |  Branch (195:23): [True: 0, False: 71]
  ------------------
  196|      0|#ifndef SUPPRESS_WARNINGS
  197|      0|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  198|      0|#endif
  199|      0|        exifData_.clear();
  200|      0|      }
  201|    108|      --search;
  202|    108|      foundExifData = true;
  203|   493k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (203:16): [True: 481k, False: 12.1k]
  |  Branch (203:33): [True: 1.16k, False: 480k]
  |  Branch (203:52): [True: 531, False: 637]
  ------------------
  204|    531|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (204:19): [True: 61, False: 470]
  ------------------
  205|     61|      xmpPacket_.assign(buf.c_str(31), size - 31);
  206|     61|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (206:11): [True: 59, False: 2]
  |  Branch (206:34): [True: 45, False: 14]
  ------------------
  207|     45|#ifndef SUPPRESS_WARNINGS
  208|     45|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     45|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 45]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     45|  LogMsg(LogMsg::warn).os()
  ------------------
  209|     45|#endif
  210|     45|      }
  211|     61|      --search;
  212|     61|      foundXmpData = true;
  213|   493k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (213:16): [True: 479k, False: 14.5k]
  |  Branch (213:40): [True: 12.4k, False: 466k]
  ------------------
  214|  12.4k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (214:16): [True: 12.1k, False: 341]
  ------------------
  215|  12.1k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (215:19): [True: 7.77k, False: 4.33k]
  ------------------
  216|       |#ifdef EXIV2_DEBUG_MESSAGES
  217|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  218|       |#endif
  219|  7.77k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (219:11): [True: 4.95k, False: 2.82k]
  ------------------
  220|  4.95k|        append(psBlob, buf.c_data(16), size - 16);
  221|  4.95k|      }
  222|       |      // Check whether psBlob is complete
  223|  7.77k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (223:11): [True: 5.83k, False: 1.94k]
  |  Branch (223:30): [True: 97, False: 5.73k]
  ------------------
  224|     97|        --search;
  225|     97|        foundCompletePsData = true;
  226|     97|      }
  227|   486k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (227:16): [True: 730, False: 485k]
  |  Branch (227:34): [True: 249, False: 481]
  ------------------
  228|       |      // JPEGs can have multiple comments, but for now only read
  229|       |      // the first one (most jpegs only have one anyway). Comments
  230|       |      // are simple single byte ISO-8859-1 strings.
  231|    249|      comment_.assign(buf.c_str(2), size - 2);
  232|  8.58k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (232:14): [True: 8.41k, False: 164]
  |  Branch (232:35): [True: 8.33k, False: 85]
  ------------------
  233|  8.33k|        comment_.pop_back();
  234|  8.33k|      }
  235|    249|      --search;
  236|   485k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (236:16): [True: 16.8k, False: 468k]
  |  Branch (236:35): [True: 5.85k, False: 11.0k]
  ------------------
  237|  5.85k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (237:19): [True: 5.14k, False: 708]
  ------------------
  238|  5.14k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (238:11): [True: 43, False: 5.09k]
  ------------------
  239|     43|        rc = 8;
  240|     43|        break;
  241|     43|      }
  242|       |      // ICC profile
  243|  5.09k|      if (!foundIccData) {
  ------------------
  |  Branch (243:11): [True: 108, False: 4.99k]
  ------------------
  244|    108|        foundIccData = true;
  245|    108|        --search;
  246|    108|      }
  247|  5.09k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  248|  5.09k|      auto chunks = static_cast<int>(buf.read_uint8(2 + 13));
  249|       |      // ICC1v43_2010-12.pdf header is 14 bytes
  250|       |      // header = "ICC_PROFILE\0" (12 bytes)
  251|       |      // chunk/chunks are a single byte
  252|       |      // Spec 7.2 Profile bytes 0-3 size
  253|  5.09k|      uint32_t s = buf.read_uint32(2 + 14, bigEndian);
  254|       |#ifdef EXIV2_DEBUG_MESSAGES
  255|       |      std::cerr << "Found ICC Profile chunk " << chunk << " of " << chunks << (chunk == 1 ? " size: " : "")
  256|       |                << (chunk == 1 ? s : 0) << '\n';
  257|       |#endif
  258|       |      // #1286 profile can be padded
  259|  5.09k|      size_t icc_size = size - 2 - 14;
  260|  5.09k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (260:11): [True: 855, False: 4.24k]
  |  Branch (260:25): [True: 116, False: 739]
  ------------------
  261|    116|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  262|    116|        icc_size = s;
  263|    116|      }
  264|       |
  265|  5.09k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  266|   480k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (266:16): [True: 351k, False: 129k]
  |  Branch (266:37): [True: 333, False: 351k]
  ------------------
  267|       |      // We hit a SOFn (start-of-frame) marker
  268|    333|      if (size < 8) {
  ------------------
  |  Branch (268:11): [True: 66, False: 267]
  ------------------
  269|     66|        rc = 7;
  270|     66|        break;
  271|     66|      }
  272|    267|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  273|    267|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  274|    267|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (274:11): [True: 129, False: 138]
  ------------------
  275|    129|        --search;
  276|    267|    }
  277|       |
  278|       |    // Read the beginning of the next segment
  279|   493k|    try {
  280|   493k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  281|   493k|    } catch (const Error&) {
  282|    463|      rc = 5;
  283|    463|      break;
  284|    463|    }
  285|   493k|  }  // while there are segments to process
  286|       |
  287|    911|  if (!psBlob.empty()) {
  ------------------
  |  Branch (287:7): [True: 163, False: 748]
  ------------------
  288|       |    // Find actual IPTC data within the psBlob
  289|    163|    Blob iptcBlob;
  290|    163|    const byte* record = nullptr;
  291|    163|    uint32_t sizeIptc = 0;
  292|    163|    uint32_t sizeHdr = 0;
  293|    163|    const byte* pCur = psBlob.data();
  294|    163|    const byte* pEnd = pCur + psBlob.size();
  295|  2.93k|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (295:12): [True: 2.91k, False: 22]
  |  Branch (295:27): [True: 2.77k, False: 141]
  ------------------
  296|       |#ifdef EXIV2_DEBUG_MESSAGES
  297|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  298|       |#endif
  299|  2.77k|      if (sizeIptc) {
  ------------------
  |  Branch (299:11): [True: 483, False: 2.28k]
  ------------------
  300|    483|        append(iptcBlob, record + sizeHdr, sizeIptc);
  301|    483|      }
  302|  2.77k|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  303|  2.77k|    }
  304|    163|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (304:9): [True: 68, False: 95]
  |  Branch (304:30): [True: 22, False: 46]
  ------------------
  305|     22|#ifndef SUPPRESS_WARNINGS
  306|     22|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     22|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 22]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     22|  LogMsg(LogMsg::warn).os()
  ------------------
  307|     22|#endif
  308|     22|      iptcData_.clear();
  309|     22|    }
  310|    163|  }
  311|       |
  312|    911|  if (rc != 0) {
  ------------------
  |  Branch (312:7): [True: 571, False: 340]
  ------------------
  313|    571|#ifndef SUPPRESS_WARNINGS
  314|    571|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    571|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 571]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    571|  LogMsg(LogMsg::warn).os()
  ------------------
  315|    571|#endif
  316|    571|  }
  317|    911|}  // JpegBase::readMetadata
_ZN5Exiv28JpegBase13writeMetadataEv:
  575|    672|void JpegBase::writeMetadata() {
  576|    672|  if (io_->open() != 0) {
  ------------------
  |  Branch (576:7): [True: 0, False: 672]
  ------------------
  577|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  578|      0|  }
  579|    672|  IoCloser closer(*io_);
  580|    672|  MemIo tempIo;
  581|       |
  582|    672|  doWriteMetadata(tempIo);  // may throw
  583|    672|  io_->close();
  584|    672|  io_->transfer(tempIo);  // may throw
  585|    672|}
_ZN5Exiv28JpegBase15readNextSegmentEh:
  587|  1.89M|DataBuf JpegBase::readNextSegment(byte marker) {
  588|  1.89M|  const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  589|       |
  590|       |  // Read the rest of the segment if not empty.
  591|  1.89M|  DataBuf buf(size);
  592|  1.89M|  if (size > 0) {
  ------------------
  |  Branch (592:7): [True: 92.0k, False: 1.80M]
  ------------------
  593|  92.0k|    std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  594|  92.0k|    if (size > 2) {
  ------------------
  |  Branch (594:9): [True: 46.8k, False: 45.1k]
  ------------------
  595|  46.8k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  596|  46.8k|    }
  597|  92.0k|  }
  598|  1.89M|  return buf;
  599|  1.89M|}
_ZN5Exiv28JpegBase15doWriteMetadataERNS_7BasicIoE:
  601|    672|void JpegBase::doWriteMetadata(BasicIo& outIo) {
  602|    672|  if (!io_->isopen())
  ------------------
  |  Branch (602:7): [True: 0, False: 672]
  ------------------
  603|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  604|    672|  if (!outIo.isopen())
  ------------------
  |  Branch (604:7): [True: 0, False: 672]
  ------------------
  605|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  606|       |
  607|       |  // Ensure that this is the correct image type
  608|    672|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (608:7): [True: 0, False: 672]
  ------------------
  609|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (609:9): [True: 0, False: 0]
  |  Branch (609:25): [True: 0, False: 0]
  ------------------
  610|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  611|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  612|      0|  }
  613|       |
  614|       |  // Used to initialize search variables such as skipCom.
  615|    672|  static const size_t notfound = std::numeric_limits<size_t>::max();
  616|       |
  617|    672|  const size_t seek = io_->tell();
  618|    672|  size_t count = 0;
  619|    672|  size_t search = 0;
  620|    672|  size_t insertPos = 0;
  621|    672|  size_t comPos = 0;
  622|    672|  size_t skipApp1Exif = notfound;
  623|    672|  size_t skipApp1Xmp = notfound;
  624|    672|  bool foundCompletePsData = false;
  625|    672|  bool foundIccData = false;
  626|    672|  std::vector<size_t> skipApp13Ps3;
  627|    672|  std::vector<size_t> skipApp2Icc;
  628|    672|  size_t skipCom = notfound;
  629|    672|  Blob psBlob;
  630|    672|  DataBuf rawExif;
  631|    672|  xmpData().usePacket(writeXmpFromPacket());
  632|       |
  633|       |  // Write image header
  634|    672|  if (writeHeader(outIo))
  ------------------
  |  Branch (634:7): [True: 0, False: 672]
  ------------------
  635|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  636|       |
  637|       |  // Read section marker
  638|    672|  byte marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  639|       |
  640|       |  // First find segments of interest. Normally app0 is first and we want
  641|       |  // to insert after it. But if app0 comes after com, app1 and app13 then
  642|       |  // don't bother.
  643|   984k|  while (marker != sos_ && marker != eoi_ && search < 6) {
  ------------------
  |  Branch (643:10): [True: 984k, False: 528]
  |  Branch (643:28): [True: 984k, False: 140]
  |  Branch (643:46): [True: 984k, False: 4]
  ------------------
  644|   984k|    DataBuf buf = readNextSegment(marker);
  645|       |
  646|   984k|    if (marker == app0_) {
  ------------------
  |  Branch (646:9): [True: 259, False: 983k]
  ------------------
  647|    259|      insertPos = count + 1;
  648|   983k|    } else if (skipApp1Exif == notfound && marker == app1_ &&
  ------------------
  |  Branch (648:16): [True: 751k, False: 232k]
  |  Branch (648:44): [True: 1.72k, False: 749k]
  ------------------
  649|  1.72k|               buf.size() >= 8 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (649:16): [True: 979, False: 750]
  ------------------
  650|    979|               buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (650:16): [True: 83, False: 896]
  ------------------
  651|     83|      skipApp1Exif = count;
  652|     83|      ++search;
  653|     83|      if (buf.size() > 8) {
  ------------------
  |  Branch (653:11): [True: 67, False: 16]
  ------------------
  654|     67|        rawExif.alloc(buf.size() - 8);
  655|     67|        std::copy_n(buf.begin() + 8, rawExif.size(), rawExif.begin());
  656|     67|      }
  657|   983k|    } else if (skipApp1Xmp == notfound && marker == app1_ &&
  ------------------
  |  Branch (657:16): [True: 967k, False: 16.0k]
  |  Branch (657:43): [True: 1.75k, False: 965k]
  ------------------
  658|  1.75k|               buf.size() >= 31 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (658:16): [True: 502, False: 1.25k]
  ------------------
  659|    502|               buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (659:16): [True: 45, False: 457]
  ------------------
  660|     45|      skipApp1Xmp = count;
  661|     45|      ++search;
  662|   983k|    } else if (marker == app2_ && buf.size() >= 13 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (662:16): [True: 18.7k, False: 964k]
  |  Branch (662:35): [True: 8.05k, False: 10.7k]
  ------------------
  663|  8.05k|               buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (663:16): [True: 6.54k, False: 1.50k]
  ------------------
  664|  6.54k|      skipApp2Icc.push_back(count);
  665|  6.54k|      if (!foundIccData) {
  ------------------
  |  Branch (665:11): [True: 82, False: 6.46k]
  ------------------
  666|     82|        ++search;
  667|     82|        foundIccData = true;
  668|     82|      }
  669|   977k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (669:16): [True: 958k, False: 18.3k]
  |  Branch (669:40): [True: 10.3k, False: 948k]
  ------------------
  670|  10.3k|               buf.size() >= 16 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (670:16): [True: 9.98k, False: 325]
  ------------------
  671|  9.98k|               buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (671:16): [True: 6.20k, False: 3.78k]
  ------------------
  672|       |#ifdef EXIV2_DEBUG_MESSAGES
  673|       |      std::cerr << "Found APP13 Photoshop PS3 segment\n";
  674|       |#endif
  675|  6.20k|      skipApp13Ps3.push_back(count);
  676|       |      // Append to psBlob
  677|  6.20k|      append(psBlob, buf.c_data(16), buf.size() - 16);
  678|       |      // Check whether psBlob is complete
  679|  6.20k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (679:11): [True: 4.15k, False: 2.04k]
  |  Branch (679:30): [True: 51, False: 4.10k]
  ------------------
  680|     51|        foundCompletePsData = true;
  681|     51|      }
  682|   970k|    } else if (marker == com_ && skipCom == notfound) {
  ------------------
  |  Branch (682:16): [True: 576, False: 970k]
  |  Branch (682:34): [True: 70, False: 506]
  ------------------
  683|       |      // Jpegs can have multiple comments, but for now only handle
  684|       |      // the first one (most jpegs only have one anyway).
  685|     70|      skipCom = count;
  686|     70|      ++search;
  687|     70|    }
  688|       |
  689|       |    // As in jpeg-6b/wrjpgcom.c:
  690|       |    // We will insert the new comment marker just before SOFn.
  691|       |    // This (a) causes the new comment to appear after, rather than before,
  692|       |    // existing comments; and (b) ensures that comments come after any JFIF
  693|       |    // or JFXX markers, as required by the JFIF specification.
  694|   984k|    if (comPos == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (694:9): [True: 324k, False: 659k]
  |  Branch (694:24): [True: 209, False: 324k]
  ------------------
  695|    209|      comPos = count;
  696|    209|      ++search;
  697|    209|    }
  698|   984k|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  699|   984k|    ++count;
  700|   984k|  }
  701|       |
  702|    672|  if (!foundCompletePsData && !psBlob.empty())
  ------------------
  |  Branch (702:7): [True: 207, False: 465]
  |  Branch (702:31): [True: 4, False: 203]
  ------------------
  703|      4|    throw Error(ErrorCode::kerNoImageInInputData);
  704|    668|  search += skipApp13Ps3.size() + skipApp2Icc.size();
  705|       |
  706|    668|  if (comPos == 0) {
  ------------------
  |  Branch (706:7): [True: 211, False: 457]
  ------------------
  707|    211|    if (marker == eoi_)
  ------------------
  |  Branch (707:9): [True: 129, False: 82]
  ------------------
  708|    129|      comPos = count;
  709|     82|    else
  710|     82|      comPos = insertPos;
  711|    211|    ++search;
  712|    211|  }
  713|    668|  if (!exifData_.empty())
  ------------------
  |  Branch (713:7): [True: 50, False: 618]
  ------------------
  714|     50|    ++search;
  715|    668|  if (!writeXmpFromPacket() && !xmpData_.empty())
  ------------------
  |  Branch (715:7): [True: 238, False: 430]
  |  Branch (715:32): [True: 9, False: 229]
  ------------------
  716|      9|    ++search;
  717|    668|  if (writeXmpFromPacket() && !xmpPacket_.empty())
  ------------------
  |  Branch (717:7): [True: 0, False: 668]
  |  Branch (717:31): [True: 0, False: 0]
  ------------------
  718|      0|    ++search;
  719|    668|  if (foundCompletePsData || !iptcData_.empty())
  ------------------
  |  Branch (719:7): [True: 465, False: 203]
  |  Branch (719:30): [True: 0, False: 203]
  ------------------
  720|     35|    ++search;
  721|    668|  if (!comment_.empty())
  ------------------
  |  Branch (721:7): [True: 15, False: 653]
  ------------------
  722|     15|    ++search;
  723|       |
  724|    668|  io_->seekOrThrow(seek, BasicIo::beg, ErrorCode::kerNoImageInInputData);
  725|    668|  count = 0;
  726|    668|  marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  727|       |
  728|       |  // To simplify this a bit, new segments are inserts at either the start
  729|       |  // or right after app0. This is standard in most jpegs, but has the
  730|       |  // potential to change segment ordering (which is allowed).
  731|       |  // Segments are erased if there is no assigned metadata.
  732|   916k|  while (marker != sos_ && search > 0) {
  ------------------
  |  Branch (732:10): [True: 915k, False: 482]
  |  Branch (732:28): [True: 915k, False: 50]
  ------------------
  733|   915k|    DataBuf buf = readNextSegment(marker);
  734|       |
  735|   915k|    if (insertPos == count) {
  ------------------
  |  Branch (735:9): [True: 231, False: 915k]
  ------------------
  736|       |      // Write Exif data first so that - if there is no app0 - we
  737|       |      // create "Exif images" according to the Exif standard.
  738|    231|      if (!exifData_.empty()) {
  ------------------
  |  Branch (738:11): [True: 50, False: 181]
  ------------------
  739|     50|        Blob blob;
  740|     50|        ByteOrder bo = byteOrder();
  741|     50|        if (bo == invalidByteOrder) {
  ------------------
  |  Branch (741:13): [True: 0, False: 50]
  ------------------
  742|      0|          bo = littleEndian;
  743|      0|          setByteOrder(bo);
  744|      0|        }
  745|     50|        const byte* pExifData = rawExif.c_data();
  746|     50|        size_t exifSize = rawExif.size();
  747|     50|        if (ExifParser::encode(blob, pExifData, exifSize, bo, exifData_) == wmIntrusive) {
  ------------------
  |  Branch (747:13): [True: 35, False: 15]
  ------------------
  748|     35|          pExifData = !blob.empty() ? blob.data() : nullptr;
  ------------------
  |  Branch (748:23): [True: 33, False: 2]
  ------------------
  749|     35|          exifSize = blob.size();
  750|     35|        }
  751|     50|        if (exifSize > 0) {
  ------------------
  |  Branch (751:13): [True: 45, False: 5]
  ------------------
  752|     45|          std::array<byte, 10> tmpBuf;
  753|       |          // Write APP1 marker, size of APP1 field, Exif id and Exif data
  754|     45|          tmpBuf[0] = 0xff;
  755|     45|          tmpBuf[1] = app1_;
  756|       |
  757|     45|          if (exifSize > 0xffff - 8)
  ------------------
  |  Branch (757:15): [True: 5, False: 40]
  ------------------
  758|      5|            throw Error(ErrorCode::kerTooLargeJpegSegment, "Exif");
  759|     40|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(exifSize + 8), bigEndian);
  760|     40|          std::copy(exifId_.begin(), exifId_.end(), tmpBuf.begin() + 4);
  761|     40|          if (outIo.write(tmpBuf.data(), 10) != 10)
  ------------------
  |  Branch (761:15): [True: 0, False: 40]
  ------------------
  762|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  763|       |
  764|       |          // Write new Exif data buffer
  765|     40|          if (outIo.write(pExifData, exifSize) != exifSize)
  ------------------
  |  Branch (765:15): [True: 0, False: 40]
  ------------------
  766|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  767|     40|          if (outIo.error())
  ------------------
  |  Branch (767:15): [True: 0, False: 40]
  ------------------
  768|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  769|     40|          --search;
  770|     40|        }
  771|     50|      }
  772|    226|      if (!writeXmpFromPacket() &&
  ------------------
  |  Branch (772:11): [True: 223, False: 3]
  ------------------
  773|    223|          XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {
  ------------------
  |  Branch (773:11): [True: 0, False: 223]
  ------------------
  774|      0|#ifndef SUPPRESS_WARNINGS
  775|      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()
  ------------------
  776|      0|#endif
  777|      0|      }
  778|    226|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (778:11): [True: 9, False: 217]
  ------------------
  779|      9|        std::array<byte, 33> tmpBuf;
  780|       |        // Write APP1 marker, size of APP1 field, XMP id and XMP packet
  781|      9|        tmpBuf[0] = 0xff;
  782|      9|        tmpBuf[1] = app1_;
  783|       |
  784|      9|        if (xmpPacket_.size() > 0xffff - 31)
  ------------------
  |  Branch (784:13): [True: 0, False: 9]
  ------------------
  785|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "XMP");
  786|      9|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(xmpPacket_.size() + 31), bigEndian);
  787|      9|        std::copy(xmpId_.begin(), xmpId_.end(), tmpBuf.begin() + 4);
  788|      9|        if (outIo.write(tmpBuf.data(), 33) != 33)
  ------------------
  |  Branch (788:13): [True: 0, False: 9]
  ------------------
  789|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  790|       |
  791|       |        // Write new XMP packet
  792|      9|        if (outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (792:13): [True: 0, False: 9]
  ------------------
  793|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  794|      9|        if (outIo.error())
  ------------------
  |  Branch (794:13): [True: 0, False: 9]
  ------------------
  795|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  796|      9|        --search;
  797|      9|      }
  798|       |
  799|    226|      if (iccProfileDefined()) {
  ------------------
  |  Branch (799:11): [True: 21, False: 205]
  ------------------
  800|     21|        std::array<byte, 4> tmpBuf;
  801|       |        // Write APP2 marker, size of APP2 field, and IccProfile
  802|       |        // See comments in readMetadata() about the ICC embedding specification
  803|     21|        tmpBuf[0] = 0xff;
  804|     21|        tmpBuf[1] = app2_;
  805|       |
  806|     21|        const size_t chunk_size = (256 * 256) - 40;  // leave bytes for marker, header and padding
  807|     21|        size_t size = iccProfile_.size();
  808|     21|        if (size >= 255 * chunk_size)
  ------------------
  |  Branch (808:13): [True: 0, False: 21]
  ------------------
  809|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "IccProfile");
  810|     21|        const size_t chunks = 1 + ((size - 1) / chunk_size);
  811|     69|        for (size_t chunk = 0; chunk < chunks; chunk++) {
  ------------------
  |  Branch (811:32): [True: 48, False: 21]
  ------------------
  812|     48|          auto bytes = std::min<size_t>(size, chunk_size);  // bytes to write
  813|     48|          size -= bytes;
  814|       |
  815|       |          // write JPEG marker (2 bytes)
  816|     48|          if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (816:15): [True: 0, False: 48]
  ------------------
  817|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Marker
  818|       |          // write length (2 bytes).  length includes the 2 bytes for the length
  819|     48|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(2 + 14 + bytes), bigEndian);
  820|     48|          if (outIo.write(tmpBuf.data() + 2, 2) != 2)
  ------------------
  |  Branch (820:15): [True: 0, False: 48]
  ------------------
  821|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Length
  822|       |
  823|       |          // write the ICC_PROFILE header (14 bytes)
  824|     48|          uint8_t pad[2];
  825|     48|          pad[0] = static_cast<uint8_t>(chunk + 1);
  826|     48|          pad[1] = static_cast<uint8_t>(chunks);
  827|     48|          outIo.write(reinterpret_cast<const byte*>(iccId_), 12);
  828|     48|          outIo.write(reinterpret_cast<const byte*>(pad), 2);
  829|     48|          if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes)
  ------------------
  |  Branch (829:15): [True: 0, False: 48]
  ------------------
  830|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  831|     48|          if (outIo.error())
  ------------------
  |  Branch (831:15): [True: 0, False: 48]
  ------------------
  832|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  833|     48|        }
  834|     21|        --search;
  835|     21|      }
  836|       |
  837|    226|      if (foundCompletePsData || !iptcData_.empty()) {
  ------------------
  |  Branch (837:11): [True: 38, False: 188]
  |  Branch (837:34): [True: 0, False: 188]
  ------------------
  838|       |        // Set the new IPTC IRB, keeps existing IRBs but removes the
  839|       |        // IPTC block if there is no new IPTC data to write
  840|     35|        DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
  841|     35|        const size_t maxChunkSize = 0xffff - 16;
  842|     35|        const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
  ------------------
  |  Branch (842:34): [True: 2, False: 33]
  ------------------
  843|     35|        const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);
  ------------------
  |  Branch (843:32): [True: 2, False: 33]
  ------------------
  844|     68|        while (chunkStart < chunkEnd) {
  ------------------
  |  Branch (844:16): [True: 33, False: 35]
  ------------------
  845|       |          // Determine size of next chunk
  846|     33|          size_t chunkSize = (chunkEnd + 1 - chunkStart);
  847|     33|          if (chunkSize > maxChunkSize) {
  ------------------
  |  Branch (847:15): [True: 2, False: 31]
  ------------------
  848|      2|            chunkSize = maxChunkSize;
  849|       |            // Don't break at a valid IRB boundary
  850|      2|            const auto writtenSize = chunkStart - newPsData.c_data();
  851|      2|            if (Photoshop::valid(newPsData.c_data(), writtenSize + chunkSize)) {
  ------------------
  |  Branch (851:17): [True: 0, False: 2]
  ------------------
  852|       |              // Since an IRB has minimum size 12,
  853|       |              // (chunkSize - 8) can't be also a IRB boundary
  854|      0|              chunkSize -= 8;
  855|      0|            }
  856|      2|          }
  857|       |
  858|       |          // Write APP13 marker, chunk size, and ps3Id
  859|     33|          std::array<byte, 18> tmpBuf;
  860|     33|          tmpBuf[0] = 0xff;
  861|     33|          tmpBuf[1] = app13_;
  862|     33|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(chunkSize + 16), bigEndian);
  863|     33|          std::copy_n(Photoshop::ps3Id_, 14, tmpBuf.begin() + 4);
  864|     33|          if (outIo.write(tmpBuf.data(), 18) != 18)
  ------------------
  |  Branch (864:15): [True: 0, False: 33]
  ------------------
  865|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  866|     33|          if (outIo.error())
  ------------------
  |  Branch (866:15): [True: 0, False: 33]
  ------------------
  867|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  868|       |
  869|       |          // Write next chunk of the Photoshop IRB data buffer
  870|     33|          if (outIo.write(chunkStart, chunkSize) != chunkSize)
  ------------------
  |  Branch (870:15): [True: 0, False: 33]
  ------------------
  871|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  872|     33|          if (outIo.error())
  ------------------
  |  Branch (872:15): [True: 0, False: 33]
  ------------------
  873|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  874|       |
  875|     33|          chunkStart += chunkSize;
  876|     33|        }
  877|     35|        --search;
  878|     35|      }
  879|    226|    }
  880|   915k|    if (comPos == count) {
  ------------------
  |  Branch (880:9): [True: 222, False: 915k]
  ------------------
  881|    222|      if (!comment_.empty()) {
  ------------------
  |  Branch (881:11): [True: 15, False: 207]
  ------------------
  882|     15|        std::array<byte, 4> tmpBuf;
  883|       |        // Write COM marker, size of comment, and string
  884|     15|        tmpBuf[0] = 0xff;
  885|     15|        tmpBuf[1] = com_;
  886|       |
  887|     15|        if (comment_.length() > 0xffff - 3)
  ------------------
  |  Branch (887:13): [True: 1, False: 14]
  ------------------
  888|      1|          throw Error(ErrorCode::kerTooLargeJpegSegment, "JPEG comment");
  889|     14|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
  890|       |
  891|     14|        if (outIo.write(tmpBuf.data(), 4) != 4)
  ------------------
  |  Branch (891:13): [True: 0, False: 14]
  ------------------
  892|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  893|     14|        if (outIo.write(reinterpret_cast<byte*>(comment_.data()), comment_.length()) != comment_.length())
  ------------------
  |  Branch (893:13): [True: 0, False: 14]
  ------------------
  894|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  895|     14|        if (outIo.putb(0) == EOF)
  ------------------
  |  Branch (895:13): [True: 0, False: 14]
  ------------------
  896|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  897|     14|        if (outIo.error())
  ------------------
  |  Branch (897:13): [True: 0, False: 14]
  ------------------
  898|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  899|     14|        --search;
  900|     14|      }
  901|    221|      --search;
  902|    221|    }
  903|   915k|    if (marker == eoi_) {
  ------------------
  |  Branch (903:9): [True: 130, False: 915k]
  ------------------
  904|    130|      break;
  905|    130|    }
  906|   915k|    if (skipApp1Exif == count || skipApp1Xmp == count ||
  ------------------
  |  Branch (906:9): [True: 60, False: 915k]
  |  Branch (906:9): [True: 7.23k, False: 908k]
  |  Branch (906:34): [True: 24, False: 915k]
  ------------------
  907|   915k|        std::find(skipApp13Ps3.begin(), skipApp13Ps3.end(), count) != skipApp13Ps3.end() ||
  ------------------
  |  Branch (907:9): [True: 2.90k, False: 912k]
  ------------------
  908|   912k|        std::find(skipApp2Icc.begin(), skipApp2Icc.end(), count) != skipApp2Icc.end() || skipCom == count) {
  ------------------
  |  Branch (908:9): [True: 4.23k, False: 908k]
  |  Branch (908:90): [True: 27, False: 908k]
  ------------------
  909|  7.23k|      --search;
  910|   908k|    } else {
  911|   908k|      std::array<byte, 2> tmpBuf;
  912|       |      // Write marker and a copy of the segment.
  913|   908k|      tmpBuf[0] = 0xff;
  914|   908k|      tmpBuf[1] = marker;
  915|   908k|      if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (915:11): [True: 0, False: 908k]
  ------------------
  916|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  917|   908k|      if (outIo.write(buf.c_data(), buf.size()) != buf.size())
  ------------------
  |  Branch (917:11): [True: 0, False: 908k]
  ------------------
  918|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  919|   908k|      if (outIo.error())
  ------------------
  |  Branch (919:11): [True: 0, False: 908k]
  ------------------
  920|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  921|   908k|    }
  922|       |
  923|       |    // Next marker
  924|   915k|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  925|   915k|    ++count;
  926|   915k|  }
  927|       |
  928|       |  // Populate the fake data, only make sense for remoteio, httpio and sshio.
  929|       |  // it avoids allocating memory for parts of the file that contain image-date.
  930|    662|  io_->populateFakeData();
  931|       |
  932|       |  // Write the final marker, then copy rest of the Io.
  933|    662|  byte tmpBuf[2];
  934|    662|  tmpBuf[0] = 0xff;
  935|    662|  tmpBuf[1] = marker;
  936|    662|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (936:7): [True: 0, False: 662]
  ------------------
  937|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  938|       |
  939|    662|  DataBuf buf(4096);
  940|    662|  size_t readSize = io_->read(buf.data(), buf.size());
  941|  1.06k|  while (readSize != 0) {
  ------------------
  |  Branch (941:10): [True: 398, False: 662]
  ------------------
  942|    398|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (942:9): [True: 0, False: 398]
  ------------------
  943|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  944|    398|    readSize = io_->read(buf.data(), buf.size());
  945|    398|  }
  946|    662|  if (outIo.error())
  ------------------
  |  Branch (946:7): [True: 0, False: 662]
  ------------------
  947|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  948|       |
  949|    662|}  // JpegBase::doWriteMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  968|  1.17k|    JpegBase(ImageType::jpeg, std::move(io), create, blank_, sizeof(blank_)) {
  969|  1.17k|}
_ZNK5Exiv29JpegImage11writeHeaderERNS_7BasicIoE:
  975|    654|int JpegImage::writeHeader(BasicIo& outIo) const {
  976|       |  // Jpeg header
  977|    654|  byte tmpBuf[2];
  978|    654|  tmpBuf[0] = 0xff;
  979|    654|  tmpBuf[1] = soi_;
  980|    654|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (980:7): [True: 0, False: 654]
  ------------------
  981|      0|    return 4;
  982|    654|  if (outIo.error())
  ------------------
  |  Branch (982:7): [True: 0, False: 654]
  ------------------
  983|      0|    return 4;
  984|    654|  return 0;
  985|    654|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  987|  1.83k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  988|  1.83k|  return isJpegType(iIo, advance);
  989|  1.83k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  991|  1.09k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, bool create) {
  992|  1.09k|  auto image = std::make_unique<JpegImage>(std::move(io), create);
  993|  1.09k|  if (!image->good()) {
  ------------------
  |  Branch (993:7): [True: 0, False: 1.09k]
  ------------------
  994|      0|    return nullptr;
  995|      0|  }
  996|  1.09k|  return image;
  997|  1.09k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
  999|  36.7k|bool isJpegType(BasicIo& iIo, bool advance) {
 1000|  36.7k|  bool result = true;
 1001|  36.7k|  byte tmpBuf[2];
 1002|  36.7k|  iIo.read(tmpBuf, 2);
 1003|  36.7k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1003:7): [True: 0, False: 36.7k]
  |  Branch (1003:22): [True: 47, False: 36.7k]
  ------------------
 1004|     47|    return false;
 1005|       |
 1006|  36.7k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1006:7): [True: 32.6k, False: 4.11k]
  |  Branch (1006:28): [True: 176, False: 3.93k]
  ------------------
 1007|  32.7k|    result = false;
 1008|  32.7k|  }
 1009|  36.7k|  if (!advance || !result)
  ------------------
  |  Branch (1009:7): [True: 34.8k, False: 1.83k]
  |  Branch (1009:19): [True: 77, False: 1.75k]
  ------------------
 1010|  34.9k|    iIo.seek(-2, BasicIo::cur);
 1011|  36.7k|  return result;
 1012|  36.7k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
 1015|     63|    JpegBase(ImageType::exv, std::move(io), create, blank_, sizeof(blank_)) {
 1016|     63|}
_ZNK5Exiv28ExvImage11writeHeaderERNS_7BasicIoE:
 1022|     18|int ExvImage::writeHeader(BasicIo& outIo) const {
 1023|       |  // Exv header
 1024|     18|  auto tmpBuf = std::array<byte, 7>{0xff, 0x01};
 1025|     18|  std::copy_n(exiv2Id_, 5, tmpBuf.begin() + 2);
 1026|     18|  if (outIo.write(tmpBuf.data(), 7) != 7)
  ------------------
  |  Branch (1026:7): [True: 0, False: 18]
  ------------------
 1027|      0|    return 4;
 1028|     18|  if (outIo.error())
  ------------------
  |  Branch (1028:7): [True: 0, False: 18]
  ------------------
 1029|      0|    return 4;
 1030|     18|  return 0;
 1031|     18|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1033|     81|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1034|     81|  return isExvType(iIo, advance);
 1035|     81|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1037|     63|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, bool create) {
 1038|     63|  auto image = std::make_unique<ExvImage>(std::move(io), create);
 1039|     63|  if (!image->good())
  ------------------
  |  Branch (1039:7): [True: 0, False: 63]
  ------------------
 1040|      0|    return nullptr;
 1041|     63|  return image;
 1042|     63|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1044|  32.9k|bool isExvType(BasicIo& iIo, bool advance) {
 1045|  32.9k|  bool result = true;
 1046|  32.9k|  byte tmpBuf[7];
 1047|  32.9k|  iIo.read(tmpBuf, 7);
 1048|  32.9k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1048:7): [True: 0, False: 32.9k]
  |  Branch (1048:22): [True: 71, False: 32.8k]
  ------------------
 1049|     71|    return false;
 1050|       |
 1051|  32.8k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1051:7): [True: 32.5k, False: 291]
  |  Branch (1051:28): [True: 58, False: 233]
  |  Branch (1051:49): [True: 26, False: 207]
  ------------------
 1052|  32.6k|    result = false;
 1053|  32.6k|  }
 1054|  32.8k|  if (!advance || !result)
  ------------------
  |  Branch (1054:7): [True: 32.7k, False: 81]
  |  Branch (1054:19): [True: 0, False: 81]
  ------------------
 1055|  32.7k|    iIo.seek(-7, BasicIo::cur);
 1056|  32.8k|  return result;
 1057|  32.9k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  2.39M|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  2.39M|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  2.39M|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  2.39M|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 143k, False: 2.25M]
  ------------------
  107|   143k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|   143k|    size = getUShort(buf.data(), bigEndian);
  109|   143k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|   143k|  }
  111|  2.39M|  return {buf, size};
  112|  2.39M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|   676k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|   676k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 185, False: 676k]
  |  Branch (92:38): [True: 357, False: 676k]
  ------------------
   93|   676k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  1.35M|constexpr bool inRange(int lo, int value, int hi) {
   88|  1.35M|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 1.34M, False: 5.33k]
  |  Branch (88:25): [True: 542, False: 1.34M]
  ------------------
   89|  1.35M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  2.39M|bool markerHasLength(byte m) {
   99|  2.39M|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 2.34M, False: 47.3k]
  |  Branch (99:44): [True: 2.25M, False: 96.1k]
  ------------------
  100|  2.39M|  return !markerWithoutLength;
  101|  2.39M|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  599|  2.68k|MatroskaVideo::MatroskaVideo(BasicIo::UniquePtr io) : Image(ImageType::mkv, mdNone, std::move(io)) {
  600|  2.68k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  602|  2.68k|std::string MatroskaVideo::mimeType() const {
  603|  2.68k|  return "video/matroska";
  604|  2.68k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  606|  1.96k|void MatroskaVideo::writeMetadata() {
  607|  1.96k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  609|  2.68k|void MatroskaVideo::readMetadata() {
  610|  2.68k|  if (io_->open() != 0)
  ------------------
  |  Branch (610:7): [True: 0, False: 2.68k]
  ------------------
  611|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  612|       |
  613|       |  // Ensure that this is the correct image type
  614|  2.68k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 2.68k]
  ------------------
  615|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (615:9): [True: 0, False: 0]
  |  Branch (615:25): [True: 0, False: 0]
  ------------------
  616|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  617|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  618|      0|  }
  619|       |
  620|  2.68k|  IoCloser closer(*io_);
  621|  2.68k|  clearMetadata();
  622|  2.68k|  continueTraversing_ = true;
  623|  2.68k|  height_ = width_ = 1;
  624|       |
  625|  2.68k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  626|  2.68k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  627|       |
  628|   150k|  while (continueTraversing_)
  ------------------
  |  Branch (628:10): [True: 147k, False: 2.68k]
  ------------------
  629|   147k|    decodeBlock();
  630|       |
  631|  2.68k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  632|  2.68k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  634|   147k|void MatroskaVideo::decodeBlock() {
  635|   147k|  byte buf[8];
  636|   147k|  io_->read(buf, 1);
  637|       |
  638|   147k|  if (io_->eof()) {
  ------------------
  |  Branch (638:7): [True: 1.18k, False: 146k]
  ------------------
  639|  1.18k|    continueTraversing_ = false;
  640|  1.18k|    return;
  641|  1.18k|  }
  642|       |
  643|   146k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  644|   146k|  if (block_size > 0)
  ------------------
  |  Branch (644:7): [True: 146k, False: 286]
  ------------------
  645|   146k|    io_->read(buf + 1, block_size - 1);
  646|       |
  647|   146k|  auto tag_id = returnTagValue(buf, block_size);
  648|   146k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  649|       |
  650|   146k|  if (!tag) {
  ------------------
  |  Branch (650:7): [True: 932, False: 145k]
  ------------------
  651|    932|    continueTraversing_ = false;
  652|    932|    return;
  653|    932|  }
  654|       |
  655|       |  // tag->dump(std::cout);
  656|       |
  657|   145k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (657:7): [True: 287, False: 145k]
  |  Branch (657:27): [True: 1, False: 145k]
  ------------------
  658|      2|    continueTraversing_ = false;
  659|      2|    return;
  660|      2|  }
  661|       |
  662|   145k|  io_->read(buf, 1);
  663|   145k|  block_size = findBlockSize(buf[0]);  // 0-8
  664|       |
  665|   145k|  if (block_size > 0)
  ------------------
  |  Branch (665:7): [True: 145k, False: 348]
  ------------------
  666|   145k|    io_->read(buf + 1, block_size - 1);
  667|   145k|  size_t size = returnTagValue(buf, block_size);
  668|       |
  669|   145k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (669:7): [True: 91.5k, False: 54.0k]
  |  Branch (669:29): [True: 91.5k, False: 0]
  ------------------
  670|  91.5k|    return;
  671|       |
  672|  54.0k|  const size_t bufMaxSize = 200;
  673|       |
  674|  54.0k|#ifndef SUPPRESS_WARNINGS
  675|  54.0k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (675:7): [True: 52.3k, False: 1.73k]
  |  Branch (675:28): [True: 197, False: 52.1k]
  ------------------
  676|    197|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    197|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 197]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    197|  LogMsg(LogMsg::warn).os()
  ------------------
  677|      0|                << bufMaxSize << ": ignoring it.\n";
  678|    197|  }
  679|  54.0k|#endif
  680|  54.0k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (680:7): [True: 1.73k, False: 52.3k]
  |  Branch (680:27): [True: 197, False: 52.1k]
  ------------------
  681|  1.57k|    io_->seek(size, BasicIo::cur);
  682|  1.57k|    return;
  683|  1.57k|  }
  684|       |
  685|  52.5k|  DataBuf buf2(bufMaxSize + 1);
  686|  52.5k|  io_->read(buf2.data(), size);
  687|  52.5k|  switch (tag->_type) {
  688|  7.47k|    case InternalField:
  ------------------
  |  Branch (688:5): [True: 7.47k, False: 45.0k]
  ------------------
  689|  7.47k|      decodeInternalTags(tag, buf2.data());
  690|  7.47k|      break;
  691|  6.32k|    case String:
  ------------------
  |  Branch (691:5): [True: 6.32k, False: 46.1k]
  ------------------
  692|  6.32k|    case Utf8:
  ------------------
  |  Branch (692:5): [True: 0, False: 52.5k]
  ------------------
  693|  6.32k|      decodeStringTags(tag, buf2.data());
  694|  6.32k|      break;
  695|  16.0k|    case Integer:
  ------------------
  |  Branch (695:5): [True: 16.0k, False: 36.4k]
  ------------------
  696|  20.4k|    case UInteger:
  ------------------
  |  Branch (696:5): [True: 4.41k, False: 48.0k]
  ------------------
  697|  20.4k|      decodeIntegerTags(tag, buf2.data());
  698|  20.4k|      break;
  699|  14.4k|    case Boolean:
  ------------------
  |  Branch (699:5): [True: 14.4k, False: 38.0k]
  ------------------
  700|  14.4k|      decodeBooleanTags(tag, buf2.data());
  701|  14.4k|      break;
  702|  1.32k|    case Date:
  ------------------
  |  Branch (702:5): [True: 1.32k, False: 51.1k]
  ------------------
  703|  1.32k|      decodeDateTags(tag, buf2.data(), size);
  704|  1.32k|      break;
  705|  2.15k|    case Float:
  ------------------
  |  Branch (705:5): [True: 2.15k, False: 50.3k]
  ------------------
  706|  2.15k|      decodeFloatTags(tag, buf2.data());
  707|  2.15k|      break;
  708|      0|    case Binary:
  ------------------
  |  Branch (708:5): [True: 0, False: 52.5k]
  ------------------
  709|      0|      break;
  710|      0|    case Master:
  ------------------
  |  Branch (710:5): [True: 0, False: 52.5k]
  ------------------
  711|      0|      break;
  712|      0|    default:
  ------------------
  |  Branch (712:5): [True: 0, False: 52.5k]
  ------------------
  713|      0|      break;
  714|  52.5k|  }
  715|  52.5k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  717|  7.47k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  718|  7.47k|  uint64_t key = getULongLong(buf, bigEndian);
  719|  7.47k|  if (!key)
  ------------------
  |  Branch (719:7): [True: 300, False: 7.17k]
  ------------------
  720|    300|    return;
  721|       |
  722|  7.17k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  7.17k|    switch (tag->_id) {
  724|  7.17k|      case Xmp_video_VideoScanTpye:
  725|  7.17k|        return Exiv2::find(videoScanType, key);
  726|  7.17k|      case Xmp_audio_ChannelType:
  727|  7.17k|        return Exiv2::find(audioChannels, key);
  728|  7.17k|      case Xmp_video_ContentCompressAlgo:
  729|  7.17k|        return Exiv2::find(compressionAlgorithm, key);
  730|  7.17k|      case Xmp_video_ContentEncryptAlgo:
  731|  7.17k|        return Exiv2::find(encryptionAlgorithm, key);
  732|  7.17k|      case Xmp_video_ContentSignAlgo_1:
  733|  7.17k|      case Xmp_video_ContentSignAlgo_2:
  734|  7.17k|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|  7.17k|      case Xmp_video_ContentSignHashAlgo_1:
  736|  7.17k|      case Xmp_video_ContentSignHashAlgo_2:
  737|  7.17k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  7.17k|      case Xmp_video_ContentEncodingType:
  739|  7.17k|        return Exiv2::find(encodingType, key);
  740|  7.17k|      case Xmp_video_DisplayUnit:
  741|  7.17k|        return Exiv2::find(displayUnit, key);
  742|  7.17k|      case Xmp_video_AspectRatioType:
  743|  7.17k|        return Exiv2::find(aspectRatioType, key);
  744|  7.17k|      case Xmp_video_PhysicalEquivalent:
  745|  7.17k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|  7.17k|      case Xmp_video_TranslateCodec:
  747|  7.17k|        return Exiv2::find(chapterTranslateCodec, key);
  748|  7.17k|      case Video_Audio_CodecID:
  749|  7.17k|        return Exiv2::find(trackCodec, key);
  750|  7.17k|      case Video_Audio_CodecName:
  751|  7.17k|        return Exiv2::find(codecInfo, key);
  752|  7.17k|      case CodecDownloadURL:
  753|  7.17k|      case CodecInfoURL:
  754|  7.17k|        return Exiv2::find(codecDownloadUrl, key);
  755|  7.17k|    }
  756|  7.17k|    return nullptr;
  757|  7.17k|  }();
  758|  7.17k|  if (internalMt) {
  ------------------
  |  Branch (758:7): [True: 2.35k, False: 4.82k]
  ------------------
  759|  2.35k|    xmpData_[tag->_label] = internalMt->_label;
  760|  4.82k|  } else {
  761|  4.82k|    xmpData_[tag->_label] = key;
  762|  4.82k|  }
  763|  7.17k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  765|  6.32k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  766|  6.32k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (766:7): [True: 1.78k, False: 4.54k]
  ------------------
  767|  1.78k|    track_count_++;
  768|  1.78k|    xmpData_[tag->_label] = track_count_;
  769|  4.54k|  } else {
  770|  4.54k|    xmpData_[tag->_label] = buf;
  771|  4.54k|  }
  772|  6.32k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  774|  20.4k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  775|  20.4k|  uint64_t value = getULongLong(buf, bigEndian);
  776|  20.4k|  if (!value)
  ------------------
  |  Branch (776:7): [True: 17.0k, False: 3.33k]
  ------------------
  777|  17.0k|    return;
  778|       |
  779|  3.33k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (779:7): [True: 1.47k, False: 1.85k]
  |  Branch (779:40): [True: 641, False: 1.21k]
  ------------------
  780|  2.11k|    width_ = value;
  781|  3.33k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (781:7): [True: 713, False: 2.62k]
  |  Branch (781:41): [True: 370, False: 2.25k]
  ------------------
  782|  1.08k|    height_ = value;
  783|  3.33k|  xmpData_[tag->_label] = value;
  784|  3.33k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  786|  14.4k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  787|  14.4k|  const MatroskaTag* internalMt = nullptr;
  788|  14.4k|  uint64_t key = getULongLong(buf, bigEndian);
  789|  14.4k|  if (!key)
  ------------------
  |  Branch (789:7): [True: 4.86k, False: 9.57k]
  ------------------
  790|  4.86k|    return;
  791|       |
  792|  9.57k|  switch (tag->_id) {
  793|  6.08k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (793:5): [True: 6.08k, False: 3.48k]
  ------------------
  794|  6.08k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (794:16): [True: 267, False: 5.81k]
  ------------------
  795|    267|        stream_ = f->_id;
  796|    267|      }
  797|  6.08k|      break;
  798|    448|    case TrackUsed:
  ------------------
  |  Branch (798:5): [True: 448, False: 9.12k]
  ------------------
  799|    448|      internalMt = Exiv2::find(trackEnable, key);
  800|    448|      break;
  801|  1.08k|    case TrackDefault:
  ------------------
  |  Branch (801:5): [True: 1.08k, False: 8.48k]
  ------------------
  802|  1.08k|      internalMt = Exiv2::find(defaultOn, key);
  803|  1.08k|      break;
  804|    512|    case TrackForced:
  ------------------
  |  Branch (804:5): [True: 512, False: 9.05k]
  ------------------
  805|    512|      internalMt = Exiv2::find(trackForced, key);
  806|    512|      break;
  807|    635|    case TrackLacing:
  ------------------
  |  Branch (807:5): [True: 635, False: 8.93k]
  ------------------
  808|    635|      internalMt = Exiv2::find(trackLacing, key);
  809|    635|      break;
  810|    513|    case CodecDecodeAll:
  ------------------
  |  Branch (810:5): [True: 513, False: 9.05k]
  ------------------
  811|    513|      internalMt = Exiv2::find(codecDecodeAll, key);
  812|    513|      break;
  813|    226|    case CodecSettings:
  ------------------
  |  Branch (813:5): [True: 226, False: 9.34k]
  ------------------
  814|    226|      internalMt = Exiv2::find(codecSettings, key);
  815|    226|      break;
  816|     69|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (816:5): [True: 69, False: 9.50k]
  ------------------
  817|     69|      internalMt = tag;
  818|     69|      break;
  819|      0|    default:
  ------------------
  |  Branch (819:5): [True: 0, False: 9.57k]
  ------------------
  820|      0|      break;
  821|  9.57k|  }
  822|       |
  823|  9.57k|  if (internalMt) {
  ------------------
  |  Branch (823:7): [True: 1.02k, False: 8.54k]
  ------------------
  824|  1.02k|    xmpData_[internalMt->_label] = "Yes";
  825|  1.02k|  }
  826|  9.57k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  828|  1.32k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  829|  1.32k|  int64_t duration_in_ms = 0;
  830|  1.32k|  uint64_t value;
  831|  1.32k|  switch (tag->_id) {
  832|    399|    case Xmp_video_Duration:
  ------------------
  |  Branch (832:5): [True: 399, False: 928]
  ------------------
  833|    399|      if (size <= 4) {
  ------------------
  |  Branch (833:11): [True: 278, False: 121]
  ------------------
  834|    278|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  835|    278|      } else {
  836|    121|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  837|    121|      }
  838|    399|      xmpData_[tag->_label] = duration_in_ms;
  839|    399|      break;
  840|    311|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (840:5): [True: 311, False: 1.01k]
  ------------------
  841|    311|      value = getULongLong(buf, bigEndian);
  842|    311|      if (!value)
  ------------------
  |  Branch (842:11): [True: 211, False: 100]
  ------------------
  843|    211|        return;
  844|    100|      duration_in_ms = value / 1000000000;
  845|    100|      xmpData_[tag->_label] = duration_in_ms;
  846|    100|      break;
  847|       |
  848|    617|    case TimecodeScale:
  ------------------
  |  Branch (848:5): [True: 617, False: 710]
  ------------------
  849|    617|      value = getULongLong(buf, bigEndian);
  850|    617|      if (!value)
  ------------------
  |  Branch (850:11): [True: 365, False: 252]
  ------------------
  851|    365|        return;
  852|    252|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  853|    252|      xmpData_[tag->_label] = time_code_scale_;
  854|    252|      break;
  855|      0|    default:
  ------------------
  |  Branch (855:5): [True: 0, False: 1.32k]
  ------------------
  856|      0|      break;
  857|  1.32k|  }
  858|  1.32k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  860|  2.15k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  861|  2.15k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  862|       |
  863|  2.15k|  switch (tag->_id) {
  864|    793|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (864:5): [True: 793, False: 1.36k]
  ------------------
  865|  1.05k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (865:5): [True: 264, False: 1.89k]
  ------------------
  866|  1.05k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  867|  1.05k|      break;
  868|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (868:5): [True: 0, False: 2.15k]
  ------------------
  869|  1.10k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (869:5): [True: 1.10k, False: 1.05k]
  ------------------
  870|  1.10k|      uint64_t key = getULongLong(buf, bigEndian);
  871|  1.10k|      if (!key)
  ------------------
  |  Branch (871:11): [True: 106, False: 996]
  ------------------
  872|    106|        return;
  873|    996|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (873:16): [True: 464, False: 532]
  ------------------
  874|    464|        double frame_rate = 0;
  875|    464|        switch (stream_) {
  876|    158|          case 1:  // video
  ------------------
  |  Branch (876:11): [True: 158, False: 306]
  ------------------
  877|    158|            frame_rate = 1000000000.0 / static_cast<double>(key);
  878|    158|            break;
  879|     73|          case 2:  // audio
  ------------------
  |  Branch (879:11): [True: 73, False: 391]
  ------------------
  880|     73|            frame_rate = static_cast<double>(key) / 1000;
  881|     73|            break;
  882|    233|          default:
  ------------------
  |  Branch (882:11): [True: 233, False: 231]
  ------------------
  883|    233|            break;
  884|    464|        }
  885|    464|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (885:13): [True: 231, False: 233]
  ------------------
  886|    231|          xmpData_[internalMt->_label] = frame_rate;
  887|    464|      } else
  888|    532|        xmpData_[tag->_label] = "Variable Bit Rate";
  889|    996|    } break;
  890|    996|    default:
  ------------------
  |  Branch (890:5): [True: 0, False: 2.15k]
  ------------------
  891|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  892|      0|      break;
  893|  2.15k|  }
  894|  2.15k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  896|   291k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  897|   291k|  if (b & 128)
  ------------------
  |  Branch (897:7): [True: 259k, False: 32.0k]
  ------------------
  898|   259k|    return 1;
  899|  32.0k|  if (b & 64)
  ------------------
  |  Branch (899:7): [True: 17.3k, False: 14.7k]
  ------------------
  900|  17.3k|    return 2;
  901|  14.7k|  if (b & 32)
  ------------------
  |  Branch (901:7): [True: 3.35k, False: 11.4k]
  ------------------
  902|  3.35k|    return 3;
  903|  11.4k|  if (b & 16)
  ------------------
  |  Branch (903:7): [True: 6.12k, False: 5.29k]
  ------------------
  904|  6.12k|    return 4;
  905|  5.29k|  if (b & 8)
  ------------------
  |  Branch (905:7): [True: 2.42k, False: 2.86k]
  ------------------
  906|  2.42k|    return 5;
  907|  2.86k|  if (b & 4)
  ------------------
  |  Branch (907:7): [True: 334, False: 2.53k]
  ------------------
  908|    334|    return 6;
  909|  2.53k|  if (b & 2)
  ------------------
  |  Branch (909:7): [True: 304, False: 2.23k]
  ------------------
  910|    304|    return 7;
  911|  2.23k|  if (b & 1)
  ------------------
  |  Branch (911:7): [True: 1.88k, False: 348]
  ------------------
  912|  1.88k|    return 8;
  913|    348|  return 0;
  914|  2.23k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  916|  2.68k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, bool /*create*/) {
  917|  2.68k|  auto image = std::make_unique<MatroskaVideo>(std::move(io));
  918|  2.68k|  if (!image->good()) {
  ------------------
  |  Branch (918:7): [True: 0, False: 2.68k]
  ------------------
  919|      0|    return nullptr;
  920|      0|  }
  921|  2.68k|  return image;
  922|  2.68k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  924|  11.1k|bool isMkvType(BasicIo& iIo, bool advance) {
  925|  11.1k|  bool result = true;
  926|  11.1k|  byte tmpBuf[4];
  927|  11.1k|  iIo.read(tmpBuf, 4);
  928|       |
  929|  11.1k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (929:7): [True: 0, False: 11.1k]
  |  Branch (929:22): [True: 342, False: 10.8k]
  ------------------
  930|    342|    return false;
  931|       |
  932|  10.8k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (932:7): [True: 2.67k, False: 8.12k]
  |  Branch (932:28): [True: 20, False: 8.10k]
  |  Branch (932:49): [True: 24, False: 8.08k]
  |  Branch (932:70): [True: 21, False: 8.06k]
  ------------------
  933|  2.73k|    result = false;
  934|  2.73k|  }
  935|       |
  936|  10.8k|  if (!advance || !result)
  ------------------
  |  Branch (936:7): [True: 10.8k, False: 0]
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|  10.8k|    iIo.seek(0, BasicIo::beg);
  938|  10.8k|  return result;
  939|  11.1k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   291k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   291k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 291k, False: 348]
  |  Branch (583:23): [True: 291k, False: 0]
  ------------------
  584|       |
  585|   291k|  size_t b0 = buf[0] & (0xff >> size);
  586|   291k|  size_t tag = b0 << ((size - 1) * 8);
  587|   360k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 68.7k, False: 291k]
  ------------------
  588|  68.7k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  68.7k|  }
  590|       |
  591|   291k|  return tag;
  592|   291k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  722|  7.17k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  7.17k|    switch (tag->_id) {
  ------------------
  |  Branch (723:13): [True: 7.17k, False: 0]
  ------------------
  724|    392|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (724:7): [True: 392, False: 6.78k]
  ------------------
  725|    392|        return Exiv2::find(videoScanType, key);
  726|    679|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (726:7): [True: 679, False: 6.49k]
  ------------------
  727|    679|        return Exiv2::find(audioChannels, key);
  728|    518|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (728:7): [True: 518, False: 6.65k]
  ------------------
  729|    518|        return Exiv2::find(compressionAlgorithm, key);
  730|    496|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (730:7): [True: 496, False: 6.68k]
  ------------------
  731|    496|        return Exiv2::find(encryptionAlgorithm, key);
  732|     87|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (732:7): [True: 87, False: 7.09k]
  ------------------
  733|    262|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (733:7): [True: 175, False: 7.00k]
  ------------------
  734|    262|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|     81|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (735:7): [True: 81, False: 7.09k]
  ------------------
  736|    805|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (736:7): [True: 724, False: 6.45k]
  ------------------
  737|    805|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|    384|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (738:7): [True: 384, False: 6.79k]
  ------------------
  739|    384|        return Exiv2::find(encodingType, key);
  740|    776|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (740:7): [True: 776, False: 6.40k]
  ------------------
  741|    776|        return Exiv2::find(displayUnit, key);
  742|    374|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (742:7): [True: 374, False: 6.80k]
  ------------------
  743|    374|        return Exiv2::find(aspectRatioType, key);
  744|  2.08k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (744:7): [True: 2.08k, False: 5.08k]
  ------------------
  745|  2.08k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|    202|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (746:7): [True: 202, False: 6.97k]
  ------------------
  747|    202|        return Exiv2::find(chapterTranslateCodec, key);
  748|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (748:7): [True: 0, False: 7.17k]
  ------------------
  749|      0|        return Exiv2::find(trackCodec, key);
  750|     93|      case Video_Audio_CodecName:
  ------------------
  |  Branch (750:7): [True: 93, False: 7.08k]
  ------------------
  751|     93|        return Exiv2::find(codecInfo, key);
  752|      0|      case CodecDownloadURL:
  ------------------
  |  Branch (752:7): [True: 0, False: 7.17k]
  ------------------
  753|    108|      case CodecInfoURL:
  ------------------
  |  Branch (753:7): [True: 108, False: 7.06k]
  ------------------
  754|    108|        return Exiv2::find(codecDownloadUrl, key);
  755|  7.17k|    }
  756|      0|    return nullptr;
  757|  7.17k|  }();

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

_ZN5Exiv28Internal16MinoltaMakerNote7tagListEv:
   25|  42.0k|  static constexpr auto tagList() {
   26|  42.0k|    return tagInfo_;
   27|  42.0k|  }
_ZN5Exiv28Internal16MinoltaMakerNote11tagListCs5DEv:
   37|    430|  static constexpr auto tagListCs5D() {
   38|    430|    return tagInfoCs5D_;
   39|    430|  }
_ZN5Exiv28Internal16MinoltaMakerNote11tagListCs7DEv:
   33|  2.71k|  static constexpr auto tagListCs7D() {
   34|  2.71k|    return tagInfoCs7D_;
   35|  2.71k|  }
_ZN5Exiv28Internal16MinoltaMakerNote12tagListCsStdEv:
   29|    740|  static constexpr auto tagListCsStd() {
   30|    740|    return tagInfoCsStd_;
   31|    740|  }
_ZN5Exiv28Internal16MinoltaMakerNote13tagListCsA100Ev:
   41|    336|  static constexpr auto tagListCsA100() {
   42|    336|    return tagInfoCsA100_;
   43|    336|  }

_ZN5Exiv28MrwImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   24|    272|    Image(ImageType::mrw, mdExif | mdIptc | mdXmp, std::move(io)) {
   25|    272|}
_ZNK5Exiv28MrwImage10pixelWidthEv:
   31|     27|uint32_t MrwImage::pixelWidth() const {
   32|     27|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   33|     27|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (33:7): [True: 18, False: 9]
  |  Branch (33:7): [True: 9, False: 18]
  |  Branch (33:40): [True: 9, False: 9]
  ------------------
   34|      9|    return imageWidth->toUint32();
   35|      9|  }
   36|     18|  return 0;
   37|     27|}
_ZNK5Exiv28MrwImage11pixelHeightEv:
   39|     27|uint32_t MrwImage::pixelHeight() const {
   40|     27|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   41|     27|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (41:7): [True: 15, False: 12]
  |  Branch (41:7): [True: 5, False: 22]
  |  Branch (41:41): [True: 5, False: 10]
  ------------------
   42|      5|    return imageHeight->toUint32();
   43|      5|  }
   44|     22|  return 0;
   45|     27|}
_ZN5Exiv28MrwImage12readMetadataEv:
   62|    272|void MrwImage::readMetadata() {
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |  std::cerr << "Reading MRW file " << io_->path() << "\n";
   65|       |#endif
   66|    272|  if (io_->open() != 0) {
  ------------------
  |  Branch (66:7): [True: 0, False: 272]
  ------------------
   67|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   68|      0|  }
   69|    272|  IoCloser closer(*io_);
   70|       |  // Ensure that this is the correct image type
   71|    272|  if (!isMrwType(*io_, false)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 272]
  ------------------
   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|    272|  clearMetadata();
   77|       |
   78|       |  // Find the TTW block and read it into a buffer
   79|    272|  uint32_t const len = 8;
   80|    272|  byte tmp[len];
   81|    272|  io_->read(tmp, len);
   82|    272|  uint32_t pos = len;
   83|    272|  uint32_t const end = getULong(tmp + 4, bigEndian);
   84|       |
   85|    272|  pos += len;
   86|    272|  Internal::enforce(pos <= end, ErrorCode::kerFailedToReadImageData);
   87|    272|  io_->read(tmp, len);
   88|    272|  if (io_->error() || io_->eof())
  ------------------
  |  Branch (88:7): [True: 24, False: 248]
  |  Branch (88:23): [True: 0, False: 248]
  ------------------
   89|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   90|       |
   91|    747|  while (memcmp(tmp + 1, "TTW", 3) != 0) {
  ------------------
  |  Branch (91:10): [True: 475, False: 272]
  ------------------
   92|    475|    uint32_t const siz = getULong(tmp + 4, bigEndian);
   93|    475|    Internal::enforce(siz <= end - pos, ErrorCode::kerFailedToReadImageData);
   94|    475|    pos += siz;
   95|    475|    io_->seek(siz, BasicIo::cur);
   96|    475|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (96:23): [True: 447, False: 28]
  |  Branch (96:40): [True: 369, False: 78]
  ------------------
   97|       |
   98|    475|    Internal::enforce(len <= end - pos, ErrorCode::kerFailedToReadImageData);
   99|    475|    pos += len;
  100|    475|    io_->read(tmp, len);
  101|    475|    Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (101:23): [True: 347, False: 128]
  |  Branch (101:40): [True: 298, False: 49]
  ------------------
  102|    475|  }
  103|       |
  104|    272|  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|    272|  Internal::enforce(siz <= io_->size(), ErrorCode::kerFailedToReadImageData);
  111|    272|  DataBuf buf(siz);
  112|    272|  io_->read(buf.data(), buf.size());
  113|    272|  Internal::enforce(!io_->error() && !io_->eof(), ErrorCode::kerFailedToReadImageData);
  ------------------
  |  Branch (113:21): [True: 47, False: 225]
  |  Branch (113:38): [True: 41, False: 6]
  ------------------
  114|       |
  115|    272|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, buf.c_data(), buf.size());
  116|    272|  setByteOrder(bo);
  117|    272|}  // MrwImage::readMetadata
_ZN5Exiv28MrwImage13writeMetadataEv:
  119|      4|void MrwImage::writeMetadata() {
  120|       |  // Todo: implement me!
  121|      4|  throw(Error(ErrorCode::kerWritingImageFormatUnsupported, "MRW"));
  122|      4|}  // MrwImage::writeMetadata
_ZN5Exiv214newMrwInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  126|    272|Image::UniquePtr newMrwInstance(BasicIo::UniquePtr io, bool create) {
  127|    272|  auto image = std::make_unique<MrwImage>(std::move(io), create);
  128|    272|  if (!image->good()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 272]
  ------------------
  129|      0|    return nullptr;
  130|      0|  }
  131|    272|  return image;
  132|    272|}
_ZN5Exiv29isMrwTypeERNS_7BasicIoEb:
  134|  32.4k|bool isMrwType(BasicIo& iIo, bool advance) {
  135|  32.4k|  const int32_t len = 4;
  136|  32.4k|  const std::array<byte, len> MrwId{0x0, 0x4d, 0x52, 0x4d};
  137|  32.4k|  std::array<byte, len> buf;
  138|  32.4k|  iIo.read(buf.data(), len);
  139|  32.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (139:7): [True: 0, False: 32.4k]
  |  Branch (139:22): [True: 149, False: 32.2k]
  ------------------
  140|    149|    return false;
  141|    149|  }
  142|  32.2k|  bool rc = buf == MrwId;
  143|  32.2k|  if (!advance || !rc) {
  ------------------
  |  Branch (143:7): [True: 32.2k, False: 0]
  |  Branch (143:19): [True: 0, False: 0]
  ------------------
  144|  32.2k|    iIo.seek(-len, BasicIo::cur);
  145|  32.2k|  }
  146|  32.2k|  return rc;
  147|  32.4k|}

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

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

_ZN5Exiv28OrfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   25|    108|    TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ std::move(io), create) {
   26|    108|  setTypeSupported(ImageType::orf, mdExif | mdIptc | mdXmp);
   27|    108|}  // OrfImage::OrfImage
_ZNK5Exiv28OrfImage10pixelWidthEv:
   33|     39|uint32_t OrfImage::pixelWidth() const {
   34|     39|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
   35|     39|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (35:7): [True: 18, False: 21]
  |  Branch (35:7): [True: 8, False: 31]
  |  Branch (35:40): [True: 8, False: 10]
  ------------------
   36|      8|    return imageWidth->toUint32();
   37|      8|  }
   38|     31|  return 0;
   39|     39|}
_ZNK5Exiv28OrfImage11pixelHeightEv:
   41|     39|uint32_t OrfImage::pixelHeight() const {
   42|     39|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageLength"));
   43|     39|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (43:7): [True: 14, False: 25]
  |  Branch (43:7): [True: 6, False: 33]
  |  Branch (43:41): [True: 6, False: 8]
  ------------------
   44|      6|    return imageHeight->toUint32();
   45|      6|  }
   46|     33|  return 0;
   47|     39|}
_ZN5Exiv28OrfImage12readMetadataEv:
   70|    108|void OrfImage::readMetadata() {
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |  std::cerr << "Reading ORF file " << io_->path() << "\n";
   73|       |#endif
   74|    108|  if (io_->open() != 0) {
  ------------------
  |  Branch (74:7): [True: 0, False: 108]
  ------------------
   75|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   76|      0|  }
   77|    108|  IoCloser closer(*io_);
   78|       |  // Ensure that this is the correct image type
   79|    108|  if (!isOrfType(*io_, false)) {
  ------------------
  |  Branch (79:7): [True: 0, False: 108]
  ------------------
   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|    108|  clearMetadata();
   85|    108|  ByteOrder bo = OrfParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
   86|    108|  setByteOrder(bo);
   87|    108|}
_ZN5Exiv28OrfImage13writeMetadataEv:
   89|     41|void OrfImage::writeMetadata() {
   90|       |#ifdef EXIV2_DEBUG_MESSAGES
   91|       |  std::cerr << "Writing ORF file " << io_->path() << "\n";
   92|       |#endif
   93|     41|  ByteOrder bo = byteOrder();
   94|     41|  const byte* pData = nullptr;
   95|     41|  size_t size = 0;
   96|     41|  IoCloser closer(*io_);
   97|       |  // Ensure that this is the correct image type
   98|     41|  if (io_->open() == 0 && isOrfType(*io_, false)) {
  ------------------
  |  Branch (98:7): [True: 41, False: 0]
  |  Branch (98:27): [True: 41, False: 0]
  ------------------
   99|     41|    pData = io_->mmap(true);
  100|     41|    size = io_->size();
  101|     41|    OrfHeader orfHeader;
  102|     41|    if (0 == orfHeader.read(pData, 8)) {
  ------------------
  |  Branch (102:9): [True: 0, False: 41]
  ------------------
  103|      0|      bo = orfHeader.byteOrder();
  104|      0|    }
  105|     41|  }
  106|     41|  if (bo == invalidByteOrder) {
  ------------------
  |  Branch (106:7): [True: 0, False: 41]
  ------------------
  107|      0|    bo = littleEndian;
  108|      0|  }
  109|     41|  setByteOrder(bo);
  110|     41|  OrfParser::encode(*io_, pData, size, bo, exifData_, iptcData_, xmpData_);  // may throw
  111|     41|}  // OrfImage::writeMetadata
_ZN5Exiv29OrfParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  113|    108|ByteOrder OrfParser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  114|    108|  OrfHeader orfHeader;
  115|    108|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, Tag::root, TiffMapping::findDecoder,
  116|    108|                                  &orfHeader);
  117|    108|}
_ZN5Exiv29OrfParser6encodeERNS_7BasicIoEPKhmNS_9ByteOrderERNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataE:
  120|     41|                              const IptcData& iptcData, const XmpData& xmpData) {
  121|       |  // Delete IFDs which do not occur in TIFF images
  122|     41|  static constexpr auto filteredIfds = {
  123|     41|      IfdId::panaRawId,
  124|     41|  };
  125|     41|  for (auto&& filteredIfd : filteredIfds) {
  ------------------
  |  Branch (125:27): [True: 41, False: 41]
  ------------------
  126|       |#ifdef EXIV2_DEBUG_MESSAGES
  127|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  128|       |#endif
  129|     41|    exifData.erase(std::remove_if(exifData.begin(), exifData.end(), FindExifdatum(filteredIfd)), exifData.end());
  130|     41|  }
  131|       |
  132|     41|  OrfHeader header(byteOrder);
  133|     41|  return TiffParserWorker::encode(io, pData, size, exifData, iptcData, xmpData, Tag::root, TiffMapping::findEncoder,
  134|     41|                                  &header, nullptr);
  135|     41|}
_ZN5Exiv214newOrfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  139|    108|Image::UniquePtr newOrfInstance(BasicIo::UniquePtr io, bool create) {
  140|    108|  auto image = std::make_unique<OrfImage>(std::move(io), create);
  141|    108|  if (!image->good()) {
  ------------------
  |  Branch (141:7): [True: 0, False: 108]
  ------------------
  142|      0|    return nullptr;
  143|      0|  }
  144|    108|  return image;
  145|    108|}
_ZN5Exiv29isOrfTypeERNS_7BasicIoEb:
  147|  20.1k|bool isOrfType(BasicIo& iIo, bool advance) {
  148|  20.1k|  const int32_t len = 8;
  149|  20.1k|  byte buf[len];
  150|  20.1k|  iIo.read(buf, len);
  151|  20.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (151:7): [True: 0, False: 20.1k]
  |  Branch (151:22): [True: 202, False: 19.9k]
  ------------------
  152|    202|    return false;
  153|    202|  }
  154|  19.9k|  OrfHeader orfHeader;
  155|  19.9k|  bool rc = orfHeader.read(buf, len);
  156|  19.9k|  if (!advance || !rc) {
  ------------------
  |  Branch (156:7): [True: 19.9k, False: 0]
  |  Branch (156:19): [True: 0, False: 0]
  ------------------
  157|  19.9k|    iIo.seek(-len, BasicIo::cur);
  158|  19.9k|  }
  159|  19.9k|  return rc;
  160|  20.1k|}

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  20.1k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  20.1k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  20.1k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  20.1k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 20.1k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  20.1k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 67, False: 20.1k]
  |  Branch (13:26): [True: 37, False: 30]
  ------------------
   14|     37|    setByteOrder(littleEndian);
   15|  20.1k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 657, False: 19.4k]
  |  Branch (15:33): [True: 605, False: 52]
  ------------------
   16|    605|    setByteOrder(bigEndian);
   17|  19.5k|  } else {
   18|  19.5k|    return false;
   19|  19.5k|  }
   20|       |
   21|    642|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|    642|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 617, False: 25]
  |  Branch (22:23): [True: 87, False: 530]
  ------------------
   23|     87|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    555|  sig_ = sig;
   25|    555|  setOffset(getULong(pData + 4, byteOrder()));
   26|    555|  return true;
   27|    642|}
_ZNK5Exiv28Internal9OrfHeader5writeEv:
   29|     30|DataBuf OrfHeader::write() const {
   30|     30|  DataBuf buf(8);
   31|     30|  switch (byteOrder()) {
   32|      1|    case littleEndian:
  ------------------
  |  Branch (32:5): [True: 1, False: 29]
  ------------------
   33|      1|      buf.write_uint8(0, 'I');
   34|      1|      break;
   35|     29|    case bigEndian:
  ------------------
  |  Branch (35:5): [True: 29, False: 1]
  ------------------
   36|     29|      buf.write_uint8(0, 'M');
   37|     29|      break;
   38|      0|    default:
  ------------------
  |  Branch (38:5): [True: 0, False: 30]
  ------------------
   39|      0|      break;
   40|     30|  }
   41|     30|  buf.write_uint8(1, buf.read_uint8(0));
   42|       |
   43|     30|  buf.write_uint16(2, sig_, byteOrder());
   44|     30|  buf.write_uint32(4, 0x00000008, byteOrder());
   45|     30|  return buf;
   46|     30|}

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

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

_ZN5Exiv28PgfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   53|    774|    Image(ImageType::pgf, mdExif | mdIptc | mdXmp | mdComment, std::move(io)), bSwap_(isBigEndianPlatform()) {
   54|    774|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (54:7): [True: 0, False: 774]
  |  Branch (54:17): [True: 0, False: 0]
  ------------------
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |    std::cerr << "Exiv2::PgfImage:: Creating PGF image to memory\n";
   57|       |#endif
   58|      0|    IoCloser closer(*io_);
   59|      0|    if (io_->write(pgfBlank, sizeof(pgfBlank)) != sizeof(pgfBlank)) {
  ------------------
  |  Branch (59:9): [True: 0, False: 0]
  ------------------
   60|       |#ifdef EXIV2_DEBUG_MESSAGES
   61|       |      std::cerr << "Exiv2::PgfImage:: Failed to create PGF image on memory\n";
   62|       |#endif
   63|      0|    }
   64|      0|  }
   65|    774|}  // PgfImage::PgfImage
_ZN5Exiv28PgfImage12readMetadataEv:
   67|    774|void PgfImage::readMetadata() {
   68|       |#ifdef EXIV2_DEBUG_MESSAGES
   69|       |  std::cerr << "Exiv2::PgfImage::readMetadata: Reading PGF file " << io_->path() << "\n";
   70|       |#endif
   71|    774|  if (io_->open() != 0) {
  ------------------
  |  Branch (71:7): [True: 0, False: 774]
  ------------------
   72|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   73|      0|  }
   74|    774|  IoCloser closer(*io_);
   75|       |  // Ensure that this is the correct image type
   76|    774|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (76:7): [True: 0, False: 774]
  ------------------
   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|    774|  clearMetadata();
   82|       |
   83|    774|  readPgfMagicNumber(*io_);
   84|       |
   85|    774|  size_t headerSize = readPgfHeaderSize(*io_);
   86|    774|  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|    774|  Internal::enforce(headerSize <= std::numeric_limits<size_t>::max() - 8, ErrorCode::kerCorruptedMetadata);
   91|    774|  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|    774|  if (size > io_->size())
  ------------------
  |  Branch (97:7): [True: 88, False: 686]
  ------------------
   98|     88|    throw Error(ErrorCode::kerInputDataReadFailed);
   99|    686|  if (size == 0)
  ------------------
  |  Branch (99:7): [True: 27, False: 659]
  ------------------
  100|     27|    return;
  101|       |
  102|    659|  DataBuf imgData(size);
  103|    659|  const size_t bufRead = io_->read(imgData.data(), imgData.size());
  104|    659|  if (io_->error())
  ------------------
  |  Branch (104:7): [True: 0, False: 659]
  ------------------
  105|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  106|    659|  if (bufRead != imgData.size())
  ------------------
  |  Branch (106:7): [True: 18, False: 641]
  ------------------
  107|     18|    throw Error(ErrorCode::kerInputDataReadFailed);
  108|       |
  109|    641|  auto image = Exiv2::ImageFactory::open(imgData.c_data(), imgData.size());
  110|    641|  image->readMetadata();
  111|    641|  exifData() = image->exifData();
  112|    641|  iptcData() = image->iptcData();
  113|    641|  xmpData() = image->xmpData();
  114|    641|}
_ZN5Exiv28PgfImage13writeMetadataEv:
  116|    315|void PgfImage::writeMetadata() {
  117|    315|  if (io_->open() != 0) {
  ------------------
  |  Branch (117:7): [True: 0, False: 315]
  ------------------
  118|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  119|      0|  }
  120|    315|  IoCloser closer(*io_);
  121|    315|  MemIo tempIo;
  122|       |
  123|    315|  doWriteMetadata(tempIo);  // may throw
  124|    315|  io_->close();
  125|    315|  io_->transfer(tempIo);  // may throw
  126|       |
  127|    315|}  // PgfImage::writeMetadata
_ZN5Exiv28PgfImage15doWriteMetadataERNS_7BasicIoE:
  129|    315|void PgfImage::doWriteMetadata(BasicIo& outIo) {
  130|    315|  if (!io_->isopen())
  ------------------
  |  Branch (130:7): [True: 0, False: 315]
  ------------------
  131|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  132|    315|  if (!outIo.isopen())
  ------------------
  |  Branch (132:7): [True: 0, False: 315]
  ------------------
  133|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  134|       |
  135|       |#ifdef EXIV2_DEBUG_MESSAGES
  136|       |  std::cout << "Exiv2::PgfImage::doWriteMetadata: Writing PGF file " << io_->path() << "\n";
  137|       |  std::cout << "Exiv2::PgfImage::doWriteMetadata: tmp file created " << outIo.path() << "\n";
  138|       |#endif
  139|       |
  140|       |  // Ensure that this is the correct image type
  141|    315|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (141:7): [True: 0, False: 315]
  ------------------
  142|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  |  Branch (142:25): [True: 0, False: 0]
  ------------------
  143|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  144|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  145|      0|  }
  146|       |
  147|       |  // Ensure PGF version.
  148|    315|  byte mnb = readPgfMagicNumber(*io_);
  149|       |
  150|    315|  readPgfHeaderSize(*io_);
  151|       |
  152|    315|  uint32_t w = 0;
  153|    315|  uint32_t h = 0;
  154|    315|  DataBuf header = readPgfHeaderStructure(*io_, w, h);
  155|       |
  156|    315|  auto img = ImageFactory::create(ImageType::png);
  157|       |
  158|    315|  img->setExifData(exifData_);
  159|    315|  img->setIptcData(iptcData_);
  160|    315|  img->setXmpData(xmpData_);
  161|    315|  img->writeMetadata();
  162|    315|  size_t imgSize = img->io().size();
  163|    315|  DataBuf imgBuf = img->io().read(imgSize);
  164|       |
  165|       |#ifdef EXIV2_DEBUG_MESSAGES
  166|       |  std::cout << "Exiv2::PgfImage::doWriteMetadata: Creating image to host metadata (" << imgSize << " bytes)\n";
  167|       |#endif
  168|       |
  169|       |  //---------------------------------------------------------------
  170|       |
  171|       |  // Write PGF Signature.
  172|    315|  if (outIo.write(pgfSignature.data(), 3) != 3)
  ------------------
  |  Branch (172:7): [True: 0, False: 315]
  ------------------
  173|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  174|       |
  175|       |  // Write Magic number.
  176|    315|  if (outIo.putb(mnb) == EOF)
  ------------------
  |  Branch (176:7): [True: 0, False: 315]
  ------------------
  177|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  178|       |
  179|       |  // Write new Header size.
  180|    315|  auto newHeaderSize = static_cast<uint32_t>(header.size() + imgSize);
  181|    315|  DataBuf buffer(4);
  182|    315|  std::memcpy(buffer.data(), &newHeaderSize, sizeof(uint32_t));
  183|    315|  byteSwap_(buffer, 0, bSwap_);
  184|    315|  if (outIo.write(buffer.c_data(), 4) != 4)
  ------------------
  |  Branch (184:7): [True: 0, False: 315]
  ------------------
  185|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  186|       |
  187|       |#ifdef EXIV2_DEBUG_MESSAGES
  188|       |  std::cout << "Exiv2::PgfImage: new PGF header size : " << newHeaderSize << " bytes\n";
  189|       |
  190|       |  printf("%x\n", buffer.read_uint8(0));
  191|       |  printf("%x\n", buffer.read_uint8(1));
  192|       |  printf("%x\n", buffer.read_uint8(2));
  193|       |  printf("%x\n", buffer.read_uint8(3));
  194|       |#endif
  195|       |
  196|       |  // Write Header data.
  197|    315|  if (outIo.write(header.c_data(), header.size()) != header.size())
  ------------------
  |  Branch (197:7): [True: 0, False: 315]
  ------------------
  198|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  199|       |
  200|       |  // Write new metadata byte array.
  201|    315|  if (outIo.write(imgBuf.c_data(), imgBuf.size()) != imgBuf.size())
  ------------------
  |  Branch (201:7): [True: 0, False: 315]
  ------------------
  202|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  203|       |
  204|       |  // Copy the rest of PGF image data.
  205|       |
  206|    315|  DataBuf buf(4096);
  207|    315|  size_t readSize = io_->read(buf.data(), buf.size());
  208|  1.00k|  while (readSize != 0) {
  ------------------
  |  Branch (208:10): [True: 689, False: 315]
  ------------------
  209|    689|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (209:9): [True: 0, False: 689]
  ------------------
  210|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  211|    689|    readSize = io_->read(buf.data(), buf.size());
  212|    689|  }
  213|    315|  if (outIo.error())
  ------------------
  |  Branch (213:7): [True: 0, False: 315]
  ------------------
  214|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  215|       |
  216|    315|}  // PgfImage::doWriteMetadata
_ZN5Exiv28PgfImage18readPgfMagicNumberERNS_7BasicIoE:
  218|  1.08k|byte PgfImage::readPgfMagicNumber(BasicIo& iIo) {
  219|  1.08k|  auto b = static_cast<byte>(iIo.getb());
  220|  1.08k|  if (iIo.error())
  ------------------
  |  Branch (220:7): [True: 0, False: 1.08k]
  ------------------
  221|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|       |
  223|  1.08k|  if (b < 0x36)  // 0x36 = '6'.
  ------------------
  |  Branch (223:7): [True: 97, False: 992]
  ------------------
  224|     97|  {
  225|       |    // Not right Magick version.
  226|       |#ifdef EXIV2_DEBUG_MESSAGES
  227|       |    std::cout << "Exiv2::PgfImage::readMetadata: wrong Magick number\n";
  228|       |#endif
  229|     97|  }
  230|       |
  231|  1.08k|  return b;
  232|  1.08k|}  // PgfImage::readPgfMagicNumber
_ZNK5Exiv28PgfImage17readPgfHeaderSizeERNS_7BasicIoE:
  234|  1.08k|size_t PgfImage::readPgfHeaderSize(BasicIo& iIo) const {
  235|  1.08k|  DataBuf buffer(4);
  236|  1.08k|  const size_t bufRead = iIo.read(buffer.data(), buffer.size());
  237|  1.08k|  if (iIo.error())
  ------------------
  |  Branch (237:7): [True: 0, False: 1.08k]
  ------------------
  238|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  239|  1.08k|  if (bufRead != buffer.size())
  ------------------
  |  Branch (239:7): [True: 0, False: 1.08k]
  ------------------
  240|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  241|       |
  242|  1.08k|  auto headerSize = static_cast<size_t>(byteSwap_(buffer, 0, bSwap_));
  243|  1.08k|  if (headerSize == 0)
  ------------------
  |  Branch (243:7): [True: 15, False: 1.07k]
  ------------------
  244|     15|    throw Error(ErrorCode::kerNoImageInInputData);
  245|       |
  246|       |#ifdef EXIV2_DEBUG_MESSAGES
  247|       |  std::cout << "Exiv2::PgfImage: PGF header size : " << headerSize << " bytes\n";
  248|       |#endif
  249|       |
  250|  1.07k|  return headerSize;
  251|  1.08k|}
_ZNK5Exiv28PgfImage22readPgfHeaderStructureERNS_7BasicIoERjS3_:
  253|  1.07k|DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const {
  254|  1.07k|  DataBuf header(16);
  255|  1.07k|  size_t bufRead = iIo.read(header.data(), header.size());
  256|  1.07k|  if (iIo.error())
  ------------------
  |  Branch (256:7): [True: 0, False: 1.07k]
  ------------------
  257|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  258|  1.07k|  if (bufRead != header.size())
  ------------------
  |  Branch (258:7): [True: 0, False: 1.07k]
  ------------------
  259|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  260|       |
  261|  1.07k|  DataBuf work(header.data(), 8);  // don't disturb the binary data - doWriteMetadata reuses it
  262|  1.07k|  width = byteSwap_(work, 0, bSwap_);
  263|  1.07k|  height = byteSwap_(work, 4, bSwap_);
  264|       |
  265|       |  /* NOTE: properties not yet used
  266|       |  byte nLevels  = buffer.pData_[8];
  267|       |  byte quality  = buffer.pData_[9];
  268|       |  byte bpp      = buffer.pData_[10];
  269|       |  byte channels = buffer.pData_[11];
  270|       |  */
  271|       |
  272|  1.07k|  if (header.read_uint8(12) == 2)  // Indexed color image. We pass color table (256 * 3 bytes).
  ------------------
  |  Branch (272:7): [True: 24, False: 1.05k]
  ------------------
  273|     24|  {
  274|     24|    header.alloc(16 + (256 * 3));
  275|       |
  276|     24|    bufRead = iIo.read(header.data(16), 256 * 3);
  277|     24|    if (iIo.error())
  ------------------
  |  Branch (277:9): [True: 0, False: 24]
  ------------------
  278|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  279|     24|    if (bufRead != 256 * 3)
  ------------------
  |  Branch (279:9): [True: 20, False: 4]
  ------------------
  280|     20|      throw Error(ErrorCode::kerInputDataReadFailed);
  281|     24|  }
  282|       |
  283|  1.05k|  return header;
  284|  1.07k|}  // PgfImage::readPgfHeaderStructure
_ZN5Exiv214newPgfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  288|    774|Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create) {
  289|    774|  auto image = std::make_unique<PgfImage>(std::move(io), create);
  290|    774|  if (!image->good()) {
  ------------------
  |  Branch (290:7): [True: 0, False: 774]
  ------------------
  291|      0|    return nullptr;
  292|      0|  }
  293|    774|  return image;
  294|    774|}
_ZN5Exiv29isPgfTypeERNS_7BasicIoEb:
  296|  20.3k|bool isPgfType(BasicIo& iIo, bool advance) {
  297|  20.3k|  const int32_t len = 3;
  298|  20.3k|  std::array<byte, len> buf;
  299|  20.3k|  iIo.read(buf.data(), len);
  300|  20.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (300:7): [True: 0, False: 20.3k]
  |  Branch (300:22): [True: 0, False: 20.3k]
  ------------------
  301|      0|    return false;
  302|      0|  }
  303|  20.3k|  bool rc = buf == pgfSignature;
  304|  20.3k|  if (!advance || !rc) {
  ------------------
  |  Branch (304:7): [True: 19.3k, False: 1.08k]
  |  Branch (304:19): [True: 0, False: 1.08k]
  ------------------
  305|  19.3k|    iIo.seek(-len, BasicIo::cur);
  306|  19.3k|  }
  307|       |
  308|  20.3k|  return rc;
  309|  20.3k|}
pgfimage.cpp:_ZN5Exiv2L9byteSwap_ERNS_7DataBufEmb:
   39|  3.54k|static uint32_t byteSwap_(Exiv2::DataBuf& buf, size_t offset, bool bSwap) {
   40|  3.54k|  uint32_t v = 0;
   41|  3.54k|  auto p = reinterpret_cast<byte*>(&v);
   42|  3.54k|  int i;
   43|  17.7k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (43:15): [True: 14.1k, False: 3.54k]
  ------------------
   44|  14.1k|    p[i] = buf.read_uint8(offset + i);
   45|  3.54k|  uint32_t result = Image::byteSwap(v, bSwap);
   46|  3.54k|  p = reinterpret_cast<byte*>(&result);
   47|  17.7k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (47:15): [True: 14.1k, False: 3.54k]
  ------------------
   48|  14.1k|    buf.write_uint8(offset + i, p[i]);
   49|  3.54k|  return result;
   50|  3.54k|}

_ZN5Exiv29Photoshop5isIrbEPKh:
   17|  4.54M|bool Photoshop::isIrb(const byte* pPsData) {
   18|  4.54M|  if (pPsData == nullptr) {
  ------------------
  |  Branch (18:7): [True: 0, False: 4.54M]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|  4.54M|  return std::any_of(irbId_.begin(), irbId_.end(), [pPsData](auto id) { return memcmp(pPsData, id, 4) == 0; });
   22|  4.54M|}
_ZN5Exiv29Photoshop5validEPKhm:
   24|  9.98k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   25|  9.98k|  const byte* record = nullptr;
   26|  9.98k|  uint32_t sizeIptc = 0;
   27|  9.98k|  uint32_t sizeHdr = 0;
   28|  9.98k|  const byte* pCur = pPsData;
   29|  9.98k|  const byte* pEnd = pPsData + sizePsData;
   30|  9.98k|  int ret = 0;
   31|  2.29M|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (31:10): [True: 2.29M, False: 36]
  |  Branch (31:25): [True: 2.28M, False: 9.95k]
  ------------------
   32|  2.28M|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   33|  2.28M|  }
   34|  9.98k|  return ret >= 0;
   35|  9.98k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   41|  2.30M|                         uint32_t& sizeData) {
   42|  2.30M|  if (sizePsData < 12) {
  ------------------
  |  Branch (42:7): [True: 1.51k, False: 2.30M]
  ------------------
   43|  1.51k|    return 3;
   44|  1.51k|  }
   45|       |
   46|       |  // Used for error checking
   47|  2.30M|  size_t position = 0;
   48|       |#ifdef EXIV2_DEBUG_MESSAGES
   49|       |  std::cerr << "Photoshop::locateIrb: ";
   50|       |#endif
   51|       |  // Data should follow Photoshop format, if not exit
   52|  4.54M|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (52:10): [True: 4.54M, False: 245]
  |  Branch (52:43): [True: 4.54M, False: 3.02k]
  ------------------
   53|  4.54M|    const byte* hrd = pPsData + position;
   54|  4.54M|    position += 4;
   55|  4.54M|    uint16_t type = getUShort(pPsData + position, bigEndian);
   56|  4.54M|    position += 2;
   57|       |#ifdef EXIV2_DEBUG_MESSAGES
   58|       |    std::cerr << "0x" << std::hex << type << std::dec << " ";
   59|       |#endif
   60|       |    // Pascal string is padded to have an even size (including size byte)
   61|  4.54M|    byte psSize = pPsData[position] + 1;
   62|  4.54M|    psSize += (psSize & 1);
   63|  4.54M|    position += psSize;
   64|  4.54M|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (64:9): [True: 4.05k, False: 4.53M]
  ------------------
   65|       |#ifdef EXIV2_DEBUG_MESSAGES
   66|       |      std::cerr << "Warning: "
   67|       |                << "Invalid or extended Photoshop IRB\n";
   68|       |#endif
   69|  4.05k|      return -2;
   70|  4.05k|    }
   71|  4.53M|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   72|  4.53M|    position += 4;
   73|  4.53M|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (73:9): [True: 2.73k, False: 4.53M]
  ------------------
   74|       |#ifdef EXIV2_DEBUG_MESSAGES
   75|       |      std::cerr << "Warning: "
   76|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   77|       |#endif
   78|  2.73k|      return -2;
   79|  2.73k|    }
   80|       |#ifdef EXIV2_DEBUG_MESSAGES
   81|       |    if ((dataSize & 1) && position + dataSize == sizePsData) {
   82|       |      std::cerr << "Warning: "
   83|       |                << "Photoshop IRB data is not padded to even size\n";
   84|       |    }
   85|       |#endif
   86|  4.53M|    if (type == psTag) {
  ------------------
  |  Branch (86:9): [True: 2.29M, False: 2.24M]
  ------------------
   87|       |#ifdef EXIV2_DEBUG_MESSAGES
   88|       |      std::cerr << "ok\n";
   89|       |#endif
   90|  2.29M|      sizeData = dataSize;
   91|  2.29M|      sizeHdr = psSize + 10;
   92|  2.29M|      *record = hrd;
   93|  2.29M|      return 0;
   94|  2.29M|    }
   95|       |    // Data size is also padded to be even
   96|  2.24M|    position += dataSize + (dataSize & 1);
   97|  2.24M|  }
   98|       |#ifdef EXIV2_DEBUG_MESSAGES
   99|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  100|       |#endif
  101|  3.27k|  if (position < sizePsData) {
  ------------------
  |  Branch (101:7): [True: 3.22k, False: 43]
  ------------------
  102|       |#ifdef EXIV2_DEBUG_MESSAGES
  103|       |    std::cerr << "Warning: "
  104|       |              << "Invalid or extended Photoshop IRB\n";
  105|       |#endif
  106|  3.22k|    return -2;
  107|  3.22k|  }
  108|     43|  return 3;
  109|  3.27k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  112|  2.30M|                             uint32_t& sizeData) {
  113|  2.30M|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  114|  2.30M|}
_ZN5Exiv29Photoshop10setIptcIrbEPKhmRKNS_8IptcDataE:
  121|    679|DataBuf Photoshop::setIptcIrb(const byte* pPsData, size_t sizePsData, const IptcData& iptcData) {
  122|       |#ifdef EXIV2_DEBUG_MESSAGES
  123|       |  std::cerr << "IRB block at the beginning of Photoshop::setIptcIrb\n";
  124|       |  if (sizePsData == 0)
  125|       |    std::cerr << "  None.\n";
  126|       |  else
  127|       |    hexdump(std::cerr, pPsData, sizePsData);
  128|       |#endif
  129|    679|  const byte* record = pPsData;
  130|    679|  uint32_t sizeIptc = 0;
  131|    679|  uint32_t sizeHdr = 0;
  132|    679|  DataBuf rc;
  133|    679|  if (0 > Photoshop::locateIptcIrb(pPsData, sizePsData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (133:7): [True: 62, False: 617]
  ------------------
  134|     62|    return rc;
  135|     62|  }
  136|       |
  137|    617|  Blob psBlob;
  138|    617|  const auto sizeFront = static_cast<size_t>(record - pPsData);
  139|       |  // Write data before old record.
  140|    617|  if (sizePsData > 0 && sizeFront > 0) {
  ------------------
  |  Branch (140:7): [True: 234, False: 383]
  |  Branch (140:25): [True: 10, False: 224]
  ------------------
  141|     10|    append(psBlob, pPsData, sizeFront);
  142|     10|  }
  143|       |
  144|       |  // Write new iptc record if we have it
  145|    617|  if (DataBuf rawIptc = IptcParser::encode(iptcData); !rawIptc.empty()) {
  ------------------
  |  Branch (145:55): [True: 166, False: 451]
  ------------------
  146|    166|    std::array<byte, 12> tmpBuf;
  147|    166|    std::copy_n(Photoshop::irbId_.front(), 4, tmpBuf.begin());
  148|    166|    us2Data(tmpBuf.data() + 4, iptc_, bigEndian);
  149|    166|    tmpBuf[6] = 0;
  150|    166|    tmpBuf[7] = 0;
  151|    166|    ul2Data(tmpBuf.data() + 8, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  152|    166|    append(psBlob, tmpBuf.data(), 12);
  153|    166|    append(psBlob, rawIptc.c_data(), rawIptc.size());
  154|       |    // Data is padded to be even (but not included in size)
  155|    166|    if (rawIptc.size() & 1)
  ------------------
  |  Branch (155:9): [True: 91, False: 75]
  ------------------
  156|     91|      psBlob.push_back(0x00);
  157|    166|  }
  158|       |
  159|       |  // Write existing stuff after record, skip the current and all remaining IPTC blocks
  160|    617|  size_t pos = sizeFront;
  161|    617|  auto nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  162|    617|  Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  163|  2.93k|  while (0 == Photoshop::locateIptcIrb(pPsData + pos, nextSizeData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (163:10): [True: 2.31k, False: 617]
  ------------------
  164|  2.31k|    const auto newPos = static_cast<size_t>(record - pPsData);
  165|  2.31k|    if (newPos > pos) {  // Copy data up to the IPTC IRB
  ------------------
  |  Branch (165:9): [True: 1.80k, False: 518]
  ------------------
  166|  1.80k|      append(psBlob, pPsData + pos, newPos - pos);
  167|  1.80k|    }
  168|  2.31k|    pos = newPos + sizeHdr + sizeIptc + (sizeIptc & 1);  // Skip the IPTC IRB
  169|  2.31k|    nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  170|  2.31k|    Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  171|  2.31k|  }
  172|    617|  if (pos < sizePsData) {
  ------------------
  |  Branch (172:7): [True: 225, False: 392]
  ------------------
  173|    225|    append(psBlob, pPsData + pos, sizePsData - pos);
  174|    225|  }
  175|       |
  176|       |  // Data is rounded to be even
  177|    617|  if (!psBlob.empty())
  ------------------
  |  Branch (177:7): [True: 387, False: 230]
  ------------------
  178|    387|    rc = DataBuf(psBlob.data(), psBlob.size());
  179|       |#ifdef EXIV2_DEBUG_MESSAGES
  180|       |  std::cerr << "IRB block at the end of Photoshop::setIptcIrb\n";
  181|       |  if (rc.empty())
  182|       |    std::cerr << "  None.\n";
  183|       |  else
  184|       |    hexdump(std::cerr, rc.c_data(), rc.size());
  185|       |#endif
  186|    617|  return rc;
  187|    679|}
photoshop.cpp:_ZZN5Exiv29Photoshop5isIrbEPKhENK3$_0clIPKcEEDaT_:
   21|  18.1M|  return std::any_of(irbId_.begin(), irbId_.end(), [pPsData](auto id) { return memcmp(pPsData, id, 4) == 0; });

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|    795|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|    795|  *outWidth = data.read_uint32(0, bigEndian);
   48|    795|  *outHeight = data.read_uint32(4, bigEndian);
   49|    795|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  7.33k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  7.33k|  DataBuf key = keyTXTChunk(data);
   53|  7.33k|  DataBuf arr = parseTXTChunk(data, key.size(), type);
   54|       |
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |  std::cout << "Exiv2::PngChunk::decodeTXTChunk: TXT chunk data: " << std::string(arr.c_str(), arr.size()) << '\n';
   57|       |#endif
   58|  7.33k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 6.61k, False: 718]
  ------------------
   59|  6.61k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  7.33k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  10.1k|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|  10.1k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 2.80k, False: 7.33k]
  ------------------
   74|  10.1k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 38, False: 10.1k]
  ------------------
   75|     38|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  10.1k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  10.1k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 43, False: 10.0k]
  ------------------
   79|     43|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  10.0k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  10.1k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.25k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.25k|  DataBuf arr;
   86|       |
   87|  7.25k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 162, False: 7.09k]
  ------------------
   88|    162|    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|    162|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 15, False: 147]
  ------------------
   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|     15|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     15|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    147|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    147|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 27, False: 120]
  ------------------
  104|     27|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     27|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     27|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     27|    }
  109|  7.09k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 1.54k, False: 5.55k]
  ------------------
  110|  1.54k|    enforce(data.size() >= Safe::add(keysize, std::size_t{1}), ErrorCode::kerCorruptedMetadata);
  111|       |    // Extract a non-compressed Latin-1 text chunk
  112|       |
  113|       |    // the text comes after the key, but isn't null terminated
  114|  1.54k|    size_t textsize = data.size() - keysize - 1;
  115|  1.54k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 759, False: 785]
  ------------------
  116|    759|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|    759|      arr = DataBuf(text, textsize);
  119|    759|    }
  120|  5.55k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 5.55k, False: 0]
  ------------------
  121|  5.55k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  5.55k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  5.55k|    enforce(nullCount >= nullSeparators, ErrorCode::kerCorruptedMetadata);
  124|       |
  125|       |    // Extract a deflate compressed or uncompressed UTF-8 text chunk
  126|       |
  127|       |    // we get the compression flag after the key
  128|  5.55k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  5.55k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  5.55k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.48k, False: 67]
  |  Branch (132:40): [True: 51, False: 16]
  ------------------
  133|  5.55k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 51, False: 5.49k]
  ------------------
  134|     51|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  5.55k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  5.55k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  5.55k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  5.55k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  5.55k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  5.55k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  5.55k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  5.55k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  5.55k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  5.55k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  5.55k|    const auto textsize =
  152|  5.55k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  5.55k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 5.49k, False: 58]
  ------------------
  154|  5.49k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  5.49k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 5.45k, False: 40]
  ------------------
  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.45k|        arr = DataBuf(text, textsize);
  162|  5.45k|      } 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|     40|        zlibUncompress(text, textsize, arr);
  170|     40|      }
  171|  5.49k|    }
  172|  5.55k|  } else {
  173|       |#ifdef DEBUG
  174|       |    std::cerr << "Exiv2::PngChunk::parseTXTChunk: We found a field, not expected though\n";
  175|       |#endif
  176|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  177|      0|  }
  178|       |
  179|  7.24k|  return arr;
  180|  7.25k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  6.61k|void PngChunk::parseChunkContent(Image* pImage, const byte* key, size_t keySize, const DataBuf& arr) {
  183|       |  // We look if an ImageMagick EXIF raw profile exist.
  184|       |
  185|  6.61k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 2.50k, False: 4.11k]
  ------------------
  186|  2.50k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 42, False: 2.46k]
  |  Branch (186:57): [True: 338, False: 2.12k]
  ------------------
  187|    380|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 380, False: 0]
  ------------------
  188|    380|    DataBuf exifData = readRawProfile(arr, false);
  189|    380|    size_t length = exifData.size();
  190|       |
  191|    380|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 228, False: 152]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|    228|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|    228|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|    228|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    308|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 80, False: 228]
  ------------------
  200|     80|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 80]
  ------------------
  201|     80|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 80]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|     80|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|    228|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 228]
  ------------------
  210|       |#ifdef EXIV2_DEBUG_MESSAGES
  211|       |        std::cout << "Exiv2::PngChunk::parseChunkContent: TIFF header found at position " << pos << "\n";
  212|       |#endif
  213|      0|        ByteOrder bo = TiffParser::decode(pImage->exifData(), pImage->iptcData(), pImage->xmpData(),
  214|      0|                                          exifData.c_data(pos), length - pos);
  215|      0|        pImage->setByteOrder(bo);
  216|    228|      } else {
  217|    228|#ifndef SUPPRESS_WARNINGS
  218|    228|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|    228|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 228]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    228|  LogMsg(LogMsg::warn).os()
  ------------------
  219|    228|#endif
  220|    228|        pImage->exifData().clear();
  221|    228|      }
  222|    228|    }
  223|    380|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  6.61k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 2.48k, False: 4.13k]
  |  Branch (227:24): [True: 506, False: 1.97k]
  |  Branch (227:73): [True: 469, False: 37]
  ------------------
  228|    469|    DataBuf psData = readRawProfile(arr, false);
  229|    469|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 123, False: 346]
  ------------------
  230|    123|      Blob iptcBlob;
  231|    123|      const byte* record = nullptr;
  232|    123|      uint32_t sizeIptc = 0;
  233|    123|      uint32_t sizeHdr = 0;
  234|       |
  235|    123|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|    123|      const byte* pCur = psData.c_data();
  237|    123|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 117, False: 6]
  |  Branch (237:29): [True: 0, False: 117]
  ------------------
  238|      0|        if (sizeIptc) {
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|       |#ifdef EXIV2_DEBUG_MESSAGES
  240|       |          std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  241|       |#endif
  242|      0|          append(iptcBlob, record + sizeHdr, sizeIptc);
  243|      0|        }
  244|      0|        pCur = record + sizeHdr + sizeIptc;
  245|      0|        pCur += (sizeIptc & 1);
  246|      0|      }
  247|    123|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 123]
  |  Branch (247:32): [True: 0, False: 0]
  ------------------
  248|      0|#ifndef SUPPRESS_WARNINGS
  249|      0|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  250|      0|#endif
  251|      0|        pImage->clearIptcData();
  252|      0|      }
  253|       |      // If there is no IRB, try to decode the complete chunk data
  254|    123|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 123, False: 0]
  |  Branch (254:31): [True: 73, False: 50]
  ------------------
  255|     73|#ifndef SUPPRESS_WARNINGS
  256|     73|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     73|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 73]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     73|  LogMsg(LogMsg::warn).os()
  ------------------
  257|     73|#endif
  258|     73|        pImage->clearIptcData();
  259|     73|      }
  260|    123|    }  // if (psData.size() > 0)
  261|    469|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  6.61k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 2.47k, False: 4.14k]
  |  Branch (265:24): [True: 417, False: 2.05k]
  |  Branch (265:72): [True: 416, False: 1]
  ------------------
  266|    416|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|    416|    size_t length = xmpBuf.size();
  268|       |
  269|    416|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 28, False: 388]
  ------------------
  270|     28|      std::string& xmpPacket = pImage->xmpPacket();
  271|     28|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|     28|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 13, False: 15]
  |  Branch (272:80): [True: 13, False: 0]
  ------------------
  273|     13|#ifndef SUPPRESS_WARNINGS
  274|     13|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\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()
  ------------------
  275|     13|#endif
  276|     13|        xmpPacket = xmpPacket.substr(idx);
  277|     13|      }
  278|     28|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 28, False: 0]
  ------------------
  279|     28|#ifndef SUPPRESS_WARNINGS
  280|     28|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     28|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 28]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     28|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     28|#endif
  282|     28|      }
  283|     28|    }
  284|    416|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  6.61k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 4.90k, False: 1.71k]
  |  Branch (288:24): [True: 970, False: 3.93k]
  |  Branch (288:69): [True: 948, False: 22]
  |  Branch (288:98): [True: 716, False: 232]
  ------------------
  289|    716|    std::string& xmpPacket = pImage->xmpPacket();
  290|    716|    xmpPacket.assign(arr.c_str(), arr.size());
  291|    716|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 161, False: 555]
  |  Branch (291:78): [True: 158, False: 3]
  ------------------
  292|    158|#ifndef SUPPRESS_WARNINGS
  293|    158|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    158|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 158]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    158|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    158|#endif
  296|    158|      xmpPacket = xmpPacket.substr(idx);
  297|    158|    }
  298|    716|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 666, False: 50]
  ------------------
  299|    666|#ifndef SUPPRESS_WARNINGS
  300|    666|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    666|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 666]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    666|  LogMsg(LogMsg::warn).os()
  ------------------
  301|    666|#endif
  302|    666|    }
  303|    716|  }
  304|       |
  305|       |  // We look if a comments string exist. Note than we use only 'Description' keyword which
  306|       |  // is dedicated to store long comments. 'Comment' keyword is ignored.
  307|       |
  308|  6.61k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 5.46k, False: 1.15k]
  |  Branch (308:7): [True: 125, False: 6.49k]
  |  Branch (308:24): [True: 1.37k, False: 4.08k]
  |  Branch (308:63): [True: 125, False: 1.24k]
  ------------------
  309|    125|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|    125|  }
  311|       |
  312|  6.61k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk17makeMetadataChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_10MetadataIdE:
  314|  2.90k|std::string PngChunk::makeMetadataChunk(std::string_view metadata, MetadataId type) {
  315|  2.90k|  std::string rawProfile;
  316|       |
  317|  2.90k|  switch (type) {
  ------------------
  |  Branch (317:11): [True: 2.90k, False: 0]
  ------------------
  318|  1.08k|    case mdComment:
  ------------------
  |  Branch (318:5): [True: 1.08k, False: 1.81k]
  ------------------
  319|  1.08k|      return makeUtf8TxtChunk("Description", metadata, true);
  320|     72|    case mdIptc:
  ------------------
  |  Branch (320:5): [True: 72, False: 2.83k]
  ------------------
  321|     72|      rawProfile = writeRawProfile(metadata, "iptc");
  322|     72|      return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
  323|  1.74k|    case mdXmp:
  ------------------
  |  Branch (323:5): [True: 1.74k, False: 1.15k]
  ------------------
  324|  1.74k|      return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
  325|      0|    case mdExif:
  ------------------
  |  Branch (325:5): [True: 0, False: 2.90k]
  ------------------
  326|      0|    case mdIccProfile:
  ------------------
  |  Branch (326:5): [True: 0, False: 2.90k]
  ------------------
  327|      0|    case mdNone:
  ------------------
  |  Branch (327:5): [True: 0, False: 2.90k]
  ------------------
  328|      0|      return {};
  329|  2.90k|  }
  330|       |
  331|      0|  return {};
  332|       |
  333|  2.90k|}  // PngChunk::makeMetadataChunk
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|     67|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|     67|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|     67|  int zlibResult = Z_BUF_ERROR;
  338|     67|  int dos = 0;
  339|       |
  340|     90|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 78, False: 12]
  ------------------
  341|     78|    arr.alloc(uncompressedLen);
  342|     78|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|     78|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 12, False: 66]
  ------------------
  344|     12|      arr.resize(uncompressedLen);
  345|     66|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 11, False: 55]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     11|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     11|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 0, False: 11]
  ------------------
  350|      0|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|          break;
  352|      0|        uncompressedLen = 131072;
  353|      0|      }
  354|     55|    } else {
  355|       |      // something bad happened
  356|     55|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|     55|    }
  358|     78|  }
  359|       |
  360|     12|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (360:7): [True: 0, False: 12]
  ------------------
  361|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  362|      0|  }
  363|     12|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk12zlibCompressENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  365|  1.15k|std::string PngChunk::zlibCompress(std::string_view text) {
  366|  1.15k|  auto compressedLen = static_cast<uLongf>(text.size() * 2);  // just a starting point
  367|  1.15k|  int zlibResult = Z_BUF_ERROR;
  368|       |
  369|  1.15k|  DataBuf arr;
  370|  3.00k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (370:10): [True: 1.84k, False: 1.15k]
  ------------------
  371|  1.84k|    arr.resize(compressedLen);
  372|  1.84k|    zlibResult = compress2(arr.data(), &compressedLen, reinterpret_cast<const Bytef*>(text.data()),
  373|  1.84k|                           static_cast<uLong>(text.size()), Z_BEST_COMPRESSION);
  374|       |
  375|  1.84k|    switch (zlibResult) {
  376|  1.15k|      case Z_OK:
  ------------------
  |  Branch (376:7): [True: 1.15k, False: 686]
  ------------------
  377|  1.15k|        arr.resize(compressedLen);
  378|  1.15k|        break;
  379|    686|      case Z_BUF_ERROR:
  ------------------
  |  Branch (379:7): [True: 686, False: 1.15k]
  ------------------
  380|       |        // The compressed array needs to be larger
  381|       |#ifdef EXIV2_DEBUG_MESSAGES
  382|       |        std::cout << "Exiv2::PngChunk::parsePngChunk: doubling size for compression.\n";
  383|       |#endif
  384|    686|        compressedLen *= 2;
  385|       |        // DoS protection. Cap max compressed size
  386|    686|        if (compressedLen > 131072)
  ------------------
  |  Branch (386:13): [True: 0, False: 686]
  ------------------
  387|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  388|    686|        break;
  389|    686|      default:
  ------------------
  |  Branch (389:7): [True: 0, False: 1.84k]
  ------------------
  390|       |        // Something bad happened
  391|      0|        throw Error(ErrorCode::kerFailedToReadImageData);
  392|  1.84k|    }
  393|  1.84k|  }
  394|       |
  395|  1.15k|  return {arr.c_str(), arr.size()};
  396|       |
  397|  1.15k|}  // PngChunk::zlibCompress
_ZN5Exiv28Internal8PngChunk17makeAsciiTxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  399|     72|std::string PngChunk::makeAsciiTxtChunk(std::string_view keyword, std::string_view text, bool compress) {
  400|       |  // Chunk structure: length (4 bytes) + chunk type + chunk data + CRC (4 bytes)
  401|       |  // Length is the size of the chunk data
  402|       |  // CRC is calculated on chunk type + chunk data
  403|       |
  404|       |  // Compressed text chunk using zlib.
  405|       |  // Chunk data format : keyword + 0x00 + compression method (0x00) + compressed text
  406|       |
  407|       |  // Not Compressed text chunk.
  408|       |  // Chunk data format : keyword + 0x00 + text
  409|       |
  410|       |  // Build chunk data, determine chunk type
  411|     72|  auto chunkData = std::string(keyword) + '\0';
  412|     72|  std::string chunkType;
  413|     72|  if (compress) {
  ------------------
  |  Branch (413:7): [True: 72, False: 0]
  ------------------
  414|     72|    chunkData += '\0' + zlibCompress(text);
  415|     72|    chunkType = "zTXt";
  416|     72|  } else {
  417|      0|    chunkData += text;
  418|      0|    chunkType = "tEXt";
  419|      0|  }
  420|       |  // Determine length of the chunk data
  421|     72|  byte length[4];
  422|     72|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  423|       |  // Calculate CRC on chunk type and chunk data
  424|     72|  std::string crcData = chunkType + chunkData;
  425|     72|  uLong tmp = crc32(0L, Z_NULL, 0);
  426|     72|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  427|     72|  byte crc[4];
  428|     72|  ul2Data(crc, tmp, bigEndian);
  429|       |  // Assemble the chunk
  430|     72|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  431|     72|         std::string(reinterpret_cast<const char*>(crc), 4);
  432|       |
  433|     72|}  // PngChunk::makeAsciiTxtChunk
_ZN5Exiv28Internal8PngChunk16makeUtf8TxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  435|  2.83k|std::string PngChunk::makeUtf8TxtChunk(std::string_view keyword, std::string_view text, bool compress) {
  436|       |  // Chunk structure: length (4 bytes) + chunk type + chunk data + CRC (4 bytes)
  437|       |  // Length is the size of the chunk data
  438|       |  // CRC is calculated on chunk type + chunk data
  439|       |
  440|       |  // Chunk data format : keyword + 0x00 + compression flag (0x00: uncompressed - 0x01: compressed)
  441|       |  //                     + compression method (0x00: zlib format) + language tag (null) + 0x00
  442|       |  //                     + translated keyword (null) + 0x00 + text (compressed or not)
  443|       |
  444|       |  // Build chunk data, determine chunk type
  445|  2.83k|  auto chunkData = std::string(keyword);
  446|  2.83k|  if (compress) {
  ------------------
  |  Branch (446:7): [True: 1.08k, False: 1.74k]
  ------------------
  447|  1.08k|    static const char flags[] = {0x00, 0x01, 0x00, 0x00, 0x00};
  448|  1.08k|    chunkData += std::string(flags, 5) + zlibCompress(text);
  449|  1.74k|  } else {
  450|  1.74k|    static const char flags[] = {0x00, 0x00, 0x00, 0x00, 0x00};
  451|  1.74k|    chunkData += std::string(flags, 5) + text.data();
  452|  1.74k|  }
  453|       |  // Determine length of the chunk data
  454|  2.83k|  byte length[4];
  455|  2.83k|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  456|       |  // Calculate CRC on chunk type and chunk data
  457|  2.83k|  std::string chunkType = "iTXt";
  458|  2.83k|  std::string crcData = chunkType + chunkData;
  459|  2.83k|  uLong tmp = crc32(0L, Z_NULL, 0);
  460|  2.83k|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  461|  2.83k|  byte crc[4];
  462|  2.83k|  ul2Data(crc, tmp, bigEndian);
  463|       |  // Assemble the chunk
  464|  2.83k|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  465|  2.83k|         std::string(reinterpret_cast<const char*>(crc), 4);
  466|       |
  467|  2.83k|}  // PngChunk::makeUtf8TxtChunk
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  469|  1.26k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  1.26k|  DataBuf info;
  471|  1.26k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 180, False: 1.08k]
  ------------------
  472|    180|    return info;
  473|    180|  }
  474|       |
  475|  1.08k|  const unsigned char unhex[103] = {
  476|  1.08k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  477|  1.08k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  478|  1.08k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15,
  479|  1.08k|  };
  480|       |
  481|  1.08k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 1.08k]
  ------------------
  482|      0|    info.alloc(text.size());
  483|      0|    std::copy(text.begin(), text.end(), info.begin());
  484|      0|    return info;
  485|      0|  }
  486|       |
  487|  1.08k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  1.08k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  1.08k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 179, False: 906]
  ------------------
  491|    179|    return info;
  492|    179|  }
  493|       |
  494|       |  // Look for newline
  495|  9.26k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 8.47k, False: 790]
  ------------------
  496|  8.47k|    sp++;
  497|  8.47k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 116, False: 8.35k]
  ------------------
  498|    116|      return info;
  499|    116|    }
  500|  8.47k|  }
  501|    790|  sp++;  // step over '\n'
  502|    790|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 77, False: 713]
  ------------------
  503|     77|    return info;
  504|     77|  }
  505|       |
  506|       |  // Look for length
  507|  4.19k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 1.94k, False: 2.24k]
  |  Branch (507:25): [True: 556, False: 1.69k]
  |  Branch (507:39): [True: 1.03k, False: 661]
  ------------------
  508|  3.52k|    sp++;
  509|  3.52k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 52, False: 3.47k]
  ------------------
  510|     52|      return info;
  511|     52|    }
  512|  3.52k|  }
  513|       |
  514|       |  // Parse the length.
  515|    661|  size_t length = 0;
  516|  2.82k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 2.56k, False: 260]
  |  Branch (516:24): [True: 2.17k, False: 391]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  2.17k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  2.17k|    length = newlength;
  520|  2.17k|    sp++;
  521|  2.17k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 10, False: 2.16k]
  ------------------
  522|     10|      return info;
  523|     10|    }
  524|  2.17k|  }
  525|    651|  sp++;  // step over '\n'
  526|    651|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 42, False: 609]
  ------------------
  527|     42|    return info;
  528|     42|  }
  529|       |
  530|    609|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|    609|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 66, False: 543]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|     66|  }
  538|    609|  info.alloc(length);
  539|    609|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 609]
  ------------------
  540|       |#ifdef EXIV2_DEBUG_MESSAGES
  541|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: cannot allocate memory\n";
  542|       |#endif
  543|      0|    return info;
  544|      0|  }
  545|       |
  546|    609|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 66, False: 543]
  ------------------
  547|     66|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|    543|  unsigned char* dp = info.data();  // decode pointer
  551|    543|  size_t nibbles = length * 2;
  552|       |
  553|  6.26k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 5.78k, False: 475]
  ------------------
  554|  5.78k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  15.0k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 4.68k, False: 10.4k]
  |  Branch (555:26): [True: 6.25k, False: 4.15k]
  |  Branch (555:39): [True: 2.13k, False: 4.11k]
  |  Branch (555:53): [True: 2.58k, False: 5.68k]
  ------------------
  556|  9.37k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 68, False: 9.31k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|     68|        return {};
  561|     68|      }
  562|       |
  563|  9.31k|      sp++;
  564|  9.31k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  9.31k|    }
  566|       |
  567|  5.71k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 2.87k, False: 2.84k]
  ------------------
  568|  2.87k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  2.84k|    else
  570|  2.84k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  5.71k|  }
  572|       |
  573|    475|  return info;
  574|       |
  575|    543|}  // PngChunk::readRawProfile
_ZN5Exiv28Internal8PngChunk15writeRawProfileENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKc:
  577|     72|std::string PngChunk::writeRawProfile(std::string_view profileData, const char* profileType) {
  578|     72|  static const byte hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  579|       |
  580|     72|  auto ss = stringFormat("\n{}\n{:08}", profileType, profileData.size());
  ------------------
  |  |   18|     72|#define stringFormat std::format
  ------------------
  581|     72|  auto sp = reinterpret_cast<const byte*>(profileData.data());
  582|   264k|  for (std::string::size_type i = 0; i < profileData.size(); ++i) {
  ------------------
  |  Branch (582:38): [True: 264k, False: 72]
  ------------------
  583|   264k|    if (i % 36 == 0)
  ------------------
  |  Branch (583:9): [True: 7.38k, False: 257k]
  ------------------
  584|  7.38k|      ss += '\n';
  585|   264k|    ss += hex[*sp >> 4 & 0x0fU];
  586|   264k|    ss += hex[*sp++ & 0x0fU];
  587|   264k|  }
  588|     72|  ss += '\n';
  589|     72|  return ss;
  590|       |
  591|     72|}  // PngChunk::writeRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   56|  1.40k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
   57|  1.40k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 315, False: 1.08k]
  |  Branch (57:17): [True: 315, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    315|    IoCloser closer(*io_);
   62|    315|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 315]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    315|  }
   68|  1.40k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.08k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.08k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.08k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.08k|  IoCloser closer(*io_);
  400|  1.08k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.08k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.08k|  clearMetadata();
  404|       |
  405|  1.08k|  const size_t imgSize = io_->size();
  406|  1.08k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  30.3k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 29.9k, False: 439]
  ------------------
  409|  29.9k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  29.9k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  29.9k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 276, False: 29.6k]
  ------------------
  414|    276|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    276|    }
  416|       |
  417|  29.6k|    std::string chunkType(cheaderBuf.c_str(4), 4);
  418|       |#ifdef EXIV2_DEBUG_MESSAGES
  419|       |    std::cout << "Exiv2::PngImage::readMetadata: chunk type: " << chunkType << " length: " << chunkLength << '\n';
  420|       |#endif
  421|       |
  422|       |    /// \todo analyse remaining chunks of the standard
  423|       |    // Perform a chunk triage for item that we need.
  424|  29.6k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 299, False: 29.3k]
  |  Branch (424:32): [True: 3.75k, False: 25.6k]
  |  Branch (424:55): [True: 1.54k, False: 24.0k]
  |  Branch (424:78): [True: 234, False: 23.8k]
  ------------------
  425|  23.8k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 110, False: 23.7k]
  |  Branch (425:32): [True: 5.55k, False: 18.1k]
  |  Branch (425:55): [True: 504, False: 17.6k]
  ------------------
  426|  11.9k|      DataBuf chunkData(chunkLength);
  427|  11.9k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 8.70k, False: 3.21k]
  ------------------
  428|  8.70k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  8.70k|      }
  430|       |
  431|  11.9k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 213, False: 11.7k]
  ------------------
  432|    213|        return;  // Last chunk found: we stop parsing.
  433|    213|      }
  434|  11.7k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 3.75k, False: 7.95k]
  |  Branch (434:34): [True: 795, False: 2.96k]
  ------------------
  435|    795|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  10.9k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 1.54k, False: 9.36k]
  ------------------
  437|  1.54k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  9.36k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 234, False: 9.13k]
  ------------------
  439|    234|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  9.13k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 5.55k, False: 3.57k]
  ------------------
  441|  5.55k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  5.55k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 110, False: 3.46k]
  ------------------
  443|    110|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    110|        setByteOrder(bo);
  445|  3.46k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 504, False: 2.96k]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    504|        uint32_t iccOffset = 0;
  448|  4.76k|        do {
  449|  4.76k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 4.75k, False: 10]
  |  Branch (449:37): [True: 4.74k, False: 11]
  ------------------
  450|  4.76k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 4.26k, False: 504]
  ------------------
  451|       |
  452|    504|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    504|        ++iccOffset;  // +1 = 'compressed' flag
  454|    504|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    504|        zlibToDataBuf(chunkData.c_data(iccOffset), static_cast<uLongf>(chunkLength - iccOffset), iccProfile_);
  457|       |#ifdef EXIV2_DEBUG_MESSAGES
  458|       |        std::cout << "Exiv2::PngImage::readMetadata: profile name: " << profileName_ << '\n';
  459|       |        std::cout << "Exiv2::PngImage::readMetadata: iccProfile.size_ (uncompressed) : " << iccProfile_.size() << '\n';
  460|       |#endif
  461|    504|      }
  462|       |
  463|       |      // Set chunkLength to 0 in case we have read a supported chunk type. Otherwise, we need to seek the
  464|       |      // file to the next chunk position.
  465|  11.7k|      chunkLength = 0;
  466|  11.7k|    }
  467|       |
  468|       |    // Move to the next chunk: chunk data size + 4 CRC bytes.
  469|       |#ifdef EXIV2_DEBUG_MESSAGES
  470|       |    std::cout << "Exiv2::PngImage::readMetadata: Seek to offset: " << chunkLength + 4 << '\n';
  471|       |#endif
  472|  29.4k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  29.4k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 439, False: 29.0k]
  |  Branch (473:25): [True: 161, False: 28.8k]
  ------------------
  474|    161|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    161|    }
  476|  29.4k|  }
  477|  1.08k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  479|    523|void PngImage::writeMetadata() {
  480|    523|  if (io_->open() != 0) {
  ------------------
  |  Branch (480:7): [True: 0, False: 523]
  ------------------
  481|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  482|      0|  }
  483|    523|  IoCloser closer(*io_);
  484|    523|  MemIo tempIo;
  485|       |
  486|    523|  doWriteMetadata(tempIo);  // may throw
  487|    523|  io_->close();
  488|    523|  io_->transfer(tempIo);  // may throw
  489|       |
  490|    523|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  492|    523|void PngImage::doWriteMetadata(BasicIo& outIo) {
  493|    523|  if (!io_->isopen())
  ------------------
  |  Branch (493:7): [True: 0, False: 523]
  ------------------
  494|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  495|    523|  if (!outIo.isopen())
  ------------------
  |  Branch (495:7): [True: 0, False: 523]
  ------------------
  496|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  497|       |
  498|       |#ifdef EXIV2_DEBUG_MESSAGES
  499|       |  std::cout << "Exiv2::PngImage::doWriteMetadata: Writing PNG file " << io_->path() << "\n";
  500|       |  std::cout << "Exiv2::PngImage::doWriteMetadata: tmp file created " << outIo.path() << "\n";
  501|       |#endif
  502|       |
  503|    523|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (503:7): [True: 0, False: 523]
  ------------------
  504|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  505|      0|  }
  506|       |
  507|       |  // Write PNG Signature.
  508|    523|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (508:7): [True: 0, False: 523]
  ------------------
  509|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  510|       |
  511|    523|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  512|       |
  513|  15.4k|  while (!io_->eof()) {
  ------------------
  |  Branch (513:10): [True: 15.4k, False: 5]
  ------------------
  514|       |    // Read chunk header.
  515|  15.4k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  516|  15.4k|    if (io_->error())
  ------------------
  |  Branch (516:9): [True: 0, False: 15.4k]
  ------------------
  517|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  518|  15.4k|    if (bufRead != 8)
  ------------------
  |  Branch (518:9): [True: 0, False: 15.4k]
  ------------------
  519|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  520|       |
  521|       |    // Decode chunk data length.
  522|       |
  523|  15.4k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  524|  15.4k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (524:9): [True: 0, False: 15.4k]
  ------------------
  525|      0|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  526|       |
  527|       |    // Read whole chunk : Chunk header + Chunk data (not fixed size - can be null) + CRC (4 bytes).
  528|       |
  529|  15.4k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  530|  15.4k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  531|  15.4k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  532|  15.4k|    if (io_->error())
  ------------------
  |  Branch (532:9): [True: 0, False: 15.4k]
  ------------------
  533|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  534|  15.4k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (534:9): [True: 78, False: 15.3k]
  ------------------
  535|     78|      throw Error(ErrorCode::kerInputDataReadFailed);
  536|       |
  537|  15.3k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  538|       |
  539|  15.3k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (539:9): [True: 440, False: 14.8k]
  ------------------
  540|       |      // Last chunk found: we write it and done.
  541|       |#ifdef EXIV2_DEBUG_MESSAGES
  542|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IEND chunk (length: " << dataOffset << ")\n";
  543|       |#endif
  544|    440|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (544:11): [True: 0, False: 440]
  ------------------
  545|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  546|    440|      return;
  547|    440|    }
  548|  14.8k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (548:9): [True: 80, False: 14.8k]
  |  Branch (548:30): [True: 143, False: 14.6k]
  ------------------
  549|       |      // do nothing (strip): Exif metadata is written following IHDR
  550|       |      // together with the ICC profile as fresh eXIf and iCCP chunks
  551|       |#ifdef EXIV2_DEBUG_MESSAGES
  552|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  553|       |                << '\n';
  554|       |#endif
  555|  14.6k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (555:16): [True: 2.71k, False: 11.9k]
  ------------------
  556|       |#ifdef EXIV2_DEBUG_MESSAGES
  557|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  558|       |#endif
  559|  2.71k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (559:11): [True: 0, False: 2.71k]
  ------------------
  560|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  561|       |
  562|       |      // Write all updated metadata here, just after IHDR.
  563|  2.71k|      if (!comment_.empty()) {
  ------------------
  |  Branch (563:11): [True: 1.08k, False: 1.62k]
  ------------------
  564|       |        // Update Comment data to a new PNG chunk
  565|  1.08k|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  566|  1.08k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (566:13): [True: 0, False: 1.08k]
  ------------------
  567|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  568|      0|        }
  569|  1.08k|      }
  570|       |
  571|  2.71k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (571:11): [True: 154, False: 2.56k]
  ------------------
  572|       |        // Update Exif data to a new PNG chunk
  573|    154|        Blob blob;
  574|    154|        ExifParser::encode(blob, littleEndian, exifData_);
  575|    154|        if (!blob.empty()) {
  ------------------
  |  Branch (575:13): [True: 142, False: 12]
  ------------------
  576|    142|          byte length[4];
  577|    142|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  578|       |
  579|       |          // calculate CRC
  580|    142|          uLong tmp = crc32(0L, Z_NULL, 0);
  581|    142|          tmp = crc32(tmp, typeExif, 4);
  582|    142|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  583|    142|          byte crc[4];
  584|    142|          ul2Data(crc, tmp, bigEndian);
  585|       |
  586|    142|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (586:15): [True: 0, False: 142]
  |  Branch (586:46): [True: 0, False: 142]
  ------------------
  587|    142|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (587:15): [True: 0, False: 142]
  |  Branch (587:71): [True: 0, False: 142]
  ------------------
  588|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  589|      0|          }
  590|       |#ifdef EXIV2_DEBUG_MESSAGES
  591|       |          std::cout << "Exiv2::PngImage::doWriteMetadata: build eXIf"
  592|       |                    << " chunk (length: " << blob.size() << ")" << '\n';
  593|       |#endif
  594|    142|        }
  595|    154|      }
  596|       |
  597|  2.71k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (597:11): [True: 72, False: 2.64k]
  ------------------
  598|       |        // Update IPTC data to a new PNG chunk
  599|     72|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  600|     72|        if (!newPsData.empty()) {
  ------------------
  |  Branch (600:13): [True: 72, False: 0]
  ------------------
  601|     72|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  602|     72|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  603|     72|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (603:15): [True: 0, False: 72]
  ------------------
  604|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  605|      0|          }
  606|     72|        }
  607|     72|      }
  608|       |
  609|  2.71k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (609:11): [True: 254, False: 2.46k]
  ------------------
  610|    254|        DataBuf compressed;
  611|    254|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  612|    254|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (612:13): [True: 254, False: 0]
  ------------------
  613|    254|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  614|    254|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  615|    254|          byte length[4];
  616|    254|          ul2Data(length, chunkLength, bigEndian);
  617|       |
  618|       |          // calculate CRC
  619|    254|          uLong tmp = crc32(0L, Z_NULL, 0);
  620|    254|          tmp = crc32(tmp, typeICCP, 4);
  621|    254|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  622|    254|          tmp = crc32(tmp, nullComp, 2);
  623|    254|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  624|    254|          byte crc[4];
  625|    254|          ul2Data(crc, tmp, bigEndian);
  626|       |
  627|    254|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (627:15): [True: 0, False: 254]
  |  Branch (627:46): [True: 0, False: 254]
  ------------------
  628|    254|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (628:15): [True: 0, False: 254]
  ------------------
  629|    254|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (629:15): [True: 0, False: 254]
  ------------------
  630|    254|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (630:15): [True: 0, False: 254]
  |  Branch (630:91): [True: 0, False: 254]
  ------------------
  631|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  632|      0|          }
  633|       |#ifdef EXIV2_DEBUG_MESSAGES
  634|       |          std::cout << "Exiv2::PngImage::doWriteMetadata: build iCCP"
  635|       |                    << " chunk (length: " << chunkLength << ")" << '\n';
  636|       |#endif
  637|    254|        }
  638|    254|      }
  639|       |
  640|  2.71k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (640:11): [True: 2.71k, False: 5]
  |  Branch (640:36): [True: 36, False: 2.67k]
  ------------------
  641|     36|#ifndef SUPPRESS_WARNINGS
  642|     36|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     36|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 36]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     36|  LogMsg(LogMsg::error).os()
  ------------------
  643|     36|#endif
  644|     36|      }
  645|  2.71k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (645:11): [True: 1.74k, False: 973]
  ------------------
  646|       |        // Update XMP data to a new PNG chunk
  647|  1.74k|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  648|  1.74k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (648:13): [True: 0, False: 1.74k]
  ------------------
  649|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  650|      0|        }
  651|  1.74k|      }
  652|  11.9k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (652:16): [True: 316, False: 11.6k]
  |  Branch (652:37): [True: 30, False: 11.5k]
  |  Branch (652:58): [True: 2.45k, False: 9.14k]
  ------------------
  653|  2.80k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  654|  2.80k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (654:11): [True: 2.62k, False: 179]
  |  Branch (654:28): [True: 17, False: 2.60k]
  |  Branch (654:69): [True: 58, False: 2.54k]
  ------------------
  655|  2.54k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (655:28): [True: 39, False: 2.51k]
  |  Branch (655:69): [True: 43, False: 2.46k]
  ------------------
  656|  2.46k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (656:28): [True: 173, False: 2.29k]
  |  Branch (656:65): [True: 1.68k, False: 608]
  ------------------
  657|       |#ifdef EXIV2_DEBUG_MESSAGES
  658|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  659|       |                  << '\n';
  660|       |#endif
  661|  2.01k|      } else {
  662|       |#ifdef EXIV2_DEBUG_MESSAGES
  663|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  664|       |                  << '\n';
  665|       |#endif
  666|    787|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (666:13): [True: 0, False: 787]
  ------------------
  667|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  668|    787|      }
  669|  9.14k|    } else {
  670|       |      // Write all others chunk as well.
  671|       |#ifdef EXIV2_DEBUG_MESSAGES
  672|       |      std::cout << "Exiv2::PngImage::doWriteMetadata:  copy " << szChunk << " chunk (length: " << dataOffset << ")"
  673|       |                << '\n';
  674|       |#endif
  675|  9.14k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (675:11): [True: 0, False: 9.14k]
  ------------------
  676|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  677|  9.14k|    }
  678|  14.8k|  }
  679|       |
  680|    523|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  684|  1.40k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, bool create) {
  685|  1.40k|  auto image = std::make_unique<PngImage>(std::move(io), create);
  686|  1.40k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.40k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.40k|  return image;
  690|  1.40k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  22.8k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  22.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 22.8k]
  |  Branch (693:22): [True: 202, False: 22.6k]
  ------------------
  694|    202|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    202|  }
  696|  22.6k|  const int32_t len = 8;
  697|  22.6k|  std::array<byte, len> buf;
  698|  22.6k|  iIo.read(buf.data(), len);
  699|  22.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 22.6k]
  |  Branch (699:22): [True: 0, False: 22.6k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  22.6k|  bool rc = buf == pngSignature;
  703|  22.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 21.0k, False: 1.61k]
  |  Branch (703:19): [True: 0, False: 1.61k]
  ------------------
  704|  21.0k|    iIo.seek(-len, BasicIo::cur);
  705|  21.0k|  }
  706|       |
  707|  22.6k|  return rc;
  708|  22.6k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    476|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    476|  uLongf uncompressedLen = length;  // just a starting point
   76|    476|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.15k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 682, False: 476]
  ------------------
   79|    682|    result.alloc(uncompressedLen);
   80|    682|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    682|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 13, False: 669]
  |  Branch (82:31): [True: 12, False: 1]
  ------------------
   83|     12|      result.reset();
   84|       |
   85|     12|      result.alloc(uncompressedLen);
   86|     12|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|     12|    }
   88|    682|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 206, False: 476]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    206|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    206|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 206]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    206|      else
   96|    206|        uncompressedLen *= 2;
   97|    206|    }
   98|    682|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    476|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  38.6k|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|  38.6k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  38.6k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 38.6k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  38.6k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 86, False: 38.5k]
  ------------------
  388|     86|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     86|  }
  390|  38.6k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    254|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    254|  uLongf compressedLen = length;  // just a starting point
  105|    254|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|    883|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 629, False: 254]
  ------------------
  108|    629|    result.alloc(compressedLen);
  109|    629|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    629|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 375, False: 254]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|    375|      result.reset();
  113|    375|      compressedLen *= 2;
  114|    375|    } else {
  115|    254|      result.reset();
  116|    254|      result.alloc(compressedLen);
  117|    254|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    254|    }
  119|    629|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    254|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  15.0k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  15.0k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  15.0k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  15.0k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  953|  1.02k|    properties_(std::move(properties)), preview_(std::move(data)) {
  954|  1.02k|}
_ZNK5Exiv212PreviewImage5pDataEv:
  980|  1.02k|const byte* PreviewImage::pData() const {
  981|  1.02k|  return preview_.c_data();
  982|  1.02k|}
_ZNK5Exiv212PreviewImage4sizeEv:
  984|  1.02k|uint32_t PreviewImage::size() const {
  985|  1.02k|  return static_cast<uint32_t>(preview_.size());
  986|  1.02k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1008|  4.86k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1009|  4.86k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1011|  4.86k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1012|  4.86k|  PreviewPropertiesList list;
 1013|       |  // go through the loader table and store all successfully created loaders in the list
 1014|   169k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1014:26): [True: 164k, False: 4.86k]
  ------------------
 1015|   164k|    auto loader = Loader::create(id, image_);
 1016|   164k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1016:9): [True: 9.87k, False: 154k]
  |  Branch (1016:19): [True: 5.39k, False: 4.47k]
  ------------------
 1017|  5.39k|      PreviewProperties props = loader->getProperties();
 1018|  5.39k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1019|  5.39k|      props.size_ = buf.size();         //     update the size
 1020|  5.39k|      list.push_back(std::move(props));
 1021|  5.39k|    }
 1022|   164k|  }
 1023|  4.86k|  std::sort(list.begin(), list.end(),
 1024|  4.86k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1025|       |
 1026|  4.86k|  return list;
 1027|  4.86k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1029|  1.02k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1030|  1.02k|  auto loader = Loader::create(properties.id_, image_);
 1031|  1.02k|  DataBuf buf;
 1032|  1.02k|  if (loader) {
  ------------------
  |  Branch (1032:7): [True: 1.02k, False: 0]
  ------------------
 1033|  1.02k|    buf = loader->getData();
 1034|  1.02k|  }
 1035|       |
 1036|  1.02k|  return {properties, std::move(buf)};
 1037|  1.02k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  341|   335k|PreviewId Loader::getNumLoaders() {
  342|   335k|  return PreviewId{std::size(loaderList_)};
  343|   335k|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  359|  19.4k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  360|  19.4k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  361|  19.4k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  345|  19.4k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  346|  19.4k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (346:7): [True: 0, False: 19.4k]
  |  Branch (346:21): [True: 19.4k, False: 0]
  ------------------
  347|  19.4k|    return;
  348|      0|  nativePreview_ = image.nativePreviews()[parIdx];
  349|      0|  width_ = nativePreview_.width_;
  350|      0|  height_ = nativePreview_.height_;
  351|      0|  valid_ = true;
  352|      0|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (352:7): [True: 0, False: 0]
  ------------------
  353|      0|    size_ = nativePreview_.size_;
  354|      0|  } else {
  355|      0|    size_ = getData().size();
  356|      0|  }
  357|      0|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  334|   156k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  335|   156k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  337|  5.39k|PreviewProperties Loader::getProperties() const {
  338|  5.39k|  return {"", "", size_, width_, height_, id_};
  339|  5.39k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   68|  1.47k|  virtual bool readDimensions() {
   69|  1.47k|    return true;
   70|  1.47k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   45|   156k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   57|   169k|  [[nodiscard]] virtual bool valid() const {
   58|   169k|    return valid_;
   59|   169k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  552|  58.4k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  553|  58.4k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  554|  58.4k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  539|  58.4k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  540|  58.4k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (540:55): [True: 85, False: 58.3k]
  ------------------
  541|     85|    size_ = pos->sizeDataArea();  // indirect data
  542|     85|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (542:9): [True: 85, False: 0]
  |  Branch (542:23): [True: 58, False: 27]
  ------------------
  543|     58|      size_ = pos->size();  // direct data
  544|     85|  }
  545|       |
  546|  58.4k|  if (size_ == 0)
  ------------------
  |  Branch (546:7): [True: 58.3k, False: 57]
  ------------------
  547|  58.3k|    return;
  548|       |
  549|     57|  valid_ = true;
  550|     57|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  556|     16|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  557|     16|  PreviewProperties prop = Loader::getProperties();
  558|     16|  prop.mimeType_ = "image/jpeg";
  559|     16|  prop.extension_ = ".jpg";
  560|     16|  return prop;
  561|     16|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  563|     73|DataBuf LoaderExifDataJpeg::getData() const {
  564|     73|  DataBuf buf;
  565|       |
  566|     73|  if (!valid())
  ------------------
  |  Branch (566:7): [True: 0, False: 73]
  ------------------
  567|      0|    return buf;
  568|       |
  569|     73|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (569:55): [True: 73, False: 0]
  ------------------
  570|     73|    buf = pos->dataArea();  // indirect data
  571|       |
  572|     73|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (572:9): [True: 73, False: 0]
  ------------------
  573|     73|      buf = DataBuf(pos->size());
  574|     73|      pos->copy(buf.data(), invalidByteOrder);
  575|     73|    }
  576|       |
  577|     73|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  578|     73|    return buf;
  579|     73|  }
  580|       |
  581|      0|  return buf;
  582|     73|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  584|     45|bool LoaderExifDataJpeg::readDimensions() {
  585|     45|  if (!valid())
  ------------------
  |  Branch (585:7): [True: 0, False: 45]
  ------------------
  586|      0|    return false;
  587|       |
  588|     45|  DataBuf buf = getData();
  589|     45|  if (buf.empty())
  ------------------
  |  Branch (589:7): [True: 0, False: 45]
  ------------------
  590|      0|    return false;
  591|       |
  592|     45|  try {
  593|     45|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  594|     45|    if (!image)
  ------------------
  |  Branch (594:9): [True: 0, False: 45]
  ------------------
  595|      0|      return false;
  596|     45|    image->readMetadata();
  597|       |
  598|     45|    width_ = image->pixelWidth();
  599|     45|    height_ = image->pixelHeight();
  600|     45|  } catch (const Error& /* error */) {
  601|     28|    return false;
  602|     28|  }
  603|       |
  604|     16|  return true;
  605|     45|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  665|  33.9k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  666|  33.9k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  667|  33.9k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  608|  33.9k|    Loader(id, image), group_(param_[parIdx].group_) {
  609|  33.9k|  const ExifData& exifData = image_.exifData();
  610|       |
  611|  33.9k|  size_t offsetCount = 0;
  612|  33.9k|  ExifData::const_iterator pos;
  613|       |
  614|       |  // check if the group_ contains a preview image
  615|  33.9k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (615:7): [True: 29.1k, False: 4.81k]
  ------------------
  616|  29.1k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  617|  29.1k|    if (pos == exifData.end())
  ------------------
  |  Branch (617:9): [True: 26.6k, False: 2.55k]
  ------------------
  618|  26.6k|      return;
  619|  2.55k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (619:9): [True: 2.55k, False: 0]
  |  Branch (619:9): [True: 305, False: 2.24k]
  |  Branch (619:39): [True: 305, False: 2.24k]
  ------------------
  620|    305|      return;
  621|  2.55k|  }
  622|       |
  623|  7.06k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  624|  7.06k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (624:7): [True: 2.07k, False: 4.98k]
  ------------------
  625|  2.07k|    offsetTag_ = "StripOffsets";
  626|  2.07k|    sizeTag_ = "StripByteCounts";
  627|  2.07k|    offsetCount = pos->value().count();
  628|  4.98k|  } else {
  629|  4.98k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  630|  4.98k|    if (pos == exifData.end())
  ------------------
  |  Branch (630:9): [True: 4.89k, False: 89]
  ------------------
  631|  4.89k|      return;
  632|     89|    offsetTag_ = "TileOffsets";
  633|     89|    sizeTag_ = "TileByteCounts";
  634|     89|    offsetCount = pos->value().count();
  635|     89|  }
  636|       |
  637|  2.16k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  638|  2.16k|  if (pos == exifData.end())
  ------------------
  |  Branch (638:7): [True: 85, False: 2.08k]
  ------------------
  639|     85|    return;
  640|  2.08k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (640:7): [True: 42, False: 2.04k]
  ------------------
  641|     42|    return;
  642|  15.2k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (642:22): [True: 13.1k, False: 2.04k]
  ------------------
  643|  13.1k|    size_ += pos->toUint32(i);
  644|  13.1k|  }
  645|       |
  646|  2.04k|  if (size_ == 0)
  ------------------
  |  Branch (646:7): [True: 92, False: 1.94k]
  ------------------
  647|     92|    return;
  648|       |
  649|  1.94k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  650|  1.94k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (650:7): [True: 1.90k, False: 48]
  |  Branch (650:7): [True: 1.73k, False: 216]
  |  Branch (650:32): [True: 1.73k, False: 168]
  ------------------
  651|  1.73k|    width_ = pos->toUint32();
  652|  1.73k|  }
  653|       |
  654|  1.94k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  655|  1.94k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (655:7): [True: 1.83k, False: 114]
  |  Branch (655:7): [True: 1.74k, False: 201]
  |  Branch (655:32): [True: 1.74k, False: 87]
  ------------------
  656|  1.74k|    height_ = pos->toUint32();
  657|  1.74k|  }
  658|       |
  659|  1.94k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (659:7): [True: 229, False: 1.71k]
  |  Branch (659:22): [True: 121, False: 1.59k]
  ------------------
  660|    350|    return;
  661|       |
  662|  1.59k|  valid_ = true;
  663|  1.59k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  669|  1.47k|PreviewProperties LoaderTiff::getProperties() const {
  670|  1.47k|  PreviewProperties prop = Loader::getProperties();
  671|  1.47k|  prop.mimeType_ = "image/tiff";
  672|  1.47k|  prop.extension_ = ".tif";
  673|  1.47k|  return prop;
  674|  1.47k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  676|  1.59k|DataBuf LoaderTiff::getData() const {
  677|  1.59k|  const ExifData& exifData = image_.exifData();
  678|       |
  679|  1.59k|  ExifData preview;
  680|       |
  681|       |  // copy tags
  682|   292k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (682:19): [True: 292k, False: 1.59k]
  ------------------
  683|   292k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (683:9): [True: 69.6k, False: 222k]
  ------------------
  684|       |      /*
  685|       |         Write only the necessary TIFF image tags
  686|       |         tags that especially could cause problems are:
  687|       |         "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
  688|       |         "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
  689|       |                         consistent result for all previews, including JPEG
  690|       |      */
  691|  69.6k|      uint16_t tag = pos.tag();
  692|  69.6k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (692:11): [True: 67.6k, False: 1.97k]
  |  Branch (692:28): [True: 67.1k, False: 536]
  |  Branch (692:45): [True: 28.7k, False: 38.3k]
  ------------------
  693|  28.7k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  694|  28.7k|      }
  695|  69.6k|    }
  696|   292k|  }
  697|       |
  698|  1.59k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  699|       |
  700|  1.59k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (700:7): [True: 1.59k, False: 0]
  ------------------
  701|       |    // image data are not available via exifData, read them from image_.io()
  702|  1.59k|    BasicIo& io = image_.io();
  703|       |
  704|  1.59k|    if (io.open() != 0) {
  ------------------
  |  Branch (704:9): [True: 0, False: 1.59k]
  ------------------
  705|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  706|      0|    }
  707|  1.59k|    IoCloser closer(io);
  708|       |
  709|  1.59k|    const Exiv2::byte* base = io.mmap();
  710|       |
  711|  1.59k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  712|       |
  713|  1.59k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (713:9): [True: 1.59k, False: 0]
  ------------------
  714|  1.59k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (714:11): [True: 1.40k, False: 196]
  ------------------
  715|       |        // this saves one copying of the buffer
  716|  1.40k|        uint32_t offset = dataValue.toUint32(0);
  717|  1.40k|        uint32_t size = sizes.toUint32(0);
  718|  1.40k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (718:13): [True: 296, False: 1.10k]
  ------------------
  719|    296|          dataValue.setDataArea(base + offset, size);
  720|  1.40k|      } else {
  721|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  722|    196|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  723|    196|        DataBuf buf(size_);
  724|    196|        uint32_t idxBuf = 0;
  725|  5.52k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (725:28): [True: 5.32k, False: 196]
  ------------------
  726|  5.32k|          uint32_t offset = dataValue.toUint32(i);
  727|  5.32k|          uint32_t size = sizes.toUint32(i);
  728|       |
  729|       |          // the size_ parameter is originally computed by summing all values inside sizes
  730|       |          // see the constructor of LoaderTiff
  731|       |          // But e.g in malicious files some of these values could be negative
  732|       |          // That's why we check again for each step here to really make sure we don't overstep
  733|  5.32k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  734|  5.32k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (734:15): [True: 2.73k, False: 2.59k]
  |  Branch (734:28): [True: 1.58k, False: 1.15k]
  ------------------
  735|  1.58k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  736|  1.58k|          }
  737|       |
  738|  5.32k|          idxBuf += size;
  739|  5.32k|        }
  740|    196|        dataValue.setDataArea(buf.c_data(), buf.size());
  741|    196|      }
  742|  1.59k|    }
  743|  1.59k|  }
  744|       |
  745|       |  // Fix compression value in the CR2 IFD2 image
  746|  1.59k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (746:7): [True: 0, False: 1.59k]
  |  Branch (746:7): [True: 0, False: 1.59k]
  |  Branch (746:40): [True: 0, False: 0]
  ------------------
  747|      0|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  748|      0|  }
  749|       |
  750|       |  // write new image
  751|  1.59k|  MemIo mio;
  752|  1.59k|  IptcData emptyIptc;
  753|  1.59k|  XmpData emptyXmp;
  754|  1.59k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  755|  1.59k|  return {mio.mmap(), mio.size()};
  756|  1.59k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  480|  39.3k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  481|  39.3k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  482|  39.3k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  451|  39.3k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  452|  39.3k|  const ExifData& exifData = image_.exifData();
  453|  39.3k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  454|  39.3k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (454:7): [True: 10.2k, False: 29.0k]
  |  Branch (454:7): [True: 9.73k, False: 29.6k]
  |  Branch (454:32): [True: 9.73k, False: 550]
  ------------------
  455|  9.73k|    offset_ = pos->toUint32();
  456|  9.73k|  }
  457|       |
  458|  39.3k|  size_ = 0;
  459|  39.3k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  460|  39.3k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (460:7): [True: 10.4k, False: 28.9k]
  |  Branch (460:7): [True: 9.64k, False: 29.7k]
  |  Branch (460:32): [True: 9.64k, False: 760]
  ------------------
  461|  9.64k|    size_ = pos->toUint32();
  462|  9.64k|  }
  463|       |
  464|  39.3k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (464:7): [True: 29.7k, False: 9.63k]
  |  Branch (464:23): [True: 251, False: 9.38k]
  ------------------
  465|  29.9k|    return;
  466|       |
  467|  9.38k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (467:7): [True: 0, False: 9.38k]
  ------------------
  468|      0|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  469|      0|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 0]
  |  Branch (469:9): [True: 0, False: 0]
  |  Branch (469:34): [True: 0, False: 0]
  ------------------
  470|      0|      offset_ += pos->toUint32();
  471|      0|    }
  472|      0|  }
  473|       |
  474|  9.38k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (474:7): [True: 145, False: 9.24k]
  ------------------
  475|    145|    return;
  476|       |
  477|  9.24k|  valid_ = true;
  478|  9.24k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  484|  3.91k|PreviewProperties LoaderExifJpeg::getProperties() const {
  485|  3.91k|  PreviewProperties prop = Loader::getProperties();
  486|  3.91k|  prop.mimeType_ = "image/jpeg";
  487|  3.91k|  prop.extension_ = ".jpg";
  488|  3.91k|  return prop;
  489|  3.91k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  491|  4.79k|DataBuf LoaderExifJpeg::getData() const {
  492|  4.79k|  if (!valid())
  ------------------
  |  Branch (492:7): [True: 0, False: 4.79k]
  ------------------
  493|      0|    return {};
  494|  4.79k|  BasicIo& io = image_.io();
  495|       |
  496|  4.79k|  if (io.open() != 0) {
  ------------------
  |  Branch (496:7): [True: 0, False: 4.79k]
  ------------------
  497|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  498|      0|  }
  499|  4.79k|  IoCloser closer(io);
  500|       |
  501|  4.79k|  const Exiv2::byte* base = io.mmap();
  502|       |
  503|  4.79k|  return {base + offset_, size_};
  504|  4.79k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  506|  8.35k|bool LoaderExifJpeg::readDimensions() {
  507|  8.35k|  if (!valid())
  ------------------
  |  Branch (507:7): [True: 0, False: 8.35k]
  ------------------
  508|      0|    return false;
  509|  8.35k|  if (width_ || height_)
  ------------------
  |  Branch (509:7): [True: 0, False: 8.35k]
  |  Branch (509:17): [True: 0, False: 8.35k]
  ------------------
  510|      0|    return true;
  511|       |
  512|  8.35k|  BasicIo& io = image_.io();
  513|       |
  514|  8.35k|  if (io.open() != 0) {
  ------------------
  |  Branch (514:7): [True: 0, False: 8.35k]
  ------------------
  515|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  516|      0|  }
  517|  8.35k|  IoCloser closer(io);
  518|  8.35k|  const Exiv2::byte* base = io.mmap();
  519|       |
  520|  8.35k|  try {
  521|  8.35k|    auto image = ImageFactory::open(base + offset_, size_);
  522|  8.35k|    if (!image)
  ------------------
  |  Branch (522:9): [True: 0, False: 8.35k]
  ------------------
  523|      0|      return false;
  524|  8.35k|    image->readMetadata();
  525|       |
  526|  8.35k|    width_ = image->pixelWidth();
  527|  8.35k|    height_ = image->pixelHeight();
  528|  8.35k|  } catch (const Error& /* error */) {
  529|  4.44k|#ifndef SUPPRESS_WARNINGS
  530|  4.44k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  4.44k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.44k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.44k|  LogMsg(LogMsg::warn).os()
  ------------------
  531|  4.44k|#endif
  532|  4.44k|    return false;
  533|  4.44k|  }
  534|       |
  535|  3.91k|  return true;
  536|  8.35k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  791|  4.81k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  792|  4.81k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  793|  4.81k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  758|  4.81k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  759|  4.81k|  (void)parIdx;
  760|       |
  761|  4.81k|  const XmpData& xmpData = image_.xmpData();
  762|       |
  763|  4.81k|  std::string prefix = "xmpGImg";
  764|  4.81k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (764:7): [True: 0, False: 4.81k]
  ------------------
  765|      0|    prefix = "xapGImg";
  766|      0|  }
  767|       |
  768|  4.81k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  769|  4.81k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (769:7): [True: 4.81k, False: 0]
  ------------------
  770|  4.81k|    return;
  771|      0|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  772|      0|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (772:7): [True: 0, False: 0]
  ------------------
  773|      0|    return;
  774|      0|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  775|      0|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (775:7): [True: 0, False: 0]
  ------------------
  776|      0|    return;
  777|      0|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  778|      0|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (778:7): [True: 0, False: 0]
  ------------------
  779|      0|    return;
  780|       |
  781|      0|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (781:7): [True: 0, False: 0]
  ------------------
  782|      0|    return;
  783|       |
  784|      0|  width_ = widthDatum->toUint32();
  785|      0|  height_ = heightDatum->toUint32();
  786|      0|  preview_ = decodeBase64(imageDatum->toString());
  787|      0|  size_ = preview_.size();
  788|      0|  valid_ = true;
  789|      0|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  319|   165k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  320|   165k|  Loader::UniquePtr loader;
  321|   165k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (321:7): [True: 0, False: 165k]
  |  Branch (321:17): [True: 0, False: 165k]
  ------------------
  322|      0|    return loader;
  323|       |
  324|   165k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (324:7): [True: 14.5k, False: 151k]
  |  Branch (324:7): [True: 9.62k, False: 156k]
  |  Branch (324:41): [True: 9.62k, False: 4.88k]
  ------------------
  325|  9.62k|    return loader;
  326|       |
  327|   156k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  328|   156k|  if (!loader->valid())
  ------------------
  |  Branch (328:7): [True: 145k, False: 10.8k]
  ------------------
  329|   145k|    loader = nullptr;
  330|       |
  331|   156k|  return loader;
  332|   165k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1024|  4.13k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|   685k|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|   685k|  return ns_ == ns.ns_;
 4941|   685k|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  78.1M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  78.1M|  return prefix_ == prefix.prefix_;
 4945|  78.1M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.29M|std::mutex& XmpProperties::getMutex() {
 4953|  2.29M|  static std::mutex m;
 4954|  2.29M|  return m;
 4955|  2.29M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.35M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  48.0M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 48.0M, False: 2.03M]
  ------------------
 4965|  48.0M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 317k, False: 47.7M]
  ------------------
 4966|   317k|      return &p;
 4967|  48.0M|  }
 4968|  2.03M|  return nullptr;
 4969|  2.35M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|  5.86k|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|  5.86k|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 5.86k]
  ------------------
 4978|      0|    return;
 4979|  5.86k|  std::string ns2 = ns;
 4980|  5.86k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 4.48k, False: 1.38k]
  |  Branch (4980:28): [True: 3.48k, False: 997]
  ------------------
 4981|  3.48k|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|  5.86k|  auto it = nsRegistry_.find(ns2);
 4985|  5.86k|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 5.86k]
  |  Branch (4985:7): [True: 0, False: 5.86k]
  |  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|  5.86k|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 5.84k, False: 26]
  ------------------
 4991|  5.84k|#ifndef SUPPRESS_WARNINGS
 4992|  5.84k|    if (ns2 != xnp->ns_)
  ------------------
  |  Branch (4992:9): [True: 5.84k, False: 0]
  ------------------
 4993|  5.84k|      EXV_WARNING << "Updating namespace URI for " << prefix << " from " << xnp->ns_ << " to " << ns2 << "\n";
  ------------------
  |  |  138|  5.84k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.84k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.84k|  LogMsg(LogMsg::warn).os()
  ------------------
 4994|  5.84k|#endif
 4995|  5.84k|    unregisterNsUnlocked(xnp->ns_, lock);
 4996|  5.84k|  }
 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|  5.86k|  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|  5.86k|  XmpNsInfo xn;
 5005|  5.86k|  auto c = new char[ns2.size() + 1];
 5006|  5.86k|  std::strcpy(c, ns2.c_str());
 5007|  5.86k|  xn.ns_ = c;
 5008|  5.86k|  c = new char[prefix.size() + 1];
 5009|  5.86k|  std::strcpy(c, prefix.c_str());
 5010|  5.86k|  xn.prefix_ = c;
 5011|  5.86k|  xn.xmpPropertyInfo_ = nullptr;
 5012|  5.86k|  xn.desc_ = "";
 5013|  5.86k|  nsRegistry_[ns2] = xn;
 5014|  5.86k|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|  11.7k|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|  11.7k|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|  11.7k|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|  11.7k|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|  11.7k|  auto i = nsRegistry_.find(ns);
 5027|  11.7k|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 5.86k, False: 5.86k]
  ------------------
 5028|  5.86k|    delete[] i->second.prefix_;
 5029|  5.86k|    delete[] i->second.ns_;
 5030|  5.86k|    nsRegistry_.erase(i);
 5031|  5.86k|  }
 5032|  11.7k|}
_ZN5Exiv213XmpProperties21unregisterAllNsNoLockENS0_11LifetimeKeyE:
 5042|      1|void XmpProperties::unregisterAllNsNoLock(LifetimeKey) {
 5043|       |  /// \todo check if we are not unregistering the first NS
 5044|      1|  auto i = nsRegistry_.begin();
 5045|     27|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 26, False: 1]
  ------------------
 5046|     26|    auto kill = i++;
 5047|     26|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     26|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   110k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   110k|  std::string ns2 = ns;
 5058|   110k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 26.2k, False: 84.0k]
  |  Branch (5058:28): [True: 18.9k, False: 7.30k]
  ------------------
 5059|  18.9k|    ns2 += '/';
 5060|       |
 5061|   110k|  auto i = nsRegistry_.find(ns2);
 5062|   110k|  std::string p;
 5063|   110k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 46.6k, False: 63.6k]
  ------------------
 5064|  46.6k|    p = i->second.prefix_;
 5065|  63.6k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 57.8k, False: 5.86k]
  ------------------
 5066|  57.8k|    p = std::string(xn->prefix_);
 5067|   110k|  return p;
 5068|   110k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.31M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.31M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 311k, False: 1.00M]
  ------------------
 5077|   311k|    return xn->ns_;
 5078|  1.00M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.31M|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5106|  38.9k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5107|  38.9k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5108|  38.9k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5108:10): [True: 36.9k, False: 2.05k]
  ------------------
 5109|  38.9k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5116|  38.9k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5117|  38.9k|  std::string prefix = key.groupName();
 5118|  38.9k|  std::string property = key.tagName();
 5119|       |  // If property is a path for a nested property, determines the innermost element
 5120|  38.9k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5120:44): [True: 0, False: 38.9k]
  ------------------
 5121|      0|    i = std::distance(property.begin(), std::find_if(property.begin() + i, property.end(), isalpha));
 5122|      0|    property = property.substr(i);
 5123|      0|    i = property.find_first_of(':');
 5124|      0|    if (i != std::string::npos) {
  ------------------
  |  Branch (5124:9): [True: 0, False: 0]
  ------------------
 5125|      0|      prefix = property.substr(0, i);
 5126|      0|      property = property.substr(i + 1);
 5127|      0|    }
 5128|       |#ifdef EXIV2_DEBUG_MESSAGES
 5129|       |    std::cout << "Nested key: " << key.key() << ", prefix: " << prefix << ", property: " << property << "\n";
 5130|       |#endif
 5131|      0|  }
 5132|  38.9k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5132:12): [True: 38.1k, False: 865]
  ------------------
 5133|  4.99M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5133:24): [True: 4.99M, False: 1.18k]
  ------------------
 5134|  4.99M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5134:11): [True: 36.9k, False: 4.95M]
  ------------------
 5135|  36.9k|        return pl + j;
 5136|  36.9k|      }
 5137|  4.99M|    }
 5138|  38.1k|  }
 5139|  2.05k|  return nullptr;
 5140|  38.9k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5157|  38.9k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5158|  38.9k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5159|  38.9k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5166|  1.03M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5167|  1.03M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5168|  1.03M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5169|  1.03M|  if (!xn)
  ------------------
  |  Branch (5169:7): [True: 1.03M, False: 865]
  ------------------
 5170|  1.03M|    xn = Exiv2::find(xmpNsInfo, pf);
 5171|  1.03M|  if (!xn)
  ------------------
  |  Branch (5171:7): [True: 24, False: 1.03M]
  ------------------
 5172|     24|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5173|  1.03M|  return xn;
 5174|  1.03M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5245|  98.3k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5246|       |  // Validate prefix unlocked (must hold lock)
 5247|  98.3k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5247:7): [True: 0, False: 98.3k]
  ------------------
 5248|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5249|       |
 5250|  98.3k|  property_ = property;
 5251|  98.3k|  prefix_ = prefix;
 5252|  98.3k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5254|   260k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5255|   260k|  p_->decomposeKey(key);
 5256|   260k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5258|   861k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5259|   861k|  p_->decomposeKeyUnlocked(key, lock);
 5260|   861k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5266|  98.3k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5267|  98.3k|}
_ZN5Exiv26XmpKeyD2Ev:
 5269|  1.55M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5271|   335k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5272|   335k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5281|   335k|XmpKey::UniquePtr XmpKey::clone() const {
 5282|   335k|  return UniquePtr(clone_());
 5283|   335k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5285|   335k|XmpKey* XmpKey::clone_() const {
 5286|   335k|  return new XmpKey(*this);
 5287|   335k|}
_ZNK5Exiv26XmpKey3keyEv:
 5289|  16.7M|std::string XmpKey::key() const {
 5290|  16.7M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5291|  16.7M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5297|   130k|std::string XmpKey::groupName() const {
 5298|   130k|  return p_->prefix_;
 5299|   130k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5301|   288k|std::string XmpKey::tagName() const {
 5302|   288k|  return p_->property_;
 5303|   288k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5331|   260k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5332|   260k|  XmpProperties::XmpLock lock;
 5333|   260k|  decomposeKeyUnlocked(key, lock);
 5334|   260k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5336|  1.12M|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5337|       |  // Get the family name, prefix and property name parts of the key
 5338|  1.12M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5338:7): [True: 201, False: 1.12M]
  ------------------
 5339|    201|    throw Error(ErrorCode::kerInvalidKey, key);
 5340|  1.12M|  std::string::size_type pos1 = key.find('.');
 5341|  1.12M|  std::string::size_type pos0 = pos1 + 1;
 5342|  1.12M|  pos1 = key.find('.', pos0);
 5343|  1.12M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5343:7): [True: 0, False: 1.12M]
  ------------------
 5344|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|  1.12M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5346|  1.12M|  if (prefix.empty())
  ------------------
  |  Branch (5346:7): [True: 0, False: 1.12M]
  ------------------
 5347|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5348|  1.12M|  std::string property = key.substr(pos1 + 1);
 5349|  1.12M|  if (property.empty())
  ------------------
  |  Branch (5349:7): [True: 0, False: 1.12M]
  ------------------
 5350|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5351|       |
 5352|       |  // Validate prefix unlocked (must hold lock)
 5353|  1.12M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5353:7): [True: 0, False: 1.12M]
  ------------------
 5354|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5355|       |
 5356|  1.12M|  property_ = std::move(property);
 5357|  1.12M|  prefix_ = std::move(prefix);
 5358|  1.12M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5219|  1.12M|  Impl() = default;                                                                             //!< Default constructor

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  100|    563|PsdImage::PsdImage(BasicIo::UniquePtr io) : Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io)) {
  101|    563|}  // PsdImage::PsdImage
_ZN5Exiv28PsdImage12readMetadataEv:
  112|    557|void PsdImage::readMetadata() {
  113|       |#ifdef EXIV2_DEBUG_MESSAGES
  114|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  115|       |#endif
  116|    557|  if (io_->open() != 0) {
  ------------------
  |  Branch (116:7): [True: 0, False: 557]
  ------------------
  117|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  118|      0|  }
  119|    557|  IoCloser closer(*io_);
  120|       |  // Ensure that this is the correct image type
  121|    557|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (121:7): [True: 0, False: 557]
  ------------------
  122|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (122:9): [True: 0, False: 0]
  |  Branch (122:25): [True: 0, False: 0]
  ------------------
  123|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  124|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  125|      0|  }
  126|    557|  clearMetadata();
  127|       |
  128|       |  /*
  129|       |    The Photoshop header goes as follows -- all numbers are in big-endian byte order:
  130|       |
  131|       |    offset  length   name       description
  132|       |    ======  =======  =========  =========
  133|       |     0      4 bytes  signature  always '8BPS'
  134|       |     4      2 bytes  version    always equal to 1
  135|       |     6      6 bytes  reserved   must be zero
  136|       |    12      2 bytes  channels   number of channels in the image, including alpha channels (1 to 24)
  137|       |    14      4 bytes  rows       the height of the image in pixels
  138|       |    18      4 bytes  columns    the width of the image in pixels
  139|       |    22      2 bytes  depth      the number of bits per channel
  140|       |    24      2 bytes  mode       the color mode of the file; Supported values are: Bitmap=0; Grayscale=1;
  141|       |    Indexed=2; RGB=3; CMYK=4; Multichannel=7; Duotone=8; Lab=9
  142|       |  */
  143|    557|  byte buf[26];
  144|    557|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (144:7): [True: 0, False: 557]
  ------------------
  145|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  146|      0|  }
  147|    557|  pixelWidth_ = getLong(buf + 18, bigEndian);
  148|    557|  pixelHeight_ = getLong(buf + 14, bigEndian);
  149|       |
  150|       |  // immediately following the image header is the color mode data section,
  151|       |  // the first four bytes of which specify the byte size of the whole section
  152|    557|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (152:7): [True: 0, False: 557]
  ------------------
  153|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  154|      0|  }
  155|       |
  156|       |  // skip it
  157|    557|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (157:7): [True: 35, False: 522]
  ------------------
  158|     35|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  159|     35|  }
  160|       |
  161|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  162|    522|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (162:7): [True: 12, False: 510]
  ------------------
  163|     12|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  164|     12|  }
  165|    510|  uint32_t resourcesLength = getULong(buf, bigEndian);
  166|    510|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  1.11k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (168:10): [True: 744, False: 373]
  ------------------
  169|    744|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  170|    744|    resourcesLength -= 8;
  171|    744|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (171:9): [True: 31, False: 713]
  ------------------
  172|     31|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  173|     31|    }
  174|       |
  175|    713|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (175:9): [True: 98, False: 615]
  ------------------
  176|     98|      break;  // bad resource type
  177|     98|    }
  178|    615|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  179|    615|    uint32_t resourceNameLength = buf[6] & ~1;
  180|       |
  181|       |    // skip the resource name, plus any padding
  182|    615|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  183|    615|    resourcesLength -= resourceNameLength;
  184|    615|    io_->seek(resourceNameLength, BasicIo::cur);
  185|       |
  186|       |    // read resource size
  187|    615|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  188|    615|    resourcesLength -= 4;
  189|    615|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (189:9): [True: 8, False: 607]
  ------------------
  190|      8|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  191|      8|    }
  192|    607|    uint32_t resourceSize = getULong(buf, bigEndian);
  193|    607|    const size_t curOffset = io_->tell();
  194|       |
  195|       |#ifdef EXIV2_DEBUG_MESSAGES
  196|       |    std::cerr << std::hex << "resourceId: " << resourceId << std::dec << " length: " << resourceSize << std::hex
  197|       |              << "\n";
  198|       |#endif
  199|       |
  200|    607|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  201|    607|    readResourceBlock(resourceId, resourceSize);
  202|    607|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  203|    607|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  204|    607|    resourcesLength -= resourceSize;
  205|    607|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  206|    607|  }
  207|       |
  208|    510|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  210|    528|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  211|    528|  switch (resourceId) {
  212|    118|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (212:5): [True: 118, False: 410]
  ------------------
  213|    118|      DataBuf rawIPTC(resourceSize);
  214|    118|      io_->read(rawIPTC.data(), rawIPTC.size());
  215|    118|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (215:11): [True: 0, False: 118]
  |  Branch (215:27): [True: 6, False: 112]
  ------------------
  216|      6|        throw Error(ErrorCode::kerFailedToReadImageData);
  217|    112|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (217:11): [True: 41, False: 71]
  ------------------
  218|     41|#ifndef SUPPRESS_WARNINGS
  219|     41|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     41|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 41]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     41|  LogMsg(LogMsg::warn).os()
  ------------------
  220|     41|#endif
  221|     41|        iptcData_.clear();
  222|     41|      }
  223|    112|      break;
  224|    118|    }
  225|       |
  226|     34|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (226:5): [True: 34, False: 494]
  ------------------
  227|     34|      DataBuf rawExif(resourceSize);
  228|     34|      io_->read(rawExif.data(), rawExif.size());
  229|     34|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (229:11): [True: 0, False: 34]
  |  Branch (229:27): [True: 6, False: 28]
  ------------------
  230|      6|        throw Error(ErrorCode::kerFailedToReadImageData);
  231|     28|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size());
  232|     28|      setByteOrder(bo);
  233|     28|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (233:11): [True: 1, False: 27]
  |  Branch (233:31): [True: 0, False: 1]
  ------------------
  234|      0|#ifndef SUPPRESS_WARNINGS
  235|      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()
  ------------------
  236|      0|#endif
  237|      0|        exifData_.clear();
  238|      0|      }
  239|     28|      break;
  240|     34|    }
  241|       |
  242|     30|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (242:5): [True: 30, False: 498]
  ------------------
  243|     30|      DataBuf xmpPacket(resourceSize);
  244|     30|      io_->read(xmpPacket.data(), xmpPacket.size());
  245|     30|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (245:11): [True: 0, False: 30]
  |  Branch (245:27): [True: 6, False: 24]
  ------------------
  246|      6|        throw Error(ErrorCode::kerFailedToReadImageData);
  247|     24|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  248|     24|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (248:11): [True: 11, False: 13]
  |  Branch (248:34): [True: 9, False: 2]
  ------------------
  249|      9|#ifndef SUPPRESS_WARNINGS
  250|      9|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|      9|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      9|  LogMsg(LogMsg::warn).os()
  ------------------
  251|      9|#endif
  252|      9|      }
  253|     24|      break;
  254|     30|    }
  255|       |
  256|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  257|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  258|    194|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (258:5): [True: 194, False: 334]
  ------------------
  259|    197|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (259:5): [True: 3, False: 525]
  ------------------
  260|       |      /*
  261|       |        Photoshop thumbnail resource header
  262|       |
  263|       |        offset  length    name            description
  264|       |        ======  ========  ====            ===========
  265|       |         0      4 bytes   format          = 1 (kJpegRGB). Also supports kRawRGB (0).
  266|       |         4      4 bytes   width           Width of thumbnail in pixels.
  267|       |         8      4 bytes   height          Height of thumbnail in pixels.
  268|       |        12      4 bytes   widthbytes      Padded row bytes as (width * bitspixel + 31) / 32 * 4.
  269|       |        16      4 bytes   size            Total size as widthbytes * height * planes
  270|       |        20      4 bytes   compressedsize  Size after compression. Used for consistency check.
  271|       |        24      2 bytes   bitspixel       = 24. Bits per pixel.
  272|       |        26      2 bytes   planes          = 1. Number of planes.
  273|       |        28      variable  data            JFIF data in RGB format.
  274|       |                                          Note: For resource ID 1033 the data is in BGR format.
  275|       |      */
  276|    197|      byte buf[28];
  277|    197|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (277:11): [True: 2, False: 195]
  ------------------
  278|      2|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  279|      2|      }
  280|    195|      NativePreview nativePreview;
  281|    195|      nativePreview.position_ = io_->tell();
  282|    195|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  283|    195|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  284|    195|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  285|    195|      const uint32_t format = getLong(buf + 0, bigEndian);
  286|       |
  287|    195|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  288|    195|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  289|       |
  290|    195|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (290:11): [True: 8, False: 187]
  |  Branch (290:38): [True: 8, False: 0]
  ------------------
  291|      8|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  292|      8|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (292:13): [True: 0, False: 8]
  |  Branch (292:29): [True: 8, False: 0]
  ------------------
  293|      8|          throw Error(ErrorCode::kerFailedToReadImageData);
  294|       |
  295|       |        // unsupported format of native preview
  296|      0|        if (format != 1)
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|      0|          break;
  298|      0|        nativePreview.filter_ = "";
  299|      0|        nativePreview.mimeType_ = "image/jpeg";
  300|      0|        nativePreviews_.push_back(std::move(nativePreview));
  301|      0|      }
  302|    187|      break;
  303|    195|    }
  304|       |
  305|    187|    default:
  ------------------
  |  Branch (305:5): [True: 149, False: 379]
  ------------------
  306|    149|      break;
  307|    528|  }
  308|    528|}  // PsdImage::readResourceBlock
_ZN5Exiv28PsdImage13writeMetadataEv:
  310|     66|void PsdImage::writeMetadata() {
  311|     66|  if (io_->open() != 0) {
  ------------------
  |  Branch (311:7): [True: 0, False: 66]
  ------------------
  312|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  313|      0|  }
  314|     66|  IoCloser closer(*io_);
  315|     66|  MemIo tempIo;
  316|       |
  317|     66|  doWriteMetadata(tempIo);  // may throw
  318|     66|  io_->close();
  319|     66|  io_->transfer(tempIo);  // may throw
  320|       |
  321|     66|}  // PsdImage::writeMetadata
_ZN5Exiv28PsdImage15doWriteMetadataERNS_7BasicIoE:
  323|     66|void PsdImage::doWriteMetadata(BasicIo& outIo) {
  324|     66|  if (!io_->isopen())
  ------------------
  |  Branch (324:7): [True: 0, False: 66]
  ------------------
  325|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  326|     66|  if (!outIo.isopen())
  ------------------
  |  Branch (326:7): [True: 0, False: 66]
  ------------------
  327|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  328|       |
  329|       |#ifdef EXIV2_DEBUG_MESSAGES
  330|       |  std::cout << "Exiv2::PsdImage::doWriteMetadata: Writing PSD file " << io_->path() << "\n";
  331|       |  std::cout << "Exiv2::PsdImage::doWriteMetadata: tmp file created " << outIo.path() << "\n";
  332|       |#endif
  333|       |
  334|       |  // Ensure that this is the correct image type
  335|     66|  if (!isPsdType(*io_, true)) {
  ------------------
  |  Branch (335:7): [True: 0, False: 66]
  ------------------
  336|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  |  Branch (336:25): [True: 0, False: 0]
  ------------------
  337|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  338|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  339|      0|  }
  340|       |
  341|     66|  io_->seek(0, BasicIo::beg);  // rewind
  342|       |
  343|     66|  DataBuf lbuf(4096);
  344|     66|  byte buf[8];
  345|       |
  346|       |  // Get Photoshop header from original file
  347|     66|  byte psd_head[26];
  348|     66|  if (io_->read(psd_head, 26) != 26)
  ------------------
  |  Branch (348:7): [True: 0, False: 66]
  ------------------
  349|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  350|       |
  351|       |  // Write Photoshop header data out to new PSD file
  352|     66|  if (outIo.write(psd_head, 26) != 26)
  ------------------
  |  Branch (352:7): [True: 0, False: 66]
  ------------------
  353|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  354|       |
  355|       |  // Read colorDataLength from original PSD
  356|     66|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (356:7): [True: 0, False: 66]
  ------------------
  357|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  358|       |
  359|     66|  uint32_t colorDataLength = getULong(buf, bigEndian);
  360|       |
  361|       |  // Write colorDataLength
  362|     66|  ul2Data(buf, colorDataLength, bigEndian);
  363|     66|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (363:7): [True: 0, False: 66]
  ------------------
  364|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  365|       |#ifdef EXIV2_DEBUG_MESSAGES
  366|       |  std::cerr << std::dec << "colorDataLength: " << colorDataLength << "\n";
  367|       |#endif
  368|       |  // Copy colorData
  369|     66|  size_t readTotal = 0;
  370|    147|  while (readTotal < colorDataLength) {
  ------------------
  |  Branch (370:10): [True: 81, False: 66]
  ------------------
  371|     81|    auto toRead = std::min<size_t>(colorDataLength - readTotal, lbuf.size());
  372|     81|    if (io_->read(lbuf.data(), toRead) != toRead)
  ------------------
  |  Branch (372:9): [True: 0, False: 81]
  ------------------
  373|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  374|     81|    readTotal += toRead;
  375|     81|    if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (375:9): [True: 0, False: 81]
  ------------------
  376|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  377|     81|  }
  378|     66|  if (outIo.error())
  ------------------
  |  Branch (378:7): [True: 0, False: 66]
  ------------------
  379|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  380|       |
  381|     66|  const size_t resLenOffset = io_->tell();  // remember for later update
  382|       |
  383|       |  // Read length of all resource blocks from original PSD
  384|     66|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (384:7): [True: 0, False: 66]
  ------------------
  385|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  386|       |
  387|     66|  uint32_t oldResLength = getULong(buf, bigEndian);
  388|     66|  uint32_t newResLength = 0;
  389|       |
  390|       |  // Write oldResLength (will be updated later)
  391|     66|  ul2Data(buf, oldResLength, bigEndian);
  392|     66|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (392:7): [True: 0, False: 66]
  ------------------
  393|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  394|       |
  395|       |#ifdef EXIV2_DEBUG_MESSAGES
  396|       |  std::cerr << std::dec << "oldResLength: " << oldResLength << "\n";
  397|       |#endif
  398|       |
  399|       |  // Iterate over original resource blocks.
  400|       |  // Replace or insert IPTC, EXIF and XMP
  401|       |  // Original resource blocks assumed to be sorted ASC
  402|       |
  403|     66|  bool iptcDone = false;
  404|     66|  bool exifDone = false;
  405|     66|  bool xmpDone = false;
  406|    187|  while (oldResLength > 0) {
  ------------------
  |  Branch (406:10): [True: 165, False: 22]
  ------------------
  407|    165|    if (io_->read(buf, 8) != 8)
  ------------------
  |  Branch (407:9): [True: 0, False: 165]
  ------------------
  408|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  409|       |
  410|       |    // read resource type and ID
  411|    165|    uint32_t resourceType = getULong(buf, bigEndian);
  412|       |
  413|    165|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (413:9): [True: 42, False: 123]
  ------------------
  414|     42|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");  // bad resource type
  415|     42|    }
  416|    123|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  417|    123|    uint32_t resourceNameLength = buf[6];
  418|    123|    uint32_t adjResourceNameLen = resourceNameLength & ~1;
  419|    123|    unsigned char resourceNameFirstChar = buf[7];
  420|       |
  421|       |    // read rest of resource name, plus any padding
  422|    123|    DataBuf resName(256);
  423|    123|    if (io_->read(resName.data(), adjResourceNameLen) != adjResourceNameLen)
  ------------------
  |  Branch (423:9): [True: 1, False: 122]
  ------------------
  424|      1|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  425|       |
  426|       |    // read resource size (actual length w/o padding!)
  427|    122|    if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (427:9): [True: 0, False: 122]
  ------------------
  428|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  429|       |
  430|    122|    uint32_t resourceSize = getULong(buf, bigEndian);
  431|    122|    uint32_t pResourceSize = (resourceSize + 1) & ~1;  // padded resource size
  432|    122|    const size_t curOffset = io_->tell();
  433|       |
  434|       |    // Write IPTC_NAA resource block
  435|    122|    if (resourceId >= kPhotoshopResourceID::IPTC_NAA && !iptcDone) {
  ------------------
  |  Branch (435:9): [True: 114, False: 8]
  |  Branch (435:57): [True: 45, False: 69]
  ------------------
  436|     45|      newResLength += writeIptcData(iptcData_, outIo);
  437|     45|      iptcDone = true;
  438|     45|    }
  439|       |
  440|       |    // Write ExifInfo resource block
  441|     77|    else if (resourceId >= kPhotoshopResourceID::ExifInfo && !exifDone) {
  ------------------
  |  Branch (441:14): [True: 36, False: 41]
  |  Branch (441:62): [True: 19, False: 17]
  ------------------
  442|     19|      newResLength += writeExifData(exifData_, outIo);
  443|     19|      exifDone = true;
  444|     19|    }
  445|       |
  446|       |    // Write XMPpacket resource block
  447|     58|    else if (resourceId >= kPhotoshopResourceID::XMPPacket && !xmpDone) {
  ------------------
  |  Branch (447:14): [True: 14, False: 44]
  |  Branch (447:63): [True: 12, False: 2]
  ------------------
  448|     12|      newResLength += writeXmpData(xmpData_, outIo);
  449|     12|      xmpDone = true;
  450|     12|    }
  451|       |
  452|       |    // Copy all other resource blocks
  453|    122|    if (resourceId != kPhotoshopResourceID::IPTC_NAA && resourceId != kPhotoshopResourceID::ExifInfo &&
  ------------------
  |  Branch (453:9): [True: 72, False: 50]
  |  Branch (453:57): [True: 61, False: 11]
  ------------------
  454|     61|        resourceId != kPhotoshopResourceID::XMPPacket) {
  ------------------
  |  Branch (454:9): [True: 43, False: 18]
  ------------------
  455|       |#ifdef EXIV2_DEBUG_MESSAGES
  456|       |      std::cerr << std::hex << "copy : resourceType: " << resourceType << "\n";
  457|       |      std::cerr << std::hex << "copy : resourceId: " << resourceId << "\n";
  458|       |      std::cerr << std::dec;
  459|       |#endif
  460|       |      // Copy resource block to new PSD file
  461|     43|      ul2Data(buf, resourceType, bigEndian);
  462|     43|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (462:11): [True: 0, False: 43]
  ------------------
  463|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  464|     43|      us2Data(buf, resourceId, bigEndian);
  465|     43|      if (outIo.write(buf, 2) != 2)
  ------------------
  |  Branch (465:11): [True: 0, False: 43]
  ------------------
  466|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  467|       |      // Write resource name as Pascal string
  468|     43|      buf[0] = resourceNameLength & 0x00ff;
  469|     43|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (469:11): [True: 0, False: 43]
  ------------------
  470|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  471|     43|      buf[0] = resourceNameFirstChar;
  472|     43|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (472:11): [True: 0, False: 43]
  ------------------
  473|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  474|     43|      if (outIo.write(resName.c_data(), adjResourceNameLen) != static_cast<size_t>(adjResourceNameLen))
  ------------------
  |  Branch (474:11): [True: 0, False: 43]
  ------------------
  475|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  476|     43|      ul2Data(buf, resourceSize, bigEndian);
  477|     43|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (477:11): [True: 0, False: 43]
  ------------------
  478|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  479|       |
  480|     43|      readTotal = 0;
  481|     99|      while (readTotal < pResourceSize) {
  ------------------
  |  Branch (481:14): [True: 57, False: 42]
  ------------------
  482|       |        /// \todo almost same code as in lines 403-410. Factor out & reuse!
  483|     57|        auto toRead = std::min<size_t>(pResourceSize - readTotal, lbuf.size());
  484|     57|        if (io_->read(lbuf.data(), toRead) != toRead) {
  ------------------
  |  Branch (484:13): [True: 1, False: 56]
  ------------------
  485|      1|          throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  486|      1|        }
  487|     56|        readTotal += toRead;
  488|     56|        if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (488:13): [True: 0, False: 56]
  ------------------
  489|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  490|     56|      }
  491|     42|      if (outIo.error())
  ------------------
  |  Branch (491:11): [True: 0, False: 42]
  ------------------
  492|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  493|     42|      newResLength += pResourceSize + adjResourceNameLen + 12;
  494|     42|    }
  495|       |
  496|    121|    io_->seek(curOffset + pResourceSize, BasicIo::beg);
  497|    121|    oldResLength -= (12 + adjResourceNameLen + pResourceSize);
  498|    121|  }
  499|       |
  500|       |  // Append IPTC_NAA resource block, if not yet written
  501|     22|  if (!iptcDone) {
  ------------------
  |  Branch (501:7): [True: 16, False: 6]
  ------------------
  502|     16|    newResLength += writeIptcData(iptcData_, outIo);
  503|     16|    iptcDone = true;
  504|     16|  }
  505|       |
  506|       |  // Append ExifInfo resource block, if not yet written
  507|     22|  if (!exifDone) {
  ------------------
  |  Branch (507:7): [True: 20, False: 2]
  ------------------
  508|     20|    newResLength += writeExifData(exifData_, outIo);
  509|     20|  }
  510|       |
  511|       |  // Append XmpPacket resource block, if not yet written
  512|     22|  if (!xmpDone) {
  ------------------
  |  Branch (512:7): [True: 21, False: 1]
  ------------------
  513|     21|    newResLength += writeXmpData(xmpData_, outIo);
  514|     21|  }
  515|       |
  516|       |  // Populate the fake data, only make sense for remoteio, httpio and sshio.
  517|       |  // it avoids allocating memory for parts of the file that contain image-date.
  518|     22|  io_->populateFakeData();
  519|       |
  520|       |  // Copy remaining data
  521|     22|  size_t readSize = io_->read(lbuf.data(), lbuf.size());
  522|    167|  while (readSize != 0) {
  ------------------
  |  Branch (522:10): [True: 145, False: 22]
  ------------------
  523|    145|    if (outIo.write(lbuf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (523:9): [True: 0, False: 145]
  ------------------
  524|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  525|    145|    readSize = io_->read(lbuf.data(), lbuf.size());
  526|    145|  }
  527|     22|  if (outIo.error())
  ------------------
  |  Branch (527:7): [True: 0, False: 22]
  ------------------
  528|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  529|       |
  530|       |    // Update length of resources
  531|       |#ifdef EXIV2_DEBUG_MESSAGES
  532|       |  std::cerr << "newResLength: " << newResLength << "\n";
  533|       |#endif
  534|     22|  outIo.seek(resLenOffset, BasicIo::beg);
  535|     22|  ul2Data(buf, newResLength, bigEndian);
  536|     22|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (536:7): [True: 0, False: 22]
  ------------------
  537|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  538|       |
  539|     22|}  // PsdImage::doWriteMetadata
_ZN5Exiv28PsdImage13writeIptcDataERKNS_8IptcDataERNS_7BasicIoE:
  541|     61|uint32_t PsdImage::writeIptcData(const IptcData& iptcData, BasicIo& out) {
  542|     61|  uint32_t resLength = 0;
  543|     61|  byte buf[8];
  544|       |
  545|     61|  if (!iptcData.empty()) {
  ------------------
  |  Branch (545:7): [True: 10, False: 51]
  ------------------
  546|     10|    DataBuf rawIptc = IptcParser::encode(iptcData);
  547|     10|    if (!rawIptc.empty()) {
  ------------------
  |  Branch (547:9): [True: 10, False: 0]
  ------------------
  548|       |#ifdef EXIV2_DEBUG_MESSAGES
  549|       |      std::cerr << std::hex << "write: resourceId: " << kPhotoshopResourceID::IPTC_NAA << "\n";
  550|       |      std::cerr << std::dec << "Writing IPTC_NAA: size: " << rawIptc.size() << "\n";
  551|       |#endif
  552|     10|      if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_.front()), 4) != 4)
  ------------------
  |  Branch (552:11): [True: 0, False: 10]
  ------------------
  553|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  554|     10|      us2Data(buf, kPhotoshopResourceID::IPTC_NAA, bigEndian);
  555|     10|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (555:11): [True: 0, False: 10]
  ------------------
  556|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  557|     10|      us2Data(buf, 0, bigEndian);  // NULL resource name
  558|     10|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (558:11): [True: 0, False: 10]
  ------------------
  559|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  560|     10|      ul2Data(buf, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  561|     10|      if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (561:11): [True: 0, False: 10]
  ------------------
  562|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  563|       |      // Write encoded Iptc data
  564|     10|      if (out.write(rawIptc.c_data(), rawIptc.size()) != rawIptc.size())
  ------------------
  |  Branch (564:11): [True: 0, False: 10]
  ------------------
  565|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  566|     10|      resLength += static_cast<uint32_t>(rawIptc.size()) + 12;
  567|     10|      if (rawIptc.size() & 1)  // even padding
  ------------------
  |  Branch (567:11): [True: 9, False: 1]
  ------------------
  568|      9|      {
  569|      9|        buf[0] = 0;
  570|      9|        if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (570:13): [True: 0, False: 9]
  ------------------
  571|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  572|      9|        resLength++;
  573|      9|      }
  574|     10|    }
  575|     10|  }
  576|     61|  return resLength;
  577|     61|}  // PsdImage::writeIptcData
_ZN5Exiv28PsdImage13writeExifDataERNS_8ExifDataERNS_7BasicIoE:
  579|     39|uint32_t PsdImage::writeExifData(ExifData& exifData, BasicIo& out) {
  580|     39|  uint32_t resLength = 0;
  581|     39|  byte buf[8];
  582|       |
  583|     39|  if (!exifData.empty()) {
  ------------------
  |  Branch (583:7): [True: 1, False: 38]
  ------------------
  584|      1|    Blob blob;
  585|      1|    ByteOrder bo = byteOrder();
  586|      1|    if (bo == invalidByteOrder) {
  ------------------
  |  Branch (586:9): [True: 0, False: 1]
  ------------------
  587|      0|      bo = littleEndian;
  588|      0|      setByteOrder(bo);
  589|      0|    }
  590|      1|    ExifParser::encode(blob, bo, exifData);
  591|       |
  592|      1|    if (!blob.empty()) {
  ------------------
  |  Branch (592:9): [True: 1, False: 0]
  ------------------
  593|       |#ifdef EXIV2_DEBUG_MESSAGES
  594|       |      std::cerr << std::hex << "write: resourceId: " << kPhotoshopResourceID::ExifInfo << "\n";
  595|       |      std::cerr << std::dec << "Writing ExifInfo: size: " << blob.size() << "\n";
  596|       |#endif
  597|      1|      if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_.front()), 4) != 4)
  ------------------
  |  Branch (597:11): [True: 0, False: 1]
  ------------------
  598|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  599|      1|      us2Data(buf, kPhotoshopResourceID::ExifInfo, bigEndian);
  600|      1|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (600:11): [True: 0, False: 1]
  ------------------
  601|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  602|      1|      us2Data(buf, 0, bigEndian);  // NULL resource name
  603|      1|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (603:11): [True: 0, False: 1]
  ------------------
  604|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  605|      1|      ul2Data(buf, static_cast<uint32_t>(blob.size()), bigEndian);
  606|      1|      if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (606:11): [True: 0, False: 1]
  ------------------
  607|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  608|       |      // Write encoded Exif data
  609|      1|      if (out.write(blob.data(), blob.size()) != blob.size())
  ------------------
  |  Branch (609:11): [True: 0, False: 1]
  ------------------
  610|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  611|      1|      resLength += static_cast<long>(blob.size()) + 12;
  612|      1|      if (blob.size() & 1)  // even padding
  ------------------
  |  Branch (612:11): [True: 0, False: 1]
  ------------------
  613|      0|      {
  614|      0|        buf[0] = 0;
  615|      0|        if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (615:13): [True: 0, False: 0]
  ------------------
  616|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  617|      0|        resLength++;
  618|      0|      }
  619|      1|    }
  620|      1|  }
  621|     39|  return resLength;
  622|     39|}  // PsdImage::writeExifData
_ZNK5Exiv28PsdImage12writeXmpDataERKNS_7XmpDataERNS_7BasicIoE:
  624|     33|uint32_t PsdImage::writeXmpData(const XmpData& xmpData, BasicIo& out) const {
  625|     33|  std::string xmpPacket;
  626|     33|  uint32_t resLength = 0;
  627|     33|  byte buf[8];
  628|       |
  629|       |#ifdef EXIV2_DEBUG_MESSAGES
  630|       |  std::cerr << "writeXmpFromPacket(): " << writeXmpFromPacket() << "\n";
  631|       |#endif
  632|       |  //        writeXmpFromPacket(true);
  633|     33|  if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket, xmpData) > 1) {
  ------------------
  |  Branch (633:7): [True: 33, False: 0]
  |  Branch (633:32): [True: 0, False: 33]
  ------------------
  634|      0|#ifndef SUPPRESS_WARNINGS
  635|      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()
  ------------------
  636|      0|#endif
  637|      0|  }
  638|       |
  639|     33|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (639:7): [True: 2, False: 31]
  ------------------
  640|       |#ifdef EXIV2_DEBUG_MESSAGES
  641|       |    std::cerr << std::hex << "write: resourceId: " << kPhotoshopResourceID::XMPPacket << "\n";
  642|       |    std::cerr << std::dec << "Writing XMPPacket: size: " << xmpPacket.size() << "\n";
  643|       |#endif
  644|      2|    if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_.front()), 4) != 4)
  ------------------
  |  Branch (644:9): [True: 0, False: 2]
  ------------------
  645|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  646|      2|    us2Data(buf, kPhotoshopResourceID::XMPPacket, bigEndian);
  647|      2|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  649|      2|    us2Data(buf, 0, bigEndian);  // NULL resource name
  650|      2|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  652|      2|    ul2Data(buf, static_cast<uint32_t>(xmpPacket.size()), bigEndian);
  653|      2|    if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (653:9): [True: 0, False: 2]
  ------------------
  654|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  655|       |    // Write XMPPacket
  656|      2|    if (out.write(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size()) != xmpPacket.size())
  ------------------
  |  Branch (656:9): [True: 0, False: 2]
  ------------------
  657|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  658|      2|    if (out.error())
  ------------------
  |  Branch (658:9): [True: 0, False: 2]
  ------------------
  659|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  660|      2|    resLength += static_cast<uint32_t>(xmpPacket.size()) + 12;
  661|      2|    if (xmpPacket.size() & 1)  // even padding
  ------------------
  |  Branch (661:9): [True: 1, False: 1]
  ------------------
  662|      1|    {
  663|      1|      buf[0] = 0;
  664|      1|      if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (664:11): [True: 0, False: 1]
  ------------------
  665|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  666|      1|      resLength++;
  667|      1|    }
  668|      2|  }
  669|     33|  return resLength;
  670|     33|}  // PsdImage::writeXmpData
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  674|    563|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, bool /*create*/) {
  675|    563|  auto image = std::make_unique<PsdImage>(std::move(io));
  676|    563|  if (!image->good()) {
  ------------------
  |  Branch (676:7): [True: 6, False: 557]
  ------------------
  677|      6|    return nullptr;
  678|      6|  }
  679|    557|  return image;
  680|    563|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  682|  13.6k|bool isPsdType(BasicIo& iIo, bool advance) {
  683|  13.6k|  const int32_t len = 6;
  684|  13.6k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  685|  13.6k|  std::array<byte, len> buf;
  686|  13.6k|  iIo.read(buf.data(), len);
  687|  13.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 13.6k]
  |  Branch (687:22): [True: 352, False: 13.3k]
  ------------------
  688|    352|    return false;
  689|    352|  }
  690|  13.3k|  bool matched = buf == PsdHeader;
  691|  13.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (691:7): [True: 13.2k, False: 66]
  |  Branch (691:19): [True: 0, False: 66]
  ------------------
  692|  13.2k|    iIo.seek(-len, BasicIo::cur);
  693|  13.2k|  }
  694|       |
  695|  13.3k|  return matched;
  696|  13.6k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  540|  3.06k|    Image(ImageType::qtime, mdNone, std::move(io)),
  541|  3.06k|    mvhdTimeScale_(1),
  542|  3.06k|    mdhdTimeScale_(1),
  543|  3.06k|    currentStream_(Null),
  544|  3.06k|    max_recursion_depth_(max_recursion_depth) {
  545|  3.06k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  3.05k|std::string QuickTimeVideo::mimeType() const {
  548|  3.05k|  return "video/quicktime";
  549|  3.05k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  551|    256|void QuickTimeVideo::writeMetadata() {
  552|    256|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  3.05k|void QuickTimeVideo::readMetadata() {
  555|  3.05k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.05k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  3.05k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 3.05k]
  ------------------
  560|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  |  Branch (560:25): [True: 0, False: 0]
  ------------------
  561|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  562|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  563|      0|  }
  564|       |
  565|  3.05k|  IoCloser closer(*io_);
  566|  3.05k|  clearMetadata();
  567|  3.05k|  continueTraversing_ = true;
  568|  3.05k|  height_ = width_ = 1;
  569|       |
  570|  3.05k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  3.05k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  59.2k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 56.2k, False: 3.05k]
  ------------------
  574|  56.2k|    decodeBlock(0);
  575|       |
  576|  3.05k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  3.05k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  81.2k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|  81.2k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|  81.2k|  const long bufMinSize = 4;
  583|  81.2k|  DataBuf buf(bufMinSize + 1);
  584|  81.2k|  uint64_t size = 0;
  585|  81.2k|  buf.data()[4] = '\0';
  586|       |
  587|  81.2k|  io_->read(buf.data(), 4);
  588|  81.2k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 367, False: 80.8k]
  ------------------
  589|    367|    continueTraversing_ = false;
  590|    367|    return;
  591|    367|  }
  592|       |
  593|  80.8k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|  80.8k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|  80.8k|  size_t hdrsize = 8;
  599|       |
  600|  80.8k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 137, False: 80.7k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    137|    DataBuf data(8);
  603|    137|    hdrsize += 8;
  604|    137|    io_->readOrThrow(data.data(), data.size());
  605|    137|    size = data.read_uint64(0, bigEndian);
  606|  80.7k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 2.55k, False: 78.1k]
  |  Branch (606:27): [True: 2.40k, False: 146]
  ------------------
  607|  2.40k|    size = buf.read_uint32(0, bigEndian);
  608|  2.40k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  2.40k|  }
  610|       |
  611|  80.8k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|  80.8k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|  80.8k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|  80.8k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|  80.8k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 12.2k, False: 68.6k]
  ------------------
  618|  12.2k|    discard(newsize);
  619|  12.2k|    return;
  620|  12.2k|  }
  621|  68.6k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 56.9k, False: 11.6k]
  ------------------
  622|  56.9k|    buf.resize(newsize);
  623|  56.9k|  }
  624|  68.6k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|  68.6k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  69.5k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  69.5k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  69.5k|  assert(buf.size() > 4);
  638|       |
  639|  69.5k|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 69.5k]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  69.5k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 10.8k, False: 58.7k]
  ------------------
  643|  10.8k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|  58.7k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 3.22k, False: 55.4k]
  ------------------
  645|  3.22k|    fileTypeDecoder(size);
  646|       |
  647|  55.4k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 3.35k, False: 52.1k]
  ------------------
  648|  3.35k|    setMediaStream();
  649|       |
  650|  52.1k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 196, False: 51.9k]
  ------------------
  651|    196|    movieHeaderDecoder(size);
  652|       |
  653|  51.9k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 2.23k, False: 49.7k]
  ------------------
  654|  2.23k|    trackHeaderDecoder(size);
  655|       |
  656|  49.7k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 3.34k, False: 46.3k]
  ------------------
  657|  3.34k|    mediaHeaderDecoder(size);
  658|       |
  659|  46.3k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 8.94k, False: 37.4k]
  ------------------
  660|  8.94k|    handlerDecoder(size);
  661|       |
  662|  37.4k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 4.08k, False: 33.3k]
  ------------------
  663|  4.08k|    videoHeaderDecoder(size);
  664|       |
  665|  33.3k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 9.42k, False: 23.9k]
  ------------------
  666|  9.42k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  23.9k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 2.38k, False: 21.5k]
  ------------------
  669|  2.38k|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  21.5k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 2.23k, False: 19.2k]
  ------------------
  672|  2.23k|    sampleDesc(size);
  673|       |
  674|  19.2k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 2.11k, False: 17.1k]
  ------------------
  675|  2.11k|    timeToSampleDecoder();
  676|       |
  677|  17.1k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 1.14k, False: 16.0k]
  ------------------
  678|  1.14k|    previewTagDecoder(size);
  679|       |
  680|  16.0k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 873, False: 15.1k]
  ------------------
  681|    873|    trackApertureTagDecoder(size);
  682|       |
  683|  15.1k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 800, False: 14.3k]
  ------------------
  684|    800|    keysTagDecoder(size);
  685|       |
  686|  14.3k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 227, False: 14.1k]
  ------------------
  687|    227|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 95, False: 132]
  ------------------
  688|     95|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    132|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 87, False: 45]
  ------------------
  690|     87|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|     45|    else
  692|     45|      discard(size);
  693|    227|  }
  694|       |
  695|  14.1k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 3.50k, False: 10.6k]
  ------------------
  696|  3.50k|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 2.45k, False: 1.05k]
  ------------------
  697|  2.45k|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|  1.05k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 780, False: 275]
  ------------------
  699|    780|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|    275|    else
  701|    275|      discard(size);
  702|  3.50k|  }
  703|       |
  704|  10.6k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 176, False: 10.4k]
  ------------------
  705|    176|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|    176|  }
  707|       |
  708|  10.4k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 502, False: 9.94k]
  ------------------
  709|    502|    io_->readOrThrow(buf.data(), 4);
  710|    502|    io_->readOrThrow(buf.data(), 4);
  711|    502|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|    502|  }
  713|       |
  714|  9.94k|  else {
  715|  9.94k|    discard(size);
  716|  9.94k|  }
  717|  69.5k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  22.4k|void QuickTimeVideo::discard(size_t size) {
  720|  22.4k|  size_t cur_pos = io_->tell();
  721|  22.4k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  22.4k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|  1.14k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|  1.14k|  DataBuf buf(4);
  726|  1.14k|  size_t cur_pos = io_->tell();
  727|  1.14k|  io_->readOrThrow(buf.data(), 4);
  728|  1.14k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|  1.14k|  io_->readOrThrow(buf.data(), 2);
  730|  1.14k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|  1.14k|  io_->readOrThrow(buf.data(), 4);
  733|  1.14k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 6, False: 1.14k]
  ------------------
  734|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|  1.14k|  else
  736|  1.14k|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|  1.14k|  io_->seek(cur_pos + size, BasicIo::beg);
  739|  1.14k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|    800|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|    800|  DataBuf buf(4);
  743|    800|  size_t cur_pos = io_->tell();
  744|    800|  io_->readOrThrow(buf.data(), 4);
  745|    800|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|    800|  io_->readOrThrow(buf.data(), 2);
  747|    800|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|    800|  io_->readOrThrow(buf.data(), 4);
  750|    800|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 6, False: 794]
  ------------------
  751|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    794|  else
  753|    794|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|    800|  io_->seek(cur_pos + size, BasicIo::beg);
  756|    800|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|    873|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|    873|  DataBuf buf(4);
  760|    873|  DataBuf buf2(2);
  761|    873|  size_t cur_pos = io_->tell();
  762|    873|  byte n = 3;
  763|       |
  764|  3.48k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 2.61k, False: 873]
  ------------------
  765|  2.61k|    io_->seek(4L, BasicIo::cur);
  766|  2.61k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  2.61k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 43, False: 2.56k]
  ------------------
  769|     43|      io_->seek(4L, BasicIo::cur);
  770|     43|      io_->readOrThrow(buf.data(), 2);
  771|     43|      io_->readOrThrow(buf2.data(), 2);
  772|     43|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|     43|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     43|#define stringFormat std::format
  ------------------
  774|     43|      io_->readOrThrow(buf.data(), 2);
  775|     43|      io_->readOrThrow(buf2.data(), 2);
  776|     43|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|     43|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     43|#define stringFormat std::format
  ------------------
  778|     43|    }
  779|       |
  780|  2.56k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 93, False: 2.47k]
  ------------------
  781|     93|      io_->seek(4L, BasicIo::cur);
  782|     93|      io_->readOrThrow(buf.data(), 2);
  783|     93|      io_->readOrThrow(buf2.data(), 2);
  784|     93|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|     93|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     93|#define stringFormat std::format
  ------------------
  786|     93|      io_->readOrThrow(buf.data(), 2);
  787|     93|      io_->readOrThrow(buf2.data(), 2);
  788|     93|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|     93|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     93|#define stringFormat std::format
  ------------------
  790|     93|    }
  791|       |
  792|  2.47k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 36, False: 2.43k]
  ------------------
  793|     36|      io_->seek(4L, BasicIo::cur);
  794|     36|      io_->readOrThrow(buf.data(), 2);
  795|     36|      io_->readOrThrow(buf2.data(), 2);
  796|     36|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|     36|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     36|#define stringFormat std::format
  ------------------
  798|     36|      io_->readOrThrow(buf.data(), 2);
  799|     36|      io_->readOrThrow(buf2.data(), 2);
  800|     36|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|     36|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     36|#define stringFormat std::format
  ------------------
  802|     36|    }
  803|  2.61k|  }
  804|    873|  io_->seek(cur_pos + size, BasicIo::beg);
  805|    873|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|  1.60k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|  1.60k|  size_t cur_pos = io_->tell();
  809|  1.60k|  DataBuf buf(50);
  810|  1.60k|  DataBuf buf2(4);
  811|       |
  812|  1.60k|  io_->readOrThrow(buf.data(), 4);
  813|  1.60k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 1.33k, False: 269]
  ------------------
  814|  1.33k|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|  1.33k|    io_->readOrThrow(buf.data(), 24);
  817|  1.33k|    xmpData_["Xmp.video.Make"] = buf.data();
  818|  1.33k|    io_->readOrThrow(buf.data(), 14);
  819|  1.33k|    xmpData_["Xmp.video.Model"] = buf.data();
  820|  1.33k|    io_->readOrThrow(buf.data(), 4);
  821|  1.33k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.33k|#define stringFormat std::format
  ------------------
  822|  1.33k|    io_->readOrThrow(buf.data(), 4);
  823|  1.33k|    io_->readOrThrow(buf2.data(), 4);
  824|  1.33k|    xmpData_["Xmp.video.FNumber"] =
  825|  1.33k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|  1.33k|    io_->readOrThrow(buf.data(), 4);
  827|  1.33k|    io_->readOrThrow(buf2.data(), 4);
  828|  1.33k|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|  1.33k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|  1.33k|    io_->readOrThrow(buf.data(), 10);
  831|  1.33k|    io_->readOrThrow(buf.data(), 4);
  832|  1.33k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 35, False: 1.29k]
  ------------------
  833|     35|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|     35|#define _(String) (String)
  ------------------
  834|  1.33k|    io_->readOrThrow(buf.data(), 4);
  835|  1.33k|    io_->readOrThrow(buf2.data(), 4);
  836|  1.33k|    xmpData_["Xmp.video.FocalLength"] =
  837|  1.33k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|  1.33k|    io_->seek(95L, BasicIo::cur);
  839|  1.33k|    io_->readOrThrow(buf.data(), 48);
  840|  1.33k|    buf.write_uint8(48, 0);
  841|  1.33k|    xmpData_["Xmp.video.Software"] = buf.data();
  842|  1.33k|    io_->readOrThrow(buf.data(), 4);
  843|  1.33k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|  1.33k|  }
  845|       |
  846|  1.60k|  io_->seek(cur_pos + size, BasicIo::beg);
  847|  1.60k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|  9.55k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|  9.55k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|  9.55k|  size_t cur_pos = io_->tell();
  852|  9.55k|  const TagVocabulary* td;
  853|  9.55k|  const TagVocabulary* tv;
  854|  9.55k|  const TagVocabulary* tv_internal;
  855|       |
  856|  9.55k|  const long bufMinSize = 100;
  857|  9.55k|  DataBuf buf(bufMinSize);
  858|  9.55k|  size_t size_internal = outer_size;
  859|  9.55k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  17.3k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 13.5k, False: 3.81k]
  |  Branch (861:38): [True: 13.5k, False: 0]
  ------------------
  862|  13.5k|    buf.data()[4] = '\0';
  863|  13.5k|    io_->readOrThrow(buf.data(), 4);
  864|  13.5k|    const size_t size = buf.read_uint32(0, bigEndian);
  865|  13.5k|    if (size > size_internal)
  ------------------
  |  Branch (865:9): [True: 2.86k, False: 10.6k]
  ------------------
  866|  2.86k|      break;
  867|  10.6k|    size_internal -= size;
  868|  10.6k|    io_->readOrThrow(buf.data(), 4);
  869|       |
  870|  10.6k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (870:9): [True: 70, False: 10.5k]
  ------------------
  871|     70|      buf.data()[0] = ' ';
  872|  10.6k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  873|       |
  874|  10.6k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  875|       |
  876|  10.6k|    if (size <= 12)
  ------------------
  |  Branch (876:9): [True: 2.87k, False: 7.76k]
  ------------------
  877|  2.87k|      break;
  878|       |
  879|  7.76k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (879:9): [True: 104, False: 7.66k]
  |  Branch (879:40): [True: 23, False: 7.64k]
  ------------------
  880|    124|      userDataDecoder(size - 8, recursion_depth + 1);
  881|       |
  882|  7.64k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (882:14): [True: 1.59k, False: 6.05k]
  ------------------
  883|  1.59k|      NikonTagsDecoder(size - 8);
  884|       |
  885|  6.05k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (885:14): [True: 1.60k, False: 4.45k]
  ------------------
  886|  1.60k|      CameraTagsDecoder(size - 8);
  887|       |
  888|  4.45k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (888:14): [True: 13, False: 4.43k]
  |  Branch (888:45): [True: 11, False: 4.42k]
  |  Branch (888:76): [True: 20, False: 4.40k]
  ------------------
  889|  4.40k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (889:14): [True: 16, False: 4.39k]
  |  Branch (889:45): [True: 100, False: 4.29k]
  ------------------
  890|    157|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  891|    157|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    157|#define _(String) (String)
  ------------------
  892|    157|    }
  893|       |
  894|  4.29k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (894:14): [True: 94, False: 4.19k]
  |  Branch (894:45): [True: 0, False: 4.19k]
  ------------------
  895|     91|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  896|     91|      io_->readOrThrow(buf.data(), 2);
  897|     91|      buf.data()[2] = '\0';
  898|     91|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  899|       |
  900|     91|      if (tv_internal)
  ------------------
  |  Branch (900:11): [True: 35, False: 56]
  ------------------
  901|     35|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     35|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     35|#define _(String) (String)
  ------------------
  902|     56|      else
  903|     56|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     56|#define _(String) (String)
  ------------------
  904|     91|    }
  905|       |
  906|  4.20k|    else if (tv) {
  ------------------
  |  Branch (906:14): [True: 405, False: 3.79k]
  ------------------
  907|    405|      io_->readOrThrow(buf.data(), 4);
  908|    405|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    405|#define _(String) (String)
  ------------------
  909|    405|    }
  910|       |
  911|  3.79k|    else if (td)
  ------------------
  |  Branch (911:14): [True: 2.39k, False: 1.40k]
  ------------------
  912|  2.39k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  913|  7.76k|  }
  914|       |
  915|  9.55k|  io_->seek(cur_pos + outer_size, BasicIo::beg);
  916|  9.55k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.59k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.59k|  size_t cur_pos = io_->tell();
  920|  1.59k|  DataBuf buf(201);
  921|  1.59k|  DataBuf buf2(4 + 1);
  922|  1.59k|  uint32_t TagID = 0;
  923|  1.59k|  uint16_t dataLength = 0;
  924|  1.59k|  uint16_t dataType = 2;
  925|  1.59k|  const TagDetails* td;
  926|  1.59k|  const TagDetails* td2;
  927|       |
  928|   115k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 114k, False: 1.59k]
  ------------------
  929|   114k|    io_->readOrThrow(buf.data(), 4);
  930|   114k|    TagID = buf.read_uint32(0, bigEndian);
  931|   114k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   114k|    io_->readOrThrow(buf.data(), 2);
  934|   114k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   114k|    std::memset(buf.data(), 0x0, buf.size());
  937|   114k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   114k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 4.62k, False: 109k]
  ------------------
  940|  4.62k|      size_t local_pos = io_->tell();
  941|  4.62k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  4.62k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  4.62k|      io_->readOrThrow(buf.data(), 4);
  945|  4.62k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  4.62k|      io_->readOrThrow(buf.data(), 20);
  947|  4.62k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  4.62k|      io_->readOrThrow(buf.data(), 20);
  949|  4.62k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  4.62k|      io_->readOrThrow(buf.data(), 4);
  951|  4.62k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  4.62k|      io_->readOrThrow(buf.data(), 1);
  954|  4.62k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  4.62k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 2.84k, False: 1.78k]
  ------------------
  956|  2.84k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.84k|#define _(String) (String)
  ------------------
  957|  1.78k|      else
  958|  1.78k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  4.62k|      io_->readOrThrow(buf.data(), 1);
  961|  4.62k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  4.62k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 2.88k, False: 1.74k]
  ------------------
  963|  2.88k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.88k|#define _(String) (String)
  ------------------
  964|       |
  965|  4.62k|      io_->readOrThrow(buf.data(), 1);
  966|  4.62k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  4.62k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 2.93k, False: 1.68k]
  ------------------
  968|  2.93k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  2.93k|#define _(String) (String)
  ------------------
  969|  1.68k|      else
  970|  1.68k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  4.62k|      io_->readOrThrow(buf.data(), 1);
  973|  4.62k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  4.62k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 1.51k, False: 3.10k]
  ------------------
  975|  1.51k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  1.51k|#define _(String) (String)
  ------------------
  976|  3.10k|      else
  977|  3.10k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  4.62k|      io_->readOrThrow(buf.data(), 1);
  980|  4.62k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  4.62k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 2.54k, False: 2.07k]
  ------------------
  982|  2.54k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  2.54k|#define _(String) (String)
  ------------------
  983|  2.07k|      else
  984|  2.07k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  4.62k|      io_->readOrThrow(buf.data(), 1);
  987|  4.62k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  4.62k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 1.72k, False: 2.90k]
  ------------------
  989|  1.72k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  1.72k|#define _(String) (String)
  ------------------
  990|  2.90k|      else
  991|  2.90k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  4.62k|      io_->readOrThrow(buf.data(), 1);
  994|  4.62k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  4.62k|      io_->readOrThrow(buf.data(), 1);
  997|  4.62k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  4.62k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 990, False: 3.63k]
  ------------------
  999|    990|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    990|#define _(String) (String)
  ------------------
 1000|  3.63k|      else
 1001|  3.63k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  4.62k|      io_->readOrThrow(buf.data(), 1);
 1004|  4.62k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  4.62k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 1.39k, False: 3.23k]
  ------------------
 1006|  1.39k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.39k|#define _(String) (String)
  ------------------
 1007|  3.23k|      else
 1008|  3.23k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  4.62k|      io_->readOrThrow(buf.data(), 1);
 1011|  4.62k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  4.62k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  4.62k|    }
 1015|       |
 1016|   109k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 474, False: 109k]
  ------------------
 1017|    474|      size_t local_pos = io_->tell();
 1018|    474|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    474|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    474|      io_->readOrThrow(buf.data(), 2);
 1022|    474|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    474|      io_->readOrThrow(buf.data(), 1);
 1024|    474|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    474|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 273, False: 201]
  ------------------
 1026|    273|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    273|#define _(String) (String)
  ------------------
 1027|       |
 1028|    474|      io_->readOrThrow(buf.data(), 1);
 1029|    474|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    474|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 330, False: 144]
  ------------------
 1031|    330|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    330|#define _(String) (String)
  ------------------
 1032|       |
 1033|    474|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    474|    }
 1035|       |
 1036|   109k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 1.72k, False: 107k]
  |  Branch (1036:31): [True: 214, False: 107k]
  ------------------
 1037|  1.42k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.42k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.42k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 496, False: 929]
  ------------------
 1042|    496|#ifndef SUPPRESS_WARNINGS
 1043|    496|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    496|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 496]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    496|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    496|#endif
 1046|    496|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    496|        buf.data()[0] = '\0';
 1048|    929|      } else {
 1049|    929|        io_->readOrThrow(buf.data(), dataLength);
 1050|    929|        buf.data()[dataLength] = '\0';
 1051|    929|      }
 1052|       |
 1053|  1.42k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 327, False: 1.09k]
  ------------------
 1054|    327|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    327|#define _(String) (String)
  ------------------
 1055|    327|      }
 1056|   107k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 985, False: 106k]
  ------------------
 1057|    985|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|    985|      std::memset(buf.data(), 0x0, buf.size());
 1059|    985|      io_->readOrThrow(buf.data(), 4);
 1060|    985|      if (td)
  ------------------
  |  Branch (1060:11): [True: 290, False: 695]
  ------------------
 1061|    290|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    290|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|    985|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 417, False: 568]
  |  Branch (1064:31): [True: 339, False: 229]
  ------------------
 1065|    752|#ifndef SUPPRESS_WARNINGS
 1066|    752|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    752|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 752]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    752|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    752|#endif
 1069|    752|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    752|      } else
 1071|    233|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|   106k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 2.23k, False: 104k]
  ------------------
 1073|  2.23k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  2.23k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  2.23k|      io_->readOrThrow(buf.data(), 2);
 1076|  2.23k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 951, False: 1.28k]
  ------------------
 1077|    951|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    951|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  2.23k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 1.80k, False: 435]
  |  Branch (1080:31): [True: 127, False: 308]
  ------------------
 1081|  1.92k|#ifndef SUPPRESS_WARNINGS
 1082|  1.92k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.92k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.92k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.92k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  1.92k|#endif
 1085|  1.92k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  1.92k|      } else
 1087|    310|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|   104k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 601, False: 103k]
  ------------------
 1089|    601|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|    601|      std::memset(buf.data(), 0x0, buf.size());
 1091|    601|      io_->readOrThrow(buf.data(), 4);
 1092|    601|      io_->readOrThrow(buf2.data(), 4);
 1093|    601|      if (td)
  ------------------
  |  Branch (1093:11): [True: 342, False: 259]
  ------------------
 1094|    342|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    342|#define _(String) (String)
  ------------------
 1095|    342|            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|    601|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 390, False: 211]
  |  Branch (1098:31): [True: 134, False: 77]
  ------------------
 1099|    521|#ifndef SUPPRESS_WARNINGS
 1100|    521|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    521|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 521]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    521|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    521|#endif
 1103|    521|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    521|      } else
 1105|     80|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|   103k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.65k, False: 102k]
  ------------------
 1107|  1.65k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.65k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.65k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.65k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.65k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 848, False: 804]
  ------------------
 1112|    848|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    848|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    848|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.65k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 885, False: 767]
  |  Branch (1115:31): [True: 158, False: 609]
  ------------------
 1116|  1.04k|#ifndef SUPPRESS_WARNINGS
 1117|  1.04k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.04k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.04k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.04k|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|  1.04k|#endif
 1120|  1.04k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|  1.04k|      } else
 1122|    610|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.65k|    }
 1124|   114k|  }
 1125|       |
 1126|  1.59k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.59k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEv:
 1129|  3.35k|void QuickTimeVideo::setMediaStream() {
 1130|  3.35k|  size_t current_position = io_->tell();
 1131|  3.35k|  DataBuf buf(4 + 1);
 1132|       |
 1133|   211k|  while (!io_->eof()) {
  ------------------
  |  Branch (1133:10): [True: 211k, False: 26]
  ------------------
 1134|   211k|    io_->readOrThrow(buf.data(), 4);
 1135|   211k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1135:9): [True: 3.33k, False: 208k]
  ------------------
 1136|  3.33k|      io_->readOrThrow(buf.data(), 4);
 1137|  3.33k|      io_->readOrThrow(buf.data(), 4);
 1138|  3.33k|      io_->readOrThrow(buf.data(), 4);
 1139|       |
 1140|  3.33k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1140:11): [True: 76, False: 3.25k]
  ------------------
 1141|     76|        currentStream_ = Video;
 1142|  3.25k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1142:16): [True: 1.18k, False: 2.07k]
  ------------------
 1143|  1.18k|        currentStream_ = Audio;
 1144|  2.07k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1144:16): [True: 113, False: 1.95k]
  ------------------
 1145|    113|        currentStream_ = Hint;
 1146|  1.95k|      else
 1147|  1.95k|        currentStream_ = GenMediaHeader;
 1148|  3.33k|      break;
 1149|  3.33k|    }
 1150|   211k|  }
 1151|       |
 1152|  3.35k|  io_->seek(current_position, BasicIo::beg);
 1153|  3.35k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1155|  2.11k|void QuickTimeVideo::timeToSampleDecoder() {
 1156|  2.11k|  DataBuf buf(4 + 1);
 1157|  2.11k|  io_->readOrThrow(buf.data(), 4);
 1158|  2.11k|  io_->readOrThrow(buf.data(), 4);
 1159|  2.11k|  uint64_t totalframes = 0;
 1160|  2.11k|  uint64_t timeOfFrames = 0;
 1161|  2.11k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1162|       |
 1163|  4.64k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1163:24): [True: 2.53k, False: 2.11k]
  ------------------
 1164|  2.53k|    io_->readOrThrow(buf.data(), 4);
 1165|  2.53k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1166|  2.53k|    totalframes = Safe::add(totalframes, temp);
 1167|  2.53k|    io_->readOrThrow(buf.data(), 4);
 1168|  2.53k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1169|  2.53k|  }
 1170|  2.11k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1170:7): [True: 300, False: 1.81k]
  ------------------
 1171|    300|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1171:9): [True: 105, False: 195]
  ------------------
 1172|    105|      timeOfFrames = 1;
 1173|    300|    xmpData_["Xmp.video.FrameRate"] =
 1174|    300|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1175|    300|  }
 1176|  2.11k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1178|  2.23k|void QuickTimeVideo::sampleDesc(size_t size) {
 1179|  2.23k|  DataBuf buf(100);
 1180|  2.23k|  size_t cur_pos = io_->tell();
 1181|  2.23k|  io_->readOrThrow(buf.data(), 4);
 1182|  2.23k|  io_->readOrThrow(buf.data(), 4);
 1183|  2.23k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1184|       |
 1185|   103k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1185:24): [True: 102k, False: 1.27k]
  ------------------
 1186|   102k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1186:9): [True: 59.6k, False: 42.9k]
  ------------------
 1187|  59.6k|      imageDescDecoder();
 1188|  42.9k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1188:14): [True: 41.9k, False: 954]
  ------------------
 1189|  41.9k|      audioDescDecoder();
 1190|    954|    else
 1191|    954|      break;
 1192|   102k|  }
 1193|  2.23k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1194|  2.23k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1196|  41.9k|void QuickTimeVideo::audioDescDecoder() {
 1197|  41.9k|  DataBuf buf(40);
 1198|  41.9k|  std::memset(buf.data(), 0x0, buf.size());
 1199|  41.9k|  buf.data()[4] = '\0';
 1200|  41.9k|  io_->readOrThrow(buf.data(), 4);
 1201|  41.9k|  size_t size = 82;
 1202|       |
 1203|  41.9k|  const TagVocabulary* td;
 1204|       |
 1205|   880k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1205:19): [True: 838k, False: 41.8k]
  ------------------
 1206|   838k|    io_->readOrThrow(buf.data(), 4);
 1207|   838k|    switch (i) {
 1208|  41.9k|      case AudioFormat:
  ------------------
  |  Branch (1208:7): [True: 41.9k, False: 796k]
  ------------------
 1209|  41.9k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1210|  41.9k|        if (td)
  ------------------
  |  Branch (1210:13): [True: 388, False: 41.5k]
  ------------------
 1211|    388|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    388|#define _(String) (String)
  ------------------
 1212|  41.5k|        else
 1213|  41.5k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1214|  41.9k|        break;
 1215|  41.9k|      case AudioVendorID:
  ------------------
  |  Branch (1215:7): [True: 41.9k, False: 796k]
  ------------------
 1216|  41.9k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1217|  41.9k|        if (td)
  ------------------
  |  Branch (1217:13): [True: 831, False: 41.1k]
  ------------------
 1218|    831|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    831|#define _(String) (String)
  ------------------
 1219|  41.9k|        break;
 1220|  41.9k|      case AudioChannels:
  ------------------
  |  Branch (1220:7): [True: 41.9k, False: 796k]
  ------------------
 1221|  41.9k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1222|  41.9k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1223|  41.9k|        break;
 1224|  41.9k|      case AudioSampleRate:
  ------------------
  |  Branch (1224:7): [True: 41.9k, False: 796k]
  ------------------
 1225|  41.9k|        xmpData_["Xmp.audio.SampleRate"] =
 1226|  41.9k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1227|  41.9k|        break;
 1228|   670k|      default:
  ------------------
  |  Branch (1228:7): [True: 670k, False: 167k]
  ------------------
 1229|   670k|        break;
 1230|   838k|    }
 1231|   838k|  }
 1232|  41.8k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1233|  41.8k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1235|  59.6k|void QuickTimeVideo::imageDescDecoder() {
 1236|  59.6k|  DataBuf buf(40);
 1237|  59.6k|  std::memset(buf.data(), 0x0, buf.size());
 1238|  59.6k|  buf.data()[4] = '\0';
 1239|  59.6k|  io_->readOrThrow(buf.data(), 4);
 1240|  59.6k|  size_t size = 82;
 1241|       |
 1242|  59.6k|  const TagVocabulary* td;
 1243|       |
 1244|   714k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1244:19): [True: 655k, False: 59.5k]
  ------------------
 1245|   655k|    io_->readOrThrow(buf.data(), 4);
 1246|       |
 1247|   655k|    switch (i) {
 1248|  59.5k|      case codec:
  ------------------
  |  Branch (1248:7): [True: 59.5k, False: 595k]
  ------------------
 1249|  59.5k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1250|  59.5k|        if (td)
  ------------------
  |  Branch (1250:13): [True: 536, False: 59.0k]
  ------------------
 1251|    536|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    536|#define _(String) (String)
  ------------------
 1252|  59.0k|        else
 1253|  59.0k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1254|  59.5k|        break;
 1255|  59.5k|      case VendorID:
  ------------------
  |  Branch (1255:7): [True: 59.5k, False: 595k]
  ------------------
 1256|  59.5k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1257|  59.5k|        if (td)
  ------------------
  |  Branch (1257:13): [True: 1.35k, False: 58.2k]
  ------------------
 1258|  1.35k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.35k|#define _(String) (String)
  ------------------
 1259|  59.5k|        break;
 1260|  59.5k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1260:7): [True: 59.5k, False: 595k]
  ------------------
 1261|  59.5k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1262|  59.5k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1263|  59.5k|        break;
 1264|  59.5k|      case XResolution:
  ------------------
  |  Branch (1264:7): [True: 59.5k, False: 595k]
  ------------------
 1265|  59.5k|        xmpData_["Xmp.video.XResolution"] =
 1266|  59.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1267|  59.5k|        break;
 1268|  59.5k|      case YResolution:
  ------------------
  |  Branch (1268:7): [True: 59.5k, False: 595k]
  ------------------
 1269|  59.5k|        xmpData_["Xmp.video.YResolution"] =
 1270|  59.5k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1271|  59.5k|        io_->readOrThrow(buf.data(), 3);
 1272|  59.5k|        size -= 3;
 1273|  59.5k|        break;
 1274|  59.5k|      case CompressorName:
  ------------------
  |  Branch (1274:7): [True: 59.5k, False: 595k]
  ------------------
 1275|  59.5k|        io_->readOrThrow(buf.data(), 32);
 1276|  59.5k|        size -= 32;
 1277|  59.5k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1278|  59.5k|        break;
 1279|   297k|      default:
  ------------------
  |  Branch (1279:7): [True: 297k, False: 357k]
  ------------------
 1280|   297k|        break;
 1281|   655k|    }
 1282|   655k|  }
 1283|  59.5k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1284|  59.5k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1285|  59.5k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1287|  2.38k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1288|  2.38k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1289|  2.38k|  DataBuf buf(4 + 1);
 1290|  2.38k|  io_->readOrThrow(buf.data(), 4);
 1291|  2.38k|  io_->readOrThrow(buf.data(), 4);
 1292|  2.38k|  uint32_t noOfEntries;
 1293|       |
 1294|  2.38k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1295|       |
 1296|  16.5k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1296:24): [True: 14.2k, False: 2.29k]
  |  Branch (1296:43): [True: 14.1k, False: 92]
  ------------------
 1297|  14.1k|    decodeBlock(recursion_depth + 1);
 1298|  14.1k|  }
 1299|  2.38k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1301|  4.08k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1302|  4.08k|  DataBuf buf(3);
 1303|  4.08k|  std::memset(buf.data(), 0x0, buf.size());
 1304|  4.08k|  buf.data()[2] = '\0';
 1305|  4.08k|  currentStream_ = Video;
 1306|       |
 1307|  4.08k|  const TagDetails* td;
 1308|       |
 1309|  22.8k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1309:19): [True: 18.8k, False: 4.08k]
  ------------------
 1310|  18.8k|    io_->readOrThrow(buf.data(), 2);
 1311|       |
 1312|  18.8k|    switch (i) {
 1313|  3.49k|      case GraphicsMode:
  ------------------
  |  Branch (1313:7): [True: 3.49k, False: 15.3k]
  ------------------
 1314|  3.49k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1315|  3.49k|        if (td)
  ------------------
  |  Branch (1315:13): [True: 2.91k, False: 585]
  ------------------
 1316|  2.91k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.91k|#define _(String) (String)
  ------------------
 1317|  3.49k|        break;
 1318|  3.49k|      case OpColor:
  ------------------
  |  Branch (1318:7): [True: 3.49k, False: 15.3k]
  ------------------
 1319|  3.49k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1320|  3.49k|        break;
 1321|  11.8k|      default:
  ------------------
  |  Branch (1321:7): [True: 11.8k, False: 6.98k]
  ------------------
 1322|  11.8k|        break;
 1323|  18.8k|    }
 1324|  18.8k|  }
 1325|  4.08k|  io_->readOrThrow(buf.data(), size % 2);
 1326|  4.08k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1328|  8.94k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1329|  8.94k|  size_t cur_pos = io_->tell();
 1330|  8.94k|  DataBuf buf(100);
 1331|  8.94k|  std::memset(buf.data(), 0x0, buf.size());
 1332|  8.94k|  buf.data()[4] = '\0';
 1333|       |
 1334|  8.94k|  const TagVocabulary* tv;
 1335|       |
 1336|  53.6k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1336:19): [True: 44.6k, False: 8.93k]
  ------------------
 1337|  44.6k|    io_->readOrThrow(buf.data(), 4);
 1338|       |
 1339|  44.6k|    switch (i) {
  ------------------
  |  Branch (1339:13): [True: 26.8k, False: 17.8k]
  ------------------
 1340|  8.93k|      case HandlerClass:
  ------------------
  |  Branch (1340:7): [True: 8.93k, False: 35.7k]
  ------------------
 1341|  8.93k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1342|  8.93k|        if (tv) {
  ------------------
  |  Branch (1342:13): [True: 4.34k, False: 4.59k]
  ------------------
 1343|  4.34k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1343:15): [True: 1.56k, False: 2.77k]
  ------------------
 1344|  1.56k|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|  1.56k|#define _(String) (String)
  ------------------
 1345|  2.77k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1345:20): [True: 1.02k, False: 1.74k]
  ------------------
 1346|  1.02k|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|  1.02k|#define _(String) (String)
  ------------------
 1347|  4.34k|        }
 1348|  8.93k|        break;
 1349|  8.93k|      case HandlerType:
  ------------------
  |  Branch (1349:7): [True: 8.93k, False: 35.7k]
  ------------------
 1350|  8.93k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1351|  8.93k|        if (tv) {
  ------------------
  |  Branch (1351:13): [True: 6.70k, False: 2.23k]
  ------------------
 1352|  6.70k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1352:15): [True: 2.23k, False: 4.47k]
  ------------------
 1353|  2.23k|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  2.23k|#define _(String) (String)
  ------------------
 1354|  4.47k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1354:20): [True: 1.84k, False: 2.63k]
  ------------------
 1355|  1.84k|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.84k|#define _(String) (String)
  ------------------
 1356|  6.70k|        }
 1357|  8.93k|        break;
 1358|  8.93k|      case HandlerVendorID:
  ------------------
  |  Branch (1358:7): [True: 8.93k, False: 35.7k]
  ------------------
 1359|  8.93k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1360|  8.93k|        if (tv) {
  ------------------
  |  Branch (1360:13): [True: 3.49k, False: 5.44k]
  ------------------
 1361|  3.49k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1361:15): [True: 303, False: 3.18k]
  ------------------
 1362|    303|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    303|#define _(String) (String)
  ------------------
 1363|  3.18k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1363:20): [True: 1.00k, False: 2.18k]
  ------------------
 1364|  1.00k|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|  1.00k|#define _(String) (String)
  ------------------
 1365|  3.49k|        }
 1366|  8.93k|        break;
 1367|  44.6k|    }
 1368|  44.6k|  }
 1369|  8.93k|  io_->seek(cur_pos + size, BasicIo::beg);
 1370|  8.93k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1372|  3.22k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1373|  3.22k|  DataBuf buf(5);
 1374|  3.22k|  std::memset(buf.data(), 0x0, buf.size());
 1375|  3.22k|  buf.data()[4] = '\0';
 1376|  3.22k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1377|  3.22k|  const TagVocabulary* td;
 1378|       |
 1379|   387k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1379:19): [True: 384k, False: 3.22k]
  ------------------
 1380|   384k|    io_->readOrThrow(buf.data(), 4);
 1381|   384k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1382|       |
 1383|   384k|    switch (i) {
 1384|  3.20k|      case 0:
  ------------------
  |  Branch (1384:7): [True: 3.20k, False: 381k]
  ------------------
 1385|  3.20k|        if (td)
  ------------------
  |  Branch (1385:13): [True: 1.85k, False: 1.35k]
  ------------------
 1386|  1.85k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  1.85k|#define _(String) (String)
  ------------------
 1387|  3.20k|        break;
 1388|  1.00k|      case 1:
  ------------------
  |  Branch (1388:7): [True: 1.00k, False: 383k]
  ------------------
 1389|  1.00k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1390|  1.00k|        break;
 1391|   380k|      default:
  ------------------
  |  Branch (1391:7): [True: 380k, False: 4.20k]
  ------------------
 1392|   380k|        if (td)
  ------------------
  |  Branch (1392:13): [True: 979, False: 379k]
  ------------------
 1393|    979|          v->read(_(td->label_));
  ------------------
  |  |   40|    979|#define _(String) (String)
  ------------------
 1394|   379k|        else
 1395|   379k|          v->read(Exiv2::toString(buf.data()));
 1396|   380k|        break;
 1397|   384k|    }
 1398|   384k|  }
 1399|  3.22k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1400|  3.22k|  io_->readOrThrow(buf.data(), size % 4);
 1401|  3.22k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1403|  3.34k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1404|  3.34k|  DataBuf buf(5);
 1405|  3.34k|  std::memset(buf.data(), 0x0, buf.size());
 1406|  3.34k|  buf.data()[4] = '\0';
 1407|  3.34k|  int64_t time_scale = 1;
 1408|       |
 1409|  23.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1409:19): [True: 19.9k, False: 3.34k]
  ------------------
 1410|  19.9k|    io_->readOrThrow(buf.data(), 4);
 1411|       |
 1412|  19.9k|    switch (i) {
 1413|  3.29k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1413:7): [True: 3.29k, False: 16.6k]
  ------------------
 1414|  3.29k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1414:13): [True: 1.42k, False: 1.87k]
  ------------------
 1415|  1.42k|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1416|  1.87k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1416:18): [True: 496, False: 1.37k]
  ------------------
 1417|    496|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1418|  3.29k|        break;
 1419|  3.29k|      case MediaCreateDate:
  ------------------
  |  Branch (1419:7): [True: 3.29k, False: 16.6k]
  ------------------
 1420|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1421|  3.29k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1421:13): [True: 1.42k, False: 1.86k]
  ------------------
 1422|  1.42k|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1423|  1.86k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1423:18): [True: 496, False: 1.37k]
  ------------------
 1424|    496|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1425|  3.29k|        break;
 1426|  3.28k|      case MediaModifyDate:
  ------------------
  |  Branch (1426:7): [True: 3.28k, False: 16.6k]
  ------------------
 1427|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1428|  3.28k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1428:13): [True: 1.41k, False: 1.86k]
  ------------------
 1429|  1.41k|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1430|  1.86k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1430:18): [True: 496, False: 1.37k]
  ------------------
 1431|    496|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1432|  3.28k|        break;
 1433|  3.28k|      case MediaTimeScale:
  ------------------
  |  Branch (1433:7): [True: 3.28k, False: 16.6k]
  ------------------
 1434|  3.28k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 1.41k, False: 1.86k]
  ------------------
 1435|  1.41k|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1436|  1.86k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 496, False: 1.37k]
  ------------------
 1437|    496|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1438|  3.28k|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1439|  3.28k|        mdhdTimeScale_ = time_scale;
 1440|  3.28k|        break;
 1441|  3.28k|      case MediaDuration:
  ------------------
  |  Branch (1441:7): [True: 3.28k, False: 16.6k]
  ------------------
 1442|  3.28k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1442:13): [True: 1.41k, False: 1.86k]
  ------------------
 1443|  1.41k|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1443:49): [True: 1.41k, False: 0]
  ------------------
 1444|  1.86k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1444:18): [True: 496, False: 1.37k]
  ------------------
 1445|    496|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1445:49): [True: 496, False: 0]
  ------------------
 1446|  3.28k|        break;
 1447|  3.28k|      case MediaLanguageCode:
  ------------------
  |  Branch (1447:7): [True: 3.28k, False: 16.6k]
  ------------------
 1448|  3.28k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 1.41k, False: 1.86k]
  ------------------
 1449|  1.41k|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1450|  1.86k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 496, False: 1.37k]
  ------------------
 1451|    496|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1452|  3.28k|        break;
 1453|       |
 1454|    240|      default:
  ------------------
  |  Branch (1454:7): [True: 240, False: 19.7k]
  ------------------
 1455|    240|        break;
 1456|  19.9k|    }
 1457|  19.9k|  }
 1458|  3.34k|  io_->readOrThrow(buf.data(), size % 4);
 1459|  3.34k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1461|  2.23k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1462|  2.23k|  DataBuf buf(5);
 1463|  2.23k|  std::memset(buf.data(), 0x0, buf.size());
 1464|  2.23k|  buf.data()[4] = '\0';
 1465|  2.23k|  int64_t temp = 0;
 1466|       |
 1467|  47.4k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1467:19): [True: 45.2k, False: 2.23k]
  ------------------
 1468|  45.2k|    io_->readOrThrow(buf.data(), 4);
 1469|       |
 1470|  45.2k|    switch (i) {
 1471|  2.17k|      case TrackHeaderVersion:
  ------------------
  |  Branch (1471:7): [True: 2.17k, False: 43.0k]
  ------------------
 1472|  2.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1472:13): [True: 112, False: 2.05k]
  ------------------
 1473|    112|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1474|  2.05k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1474:18): [True: 858, False: 1.20k]
  ------------------
 1475|    858|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1476|  2.17k|        break;
 1477|  2.16k|      case TrackCreateDate:
  ------------------
  |  Branch (1477:7): [True: 2.16k, False: 43.0k]
  ------------------
 1478|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1479|  2.16k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1479:13): [True: 112, False: 2.05k]
  ------------------
 1480|    112|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1481|  2.05k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1481:18): [True: 858, False: 1.19k]
  ------------------
 1482|    858|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1483|  2.16k|        break;
 1484|  2.16k|      case TrackModifyDate:
  ------------------
  |  Branch (1484:7): [True: 2.16k, False: 43.0k]
  ------------------
 1485|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1486|  2.16k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1486:13): [True: 112, False: 2.05k]
  ------------------
 1487|    112|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1488|  2.05k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1488:18): [True: 858, False: 1.19k]
  ------------------
 1489|    858|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1490|  2.16k|        break;
 1491|  2.16k|      case TrackID:
  ------------------
  |  Branch (1491:7): [True: 2.16k, False: 43.0k]
  ------------------
 1492|  2.16k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 112, False: 2.05k]
  ------------------
 1493|    112|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1494|  2.05k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 858, False: 1.19k]
  ------------------
 1495|    858|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1496|  2.16k|        break;
 1497|  2.16k|      case TrackDuration:
  ------------------
  |  Branch (1497:7): [True: 2.16k, False: 43.0k]
  ------------------
 1498|  2.16k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 111, False: 2.05k]
  ------------------
 1499|    111|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1499:49): [True: 111, False: 0]
  ------------------
 1500|  2.05k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 858, False: 1.19k]
  ------------------
 1501|    858|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1501:49): [True: 858, False: 0]
  ------------------
 1502|  2.16k|        break;
 1503|  2.11k|      case TrackLayer:
  ------------------
  |  Branch (1503:7): [True: 2.11k, False: 43.1k]
  ------------------
 1504|  2.11k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 74, False: 2.04k]
  ------------------
 1505|     74|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1506|  2.04k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 858, False: 1.18k]
  ------------------
 1507|    858|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1508|  2.11k|        break;
 1509|  2.11k|      case TrackVolume:
  ------------------
  |  Branch (1509:7): [True: 2.11k, False: 43.1k]
  ------------------
 1510|  2.11k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 73, False: 2.04k]
  ------------------
 1511|     73|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1512|  2.04k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 858, False: 1.18k]
  ------------------
 1513|    858|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1514|  2.11k|        break;
 1515|  2.10k|      case ImageWidth:
  ------------------
  |  Branch (1515:7): [True: 2.10k, False: 43.1k]
  ------------------
 1516|  2.10k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1516:13): [True: 71, False: 2.03k]
  ------------------
 1517|     71|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1518|     71|          xmpData_["Xmp.video.Width"] = temp;
 1519|     71|          width_ = temp;
 1520|     71|        }
 1521|  2.10k|        break;
 1522|  2.10k|      case ImageHeight:
  ------------------
  |  Branch (1522:7): [True: 2.10k, False: 43.1k]
  ------------------
 1523|  2.10k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1523:13): [True: 71, False: 2.03k]
  ------------------
 1524|     71|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1525|     71|          xmpData_["Xmp.video.Height"] = temp;
 1526|     71|          height_ = temp;
 1527|     71|        }
 1528|  2.10k|        break;
 1529|  25.9k|      default:
  ------------------
  |  Branch (1529:7): [True: 25.9k, False: 19.2k]
  ------------------
 1530|  25.9k|        break;
 1531|  45.2k|    }
 1532|  45.2k|  }
 1533|  2.23k|  io_->readOrThrow(buf.data(), size % 4);
 1534|  2.23k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1536|    196|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1537|    196|  DataBuf buf(5);
 1538|    196|  std::memset(buf.data(), 0x0, buf.size());
 1539|    196|  buf.data()[4] = '\0';
 1540|       |
 1541|  2.64k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1541:19): [True: 2.45k, False: 196]
  ------------------
 1542|  2.45k|    io_->readOrThrow(buf.data(), 4);
 1543|       |
 1544|  2.45k|    switch (i) {
 1545|    154|      case MovieHeaderVersion:
  ------------------
  |  Branch (1545:7): [True: 154, False: 2.29k]
  ------------------
 1546|    154|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1547|    154|        break;
 1548|    153|      case CreateDate:
  ------------------
  |  Branch (1548:7): [True: 153, False: 2.30k]
  ------------------
 1549|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1550|    153|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1551|    153|        break;
 1552|    125|      case ModifyDate:
  ------------------
  |  Branch (1552:7): [True: 125, False: 2.32k]
  ------------------
 1553|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1554|    125|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1555|    125|        break;
 1556|    124|      case TimeScale:
  ------------------
  |  Branch (1556:7): [True: 124, False: 2.32k]
  ------------------
 1557|    124|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1558|    124|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1559|    124|        break;
 1560|    117|      case Duration:
  ------------------
  |  Branch (1560:7): [True: 117, False: 2.33k]
  ------------------
 1561|    117|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1561:13): [True: 117, False: 0]
  ------------------
 1562|    117|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1563|    117|        }
 1564|    117|        break;
 1565|    117|      case PreferredRate:
  ------------------
  |  Branch (1565:7): [True: 117, False: 2.33k]
  ------------------
 1566|    117|        xmpData_["Xmp.video.PreferredRate"] =
 1567|    117|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1568|    117|        break;
 1569|    117|      case PreferredVolume:
  ------------------
  |  Branch (1569:7): [True: 117, False: 2.33k]
  ------------------
 1570|    117|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1571|    117|        break;
 1572|     81|      case PreviewTime:
  ------------------
  |  Branch (1572:7): [True: 81, False: 2.37k]
  ------------------
 1573|     81|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1574|     81|        break;
 1575|     81|      case PreviewDuration:
  ------------------
  |  Branch (1575:7): [True: 81, False: 2.37k]
  ------------------
 1576|     81|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1577|     81|        break;
 1578|     81|      case PosterTime:
  ------------------
  |  Branch (1578:7): [True: 81, False: 2.37k]
  ------------------
 1579|     81|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1580|     81|        break;
 1581|     81|      case SelectionTime:
  ------------------
  |  Branch (1581:7): [True: 81, False: 2.37k]
  ------------------
 1582|     81|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1583|     81|        break;
 1584|     81|      case SelectionDuration:
  ------------------
  |  Branch (1584:7): [True: 81, False: 2.37k]
  ------------------
 1585|     81|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1586|     81|        break;
 1587|     81|      case CurrentTime:
  ------------------
  |  Branch (1587:7): [True: 81, False: 2.37k]
  ------------------
 1588|     81|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1589|     81|        break;
 1590|     81|      case NextTrackID:
  ------------------
  |  Branch (1590:7): [True: 81, False: 2.37k]
  ------------------
 1591|     81|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1592|     81|        break;
 1593|    979|      default:
  ------------------
  |  Branch (1593:7): [True: 979, False: 1.47k]
  ------------------
 1594|    979|        break;
 1595|  2.45k|    }
 1596|  2.45k|  }
 1597|    196|  io_->readOrThrow(buf.data(), size % 4);
 1598|    196|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1600|  3.06k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool /*create*/) {
 1601|  3.06k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io));
 1602|  3.06k|  if (!image->good()) {
  ------------------
  |  Branch (1602:7): [True: 8, False: 3.05k]
  ------------------
 1603|      8|    return nullptr;
 1604|      8|  }
 1605|  3.05k|  return image;
 1606|  3.06k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1608|  16.6k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1609|  16.6k|  auto buf = DataBuf(12);
 1610|  16.6k|  iIo.read(buf.data(), 12);
 1611|       |
 1612|  16.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1612:7): [True: 0, False: 16.6k]
  |  Branch (1612:22): [True: 342, False: 16.3k]
  ------------------
 1613|    342|    return false;
 1614|    342|  }
 1615|  16.3k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1616|       |
 1617|  16.3k|  bool matched = false;
 1618|       |
 1619|   114k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1619:24): [True: 114k, False: 4.85k]
  ------------------
 1620|   114k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1621|   114k|    if (tmp == 0) {
  ------------------
  |  Branch (1621:9): [True: 11.4k, False: 102k]
  ------------------
 1622|       |      // we only match if we actually know the video type. This is done
 1623|       |      // to avoid matching just on ftyp because bmffimage also has that
 1624|       |      // header.
 1625|  11.4k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1625:11): [True: 9.18k, False: 2.30k]
  ------------------
 1626|  9.18k|        matched = true;
 1627|  9.18k|      }
 1628|  11.4k|      break;
 1629|  11.4k|    }
 1630|   114k|  }
 1631|       |
 1632|  16.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (1632:7): [True: 16.3k, False: 0]
  |  Branch (1632:19): [True: 0, False: 0]
  ------------------
 1633|  16.3k|    iIo.seek(0L, BasicIo::beg);
 1634|  16.3k|  }
 1635|       |
 1636|  16.3k|  return matched;
 1637|  16.6k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   148k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   148k|  const char ignoreList[13][5] = {
  505|   148k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   148k|  };
  507|       |
  508|   148k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.85M, False: 136k]
  ------------------
  509|  1.85M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 12.2k, False: 1.83M]
  ------------------
  510|  12.2k|      return true;
  511|       |
  512|   136k|  return false;
  513|   148k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  69.5k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  69.5k|  const char ignoreList[8][5] = {
  524|  69.5k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  69.5k|  };
  526|       |
  527|  69.5k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 524k, False: 58.7k]
  ------------------
  528|   524k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 10.8k, False: 513k]
  ------------------
  529|  10.8k|      return true;
  530|       |
  531|  58.7k|  return false;
  532|  69.5k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  3.21M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  3.21M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  3.21M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  3.21M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  3.77M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  4.15k|static std::string readString(BasicIo& io, size_t size) {
  628|  4.15k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  4.15k|  Exiv2::DataBuf str(size + 1);
  630|  4.15k|  io.readOrThrow(str.data(), size);
  631|  4.15k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  4.15k|  return Exiv2::toString(str.data());
  633|  4.15k|}

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

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

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

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

_ZN4Safe3addIjEET_S1_S1_:
  137|  10.1k|T add(T summand_1, T summand_2) {
  138|  10.1k|  T res = 0;
  139|  10.1k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 14, False: 10.1k]
  ------------------
  140|     14|    throw std::overflow_error("Overflow in addition");
  141|     14|  }
  142|  10.1k|  return res;
  143|  10.1k|}
_ZN4Safe8Internal20builtin_add_overflowIjEEbT_S2_RS2_:
   96|  10.1k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  10.1k|#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|  10.1k|    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|  10.1k|}
_ZN4Safe3addImEET_S1_S1_:
  137|  1.29M|T add(T summand_1, T summand_2) {
  138|  1.29M|  T res = 0;
  139|  1.29M|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 3, False: 1.29M]
  ------------------
  140|      3|    throw std::overflow_error("Overflow in addition");
  141|      3|  }
  142|  1.29M|  return res;
  143|  1.29M|}
_ZN4Safe8Internal20builtin_add_overflowImEEbT_S2_RS2_:
   96|  1.29M|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  1.29M|#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|  1.29M|    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|  1.29M|}
_ZN4Safe3addIlEET_S1_S1_:
  137|  44.6k|T add(T summand_1, T summand_2) {
  138|  44.6k|  T res = 0;
  139|  44.6k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 44.6k]
  ------------------
  140|      1|    throw std::overflow_error("Overflow in addition");
  141|      1|  }
  142|  44.6k|  return res;
  143|  44.6k|}
_ZN4Safe8Internal20builtin_add_overflowIlEEbT_S2_RS2_:
   96|  44.6k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  44.6k|#if (defined(__GNUC__) || defined(__clang__)) && (__GNUC__ >= 5 || __clang_major__ >= 3)
   98|       |  if constexpr (std::is_same_v<T, int>)
   99|       |    return __builtin_sadd_overflow(summand_1, summand_2, &result);
  100|       |  else if constexpr (std::is_same_v<T, long>)
  101|  44.6k|    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|       |    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|  44.6k|}

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

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

_ZN5Exiv28Internal15sonyTagDecipherEtPKhmPNS0_13TiffComponentE:
 2331|    501|DataBuf sonyTagDecipher(uint16_t tag, const byte* bytes, size_t size, TiffComponent* object) {
 2332|    501|  return sonyTagCipher(tag, bytes, size, object, true);
 2333|    501|}
_ZN5Exiv28Internal15sonyTagEncipherEtPKhmPNS0_13TiffComponentE:
 2334|    154|DataBuf sonyTagEncipher(uint16_t tag, const byte* bytes, size_t size, TiffComponent* object) {
 2335|    154|  return sonyTagCipher(tag, bytes, size, object, false);
 2336|    154|}
sonymn_int.cpp:_ZN5Exiv28InternalL13sonyTagCipherEtPKhmPKNS0_13TiffComponentEb:
 2307|    655|                             bool bDecipher) {
 2308|    655|  DataBuf b(bytes, size);  // copy the data
 2309|       |
 2310|       |  // initialize the code table
 2311|    655|  byte code[256];
 2312|   163k|  for (uint32_t i = 0; i < 249; i++) {
  ------------------
  |  Branch (2312:24): [True: 163k, False: 655]
  ------------------
 2313|   163k|    if (bDecipher) {
  ------------------
  |  Branch (2313:9): [True: 124k, False: 38.3k]
  ------------------
 2314|   124k|      code[(i * i * i) % 249] = static_cast<byte>(i);
 2315|   124k|    } else {
 2316|  38.3k|      code[i] = (i * i * i) % 249;
 2317|  38.3k|    }
 2318|   163k|  }
 2319|  5.24k|  for (uint32_t i = 249; i < 256; i++) {
  ------------------
  |  Branch (2319:26): [True: 4.58k, False: 655]
  ------------------
 2320|  4.58k|    code[i] = static_cast<byte>(i);
 2321|  4.58k|  }
 2322|       |
 2323|       |  // code byte-by-byte
 2324|  58.4k|  for (uint32_t i = 0; i < size; i++) {
  ------------------
  |  Branch (2324:24): [True: 57.7k, False: 655]
  ------------------
 2325|  57.7k|    b.write_uint8(i, code[bytes[i]]);
 2326|  57.7k|  }
 2327|       |
 2328|    655|  return b;
 2329|    655|}

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  20.7k|  static constexpr auto tagList() {
   30|  20.7k|    return tagInfo_;
   31|  20.7k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|  1.05k|  static constexpr auto tagListCs() {
   34|  1.05k|    return tagInfoCs_;
   35|  1.05k|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|  1.40k|  static constexpr auto tagListCs2() {
   38|  1.40k|    return tagInfoCs2_;
   39|  1.40k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  18.6k|  static constexpr auto tagListFp() {
   42|  18.6k|    return tagInfoFp_;
   43|  18.6k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  2.32k|  static constexpr auto tagListSonyMisc1() {
   46|  2.32k|    return tagInfoSonyMisc1_;
   47|  2.32k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|    324|  static constexpr auto tagListSonyMisc2b() {
   50|    324|    return tagInfoSonyMisc2b_;
   51|    324|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  3.90k|  static constexpr auto tagListSonyMisc3c() {
   54|  3.90k|    return tagInfoSonyMisc3c_;
   55|  3.90k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   501k|  static constexpr auto tagListSonySInfo1() {
   58|   501k|    return tagInfoSonySInfo1_;
   59|   501k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1767|  1.47M|const TagInfo* ifdTagList() {
 1768|  1.47M|  return ifdTagInfo;
 1769|  1.47M|}
_ZN5Exiv28Internal11exifTagListEv:
 2166|   255k|const TagInfo* exifTagList() {
 2167|   255k|  return exifTagInfo;
 2168|   255k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2382|   122k|const TagInfo* gpsTagList() {
 2383|   122k|  return gpsTagInfo;
 2384|   122k|}
_ZN5Exiv28Internal10iopTagListEv:
 2457|  56.0k|const TagInfo* iopTagList() {
 2458|  56.0k|  return iopTagInfo;
 2459|  56.0k|}
_ZN5Exiv28Internal9mnTagListEv:
 2473|  14.4k|const TagInfo* mnTagList() {
 2474|  14.4k|  return mnTagInfo;
 2475|  14.4k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2477|   882k|bool isMakerIfd(IfdId ifdId) {
 2478|   882k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2478:12): [True: 882k, False: 0]
  ------------------
 2479|   882k|    return std::string_view("Makernote") == ii->ifdName_;
 2480|      0|  return false;
 2481|   882k|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2483|  2.27M|bool isExifIfd(IfdId ifdId) {
 2484|  2.27M|  switch (ifdId) {
 2485|   425k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2485:5): [True: 425k, False: 1.85M]
  ------------------
 2486|   560k|    case IfdId::exifId:
  ------------------
  |  Branch (2486:5): [True: 134k, False: 2.14M]
  ------------------
 2487|   627k|    case IfdId::gpsId:
  ------------------
  |  Branch (2487:5): [True: 67.7k, False: 2.21M]
  ------------------
 2488|   680k|    case IfdId::iopId:
  ------------------
  |  Branch (2488:5): [True: 52.3k, False: 2.22M]
  ------------------
 2489|   727k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2489:5): [True: 47.3k, False: 2.23M]
  ------------------
 2490|   738k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2490:5): [True: 11.2k, False: 2.26M]
  ------------------
 2491|   739k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2491:5): [True: 539, False: 2.27M]
  ------------------
 2492|   739k|    case IfdId::mpfId:
  ------------------
  |  Branch (2492:5): [True: 0, False: 2.27M]
  ------------------
 2493|   938k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2493:5): [True: 198k, False: 2.07M]
  ------------------
 2494|  1.06M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2494:5): [True: 125k, False: 2.15M]
  ------------------
 2495|  1.16M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2495:5): [True: 103k, False: 2.17M]
  ------------------
 2496|  1.22M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2496:5): [True: 60.5k, False: 2.21M]
  ------------------
 2497|  1.24M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2497:5): [True: 15.9k, False: 2.26M]
  ------------------
 2498|  1.25M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2498:5): [True: 9.77k, False: 2.26M]
  ------------------
 2499|  1.26M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2499:5): [True: 15.0k, False: 2.26M]
  ------------------
 2500|  1.27M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2500:5): [True: 4.23k, False: 2.27M]
  ------------------
 2501|  1.28M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2501:5): [True: 8.97k, False: 2.26M]
  ------------------
 2502|  1.29M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2502:5): [True: 15.1k, False: 2.26M]
  ------------------
 2503|  1.39M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2503:5): [True: 98.6k, False: 2.17M]
  ------------------
 2504|  1.39M|      return true;
 2505|   882k|    default:
  ------------------
  |  Branch (2505:5): [True: 882k, False: 1.39M]
  ------------------
 2506|   882k|      return false;
 2507|  2.27M|  }
 2508|  2.27M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2518|  3.05M|const TagInfo* tagList(IfdId ifdId) {
 2519|  3.05M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2519:12): [True: 3.05M, False: 0]
  ------------------
 2520|  3.05M|    if (ii->tagList_)
  ------------------
  |  Branch (2520:9): [True: 3.05M, False: 0]
  ------------------
 2521|  3.05M|      return ii->tagList_();
 2522|      0|  return nullptr;
 2523|  3.05M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2525|  2.27M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2526|  2.27M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2526:12): [True: 2.27M, False: 0]
  ------------------
 2527|  2.27M|    int idx = 0;
 2528|   179M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2528:19): [True: 178M, False: 1.25M]
  ------------------
 2529|   178M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2529:11): [True: 1.02M, False: 177M]
  ------------------
 2530|  1.02M|        break;
 2531|   178M|    }
 2532|  2.27M|    return ti + idx;
 2533|  2.27M|  }
 2534|      0|  return nullptr;
 2535|  2.27M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2537|   781k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2538|   781k|  if (tagName.empty())
  ------------------
  |  Branch (2538:7): [True: 0, False: 781k]
  ------------------
 2539|      0|    return nullptr;
 2540|   781k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2540:12): [True: 781k, False: 0]
  ------------------
 2541|  44.2M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2541:23): [True: 44.2M, False: 55.8k]
  ------------------
 2542|  44.2M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2542:11): [True: 725k, False: 43.4M]
  ------------------
 2543|   725k|        return ti + idx;
 2544|   725k|      }
 2545|  44.2M|    }
 2546|   781k|  }
 2547|  55.8k|  return nullptr;
 2548|   781k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2550|  5.06M|IfdId groupId(const std::string& groupName) {
 2551|  5.06M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2551:12): [True: 5.06M, False: 0]
  ------------------
 2552|  5.06M|    return IfdId{ii->ifdId_};
 2553|      0|  return IfdId::ifdIdNotSet;
 2554|  5.06M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2562|  1.47M|const char* groupName(IfdId ifdId) {
 2563|  1.47M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2563:12): [True: 1.47M, False: 0]
  ------------------
 2564|  1.47M|    return ii->groupName_;
 2565|      0|  return groupInfo[0].groupName_;
 2566|  1.47M|}
_ZN5Exiv28Internal7fnumberEf:
 2597|    211|float fnumber(float apertureValue) {
 2598|    211|  float result = std::exp2(apertureValue / 2.F);
 2599|    211|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2599:7): [True: 7, False: 204]
  ------------------
 2600|      7|    result = 3.5F;
 2601|      7|  }
 2602|    211|  return result;
 2603|    211|}
_ZN5Exiv28Internal12exposureTimeEf:
 2605|    211|URational exposureTime(float shutterSpeedValue) {
 2606|    211|  URational ur(1, 1);
 2607|    211|  const double tmp = std::exp2(shutterSpeedValue);
 2608|    211|  if (tmp > 1) {
  ------------------
  |  Branch (2608:7): [True: 80, False: 131]
  ------------------
 2609|     80|    const double x = std::round(tmp);
 2610|       |    // Check that x is within the range of a uint32_t before casting.
 2611|     80|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2611:9): [True: 37, False: 43]
  ------------------
 2612|     37|      ur.second = static_cast<uint32_t>(x);
 2613|     37|    }
 2614|    131|  } else {
 2615|    131|    const double x = std::round(1 / tmp);
 2616|       |    // Check that x is within the range of a uint32_t before casting.
 2617|    131|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2617:9): [True: 131, False: 0]
  |  Branch (2617:19): [True: 131, False: 0]
  ------------------
 2618|    131|      ur.first = static_cast<uint32_t>(x);
 2619|    131|    }
 2620|    131|  }
 2621|    211|  return ur;
 2622|    211|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2624|   781k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2625|   781k|  auto ti = tagInfo(tagName, ifdId);
 2626|   781k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2626:7): [True: 725k, False: 55.8k]
  |  Branch (2626:13): [True: 725k, False: 0]
  ------------------
 2627|   725k|    return ti->tag_;
 2628|  55.8k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2628:7): [True: 0, False: 55.8k]
  ------------------
 2629|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2630|  55.8k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2631|  55.8k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3244|  5.31k|const TagInfo* tagList(const std::string& groupName) {
 3245|  5.31k|  auto ii = Exiv2::find(groupInfo, groupName);
 3246|  5.31k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3246:7): [True: 0, False: 5.31k]
  |  Branch (3246:14): [True: 0, False: 5.31k]
  ------------------
 3247|      0|    return nullptr;
 3248|      0|  }
 3249|  5.31k|  return ii->tagList_();
 3250|  5.31k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  20.8M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  20.8M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 20.8M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 4.17M, False: 16.6M]
  |  Branch (42:86): [True: 19.5k, False: 16.6M]
  ------------------
   43|  4.19M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 13.4k, False: 4.17M]
  ------------------
   44|  20.8M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  20.4k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  20.4k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 6.55k, False: 13.8k]
  |  Branch (48:20): [True: 0, False: 13.8k]
  ------------------
   49|  6.55k|    wroteHeader_ = true;
   50|  20.4k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  3.96M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  3.96M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 13.7k, False: 3.94M]
  |  Branch (53:24): [True: 13.7k, False: 0]
  ------------------
   54|  13.7k|    io_.write(pHeader_, size_);
   55|  13.7k|    wroteHeader_ = true;
   56|  13.7k|  }
   57|  3.96M|  return io_.write(pData, wcount);
   58|  3.96M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  29.6k|int IoWrapper::putb(byte data) {
   61|  29.6k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 29.6k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  29.6k|  return io_.putb(data);
   66|  29.6k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     30|void IoWrapper::setTarget(int id, size_t target) {
   69|     30|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 30]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     30|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 14, False: 16]
  ------------------
   73|     14|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     30|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   117k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   117k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  45.2k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  45.2k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  13.8k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  13.8k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  13.8k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  30.4k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  30.4k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  4.22k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  4.22k|    cfgSelFct_(cfgSelFct),
   99|  4.22k|    arraySet_(arraySet),
  100|  4.22k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  4.22k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  6.01M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  6.01M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  6.05M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  39.9k|    TiffComponent(rhs),
  125|  39.9k|    tiffType_(rhs.tiffType_),
  126|  39.9k|    count_(rhs.count_),
  127|  39.9k|    offset_(rhs.offset_),
  128|  39.9k|    size_(rhs.size_),
  129|  39.9k|    pData_(rhs.pData_),
  130|  39.9k|    idx_(rhs.idx_),
  131|  39.9k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 21.7k, False: 18.1k]
  ------------------
  132|  39.9k|    storage_(rhs.storage_) {
  133|  39.9k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    522|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    522|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  76.1k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  76.1k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  82.2k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  82.2k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  33.8k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  33.8k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  33.8k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  39.9k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  39.9k|  return UniquePtr(doClone());
  159|  39.9k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  32.1k|TiffEntry* TiffEntry::doClone() const {
  162|  32.1k|  return new TiffEntry(*this);
  163|  32.1k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    359|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    359|  return new TiffDataEntry(*this);
  167|    359|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  2.42k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  2.42k|  return new TiffImageEntry(*this);
  171|  2.42k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  4.49k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  4.49k|  return new TiffSizeEntry(*this);
  175|  4.49k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    522|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    522|  return new TiffSubIfd(*this);
  183|    522|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  18.2M|int TiffEntryBase::idx() const {
  206|  18.2M|  return idx_;
  207|  18.2M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|   647k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|   647k|  storage_ = std::move(buf);
  211|   647k|  pData_ = storage_->data();
  212|   647k|  size_ = storage_->size();
  213|   647k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  2.15M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  2.15M|  pData_ = pData;
  217|  2.15M|  size_ = size;
  218|  2.15M|  storage_ = std::move(storage);
  219|  2.15M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 2.15M]
  ------------------
  220|      0|    size_ = 0;
  221|  2.15M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  2.74M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  2.74M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 2.74M]
  ------------------
  225|      0|    return;
  226|  2.74M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 646k, False: 2.09M]
  ------------------
  227|   646k|    auto d = std::make_shared<DataBuf>(newSize);
  228|   646k|    setData(std::move(d));
  229|   646k|  }
  230|  2.74M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 682k, False: 2.06M]
  ------------------
  231|   682k|    memset(pData_, 0x0, size_);
  232|   682k|  }
  233|  2.74M|  size_ = value->copy(pData_, byteOrder);
  234|  2.74M|  setValue(std::move(value));
  235|  2.74M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  4.96M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  4.96M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 4.96M]
  ------------------
  239|      0|    return;
  240|  4.96M|  tiffType_ = toTiffType(value->typeId());
  241|  4.96M|  count_ = value->count();
  242|  4.96M|  pValue_ = std::move(value);
  243|  4.96M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  14.1k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  14.1k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 290, False: 13.9k]
  |  Branch (246:20): [True: 272, False: 13.6k]
  ------------------
  247|    562|#ifndef SUPPRESS_WARNINGS
  248|    562|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    562|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 562]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    562|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|    562|#endif
  251|    562|    return;
  252|    562|  }
  253|  13.6k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 1.92k, False: 11.7k]
  ------------------
  254|  1.92k|#ifndef SUPPRESS_WARNINGS
  255|  1.92k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.92k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.92k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.92k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  1.92k|#endif
  258|  1.92k|    return;
  259|  1.92k|  }
  260|  11.7k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 2.01k, False: 9.69k]
  ------------------
  261|  2.01k|#ifndef SUPPRESS_WARNINGS
  262|  2.01k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.01k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.01k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.01k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  2.01k|#endif
  266|  2.01k|    return;
  267|  2.01k|  }
  268|  9.69k|  size_t size = 0;
  269|  39.5k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 29.8k, False: 9.69k]
  ------------------
  270|  29.8k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  29.8k|  }
  272|  9.69k|  const size_t offset = pValue()->toUint32(0);
  273|  9.69k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 365, False: 9.32k]
  |  Branch (273:26): [True: 420, False: 8.90k]
  |  Branch (273:54): [True: 38, False: 8.87k]
  ------------------
  274|    823|#ifndef SUPPRESS_WARNINGS
  275|    823|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    823|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 823]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    823|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|    823|#endif
  278|    823|    return;
  279|    823|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  8.87k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 256, False: 8.61k]
  ------------------
  283|    256|#ifndef SUPPRESS_WARNINGS
  284|    256|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    256|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 256]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    256|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    256|#endif
  287|    256|    return;
  288|    256|  }
  289|  8.61k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  8.61k|  sizeDataArea_ = size;
  291|  8.61k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  8.61k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  37.9k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  37.9k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 1.68k, False: 36.2k]
  |  Branch (295:20): [True: 2.36k, False: 33.8k]
  ------------------
  296|  4.05k|#ifndef SUPPRESS_WARNINGS
  297|  4.05k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  4.05k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.05k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.05k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  4.05k|#endif
  300|  4.05k|    return;
  301|  4.05k|  }
  302|  33.8k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 8.68k, False: 25.1k]
  ------------------
  303|  8.68k|#ifndef SUPPRESS_WARNINGS
  304|  8.68k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  8.68k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.68k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.68k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  8.68k|#endif
  308|  8.68k|    return;
  309|  8.68k|  }
  310|   159k|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 133k, False: 25.1k]
  ------------------
  311|   133k|    const size_t offset = pValue()->toUint32(i);
  312|   133k|    const size_t size = pSize->toUint32(i);
  313|       |
  314|   133k|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 20.1k, False: 113k]
  |  Branch (314:28): [True: 38.7k, False: 74.9k]
  |  Branch (314:56): [True: 140, False: 74.8k]
  ------------------
  315|  59.0k|#ifndef SUPPRESS_WARNINGS
  316|  59.0k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  59.0k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 59.0k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  59.0k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  59.0k|#endif
  319|  74.8k|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 49.5k, False: 25.2k]
  ------------------
  320|  49.5k|      const byte* pStrip = pData + baseOffset + offset;
  321|  49.5k|      strips_.emplace_back(pStrip, size);
  322|  49.5k|    }
  323|   133k|  }
  324|  25.1k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  5.33k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  5.33k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 2.09k, False: 3.23k]
  ------------------
  328|  2.09k|    return 0;
  329|  3.23k|  return pHeader_->ifdOffset();
  330|  5.33k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  24.6k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  24.6k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 4.66k, False: 19.9k]
  |  Branch (333:20): [True: 17.2k, False: 2.71k]
  ------------------
  334|  21.9k|    return imageByteOrder_;
  335|  21.9k|  }
  336|  2.71k|  return pHeader_->byteOrder();
  337|  24.6k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  3.12k|size_t TiffIfdMakernote::mnOffset() const {
  340|  3.12k|  return mnOffset_;
  341|  3.12k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  13.0k|size_t TiffIfdMakernote::baseOffset() const {
  344|  13.0k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 2.56k, False: 10.4k]
  ------------------
  345|  2.56k|    return 0;
  346|  10.4k|  return pHeader_->baseOffset(mnOffset_);
  347|  13.0k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  6.03k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  6.03k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 2.09k, False: 3.93k]
  ------------------
  351|  2.09k|    return true;
  352|  3.93k|  return pHeader_->read(pData, size, byteOrder);
  353|  6.03k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  6.54k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  6.54k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 6.07k, False: 466]
  ------------------
  357|  6.07k|    pHeader_->setByteOrder(byteOrder);
  358|  6.54k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  65.3k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  65.3k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 4.52k, False: 60.8k]
  ------------------
  362|  4.52k|    return 0;
  363|  60.8k|  return pHeader_->size();
  364|  65.3k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  7.71k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  7.71k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 461, False: 7.25k]
  ------------------
  368|    461|    return 0;
  369|  7.25k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  7.71k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  3.77M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  3.77M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  3.77M|  return count_ * TypeInfo::typeSize(typeId);
  375|  3.77M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.28M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.28M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.28M, False: 348]
  ------------------
  379|  1.28M|    return true;  // Not a complex array or already initialized
  380|       |
  381|    874|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 874, False: 0]
  ------------------
  382|    874|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 348, False: 526]
  ------------------
  383|    348|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    348|      arrayDef_ = arraySet_[idx].def_;
  385|    348|      defSize_ = arraySet_[idx].defSize_;
  386|    348|      return true;
  387|    348|    }
  388|    874|  }
  389|      0|  return false;
  390|    348|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  4.02k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  4.02k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.27k, False: 1.75k]
  ------------------
  394|  2.27k|    return true;  // Not a complex array
  395|       |
  396|  1.75k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  1.75k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.09k, False: 657]
  ------------------
  398|  1.09k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.09k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.09k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.09k|  }
  402|  1.75k|  return idx > -1;
  403|  4.02k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  13.4k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  13.4k|  origData_ = const_cast<byte*>(pData());
  407|  13.4k|  origSize_ = TiffEntryBase::doSize();
  408|  13.4k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     69|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     69|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 69]
  ------------------
  412|      0|    return false;
  413|     69|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 39, False: 30]
  ------------------
  414|     39|    return true;
  415|     30|  std::memcpy(origData_, pData, origSize_);
  416|     30|  return true;
  417|     69|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  1.07M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  1.07M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  1.07M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  1.07M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  1.07M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  1.07M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 1.07M]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|  1.07M|  tp->setStart(pData() + idx);
  429|  1.07M|  auto s = storage();
  430|  1.07M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  1.07M|  tp->setElDef(def);
  432|  1.07M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  1.07M|  addChild(std::move(tc));
  434|  1.07M|  return sz;
  435|  1.07M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  16.4M|                                      TiffComponent::UniquePtr object) {
  439|  16.4M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  16.4M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  2.74M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  2.74M|  return this;
  445|  2.74M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  6.69M|                                        TiffComponent::UniquePtr object) {
  449|  6.69M|  tiffPath.pop();
  450|  6.69M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  6.69M|  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|  6.69M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 5.18M, False: 1.50M]
  |  Branch (457:31): [True: 1.37k, False: 1.50M]
  |  Branch (457:62): [True: 1.13k, False: 244]
  ------------------
  458|  5.18M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 31.2k, False: 5.15M]
  ------------------
  459|  31.2k|      tc = pNext_.get();
  460|  5.15M|    } else {
  461|  32.0M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 32.0M, False: 22.1k]
  ------------------
  462|  32.0M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 5.13M, False: 26.9M]
  |  Branch (462:46): [True: 5.13M, False: 3.07k]
  ------------------
  463|  5.13M|          tc = component.get();
  464|  5.13M|          break;
  465|  5.13M|        }
  466|  32.0M|      }
  467|  5.15M|    }
  468|  5.18M|  }
  469|       |
  470|  6.69M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 5.16M, False: 1.53M]
  ------------------
  471|  5.16M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.53M|  auto atc = [&] {
  474|  1.53M|    if (tiffPath.size() == 1 && object) {
  475|  1.53M|      return std::move(object);
  476|  1.53M|    }
  477|  1.53M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.53M|  }();
  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|  1.53M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.50M, False: 22.7k]
  |  Branch (482:31): [True: 18.9k, False: 1.48M]
  ------------------
  483|  18.9k|    return nullptr;
  484|       |
  485|  1.51M|  tc = [&] {
  486|  1.51M|    if (tpi.extendedTag() == Tag::next)
  487|  1.51M|      return this->addNext(std::move(atc));
  488|  1.51M|    return this->addChild(std::move(atc));
  489|  1.51M|  }();
  490|  1.51M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.53M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  1.99M|                                     TiffComponent::UniquePtr object) {
  495|  1.99M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  1.99M|  tiffPath.pop();
  497|  1.99M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 1.99M]
  ------------------
  498|       |    // If the last element in the path is the sub-IFD tag itself we're done.
  499|       |    // But that shouldn't happen - see TiffDirectory::doAddPath
  500|      0|    return this;
  501|      0|  }
  502|  1.99M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  1.99M|  tiffPath.push(tpi1);
  504|  1.99M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.17M, False: 11.8k]
  ------------------
  505|  2.17M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 1.98M, False: 190k]
  ------------------
  506|  1.98M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  11.8k|  auto tc = [&] {
  509|  11.8k|    if (tiffPath.size() == 1 && object) {
  510|  11.8k|      return addChild(std::move(object));
  511|  11.8k|    }
  512|  11.8k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  11.8k|  }();
  514|  11.8k|  setCount(ifds_.size());
  515|  11.8k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  1.99M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  1.88M|                                      TiffComponent::UniquePtr object) {
  520|  1.88M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  1.88M|  tiffPath.pop();
  522|  1.88M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 11.8k, False: 1.87M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  11.8k|    return this;
  525|  11.8k|  }
  526|  1.87M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  1.87M|  tiffPath.push(tpi1);
  528|  1.87M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 7.79k, False: 1.86M]
  ------------------
  529|  7.79k|    mnGroup_ = tpi2.group();
  530|  7.79k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  7.79k|  }
  532|  1.87M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  1.88M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  1.87M|                                           TiffComponent::UniquePtr object) {
  537|  1.87M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  1.87M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.29M|                                          TiffComponent::UniquePtr object) {
  542|  1.29M|  pRoot_ = pRoot;
  543|  1.29M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 14.6k, False: 1.28M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  14.6k|    return this;
  546|  14.6k|  }
  547|  1.28M|  tiffPath.pop();
  548|  1.28M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.28M|  initialize(tpi.group());
  551|       |  // Todo: Duplicates are not allowed!
  552|       |  // To allow duplicate entries, we only check if the new component already
  553|       |  // exists if there is still at least one composite tag on the stack
  554|  1.28M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.28M]
  ------------------
  555|      0|    for (const auto& element : elements_)
  ------------------
  |  Branch (555:30): [True: 0, False: 0]
  ------------------
  556|      0|      if (element->tag() == tpi.tag() && element->group() == tpi.group())
  ------------------
  |  Branch (556:11): [True: 0, False: 0]
  |  Branch (556:42): [True: 0, False: 0]
  ------------------
  557|      0|        return element->addPath(tag, tiffPath, pRoot, std::move(object));
  558|      0|  }
  559|       |
  560|  1.28M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.28M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.28M]
  ------------------
  561|      0|    auto tc = addChild(std::move(object));
  562|      0|    setCount(elements_.size());
  563|      0|    return tc->addPath(tag, tiffPath, pRoot, nullptr);
  564|      0|  }
  565|       |
  566|  1.28M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.28M|  setCount(elements_.size());
  568|  1.28M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.28M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  6.09M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  6.09M|  return doAddChild(std::move(tiffComponent));
  573|  6.09M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  3.67M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  3.67M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  3.67M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  65.3k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  65.3k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  65.3k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 65.3k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  65.3k|  return ifds_.emplace_back(std::move(d)).get();
  589|  65.3k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  2.35M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  2.35M|  setDecoded(true);
  604|  2.35M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  2.35M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  2.93k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  2.93k|  return doAddNext(std::move(tiffComponent));
  609|  2.93k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  2.93k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  2.93k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 2.93k, False: 0]
  ------------------
  617|  2.93k|    pNext_ = std::move(tiffComponent);
  618|  2.93k|    return pNext_.get();
  619|  2.93k|  }
  620|      0|  return nullptr;
  621|  2.93k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  41.8M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  41.8M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 41.8M, False: 12.0k]
  ------------------
  636|  41.8M|    doAccept(visitor);  // one for NVI :)
  637|  41.8M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  25.1M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  25.1M|  visitor.visitEntry(this);
  641|  25.1M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   322k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   322k|  visitor.visitDataEntry(this);
  645|   322k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  1.81M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  1.81M|  visitor.visitImageEntry(this);
  649|  1.81M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.38M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.38M|  visitor.visitSizeEntry(this);
  653|  2.38M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  1.28M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  1.28M|  visitor.visitDirectory(this);
  657|  30.7M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 30.7M, False: 1.07M]
  ------------------
  658|  30.7M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 201k, False: 30.5M]
  ------------------
  659|   201k|      break;
  660|  30.5M|    component->accept(visitor);
  661|  30.5M|  }
  662|  1.28M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.06M, False: 213k]
  ------------------
  663|  1.06M|    visitor.visitDirectoryNext(this);
  664|  1.28M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 48.6k, False: 1.23M]
  ------------------
  665|  48.6k|    pNext_->accept(visitor);
  666|  1.28M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.04M, False: 232k]
  ------------------
  667|  1.04M|    visitor.visitDirectoryEnd(this);
  668|  1.28M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   252k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   252k|  visitor.visitSubIfd(this);
  672|   919k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 919k, False: 211k]
  ------------------
  673|   919k|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 41.2k, False: 877k]
  ------------------
  674|  41.2k|      break;
  675|   877k|    ifd->accept(visitor);
  676|   877k|  }
  677|   252k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   246k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   246k|  visitor.visitMnEntry(this);
  681|   246k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 71.9k, False: 174k]
  ------------------
  682|  71.9k|    mn_->accept(visitor);
  683|   246k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.01k, False: 245k]
  ------------------
  684|  1.01k|    mn_ = nullptr;
  685|  1.01k|  }
  686|       |
  687|   246k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  65.4k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  65.4k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 65.4k, False: 0]
  ------------------
  691|  65.4k|    visitor.visitIfdMakernote(this);
  692|  65.4k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 64.7k, False: 710]
  ------------------
  693|  64.7k|    ifd_.accept(visitor);
  694|  65.4k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 64.7k, False: 710]
  |  Branch (694:52): [True: 48.3k, False: 16.4k]
  ------------------
  695|  48.3k|    visitor.visitIfdMakernoteEnd(this);
  696|  65.4k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   166k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   166k|  visitor.visitBinaryArray(this);
  700|  9.95M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 9.95M, False: 164k]
  ------------------
  701|  9.95M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 1.28k, False: 9.95M]
  ------------------
  702|  1.28k|      break;
  703|  9.95M|    element->accept(visitor);
  704|  9.95M|  }
  705|   166k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 153k, False: 12.4k]
  ------------------
  706|   153k|    visitor.visitBinaryArrayEnd(this);
  707|   166k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  10.2M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  10.2M|  visitor.visitBinaryElement(this);
  711|  10.2M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  2.77M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  2.77M|  doEncode(encoder, datum);
  715|  2.77M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.28M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.28M|  encoder.encodeBinaryElement(this, datum);
  719|  1.28M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  14.9k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  14.9k|  encoder.encodeBinaryArray(this, datum);
  723|  14.9k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  7.61k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  7.61k|  encoder.encodeDataEntry(this, datum);
  727|  7.61k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.41M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.41M|  encoder.encodeTiffEntry(this, datum);
  731|  1.41M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  15.2k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  15.2k|  encoder.encodeImageEntry(this, datum);
  735|  15.2k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  12.4k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  12.4k|  encoder.encodeMnEntry(this, datum);
  739|  12.4k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  25.8k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  25.8k|  encoder.encodeSizeEntry(this, datum);
  743|  25.8k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  1.70k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  1.70k|  encoder.encodeSubIfd(this, datum);
  747|  1.70k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  1.75M|size_t TiffComponent::count() const {
  750|  1.75M|  return doCount();
  751|  1.75M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   152k|size_t TiffDirectory::doCount() const {
  754|   152k|  return components_.size();
  755|   152k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.58M|size_t TiffEntryBase::doCount() const {
  758|  1.58M|  return count_;
  759|  1.58M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  17.5k|size_t TiffMnEntry::doCount() const {
  762|  17.5k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 9.71k, False: 7.87k]
  ------------------
  763|  9.71k|    return TiffEntryBase::doCount();
  764|  9.71k|  }
  765|  7.87k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  7.87k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 1.35k, False: 6.51k]
  |  Branch (768:36): [True: 1.33k, False: 18]
  |  Branch (768:68): [True: 1.29k, False: 42]
  ------------------
  769|  1.29k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  1.29k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.29k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.29k|  LogMsg(LogMsg::error).os()
  ------------------
                  EXV_ERROR << stringFormat(
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  770|      0|        "Makernote entry 0x{:04x} has incorrect Exif (TIFF) type {}. (Expected signed or unsigned byte.)\n", tag(),
  771|      0|        static_cast<uint16_t>(tiffType()));
  772|  1.29k|  }
  773|  7.87k|#endif
  774|  7.87k|  return mn_->size();
  775|  17.5k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  21.2k|size_t TiffBinaryArray::doCount() const {
  782|  21.2k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 823, False: 20.4k]
  |  Branch (782:17): [True: 13.7k, False: 6.62k]
  ------------------
  783|  14.6k|    return TiffEntryBase::doCount();
  784|       |
  785|  6.62k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 6.62k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  6.62k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  6.62k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  6.62k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 27, False: 6.59k]
  ------------------
  791|     27|#ifndef SUPPRESS_WARNINGS
  792|     27|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|     27|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 27]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     27|  LogMsg(LogMsg::warn).os()
  ------------------
                  EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  793|      0|                                groupName(group()), tag(), static_cast<uint16_t>(tiffType()));
  794|     27|#endif
  795|     27|    typeSize = 1;
  796|     27|  }
  797|       |
  798|  6.62k|  return size() / typeSize;
  799|  6.62k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|  1.61k|size_t TiffBinaryElement::doCount() const {
  802|  1.61k|  return elDef_.count_;
  803|  1.61k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  2.81M|                            size_t& imageIdx) {
  807|  2.81M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  2.81M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  34.0k|                              size_t& imageIdx) {
  812|  34.0k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  34.0k|  const size_t compCount = count();
  816|  34.0k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 34.0k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  34.0k|  size_t sizeNext = 0;
  821|  34.0k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 842, False: 33.1k]
  ------------------
  822|    842|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  34.0k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 443, False: 33.5k]
  |  Branch (825:25): [True: 135, False: 308]
  ------------------
  826|    135|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  33.8k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 30, False: 33.8k]
  ------------------
  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|     30|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     30|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  33.8k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 33.6k, False: 240]
  ------------------
  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|  33.8k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 25.6k, False: 8.19k]
  ------------------
  842|  25.6k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  25.6k|  }
  844|       |  // Size of IFD values and additional data
  845|  33.8k|  size_t sizeValue = 0;
  846|  33.8k|  size_t sizeData = 0;
  847|  1.50M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.50M, False: 33.8k]
  ------------------
  848|  1.50M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 85.3k, False: 1.41M]
  ------------------
  849|  85.3k|      sv += sv & 1;  // Align value to word boundary
  850|  85.3k|      sizeValue += sv;
  851|  85.3k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.50M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 768k, False: 734k]
  ------------------
  854|   768k|      auto sd = component->sizeData();
  855|   768k|      sd += sd & 1;  // Align data to word boundary
  856|   768k|      sizeData += sd;
  857|   768k|    }
  858|  1.50M|  }
  859|       |
  860|  33.8k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  33.8k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  33.8k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  33.8k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 13.7k, False: 20.1k]
  ------------------
  864|  13.7k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  13.7k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  13.7k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  33.8k|  byte buf[4];
  870|  33.8k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  33.8k|  ioWrapper.write(buf, 2);
  872|  33.8k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.49M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.49M, False: 33.8k]
  ------------------
  875|  1.49M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.49M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 84.4k, False: 1.41M]
  ------------------
  877|  84.4k|      sv += sv & 1;  // Align value to word boundary
  878|  84.4k|      valueIdx += sv;
  879|  84.4k|    }
  880|  1.49M|    auto sd = component->sizeData();
  881|  1.49M|    sd += sd & 1;  // Align data to word boundary
  882|  1.49M|    dataIdx += sd;
  883|  1.49M|  }
  884|       |  // c) Pointer to the next IFD
  885|  33.8k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 33.4k, False: 441]
  ------------------
  886|  33.4k|    memset(buf, 0x0, 4);
  887|  33.4k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 837, False: 32.6k]
  |  Branch (887:19): [True: 836, False: 1]
  ------------------
  888|    836|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|    836|    }
  890|  33.4k|    ioWrapper.write(buf, 4);
  891|  33.4k|    idx += 4;
  892|  33.4k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  33.8k|  valueIdx = sizeDir;
  896|  33.8k|  dataIdx = sizeDir + sizeValue;
  897|  1.48M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.48M, False: 33.8k]
  ------------------
  898|  1.48M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 82.9k, False: 1.40M]
  ------------------
  899|  82.9k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  82.9k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  82.9k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 13.8k, False: 69.1k]
  ------------------
  902|  13.8k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  13.8k|        sv += 1;
  904|  13.8k|      }
  905|  82.9k|      idx += sv;
  906|  82.9k|      valueIdx += sv;
  907|  82.9k|    }
  908|  1.48M|    auto sd = component->sizeData();
  909|  1.48M|    sd += sd & 1;  // Align data to word boundary
  910|  1.48M|    dataIdx += sd;
  911|  1.48M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  33.8k|  dataIdx = sizeDir + sizeValue;
  915|  33.8k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  33.8k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 831, False: 33.0k]
  |  Branch (918:17): [True: 830, False: 1]
  ------------------
  919|    830|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|    830|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  33.8k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 13.2k, False: 20.5k]
  ------------------
  924|  13.2k|    idx += writeImage(ioWrapper, byteOrder);
  925|  13.2k|  }
  926|       |
  927|  33.8k|  return idx;
  928|  34.0k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.49M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.49M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.49M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.49M]
  ------------------
  934|      0|    return 0;
  935|  1.49M|  byte buf[8];
  936|  1.49M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.49M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.49M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.49M|  ioWrapper.write(buf, 8);
  940|  1.49M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 84.4k, False: 1.41M]
  ------------------
  941|  84.4k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  84.4k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  84.4k|    ioWrapper.write(buf, 4);
  944|  1.41M|  } else {
  945|  1.41M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.41M|#ifndef SUPPRESS_WARNINGS
  947|  1.41M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 38, False: 1.41M]
  ------------------
  948|     38|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|     38|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 38]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     38|  LogMsg(LogMsg::error).os()
  ------------------
  949|     38|    }
  950|  1.41M|#endif
  951|  1.41M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.39M, False: 18.9k]
  ------------------
  952|  1.39M|      memset(buf, 0x0, 4);
  953|  1.39M|      ioWrapper.write(buf, 4 - len);
  954|  1.39M|    }
  955|  1.41M|  }
  956|  1.49M|  return 12;
  957|  1.49M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.45M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.45M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 17.9k, False: 1.43M]
  |  Branch (961:19): [True: 1.33M, False: 99.6k]
  ------------------
  962|  1.35M|    return 0;
  963|       |
  964|  99.6k|  DataBuf buf(pValue_->size());
  965|  99.6k|  pValue_->copy(buf.data(), byteOrder);
  966|  99.6k|  ioWrapper.write(buf.c_data(), buf.size());
  967|  99.6k|  return buf.size();
  968|  1.45M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  49.5k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  49.5k|  size_t rc = 0;
  972|  49.5k|  switch (tiffType) {
  973|  1.74k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 1.74k, False: 47.8k]
  ------------------
  974|  5.60k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 3.85k, False: 45.7k]
  ------------------
  975|  5.60k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 7, False: 5.59k]
  ------------------
  976|      7|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  5.59k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  5.59k|      break;
  979|  42.1k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 42.1k, False: 7.44k]
  ------------------
  980|  43.6k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 1.47k, False: 48.1k]
  ------------------
  981|  43.6k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  43.6k|      break;
  983|    372|    default:
  ------------------
  |  Branch (983:5): [True: 372, False: 49.2k]
  ------------------
  984|    372|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  49.5k|  }
  986|  49.2k|  return rc;
  987|  49.5k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  990|  4.07k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  991|  4.07k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (991:7): [True: 129, False: 3.94k]
  |  Branch (991:20): [True: 2.29k, False: 1.65k]
  ------------------
  992|  2.42k|    return 0;
  993|       |
  994|  1.65k|  DataBuf buf(pValue()->size());
  995|  1.65k|  size_t idx = 0;
  996|  1.65k|  const size_t prevOffset = pValue()->toUint32(0);
  997|  8.21k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (997:22): [True: 6.55k, False: 1.65k]
  ------------------
  998|  6.55k|    const size_t iOffset = pValue()->toUint32(i);
  999|  6.55k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1000|  6.55k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1001|  6.55k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1002|  6.55k|  }
 1003|  1.65k|  ioWrapper.write(buf.c_data(), buf.size());
 1004|  1.65k|  return buf.size();
 1005|  4.07k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  15.4k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  15.4k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  15.4k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 667, False: 14.8k]
  ------------------
 1012|    667|    o2 = Safe::add<size_t>(offset, dataIdx);
 1013|       |#ifdef EXIV2_DEBUG_MESSAGES
 1014|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1015|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1016|       |#endif
 1017|  15.4k|  DataBuf buf(strips_.size() * 4);
 1018|  15.4k|  size_t idx = 0;
 1019|  31.2k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 31.2k, False: 15.4k]
  ------------------
 1020|  31.2k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  31.2k|    const auto sz = Safe::add(off, off & 1);
 1023|  31.2k|    o2 = Safe::add(o2, sz);
 1024|  31.2k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 30.8k, False: 445]
  ------------------
 1025|  30.8k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  31.2k|  }
 1027|  15.4k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  15.4k|  return buf.size();
 1029|  15.4k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1032|  8.77k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1033|  8.77k|  DataBuf buf(ifds_.size() * 4);
 1034|  8.77k|  size_t idx = 0;
 1035|       |  // Sort IFDs by group, needed if image data tags were copied first
 1036|  8.77k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1037|  11.7k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1037:19): [True: 11.7k, False: 8.77k]
  ------------------
 1038|  11.7k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1039|  11.7k|    dataIdx += ifd->size();
 1040|  11.7k|  }
 1041|  8.77k|  ioWrapper.write(buf.c_data(), buf.size());
 1042|  8.77k|  return buf.size();
 1043|  8.77k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1046|  17.2k|                            size_t& imageIdx) {
 1047|  17.2k|  if (!mn_) {
  ------------------
  |  Branch (1047:7): [True: 9.54k, False: 7.71k]
  ------------------
 1048|  9.54k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1049|  9.54k|  }
 1050|  7.71k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1051|  17.2k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1054|  7.71k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1055|  7.71k|  mnOffset_ = offset;
 1056|  7.71k|  setImageByteOrder(byteOrder);
 1057|  7.71k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1058|  7.71k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1059|  7.71k|                    imageIdx);
 1060|  7.71k|  return len;
 1061|  7.71k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1064|  21.0k|                                size_t dataIdx, size_t& imageIdx) {
 1065|  21.0k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1065:7): [True: 763, False: 20.3k]
  |  Branch (1065:17): [True: 13.7k, False: 6.55k]
  ------------------
 1066|  14.5k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1067|  6.55k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1067:7): [True: 1.04k, False: 5.51k]
  ------------------
 1068|  1.04k|    byteOrder = cfg()->byteOrder_;
 1069|       |  // Tags must be sorted in ascending order
 1070|  6.55k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1071|  6.55k|  size_t idx = 0;
 1072|  6.55k|  MemIo mio;  // memory stream in which to store data
 1073|  6.55k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1074|       |  // Some array entries need to have the size in the first element
 1075|  6.55k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1075:7): [True: 132, False: 6.42k]
  ------------------
 1076|    132|    byte buf[4];
 1077|    132|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1078|    132|    switch (elSize) {
 1079|     78|      case 2:
  ------------------
  |  Branch (1079:7): [True: 78, False: 54]
  ------------------
 1080|     78|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1081|     78|        break;
 1082|     54|      case 4:
  ------------------
  |  Branch (1082:7): [True: 54, False: 78]
  ------------------
 1083|     54|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1084|     54|        break;
 1085|      0|      default:
  ------------------
  |  Branch (1085:7): [True: 0, False: 132]
  ------------------
 1086|      0|        break;
 1087|    132|    }
 1088|    132|    mioWrapper.write(buf, elSize);
 1089|    132|  }
 1090|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1091|  1.27M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1091:23): [True: 1.27M, False: 6.55k]
  ------------------
 1092|       |    // Skip the manufactured tag, if it exists
 1093|  1.27M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1093:9): [True: 8.73k, False: 1.26M]
  |  Branch (1093:28): [True: 132, False: 8.59k]
  ------------------
 1094|    132|      continue;
 1095|  1.27M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1096|  1.27M|    idx += fillGap(mioWrapper, idx, newIdx);
 1097|  1.27M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1098|  1.27M|  }
 1099|  6.55k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1099:7): [True: 5.42k, False: 1.12k]
  |  Branch (1099:29): [True: 5.42k, False: 0]
  ------------------
 1100|  5.42k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1101|  5.42k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1102|  5.42k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1103|  5.42k|  }
 1104|       |
 1105|  6.55k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1105:7): [True: 319, False: 6.23k]
  ------------------
 1106|       |    // Select sonyTagEncipher
 1107|    319|    CryptFct cryptFct = cfg()->cryptFct_;
 1108|    319|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1108:9): [True: 139, False: 180]
  ------------------
 1109|    139|      cryptFct = sonyTagEncipher;
 1110|    139|    }
 1111|    319|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1112|    319|    if (!buf.empty()) {
  ------------------
  |  Branch (1112:9): [True: 165, False: 154]
  ------------------
 1113|    165|      mio.seek(0, Exiv2::BasicIo::beg);
 1114|    165|      mio.write(buf.c_data(), buf.size());
 1115|    165|    }
 1116|    319|  }
 1117|  6.55k|  ioWrapper.write(mio.mmap(), mio.size());
 1118|       |
 1119|  6.55k|  return idx;
 1120|  6.55k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1123|  1.27M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1124|  1.27M|  auto pv = pValue();
 1125|  1.27M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1125:7): [True: 0, False: 1.27M]
  |  Branch (1125:14): [True: 744k, False: 533k]
  ------------------
 1126|   744k|    return 0;
 1127|   533k|  DataBuf buf(pv->size());
 1128|   533k|  pv->copy(buf.data(), byteOrder);
 1129|   533k|  ioWrapper.write(buf.c_data(), buf.size());
 1130|   533k|  return buf.size();
 1131|  1.27M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|  1.51M|                                size_t& imageIdx) const {
 1135|  1.51M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|  1.51M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  33.3k|                                  size_t& imageIdx) const {
 1140|  33.3k|  size_t len = 0;
 1141|  1.48M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 1.48M, False: 33.3k]
  ------------------
 1142|  1.48M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|  1.48M|  }
 1144|  33.3k|  return len;
 1145|  33.3k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|  1.45M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|  1.45M|  return 0;
 1150|  1.45M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  15.2k|                                   size_t& /*imageIdx*/) const {
 1154|  15.2k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  15.2k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 655, False: 14.5k]
  ------------------
 1157|    655|    len = writeImage(ioWrapper, byteOrder);
 1158|    655|  }
 1159|  15.2k|  return len;
 1160|  15.2k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1163|  3.53k|                                  size_t& /*imageIdx*/) const {
 1164|  3.53k|  if (!pValue())
  ------------------
  |  Branch (1164:7): [True: 124, False: 3.41k]
  ------------------
 1165|    124|    return 0;
 1166|       |
 1167|  3.41k|  DataBuf buf = pValue()->dataArea();
 1168|  3.41k|  if (!buf.empty())
  ------------------
  |  Branch (1168:7): [True: 573, False: 2.83k]
  ------------------
 1169|    573|    ioWrapper.write(buf.c_data(), buf.size());
 1170|       |  // Align data to word boundary
 1171|  3.41k|  size_t align = (buf.size() & 1);
 1172|  3.41k|  if (align)
  ------------------
  |  Branch (1172:7): [True: 159, False: 3.25k]
  ------------------
 1173|    159|    ioWrapper.putb(0x0);
 1174|       |
 1175|  3.41k|  return buf.size() + align;
 1176|  3.53k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1179|  8.73k|                               size_t& imageIdx) const {
 1180|  8.73k|  size_t len = 0;
 1181|  11.6k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1181:19): [True: 11.6k, False: 8.73k]
  ------------------
 1182|  11.6k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1183|  11.6k|  }
 1184|       |  // Align data to word boundary
 1185|  8.73k|  size_t align = (len & 1);
 1186|  8.73k|  if (align)
  ------------------
  |  Branch (1186:7): [True: 0, False: 8.73k]
  ------------------
 1187|      0|    ioWrapper.putb(0x0);
 1188|       |
 1189|  8.73k|  return len + align;
 1190|  8.73k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   920k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   920k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   920k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  24.7k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  24.7k|  size_t len = 0;
 1203|  24.7k|  const TiffComponent* pSubIfd = nullptr;
 1204|   895k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 895k, False: 24.7k]
  ------------------
 1205|   895k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 1.48k, False: 893k]
  ------------------
 1206|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1207|  1.48k|#ifndef SUPPRESS_WARNINGS
 1208|  1.48k|      if (pSubIfd) {
  ------------------
  |  Branch (1208:11): [True: 392, False: 1.09k]
  ------------------
 1209|    392|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    392|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 392]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    392|  LogMsg(LogMsg::error).os()
  ------------------
 1210|    392|      }
 1211|  1.48k|#endif
 1212|  1.48k|      pSubIfd = component.get();
 1213|  1.48k|      continue;
 1214|  1.48k|    }
 1215|   893k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   893k|  }
 1217|  24.7k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 1.07k, False: 23.6k]
  ------------------
 1218|  1.07k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|  1.07k|  }
 1220|  24.7k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 644, False: 24.1k]
  ------------------
 1221|    644|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|    644|  }
 1223|  24.7k|  return len;
 1224|  24.7k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   873k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   873k|  return 0;
 1228|   873k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1230|  8.08k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1231|  8.08k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1232|  8.08k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1233|  8.08k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  13.8k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  13.8k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 115, False: 13.7k]
  ------------------
 1245|    115|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  13.7k|  size_t len = pValue()->sizeDataArea();
 1248|  13.7k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 119, False: 13.6k]
  ------------------
 1249|       |#ifdef EXIV2_DEBUG_MESSAGES
 1250|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1251|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1252|       |#endif
 1253|    119|    DataBuf buf = pValue()->dataArea();
 1254|    119|    ioWrapper.write(buf.c_data(), buf.size());
 1255|    119|    size_t align = len & 1;  // Align image data to word boundary
 1256|    119|    if (align)
  ------------------
  |  Branch (1256:9): [True: 55, False: 64]
  ------------------
 1257|     55|      ioWrapper.putb(0x0);
 1258|    119|    len += align;
 1259|  13.6k|  } else {
 1260|       |#ifdef EXIV2_DEBUG_MESSAGES
 1261|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1262|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1263|       |#endif
 1264|  13.6k|    len = 0;
 1265|  26.4k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 26.4k, False: 13.6k]
  ------------------
 1266|  26.4k|      ioWrapper.write(f, s);
 1267|  26.4k|      len += s;
 1268|  26.4k|      size_t align = s & 1;  // Align strip data to word boundary
 1269|  26.4k|      if (align)
  ------------------
  |  Branch (1269:11): [True: 15.6k, False: 10.8k]
  ------------------
 1270|  15.6k|        ioWrapper.putb(0x0);
 1271|  26.4k|      len += align;
 1272|  26.4k|    }
 1273|  13.6k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  13.7k|  return len;
 1278|  13.8k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|  14.3M|size_t TiffComponent::size() const {
 1281|  14.3M|  return doSize();
 1282|  14.3M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1284|   118k|size_t TiffDirectory::doSize() const {
 1285|   118k|  size_t compCount = count();
 1286|       |  // Size of the directory, without values and additional data
 1287|   118k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1287:40): [True: 116k, False: 2.16k]
  ------------------
 1288|       |  // Size of IFD values and data
 1289|  5.75M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1289:25): [True: 5.75M, False: 118k]
  ------------------
 1290|  5.75M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1290:40): [True: 267k, False: 5.48M]
  ------------------
 1291|   267k|      sv += sv & 1;  // Align value to word boundary
 1292|   267k|      len += sv;
 1293|   267k|    }
 1294|  5.75M|    auto sd = component->sizeData();
 1295|  5.75M|    sd += sd & 1;  // Align data to word boundary
 1296|  5.75M|    len += sd;
 1297|  5.75M|  }
 1298|       |  // Size of next-IFD, if any
 1299|   118k|  size_t sizeNext = 0;
 1300|   118k|  if (pNext_) {
  ------------------
  |  Branch (1300:7): [True: 163, False: 118k]
  ------------------
 1301|    163|    sizeNext = pNext_->size();
 1302|    163|    len += sizeNext;
 1303|    163|  }
 1304|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1305|   118k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1305:7): [True: 628, False: 117k]
  |  Branch (1305:25): [True: 539, False: 89]
  ------------------
 1306|    539|    len = 0;
 1307|   118k|  return len;
 1308|   118k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  14.7M|size_t TiffEntryBase::doSize() const {
 1311|  14.7M|  return size_;
 1312|  14.7M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|  95.9k|size_t TiffImageEntry::doSize() const {
 1315|  95.9k|  return strips_.size() * 4;
 1316|  95.9k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1318|  41.4k|size_t TiffSubIfd::doSize() const {
 1319|  41.4k|  return ifds_.size() * 4;
 1320|  41.4k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1322|  96.1k|size_t TiffMnEntry::doSize() const {
 1323|  96.1k|  if (!mn_) {
  ------------------
  |  Branch (1323:7): [True: 38.7k, False: 57.4k]
  ------------------
 1324|  38.7k|    return TiffEntryBase::doSize();
 1325|  38.7k|  }
 1326|  57.4k|  return mn_->size();
 1327|  96.1k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1329|  65.3k|size_t TiffIfdMakernote::doSize() const {
 1330|  65.3k|  return sizeHeader() + ifd_.size();
 1331|  65.3k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1333|   281k|size_t TiffBinaryArray::doSize() const {
 1334|   281k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1334:7): [True: 10.1k, False: 271k]
  |  Branch (1334:17): [True: 179k, False: 92.2k]
  ------------------
 1335|   189k|    return TiffEntryBase::doSize();
 1336|       |
 1337|  92.2k|  if (elements_.empty())
  ------------------
  |  Branch (1337:7): [True: 0, False: 92.2k]
  ------------------
 1338|      0|    return 0;
 1339|       |
 1340|       |  // Remaining assumptions:
 1341|       |  // - array elements don't "overlap"
 1342|       |  // - no duplicate tags in the array
 1343|  92.2k|  size_t idx = 0;
 1344|  92.2k|  size_t sz = cfg()->tagStep();
 1345|  17.9M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1345:23): [True: 17.9M, False: 92.2k]
  ------------------
 1346|  17.9M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1346:9): [True: 2.40M, False: 15.5M]
  ------------------
 1347|  2.40M|      idx = element->tag();
 1348|  2.40M|      sz = element->size();
 1349|  2.40M|    }
 1350|  17.9M|  }
 1351|  92.2k|  idx *= cfg()->tagStep();
 1352|  92.2k|  idx += sz;
 1353|       |
 1354|  92.2k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1354:7): [True: 76.1k, False: 16.0k]
  |  Branch (1354:29): [True: 76.1k, False: 0]
  ------------------
 1355|  76.1k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1356|  76.1k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1357|  76.1k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1358|  76.1k|  }
 1359|  92.2k|  return idx;
 1360|       |
 1361|  92.2k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1363|  2.41M|size_t TiffBinaryElement::doSize() const {
 1364|  2.41M|  if (!pValue())
  ------------------
  |  Branch (1364:7): [True: 0, False: 2.41M]
  ------------------
 1365|      0|    return 0;
 1366|  2.41M|  return pValue()->size();
 1367|  2.41M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|  9.50M|size_t TiffComponent::sizeData() const {
 1370|  9.50M|  return doSizeData();
 1371|  9.50M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|  9.37M|size_t TiffEntryBase::doSizeData() const {
 1378|  9.37M|  return 0;
 1379|  9.37M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  72.9k|size_t TiffImageEntry::doSizeData() const {
 1382|  72.9k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  72.9k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 9.73k, False: 63.2k]
  ------------------
 1385|  9.73k|    len = sizeImage();
 1386|  9.73k|  }
 1387|  72.9k|  return len;
 1388|  72.9k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1390|  21.3k|size_t TiffDataEntry::doSizeData() const {
 1391|  21.3k|  if (!pValue())
  ------------------
  |  Branch (1391:7): [True: 384, False: 20.9k]
  ------------------
 1392|    384|    return 0;
 1393|  20.9k|  return pValue()->sizeDataArea();
 1394|  21.3k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1396|  31.2k|size_t TiffSubIfd::doSizeData() const {
 1397|  31.2k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1398|  31.2k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1404|  9.73k|size_t TiffComponent::sizeImage() const {
 1405|  9.73k|  return doSizeImage();
 1406|  9.73k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1426|  9.73k|size_t TiffImageEntry::doSizeImage() const {
 1427|  9.73k|  if (!pValue())
  ------------------
  |  Branch (1427:7): [True: 0, False: 9.73k]
  ------------------
 1428|      0|    return 0;
 1429|  9.73k|  auto len = pValue()->sizeDataArea();
 1430|  9.73k|  if (len != 0)
  ------------------
  |  Branch (1430:7): [True: 0, False: 9.73k]
  ------------------
 1431|      0|    return len;
 1432|       |
 1433|  9.73k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1434|  9.73k|                               [](const auto& s) { return s.second; });
 1435|  9.73k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  7.02M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  7.02M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  7.02M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 8.42k, False: 7.01M]
  ------------------
 1456|  8.42k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 5.07k, False: 3.35k]
  ------------------
 1457|  5.07k|      ti = comment;
 1458|  5.07k|    }
 1459|  8.42k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  7.02M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 3.70M, False: 3.31M]
  ------------------
 1463|  3.70M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 4.72k, False: 3.70M]
  |  Branch (1463:26): [True: 1.35k, False: 3.37k]
  |  Branch (1463:58): [True: 2.52k, False: 3.70M]
  |  Branch (1463:75): [True: 30, False: 2.49k]
  ------------------
 1464|  1.38k|    ti = Exiv2::signedByte;
 1465|  1.38k|  }
 1466|  7.02M|  return ti;
 1467|  7.02M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  4.96M|TiffType toTiffType(TypeId typeId) {
 1470|  4.96M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 4.96M]
  ------------------
 1471|      0|#ifndef SUPPRESS_WARNINGS
 1472|      0|    EXV_ERROR << "'" << TypeInfo::typeName(typeId) << "' is not a valid Exif (TIFF) type; using type '"
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1473|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1474|      0|#endif
 1475|      0|    return ttUndefined;
 1476|      0|  }
 1477|  4.96M|  return static_cast<TiffType>(typeId);
 1478|  4.96M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  22.5M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  22.5M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 14.1M, False: 8.38M]
  ------------------
 1482|  14.1M|    return lhs->tag() < rhs->tag();
 1483|  8.38M|  return lhs->idx() < rhs->idx();
 1484|  22.5M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|  3.35M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|  3.35M|  return std::make_unique<TiffEntry>(tag, group);
 1488|  3.35M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  33.8k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  33.8k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  33.8k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|  2.38M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|  2.38M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|  2.38M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.53M|  auto atc = [&] {
  474|  1.53M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.50M, False: 22.7k]
  |  Branch (474:33): [True: 39.2k, False: 1.46M]
  ------------------
  475|  39.2k|      return std::move(object);
  476|  39.2k|    }
  477|  1.49M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.53M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.51M|  tc = [&] {
  486|  1.51M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 843, False: 1.51M]
  ------------------
  487|    843|      return this->addNext(std::move(atc));
  488|  1.51M|    return this->addChild(std::move(atc));
  489|  1.51M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  11.8k|  auto tc = [&] {
  509|  11.8k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 11.8k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  11.8k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  11.8k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1036|  3.46k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderEENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEEEEDaRKT_:
 1232|  10.8k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1434|  7.78k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  52.1k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  52.1k|  const TagInfo* tags = [=] {
 1439|  52.1k|    if (group == IfdId::gpsId)
 1440|  52.1k|      return Internal::gpsTagList();
 1441|  52.1k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  52.1k|  }();
 1443|  52.1k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 8.82k, False: 43.2k]
  ------------------
 1444|   296k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 296k, False: 401]
  ------------------
 1445|   296k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 8.42k, False: 287k]
  ------------------
 1446|  8.42k|        return tags + idx;
 1447|  43.6k|  return nullptr;
 1448|  52.1k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  52.1k|  const TagInfo* tags = [=] {
 1439|  52.1k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 4.08k, False: 48.0k]
  ------------------
 1440|  4.08k|      return Internal::gpsTagList();
 1441|  48.0k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 4.74k, False: 43.2k]
  ------------------
 1442|  52.1k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1503|  1.28M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1504|  1.28M|  if (curr < tobe) {
  ------------------
  |  Branch (1504:7): [True: 221k, False: 1.06M]
  ------------------
 1505|   221k|    Exiv2::DataBuf buf(tobe - curr);
 1506|   221k|    ioWrapper.write(buf.c_data(), buf.size());
 1507|   221k|    return tobe - curr;
 1508|   221k|  }
 1509|  1.06M|  return 0;
 1510|  1.28M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  10.7M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  10.7M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  32.0M|  [[nodiscard]] uint16_t tag() const {
   82|  32.0M|    return static_cast<uint16_t>(extendedTag_);
   83|  32.0M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  10.9M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  10.9M|    return extendedTag_;
   87|  10.9M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  11.3M|  [[nodiscard]] IfdId group() const {
   90|  11.3M|    return group_;
   91|  11.3M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  6.14M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  6.14M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  3.32M|  void setStart(const byte* pStart) {
  217|  3.32M|    pStart_ = const_cast<byte*>(pStart);
  218|  3.32M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   178M|  [[nodiscard]] uint16_t tag() const {
  241|   178M|    return tag_;
  242|   178M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  25.3M|  [[nodiscard]] IfdId group() const {
  245|  25.3M|    return group_;
  246|  25.3M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  3.42M|  [[nodiscard]] byte* start() const {
  249|  3.42M|    return pStart_;
  250|  3.42M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  2.27M|  void setOffset(size_t offset) {
  417|  2.27M|    offset_ = offset;
  418|  2.27M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.61M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.61M|    return tiffType_;
  460|  1.61M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  84.4k|  [[nodiscard]] size_t offset() const {
  466|  84.4k|    return offset_;
  467|  84.4k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  2.25M|  [[nodiscard]] const byte* pData() const {
  477|  2.25M|    return pData_;
  478|  2.25M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  10.7M|  [[nodiscard]] const Value* pValue() const {
  481|  10.7M|    return pValue_.get();
  482|  10.7M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.29M|  void setCount(size_t count) {
  498|  1.29M|    count_ = count;
  499|  1.29M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  2.18M|  void setIdx(int idx) {
  502|  2.18M|    idx_ = idx;
  503|  2.18M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  1.07M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  1.07M|    return storage_;
  542|  1.07M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  55.7k|  [[nodiscard]] uint16_t szTag() const {
  624|  55.7k|    return szTag_;
  625|  55.7k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  55.7k|  [[nodiscard]] IfdId szGroup() const {
  628|  55.7k|    return szGroup_;
  629|  55.7k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  58.2k|  [[nodiscard]] uint16_t dtTag() const {
  790|  58.2k|    return dtTag_;
  791|  58.2k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  58.2k|  [[nodiscard]] IfdId dtGroup() const {
  794|  58.2k|    return dtGroup_;
  795|  58.2k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  20.5k|  [[nodiscard]] bool hasNext() const {
  843|  20.5k|    return hasNext_;
  844|  20.5k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  13.7k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  13.7k|    imageByteOrder_ = byteOrder;
 1108|  13.7k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  5.19M|  bool operator==(size_t idx) const {
 1218|  5.19M|    return idx_ == idx;
 1219|  5.19M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  2.62M|  [[nodiscard]] size_t tagStep() const {
 1235|  2.62M|    return elDefaultDef_.size(0, group_);
 1236|  2.62M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  2.36M|  void setDecoded(bool decoded) {
 1311|  2.36M|    decoded_ = decoded;
 1312|  2.36M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  7.66M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  7.66M|    return arrayCfg_;
 1320|  7.66M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   166k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   166k|    return arrayDef_;
 1324|   166k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  84.7k|  [[nodiscard]] size_t defSize() const {
 1327|  84.7k|    return defSize_;
 1328|  84.7k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   319k|  [[nodiscard]] bool decoded() const {
 1331|   319k|    return decoded_;
 1332|   319k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  1.07M|  void setElDef(const ArrayDef& def) {
 1405|  1.07M|    elDef_ = def;
 1406|  1.07M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  1.07M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  1.07M|    elByteOrder_ = byteOrder;
 1412|  1.07M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  1.10M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  1.10M|    return &elDef_;
 1422|  1.10M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  1.11M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  1.11M|    return elByteOrder_;
 1428|  1.11M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  27.9k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  27.9k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  27.9k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     19|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     19|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     19|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     94|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     94|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     94|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     15|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     15|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     15|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    236|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    236|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    236|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     11|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     11|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     11|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  9.70k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  9.70k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  9.70k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  7.28k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  7.28k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  7.28k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.65k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.65k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.65k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.85k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.85k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.85k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    472|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    472|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    472|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  10.4k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  10.4k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  10.4k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  16.1k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  16.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  16.1k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.03k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.03k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.03k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  4.93k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  4.93k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  4.93k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.04k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.04k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.04k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    800|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    800|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    800|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    311|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    311|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    311|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    508|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    508|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    508|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  8.14k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  8.14k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  8.14k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  6.94k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  6.94k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  6.94k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    903|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    903|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    903|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.12k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.12k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.12k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    505|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    505|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    505|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    773|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    773|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    773|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.61k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.61k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.61k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.35k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.35k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.35k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.10k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.10k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.10k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.52k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.52k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.52k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    134|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    134|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    134|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.30k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.30k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.30k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.49k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.49k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.49k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    285|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    285|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    285|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    931|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    931|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    931|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    398|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    398|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    398|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    440|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    440|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    440|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.90k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.90k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.90k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.24k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.24k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.24k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    256|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    256|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    256|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    424|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    424|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    424|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    347|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    347|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    347|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    336|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    336|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    336|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.66k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.66k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.66k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.62k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.62k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.62k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    252|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    252|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    252|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    685|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    685|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    685|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    279|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    279|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    279|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    207|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    207|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    207|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.14k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.14k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.14k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    270|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    270|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    270|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    674|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    674|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    674|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    293|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    293|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    293|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    498|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    498|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    498|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.49k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.49k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.49k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.98k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.98k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.98k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    207|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    207|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    207|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    475|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    475|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    475|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    246|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    246|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    246|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    395|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    395|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    395|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    469|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    469|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    469|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    869|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    869|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    869|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    253|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    253|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    253|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    206|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    206|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    206|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    330|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    330|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    330|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    127|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    127|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    127|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    915|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    915|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    915|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.15k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.15k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.15k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    413|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    413|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    413|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    299|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    299|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    299|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    278|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    278|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    278|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    219|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    219|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    219|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    384|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    384|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    384|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.89k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.89k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.89k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  15.7k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  15.7k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  15.7k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  9.21k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  9.21k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  9.21k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    391|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    391|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    391|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    231|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    231|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    231|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     70|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     70|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     70|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     82|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     82|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     82|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    125|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    125|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    125|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    240|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    240|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    240|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    237|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    237|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    237|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    201|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    201|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    201|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    200|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    200|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    200|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    340|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    340|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    340|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    431|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    431|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    431|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    132|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    132|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    132|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     83|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     83|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     83|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     75|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     75|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     75|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    224|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    224|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    224|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     92|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     92|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     92|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  12.9k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  12.9k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  12.9k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.54k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.54k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.54k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    429|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    429|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    429|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.81k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.81k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.81k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    305|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    305|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    305|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    137|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    137|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    137|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    200|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    200|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    200|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    189|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    189|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    189|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    104|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    104|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    104|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    253|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    253|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    253|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    492|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    492|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    492|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    317|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    317|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    317|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.82k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.82k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.82k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    588|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    588|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    588|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    693|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    693|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    693|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.14k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.14k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.14k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.18k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.18k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.18k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.43k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.43k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.43k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.22k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.22k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.22k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    308|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    308|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    308|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.60k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.60k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.60k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.60k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.44k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.44k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.44k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    305|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    305|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    305|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    273|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    273|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    273|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     88|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     88|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    343|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    343|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    343|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    111|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    111|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    111|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    111|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    155|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    155|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    155|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    107|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    107|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    107|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     99|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     99|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     99|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     92|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     92|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     92|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     74|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     74|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     74|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     74|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    170|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    170|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    170|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     94|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     94|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     94|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     89|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     89|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     89|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__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_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    101|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    101|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    101|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    101|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    101|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    101|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    373|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    373|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    373|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    190|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    190|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    190|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    190|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    333|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    333|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    333|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    333|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    228|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    228|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    228|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    228|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    205|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    205|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    205|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    205|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    348|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    348|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    348|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    348|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    714|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    714|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    714|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    714|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    364|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    364|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    364|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    364|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    523|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    523|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    523|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    523|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    269|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    269|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    269|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    269|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    135|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    135|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    135|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    135|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    345|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    345|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    345|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    345|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    302|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    302|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    302|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    302|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    197|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    197|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    197|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    197|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    171|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    171|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    171|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    523|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    523|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    523|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    601|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    601|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    601|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    631|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    631|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    631|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    352|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    352|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    352|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    570|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    570|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    570|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  5.29k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  5.29k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  5.29k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  5.29k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    265|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    265|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    265|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    476|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    476|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    476|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.23k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.23k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.23k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    237|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    237|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    237|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    237|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    570|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    570|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    570|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    570|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    242|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    242|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    242|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    242|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    531|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    531|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    531|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    531|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    178|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    178|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    178|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    178|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.73k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.73k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.73k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.73k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    201|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    201|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    201|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    201|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    119|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    119|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    119|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    224|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    224|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    224|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    224|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    120|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    120|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    120|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     65|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     65|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     65|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    506|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    506|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    506|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    506|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     11|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     11|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     11|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     11|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     11|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     11|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    137|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    137|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    137|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    137|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    592|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    592|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    592|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    592|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    719|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    719|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    719|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     45|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     45|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     45|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__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|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  4.86k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  4.86k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  4.86k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  6.18M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   117k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  45.8k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  34.6k|  ~TiffBinaryArray() override = default;

_ZN5Exiv29TiffImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   44|  6.54k|    Image(ImageType::tiff, mdExif | mdIptc | mdXmp, std::move(io)) {
   45|  6.54k|}  // TiffImage::TiffImage
_ZNK5Exiv29TiffImage12primaryGroupEv:
   76|  1.65k|std::string TiffImage::primaryGroup() const {
   77|  1.65k|  if (!primaryGroup_.empty())
  ------------------
  |  Branch (77:7): [True: 825, False: 825]
  ------------------
   78|    825|    return primaryGroup_;
   79|       |
   80|    825|  static constexpr auto keys = std::array{
   81|    825|      "Exif.Image.NewSubfileType",     "Exif.SubImage1.NewSubfileType", "Exif.SubImage2.NewSubfileType",
   82|    825|      "Exif.SubImage3.NewSubfileType", "Exif.SubImage4.NewSubfileType", "Exif.SubImage5.NewSubfileType",
   83|    825|      "Exif.SubImage6.NewSubfileType", "Exif.SubImage7.NewSubfileType", "Exif.SubImage8.NewSubfileType",
   84|    825|      "Exif.SubImage9.NewSubfileType",
   85|    825|  };
   86|       |  // Find the group of the primary image, default to "Image"
   87|    825|  primaryGroup_ = std::string("Image");
   88|  8.08k|  for (auto i : keys) {
  ------------------
  |  Branch (88:15): [True: 8.08k, False: 801]
  ------------------
   89|  8.08k|    auto md = exifData_.findKey(ExifKey(i));
   90|       |    // Is it the primary image?
   91|  8.08k|    if (md != exifData_.end() && md->count() > 0 && md->toInt64() == 0) {
  ------------------
  |  Branch (91:9): [True: 361, False: 7.72k]
  |  Branch (91:9): [True: 103, False: 7.98k]
  |  Branch (91:34): [True: 254, False: 107]
  |  Branch (91:53): [True: 103, False: 151]
  ------------------
   92|       |      // Sometimes there is a JPEG primary image; that's not our first choice
   93|    103|      primaryGroup_ = md->groupName();
   94|    103|      std::string key = "Exif." + primaryGroup_ + ".JPEGInterchangeFormat";
   95|    103|      if (exifData_.findKey(ExifKey(key)) == exifData_.end())
  ------------------
  |  Branch (95:11): [True: 24, False: 79]
  ------------------
   96|     24|        break;
   97|    103|    }
   98|  8.08k|  }
   99|    825|  return primaryGroup_;
  100|  1.65k|}
_ZNK5Exiv29TiffImage10pixelWidthEv:
  102|    825|uint32_t TiffImage::pixelWidth() const {
  103|    825|  if (pixelWidthPrimary_ != 0) {
  ------------------
  |  Branch (103:7): [True: 0, False: 825]
  ------------------
  104|      0|    return pixelWidthPrimary_;
  105|      0|  }
  106|       |
  107|    825|  ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageWidth"));
  108|    825|  auto imageWidth = exifData_.findKey(key);
  109|    825|  if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
  ------------------
  |  Branch (109:7): [True: 168, False: 657]
  |  Branch (109:7): [True: 95, False: 730]
  |  Branch (109:40): [True: 95, False: 73]
  ------------------
  110|     95|    pixelWidthPrimary_ = imageWidth->toUint32();
  111|     95|  }
  112|    825|  return pixelWidthPrimary_;
  113|    825|}
_ZNK5Exiv29TiffImage11pixelHeightEv:
  115|    825|uint32_t TiffImage::pixelHeight() const {
  116|    825|  if (pixelHeightPrimary_ != 0) {
  ------------------
  |  Branch (116:7): [True: 0, False: 825]
  ------------------
  117|      0|    return pixelHeightPrimary_;
  118|      0|  }
  119|       |
  120|    825|  ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageLength"));
  121|    825|  auto imageHeight = exifData_.findKey(key);
  122|    825|  if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
  ------------------
  |  Branch (122:7): [True: 207, False: 618]
  |  Branch (122:7): [True: 100, False: 725]
  |  Branch (122:41): [True: 100, False: 107]
  ------------------
  123|    100|    pixelHeightPrimary_ = imageHeight->toUint32();
  124|    100|  }
  125|    825|  return pixelHeightPrimary_;
  126|    825|}
_ZN5Exiv29TiffImage12readMetadataEv:
  133|  6.43k|void TiffImage::readMetadata() {
  134|       |#ifdef EXIV2_DEBUG_MESSAGES
  135|       |  std::cerr << "Reading TIFF file " << io_->path() << "\n";
  136|       |#endif
  137|  6.43k|  if (io_->open() != 0) {
  ------------------
  |  Branch (137:7): [True: 0, False: 6.43k]
  ------------------
  138|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  139|      0|  }
  140|       |
  141|  6.43k|  IoCloser closer(*io_);
  142|       |  // Ensure that this is the correct image type
  143|  6.43k|  if (!isTiffType(*io_, false)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 6.43k]
  ------------------
  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|  6.43k|  clearMetadata();
  149|       |
  150|  6.43k|  ByteOrder bo = TiffParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size());
  151|  6.43k|  setByteOrder(bo);
  152|       |
  153|       |  // read profile from the metadata
  154|  6.43k|  Exiv2::ExifKey key("Exif.Image.InterColorProfile");
  155|  6.43k|  auto pos = exifData_.findKey(key);
  156|  6.43k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (156:7): [True: 100, False: 6.33k]
  ------------------
  157|    100|    size_t size = pos->count() * pos->typeSize();
  158|    100|    if (size == 0) {
  ------------------
  |  Branch (158:9): [True: 78, False: 22]
  ------------------
  159|     78|      throw Error(ErrorCode::kerFailedToReadImageData);
  160|     78|    }
  161|     22|    iccProfile_.alloc(size);
  162|     22|    pos->copy(iccProfile_.data(), bo);
  163|     22|  }
  164|  6.43k|}
_ZN5Exiv29TiffImage13writeMetadataEv:
  166|  5.16k|void TiffImage::writeMetadata() {
  167|       |#ifdef EXIV2_DEBUG_MESSAGES
  168|       |  std::cerr << "Writing TIFF file " << io_->path() << "\n";
  169|       |#endif
  170|  5.16k|  ByteOrder bo = byteOrder();
  171|  5.16k|  const byte* pData = nullptr;
  172|  5.16k|  size_t size = 0;
  173|  5.16k|  IoCloser closer(*io_);
  174|       |  // Ensure that this is the correct image type
  175|  5.16k|  if (io_->open() == 0 && isTiffType(*io_, false)) {
  ------------------
  |  Branch (175:7): [True: 5.16k, False: 0]
  |  Branch (175:27): [True: 5.16k, False: 0]
  ------------------
  176|  5.16k|    pData = io_->mmap(true);
  177|  5.16k|    size = io_->size();
  178|  5.16k|    TiffHeader tiffHeader;
  179|  5.16k|    if (0 == tiffHeader.read(pData, 8)) {
  ------------------
  |  Branch (179:9): [True: 0, False: 5.16k]
  ------------------
  180|      0|      bo = tiffHeader.byteOrder();
  181|      0|    }
  182|  5.16k|  }
  183|  5.16k|  if (bo == invalidByteOrder) {
  ------------------
  |  Branch (183:7): [True: 0, False: 5.16k]
  ------------------
  184|      0|    bo = littleEndian;
  185|      0|  }
  186|  5.16k|  setByteOrder(bo);
  187|       |
  188|       |  // fixup ICC profile
  189|  5.16k|  Exiv2::ExifKey key("Exif.Image.InterColorProfile");
  190|  5.16k|  auto pos = exifData_.findKey(key);
  191|  5.16k|  bool found = pos != exifData_.end();
  192|  5.16k|  if (iccProfileDefined()) {
  ------------------
  |  Branch (192:7): [True: 17, False: 5.14k]
  ------------------
  193|     17|    Exiv2::DataValue value(iccProfile_.c_data(), iccProfile_.size());
  194|     17|    if (found)
  ------------------
  |  Branch (194:9): [True: 17, False: 0]
  ------------------
  195|     17|      pos->setValue(&value);
  196|      0|    else
  197|      0|      exifData_.add(key, &value);
  198|  5.14k|  } else {
  199|  5.14k|    if (found)
  ------------------
  |  Branch (199:9): [True: 0, False: 5.14k]
  ------------------
  200|      0|      exifData_.erase(pos);
  201|  5.14k|  }
  202|       |
  203|       |  // set usePacket to influence TiffEncoder::encodeXmp() called by TiffVisitor.encode()
  204|  5.16k|  xmpData().usePacket(writeXmpFromPacket());
  205|       |
  206|  5.16k|  TiffParser::encode(*io_, pData, size, bo, exifData_, iptcData_, xmpData_);  // may throw
  207|  5.16k|}  // TiffImage::writeMetadata
_ZN5Exiv210TiffParser6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhm:
  209|  7.52k|ByteOrder TiffParser::decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size) {
  210|  7.52k|  uint32_t root = Tag::root;
  211|       |
  212|       |  // #1402  Fujifilm RAF. Change root when parsing embedded tiff
  213|  7.52k|  Exiv2::ExifKey key("Exif.Image.Make");
  214|  7.52k|  if (exifData.findKey(key) != exifData.end() && exifData.findKey(key)->toString() == "FUJIFILM") {
  ------------------
  |  Branch (214:7): [True: 197, False: 7.33k]
  |  Branch (214:7): [True: 19, False: 7.50k]
  |  Branch (214:50): [True: 19, False: 178]
  ------------------
  215|     19|    root = Tag::fuji;
  216|     19|  }
  217|       |
  218|  7.52k|  return TiffParserWorker::decode(exifData, iptcData, xmpData, pData, size, root, TiffMapping::findDecoder);
  219|  7.52k|}  // TiffParser::decode
_ZN5Exiv210TiffParser6encodeERNS_7BasicIoEPKhmNS_9ByteOrderERNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataE:
  222|  6.73k|                               const IptcData& iptcData, const XmpData& xmpData) {
  223|       |  // Delete IFDs which do not occur in TIFF images
  224|  6.73k|  static constexpr auto filteredIfds = std::array{
  225|  6.73k|      IfdId::panaRawId,
  226|  6.73k|  };
  227|  6.73k|  for (auto filteredIfd : filteredIfds) {
  ------------------
  |  Branch (227:25): [True: 6.73k, False: 6.73k]
  ------------------
  228|       |#ifdef EXIV2_DEBUG_MESSAGES
  229|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  230|       |#endif
  231|  6.73k|    exifData.erase(std::remove_if(exifData.begin(), exifData.end(), FindExifdatum(filteredIfd)), exifData.end());
  232|  6.73k|  }
  233|       |
  234|  6.73k|  TiffHeader header(byteOrder);
  235|  6.73k|  return TiffParserWorker::encode(io, pData, size, exifData, iptcData, xmpData, Tag::root, TiffMapping::findEncoder,
  236|  6.73k|                                  &header, nullptr);
  237|  6.73k|}  // TiffParser::encode
_ZN5Exiv215newTiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  241|  6.43k|Image::UniquePtr newTiffInstance(BasicIo::UniquePtr io, bool create) {
  242|  6.43k|  auto image = std::make_unique<TiffImage>(std::move(io), create);
  243|  6.43k|  if (!image->good()) {
  ------------------
  |  Branch (243:7): [True: 0, False: 6.43k]
  ------------------
  244|      0|    return nullptr;
  245|      0|  }
  246|  6.43k|  return image;
  247|  6.43k|}
_ZN5Exiv210isTiffTypeERNS_7BasicIoEb:
  249|   188k|bool isTiffType(BasicIo& iIo, bool advance) {
  250|   188k|  const int32_t len = 8;
  251|   188k|  byte buf[len];
  252|   188k|  iIo.read(buf, len);
  253|   188k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (253:7): [True: 0, False: 188k]
  |  Branch (253:22): [True: 1.06k, False: 187k]
  ------------------
  254|  1.06k|    return false;
  255|  1.06k|  }
  256|   187k|  TiffHeader tiffHeader;
  257|   187k|  bool rc = tiffHeader.read(buf, len);
  258|   187k|  if (!advance || !rc) {
  ------------------
  |  Branch (258:7): [True: 187k, False: 0]
  |  Branch (258:19): [True: 0, False: 0]
  ------------------
  259|   187k|    iIo.seek(-len, BasicIo::cur);
  260|   187k|  }
  261|   187k|  return rc;
  262|   188k|}

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  15.2M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  15.2M|  return ifdId_ == md.ifdId();
   31|  15.2M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.39M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.39M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.39M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 8.10k, False: 1.38M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  8.10k|    decoderFct = td->decoderFct_;
 1996|  8.10k|  }
 1997|  1.39M|  return decoderFct;
 1998|  1.39M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  2.77M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  2.77M|  EncoderFct encoderFct = nullptr;
 2002|  2.77M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 5.32k, False: 2.77M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  5.32k|    encoderFct = td->encoderFct_;
 2005|  5.32k|  }
 2006|  2.77M|  return encoderFct;
 2007|  2.77M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  6.12M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  6.12M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  6.12M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  6.12M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 5.79M, False: 322k]
  ------------------
 2014|  5.79M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  5.79M|  }
 2016|  6.12M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 6.06M, False: 57.1k]
  |  Branch (2016:7): [True: 6.05M, False: 69.0k]
  |  Branch (2016:37): [True: 6.05M, False: 11.8k]
  ------------------
 2017|  6.05M|    return i->second(tag, group);
 2018|  6.05M|  }
 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|  69.0k|  return nullptr;
 2028|  6.12M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  2.79M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  2.79M|  TiffPath ret;
 2032|  10.7M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 10.7M, Folded]
  ------------------
 2033|  10.7M|    ret.emplace(extendedTag, group);
 2034|  10.7M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  10.7M|    assert(ts != tiffTreeTable_.end());
 2036|  10.7M|    extendedTag = ts->second.second;
 2037|  10.7M|    group = ts->second.first;
 2038|  10.7M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 2.79M, False: 7.97M]
  ------------------
 2039|  2.79M|      break;
 2040|  2.79M|    }
 2041|  10.7M|  }
 2042|  2.79M|  return ret;
 2043|  2.79M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  14.0k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  14.0k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  14.0k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 8.85k, False: 5.23k]
  ------------------
 2050|  8.85k|    ph = std::make_unique<TiffHeader>();
 2051|  8.85k|    pHeader = ph.get();
 2052|  8.85k|  }
 2053|       |
 2054|  14.0k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 13.7k, False: 356]
  ------------------
 2055|  13.7k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  13.7k|    rootDir->accept(decoder);
 2057|  13.7k|  }
 2058|  14.0k|  return pHeader->byteOrder();
 2059|       |
 2060|  14.0k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  14.5k|                                     OffsetWriter* pOffsetWriter) {
 2066|       |  /*
 2067|       |     1) parse the binary image, if one is provided, and
 2068|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2069|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2070|       |        writing"). If there is a parsed tree, it is only used to access the
 2071|       |        image data in this case.
 2072|       |   */
 2073|  14.5k|  WriteMethod writeMethod = wmIntrusive;
 2074|  14.5k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  14.5k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  14.5k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 5.45k, False: 9.14k]
  ------------------
 2077|       |    // Attempt to update existing TIFF components based on metadata entries
 2078|  5.45k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2079|  5.45k|    parsedTree->accept(encoder);
 2080|  5.45k|    if (!encoder.dirty())
  ------------------
  |  Branch (2080:9): [True: 705, False: 4.74k]
  ------------------
 2081|    705|      writeMethod = wmNonIntrusive;
 2082|  5.45k|  }
 2083|  14.5k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 13.8k, False: 709]
  ------------------
 2084|  13.8k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  13.8k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 4.74k, False: 9.13k]
  ------------------
 2086|       |      // Copy image tags from the original image to the composite
 2087|  4.74k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2088|  4.74k|      parsedTree->accept(copier);
 2089|  4.74k|    }
 2090|       |    // Add entries from metadata to composite
 2091|  13.8k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  13.8k|                        findEncoderFct);
 2093|  13.8k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  13.8k|    DataBuf header = pHeader->write();
 2096|  13.8k|    auto tempIo = MemIo();
 2097|  13.8k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  13.8k|    auto imageIdx(std::string::npos);
 2099|  13.8k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  13.8k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 140, False: 13.7k]
  ------------------
 2101|    140|      pOffsetWriter->writeOffsets(tempIo);
 2102|  13.8k|    io.transfer(tempIo);  // may throw
 2103|  13.8k|#ifndef SUPPRESS_WARNINGS
 2104|  13.8k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  13.8k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 13.8k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  13.8k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  13.8k|#endif
 2106|  13.8k|  }
 2107|    709|#ifndef SUPPRESS_WARNINGS
 2108|    709|  else {
 2109|    709|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    709|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 709]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    709|  LogMsg(LogMsg::info).os()
  ------------------
 2110|    709|  }
 2111|  14.5k|#endif
 2112|  14.5k|  return writeMethod;
 2113|  14.5k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  28.6k|                                                 TiffHeaderBase* pHeader) {
 2117|  28.6k|  TiffComponent::UniquePtr rootDir;
 2118|  28.6k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 9.29k, False: 19.3k]
  |  Branch (2118:17): [True: 0, False: 19.3k]
  ------------------
 2119|  9.29k|    return rootDir;
 2120|  19.3k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 68, False: 19.3k]
  |  Branch (2120:38): [True: 137, False: 19.1k]
  ------------------
 2121|    205|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    205|  }
 2123|  19.1k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  19.1k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 19.1k, False: 0]
  ------------------
 2125|  19.1k|    rootDir->setStart(pData + pHeader->offset());
 2126|  19.1k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  19.1k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  19.1k|    rootDir->accept(reader);
 2129|  19.1k|    reader.postProcess();
 2130|  19.1k|  }
 2131|  19.1k|  return rootDir;
 2132|       |
 2133|  19.3k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  14.5k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  14.5k|  PrimaryGroups ret;
 2137|  14.5k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 9.13k, False: 5.45k]
  ------------------
 2138|  9.13k|    return ret;
 2139|       |
 2140|  5.45k|  static constexpr auto imageGroups = std::array{
 2141|  5.45k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2142|  5.45k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2143|  5.45k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2144|  5.45k|  };
 2145|       |
 2146|  70.8k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2146:24): [True: 70.8k, False: 5.45k]
  ------------------
 2147|  70.8k|    TiffFinder finder(0x00fe, imageGroup);
 2148|  70.8k|    pSourceDir->accept(finder);
 2149|  70.8k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2150|  70.8k|    if (!te)
  ------------------
  |  Branch (2150:9): [True: 69.6k, False: 1.21k]
  ------------------
 2151|  69.6k|      continue;
 2152|  1.21k|    const Value* pV = te->pValue();
 2153|  1.21k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2153:9): [True: 1.06k, False: 143]
  |  Branch (2153:15): [True: 905, False: 164]
  |  Branch (2153:47): [True: 873, False: 32]
  |  Branch (2153:67): [True: 743, False: 130]
  ------------------
 2154|    743|      ret.push_back(te->group());
 2155|    743|    }
 2156|  1.21k|  }
 2157|  5.45k|  return ret;
 2158|  14.5k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   309k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   309k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   248k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   248k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 248k]
  |  Branch (2165:17): [True: 18, False: 248k]
  ------------------
 2166|     18|    return false;
 2167|       |
 2168|   248k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 6.72k, False: 241k]
  |  Branch (2168:26): [True: 6.43k, False: 292]
  ------------------
 2169|  6.43k|    byteOrder_ = littleEndian;
 2170|   241k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 85.3k, False: 156k]
  |  Branch (2170:33): [True: 84.8k, False: 534]
  ------------------
 2171|  84.8k|    byteOrder_ = bigEndian;
 2172|   157k|  } else {
 2173|   157k|    return false;
 2174|   157k|  }
 2175|  91.2k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|  91.2k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 91.2k, False: 22]
  |  Branch (2176:19): [True: 91.1k, False: 51]
  |  Branch (2176:33): [True: 26.1k, False: 64.9k]
  ------------------
 2177|  26.1k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  65.0k|  tag_ = t;
 2179|  65.0k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  65.0k|  return true;
 2182|  91.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  14.0k|DataBuf TiffHeaderBase::write() const {
 2185|  14.0k|  DataBuf buf(8);
 2186|  14.0k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 14.0k, False: 0]
  ------------------
 2187|  9.87k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 9.87k, False: 4.13k]
  ------------------
 2188|  9.87k|      buf.write_uint8(0, 'I');
 2189|  9.87k|      break;
 2190|  4.13k|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 4.13k, False: 9.87k]
  ------------------
 2191|  4.13k|      buf.write_uint8(0, 'M');
 2192|  4.13k|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 14.0k]
  ------------------
 2194|      0|      break;
 2195|  14.0k|  }
 2196|  14.0k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  14.0k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  14.0k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  14.0k|  return buf;
 2200|  14.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|  91.9k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|  91.9k|  return byteOrder_;
 2220|  91.9k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  14.2k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  14.2k|  byteOrder_ = byteOrder;
 2224|  14.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  39.4k|uint32_t TiffHeaderBase::offset() const {
 2227|  39.4k|  return offset_;
 2228|  39.4k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  8.43k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  8.43k|  offset_ = offset;
 2232|  8.43k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  15.3k|uint16_t TiffHeaderBase::tag() const {
 2239|  15.3k|  return tag_;
 2240|  15.3k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2242|  1.82k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2243|  1.82k|  return false;
 2244|  1.82k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|  2.49M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|  2.49M|  const bool result = isTiffImageTagLookup(tag, group);
 2326|       |#ifdef EXIV2_DEBUG_MESSAGES
 2327|       |  if (result) {
 2328|       |    ExifKey key(tag, groupName(group));
 2329|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2330|       |  } else {
 2331|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2332|       |  }
 2333|       |#endif
 2334|  2.49M|  return result;
 2335|  2.49M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   216k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   216k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2341|  2.49M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2342|  2.49M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2342:7): [True: 49.5k, False: 2.44M]
  ------------------
 2343|       |#ifdef EXIV2_DEBUG_MESSAGES
 2344|       |    std::cerr << "No image tags in this image\n";
 2345|       |#endif
 2346|  49.5k|    return false;
 2347|  49.5k|  }
 2348|       |#ifdef EXIV2_DEBUG_MESSAGES
 2349|       |  ExifKey key(tag, groupName(group));
 2350|       |#endif
 2351|       |  // If there are primary groups and none matches group, we're done
 2352|  2.44M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2352:7): [True: 59.2k, False: 2.38M]
  |  Branch (2352:7): [True: 23.9k, False: 2.41M]
  ------------------
 2353|  59.2k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2353:7): [True: 23.9k, False: 35.3k]
  ------------------
 2354|       |#ifdef EXIV2_DEBUG_MESSAGES
 2355|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2356|       |#endif
 2357|  23.9k|    return false;
 2358|  23.9k|  }
 2359|       |  // All tags of marked primary groups other than IFD0 are considered
 2360|       |  // image tags. That should take care of NEFs until we know better.
 2361|  2.41M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2361:7): [True: 35.3k, False: 2.38M]
  |  Branch (2361:34): [True: 34.1k, False: 1.19k]
  ------------------
 2362|       |#ifdef EXIV2_DEBUG_MESSAGES
 2363|       |    ExifKey key(tag, groupName(group));
 2364|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2365|       |#endif
 2366|  34.1k|    return true;
 2367|  34.1k|  }
 2368|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2369|  2.38M|  return isTiffImageTag(tag, group);
 2370|  2.41M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2372|    173|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2373|    173|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2374|    173|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2376|     14|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2377|     14|  auto it = offsetList_.find(id);
 2378|     14|  if (it != offsetList_.end())
  ------------------
  |  Branch (2378:7): [True: 14, False: 0]
  ------------------
 2379|     14|    it->second.target_ = target;
 2380|     14|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2382|    140|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2383|    140|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2383:29): [True: 140, False: 140]
  ------------------
 2384|    140|    io.seek(off.origin_, BasicIo::beg);
 2385|    140|    byte buf[4] = {0, 0, 0, 0};
 2386|    140|    l2Data(buf, off.target_, off.byteOrder_);
 2387|    140|    io.write(buf, 4);
 2388|    140|  }
 2389|    140|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|  2.49M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|  2.49M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 2.08M, False: 410k]
  ------------------
 2248|  2.08M|    return false;
 2249|  2.08M|  }
 2250|       |  //! List of TIFF image tags
 2251|   410k|  switch (tag) {
 2252|    804|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 804, False: 409k]
  ------------------
 2253|  1.97k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 1.16k, False: 409k]
  ------------------
 2254|  10.2k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 8.30k, False: 402k]
  ------------------
 2255|  19.5k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 9.24k, False: 401k]
  ------------------
 2256|  25.5k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 5.99k, False: 404k]
  ------------------
 2257|  26.3k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 812, False: 409k]
  ------------------
 2258|  26.8k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 526, False: 409k]
  ------------------
 2259|  27.2k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 415, False: 410k]
  ------------------
 2260|  29.7k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 2.54k, False: 407k]
  ------------------
 2261|  30.2k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 415, False: 410k]
  ------------------
 2262|  30.6k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 433, False: 410k]
  ------------------
 2263|  33.1k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 2.45k, False: 408k]
  ------------------
 2264|  33.5k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 493, False: 409k]
  ------------------
 2265|  34.1k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 509, False: 409k]
  ------------------
 2266|  34.3k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 289, False: 410k]
  ------------------
 2267|  34.4k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 76, False: 410k]
  ------------------
 2268|  34.5k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 86, False: 410k]
  ------------------
 2269|  34.7k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 224, False: 410k]
  ------------------
 2270|  35.1k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 324, False: 410k]
  ------------------
 2271|  35.4k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 351, False: 410k]
  ------------------
 2272|  35.6k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 235, False: 410k]
  ------------------
 2273|  35.7k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 86, False: 410k]
  ------------------
 2274|  35.8k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 94, False: 410k]
  ------------------
 2275|  35.9k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 95, False: 410k]
  ------------------
 2276|  36.2k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 303, False: 410k]
  ------------------
 2277|  36.4k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 217, False: 410k]
  ------------------
 2278|  36.6k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 123, False: 410k]
  ------------------
 2279|  36.6k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 67, False: 410k]
  ------------------
 2280|  36.7k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 69, False: 410k]
  ------------------
 2281|  36.9k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 251, False: 410k]
  ------------------
 2282|  37.8k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 858, False: 409k]
  ------------------
 2283|  37.9k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 69, False: 410k]
  ------------------
 2284|  38.1k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 216, False: 410k]
  ------------------
 2285|  38.1k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 41, False: 410k]
  ------------------
 2286|  38.3k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 164, False: 410k]
  ------------------
 2287|  38.3k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 47, False: 410k]
  ------------------
 2288|  38.6k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 208, False: 410k]
  ------------------
 2289|  38.7k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 138, False: 410k]
  ------------------
 2290|  38.8k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 103, False: 410k]
  ------------------
 2291|  39.0k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 224, False: 410k]
  ------------------
 2292|  39.1k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 104, False: 410k]
  ------------------
 2293|  39.2k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 84, False: 410k]
  ------------------
 2294|  39.4k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 224, False: 410k]
  ------------------
 2295|  39.6k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 161, False: 410k]
  ------------------
 2296|  39.6k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 40, False: 410k]
  ------------------
 2297|  39.7k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 73, False: 410k]
  ------------------
 2298|  41.4k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 1.73k, False: 408k]
  ------------------
 2299|  49.5k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 8.08k, False: 402k]
  ------------------
 2300|  58.3k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 8.73k, False: 401k]
  ------------------
 2301|  58.6k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 324, False: 410k]
  ------------------
 2302|  58.6k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 69, False: 410k]
  ------------------
 2303|  58.7k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 94, False: 410k]
  ------------------
 2304|  58.8k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 73, False: 410k]
  ------------------
 2305|  58.9k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 114, False: 410k]
  ------------------
 2306|  59.0k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 99, False: 410k]
  ------------------
 2307|  59.3k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 282, False: 410k]
  ------------------
 2308|  59.4k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 86, False: 410k]
  ------------------
 2309|  59.5k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 74, False: 410k]
  ------------------
 2310|  59.7k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 247, False: 410k]
  ------------------
 2311|  59.9k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 200, False: 410k]
  ------------------
 2312|  60.0k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 69, False: 410k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|  60.1k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 72, False: 410k]
  ------------------
 2315|  60.1k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 34, False: 410k]
  ------------------
 2316|  60.3k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 252, False: 410k]
  ------------------
 2317|  61.0k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 647, False: 409k]
  ------------------
 2318|  61.0k|      return true;
 2319|   349k|    default:
  ------------------
  |  Branch (2319:5): [True: 349k, False: 61.0k]
  ------------------
 2320|   349k|      return false;
 2321|   410k|  }
 2322|   410k|}

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

_ZN5Exiv28Internal11TiffVisitor5setGoENS1_7GoEventEb:
   61|   774k|void TiffVisitor::setGo(GoEvent event, bool go) {
   62|   774k|  go_[event] = go;
   63|   774k|}
_ZNK5Exiv28Internal11TiffVisitor2goENS1_7GoEventE:
   65|  86.7M|bool TiffVisitor::go(GoEvent event) const {
   66|  86.7M|  return go_[event];
   67|  86.7M|}
_ZN5Exiv28Internal11TiffVisitor18visitDirectoryNextEPNS0_13TiffDirectoryE:
   69|  1.06M|void TiffVisitor::visitDirectoryNext(TiffDirectory* /*object*/) {
   70|  1.06M|}
_ZN5Exiv28Internal11TiffVisitor17visitDirectoryEndEPNS0_13TiffDirectoryE:
   72|  1.04M|void TiffVisitor::visitDirectoryEnd(TiffDirectory* /*object*/) {
   73|  1.04M|}
_ZN5Exiv28Internal11TiffVisitor20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
   75|  42.6k|void TiffVisitor::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
   76|  42.6k|}
_ZN5Exiv28Internal11TiffVisitor19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
   78|   153k|void TiffVisitor::visitBinaryArrayEnd(TiffBinaryArray* /*object*/) {
   79|   153k|}
_ZN5Exiv28Internal10TiffFinder4initEtNS_5IfdIdE:
   81|    279|void TiffFinder::init(uint16_t tag, IfdId group) {
   82|    279|  tag_ = tag;
   83|    279|  group_ = group;
   84|    279|  tiffComponent_ = nullptr;
   85|    279|  setGo(geTraverse, true);
   86|    279|}
_ZN5Exiv28Internal10TiffFinder10findObjectEPNS0_13TiffComponentE:
   88|  35.1M|void TiffFinder::findObject(TiffComponent* object) {
   89|  35.1M|  if (object->tag() == tag_ && object->group() == group_) {
  ------------------
  |  Branch (89:7): [True: 596k, False: 34.5M]
  |  Branch (89:32): [True: 122k, False: 473k]
  ------------------
   90|   122k|    tiffComponent_ = object;
   91|   122k|    setGo(geTraverse, false);
   92|   122k|  }
   93|  35.1M|}
_ZN5Exiv28Internal10TiffFinder10visitEntryEPNS0_9TiffEntryE:
   95|  21.1M|void TiffFinder::visitEntry(TiffEntry* object) {
   96|  21.1M|  findObject(object);
   97|  21.1M|}
_ZN5Exiv28Internal10TiffFinder14visitDataEntryEPNS0_13TiffDataEntryE:
   99|   296k|void TiffFinder::visitDataEntry(TiffDataEntry* object) {
  100|   296k|  findObject(object);
  101|   296k|}
_ZN5Exiv28Internal10TiffFinder15visitImageEntryEPNS0_14TiffImageEntryE:
  103|  1.72M|void TiffFinder::visitImageEntry(TiffImageEntry* object) {
  104|  1.72M|  findObject(object);
  105|  1.72M|}
_ZN5Exiv28Internal10TiffFinder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  107|  2.26M|void TiffFinder::visitSizeEntry(TiffSizeEntry* object) {
  108|  2.26M|  findObject(object);
  109|  2.26M|}
_ZN5Exiv28Internal10TiffFinder14visitDirectoryEPNS0_13TiffDirectoryE:
  111|  1.11M|void TiffFinder::visitDirectory(TiffDirectory* object) {
  112|  1.11M|  findObject(object);
  113|  1.11M|}
_ZN5Exiv28Internal10TiffFinder11visitSubIfdEPNS0_10TiffSubIfdE:
  115|   215k|void TiffFinder::visitSubIfd(TiffSubIfd* object) {
  116|   215k|  findObject(object);
  117|   215k|}
_ZN5Exiv28Internal10TiffFinder12visitMnEntryEPNS0_11TiffMnEntryE:
  119|   212k|void TiffFinder::visitMnEntry(TiffMnEntry* object) {
  120|   212k|  findObject(object);
  121|   212k|}
_ZN5Exiv28Internal10TiffFinder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  123|  53.7k|void TiffFinder::visitIfdMakernote(TiffIfdMakernote* object) {
  124|  53.7k|  findObject(object);
  125|  53.7k|}
_ZN5Exiv28Internal10TiffFinder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  127|   125k|void TiffFinder::visitBinaryArray(TiffBinaryArray* object) {
  128|   125k|  findObject(object);
  129|   125k|}
_ZN5Exiv28Internal10TiffFinder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  131|  7.99M|void TiffFinder::visitBinaryElement(TiffBinaryElement* object) {
  132|  7.99M|  findObject(object);
  133|  7.99M|}
_ZN5Exiv28Internal10TiffCopierC2EPNS0_13TiffComponentEjPKNS0_14TiffHeaderBaseENSt3__16vectorINS_5IfdIdENS7_9allocatorIS9_EEEE:
  137|  4.74k|    pRoot_(pRoot), root_(root), pHeader_(pHeader), pPrimaryGroups_(std::move(pPrimaryGroups)) {
  138|  4.74k|}
_ZN5Exiv28Internal10TiffCopier10copyObjectEPKNS0_13TiffComponentE:
  140|   969k|void TiffCopier::copyObject(const TiffComponent* object) {
  141|   969k|  if (pHeader_->isImageTag(object->tag(), object->group(), pPrimaryGroups_)) {
  ------------------
  |  Branch (141:7): [True: 39.9k, False: 929k]
  ------------------
  142|  39.9k|    auto clone = object->clone();
  143|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  144|  39.9k|    auto tiffPath = TiffCreator::getPath(object->tag(), object->group(), root_);
  145|  39.9k|    pRoot_->addPath(object->tag(), tiffPath, pRoot_, std::move(clone));
  146|       |#ifdef EXIV2_DEBUG_MESSAGES
  147|       |    ExifKey key(object->tag(), groupName(object->group()));
  148|       |    std::cerr << "Copied " << key << "\n";
  149|       |#endif
  150|  39.9k|  }
  151|   969k|}
_ZN5Exiv28Internal10TiffCopier10visitEntryEPNS0_9TiffEntryE:
  153|   388k|void TiffCopier::visitEntry(TiffEntry* object) {
  154|   388k|  copyObject(object);
  155|   388k|}
_ZN5Exiv28Internal10TiffCopier14visitDataEntryEPNS0_13TiffDataEntryE:
  157|  5.68k|void TiffCopier::visitDataEntry(TiffDataEntry* object) {
  158|  5.68k|  copyObject(object);
  159|  5.68k|}
_ZN5Exiv28Internal10TiffCopier15visitImageEntryEPNS0_14TiffImageEntryE:
  161|  10.2k|void TiffCopier::visitImageEntry(TiffImageEntry* object) {
  162|  10.2k|  copyObject(object);
  163|  10.2k|}
_ZN5Exiv28Internal10TiffCopier14visitSizeEntryEPNS0_13TiffSizeEntryE:
  165|  17.2k|void TiffCopier::visitSizeEntry(TiffSizeEntry* object) {
  166|  17.2k|  copyObject(object);
  167|  17.2k|}
_ZN5Exiv28Internal10TiffCopier14visitDirectoryEPNS0_13TiffDirectoryE:
  169|  17.5k|void TiffCopier::visitDirectory(TiffDirectory* /*object*/) {
  170|       |  // Do not copy directories (avoids problems with SubIfds)
  171|  17.5k|}
_ZN5Exiv28Internal10TiffCopier11visitSubIfdEPNS0_10TiffSubIfdE:
  173|  4.53k|void TiffCopier::visitSubIfd(TiffSubIfd* object) {
  174|  4.53k|  copyObject(object);
  175|  4.53k|}
_ZN5Exiv28Internal10TiffCopier12visitMnEntryEPNS0_11TiffMnEntryE:
  177|  7.17k|void TiffCopier::visitMnEntry(TiffMnEntry* object) {
  178|  7.17k|  copyObject(object);
  179|  7.17k|}
_ZN5Exiv28Internal10TiffCopier17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  181|  2.04k|void TiffCopier::visitIfdMakernote(TiffIfdMakernote* object) {
  182|  2.04k|  copyObject(object);
  183|  2.04k|}
_ZN5Exiv28Internal10TiffCopier16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  185|  5.46k|void TiffCopier::visitBinaryArray(TiffBinaryArray* object) {
  186|  5.46k|  copyObject(object);
  187|  5.46k|}
_ZN5Exiv28Internal10TiffCopier18visitBinaryElementEPNS0_17TiffBinaryElementE:
  189|   529k|void TiffCopier::visitBinaryElement(TiffBinaryElement* object) {
  190|   529k|  copyObject(object);
  191|   529k|}
_ZN5Exiv28Internal11TiffDecoderC2ERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPNS0_13TiffComponentEPFMS1_FvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSF_11char_traitsIcEEEEjNS_5IfdIdEE:
  195|  13.7k|    exifData_(exifData), iptcData_(iptcData), xmpData_(xmpData), pRoot_(pRoot), findDecoderFct_(findDecoderFct) {
  196|       |  // #1402 Fujifilm RAF. Search for the make
  197|       |  // Find camera make in existing metadata (read from the JPEG)
  198|  13.7k|  ExifKey key("Exif.Image.Make");
  199|  13.7k|  if (exifData_.findKey(key) != exifData_.end()) {
  ------------------
  |  Branch (199:7): [True: 196, False: 13.5k]
  ------------------
  200|    196|    make_ = exifData_.findKey(key)->toString();
  201|  13.5k|  } else {
  202|       |    // Find camera make by looking for tag 0x010f in IFD0
  203|  13.5k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  204|  13.5k|    pRoot_->accept(finder);
  205|  13.5k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  206|  13.5k|    if (te && te->pValue()) {
  ------------------
  |  Branch (206:9): [True: 2.78k, False: 10.7k]
  |  Branch (206:15): [True: 2.71k, False: 66]
  ------------------
  207|  2.71k|      make_ = te->pValue()->toString();
  208|  2.71k|    }
  209|  13.5k|  }
  210|  13.7k|}
_ZN5Exiv28Internal11TiffDecoder10visitEntryEPNS0_9TiffEntryE:
  212|  1.57M|void TiffDecoder::visitEntry(TiffEntry* object) {
  213|  1.57M|  decodeTiffEntry(object);
  214|  1.57M|}
_ZN5Exiv28Internal11TiffDecoder14visitDataEntryEPNS0_13TiffDataEntryE:
  216|  6.51k|void TiffDecoder::visitDataEntry(TiffDataEntry* object) {
  217|  6.51k|  decodeTiffEntry(object);
  218|  6.51k|}
_ZN5Exiv28Internal11TiffDecoder15visitImageEntryEPNS0_14TiffImageEntryE:
  220|  32.5k|void TiffDecoder::visitImageEntry(TiffImageEntry* object) {
  221|  32.5k|  decodeTiffEntry(object);
  222|  32.5k|}
_ZN5Exiv28Internal11TiffDecoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  224|  40.5k|void TiffDecoder::visitSizeEntry(TiffSizeEntry* object) {
  225|  40.5k|  decodeTiffEntry(object);
  226|  40.5k|}
_ZN5Exiv28Internal11TiffDecoder14visitDirectoryEPNS0_13TiffDirectoryE:
  228|  60.5k|void TiffDecoder::visitDirectory(TiffDirectory* /* object */) {
  229|       |  // Nothing to do
  230|  60.5k|}
_ZN5Exiv28Internal11TiffDecoder11visitSubIfdEPNS0_10TiffSubIfdE:
  232|  13.1k|void TiffDecoder::visitSubIfd(TiffSubIfd* object) {
  233|  13.1k|  decodeTiffEntry(object);
  234|  13.1k|}
_ZN5Exiv28Internal11TiffDecoder12visitMnEntryEPNS0_11TiffMnEntryE:
  236|  8.92k|void TiffDecoder::visitMnEntry(TiffMnEntry* object) {
  237|       |  // Always decode binary makernote tag
  238|  8.92k|  decodeTiffEntry(object);
  239|  8.92k|}
_ZN5Exiv28Internal11TiffDecoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  241|  3.12k|void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
  242|  3.12k|  exifData_["Exif.MakerNote.Offset"] = static_cast<uint32_t>(object->mnOffset());
  243|  3.12k|  switch (object->byteOrder()) {
  ------------------
  |  Branch (243:11): [True: 3.12k, False: 0]
  ------------------
  244|    556|    case littleEndian:
  ------------------
  |  Branch (244:5): [True: 556, False: 2.57k]
  ------------------
  245|    556|      exifData_["Exif.MakerNote.ByteOrder"] = "II";
  246|    556|      break;
  247|  2.57k|    case bigEndian:
  ------------------
  |  Branch (247:5): [True: 2.57k, False: 556]
  ------------------
  248|  2.57k|      exifData_["Exif.MakerNote.ByteOrder"] = "MM";
  249|  2.57k|      break;
  250|      0|    case invalidByteOrder:
  ------------------
  |  Branch (250:5): [True: 0, False: 3.12k]
  ------------------
  251|      0|      break;
  252|  3.12k|  }
  253|  3.12k|}
_ZN5Exiv28Internal11TiffDecoder10getObjDataERPKhRmtNS_5IfdIdEPKNS0_13TiffEntryBaseE:
  255|  6.58k|void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
  256|  6.58k|  if (object && object->tag() == tag && object->group() == group) {
  ------------------
  |  Branch (256:7): [True: 6.58k, False: 0]
  |  Branch (256:17): [True: 6.26k, False: 312]
  |  Branch (256:41): [True: 6.26k, False: 0]
  ------------------
  257|  6.26k|    pData = object->pData();
  258|  6.26k|    size = object->size();
  259|  6.26k|    return;
  260|  6.26k|  }
  261|    312|  TiffFinder finder(tag, group);
  262|    312|  pRoot_->accept(finder);
  263|    312|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (263:12): [True: 48, False: 264]
  ------------------
  264|     48|    pData = te->pData();
  265|     48|    size = te->size();
  266|     48|    return;
  267|     48|  }
  268|    312|}
_ZN5Exiv28Internal11TiffDecoder9decodeXmpEPKNS0_13TiffEntryBaseE:
  270|  5.58k|void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
  271|       |  // add Exif tag anyway
  272|  5.58k|  decodeStdTiffEntry(object);
  273|       |
  274|  5.58k|  const byte* pData = nullptr;
  275|  5.58k|  size_t size = 0;
  276|  5.58k|  getObjData(pData, size, 0x02bc, IfdId::ifd0Id, object);
  277|  5.58k|  if (pData) {
  ------------------
  |  Branch (277:7): [True: 5.58k, False: 0]
  ------------------
  278|  5.58k|    std::string xmpPacket;
  279|  5.58k|    xmpPacket.assign(reinterpret_cast<const char*>(pData), size);
  280|  5.58k|    std::string::size_type idx = xmpPacket.find_first_of('<');
  281|  5.58k|    if (idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (281:9): [True: 4.25k, False: 1.32k]
  |  Branch (281:37): [True: 4.20k, False: 52]
  ------------------
  282|  4.20k|#ifndef SUPPRESS_WARNINGS
  283|  4.20k|      EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|  4.20k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.20k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.20k|  LogMsg(LogMsg::warn).os()
  ------------------
  284|  4.20k|#endif
  285|  4.20k|      xmpPacket = xmpPacket.substr(idx);
  286|  4.20k|    }
  287|  5.58k|    if (XmpParser::decode(xmpData_, xmpPacket)) {
  ------------------
  |  Branch (287:9): [True: 1.76k, False: 3.81k]
  ------------------
  288|  1.76k|#ifndef SUPPRESS_WARNINGS
  289|  1.76k|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  1.76k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.76k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.76k|  LogMsg(LogMsg::warn).os()
  ------------------
  290|  1.76k|#endif
  291|  1.76k|    }
  292|  5.58k|  }
  293|  5.58k|}  // TiffDecoder::decodeXmp
_ZN5Exiv28Internal11TiffDecoder10decodeIptcEPKNS0_13TiffEntryBaseE:
  295|  1.20k|void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
  296|       |  // add Exif tag anyway
  297|  1.20k|  decodeStdTiffEntry(object);
  298|       |
  299|       |  // All tags are read at this point, so the first time we come here,
  300|       |  // find the relevant IPTC tag and decode IPTC if found
  301|  1.20k|  if (decodedIptc_) {
  ------------------
  |  Branch (301:7): [True: 513, False: 693]
  ------------------
  302|    513|    return;
  303|    513|  }
  304|    693|  decodedIptc_ = true;
  305|       |  // 1st choice: IPTCNAA
  306|    693|  const byte* pData = nullptr;
  307|    693|  size_t size = 0;
  308|    693|  getObjData(pData, size, 0x83bb, IfdId::ifd0Id, object);
  309|    693|  if (pData) {
  ------------------
  |  Branch (309:7): [True: 597, False: 96]
  ------------------
  310|    597|    if (0 == IptcParser::decode(iptcData_, pData, size)) {
  ------------------
  |  Branch (310:9): [True: 356, False: 241]
  ------------------
  311|    356|      return;
  312|    356|    }
  313|    241|#ifndef SUPPRESS_WARNINGS
  314|    241|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x83bb\n";
  ------------------
  |  |  138|    241|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 241]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    241|  LogMsg(LogMsg::warn).os()
  ------------------
  315|       |
  316|    241|#endif
  317|    241|  }
  318|       |
  319|       |  // 2nd choice if no IPTCNAA record found or failed to decode it:
  320|       |  // ImageResources
  321|    337|  pData = nullptr;
  322|    337|  size = 0;
  323|    337|  getObjData(pData, size, 0x8649, IfdId::ifd0Id, object);
  324|    337|  if (pData) {
  ------------------
  |  Branch (324:7): [True: 128, False: 209]
  ------------------
  325|    128|    const byte* record = nullptr;
  326|    128|    uint32_t sizeHdr = 0;
  327|    128|    uint32_t sizeData = 0;
  328|    128|    if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {
  ------------------
  |  Branch (328:9): [True: 110, False: 18]
  ------------------
  329|    110|      return;
  330|    110|    }
  331|     18|    if (0 == IptcParser::decode(iptcData_, record + sizeHdr, sizeData)) {
  ------------------
  |  Branch (331:9): [True: 12, False: 6]
  ------------------
  332|     12|      return;
  333|     12|    }
  334|      6|#ifndef SUPPRESS_WARNINGS
  335|      6|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x8649\n";
  ------------------
  |  |  138|      6|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      6|  LogMsg(LogMsg::warn).os()
  ------------------
  336|       |
  337|      6|#endif
  338|      6|  }
  339|    337|}  // TiffMetadataDecoder::decodeIptc
_ZN5Exiv28Internal11TiffDecoder17decodeCanonAFInfoEPKNS0_13TiffEntryBaseE:
  347|  1.31k|void TiffDecoder::decodeCanonAFInfo(const TiffEntryBase* object) {
  348|       |  // report Exif.Canon.AFInfo as usual
  349|  1.31k|  TiffDecoder::decodeStdTiffEntry(object);
  350|  1.31k|  if (object->pValue()->count() < 3 || object->pValue()->typeId() != unsignedShort)
  ------------------
  |  Branch (350:7): [True: 345, False: 965]
  |  Branch (350:40): [True: 24, False: 941]
  ------------------
  351|    369|    return;  // insufficient data
  352|       |
  353|       |  // create vector of signedShorts from unsignedShorts in Exif.Canon.AFInfo
  354|    941|  std::vector<int16_t> ints;
  355|    941|  std::vector<uint16_t> uint;
  356|  85.7k|  for (size_t i = 0; i < object->pValue()->count(); i++) {
  ------------------
  |  Branch (356:22): [True: 84.8k, False: 941]
  ------------------
  357|  84.8k|    ints.push_back(object->pValue()->toInt64(i));
  358|  84.8k|    uint.push_back(object->pValue()->toUint32(i));
  359|  84.8k|  }
  360|       |  // Check this is AFInfo2 (ints[0] = bytes in object)
  361|    941|  if (ints.front() != static_cast<int16_t>(object->pValue()->count()) * 2)
  ------------------
  |  Branch (361:7): [True: 186, False: 755]
  ------------------
  362|    186|    return;
  363|       |
  364|    755|  std::string familyGroup(std::string("Exif.") + groupName(object->group()) + ".");
  365|       |
  366|    755|  const uint16_t nPoints = uint.at(2);
  367|    755|  const uint16_t nMasks = (nPoints + 15) / (sizeof(uint16_t) * 8);
  368|    755|  int nStart = 0;
  369|       |
  370|    755|  const std::tuple<uint16_t, uint16_t, bool> records[] = {
  371|    755|      {0x2600, 1, true},        // AFInfoSize
  372|    755|      {0x2601, 1, true},        // AFAreaMode
  373|    755|      {0x2602, 1, true},        // AFNumPoints
  374|    755|      {0x2603, 1, true},        // AFValidPoints
  375|    755|      {0x2604, 1, true},        // AFCanonImageWidth
  376|    755|      {0x2605, 1, true},        // AFCanonImageHeight
  377|    755|      {0x2606, 1, true},        // AFImageWidth"
  378|    755|      {0x2607, 1, true},        // AFImageHeight
  379|    755|      {0x2608, nPoints, true},  // AFAreaWidths
  380|    755|      {0x2609, nPoints, true},  // AFAreaHeights
  381|    755|      {0x260a, nPoints, true},  // AFXPositions
  382|    755|      {0x260b, nPoints, true},  // AFYPositions
  383|    755|      {0x260c, nMasks, false},  // AFPointsInFocus
  384|    755|      {0x260d, nMasks, false},  // AFPointsSelected
  385|    755|      {0x260e, nMasks, false},  // AFPointsUnusable
  386|    755|  };
  387|       |  // check we have enough data!
  388|    755|  uint16_t count = 0;
  389|  9.68k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (389:41): [True: 9.68k, False: 354]
  ------------------
  390|  9.68k|    count += size;
  391|  9.68k|    if (count > ints.size())
  ------------------
  |  Branch (391:9): [True: 401, False: 9.28k]
  ------------------
  392|    401|      return;
  393|  9.68k|  }
  394|       |
  395|  5.31k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (395:41): [True: 5.31k, False: 354]
  ------------------
  396|  5.31k|    auto pTags = ExifTags::tagList("Canon");
  397|  5.31k|    if (auto pTag = findTag(pTags, tag)) {
  ------------------
  |  Branch (397:14): [True: 5.31k, False: 0]
  ------------------
  398|  5.31k|      auto v = Exiv2::Value::create(bSigned ? Exiv2::signedShort : Exiv2::unsignedShort);
  ------------------
  |  Branch (398:37): [True: 4.24k, False: 1.06k]
  ------------------
  399|  5.31k|      std::string s;
  400|  5.31k|      if (bSigned) {
  ------------------
  |  Branch (400:11): [True: 4.24k, False: 1.06k]
  ------------------
  401|  11.6k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (401:30): [True: 7.42k, False: 4.24k]
  ------------------
  402|  7.42k|          s += stringFormat(" {}", ints.at(nStart++));
  ------------------
  |  |   18|  7.42k|#define stringFormat std::format
  ------------------
  403|  4.24k|      } else {
  404|  1.64k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (404:30): [True: 579, False: 1.06k]
  ------------------
  405|    579|          s += stringFormat(" {}", uint.at(nStart++));
  ------------------
  |  |   18|    579|#define stringFormat std::format
  ------------------
  406|  1.06k|      }
  407|       |
  408|  5.31k|      v->read(s);
  409|  5.31k|      exifData_[familyGroup + pTag->name_] = *v;
  410|  5.31k|    }
  411|  5.31k|  }
  412|    354|}
_ZN5Exiv28Internal11TiffDecoder15decodeTiffEntryEPKNS0_13TiffEntryBaseE:
  414|  2.26M|void TiffDecoder::decodeTiffEntry(const TiffEntryBase* object) {
  415|       |  // Don't decode the entry if value is not set
  416|  2.26M|  if (!object->pValue())
  ------------------
  |  Branch (416:7): [True: 863k, False: 1.39M]
  ------------------
  417|   863k|    return;
  418|       |
  419|       |  // skip decoding if decoderFct == 0
  420|  1.39M|  if (auto decoderFct = findDecoderFct_(make_, object->tag(), object->group()))
  ------------------
  |  Branch (420:12): [True: 1.39M, False: 0]
  ------------------
  421|  1.39M|    std::invoke(decoderFct, *this, object);
  422|  1.39M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder18decodeStdTiffEntryEPKNS0_13TiffEntryBaseE:
  424|  1.39M|void TiffDecoder::decodeStdTiffEntry(const TiffEntryBase* object) {
  425|  1.39M|  ExifKey key(object->tag(), groupName(object->group()));
  426|  1.39M|  key.setIdx(object->idx());
  427|  1.39M|  exifData_.add(key, object->pValue());
  428|       |
  429|  1.39M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  431|  7.90k|void TiffDecoder::visitBinaryArray(TiffBinaryArray* object) {
  432|  7.90k|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (432:7): [True: 1.26k, False: 6.64k]
  |  Branch (432:25): [True: 4.75k, False: 1.89k]
  ------------------
  433|  6.01k|    decodeTiffEntry(object);
  434|  6.01k|  }
  435|  7.90k|}
_ZN5Exiv28Internal11TiffDecoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  437|   577k|void TiffDecoder::visitBinaryElement(TiffBinaryElement* object) {
  438|   577k|  decodeTiffEntry(object);
  439|   577k|}
_ZN5Exiv28Internal11TiffEncoderC2ENS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEPNS0_13TiffComponentEbNSt3__16vectorINS_5IfdIdENSB_9allocatorISD_EEEEPKNS0_14TiffHeaderBaseEPFMS1_FvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSB_17basic_string_viewIcNSB_11char_traitsIcEEEEjSD_E:
  444|  19.3k|    exifData_(std::move(exifData)),
  445|  19.3k|    iptcData_(iptcData),
  446|  19.3k|    xmpData_(xmpData),
  447|  19.3k|    pHeader_(pHeader),
  448|  19.3k|    pRoot_(pRoot),
  449|  19.3k|    isNewImage_(isNewImage),
  450|  19.3k|    pPrimaryGroups_(std::move(pPrimaryGroups)),
  451|  19.3k|    byteOrder_(pHeader->byteOrder()),
  452|  19.3k|    origByteOrder_(byteOrder_),
  453|  19.3k|    findEncoderFct_(findEncoderFct) {
  454|  19.3k|  encodeIptc();
  455|  19.3k|  encodeXmp();
  456|       |
  457|       |  // Find camera make
  458|  19.3k|  ExifKey key("Exif.Image.Make");
  459|  19.3k|  if (auto pos = exifData_.findKey(key); pos != exifData_.end()) {
  ------------------
  |  Branch (459:42): [True: 9.88k, False: 9.44k]
  ------------------
  460|  9.88k|    make_ = pos->toString();
  461|  9.88k|  }
  462|  19.3k|  if (make_.empty() && pRoot_) {
  ------------------
  |  Branch (462:7): [True: 9.96k, False: 9.37k]
  |  Branch (462:24): [True: 9.96k, False: 0]
  ------------------
  463|  9.96k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  464|  9.96k|    pRoot_->accept(finder);
  465|  9.96k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  466|  9.96k|    if (te && te->pValue()) {
  ------------------
  |  Branch (466:9): [True: 142, False: 9.81k]
  |  Branch (466:15): [True: 120, False: 22]
  ------------------
  467|    120|      make_ = te->pValue()->toString();
  468|    120|    }
  469|  9.96k|  }
  470|  19.3k|}
_ZN5Exiv28Internal11TiffEncoder10encodeIptcEv:
  472|  19.3k|void TiffEncoder::encodeIptc() {
  473|       |  // Update IPTCNAA Exif tag, if it exists. Delete the tag if there
  474|       |  // is no IPTC data anymore.
  475|       |  // If there is new IPTC data and Exif.Image.ImageResources does
  476|       |  // not exist, create a new IPTCNAA Exif tag.
  477|  19.3k|  bool del = false;
  478|  19.3k|  ExifKey iptcNaaKey("Exif.Image.IPTCNAA");
  479|  19.3k|  auto pos = exifData_.findKey(iptcNaaKey);
  480|  19.3k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (480:7): [True: 1.05k, False: 18.2k]
  ------------------
  481|  1.05k|    iptcNaaKey.setIdx(pos->idx());
  482|  1.05k|    exifData_.erase(pos);
  483|  1.05k|    del = true;
  484|  1.05k|  }
  485|  19.3k|  DataBuf rawIptc = IptcParser::encode(iptcData_);
  486|  19.3k|  ExifKey irbKey("Exif.Image.ImageResources");
  487|  19.3k|  pos = exifData_.findKey(irbKey);
  488|  19.3k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (488:7): [True: 572, False: 18.7k]
  ------------------
  489|    572|    irbKey.setIdx(pos->idx());
  490|    572|  }
  491|  19.3k|  if (!rawIptc.empty() && (del || pos == exifData_.end())) {
  ------------------
  |  Branch (491:7): [True: 562, False: 18.7k]
  |  Branch (491:7): [True: 559, False: 18.7k]
  |  Branch (491:28): [True: 559, False: 3]
  |  Branch (491:35): [True: 0, False: 3]
  ------------------
  492|    559|    auto value = Value::create(unsignedLong);
  493|    559|    DataBuf buf;
  494|    559|    if (rawIptc.size() % 4 != 0) {
  ------------------
  |  Branch (494:9): [True: 427, False: 132]
  ------------------
  495|       |      // Pad the last unsignedLong value with 0s
  496|    427|      buf.alloc(((rawIptc.size() / 4) * 4) + 4);
  497|    427|      std::move(rawIptc.begin(), rawIptc.end(), buf.begin());
  498|    427|    } else {
  499|    132|      buf = std::move(rawIptc);  // Note: This resets rawIptc
  500|    132|    }
  501|    559|    value->read(buf.data(), buf.size(), byteOrder_);
  502|    559|    Exifdatum iptcDatum(iptcNaaKey, value.get());
  503|    559|    exifData_.add(iptcDatum);
  504|    559|    pos = exifData_.findKey(irbKey);  // needed after add()
  505|    559|  }
  506|       |  // Also update IPTC IRB in Exif.Image.ImageResources if it exists,
  507|       |  // but don't create it if not.
  508|  19.3k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (508:7): [True: 572, False: 18.7k]
  ------------------
  509|    572|    DataBuf irbBuf(pos->value().size());
  510|    572|    pos->value().copy(irbBuf.data(), invalidByteOrder);
  511|    572|    irbBuf = Photoshop::setIptcIrb(irbBuf.c_data(), irbBuf.size(), iptcData_);
  512|    572|    exifData_.erase(pos);
  513|    572|    if (!irbBuf.empty()) {
  ------------------
  |  Branch (513:9): [True: 283, False: 289]
  ------------------
  514|    283|      auto value = Value::create(unsignedByte);
  515|    283|      value->read(irbBuf.data(), irbBuf.size(), invalidByteOrder);
  516|    283|      Exifdatum iptcDatum(irbKey, value.get());
  517|    283|      exifData_.add(iptcDatum);
  518|    283|    }
  519|    572|  }
  520|  19.3k|}  // TiffEncoder::encodeIptc
_ZN5Exiv28Internal11TiffEncoder9encodeXmpEv:
  522|  19.3k|void TiffEncoder::encodeXmp() {
  523|  19.3k|#ifdef EXV_HAVE_XMP_TOOLKIT
  524|  19.3k|  ExifKey xmpKey("Exif.Image.XMLPacket");
  525|       |  // Remove any existing XMP Exif tag
  526|  19.3k|  if (auto pos = exifData_.findKey(xmpKey); pos != exifData_.end()) {
  ------------------
  |  Branch (526:45): [True: 1.81k, False: 17.5k]
  ------------------
  527|  1.81k|    xmpKey.setIdx(pos->idx());
  528|  1.81k|    exifData_.erase(pos);
  529|  1.81k|  }
  530|  19.3k|  std::string xmpPacket;
  531|  19.3k|  if (xmpData_.usePacket()) {
  ------------------
  |  Branch (531:7): [True: 0, False: 19.3k]
  ------------------
  532|      0|    xmpPacket = xmpData_.xmpPacket();
  533|  19.3k|  } else {
  534|  19.3k|    if (XmpParser::encode(xmpPacket, xmpData_) > 1) {
  ------------------
  |  Branch (534:9): [True: 2, False: 19.3k]
  ------------------
  535|      2|#ifndef SUPPRESS_WARNINGS
  536|      2|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|      2|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      2|  LogMsg(LogMsg::error).os()
  ------------------
  537|      2|#endif
  538|      2|    }
  539|  19.3k|  }
  540|  19.3k|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (540:7): [True: 600, False: 18.7k]
  ------------------
  541|       |    // Set the XMP Exif tag to the new value
  542|    600|    auto value = Value::create(unsignedByte);
  543|    600|    value->read(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size(), invalidByteOrder);
  544|    600|    Exifdatum xmpDatum(xmpKey, value.get());
  545|    600|    exifData_.add(xmpDatum);
  546|    600|  }
  547|  19.3k|#endif
  548|  19.3k|}  // TiffEncoder::encodeXmp
_ZN5Exiv28Internal11TiffEncoder8setDirtyEb:
  550|   651k|void TiffEncoder::setDirty(bool flag) {
  551|   651k|  dirty_ = flag;
  552|   651k|  setGo(geTraverse, !flag);
  553|   651k|}
_ZNK5Exiv28Internal11TiffEncoder5dirtyEv:
  555|  5.44k|bool TiffEncoder::dirty() const {
  556|  5.44k|  return dirty_ || !exifData_.empty();
  ------------------
  |  Branch (556:10): [True: 4.74k, False: 707]
  |  Branch (556:20): [True: 2, False: 705]
  ------------------
  557|  5.44k|}
_ZN5Exiv28Internal11TiffEncoder10visitEntryEPNS0_9TiffEntryE:
  559|  41.6k|void TiffEncoder::visitEntry(TiffEntry* object) {
  560|  41.6k|  encodeTiffComponent(object);
  561|  41.6k|}
_ZN5Exiv28Internal11TiffEncoder14visitDataEntryEPNS0_13TiffDataEntryE:
  563|  1.64k|void TiffEncoder::visitDataEntry(TiffDataEntry* object) {
  564|  1.64k|  encodeTiffComponent(object);
  565|  1.64k|}
_ZN5Exiv28Internal11TiffEncoder15visitImageEntryEPNS0_14TiffImageEntryE:
  567|  1.58k|void TiffEncoder::visitImageEntry(TiffImageEntry* object) {
  568|  1.58k|  encodeTiffComponent(object);
  569|  1.58k|}
_ZN5Exiv28Internal11TiffEncoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  571|  2.49k|void TiffEncoder::visitSizeEntry(TiffSizeEntry* object) {
  572|  2.49k|  encodeTiffComponent(object);
  573|  2.49k|}
_ZN5Exiv28Internal11TiffEncoder14visitDirectoryEPNS0_13TiffDirectoryE:
  575|  10.9k|void TiffEncoder::visitDirectory(TiffDirectory* /*object*/) {
  576|       |  // Nothing to do
  577|  10.9k|}
_ZN5Exiv28Internal11TiffEncoder18visitDirectoryNextEPNS0_13TiffDirectoryE:
  579|  5.27k|void TiffEncoder::visitDirectoryNext(TiffDirectory* object) {
  580|       |  // Update type and count in IFD entries, in case they changed
  581|  5.27k|  byte* p = object->start() + 2;
  582|  18.1k|  for (const auto& component : object->components_) {
  ------------------
  |  Branch (582:30): [True: 18.1k, False: 5.27k]
  ------------------
  583|  18.1k|    p += updateDirEntry(p, byteOrder(), component);
  584|  18.1k|  }
  585|  5.27k|}
_ZN5Exiv28Internal11TiffEncoder14updateDirEntryEPhNS_9ByteOrderERKNSt3__110shared_ptrINS0_13TiffComponentEEE:
  587|  18.1k|uint32_t TiffEncoder::updateDirEntry(byte* buf, ByteOrder byteOrder, const TiffComponent::SharedPtr& tiffComponent) {
  588|  18.1k|  auto pTiffEntry = std::dynamic_pointer_cast<TiffEntryBase>(tiffComponent);
  589|  18.1k|  if (!pTiffEntry)
  ------------------
  |  Branch (589:7): [True: 0, False: 18.1k]
  ------------------
  590|      0|    return 0;
  591|  18.1k|  us2Data(buf + 2, pTiffEntry->tiffType(), byteOrder);
  592|  18.1k|  ul2Data(buf + 4, static_cast<uint32_t>(pTiffEntry->count()), byteOrder);
  593|       |  // Move data to offset field, if it fits and is not yet there.
  594|  18.1k|  if (pTiffEntry->size() <= 4 && buf + 8 != pTiffEntry->pData()) {
  ------------------
  |  Branch (594:7): [True: 15.1k, False: 3.01k]
  |  Branch (594:34): [True: 4.10k, False: 11.0k]
  ------------------
  595|       |#ifdef EXIV2_DEBUG_MESSAGES
  596|       |    std::cerr << "Copying data for tag " << pTiffEntry->tag() << " to offset area.\n";
  597|       |#endif
  598|  4.10k|    memset(buf + 8, 0x0, 4);
  599|  4.10k|    if (pTiffEntry->size() > 0) {
  ------------------
  |  Branch (599:9): [True: 71, False: 4.03k]
  ------------------
  600|     71|      std::copy_n(pTiffEntry->pData(), pTiffEntry->size(), buf + 8);
  601|     71|      memset(const_cast<byte*>(pTiffEntry->pData()), 0x0, pTiffEntry->size());
  602|     71|    }
  603|  4.10k|  }
  604|  18.1k|  return 12;
  605|  18.1k|}
_ZN5Exiv28Internal11TiffEncoder11visitSubIfdEPNS0_10TiffSubIfdE:
  607|  1.83k|void TiffEncoder::visitSubIfd(TiffSubIfd* object) {
  608|  1.83k|  encodeTiffComponent(object);
  609|  1.83k|}
_ZN5Exiv28Internal11TiffEncoder12visitMnEntryEPNS0_11TiffMnEntryE:
  611|  1.13k|void TiffEncoder::visitMnEntry(TiffMnEntry* object) {
  612|       |  // Test is required here as well as in the callback encoder function
  613|  1.13k|  if (!object->mn_) {
  ------------------
  |  Branch (613:7): [True: 644, False: 495]
  ------------------
  614|    644|    encodeTiffComponent(object);
  615|    644|  } else if (del_) {
  ------------------
  |  Branch (615:14): [True: 495, False: 0]
  ------------------
  616|       |    // The makernote is made up of decoded tags, delete binary tag
  617|    495|    ExifKey key(object->tag(), groupName(object->group()));
  618|    495|    auto pos = exifData_.findKey(key);
  619|    495|    if (pos != exifData_.end())
  ------------------
  |  Branch (619:9): [True: 485, False: 10]
  ------------------
  620|    485|      exifData_.erase(pos);
  621|    495|  }
  622|  1.13k|}
_ZN5Exiv28Internal11TiffEncoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  624|    495|void TiffEncoder::visitIfdMakernote(TiffIfdMakernote* object) {
  625|    495|  auto pos = exifData_.findKey(ExifKey("Exif.MakerNote.ByteOrder"));
  626|    495|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (626:7): [True: 246, False: 249]
  ------------------
  627|       |    // Set Makernote byte order
  628|    246|    ByteOrder bo = stringToByteOrder(pos->toString());
  629|    246|    if (bo != invalidByteOrder && bo != object->byteOrder()) {
  ------------------
  |  Branch (629:9): [True: 246, False: 0]
  |  Branch (629:35): [True: 3, False: 243]
  ------------------
  630|      3|      object->setByteOrder(bo);
  631|      3|      setDirty();
  632|      3|    }
  633|    246|    if (del_)
  ------------------
  |  Branch (633:9): [True: 246, False: 0]
  ------------------
  634|    246|      exifData_.erase(pos);
  635|    246|  }
  636|    495|  if (del_) {
  ------------------
  |  Branch (636:7): [True: 495, False: 0]
  ------------------
  637|       |    // Remove remaining synthesized tags
  638|    495|    static constexpr auto synthesizedTags = std::array{
  639|    495|        "Exif.MakerNote.Offset",
  640|    495|    };
  641|    495|    for (auto synthesizedTag : synthesizedTags) {
  ------------------
  |  Branch (641:30): [True: 495, False: 495]
  ------------------
  642|    495|      pos = exifData_.findKey(ExifKey(synthesizedTag));
  643|    495|      if (pos != exifData_.end())
  ------------------
  |  Branch (643:11): [True: 246, False: 249]
  ------------------
  644|    246|        exifData_.erase(pos);
  645|    495|    }
  646|    495|  }
  647|       |  // Modify encoder for Makernote peculiarities, byte order
  648|    495|  byteOrder_ = object->byteOrder();
  649|       |
  650|    495|}  // TiffEncoder::visitIfdMakernote
_ZN5Exiv28Internal11TiffEncoder20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
  652|    324|void TiffEncoder::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
  653|       |  // Reset byte order back to that from the c'tor
  654|    324|  byteOrder_ = origByteOrder_;
  655|       |
  656|    324|}  // TiffEncoder::visitIfdMakernoteEnd
_ZN5Exiv28Internal11TiffEncoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  658|    525|void TiffEncoder::visitBinaryArray(TiffBinaryArray* object) {
  659|    525|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (659:7): [True: 122, False: 403]
  |  Branch (659:25): [True: 179, False: 224]
  ------------------
  660|    301|    encodeTiffComponent(object);
  661|    301|  }
  662|    525|}
_ZN5Exiv28Internal11TiffEncoder19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
  664|    519|void TiffEncoder::visitBinaryArrayEnd(TiffBinaryArray* object) {
  665|    519|  if (!object->cfg() || !object->decoded())
  ------------------
  |  Branch (665:7): [True: 122, False: 397]
  |  Branch (665:25): [True: 173, False: 224]
  ------------------
  666|    295|    return;
  667|    224|  size_t size = object->TiffEntryBase::doSize();
  668|    224|  if (size == 0)
  ------------------
  |  Branch (668:7): [True: 0, False: 224]
  ------------------
  669|      0|    return;
  670|    224|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (670:7): [True: 0, False: 224]
  ------------------
  671|      0|    return;
  672|       |
  673|       |  // Re-encrypt buffer if necessary
  674|    224|  CryptFct cryptFct = object->cfg()->cryptFct_;
  675|    224|  if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (675:7): [True: 15, False: 209]
  ------------------
  676|     15|    cryptFct = sonyTagEncipher;
  677|     15|  }
  678|    224|  if (cryptFct) {
  ------------------
  |  Branch (678:7): [True: 69, False: 155]
  ------------------
  679|     69|    const byte* pData = object->pData();
  680|     69|    DataBuf buf = cryptFct(object->tag(), pData, size, pRoot_);
  681|     69|    if (!buf.empty()) {
  ------------------
  |  Branch (681:9): [True: 30, False: 39]
  ------------------
  682|     30|      pData = buf.c_data();
  683|     30|      size = buf.size();
  684|     30|    }
  685|     69|    if (!object->updOrigDataBuf(pData, size)) {
  ------------------
  |  Branch (685:9): [True: 0, False: 69]
  ------------------
  686|      0|      setDirty();
  687|      0|    }
  688|     69|  }
  689|    224|}
_ZN5Exiv28Internal11TiffEncoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  691|  3.34k|void TiffEncoder::visitBinaryElement(TiffBinaryElement* object) {
  692|       |  // Temporarily overwrite byte order according to that of the binary element
  693|  3.34k|  ByteOrder boOrig = byteOrder_;
  694|  3.34k|  if (object->elByteOrder() != invalidByteOrder)
  ------------------
  |  Branch (694:7): [True: 633, False: 2.70k]
  ------------------
  695|    633|    byteOrder_ = object->elByteOrder();
  696|  3.34k|  encodeTiffComponent(object);
  697|  3.34k|  byteOrder_ = boOrig;
  698|  3.34k|}
_ZNK5Exiv28Internal11TiffEncoder10isImageTagEtNS_5IfdIdE:
  700|  5.55M|bool TiffEncoder::isImageTag(uint16_t tag, IfdId group) const {
  701|  5.55M|  return !isNewImage_ && pHeader_->isImageTag(tag, group, pPrimaryGroups_);
  ------------------
  |  Branch (701:10): [True: 1.57M, False: 3.98M]
  |  Branch (701:26): [True: 27.5k, False: 1.54M]
  ------------------
  702|  5.55M|}
_ZN5Exiv28Internal11TiffEncoder19encodeTiffComponentEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  704|  2.78M|void TiffEncoder::encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum) {
  705|  2.78M|  auto pos = exifData_.end();
  706|  2.78M|  const Exifdatum* ed = datum;
  707|  2.78M|  if (!ed) {
  ------------------
  |  Branch (707:7): [True: 53.5k, False: 2.73M]
  ------------------
  708|       |    // Non-intrusive writing: find matching tag
  709|  53.5k|    ExifKey key(object->tag(), groupName(object->group()));
  710|  53.5k|    pos = exifData_.findKey(key);
  711|  53.5k|    if (pos != exifData_.end()) {
  ------------------
  |  Branch (711:9): [True: 49.0k, False: 4.49k]
  ------------------
  712|  49.0k|      ed = &(*pos);
  713|  49.0k|      if (object->idx() != pos->idx()) {
  ------------------
  |  Branch (713:11): [True: 4.84k, False: 44.1k]
  ------------------
  714|       |        // Try to find exact match (in case of duplicate tags)
  715|  4.84k|        auto pos2 = std::find_if(exifData_.begin(), exifData_.end(), FindExifdatum2(object->group(), object->idx()));
  716|  4.84k|        if (pos2 != exifData_.end() && pos2->key() == key.key()) {
  ------------------
  |  Branch (716:13): [True: 138, False: 4.71k]
  |  Branch (716:13): [True: 40, False: 4.80k]
  |  Branch (716:40): [True: 40, False: 98]
  ------------------
  717|     40|          ed = &(*pos2);
  718|     40|          pos = pos2;  // make sure we delete the correct tag below
  719|     40|        }
  720|  4.84k|      }
  721|  49.0k|    } else {
  722|  4.49k|      setDirty();
  723|       |#ifdef EXIV2_DEBUG_MESSAGES
  724|       |      std::cerr << "DELETING          " << key << ", idx = " << object->idx() << "\n";
  725|       |#endif
  726|  4.49k|    }
  727|  2.73M|  } else {
  728|       |    // For intrusive writing, the index is used to preserve the order of
  729|       |    // duplicate tags
  730|  2.73M|    object->idx_ = ed->idx();
  731|  2.73M|  }
  732|       |  // Skip encoding image tags of existing TIFF image - they were copied earlier -
  733|       |  // but encode image tags of new images (creation)
  734|  2.78M|  if (ed && !isImageTag(object->tag(), object->group())) {
  ------------------
  |  Branch (734:7): [True: 2.78M, False: 4.49k]
  |  Branch (734:13): [True: 2.77M, False: 5.73k]
  ------------------
  735|  2.77M|    if (auto fct = findEncoderFct_(make_, object->tag(), object->group())) {
  ------------------
  |  Branch (735:14): [True: 0, False: 2.77M]
  ------------------
  736|       |      // If an encoding function is registered for the tag, use it
  737|      0|      std::invoke(fct, *this, object, ed);
  738|  2.77M|    } else {
  739|       |      // Else use the encode function at the object (results in a double-dispatch
  740|       |      // to the appropriate encoding function of the encoder.
  741|  2.77M|      object->encode(*this, ed);
  742|  2.77M|    }
  743|  2.77M|  }
  744|  2.78M|  if (del_ && pos != exifData_.end()) {
  ------------------
  |  Branch (744:7): [True: 53.5k, False: 2.73M]
  |  Branch (744:7): [True: 49.0k, False: 2.73M]
  |  Branch (744:15): [True: 49.0k, False: 4.49k]
  ------------------
  745|  49.0k|    exifData_.erase(pos);
  746|  49.0k|  }
  747|       |#ifdef EXIV2_DEBUG_MESSAGES
  748|       |  std::cerr << "\n";
  749|       |#endif
  750|  2.78M|}  // TiffEncoder::encodeTiffComponent
_ZN5Exiv28Internal11TiffEncoder17encodeBinaryArrayEPNS0_15TiffBinaryArrayEPKNS_9ExifdatumE:
  752|  14.9k|void TiffEncoder::encodeBinaryArray(TiffBinaryArray* object, const Exifdatum* datum) {
  753|  14.9k|  encodeOffsetEntry(object, datum);
  754|  14.9k|}  // TiffEncoder::encodeBinaryArray
_ZN5Exiv28Internal11TiffEncoder19encodeBinaryElementEPNS0_17TiffBinaryElementEPKNS_9ExifdatumE:
  756|  1.28M|void TiffEncoder::encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum) {
  757|  1.28M|  encodeTiffEntryBase(object, datum);
  758|  1.28M|}  // TiffEncoder::encodeArrayElement
_ZN5Exiv28Internal11TiffEncoder15encodeDataEntryEPNS0_13TiffDataEntryEPKNS_9ExifdatumE:
  760|  7.61k|void TiffEncoder::encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum) {
  761|  7.61k|  encodeOffsetEntry(object, datum);
  762|       |
  763|  7.61k|  if (!dirty_ && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (763:7): [True: 1.81k, False: 5.80k]
  |  Branch (763:18): [True: 1.49k, False: 317]
  ------------------
  764|  1.49k|    if (object->sizeDataArea_ < object->pValue()->sizeDataArea()) {
  ------------------
  |  Branch (764:9): [True: 0, False: 1.49k]
  ------------------
  765|       |#ifdef EXIV2_DEBUG_MESSAGES
  766|       |      ExifKey key(object->tag(), groupName(object->group()));
  767|       |      std::cerr << "DATAAREA GREW     " << key << "\n";
  768|       |#endif
  769|      0|      setDirty();
  770|  1.49k|    } else {
  771|       |      // Write the new dataarea, fill with 0x0
  772|       |#ifdef EXIV2_DEBUG_MESSAGES
  773|       |      ExifKey key(object->tag(), groupName(object->group()));
  774|       |      std::cerr << "Writing data area for " << key << "\n";
  775|       |#endif
  776|  1.49k|      DataBuf buf = object->pValue()->dataArea();
  777|  1.49k|      if (!buf.empty()) {
  ------------------
  |  Branch (777:11): [True: 557, False: 940]
  ------------------
  778|    557|        std::copy(buf.begin(), buf.end(), object->pDataArea_);
  779|    557|        if (object->sizeDataArea_ > buf.size()) {
  ------------------
  |  Branch (779:13): [True: 0, False: 557]
  ------------------
  780|      0|          memset(object->pDataArea_ + buf.size(), 0x0, object->sizeDataArea_ - buf.size());
  781|      0|        }
  782|    557|      }
  783|  1.49k|    }
  784|  1.49k|  }
  785|       |
  786|  7.61k|}  // TiffEncoder::encodeDataEntry
_ZN5Exiv28Internal11TiffEncoder15encodeTiffEntryEPNS0_9TiffEntryEPKNS_9ExifdatumE:
  788|  1.41M|void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) {
  789|  1.41M|  encodeTiffEntryBase(object, datum);
  790|  1.41M|}  // TiffEncoder::encodeTiffEntry
_ZN5Exiv28Internal11TiffEncoder16encodeImageEntryEPNS0_14TiffImageEntryEPKNS_9ExifdatumE:
  792|  15.2k|void TiffEncoder::encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum) {
  793|  15.2k|  encodeOffsetEntry(object, datum);
  794|       |
  795|  15.2k|  size_t sizeDataArea = object->pValue()->sizeDataArea();
  796|       |
  797|  15.2k|  if (sizeDataArea > 0 && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (797:7): [True: 144, False: 15.0k]
  |  Branch (797:27): [True: 0, False: 144]
  ------------------
  798|       |#ifdef EXIV2_DEBUG_MESSAGES
  799|       |    std::cerr << "\t DATAAREA IS SET (NON-INTRUSIVE WRITING)";
  800|       |#endif
  801|      0|    setDirty();
  802|      0|  }
  803|       |
  804|  15.2k|  if (sizeDataArea > 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (804:7): [True: 144, False: 15.0k]
  |  Branch (804:27): [True: 144, False: 0]
  ------------------
  805|       |#ifdef EXIV2_DEBUG_MESSAGES
  806|       |    std::cerr << "\t DATAAREA IS SET (INTRUSIVE WRITING)";
  807|       |#endif
  808|       |    // Set pseudo strips (without a data pointer) from the size tag
  809|    144|    ExifKey key(object->szTag(), groupName(object->szGroup()));
  810|    144|    auto pos = exifData_.findKey(key);
  811|    144|    const byte* zero = nullptr;
  812|    144|    if (pos == exifData_.end()) {
  ------------------
  |  Branch (812:9): [True: 0, False: 144]
  ------------------
  813|      0|#ifndef SUPPRESS_WARNINGS
  814|      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()
  ------------------
  815|      0|#endif
  816|      0|      object->strips_.clear();
  817|      0|      object->strips_.emplace_back(zero, sizeDataArea);
  818|    144|    } else {
  819|    144|      size_t sizeTotal = 0;
  820|    144|      object->strips_.clear();
  821|  4.67k|      for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (821:26): [True: 4.52k, False: 144]
  ------------------
  822|  4.52k|        uint32_t len = pos->toUint32(i);
  823|  4.52k|        object->strips_.emplace_back(zero, len);
  824|  4.52k|        sizeTotal += len;
  825|  4.52k|      }
  826|    144|      if (sizeTotal != sizeDataArea) {
  ------------------
  |  Branch (826:11): [True: 0, False: 144]
  ------------------
  827|      0|#ifndef SUPPRESS_WARNINGS
  828|      0|        ExifKey key2(object->tag(), groupName(object->group()));
  829|      0|        EXV_ERROR << "Sum of all sizes of " << key << " != data size of " << key2 << ". "
  ------------------
  |  |  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()
  ------------------
  830|      0|                  << "This results in an invalid image.\n";
  831|      0|#endif
  832|       |        // Todo: How to fix? Write only one strip?
  833|      0|      }
  834|    144|    }
  835|    144|  }
  836|       |
  837|  15.2k|  if (sizeDataArea == 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (837:7): [True: 15.0k, False: 144]
  |  Branch (837:28): [True: 14.2k, False: 818]
  ------------------
  838|       |#ifdef EXIV2_DEBUG_MESSAGES
  839|       |    std::cerr << "\t USE STRIPS FROM SOURCE TREE IMAGE ENTRY";
  840|       |#endif
  841|       |    // Set strips from source tree
  842|  14.2k|    if (pSourceTree_) {
  ------------------
  |  Branch (842:9): [True: 6.23k, False: 8.00k]
  ------------------
  843|  6.23k|      TiffFinder finder(object->tag(), object->group());
  844|  6.23k|      pSourceTree_->accept(finder);
  845|  6.23k|      if (auto ti = dynamic_cast<const TiffImageEntry*>(finder.result())) {
  ------------------
  |  Branch (845:16): [True: 6.23k, False: 3]
  ------------------
  846|  6.23k|        object->strips_ = ti->strips_;
  847|  6.23k|      }
  848|  6.23k|    }
  849|  8.00k|#ifndef SUPPRESS_WARNINGS
  850|  8.00k|    else {
  851|  8.00k|      ExifKey key2(object->tag(), groupName(object->group()));
  852|  8.00k|      EXV_WARNING << "No image data to encode " << key2 << ".\n";
  ------------------
  |  |  138|  8.00k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.00k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.00k|  LogMsg(LogMsg::warn).os()
  ------------------
  853|  8.00k|    }
  854|  14.2k|#endif
  855|  14.2k|  }
  856|       |
  857|  15.2k|}  // TiffEncoder::encodeImageEntry
_ZN5Exiv28Internal11TiffEncoder13encodeMnEntryEPNS0_11TiffMnEntryEPKNS_9ExifdatumE:
  859|  12.4k|void TiffEncoder::encodeMnEntry(TiffMnEntry* object, const Exifdatum* datum) {
  860|       |  // Test is required here as well as in the visit function
  861|  12.4k|  if (!object->mn_)
  ------------------
  |  Branch (861:7): [True: 12.3k, False: 134]
  ------------------
  862|  12.3k|    encodeTiffEntryBase(object, datum);
  863|  12.4k|}  // TiffEncoder::encodeMnEntry
_ZN5Exiv28Internal11TiffEncoder15encodeSizeEntryEPNS0_13TiffSizeEntryEPKNS_9ExifdatumE:
  865|  25.8k|void TiffEncoder::encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum) {
  866|  25.8k|  encodeTiffEntryBase(object, datum);
  867|  25.8k|}  // TiffEncoder::encodeSizeEntry
_ZN5Exiv28Internal11TiffEncoder12encodeSubIfdEPNS0_10TiffSubIfdEPKNS_9ExifdatumE:
  869|  1.70k|void TiffEncoder::encodeSubIfd(TiffSubIfd* object, const Exifdatum* datum) {
  870|  1.70k|  encodeOffsetEntry(object, datum);
  871|  1.70k|}  // TiffEncoder::encodeSubIfd
_ZN5Exiv28Internal11TiffEncoder19encodeTiffEntryBaseEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  873|  2.73M|void TiffEncoder::encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum) {
  874|       |#ifdef EXIV2_DEBUG_MESSAGES
  875|       |  bool tooLarge = false;
  876|       |#endif
  877|  2.73M|  if (datum->size() > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (877:7): [True: 636k, False: 2.09M]
  ------------------
  878|   636k|    setDirty();
  879|       |#ifdef EXIV2_DEBUG_MESSAGES
  880|       |    tooLarge = true;
  881|       |#endif
  882|   636k|  }
  883|  2.73M|  object->updateValue(datum->getValue(), byteOrder());  // clones the value
  884|       |#ifdef EXIV2_DEBUG_MESSAGES
  885|       |  ExifKey key(object->tag(), groupName(object->group()));
  886|       |  std::cerr << "UPDATING DATA     " << key;
  887|       |  if (tooLarge) {
  888|       |    std::cerr << "\t\t\t ALLOCATED " << std::dec << object->size_ << " BYTES";
  889|       |  }
  890|       |#endif
  891|  2.73M|}
_ZN5Exiv28Internal11TiffEncoder17encodeOffsetEntryEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  893|  39.4k|void TiffEncoder::encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum) {
  894|  39.4k|  size_t newSize = datum->size();
  895|  39.4k|  if (newSize > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (895:7): [True: 10.1k, False: 29.2k]
  ------------------
  896|  10.1k|    setDirty();
  897|  10.1k|    object->updateValue(datum->getValue(), byteOrder());  // clones the value
  898|       |#ifdef EXIV2_DEBUG_MESSAGES
  899|       |    ExifKey key(object->tag(), groupName(object->group()));
  900|       |    std::cerr << "UPDATING DATA     " << key;
  901|       |    std::cerr << "\t\t\t ALLOCATED " << object->size() << " BYTES";
  902|       |#endif
  903|  29.2k|  } else {
  904|  29.2k|    object->setValue(datum->getValue());  // clones the value
  905|       |#ifdef EXIV2_DEBUG_MESSAGES
  906|       |    ExifKey key(object->tag(), groupName(object->group()));
  907|       |    std::cerr << "NOT UPDATING      " << key;
  908|       |    std::cerr << "\t\t\t PRESERVE VALUE DATA";
  909|       |#endif
  910|  29.2k|  }
  911|  39.4k|}
_ZN5Exiv28Internal11TiffEncoder3addEPNS0_13TiffComponentENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEEj:
  913|  13.8k|void TiffEncoder::add(TiffComponent* pRootDir, TiffComponent::UniquePtr pSourceDir, uint32_t root) {
  914|  13.8k|  writeMethod_ = wmIntrusive;
  915|  13.8k|  pSourceTree_ = std::move(pSourceDir);
  916|       |
  917|       |  // Ensure that the exifData_ entries are not deleted, to be able to
  918|       |  // iterate over all remaining entries.
  919|  13.8k|  del_ = false;
  920|       |
  921|  13.8k|  auto posBo = exifData_.end();
  922|  2.79M|  for (auto i = exifData_.begin(); i != exifData_.end(); ++i) {
  ------------------
  |  Branch (922:36): [True: 2.78M, False: 13.8k]
  ------------------
  923|  2.78M|    IfdId group = groupId(i->groupName());
  924|       |    // Skip synthesized info tags
  925|  2.78M|    if (group == IfdId::mnId) {
  ------------------
  |  Branch (925:9): [True: 13.5k, False: 2.77M]
  ------------------
  926|  13.5k|      if (i->tag() == 0x0002) {
  ------------------
  |  Branch (926:11): [True: 6.78k, False: 6.78k]
  ------------------
  927|  6.78k|        posBo = i;
  928|  6.78k|      }
  929|  13.5k|      continue;
  930|  13.5k|    }
  931|       |
  932|       |    // Skip image tags of existing TIFF image - they were copied earlier -
  933|       |    // but add and encode image tags of new images (creation)
  934|  2.77M|    if (isImageTag(i->tag(), group))
  ------------------
  |  Branch (934:9): [True: 21.7k, False: 2.75M]
  ------------------
  935|  21.7k|      continue;
  936|       |
  937|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  938|  2.75M|    auto tiffPath = TiffCreator::getPath(i->tag(), group, root);
  939|  2.75M|    TiffComponent* tc = pRootDir->addPath(i->tag(), tiffPath, pRootDir);
  940|  2.75M|    auto object = dynamic_cast<TiffEntryBase*>(tc);
  941|       |#ifdef EXIV2_DEBUG_MESSAGES
  942|       |    if (!object) {
  943|       |      std::cerr << "Warning: addPath() didn't add an entry for " << i->groupName() << " tag 0x" << std::setw(4)
  944|       |                << std::setfill('0') << std::hex << i->tag() << "\n";
  945|       |    }
  946|       |#endif
  947|  2.75M|    if (object) {
  ------------------
  |  Branch (947:9): [True: 2.73M, False: 18.3k]
  ------------------
  948|  2.73M|      encodeTiffComponent(object, &(*i));
  949|  2.73M|    }
  950|  2.75M|  }
  951|       |
  952|       |  /*
  953|       |    What follows is a hack. I can't think of a better way to set
  954|       |    the makernote byte order (and other properties maybe) in the
  955|       |    makernote header during intrusive writing. The thing is that
  956|       |    visit/encodeIfdMakernote is not called in this case and there
  957|       |    can't be an Exif tag which corresponds to this component.
  958|       |   */
  959|  13.8k|  if (posBo == exifData_.end())
  ------------------
  |  Branch (959:7): [True: 7.09k, False: 6.78k]
  ------------------
  960|  7.09k|    return;
  961|       |
  962|  6.78k|  TiffFinder finder(0x927c, IfdId::exifId);
  963|  6.78k|  pRootDir->accept(finder);
  964|  6.78k|  if (auto te = dynamic_cast<const TiffMnEntry*>(finder.result())) {
  ------------------
  |  Branch (964:12): [True: 6.55k, False: 232]
  ------------------
  965|  6.55k|    if (const auto& mn = te->mn_) {
  ------------------
  |  Branch (965:21): [True: 6.53k, False: 18]
  ------------------
  966|       |      // Set Makernote byte order
  967|  6.53k|      ByteOrder bo = stringToByteOrder(posBo->toString());
  968|  6.53k|      if (bo != invalidByteOrder)
  ------------------
  |  Branch (968:11): [True: 6.53k, False: 0]
  ------------------
  969|  6.53k|        mn->setByteOrder(bo);
  970|  6.53k|    }
  971|  6.55k|  }
  972|       |
  973|  6.78k|}  // TiffEncoder::add
_ZN5Exiv28Internal10TiffReaderC2EPKhmPNS0_13TiffComponentENS0_11TiffRwStateE:
  976|  19.1k|    pData_(pData), size_(size), pLast_(pData + size), pRoot_(pRoot), origState_(state), mnState_(state) {
  977|  19.1k|  pState_ = &origState_;
  978|       |
  979|  19.1k|}  // TiffReader::TiffReader
_ZN5Exiv28Internal10TiffReader12setOrigStateEv:
  981|  24.5k|void TiffReader::setOrigState() {
  982|  24.5k|  pState_ = &origState_;
  983|  24.5k|}
_ZN5Exiv28Internal10TiffReader10setMnStateEPKNS0_11TiffRwStateE:
  985|  24.5k|void TiffReader::setMnState(const TiffRwState* state) {
  986|  24.5k|  if (state) {
  ------------------
  |  Branch (986:7): [True: 5.33k, False: 19.1k]
  ------------------
  987|       |    // invalidByteOrder indicates 'no change'
  988|  5.33k|    if (state->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (988:9): [True: 0, False: 5.33k]
  ------------------
  989|      0|      mnState_ = TiffRwState{origState_.byteOrder(), state->baseOffset()};
  990|  5.33k|    } else {
  991|  5.33k|      mnState_ = *state;
  992|  5.33k|    }
  993|  5.33k|  }
  994|  24.5k|  pState_ = &mnState_;
  995|  24.5k|}
_ZNK5Exiv28Internal10TiffReader9byteOrderEv:
  997|  8.88M|ByteOrder TiffReader::byteOrder() const {
  998|  8.88M|  return pState_->byteOrder();
  999|  8.88M|}
_ZNK5Exiv28Internal10TiffReader10baseOffsetEv:
 1001|  1.39M|size_t TiffReader::baseOffset() const {
 1002|  1.39M|  return pState_->baseOffset();
 1003|  1.39M|}
_ZN5Exiv28Internal10TiffReader17readDataEntryBaseEPNS0_17TiffDataEntryBaseE:
 1005|  55.6k|void TiffReader::readDataEntryBase(TiffDataEntryBase* object) {
 1006|  55.6k|  readTiffEntry(object);
 1007|  55.6k|  TiffFinder finder(object->szTag(), object->szGroup());
 1008|  55.6k|  pRoot_->accept(finder);
 1009|  55.6k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1010|  55.6k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1010:7): [True: 39.2k, False: 16.3k]
  |  Branch (1010:13): [True: 25.0k, False: 14.2k]
  ------------------
 1011|  25.0k|    object->setStrips(te->pValue(), pData_, size_, baseOffset());
 1012|  25.0k|  }
 1013|  55.6k|}
_ZN5Exiv28Internal10TiffReader10visitEntryEPNS0_9TiffEntryE:
 1015|  1.97M|void TiffReader::visitEntry(TiffEntry* object) {
 1016|  1.97M|  readTiffEntry(object);
 1017|  1.97M|}
_ZN5Exiv28Internal10TiffReader14visitDataEntryEPNS0_13TiffDataEntryE:
 1019|  12.5k|void TiffReader::visitDataEntry(TiffDataEntry* object) {
 1020|  12.5k|  readDataEntryBase(object);
 1021|  12.5k|}
_ZN5Exiv28Internal10TiffReader15visitImageEntryEPNS0_14TiffImageEntryE:
 1023|  43.1k|void TiffReader::visitImageEntry(TiffImageEntry* object) {
 1024|  43.1k|  readDataEntryBase(object);
 1025|  43.1k|}
_ZN5Exiv28Internal10TiffReader14visitSizeEntryEPNS0_13TiffSizeEntryE:
 1027|  58.2k|void TiffReader::visitSizeEntry(TiffSizeEntry* object) {
 1028|  58.2k|  readTiffEntry(object);
 1029|  58.2k|  TiffFinder finder(object->dtTag(), object->dtGroup());
 1030|  58.2k|  pRoot_->accept(finder);
 1031|  58.2k|  auto te = dynamic_cast<TiffDataEntryBase*>(finder.result());
 1032|  58.2k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1032:7): [True: 35.3k, False: 22.9k]
  |  Branch (1032:13): [True: 27.0k, False: 8.30k]
  ------------------
 1033|  27.0k|    te->setStrips(object->pValue(), pData_, size_, baseOffset());
 1034|  27.0k|  }
 1035|  58.2k|}
_ZN5Exiv28Internal10TiffReader17circularReferenceEPKhNS_5IfdIdE:
 1037|  80.0k|bool TiffReader::circularReference(const byte* start, IfdId group) {
 1038|  80.0k|  if (auto pos = dirList_.find(start); pos != dirList_.end()) {
  ------------------
  |  Branch (1038:40): [True: 10.8k, False: 69.1k]
  ------------------
 1039|  10.8k|#ifndef SUPPRESS_WARNINGS
 1040|  10.8k|    EXV_ERROR << groupName(group) << " pointer references previously read " << groupName(pos->second)
  ------------------
  |  |  142|  10.8k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 10.8k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  10.8k|  LogMsg(LogMsg::error).os()
  ------------------
 1041|      0|              << " directory; ignored.\n";
 1042|  10.8k|#endif
 1043|  10.8k|    return true;
 1044|  10.8k|  }
 1045|  69.1k|  dirList_[start] = group;
 1046|  69.1k|  return false;
 1047|  80.0k|}
_ZN5Exiv28Internal10TiffReader7nextIdxENS_5IfdIdE:
 1049|  2.18M|int TiffReader::nextIdx(IfdId group) {
 1050|  2.18M|  return ++idxSeq_[group];
 1051|  2.18M|}
_ZN5Exiv28Internal10TiffReader11postProcessEv:
 1053|  19.1k|void TiffReader::postProcess() {
 1054|  19.1k|  setMnState();  // All components to be post-processed must be from the Makernote
 1055|  19.1k|  postProc_ = true;
 1056|  19.1k|  for (auto pos : postList_) {
  ------------------
  |  Branch (1056:17): [True: 13.4k, False: 19.1k]
  ------------------
 1057|  13.4k|    pos->accept(*this);
 1058|  13.4k|  }
 1059|  19.1k|  postProc_ = false;
 1060|  19.1k|  setOrigState();
 1061|  19.1k|}
_ZN5Exiv28Internal10TiffReader14visitDirectoryEPNS0_13TiffDirectoryE:
 1063|  80.0k|void TiffReader::visitDirectory(TiffDirectory* object) {
 1064|  80.0k|  const byte* p = object->start();
 1065|       |
 1066|  80.0k|  if (circularReference(object->start(), object->group()))
  ------------------
  |  Branch (1066:7): [True: 10.8k, False: 69.1k]
  ------------------
 1067|  10.8k|    return;
 1068|       |
 1069|  69.1k|  if (p + 2 > pLast_) {
  ------------------
  |  Branch (1069:7): [True: 116, False: 69.0k]
  ------------------
 1070|    116|#ifndef SUPPRESS_WARNINGS
 1071|    116|    EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD exceeds data buffer, cannot read entry count.\n";
  ------------------
  |  |  142|    116|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 116]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    116|  LogMsg(LogMsg::error).os()
  ------------------
 1072|    116|#endif
 1073|    116|    return;
 1074|    116|  }
 1075|  69.0k|  const uint16_t n = getUShort(p, byteOrder());
 1076|  69.0k|  p += 2;
 1077|       |  // Sanity check with an "unreasonably" large number
 1078|  69.0k|  if (n > 256) {
  ------------------
  |  Branch (1078:7): [True: 13.1k, False: 55.9k]
  ------------------
 1079|  13.1k|#ifndef SUPPRESS_WARNINGS
 1080|  13.1k|    EXV_ERROR << "Directory " << groupName(object->group()) << " with " << n
  ------------------
  |  |  142|  13.1k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 13.1k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  13.1k|  LogMsg(LogMsg::error).os()
  ------------------
 1081|      0|              << " entries considered invalid; not read.\n";
 1082|  13.1k|#endif
 1083|  13.1k|    return;
 1084|  13.1k|  }
 1085|  2.27M|  for (uint16_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (1085:24): [True: 2.25M, False: 20.5k]
  ------------------
 1086|  2.25M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1086:9): [True: 35.4k, False: 2.22M]
  ------------------
 1087|  35.4k|#ifndef SUPPRESS_WARNINGS
 1088|  35.4k|      EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD entry " << i
  ------------------
  |  |  142|  35.4k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 35.4k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  35.4k|  LogMsg(LogMsg::error).os()
  ------------------
 1089|      0|                << " lies outside of the data buffer.\n";
 1090|  35.4k|#endif
 1091|  35.4k|      return;
 1092|  35.4k|    }
 1093|  2.22M|    uint16_t tag = getUShort(p, byteOrder());
 1094|  2.22M|    if (auto tc = TiffCreator::create(tag, object->group())) {
  ------------------
  |  Branch (1094:14): [True: 2.16M, False: 56.2k]
  ------------------
 1095|  2.16M|      tc->setStart(p);
 1096|  2.16M|      object->addChild(std::move(tc));
 1097|  2.16M|    } else {
 1098|  56.2k|#ifndef SUPPRESS_WARNINGS
 1099|  56.2k|      EXV_WARNING << "Unable to handle tag " << tag << ".\n";
  ------------------
  |  |  138|  56.2k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 56.2k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  56.2k|  LogMsg(LogMsg::warn).os()
  ------------------
 1100|  56.2k|#endif
 1101|  56.2k|    }
 1102|  2.22M|    p += 12;
 1103|  2.22M|  }
 1104|       |
 1105|  20.5k|  if (object->hasNext()) {
  ------------------
  |  Branch (1105:7): [True: 20.4k, False: 29]
  ------------------
 1106|  20.4k|    if (p + 4 > pLast_) {
  ------------------
  |  Branch (1106:9): [True: 174, False: 20.3k]
  ------------------
 1107|    174|#ifndef SUPPRESS_WARNINGS
 1108|    174|      EXV_ERROR << "Directory " << groupName(object->group())
  ------------------
  |  |  142|    174|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 174]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    174|  LogMsg(LogMsg::error).os()
  ------------------
 1109|      0|                << ": IFD exceeds data buffer, cannot read next pointer.\n";
 1110|    174|#endif
 1111|    174|      return;
 1112|    174|    }
 1113|  20.3k|    TiffComponent::UniquePtr tc;
 1114|  20.3k|    uint32_t next = getULong(p, byteOrder());
 1115|  20.3k|    if (next) {
  ------------------
  |  Branch (1115:9): [True: 17.7k, False: 2.56k]
  ------------------
 1116|  17.7k|      tc = TiffCreator::create(Tag::next, object->group());
 1117|  17.7k|#ifndef SUPPRESS_WARNINGS
 1118|  17.7k|      if (!tc) {
  ------------------
  |  Branch (1118:11): [True: 12.7k, False: 4.99k]
  ------------------
 1119|  12.7k|        EXV_WARNING << "Directory " << groupName(object->group()) << " has an unexpected next pointer; ignored.\n";
  ------------------
  |  |  138|  12.7k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 12.7k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  12.7k|  LogMsg(LogMsg::warn).os()
  ------------------
 1120|  12.7k|      }
 1121|  17.7k|#endif
 1122|  17.7k|    }
 1123|  20.3k|    if (tc) {
  ------------------
  |  Branch (1123:9): [True: 4.99k, False: 15.3k]
  ------------------
 1124|  4.99k|      if (baseOffset() + next > size_) {
  ------------------
  |  Branch (1124:11): [True: 2.89k, False: 2.09k]
  ------------------
 1125|  2.89k|#ifndef SUPPRESS_WARNINGS
 1126|  2.89k|        EXV_ERROR << "Directory " << groupName(object->group()) << ": Next pointer is out of bounds; ignored.\n";
  ------------------
  |  |  142|  2.89k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.89k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.89k|  LogMsg(LogMsg::error).os()
  ------------------
 1127|  2.89k|#endif
 1128|  2.89k|        return;
 1129|  2.89k|      }
 1130|  2.09k|      tc->setStart(pData_ + baseOffset() + next);
 1131|  2.09k|      object->addNext(std::move(tc));
 1132|  2.09k|    }
 1133|  20.3k|  }  // object->hasNext()
 1134|       |
 1135|  20.5k|}  // TiffReader::visitDirectory
_ZN5Exiv28Internal10TiffReader11visitSubIfdEPNS0_10TiffSubIfdE:
 1137|  18.0k|void TiffReader::visitSubIfd(TiffSubIfd* object) {
 1138|  18.0k|  readTiffEntry(object);
 1139|  18.0k|  if ((object->tiffType() == ttUnsignedLong || object->tiffType() == ttSignedLong || object->tiffType() == ttTiffIfd) &&
  ------------------
  |  Branch (1139:8): [True: 10.7k, False: 7.33k]
  |  Branch (1139:48): [True: 3.29k, False: 4.03k]
  |  Branch (1139:86): [True: 2.50k, False: 1.53k]
  ------------------
 1140|  16.5k|      object->count() >= 1) {
  ------------------
  |  Branch (1140:7): [True: 10.5k, False: 5.98k]
  ------------------
 1141|       |    // Todo: Fix hack
 1142|  10.5k|    uint32_t maxi = 9;
 1143|  10.5k|    if (object->group() == IfdId::ifd1Id)
  ------------------
  |  Branch (1143:9): [True: 160, False: 10.3k]
  ------------------
 1144|    160|      maxi = 1;
 1145|  64.0k|    for (uint32_t i = 0; i < object->count(); ++i) {
  ------------------
  |  Branch (1145:26): [True: 62.3k, False: 1.71k]
  ------------------
 1146|  62.3k|      uint32_t offset = getULong(object->pData() + (4 * i), byteOrder());
 1147|  62.3k|      if (baseOffset() + offset > size_) {
  ------------------
  |  Branch (1147:11): [True: 8.53k, False: 53.7k]
  ------------------
 1148|  8.53k|#ifndef SUPPRESS_WARNINGS
 1149|  8.53k|        EXV_ERROR << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  142|  8.53k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 8.53k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  8.53k|  LogMsg(LogMsg::error).os()
  ------------------
 1150|      0|                  << std::hex << object->tag() << " Sub-IFD pointer " << i << " is out of bounds; ignoring it.\n";
 1151|  8.53k|#endif
 1152|  8.53k|        return;
 1153|  8.53k|      }
 1154|  53.7k|      if (i >= maxi) {
  ------------------
  |  Branch (1154:11): [True: 266, False: 53.5k]
  ------------------
 1155|    266|#ifndef SUPPRESS_WARNINGS
 1156|    266|        EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|    266|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 266]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    266|  LogMsg(LogMsg::warn).os()
  ------------------
 1157|      0|                    << std::hex << object->tag() << ": Skipping sub-IFDs beyond the first " << i << ".\n";
 1158|    266|#endif
 1159|    266|        break;
 1160|    266|      }
 1161|       |      // If there are multiple dirs, group is incremented for each
 1162|  53.5k|      auto td = std::make_unique<TiffDirectory>(object->tag(),
 1163|  53.5k|                                                static_cast<IfdId>(static_cast<uint32_t>(object->newGroup_) + i));
 1164|  53.5k|      td->setStart(pData_ + baseOffset() + offset);
 1165|  53.5k|      object->addChild(std::move(td));
 1166|  53.5k|    }
 1167|  10.5k|  }
 1168|  7.51k|#ifndef SUPPRESS_WARNINGS
 1169|  7.51k|  else {
 1170|  7.51k|    EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|  7.51k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.51k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.51k|  LogMsg(LogMsg::warn).os()
  ------------------
 1171|      0|                << std::hex << object->tag() << " doesn't look like a sub-IFD.\n";
 1172|  7.51k|  }
 1173|  18.0k|#endif
 1174|       |
 1175|  18.0k|}  // TiffReader::visitSubIfd
_ZN5Exiv28Internal10TiffReader12visitMnEntryEPNS0_11TiffMnEntryE:
 1177|  16.4k|void TiffReader::visitMnEntry(TiffMnEntry* object) {
 1178|  16.4k|  readTiffEntry(object);
 1179|       |  // Find camera make
 1180|  16.4k|  TiffFinder finder(0x010f, IfdId::ifd0Id);
 1181|  16.4k|  pRoot_->accept(finder);
 1182|  16.4k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1183|  16.4k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1183:7): [True: 15.9k, False: 486]
  |  Branch (1183:13): [True: 15.1k, False: 792]
  ------------------
 1184|  15.1k|    auto make = te->pValue()->toString();
 1185|       |    // create concrete makernote, based on make and makernote contents
 1186|  15.1k|    object->mn_ =
 1187|  15.1k|        TiffMnCreator::create(object->tag(), object->mnGroup_, make, object->pData_, object->size_, byteOrder());
 1188|  15.1k|  }
 1189|  16.4k|  if (object->mn_)
  ------------------
  |  Branch (1189:7): [True: 6.03k, False: 10.3k]
  ------------------
 1190|  6.03k|    object->mn_->setStart(object->pData());
 1191|       |
 1192|  16.4k|}  // TiffReader::visitMnEntry
_ZN5Exiv28Internal10TiffReader17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
 1194|  6.03k|void TiffReader::visitIfdMakernote(TiffIfdMakernote* object) {
 1195|  6.03k|  object->setImageByteOrder(byteOrder());  // set the byte order for the image
 1196|       |
 1197|  6.03k|  if (!object->readHeader(object->start(), pLast_ - object->start(), byteOrder())) {
  ------------------
  |  Branch (1197:7): [True: 700, False: 5.33k]
  ------------------
 1198|    700|#ifndef SUPPRESS_WARNINGS
 1199|    700|    EXV_ERROR << "Failed to read " << groupName(object->ifd_.group()) << " IFD Makernote header.\n";
  ------------------
  |  |  142|    700|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 700]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    700|  LogMsg(LogMsg::error).os()
  ------------------
 1200|       |#ifdef EXIV2_DEBUG_MESSAGES
 1201|       |    if (pLast_ - object->start() >= 16u) {
 1202|       |      hexdump(std::cerr, object->start(), 16u);
 1203|       |    }
 1204|       |#endif  // EXIV2_DEBUG_MESSAGES
 1205|    700|#endif  // SUPPRESS_WARNINGS
 1206|    700|    setGo(geKnownMakernote, false);
 1207|    700|    return;
 1208|    700|  }
 1209|       |
 1210|  5.33k|  object->ifd_.setStart(object->start() + object->ifdOffset());
 1211|       |
 1212|       |  // Modify reader for Makernote peculiarities, byte order and offset
 1213|  5.33k|  object->mnOffset_ = object->start() - pData_;
 1214|  5.33k|  auto state = TiffRwState{object->byteOrder(), object->baseOffset()};
 1215|  5.33k|  setMnState(&state);
 1216|       |
 1217|  5.33k|}  // TiffReader::visitIfdMakernote
_ZN5Exiv28Internal10TiffReader20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
 1219|  5.32k|void TiffReader::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
 1220|       |  // Reset state (byte order, create function, offset) back to that for the image
 1221|  5.32k|  setOrigState();
 1222|  5.32k|}  // TiffReader::visitIfdMakernoteEnd
_ZN5Exiv28Internal10TiffReader13readTiffEntryEPNS0_13TiffEntryBaseE:
 1224|  2.13M|void TiffReader::readTiffEntry(TiffEntryBase* object) {
 1225|  2.13M|  try {
 1226|  2.13M|    byte* p = object->start();
 1227|       |
 1228|  2.13M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1228:9): [True: 3, False: 2.13M]
  ------------------
 1229|      3|#ifndef SUPPRESS_WARNINGS
 1230|      3|      EXV_ERROR << "Entry in directory " << groupName(object->group())
  ------------------
  |  |  142|      3|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      3|  LogMsg(LogMsg::error).os()
  ------------------
 1231|      0|                << "requests access to memory beyond the data buffer. " << "Skipping entry.\n";
 1232|      3|#endif
 1233|      3|      return;
 1234|      3|    }
 1235|       |    // Component already has tag
 1236|  2.13M|    p += 2;
 1237|  2.13M|    auto tiffType = static_cast<TiffType>(getUShort(p, byteOrder()));
 1238|  2.13M|    TypeId typeId = toTypeId(tiffType, object->tag(), object->group());
 1239|  2.13M|    size_t typeSize = TypeInfo::typeSize(typeId);
 1240|  2.13M|    if (0 == typeSize) {
  ------------------
  |  Branch (1240:9): [True: 1.90M, False: 232k]
  ------------------
 1241|  1.90M|#ifndef SUPPRESS_WARNINGS
 1242|  1.90M|      EXV_WARNING << stringFormat(
  ------------------
  |  |  138|  1.90M|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.90M]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.90M|  LogMsg(LogMsg::warn).os()
  ------------------
                    EXV_WARNING << stringFormat(
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1243|      0|          "Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
 1244|      0|          groupName(object->group()), object->tag(), static_cast<uint16_t>(tiffType));
 1245|  1.90M|#endif
 1246|  1.90M|      typeSize = 1;
 1247|  1.90M|    }
 1248|  2.13M|    p += 2;
 1249|  2.13M|    uint32_t count = getULong(p, byteOrder());
 1250|  2.13M|    if (count >= 0x10000000) {
  ------------------
  |  Branch (1250:9): [True: 1.05M, False: 1.07M]
  ------------------
 1251|  1.05M|#ifndef SUPPRESS_WARNINGS
 1252|  1.05M|      EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |  142|  1.05M|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.05M]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.05M|  LogMsg(LogMsg::error).os()
  ------------------
                    EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1253|      0|                                groupName(object->group()), object->tag(), count, typeSize);
 1254|  1.05M|#endif
 1255|  1.05M|      return;
 1256|  1.05M|    }
 1257|  1.07M|    p += 4;
 1258|       |
 1259|  1.07M|    if (count > std::numeric_limits<size_t>::max() / typeSize) {
  ------------------
  |  Branch (1259:9): [True: 0, False: 1.07M]
  ------------------
 1260|      0|      throw Error(ErrorCode::kerArithmeticOverflow);
 1261|      0|    }
 1262|  1.07M|    size_t size = typeSize * count;
 1263|  1.07M|    size_t offset = getULong(p, byteOrder());
 1264|  1.07M|    byte* pData = p;
 1265|  1.07M|    if (size > 4 && Safe::add<size_t>(baseOffset(), offset) >= size_) {
  ------------------
  |  Branch (1265:9): [True: 819k, False: 259k]
  |  Branch (1265:21): [True: 620k, False: 198k]
  ------------------
 1266|       |      // #1143
 1267|   620k|      if (object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1") {
  ------------------
  |  Branch (1267:11): [True: 909, False: 620k]
  |  Branch (1267:11): [True: 70, False: 620k]
  |  Branch (1267:38): [True: 70, False: 839]
  ------------------
 1268|       |        // This tag is Exif.Sony1.PreviewImage, which refers to a preview image which is
 1269|       |        // not stored in the metadata. Instead it is stored at the end of the file, after
 1270|       |        // the main image. The value of `size` refers to the size of the preview image, not
 1271|       |        // the size of the tag's payload, so we set it to zero here so that we don't attempt
 1272|       |        // to read those bytes from the metadata. We currently leave this tag as "undefined",
 1273|       |        // although we may attempt to handle it better in the future. More discussion of
 1274|       |        // this issue can be found here:
 1275|       |        //
 1276|       |        //   https://github.com/Exiv2/exiv2/issues/2001
 1277|       |        //   https://github.com/Exiv2/exiv2/pull/2008
 1278|       |        //   https://github.com/Exiv2/exiv2/pull/2013
 1279|     70|        typeId = undefined;
 1280|     70|        size = 0;
 1281|   620k|      } else {
 1282|   620k|#ifndef SUPPRESS_WARNINGS
 1283|   620k|        EXV_ERROR << "Offset of directory " << groupName(object->group()) << ", entry 0x" << std::setw(4)
  ------------------
  |  |  142|   620k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 620k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   620k|  LogMsg(LogMsg::error).os()
  ------------------
 1284|      0|                  << std::setfill('0') << std::hex << object->tag() << " is out of bounds: " << "Offset = 0x"
 1285|      0|                  << std::setw(8) << std::setfill('0') << std::hex << offset << "; truncating the entry\n";
 1286|   620k|#endif
 1287|   620k|      }
 1288|   620k|      size = 0;
 1289|   620k|    }
 1290|  1.07M|    if (size > 4) {
  ------------------
  |  Branch (1290:9): [True: 198k, False: 880k]
  ------------------
 1291|       |      // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
 1292|       |      // as offset can be arbitrarily large
 1293|   198k|      if (Safe::add<size_t>(baseOffset(), offset) > static_cast<size_t>(pLast_ - pData_)) {
  ------------------
  |  Branch (1293:11): [True: 0, False: 198k]
  ------------------
 1294|      0|        throw Error(ErrorCode::kerCorruptedMetadata);
 1295|      0|      }
 1296|   198k|      pData = const_cast<byte*>(pData_) + baseOffset() + offset;
 1297|       |
 1298|       |      // check for size being invalid
 1299|   198k|      if (size > static_cast<size_t>(pLast_ - pData)) {
  ------------------
  |  Branch (1299:11): [True: 92.6k, False: 105k]
  ------------------
 1300|  92.6k|#ifndef SUPPRESS_WARNINGS
 1301|  92.6k|        EXV_ERROR << "Upper boundary of data for " << "directory " << groupName(object->group()) << ", entry 0x"
  ------------------
  |  |  142|  92.6k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 92.6k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  92.6k|  LogMsg(LogMsg::error).os()
  ------------------
 1302|      0|                  << std::setw(4) << std::setfill('0') << std::hex << object->tag()
 1303|      0|                  << " is out of bounds: " << "Offset = 0x" << std::setw(8) << std::setfill('0') << std::hex << offset
 1304|      0|                  << ", size = " << std::dec << size
 1305|      0|                  << ", exceeds buffer size by "
 1306|       |                  // cast to make MSVC happy
 1307|      0|                  << size - static_cast<size_t>(pLast_ - pData) << " Bytes; truncating the entry\n";
 1308|  92.6k|#endif
 1309|  92.6k|        size = 0;
 1310|  92.6k|      }
 1311|   198k|    }
 1312|  1.07M|    auto v = Value::create(typeId);
 1313|  1.07M|    enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1314|  1.07M|    v->read(pData, size, byteOrder());
 1315|       |
 1316|  1.07M|    object->setValue(std::move(v));
 1317|  1.07M|    auto d = std::make_shared<DataBuf>();
 1318|  1.07M|    object->setData(pData, size, std::move(d));
 1319|  1.07M|    object->setOffset(offset);
 1320|  1.07M|    object->setIdx(nextIdx(object->group()));
 1321|  1.07M|  } catch (std::overflow_error&) {
 1322|      0|    throw Error(ErrorCode::kerCorruptedMetadata);  // #562 don't throw std::overflow_error
 1323|      0|  }
 1324|  2.13M|}  // TiffReader::readTiffEntry
_ZN5Exiv28Internal10TiffReader16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
 1326|  26.9k|void TiffReader::visitBinaryArray(TiffBinaryArray* object) {
 1327|  26.9k|  if (!postProc_) {
  ------------------
  |  Branch (1327:7): [True: 13.4k, False: 13.4k]
  ------------------
 1328|       |    // Defer reading children until after all other components are read, but
 1329|       |    // since state (offset) is not set during post-processing, read entry here
 1330|  13.4k|    readTiffEntry(object);
 1331|  13.4k|    object->iniOrigDataBuf();
 1332|  13.4k|    postList_.push_back(object);
 1333|  13.4k|    return;
 1334|  13.4k|  }
 1335|       |  // Check duplicates
 1336|  13.4k|  TiffFinder finder(object->tag(), object->group());
 1337|  13.4k|  pRoot_->accept(finder);
 1338|  13.4k|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (1338:12): [True: 12.1k, False: 1.29k]
  ------------------
 1339|  12.1k|    if (te->idx() != object->idx()) {
  ------------------
  |  Branch (1339:9): [True: 6.16k, False: 5.99k]
  ------------------
 1340|  6.16k|#ifndef SUPPRESS_WARNINGS
 1341|  6.16k|      EXV_WARNING << "Not decoding duplicate binary array tag 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  6.16k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.16k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.16k|  LogMsg(LogMsg::warn).os()
  ------------------
 1342|      0|                  << object->tag() << std::dec << ", group " << groupName(object->group()) << ", idx " << object->idx()
 1343|      0|                  << "\n";
 1344|  6.16k|#endif
 1345|  6.16k|      object->setDecoded(false);
 1346|  6.16k|      return;
 1347|  6.16k|    }
 1348|  12.1k|  }
 1349|       |
 1350|  7.29k|  if (object->TiffEntryBase::doSize() == 0)
  ------------------
  |  Branch (1350:7): [True: 3.48k, False: 3.80k]
  ------------------
 1351|  3.48k|    return;
 1352|  3.80k|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (1352:7): [True: 657, False: 3.14k]
  ------------------
 1353|    657|    return;
 1354|  3.14k|  const ArrayCfg* cfg = object->cfg();
 1355|  3.14k|  if (!cfg)
  ------------------
  |  Branch (1355:7): [True: 0, False: 3.14k]
  ------------------
 1356|      0|    return;
 1357|       |
 1358|  3.14k|  if (auto cryptFct = cfg->cryptFct_) {
  ------------------
  |  Branch (1358:12): [True: 853, False: 2.29k]
  ------------------
 1359|    853|    const byte* pData = object->pData();
 1360|    853|    size_t size = object->TiffEntryBase::doSize();
 1361|    853|    auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
 1362|    853|    if (!buf->empty())
  ------------------
  |  Branch (1362:9): [True: 565, False: 288]
  ------------------
 1363|    565|      object->setData(std::move(buf));
 1364|    853|  }
 1365|       |
 1366|  3.14k|  const ArrayDef* defs = object->def();
 1367|  3.14k|  const ArrayDef* defsEnd = defs + object->defSize();
 1368|  3.14k|  const ArrayDef* def = &cfg->elDefaultDef_;
 1369|  3.14k|  ArrayDef gap = *def;
 1370|       |
 1371|  1.07M|  for (size_t idx = 0; idx < object->TiffEntryBase::doSize();) {
  ------------------
  |  Branch (1371:24): [True: 1.07M, False: 3.14k]
  ------------------
 1372|  1.07M|    if (defs) {
  ------------------
  |  Branch (1372:9): [True: 1.06M, False: 11.8k]
  ------------------
 1373|  1.06M|      def = std::find(defs, defsEnd, idx);
 1374|  1.06M|      if (def == defsEnd) {
  ------------------
  |  Branch (1374:11): [True: 1.05M, False: 9.61k]
  ------------------
 1375|  1.05M|        if (cfg->concat_) {
  ------------------
  |  Branch (1375:13): [True: 890, False: 1.05M]
  ------------------
 1376|       |          // Determine gap-size
 1377|    890|          const ArrayDef* xdef = defs;
 1378|  3.96k|          for (; xdef != defsEnd && xdef->idx_ <= idx; ++xdef) {
  ------------------
  |  Branch (1378:18): [True: 3.74k, False: 227]
  |  Branch (1378:37): [True: 3.07k, False: 663]
  ------------------
 1379|  3.07k|          }
 1380|    890|          size_t gapSize = 0;
 1381|    890|          if (xdef != defsEnd && xdef->idx_ > idx) {
  ------------------
  |  Branch (1381:15): [True: 663, False: 227]
  |  Branch (1381:34): [True: 663, False: 0]
  ------------------
 1382|    663|            gapSize = xdef->idx_ - idx;
 1383|    663|          } else {
 1384|    227|            gapSize = object->TiffEntryBase::doSize() - idx;
 1385|    227|          }
 1386|    890|          gap.idx_ = idx;
 1387|    890|          gap.tiffType_ = cfg->elDefaultDef_.tiffType_;
 1388|    890|          gap.count_ = gapSize / cfg->tagStep();
 1389|    890|          if (gap.count_ * cfg->tagStep() != gapSize) {
  ------------------
  |  Branch (1389:15): [True: 8, False: 882]
  ------------------
 1390|      8|            gap.tiffType_ = ttUndefined;
 1391|      8|            gap.count_ = gapSize;
 1392|      8|          }
 1393|    890|          def = &gap;
 1394|  1.05M|        } else {
 1395|  1.05M|          def = &cfg->elDefaultDef_;
 1396|  1.05M|        }
 1397|  1.05M|      }
 1398|  1.06M|    }
 1399|  1.07M|    idx += object->addElement(idx, *def);  // idx may be different from def->idx_
 1400|  1.07M|  }
 1401|       |
 1402|  3.14k|}  // TiffReader::visitBinaryArray
_ZN5Exiv28Internal10TiffReader18visitBinaryElementEPNS0_17TiffBinaryElementE:
 1404|  1.10M|void TiffReader::visitBinaryElement(TiffBinaryElement* object) {
 1405|  1.10M|  auto pData = object->start();
 1406|  1.10M|  size_t size = object->TiffEntryBase::doSize();
 1407|  1.10M|  ByteOrder bo = object->elByteOrder();
 1408|  1.10M|  if (bo == invalidByteOrder)
  ------------------
  |  Branch (1408:7): [True: 56.6k, False: 1.05M]
  ------------------
 1409|  56.6k|    bo = byteOrder();
 1410|  1.10M|  TypeId typeId = toTypeId(object->elDef()->tiffType_, object->tag(), object->group());
 1411|  1.10M|  auto v = Value::create(typeId);
 1412|  1.10M|  enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1413|  1.10M|  v->read(pData, size, bo);
 1414|       |
 1415|  1.10M|  object->setValue(std::move(v));
 1416|  1.10M|  object->setOffset(0);
 1417|  1.10M|  object->setIdx(nextIdx(object->group()));
 1418|  1.10M|}
tiffvisitor_int.cpp:_ZN5Exiv28InternalL7findTagEPKNS_7TagInfoEt:
  341|  5.31k|static const TagInfo* findTag(const TagInfo* pList, uint16_t tag) {
  342|   371k|  while (pList->tag_ != 0xffff && pList->tag_ != tag)
  ------------------
  |  Branch (342:10): [True: 371k, False: 0]
  |  Branch (342:35): [True: 366k, False: 5.31k]
  ------------------
  343|   366k|    pList++;
  344|  5.31k|  return pList->tag_ != 0xffff ? pList : nullptr;
  ------------------
  |  Branch (344:10): [True: 5.31k, False: 0]
  ------------------
  345|  5.31k|}
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_117stringToByteOrderENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   48|  6.78k|Exiv2::ByteOrder stringToByteOrder(std::string_view val) {
   49|  6.78k|  if (val == "II")
  ------------------
  |  Branch (49:7): [True: 151, False: 6.63k]
  ------------------
   50|    151|    return Exiv2::littleEndian;
   51|  6.63k|  if (val == "MM")
  ------------------
  |  Branch (51:7): [True: 6.63k, False: 0]
  ------------------
   52|  6.63k|    return Exiv2::bigEndian;
   53|       |
   54|      0|  return Exiv2::invalidByteOrder;
   55|  6.63k|}
tiffvisitor_int.cpp:_ZNK12_GLOBAL__N_114FindExifdatum2clERKN5Exiv29ExifdatumE:
   38|   361k|  bool operator()(const Exiv2::Exifdatum& md) const {
   39|   361k|    return idx_ == md.idx() && md.groupName() == groupName_;
  ------------------
  |  Branch (39:12): [True: 3.35k, False: 358k]
  |  Branch (39:32): [True: 138, False: 3.21k]
  ------------------
   40|   361k|  }
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_114FindExifdatum2C2EN5Exiv25IfdIdEi:
   35|  4.84k|  FindExifdatum2(Exiv2::IfdId group, int idx) : groupName_(Exiv2::Internal::groupName(group)), idx_(idx) {
   36|  4.84k|  }

_ZN5Exiv28Internal11TiffVisitorD2Ev:
   65|  56.9k|  virtual ~TiffVisitor() = default;
_ZN5Exiv28Internal11TiffEncoderD2Ev:
  355|  19.3k|  ~TiffEncoder() override = default;
_ZN5Exiv28Internal11TiffRwStateC2ENS_9ByteOrderEm:
  538|  24.5k|  constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
  539|  24.5k|  }
_ZN5Exiv28Internal10TiffFinderC2EtNS_5IfdIdE:
  142|   253k|  constexpr TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  143|   253k|  }
_ZN5Exiv28Internal11TiffVisitorC2Ev:
   63|   310k|  TiffVisitor() = default;
_ZNK5Exiv28Internal10TiffFinder6resultEv:
  181|   253k|  [[nodiscard]] TiffComponent* result() const {
  182|   253k|    return tiffComponent_;
  183|   253k|  }
_ZNK5Exiv28Internal11TiffEncoder9byteOrderEv:
  458|  2.76M|  [[nodiscard]] ByteOrder byteOrder() const {
  459|  2.76M|    return byteOrder_;
  460|  2.76M|  }
_ZNK5Exiv28Internal11TiffEncoder11writeMethodEv:
  467|  17.1k|  [[nodiscard]] WriteMethod writeMethod() const {
  468|  17.1k|    return writeMethod_;
  469|  17.1k|  }
_ZNK5Exiv28Internal11TiffRwState9byteOrderEv:
  548|  8.88M|  [[nodiscard]] ByteOrder byteOrder() const {
  549|  8.88M|    return byteOrder_;
  550|  8.88M|  }
_ZNK5Exiv28Internal11TiffRwState10baseOffsetEv:
  562|  1.39M|  [[nodiscard]] size_t baseOffset() const {
  563|  1.39M|    return baseOffset_;
  564|  1.39M|  }

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  6.64M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  6.64M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 4.74M, False: 1.90M]
  ------------------
   88|  4.74M|    return tit->size_;
   89|  1.90M|  return 0;
   90|  6.64M|}
_ZN5Exiv27DataBufC2Em:
   92|  4.65M|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|  4.65M|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  53.9k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  53.9k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  26.0k|void DataBuf::alloc(size_t size) {
   99|  26.0k|  pData_.resize(size);
  100|  26.0k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   288k|void DataBuf::resize(size_t size) {
  103|   288k|  pData_.resize(size);
  104|   288k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  29.2k|void DataBuf::reset() {
  107|  29.2k|  pData_.clear();
  108|  29.2k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|  1.67M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|  1.67M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 1.67M]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|  1.67M|  return pData_[offset];
  115|  1.67M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|   107k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|   107k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 107k]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|   107k|  pData_[offset] = x;
  122|   107k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   571k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   571k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 571k]
  |  Branch (125:28): [True: 1, False: 571k]
  ------------------
  126|      1|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      1|  }
  128|   571k|  return getUShort(&pData_[offset], byteOrder);
  129|   571k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  14.2k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  14.2k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 14.2k]
  |  Branch (132:28): [True: 0, False: 14.2k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  14.2k|  us2Data(&pData_[offset], x, byteOrder);
  136|  14.2k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  138|   398k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  139|   398k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 398k]
  |  Branch (139:28): [True: 1, False: 398k]
  ------------------
  140|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      2|  }
  142|   398k|  return getULong(&pData_[offset], byteOrder);
  143|   398k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  14.3k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  14.3k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 14.3k]
  |  Branch (146:28): [True: 0, False: 14.3k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  14.3k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  14.3k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  9.25k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  9.25k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 9.25k]
  |  Branch (153:28): [True: 0, False: 9.25k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  9.25k|  return getULongLong(&pData_[offset], byteOrder);
  157|  9.25k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   305k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   305k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 305k]
  |  Branch (167:34): [True: 0, False: 305k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   305k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   305k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  7.56M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  7.56M|  return const_cast<byte*>(c_data(offset));
  175|  7.56M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  9.55M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  9.55M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 905k, False: 8.65M]
  |  Branch (178:25): [True: 9.57k, False: 8.64M]
  ------------------
  179|   915k|    return nullptr;
  180|   915k|  }
  181|  8.64M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 8.64M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  8.64M|  return &pData_[offset];
  185|  8.64M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  61.6k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  61.6k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  61.6k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|  4.15k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|  4.15k|  return os << r.first << "/" << r.second;
  212|  4.15k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|   134k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|   134k|  return os << r.first << "/" << r.second;
  241|   134k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  11.3M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  11.3M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  11.3M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  10.4M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  10.4M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 559k, False: 9.91M]
  ------------------
  253|   559k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|   559k|  }
  255|  9.91M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  10.4M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  53.6k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  53.6k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 8.92k, False: 44.6k]
  ------------------
  260|  8.92k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  8.92k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  8.92k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  8.92k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  8.92k|  }
  265|  44.6k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  44.6k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  44.6k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  44.6k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  53.6k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|   137k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|   137k|  uint32_t nominator = getULong(buf, byteOrder);
  273|   137k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|   137k|  return {nominator, denominator};
  275|   137k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|  96.3k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|  96.3k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 5.71k, False: 90.6k]
  ------------------
  279|  5.71k|    return buf[1] << 8 | buf[0];
  280|  5.71k|  }
  281|  90.6k|  return buf[0] << 8 | buf[1];
  282|  96.3k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|  1.06M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|  1.06M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 10.0k, False: 1.05M]
  ------------------
  286|  10.0k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|  10.0k|  }
  288|  1.05M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|  1.06M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|   223k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|   223k|  int32_t nominator = getLong(buf, byteOrder);
  293|   223k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|   223k|  return {nominator, denominator};
  295|   223k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  47.0k|float getFloat(const byte* buf, ByteOrder byteOrder) {
  298|       |  // This algorithm assumes that the internal representation of the float
  299|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  300|       |  // required by the C++ standard.
  301|  47.0k|#ifdef __cpp_lib_bit_cast
  302|  47.0k|  return std::bit_cast<float>(getULong(buf, byteOrder));
  303|       |#else
  304|       |  union {
  305|       |    uint32_t ul_;
  306|       |    float f_;
  307|       |  } u;
  308|       |  u.ul_ = getULong(buf, byteOrder);
  309|       |  return u.f_;
  310|       |#endif
  311|  47.0k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|   341k|double getDouble(const byte* buf, ByteOrder byteOrder) {
  314|       |  // This algorithm assumes that the internal representation of the double
  315|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  316|       |  // required by the C++ standard.
  317|   341k|#ifdef __cpp_lib_bit_cast
  318|   341k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 51.6k, False: 289k]
  ------------------
  319|  51.6k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  51.6k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  51.6k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  51.6k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|   289k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|   289k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|   289k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|   289k|                               static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]));
  327|       |#else
  328|       |  union {
  329|       |    uint64_t ull_;
  330|       |    double d_;
  331|       |  } u;
  332|       |  u.ull_ = 0;
  333|       |  if (byteOrder == littleEndian) {
  334|       |    u.ull_ = static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  335|       |             static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  336|       |             static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  337|       |             static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  338|       |  } else {
  339|       |    u.ull_ = static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  340|       |             static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  341|       |             static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  342|       |             static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  343|       |  }
  344|       |  return u.d_;
  345|       |#endif
  346|   341k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|  4.98M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|  4.98M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 4.45M, False: 524k]
  ------------------
  350|  4.45M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|  4.45M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|  4.45M|  } else {
  353|   524k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|   524k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|   524k|  }
  356|  4.98M|  return 2;
  357|  4.98M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|  2.41M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|  2.41M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 1.74M, False: 667k]
  ------------------
  361|  1.74M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|  1.74M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|  1.74M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|  1.74M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|  1.74M|  } else {
  366|   667k|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|   667k|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|   667k|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|   667k|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|   667k|  }
  371|  2.41M|  return 4;
  372|  2.41M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|   157k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|   157k|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|   157k|  o += ul2Data(buf + o, l.second, byteOrder);
  392|   157k|  return o;
  393|   157k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|   134k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|   134k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 73.8k, False: 60.9k]
  ------------------
  397|  73.8k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|  73.8k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|  73.8k|  } else {
  400|  60.9k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|  60.9k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|  60.9k|  }
  403|   134k|  return 2;
  404|   134k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|   779k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|   779k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 81.3k, False: 697k]
  ------------------
  408|  81.3k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|  81.3k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|  81.3k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|  81.3k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|   697k|  } else {
  413|   697k|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  414|   697k|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  415|   697k|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  416|   697k|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  417|   697k|  }
  418|   779k|  return 4;
  419|   779k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|   133k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|   133k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|   133k|  o += l2Data(buf + o, l.second, byteOrder);
  424|   133k|  return o;
  425|   133k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|  32.7k|size_t f2Data(byte* buf, float f, ByteOrder byteOrder) {
  428|       |  // This algorithm assumes that the internal representation of the float
  429|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  430|       |  // required by the C++ standard.
  431|  32.7k|#ifdef __cpp_lib_bit_cast
  432|  32.7k|  return ul2Data(buf, std::bit_cast<uint32_t>(f), byteOrder);
  433|       |#else
  434|       |  union {
  435|       |    uint32_t ul_;
  436|       |    float f_;
  437|       |  } u;
  438|       |  u.f_ = f;
  439|       |  return ul2Data(buf, u.ul_, byteOrder);
  440|       |#endif
  441|  32.7k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|   338k|size_t d2Data(byte* buf, double d, ByteOrder byteOrder) {
  444|       |  // This algorithm assumes that the internal representation of the double
  445|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  446|       |  // required by the C++ standard.
  447|   338k|  union {
  448|   338k|    uint64_t ull_;
  449|   338k|    double d_;
  450|   338k|  } u;
  451|   338k|  u.d_ = d;
  452|   338k|  uint64_t m = 0xff;
  453|   338k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 91.1k, False: 247k]
  ------------------
  454|  91.1k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|  91.1k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|  91.1k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|  91.1k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|  91.1k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|  91.1k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|  91.1k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|  91.1k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|   247k|  } else {
  463|   247k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|   247k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|   247k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|   247k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|   247k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   247k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|   247k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|   247k|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|   247k|  }
  472|   338k|  return 8;
  473|   338k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  502|  55.8k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  503|  55.8k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (503:7): [True: 0, False: 55.8k]
  ------------------
  504|      0|    return false;
  505|  55.8k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (505:7): [True: 55.8k, False: 0]
  |  Branch (505:19): [True: 0, False: 55.8k]
  ------------------
  506|      0|    return false;
  507|       |
  508|  55.8k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  509|  55.8k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  511|      9|int exifTime(const char* buf, tm* tm) {
  512|      9|  int rc = 1;
  513|      9|  int year = 0;
  514|      9|  int mon = 0;
  515|      9|  int mday = 0;
  516|      9|  int hour = 0;
  517|      9|  int min = 0;
  518|      9|  int sec = 0;
  519|      9|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (519:7): [True: 6, False: 3]
  ------------------
  520|      6|    tm->tm_year = year - 1900;
  521|      6|    tm->tm_mon = mon - 1;
  522|      6|    tm->tm_mday = mday;
  523|      6|    tm->tm_hour = hour;
  524|      6|    tm->tm_min = min;
  525|      6|    tm->tm_sec = sec;
  526|      6|    rc = 0;
  527|      6|  }
  528|      9|  return rc;
  529|      9|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  651|    211|Rational floatToRationalCast(float f) {
  652|       |  // Convert f to double because it simplifies the range checks
  653|       |  // below. (All int values can be losslessly converted to double, but
  654|       |  // sometimes get rounded when converted to float.)
  655|    211|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|    211|  int32_t den;
  658|    211|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 147, False: 64]
  ------------------
  659|    147|    den = 1000000;
  660|    147|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (660:14): [True: 21, False: 43]
  ------------------
  661|     21|    den = 10000;
  662|     43|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (662:14): [True: 3, False: 40]
  ------------------
  663|      3|    den = 100;
  664|     40|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (664:14): [True: 16, False: 24]
  ------------------
  665|     16|    den = 1;
  666|     24|  } else {
  667|     24|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (667:13): [True: 24, False: 0]
  ------------------
  668|     24|  }
  669|    187|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|    187|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|    187|  return {nom / g, den / g};
  673|    211|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|  62.4M|  bool operator==(Exiv2::TypeId typeId) const {
   35|  62.4M|    return typeId_ == typeId;
   36|  62.4M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  2.96M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  2.96M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  2.32M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  2.32M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 2.32M]
  ------------------
   25|  3.05k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 3.05k, False: 2.32M]
  ------------------
   26|  1.06M|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 1.05M, False: 1.26M]
  ------------------
   27|  1.06M|      return std::make_unique<DataValue>(typeId);
   28|  37.9k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 37.9k, False: 2.28M]
  ------------------
   29|  37.9k|      return std::make_unique<AsciiValue>();
   30|  45.3k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 45.3k, False: 2.27M]
  ------------------
   31|  45.3k|      return std::make_unique<ValueType<uint16_t>>();
   32|  36.8k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 36.8k, False: 2.28M]
  ------------------
   33|  45.7k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 8.87k, False: 2.31M]
  ------------------
   34|  45.7k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  11.5k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 11.5k, False: 2.31M]
  ------------------
   36|  11.5k|      return std::make_unique<ValueType<URational>>();
   37|  44.4k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 44.4k, False: 2.28M]
  ------------------
   38|  44.4k|      return std::make_unique<DataValue>();
   39|  16.9k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 16.9k, False: 2.30M]
  ------------------
   40|  16.9k|      return std::make_unique<ValueType<int16_t>>();
   41|  25.7k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 25.7k, False: 2.29M]
  ------------------
   42|  25.7k|      return std::make_unique<ValueType<int32_t>>();
   43|  10.1k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 10.1k, False: 2.31M]
  ------------------
   44|  10.1k|      return std::make_unique<ValueType<Rational>>();
   45|  7.02k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 7.02k, False: 2.31M]
  ------------------
   46|  7.02k|      return std::make_unique<ValueType<float>>();
   47|  11.3k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 11.3k, False: 2.31M]
  ------------------
   48|  11.3k|      return std::make_unique<ValueType<double>>();
   49|  73.8k|    case string:
  ------------------
  |  Branch (49:5): [True: 73.8k, False: 2.25M]
  ------------------
   50|  73.8k|      return std::make_unique<StringValue>();
   51|  3.84k|    case date:
  ------------------
  |  Branch (51:5): [True: 3.84k, False: 2.32M]
  ------------------
   52|  3.84k|      return std::make_unique<DateValue>();
   53|  7.81k|    case time:
  ------------------
  |  Branch (53:5): [True: 7.81k, False: 2.31M]
  ------------------
   54|  7.81k|      return std::make_unique<TimeValue>();
   55|  4.76k|    case comment:
  ------------------
  |  Branch (55:5): [True: 4.76k, False: 2.31M]
  ------------------
   56|  4.76k|      return std::make_unique<CommentValue>();
   57|  38.9k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 38.9k, False: 2.28M]
  ------------------
   58|  38.9k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 2.32M]
  ------------------
   60|  3.26k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 3.26k, False: 2.32M]
  ------------------
   61|  3.26k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 2.32M]
  ------------------
   62|  3.26k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 2.32M]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|   873k|    default:
  ------------------
  |  Branch (65:5): [True: 873k, False: 1.45M]
  ------------------
   66|   873k|      return std::make_unique<DataValue>(typeId);
   67|  2.32M|  }
   68|  2.32M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|    925|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|    925|  return -1;
   72|    925|}
_ZNK5Exiv25Value8toStringEv:
   74|   252k|std::string Value::toString() const {
   75|   252k|  std::ostringstream os;
   76|   252k|  write(os);
   77|   252k|  ok_ = !os.fail();
   78|   252k|  return os.str();
   79|   252k|}
_ZNK5Exiv25Value8toStringEm:
   81|   156k|std::string Value::toString(size_t /*n*/) const {
   82|   156k|  return toString();
   83|   156k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  33.8k|size_t Value::sizeDataArea() const {
   86|  33.8k|  return 0;
   87|  33.8k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|  1.12k|DataBuf Value::dataArea() const {
   90|  1.12k|  return {nullptr, 0};
   91|  1.12k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|  1.98M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|  1.98M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   96|     17|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   97|     17|  read(buf, len, byteOrder);
   98|     17|}
_ZNK5Exiv29DataValue5countEv:
  100|  6.02M|size_t DataValue::count() const {
  101|  6.02M|  return size();
  102|  6.02M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|  1.98M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|  1.98M|  value_.assign(buf, buf + len);
  107|  1.98M|  return 0;
  108|  1.98M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|  3.19M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|  3.19M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|  3.19M|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  17.0M|size_t DataValue::size() const {
  128|  17.0M|  return value_.size();
  129|  17.0M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  8.74M|DataValue* DataValue::clone_() const {
  132|  8.74M|  return new DataValue(*this);
  133|  8.74M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  1.83k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  1.83k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.30k, False: 530]
  ------------------
  137|  1.30k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.30k|    os << static_cast<int>(value_.back());
  139|  1.30k|  }
  140|  1.83k|  return os;
  141|  1.83k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  48.0k|int64_t DataValue::toInt64(size_t n) const {
  149|  48.0k|  ok_ = true;
  150|  48.0k|  return value_.at(n);
  151|  48.0k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|  56.9k|uint32_t DataValue::toUint32(size_t n) const {
  154|  56.9k|  ok_ = true;
  155|  56.9k|  return value_.at(n);
  156|  56.9k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  52.5k|int StringValueBase::read(const std::string& buf) {
  173|  52.5k|  value_ = buf;
  174|  52.5k|  return 0;
  175|  52.5k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  61.9k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  61.9k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 61.9k, False: 0]
  ------------------
  180|  61.9k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  61.9k|  return 0;
  182|  61.9k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  88.7k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  88.7k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 51.4k, False: 37.3k]
  ------------------
  186|  51.4k|    return 0;
  187|       |  // byteOrder not needed
  188|  37.3k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  88.7k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|   112k|size_t StringValueBase::count() const {
  192|   112k|  return size();
  193|   112k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|   352k|size_t StringValueBase::size() const {
  196|   352k|  return value_.size();
  197|   352k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  199|  51.7k|std::ostream& StringValueBase::write(std::ostream& os) const {
  200|  51.7k|  return os << value_;
  201|  51.7k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  1.75k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  1.75k|  ok_ = true;
  205|  1.75k|  return value_.at(n);
  206|  1.75k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  47.8k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  47.8k|  ok_ = true;
  210|  47.8k|  return value_.at(n);
  211|  47.8k|}
_ZN5Exiv211StringValueC2Ev:
  223|  73.8k|StringValue::StringValue() : StringValueBase(string) {
  224|  73.8k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|   402k|StringValue* StringValue::clone_() const {
  230|   402k|  return new StringValue(*this);
  231|   402k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  37.9k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  37.9k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  3.57k|int AsciiValue::read(const std::string& buf) {
  240|  3.57k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  3.57k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 6, False: 3.57k]
  |  Branch (242:25): [True: 3.57k, False: 0]
  ------------------
  243|  3.57k|    value_ += '\0';
  244|  3.57k|  }
  245|  3.57k|  return 0;
  246|  3.57k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|   153k|AsciiValue* AsciiValue::clone_() const {
  249|   153k|  return new AsciiValue(*this);
  250|   153k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  29.7k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  29.7k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  29.7k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 8.05k, False: 21.6k]
  ------------------
  256|  8.05k|    pos = value_.size();
  257|  29.7k|  return os << value_.substr(0, pos);
  258|  29.7k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  285|  3.24k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  286|  3.24k|  int i = 0;
  287|  11.7k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (287:10): [True: 10.7k, False: 990]
  |  Branch (287:10): [True: 8.49k, False: 3.24k]
  |  Branch (287:58): [True: 8.49k, False: 2.25k]
  ------------------
  288|  8.49k|  }
  289|  3.24k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (289:10): [True: 990, False: 2.25k]
  ------------------
  290|  3.24k|}
_ZN5Exiv212CommentValueC2Ev:
  292|  4.76k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|  4.76k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|  4.76k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|  4.76k|  byteOrder_ = byteOrder;
  331|  4.76k|  return StringValueBase::read(buf, len, byteOrder);
  332|  4.76k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  334|  4.79k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  335|  4.79k|  std::string c = value_;
  336|  4.79k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (336:7): [True: 1.12k, False: 3.67k]
  ------------------
  337|  1.12k|    c = value_.substr(8);
  338|  1.12k|    [[maybe_unused]] const size_t sz = c.size();
  339|  1.12k|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (339:9): [True: 19, False: 1.10k]
  |  Branch (339:39): [True: 0, False: 19]
  ------------------
  340|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  341|  1.12k|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (341:16): [True: 1.10k, False: 19]
  |  Branch (341:43): [True: 338, False: 766]
  ------------------
  342|    338|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  343|    338|    }
  344|  1.12k|    c = value_.substr(0, 8) + c;
  345|  1.12k|  }
  346|  4.79k|  if (c.empty())
  ------------------
  |  Branch (346:7): [True: 1.27k, False: 3.52k]
  ------------------
  347|  1.27k|    return 0;
  348|  3.52k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  349|  4.79k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  381|  4.79k|CommentValue::CharsetId CommentValue::charsetId() const {
  382|  4.79k|  CharsetId charsetId = undefined;
  383|  4.79k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (383:7): [True: 3.24k, False: 1.55k]
  ------------------
  384|  3.24k|    const std::string code = value_.substr(0, 8);
  385|  3.24k|    charsetId = CharsetInfo::charsetIdByCode(code);
  386|  3.24k|  }
  387|  4.79k|  return charsetId;
  388|  4.79k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|  13.3k|CommentValue* CommentValue::clone_() const {
  411|  13.3k|  return new CommentValue(*this);
  412|  13.3k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  13.5k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  13.5k|  xmpArrayType_ = xmpArrayType;
  416|  13.5k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  8.13k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  8.13k|  xmpStruct_ = xmpStruct;
  420|  8.13k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|   419k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|   419k|  return xmpArrayType_;
  424|   419k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  13.4k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  13.4k|  XmpArrayType xa = xaNone;
  428|  13.4k|  switch (typeId) {
  429|    540|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 540, False: 12.9k]
  ------------------
  430|    540|      xa = xaAlt;
  431|    540|      break;
  432|    270|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 270, False: 13.1k]
  ------------------
  433|    270|      xa = xaBag;
  434|    270|      break;
  435|  5.12k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 5.12k, False: 8.32k]
  ------------------
  436|  5.12k|      xa = xaSeq;
  437|  5.12k|      break;
  438|  7.51k|    default:
  ------------------
  |  Branch (438:5): [True: 7.51k, False: 5.93k]
  ------------------
  439|  7.51k|      break;
  440|  13.4k|  }
  441|  13.4k|  return xa;
  442|  13.4k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|   432k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|   432k|  return xmpStruct_;
  446|   432k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   133k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   133k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   922k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   922k|  std::string b = buf;
  478|   922k|  std::string type;
  479|   922k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 1.85k, False: 921k]
  ------------------
  480|  1.85k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  1.85k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  1.85k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 798, False: 1.06k]
  |  Branch (483:26): [True: 535, False: 263]
  ------------------
  484|    535|      type = type.substr(1);
  485|  1.85k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 725, False: 1.13k]
  |  Branch (485:26): [True: 360, False: 365]
  ------------------
  486|    360|      type.pop_back();
  487|  1.85k|    b.clear();
  488|  1.85k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 1.23k, False: 623]
  ------------------
  489|  1.23k|      b = buf.substr(pos + 1);
  490|  1.85k|  }
  491|   922k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 725, False: 922k]
  ------------------
  492|    725|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 96, False: 629]
  ------------------
  493|     96|      setXmpArrayType(XmpValue::xaAlt);
  494|    629|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 17, False: 612]
  ------------------
  495|     17|      setXmpArrayType(XmpValue::xaBag);
  496|    612|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 36, False: 576]
  ------------------
  497|     36|      setXmpArrayType(XmpValue::xaSeq);
  498|    576|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 271, False: 305]
  ------------------
  499|    271|      setXmpStruct();
  500|    305|    } else {
  501|    305|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    305|    }
  503|    725|  }
  504|   922k|  value_ = std::move(b);
  505|   922k|  return 0;
  506|   922k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  512|  88.4k|size_t XmpTextValue::size() const {
  513|  88.4k|  std::ostringstream os;
  514|  88.4k|  write(os);
  515|  88.4k|  return os.str().size();
  516|  88.4k|}
_ZNK5Exiv212XmpTextValue5countEv:
  518|  88.4k|size_t XmpTextValue::count() const {
  519|  88.4k|  return size();
  520|  88.4k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|   250k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|   250k|  bool del = false;
  524|   250k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 304, False: 249k]
  ------------------
  525|    304|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 304, False: 0]
  ------------------
  526|     90|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 90, False: 214]
  ------------------
  527|     90|        os << "type=\"Alt\"";
  528|     90|        break;
  529|      4|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 4, False: 300]
  ------------------
  530|      4|        os << "type=\"Bag\"";
  531|      4|        break;
  532|    210|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 210, False: 94]
  ------------------
  533|    210|        os << "type=\"Seq\"";
  534|    210|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 304]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|    304|    }
  538|    304|    del = true;
  539|   249k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 6.75k, False: 243k]
  ------------------
  540|  6.75k|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 6.75k, False: 0]
  ------------------
  541|  6.75k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 6.75k, False: 0]
  ------------------
  542|  6.75k|        os << "type=\"Struct\"";
  543|  6.75k|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 6.75k]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|  6.75k|    }
  547|  6.75k|    del = true;
  548|  6.75k|  }
  549|   250k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 7.06k, False: 243k]
  |  Branch (549:14): [True: 20, False: 7.04k]
  ------------------
  550|     20|    os << " ";
  551|   250k|  return os << value_;
  552|   250k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   295k|XmpTextValue* XmpTextValue::clone_() const {
  571|   295k|  return new XmpTextValue(*this);
  572|   295k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  5.58k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  5.58k|  setXmpArrayType(xmpArrayType(typeId));
  576|  5.58k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   438k|int XmpArrayValue::read(const std::string& buf) {
  579|   438k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 431k, False: 7.55k]
  ------------------
  580|   431k|    value_.push_back(buf);
  581|   438k|  return 0;
  582|   438k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|  60.2k|size_t XmpArrayValue::count() const {
  589|  60.2k|  return value_.size();
  590|  60.2k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    202|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    202|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 198, False: 4]
  ------------------
  594|    198|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    198|    os << value_.back();
  596|    198|  }
  597|    202|  return os;
  598|    202|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|   167k|std::string XmpArrayValue::toString(size_t n) const {
  601|   167k|  ok_ = true;
  602|   167k|  return value_.at(n);
  603|   167k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  10.4k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  10.4k|  return new XmpArrayValue(*this);
  623|  10.4k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|    977|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|    977|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    393|size_t LangAltValue::count() const {
  680|    393|  return value_.size();
  681|    393|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|    143|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|    143|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|    143|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 143]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|    143|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 143, False: 143]
  ------------------
  694|    143|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 143, False: 0]
  ------------------
  695|    143|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 143]
  ------------------
  696|      0|        os << ", ";
  697|    143|      os << "lang=\"" << lang << "\" " << s;
  698|    143|      first = false;
  699|    143|    }
  700|    143|  }
  701|    143|  return os;
  702|    143|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    440|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    440|  return toString("x-default");
  706|    440|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    440|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    440|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 47, False: 393]
  ------------------
  710|     47|    ok_ = true;
  711|     47|    return i->second;
  712|     47|  }
  713|    393|  ok_ = false;
  714|    393|  return "";
  715|    440|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  1.87k|LangAltValue* LangAltValue::clone_() const {
  738|  1.87k|  return new LangAltValue(*this);
  739|  1.87k|}
_ZN5Exiv29DateValueC2Ev:
  741|  3.84k|DateValue::DateValue() : Value(date) {
  742|  3.84k|  date_ = {};
  743|  3.84k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  3.54k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  3.54k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  3.54k|  return read(str);
  752|  3.54k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  3.84k|int DateValue::read(const std::string& buf) {
  755|       |  // ISO 8601 date formats:
  756|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  757|  3.84k|  size_t monthPos = 0;
  758|  3.84k|  size_t dayPos = 0;
  759|       |
  760|  3.84k|  auto printWarning = [] {
  761|  3.84k|#ifndef SUPPRESS_WARNINGS
  762|  3.84k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  3.84k|#endif
  764|  3.84k|  };
  765|       |
  766|  3.84k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 715, False: 3.12k]
  ------------------
  767|    715|    printWarning();
  768|    715|    return 1;
  769|    715|  }
  770|       |
  771|  3.12k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 1.91k, False: 1.21k]
  |  Branch (771:28): [True: 910, False: 1.00k]
  |  Branch (771:45): [True: 285, False: 625]
  |  Branch (771:63): [True: 1.21k, False: 1.63k]
  ------------------
  772|  1.49k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 285, False: 1.21k]
  ------------------
  773|    285|      monthPos = 5;
  774|    285|      dayPos = 8;
  775|  1.21k|    } else {
  776|  1.21k|      monthPos = 4;
  777|  1.21k|      dayPos = 6;
  778|  1.21k|    }
  779|       |
  780|  1.49k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  1.49k|      for (size_t i = start; i < start + count; ++i) {
  782|  1.49k|        if (!std::isdigit(buf[i])) {
  783|  1.49k|          printWarning();
  784|  1.49k|          return 1;
  785|  1.49k|        }
  786|  1.49k|      }
  787|  1.49k|      dest = std::stoul(buf.substr(start, count));
  788|  1.49k|      return 0;
  789|  1.49k|    };
  790|       |
  791|  1.49k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 591, False: 907]
  |  Branch (791:42): [True: 443, False: 464]
  |  Branch (791:83): [True: 105, False: 359]
  ------------------
  792|  1.13k|      printWarning();
  793|  1.13k|      return 1;
  794|  1.13k|    }
  795|       |
  796|    359|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 129, False: 230]
  |  Branch (796:29): [True: 88, False: 142]
  ------------------
  797|    217|      date_.month = 0;
  798|    217|      date_.day = 0;
  799|    217|      printWarning();
  800|    217|      return 1;
  801|    217|    }
  802|    142|    return 0;
  803|    359|  }
  804|  1.63k|  printWarning();
  805|  1.63k|  return 1;
  806|  3.12k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  812|    149|size_t DateValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  813|       |  // \note Here the date is copied in the Basic format YYYYMMDD, as the IPTC key	Iptc.Application2.DateCreated
  814|       |  // wants it. Check https://exiv2.org/iptc.html
  815|       |
  816|    149|  auto out = reinterpret_cast<char*>(buf);
  817|    149|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|    149|#define stringFormatTo std::format_to
  ------------------
  818|       |
  819|    149|  return it - out;
  820|    149|}
_ZNK5Exiv29DateValue4sizeEv:
  830|    298|size_t DateValue::size() const {
  831|    298|  return 8;
  832|    298|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|  1.48k|DateValue* DateValue::clone_() const {
  835|  1.48k|  return new DateValue(*this);
  836|  1.48k|}
_ZN5Exiv29TimeValueC2Ev:
  877|  7.81k|TimeValue::TimeValue() : Value(time) {
  878|  7.81k|  time_ = {};
  879|  7.81k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  7.81k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  7.81k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  7.81k|  return read(str);
  888|  7.81k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  7.81k|int TimeValue::read(const std::string& buf) {
  891|       |  // ISO 8601 time formats:
  892|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  893|       |  // Not supported formats:
  894|       |  // 4.2.2.4 Representations with decimal fraction: 232050,5
  895|  7.81k|  auto printWarning = [] {
  896|  7.81k|#ifndef SUPPRESS_WARNINGS
  897|  7.81k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  7.81k|#endif
  899|  7.81k|    return 1;
  900|  7.81k|  };
  901|       |
  902|  7.81k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 901, False: 6.91k]
  ------------------
  903|    901|    return printWarning();
  904|       |
  905|  6.91k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 79.8k, False: 4.68k]
  ------------------
  906|  79.8k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 77.0k, False: 2.77k]
  |  Branch (906:21): [True: 74.2k, False: 2.82k]
  |  Branch (906:33): [True: 69.5k, False: 4.66k]
  |  Branch (906:45): [True: 66.7k, False: 2.76k]
  |  Branch (906:57): [True: 2.23k, False: 64.5k]
  ------------------
  907|  2.23k|      return printWarning();
  908|       |
  909|  4.68k|  size_t mpos;
  910|  4.68k|  size_t spos;
  911|  4.68k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 1.82k, False: 2.85k]
  ------------------
  912|  1.82k|    mpos = 3;
  913|  1.82k|    spos = 6;
  914|  2.85k|  } else {
  915|  2.85k|    mpos = 2;
  916|  2.85k|    spos = 4;
  917|  2.85k|  }
  918|       |
  919|  4.68k|  auto hi = std::stoi(buf.substr(0, 2));
  920|  4.68k|  if (hi < 0 || hi > 23)
  ------------------
  |  Branch (920:7): [True: 50, False: 4.63k]
  |  Branch (920:17): [True: 96, False: 4.53k]
  ------------------
  921|    130|    return printWarning();
  922|  4.55k|  time_.hour = hi;
  923|  4.55k|  if (buf.size() > 3) {
  ------------------
  |  Branch (923:7): [True: 3.57k, False: 974]
  ------------------
  924|  3.57k|    auto mi = std::stoi(buf.substr(mpos, 2));
  925|  3.57k|    if (mi < 0 || mi > 59)
  ------------------
  |  Branch (925:9): [True: 188, False: 3.38k]
  |  Branch (925:19): [True: 65, False: 3.32k]
  ------------------
  926|    252|      return printWarning();
  927|  3.32k|    time_.minute = std::stoi(buf.substr(mpos, 2));
  928|  3.32k|  } else {
  929|    974|    time_.minute = 0;
  930|    974|  }
  931|  4.29k|  if (buf.size() > 5) {
  ------------------
  |  Branch (931:7): [True: 2.55k, False: 1.74k]
  ------------------
  932|  2.55k|    auto si = std::stoi(buf.substr(spos, 2));
  933|  2.55k|    if (si < 0 || si > 60)
  ------------------
  |  Branch (933:9): [True: 62, False: 2.49k]
  |  Branch (933:19): [True: 166, False: 2.32k]
  ------------------
  934|    225|      return printWarning();
  935|  2.32k|    time_.second = std::stoi(buf.substr(spos, 2));
  936|  2.32k|  } else {
  937|  1.74k|    time_.second = 0;
  938|  1.74k|  }
  939|       |
  940|  4.07k|  auto fpos = buf.find('+');
  941|  4.07k|  if (fpos == std::string::npos)
  ------------------
  |  Branch (941:7): [True: 2.20k, False: 1.86k]
  ------------------
  942|  2.20k|    fpos = buf.find('-');
  943|       |
  944|  4.07k|  if (fpos != std::string::npos) {
  ------------------
  |  Branch (944:7): [True: 3.70k, False: 369]
  ------------------
  945|  3.70k|    auto format = buf.substr(fpos, buf.size());
  946|  3.70k|    auto posColon = format.find(':');
  947|  3.70k|    if (posColon == std::string::npos) {
  ------------------
  |  Branch (947:9): [True: 2.12k, False: 1.57k]
  ------------------
  948|       |      // Extended format
  949|  2.12k|      auto tzhi = std::stoi(format.substr(0, 3));
  950|  2.12k|      if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (950:11): [True: 178, False: 1.95k]
  |  Branch (950:25): [True: 387, False: 1.56k]
  ------------------
  951|    562|        return printWarning();
  952|  1.56k|      time_.tzHour = tzhi;
  953|  1.56k|      if (format.size() > 3) {
  ------------------
  |  Branch (953:11): [True: 809, False: 758]
  ------------------
  954|    809|        int minute = std::stoi(format.substr(3));
  955|    809|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (955:13): [True: 68, False: 741]
  |  Branch (955:27): [True: 236, False: 505]
  ------------------
  956|    298|          return printWarning();
  957|    511|        time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (957:26): [True: 261, False: 250]
  ------------------
  958|    511|      }
  959|  1.57k|    } else {
  960|       |      // Basic format
  961|  1.57k|      auto tzhi = std::stoi(format.substr(0, posColon));
  962|  1.57k|      if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (962:11): [True: 408, False: 1.16k]
  |  Branch (962:25): [True: 219, False: 948]
  ------------------
  963|    625|        return printWarning();
  964|    950|      time_.tzHour = tzhi;
  965|    950|      int minute = std::stoi(format.substr(posColon + 1));
  966|    950|      if (minute < 0 || minute > 59)
  ------------------
  |  Branch (966:11): [True: 299, False: 651]
  |  Branch (966:25): [True: 192, False: 459]
  ------------------
  967|    480|        return printWarning();
  968|    470|      time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (968:24): [True: 163, False: 307]
  ------------------
  969|    470|    }
  970|  3.70k|  }
  971|  2.10k|  return 0;
  972|  4.07k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  979|    308|size_t TimeValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  980|       |  // NOTE: Here the time is copied in the Basic format HHMMSS:HHMM, as the IPTC key
  981|       |  // Iptc.Application2.TimeCreated wants it. Check https://exiv2.org/iptc.html
  982|    308|  char plusMinus = '+';
  983|    308|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (983:7): [True: 112, False: 196]
  |  Branch (983:27): [True: 0, False: 196]
  ------------------
  984|    112|    plusMinus = '-';
  985|       |
  986|    308|  auto out = reinterpret_cast<char*>(buf);
  987|    308|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    308|#define stringFormatTo std::format_to
  ------------------
  988|    308|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
  989|       |
  990|    308|  auto wrote = static_cast<size_t>(it - out);
  991|    308|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
  992|    308|  return wrote;
  993|    308|}
_ZNK5Exiv29TimeValue4sizeEv:
 1003|    616|size_t TimeValue::size() const {
 1004|    616|  return 11;
 1005|    616|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1007|  3.56k|TimeValue* TimeValue::clone_() const {
 1008|  3.56k|  return new TimeValue(*this);
 1009|  3.56k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  4.84k|  auto printWarning = [] {
  761|  4.84k|#ifndef SUPPRESS_WARNINGS
  762|  4.84k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  4.84k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.84k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.84k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  4.84k|#endif
  764|  4.84k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  2.86k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  9.43k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 7.70k, False: 1.73k]
  ------------------
  782|  7.70k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 1.13k, False: 6.56k]
  ------------------
  783|  1.13k|          printWarning();
  784|  1.13k|          return 1;
  785|  1.13k|        }
  786|  7.70k|      }
  787|  1.73k|      dest = std::stoul(buf.substr(start, count));
  788|  1.73k|      return 0;
  789|  2.86k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  5.70k|  auto printWarning = [] {
  896|  5.70k|#ifndef SUPPRESS_WARNINGS
  897|  5.70k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  5.70k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.70k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.70k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  5.70k|#endif
  899|  5.70k|    return 1;
  900|  5.70k|  };

_ZN5Exiv213versionNumberEv:
   67|  1.10k|uint32_t versionNumber() {
   68|  1.10k|  return EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION, EXIV2_MINOR_VERSION, EXIV2_PATCH_VERSION);
  ------------------
  |  |   19|  1.10k|#define EXIV2_MAKE_VERSION(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
  ------------------
   69|  1.10k|}
_ZN5Exiv222versionNumberHexStringEv:
   75|  1.10k|std::string versionNumberHexString() {
   76|  1.10k|  return stringFormat("{:06x}", Exiv2::versionNumber());
  ------------------
  |  |   18|  1.10k|#define stringFormat std::format
  ------------------
   77|  1.10k|}

_ZN5Exiv29WebPImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   77|    343|WebPImage::WebPImage(BasicIo::UniquePtr io) : Image(ImageType::webp, mdNone, std::move(io)) {
   78|    343|}  // WebPImage::WebPImage
_ZN5Exiv29WebPImage13writeMetadataEv:
   97|    115|void WebPImage::writeMetadata() {
   98|    115|  if (io_->open() != 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 115]
  ------------------
   99|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  100|      0|  }
  101|    115|  IoCloser closer(*io_);
  102|    115|  MemIo tempIo;
  103|       |
  104|    115|  doWriteMetadata(tempIo);  // may throw
  105|    115|  io_->close();
  106|    115|  io_->transfer(tempIo);  // may throw
  107|    115|}  // WebPImage::writeMetadata
_ZN5Exiv29WebPImage15doWriteMetadataERNS_7BasicIoE:
  109|    115|void WebPImage::doWriteMetadata(BasicIo& outIo) {
  110|    115|  if (!io_->isopen())
  ------------------
  |  Branch (110:7): [True: 0, False: 115]
  ------------------
  111|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  112|    115|  if (!outIo.isopen())
  ------------------
  |  Branch (112:7): [True: 0, False: 115]
  ------------------
  113|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  114|       |
  115|       |#ifdef EXIV2_DEBUG_MESSAGES
  116|       |  std::cout << "Writing metadata" << '\n';
  117|       |#endif
  118|       |
  119|    115|  byte data[WEBP_TAG_SIZE * 3];
  120|    115|  DataBuf chunkId(WEBP_TAG_SIZE + 1);
  121|    115|  chunkId.write_uint8(WEBP_TAG_SIZE, '\0');
  122|       |
  123|    115|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  124|    115|  uint64_t filesize = Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian);
  125|       |
  126|       |  /* Set up header */
  127|    115|  if (outIo.write(data, WEBP_TAG_SIZE * 3) != WEBP_TAG_SIZE * 3)
  ------------------
  |  Branch (127:7): [True: 0, False: 115]
  ------------------
  128|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  129|       |
  130|       |  /* Parse Chunks */
  131|    115|  bool has_size = false;
  132|    115|  bool has_xmp = false;
  133|    115|  bool has_exif = false;
  134|    115|  bool has_vp8x = false;
  135|    115|  bool has_alpha = false;
  136|    115|  bool has_icc = iccProfileDefined();
  137|       |
  138|    115|  uint32_t width = 0;
  139|    115|  uint32_t height = 0;
  140|       |
  141|    115|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  142|    115|  Blob blob;
  143|       |
  144|    115|  if (!exifData_.empty()) {
  ------------------
  |  Branch (144:7): [True: 26, False: 89]
  ------------------
  145|     26|    ExifParser::encode(blob, littleEndian, exifData_);
  146|     26|    if (!blob.empty()) {
  ------------------
  |  Branch (146:9): [True: 24, False: 2]
  ------------------
  147|     24|      has_exif = true;
  148|     24|    }
  149|     26|  }
  150|       |
  151|    115|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (151:7): [True: 2, False: 113]
  |  Branch (151:28): [True: 2, False: 0]
  ------------------
  152|      2|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  153|      2|  }
  154|    115|  has_xmp = !xmpPacket_.empty();
  155|    115|  std::string xmp(xmpPacket_);
  156|       |
  157|       |  /* Verify for a VP8X Chunk First before writing in
  158|       |   case we have any exif or xmp data, also check
  159|       |   for any chunks with alpha frame/layer set */
  160|  5.66k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (160:10): [True: 5.64k, False: 12]
  |  Branch (160:25): [True: 5.54k, False: 103]
  ------------------
  161|  5.54k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  162|  5.54k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  163|  5.54k|    const uint32_t size_u32 = Exiv2::getULong(size_buff.data(), littleEndian);
  164|       |
  165|       |    // Check that `size_u32` is within bounds.
  166|  5.54k|    Internal::enforce(size_u32 <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  5.54k|    DataBuf payload(size_u32);
  169|  5.54k|    if (!payload.empty()) {
  ------------------
  |  Branch (169:9): [True: 848, False: 4.69k]
  ------------------
  170|    848|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  171|    848|      if (payload.size() % 2) {
  ------------------
  |  Branch (171:11): [True: 377, False: 471]
  ------------------
  172|    377|        byte c = 0;
  173|    377|        io_->readOrThrow(&c, 1, Exiv2::ErrorCode::kerCorruptedMetadata);
  174|    377|      }
  175|    848|    }
  176|       |
  177|       |    /* Chunk with information about features
  178|       |     used in the file. */
  179|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_vp8x) {
  ------------------
  |  Branch (179:9): [True: 33, False: 5.51k]
  |  Branch (179:59): [True: 22, False: 11]
  ------------------
  180|     22|      has_vp8x = true;
  181|     22|    }
  182|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_size) {
  ------------------
  |  Branch (182:9): [True: 33, False: 5.51k]
  |  Branch (182:59): [True: 22, False: 11]
  ------------------
  183|     22|      Internal::enforce(size_u32 >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  184|     22|      has_size = true;
  185|     22|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  186|       |
  187|       |      // Fetch width - stored in 24bits
  188|     22|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  189|     22|      size_buf.back() = 0;
  190|     22|      width = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  191|       |
  192|       |      // Fetch height - stored in 24bits
  193|     22|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  194|     22|      size_buf.back() = 0;
  195|     22|      height = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  196|     22|    }
  197|       |
  198|       |    /* Chunk with animation control data. */
  199|       |#ifdef __CHECK_FOR_ALPHA__  // Maybe in the future
  200|       |    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANIM) && !has_alpha) {
  201|       |      has_alpha = true;
  202|       |    }
  203|       |#endif
  204|       |
  205|       |    /* Chunk with lossy image data. */
  206|       |#ifdef __CHECK_FOR_ALPHA__  // Maybe in the future
  207|       |    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_alpha) {
  208|       |      has_alpha = true;
  209|       |    }
  210|       |#endif
  211|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_size) {
  ------------------
  |  Branch (211:9): [True: 20, False: 5.52k]
  |  Branch (211:58): [True: 3, False: 17]
  ------------------
  212|      3|      Internal::enforce(size_u32 >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  213|      3|      has_size = true;
  214|      3|      std::array<byte, 2> size_buf;
  215|       |
  216|       |      /* Refer to this https://tools.ietf.org/html/rfc6386
  217|       |         for height and width reference for VP8 chunks */
  218|       |
  219|       |      // Fetch width - stored in 16bits
  220|      3|      std::copy_n(payload.begin() + 6, 2, size_buf.begin());
  221|      3|      width = Exiv2::getUShort(size_buf.data(), littleEndian) & 0x3fff;
  222|       |
  223|       |      // Fetch height - stored in 16bits
  224|      3|      std::copy_n(payload.begin() + 8, 2, size_buf.begin());
  225|      3|      height = Exiv2::getUShort(size_buf.data(), littleEndian) & 0x3fff;
  226|      3|    }
  227|       |
  228|       |    /* Chunk with lossless image data. */
  229|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_alpha) {
  ------------------
  |  Branch (229:9): [True: 77, False: 5.46k]
  |  Branch (229:59): [True: 51, False: 26]
  ------------------
  230|     51|      Internal::enforce(size_u32 >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  231|     51|      if ((payload.read_uint8(4) & WEBP_VP8X_ALPHA_BIT) == WEBP_VP8X_ALPHA_BIT) {
  ------------------
  |  Branch (231:11): [True: 8, False: 43]
  ------------------
  232|      8|        has_alpha = true;
  233|      8|      }
  234|     51|    }
  235|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_size) {
  ------------------
  |  Branch (235:9): [True: 76, False: 5.47k]
  |  Branch (235:59): [True: 29, False: 47]
  ------------------
  236|     29|      Internal::enforce(size_u32 >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  237|     29|      has_size = true;
  238|     29|      std::array<byte, 2> size_buf_w;
  239|     29|      std::array<byte, 3> size_buf_h;
  240|       |
  241|       |      /* For VP8L chunks width & height are stored in 28 bits
  242|       |         of a 32 bit field requires bitshifting to get actual
  243|       |         sizes. Width and height are split even into 14 bits
  244|       |         each. Refer to this https://goo.gl/bpgMJf */
  245|       |
  246|       |      // Fetch width - 14 bits wide
  247|     29|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  248|     29|      size_buf_w.back() &= 0x3F;
  249|     29|      width = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  250|       |
  251|       |      // Fetch height - 14 bits wide
  252|     29|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  253|     29|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  254|     29|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  255|     29|      height = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  256|     29|    }
  257|       |
  258|       |    /* Chunk with animation frame. */
  259|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_alpha) {
  ------------------
  |  Branch (259:9): [True: 88, False: 5.45k]
  |  Branch (259:59): [True: 42, False: 46]
  ------------------
  260|     42|      Internal::enforce(size_u32 >= 6, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|     42|      if ((payload.read_uint8(5) & 0x2) == 0x2) {
  ------------------
  |  Branch (261:11): [True: 4, False: 38]
  ------------------
  262|      4|        has_alpha = true;
  263|      4|      }
  264|     42|    }
  265|  5.54k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_size) {
  ------------------
  |  Branch (265:9): [True: 88, False: 5.45k]
  |  Branch (265:59): [True: 7, False: 81]
  ------------------
  266|      7|      Internal::enforce(size_u32 >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  267|      7|      has_size = true;
  268|      7|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  269|       |
  270|       |      // Fetch width - stored in 24bits
  271|      7|      std::copy_n(payload.begin() + 6, 3, size_buf.begin());
  272|      7|      size_buf.back() = 0;
  273|      7|      width = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  274|       |
  275|       |      // Fetch height - stored in 24bits
  276|      7|      std::copy_n(payload.begin() + 9, 3, size_buf.begin());
  277|      7|      size_buf.back() = 0;
  278|      7|      height = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  279|      7|    }
  280|       |
  281|       |    /* Chunk with alpha data. */
  282|  5.54k|    if (equalsWebPTag(chunkId, "ALPH") && !has_alpha) {
  ------------------
  |  Branch (282:9): [True: 19, False: 5.52k]
  |  Branch (282:43): [True: 7, False: 12]
  ------------------
  283|      7|      has_alpha = true;
  284|      7|    }
  285|  5.54k|  }
  286|       |
  287|       |  /* Inject a VP8X chunk if one isn't available. */
  288|    115|  if (!has_vp8x) {
  ------------------
  |  Branch (288:7): [True: 82, False: 33]
  ------------------
  289|     82|    inject_VP8X(outIo, has_xmp, has_exif, has_alpha, has_icc, width, height);
  290|     82|  }
  291|       |
  292|    115|  io_->seek(12, BasicIo::beg);
  293|  5.00k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (293:10): [True: 4.95k, False: 57]
  |  Branch (293:25): [True: 4.89k, False: 58]
  ------------------
  294|  4.89k|    io_->readOrThrow(chunkId.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  295|  4.89k|    io_->readOrThrow(size_buff.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  296|       |
  297|  4.89k|    const uint32_t size_u32 = Exiv2::getULong(size_buff.data(), littleEndian);
  298|       |
  299|       |    // Check that `size_u32` is within bounds.
  300|  4.89k|    Internal::enforce(size_u32 <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  301|       |
  302|  4.89k|    DataBuf payload(size_u32);
  303|  4.89k|    io_->readOrThrow(payload.data(), size_u32, Exiv2::ErrorCode::kerCorruptedMetadata);
  304|  4.89k|    if (io_->tell() % 2)
  ------------------
  |  Branch (304:9): [True: 305, False: 4.58k]
  ------------------
  305|    305|      io_->seek(+1, BasicIo::cur);  // skip pad
  306|       |
  307|  4.89k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X)) {
  ------------------
  |  Branch (307:9): [True: 32, False: 4.86k]
  ------------------
  308|     32|      Internal::enforce(size_u32 >= 1, Exiv2::ErrorCode::kerCorruptedMetadata);
  309|     32|      if (has_icc) {
  ------------------
  |  Branch (309:11): [True: 1, False: 31]
  ------------------
  310|      1|        const uint8_t x = payload.read_uint8(0);
  311|      1|        payload.write_uint8(0, x | WEBP_VP8X_ICC_BIT);
  312|     31|      } else {
  313|     31|        const uint8_t x = payload.read_uint8(0);
  314|     31|        payload.write_uint8(0, x & ~WEBP_VP8X_ICC_BIT);
  315|     31|      }
  316|       |
  317|     32|      if (has_xmp) {
  ------------------
  |  Branch (317:11): [True: 3, False: 29]
  ------------------
  318|      3|        const uint8_t x = payload.read_uint8(0);
  319|      3|        payload.write_uint8(0, x | WEBP_VP8X_XMP_BIT);
  320|     29|      } else {
  321|     29|        const uint8_t x = payload.read_uint8(0);
  322|     29|        payload.write_uint8(0, x & ~WEBP_VP8X_XMP_BIT);
  323|     29|      }
  324|       |
  325|     32|      if (has_exif) {
  ------------------
  |  Branch (325:11): [True: 3, False: 29]
  ------------------
  326|      3|        const uint8_t x = payload.read_uint8(0);
  327|      3|        payload.write_uint8(0, x | WEBP_VP8X_EXIF_BIT);
  328|     29|      } else {
  329|     29|        const uint8_t x = payload.read_uint8(0);
  330|     29|        payload.write_uint8(0, x & ~WEBP_VP8X_EXIF_BIT);
  331|     29|      }
  332|       |
  333|     32|      if (outIo.write(chunkId.c_data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (333:11): [True: 0, False: 32]
  ------------------
  334|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  335|     32|      if (outIo.write(size_buff.data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (335:11): [True: 0, False: 32]
  ------------------
  336|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  337|     32|      if (outIo.write(payload.c_data(), payload.size()) != payload.size())
  ------------------
  |  Branch (337:11): [True: 0, False: 32]
  ------------------
  338|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  339|     32|      if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (339:11): [True: 6, False: 26]
  |  Branch (339:31): [True: 0, False: 6]
  ------------------
  340|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  341|       |
  342|     32|      if (has_icc) {
  ------------------
  |  Branch (342:11): [True: 1, False: 31]
  ------------------
  343|      1|        if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_ICCP), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (343:13): [True: 0, False: 1]
  ------------------
  344|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  345|      1|        ul2Data(data, static_cast<uint32_t>(iccProfile_.size()), littleEndian);
  346|      1|        if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (346:13): [True: 0, False: 1]
  ------------------
  347|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  348|      1|        if (outIo.write(iccProfile_.c_data(), iccProfile_.size()) != iccProfile_.size()) {
  ------------------
  |  Branch (348:13): [True: 0, False: 1]
  ------------------
  349|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  350|      0|        }
  351|      1|        has_icc = false;
  352|      1|      }
  353|  4.86k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (353:16): [True: 59, False: 4.80k]
  ------------------
  354|       |      // Skip it altogether handle it prior to here :)
  355|  4.80k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (355:16): [True: 90, False: 4.71k]
  ------------------
  356|       |      // Skip and add new data afterwards
  357|  4.71k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (357:16): [True: 25, False: 4.68k]
  ------------------
  358|       |      // Skip and add new data afterwards
  359|  4.68k|    } else {
  360|  4.68k|      if (outIo.write(chunkId.c_data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (360:11): [True: 0, False: 4.68k]
  ------------------
  361|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  362|  4.68k|      if (outIo.write(size_buff.data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (362:11): [True: 0, False: 4.68k]
  ------------------
  363|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  364|  4.68k|      if (outIo.write(payload.c_data(), payload.size()) != payload.size())
  ------------------
  |  Branch (364:11): [True: 0, False: 4.68k]
  ------------------
  365|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  366|  4.68k|    }
  367|       |
  368|       |    // Encoder required to pad odd sized data with a null byte
  369|  4.89k|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (369:9): [True: 244, False: 4.64k]
  |  Branch (369:29): [True: 0, False: 244]
  ------------------
  370|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  371|  4.89k|  }
  372|       |
  373|    115|  if (has_exif) {
  ------------------
  |  Branch (373:7): [True: 10, False: 105]
  ------------------
  374|     10|    if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_EXIF), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (374:9): [True: 0, False: 10]
  ------------------
  375|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  376|     10|    us2Data(data, static_cast<uint16_t>(blob.size()) + 8, bigEndian);
  377|     10|    ul2Data(data, static_cast<uint32_t>(blob.size()), littleEndian);
  378|     10|    if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (378:9): [True: 0, False: 10]
  ------------------
  379|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  380|     10|    if (outIo.write(blob.data(), blob.size()) != blob.size()) {
  ------------------
  |  Branch (380:9): [True: 0, False: 10]
  ------------------
  381|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  382|      0|    }
  383|     10|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (383:9): [True: 0, False: 10]
  |  Branch (383:29): [True: 0, False: 0]
  ------------------
  384|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  385|     10|  }
  386|       |
  387|    115|  if (has_xmp) {
  ------------------
  |  Branch (387:7): [True: 9, False: 106]
  ------------------
  388|      9|    if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_XMP), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (388:9): [True: 0, False: 9]
  ------------------
  389|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  390|      9|    ul2Data(data, static_cast<uint32_t>(xmpPacket().size()), littleEndian);
  391|      9|    if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (391:9): [True: 0, False: 9]
  ------------------
  392|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  393|      9|    if (outIo.write(reinterpret_cast<const byte*>(xmp.data()), xmp.size()) != xmp.size()) {
  ------------------
  |  Branch (393:9): [True: 0, False: 9]
  ------------------
  394|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  395|      0|    }
  396|      9|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (396:9): [True: 7, False: 2]
  |  Branch (396:29): [True: 0, False: 7]
  ------------------
  397|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  398|      9|  }
  399|       |
  400|       |  // Fix File Size Payload Data
  401|    115|  outIo.seek(0, BasicIo::beg);
  402|    115|  filesize = outIo.size() - 8;
  403|    115|  outIo.seek(4, BasicIo::beg);
  404|    115|  ul2Data(data, static_cast<uint32_t>(filesize), littleEndian);
  405|    115|  if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (405:7): [True: 0, False: 115]
  ------------------
  406|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  407|       |
  408|    115|}  // WebPImage::writeMetadata
_ZN5Exiv29WebPImage12readMetadataEv:
  475|    343|void WebPImage::readMetadata() {
  476|    343|  if (io_->open() != 0)
  ------------------
  |  Branch (476:7): [True: 0, False: 343]
  ------------------
  477|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  478|    343|  IoCloser closer(*io_);
  479|       |  // Ensure that this is the correct image type
  480|    343|  if (!isWebPType(*io_, true)) {
  ------------------
  |  Branch (480:7): [True: 0, False: 343]
  ------------------
  481|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  |  Branch (481:25): [True: 0, False: 0]
  ------------------
  482|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  483|      0|    throw Error(ErrorCode::kerNotAJpeg);
  484|      0|  }
  485|    343|  clearMetadata();
  486|       |
  487|    343|  byte data[12];
  488|    343|  DataBuf chunkId(5);
  489|    343|  chunkId.write_uint8(4, '\0');
  490|       |
  491|    343|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  492|       |
  493|    343|  const uint32_t filesize = Safe::add(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian), 8U);
  494|    343|  Internal::enforce(filesize <= io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  495|       |
  496|    343|  WebPImage::decodeChunks(filesize);
  497|       |
  498|    343|}  // WebPImage::readMetadata
_ZN5Exiv29WebPImage12decodeChunksEj:
  500|    306|void WebPImage::decodeChunks(uint32_t filesize) {
  501|    306|  DataBuf chunkId(5);
  502|    306|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  503|    306|  bool has_canvas_data = false;
  504|       |
  505|       |#ifdef EXIV2_DEBUG_MESSAGES
  506|       |  std::cout << "Reading metadata" << '\n';
  507|       |#endif
  508|       |
  509|    306|  chunkId.write_uint8(4, '\0');
  510|  8.58k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (510:10): [True: 8.44k, False: 141]
  |  Branch (510:25): [True: 8.27k, False: 165]
  ------------------
  511|  8.27k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  512|  8.27k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  513|       |
  514|  8.27k|    const uint32_t size = Exiv2::getULong(size_buff.data(), littleEndian);
  515|       |
  516|       |    // Check that `size` is within bounds.
  517|  8.27k|    Internal::enforce(io_->tell() <= filesize, Exiv2::ErrorCode::kerCorruptedMetadata);
  518|  8.27k|    Internal::enforce(size <= (filesize - io_->tell()), Exiv2::ErrorCode::kerCorruptedMetadata);
  519|       |
  520|  8.27k|    if (DataBuf payload(size); payload.empty()) {
  ------------------
  |  Branch (520:32): [True: 6.88k, False: 1.39k]
  ------------------
  521|  6.88k|      io_->seek(size, BasicIo::cur);
  522|  6.88k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_canvas_data) {
  ------------------
  |  Branch (522:16): [True: 40, False: 1.35k]
  |  Branch (522:66): [True: 30, False: 10]
  ------------------
  523|     30|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  524|       |
  525|     30|      has_canvas_data = true;
  526|     30|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  527|       |
  528|     30|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  529|       |
  530|       |      // Fetch width
  531|     30|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  532|     30|      size_buf.back() = 0;
  533|     30|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  534|       |
  535|       |      // Fetch height
  536|     30|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  537|     30|      size_buf.back() = 0;
  538|     30|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  539|  1.36k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_canvas_data) {
  ------------------
  |  Branch (539:16): [True: 38, False: 1.32k]
  |  Branch (539:65): [True: 14, False: 24]
  ------------------
  540|     14|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  541|       |
  542|     14|      has_canvas_data = true;
  543|     14|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  544|     14|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  545|       |
  546|       |      // Fetch width""
  547|     14|      std::copy_n(payload.begin() + 6, 2, size_buf.begin());
  548|     14|      size_buf[2] = 0;
  549|     14|      size_buf[3] = 0;
  550|     14|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  551|       |
  552|       |      // Fetch height
  553|     14|      std::copy_n(payload.begin() + 8, 2, size_buf.begin());
  554|     14|      size_buf[2] = 0;
  555|     14|      size_buf[3] = 0;
  556|     14|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) & 0x3fff;
  557|  1.35k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_canvas_data) {
  ------------------
  |  Branch (557:16): [True: 97, False: 1.25k]
  |  Branch (557:66): [True: 47, False: 50]
  ------------------
  558|     47|      Internal::enforce(size >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  559|       |
  560|     47|      has_canvas_data = true;
  561|     47|      std::array<byte, 2> size_buf_w;
  562|     47|      std::array<byte, 3> size_buf_h;
  563|       |
  564|     47|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  565|       |
  566|       |      // Fetch width
  567|     47|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  568|     47|      size_buf_w.back() &= 0x3F;
  569|     47|      pixelWidth_ = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  570|       |
  571|       |      // Fetch height
  572|     47|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  573|     47|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  574|     47|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  575|     47|      pixelHeight_ = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  576|  1.30k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_canvas_data) {
  ------------------
  |  Branch (576:16): [True: 124, False: 1.18k]
  |  Branch (576:66): [True: 13, False: 111]
  ------------------
  577|     13|      Internal::enforce(size >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  578|       |
  579|     13|      has_canvas_data = true;
  580|     13|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  581|       |
  582|     13|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  583|       |
  584|       |      // Fetch width
  585|     13|      std::copy_n(payload.begin() + 6, 3, size_buf.begin());
  586|     13|      size_buf.back() = 0;
  587|     13|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  588|       |
  589|       |      // Fetch height
  590|     13|      std::copy_n(payload.begin() + 9, 3, size_buf.begin());
  591|     13|      size_buf.back() = 0;
  592|     13|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  593|  1.29k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (593:16): [True: 6, False: 1.28k]
  ------------------
  594|      6|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  595|      6|      this->setIccProfile(std::move(payload));
  596|  1.28k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (596:16): [True: 210, False: 1.07k]
  ------------------
  597|    210|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  598|       |
  599|    210|      std::array<byte, 2> size_buff2;
  600|       |      // 4 meaningful bytes + 2 padding bytes
  601|    210|      auto exifLongHeader = std::array<byte, 6>{0xFF, 0x01, 0xFF, 0xE1, 0x00, 0x00};
  602|    210|      auto exifShortHeader = std::array<byte, 6>{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  603|    210|      const byte exifTiffLEHeader[] = {0x49, 0x49, 0x2A};        // "MM*"
  604|    210|      const byte exifTiffBEHeader[] = {0x4D, 0x4D, 0x00, 0x2A};  // "II\0*"
  605|    210|      size_t offset = 0;
  606|    210|      bool s_header = false;
  607|    210|      bool le_header = false;
  608|    210|      bool be_header = false;
  609|    210|      size_t pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 4);
  610|       |
  611|    210|      if (pos == std::string::npos) {
  ------------------
  |  Branch (611:11): [True: 203, False: 7]
  ------------------
  612|    203|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 6);
  613|    203|        if (pos != std::string::npos) {
  ------------------
  |  Branch (613:13): [True: 0, False: 203]
  ------------------
  614|      0|          s_header = true;
  615|      0|        }
  616|    203|      }
  617|    210|      if (pos == std::string::npos) {
  ------------------
  |  Branch (617:11): [True: 203, False: 7]
  ------------------
  618|    203|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffLEHeader, 3);
  619|    203|        if (pos != std::string::npos) {
  ------------------
  |  Branch (619:13): [True: 27, False: 176]
  ------------------
  620|     27|          le_header = true;
  621|     27|        }
  622|    203|      }
  623|    210|      if (pos == std::string::npos) {
  ------------------
  |  Branch (623:11): [True: 176, False: 34]
  ------------------
  624|    176|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffBEHeader, 4);
  625|    176|        if (pos != std::string::npos) {
  ------------------
  |  Branch (625:13): [True: 69, False: 107]
  ------------------
  626|     69|          be_header = true;
  627|     69|        }
  628|    176|      }
  629|       |
  630|    210|      if (s_header) {
  ------------------
  |  Branch (630:11): [True: 0, False: 210]
  ------------------
  631|      0|        offset += 6;
  632|      0|      }
  633|    210|      if (be_header || le_header) {
  ------------------
  |  Branch (633:11): [True: 69, False: 141]
  |  Branch (633:24): [True: 27, False: 114]
  ------------------
  634|     96|        offset += 12;
  635|     96|      }
  636|       |
  637|    210|      const size_t sizePayload = Safe::add(payload.size(), offset);
  638|    210|      DataBuf rawExifData(sizePayload);
  639|       |
  640|    210|      if (s_header) {
  ------------------
  |  Branch (640:11): [True: 0, False: 210]
  ------------------
  641|      0|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  642|      0|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  643|      0|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  644|      0|      }
  645|       |
  646|    210|      if (be_header || le_header) {
  ------------------
  |  Branch (646:11): [True: 69, False: 141]
  |  Branch (646:24): [True: 27, False: 114]
  ------------------
  647|     96|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  648|     96|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  649|     96|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  650|     96|        std::copy(exifShortHeader.begin(), exifShortHeader.end(), rawExifData.begin() + 6);
  651|     96|      }
  652|       |
  653|    210|      std::copy(payload.begin(), payload.end(), rawExifData.begin() + offset);
  654|       |
  655|       |#ifdef EXIV2_DEBUG_MESSAGES
  656|       |      std::cout << "Display Hex Dump [size:" << sizePayload << "]" << '\n';
  657|       |      std::cout << binaryToHex(rawExifData.c_data(), sizePayload);
  658|       |#endif
  659|       |
  660|    210|      if (pos != std::string::npos) {
  ------------------
  |  Branch (660:11): [True: 103, False: 107]
  ------------------
  661|    103|        XmpData xmpData;
  662|    103|        ByteOrder bo = ExifParser::decode(exifData_, payload.c_data(pos), payload.size() - pos);
  663|    103|        setByteOrder(bo);
  664|    107|      } else {
  665|    107|#ifndef SUPPRESS_WARNINGS
  666|    107|        EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    107|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 107]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    107|  LogMsg(LogMsg::warn).os()
  ------------------
  667|    107|#endif
  668|    107|        exifData_.clear();
  669|    107|      }
  670|  1.07k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (670:16): [True: 44, False: 1.03k]
  ------------------
  671|     44|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  672|     44|      xmpPacket_.assign(payload.c_str(), payload.size());
  673|     44|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (673:11): [True: 44, False: 0]
  |  Branch (673:34): [True: 42, False: 2]
  ------------------
  674|     42|#ifndef SUPPRESS_WARNINGS
  675|     42|        EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|     42|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 42]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     42|  LogMsg(LogMsg::warn).os()
  ------------------
  676|     42|#endif
  677|     42|      } else {
  678|       |#ifdef EXIV2_DEBUG_MESSAGES
  679|       |        std::cout << "Display Hex Dump [size:" << payload.size() << "]" << '\n';
  680|       |        std::cout << binaryToHex(payload.c_data(), payload.size());
  681|       |#endif
  682|      2|      }
  683|  1.03k|    } else {
  684|  1.03k|      io_->seek(size, BasicIo::cur);
  685|  1.03k|    }
  686|       |
  687|  8.27k|    if (io_->tell() % 2)
  ------------------
  |  Branch (687:9): [True: 536, False: 7.74k]
  ------------------
  688|    536|      io_->seek(+1, BasicIo::cur);
  689|  8.27k|  }
  690|    306|}
_ZN5Exiv215newWebPInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  694|    343|Image::UniquePtr newWebPInstance(BasicIo::UniquePtr io, bool /*create*/) {
  695|    343|  auto image = std::make_unique<WebPImage>(std::move(io));
  696|    343|  if (!image->good()) {
  ------------------
  |  Branch (696:7): [True: 0, False: 343]
  ------------------
  697|      0|    return nullptr;
  698|      0|  }
  699|    343|  return image;
  700|    343|}
_ZN5Exiv210isWebPTypeERNS_7BasicIoEb:
  702|  25.8k|bool isWebPType(BasicIo& iIo, bool /*advance*/) {
  703|  25.8k|  if (iIo.size() < 12) {
  ------------------
  |  Branch (703:7): [True: 127, False: 25.7k]
  ------------------
  704|    127|    return false;
  705|    127|  }
  706|  25.7k|  const int32_t len = 4;
  707|  25.7k|  constexpr std::array<byte, len> RiffImageId{'R', 'I', 'F', 'F'};
  708|  25.7k|  constexpr std::array<byte, len> WebPImageId{'W', 'E', 'B', 'P'};
  709|  25.7k|  std::array<byte, len> webp;
  710|  25.7k|  std::array<byte, len> data;
  711|  25.7k|  std::array<byte, len> riff;
  712|  25.7k|  iIo.readOrThrow(riff.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  713|  25.7k|  iIo.readOrThrow(data.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  714|  25.7k|  iIo.readOrThrow(webp.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  715|  25.7k|  bool matched_riff = riff == RiffImageId;
  716|  25.7k|  bool matched_webp = webp == WebPImageId;
  717|  25.7k|  iIo.seek(-12, BasicIo::cur);
  718|  25.7k|  return matched_riff && matched_webp;
  ------------------
  |  Branch (718:10): [True: 1.66k, False: 24.0k]
  |  Branch (718:26): [True: 1.02k, False: 636]
  ------------------
  719|  25.8k|}
_ZN5Exiv29WebPImage13equalsWebPTagERKNS_7DataBufEPKc:
  728|  72.0k|bool WebPImage::equalsWebPTag(const Exiv2::DataBuf& buf, const char* str) {
  729|  81.4k|  for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (729:19): [True: 80.2k, False: 1.19k]
  ------------------
  730|  80.2k|    if (toupper(buf.read_uint8(i)) != str[i])
  ------------------
  |  Branch (730:9): [True: 70.8k, False: 9.45k]
  ------------------
  731|  70.8k|      return false;
  732|  1.19k|  return true;
  733|  72.0k|}
_ZNK5Exiv29WebPImage11inject_VP8XERNS_7BasicIoEbbbbjj:
  743|     82|                            uint32_t height) const {
  744|     82|  const byte size[4] = {0x0A, 0x00, 0x00, 0x00};
  745|     82|  byte data[10] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  746|     82|  iIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_VP8X), WEBP_TAG_SIZE);
  747|     82|  iIo.write(size, WEBP_TAG_SIZE);
  748|       |
  749|     82|  if (has_alpha) {
  ------------------
  |  Branch (749:7): [True: 10, False: 72]
  ------------------
  750|     10|    data[0] |= WEBP_VP8X_ALPHA_BIT;
  751|     10|  }
  752|       |
  753|     82|  if (has_icc) {
  ------------------
  |  Branch (753:7): [True: 2, False: 80]
  ------------------
  754|      2|    data[0] |= WEBP_VP8X_ICC_BIT;
  755|      2|  }
  756|       |
  757|     82|  if (has_xmp) {
  ------------------
  |  Branch (757:7): [True: 11, False: 71]
  ------------------
  758|     11|    data[0] |= WEBP_VP8X_XMP_BIT;
  759|     11|  }
  760|       |
  761|     82|  if (has_exif) {
  ------------------
  |  Branch (761:7): [True: 21, False: 61]
  ------------------
  762|     21|    data[0] |= WEBP_VP8X_EXIF_BIT;
  763|     21|  }
  764|       |
  765|       |  /* set width - stored in 24bits*/
  766|     82|  Internal::enforce(width > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  767|     82|  uint32_t w = width - 1;
  768|     82|  data[4] = w & 0xFF;
  769|     82|  data[5] = (w >> 8) & 0xFF;
  770|     82|  data[6] = (w >> 16) & 0xFF;
  771|       |
  772|       |  /* set height - stored in 24bits */
  773|     82|  Internal::enforce(width > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  774|     82|  uint32_t h = height - 1;
  775|     82|  data[7] = h & 0xFF;
  776|     82|  data[8] = (h >> 8) & 0xFF;
  777|     82|  data[9] = (h >> 16) & 0xFF;
  778|       |
  779|     82|  iIo.write(data, 10);
  780|       |
  781|       |  /* Handle inject an icc profile right after VP8X chunk */
  782|     82|  if (has_icc) {
  ------------------
  |  Branch (782:7): [True: 0, False: 82]
  ------------------
  783|      0|    byte size_buff[WEBP_TAG_SIZE];
  784|      0|    ul2Data(size_buff, static_cast<uint32_t>(iccProfile_.size()), littleEndian);
  785|      0|    if (iIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_ICCP), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (785:9): [True: 0, False: 0]
  ------------------
  786|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  787|      0|    if (iIo.write(size_buff, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (787:9): [True: 0, False: 0]
  ------------------
  788|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  789|      0|    if (iIo.write(iccProfile_.c_data(), iccProfile_.size()) != iccProfile_.size())
  ------------------
  |  Branch (789:9): [True: 0, False: 0]
  ------------------
  790|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  791|      0|    if (iIo.tell() % 2 && iIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (791:9): [True: 0, False: 0]
  |  Branch (791:27): [True: 0, False: 0]
  ------------------
  792|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  793|      0|  }
  794|     82|}
_ZN5Exiv29WebPImage15getHeaderOffsetEPKhmS2_m:
  796|    792|size_t WebPImage::getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size) {
  797|    792|  size_t pos = std::string::npos;  // error value
  798|    792|  if (data_size < header_size) {
  ------------------
  |  Branch (798:7): [True: 246, False: 546]
  ------------------
  799|    246|    return pos;
  800|    246|  }
  801|   378k|  for (size_t i = 0; i < data_size - header_size; i++) {
  ------------------
  |  Branch (801:22): [True: 377k, False: 443]
  ------------------
  802|   377k|    if (memcmp(header, &data[i], header_size) == 0) {
  ------------------
  |  Branch (802:9): [True: 103, False: 377k]
  ------------------
  803|    103|      pos = i;
  804|    103|      break;
  805|    103|    }
  806|   377k|  }
  807|    546|  return pos;
  808|    792|}

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   151k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   151k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 101k, False: 50.0k]
  ------------------
  253|   101k|    value_ = pValue->clone();
  254|   151k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   181k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   181k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 181k, False: 0]
  ------------------
  258|   181k|    key_ = rhs.key_->clone();  // deep copy
  259|   181k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 181k, False: 0]
  ------------------
  260|   181k|    value_ = rhs.value_->clone();  // deep copy
  261|   181k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  263|  2.06k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  264|  2.06k|  if (this == &rhs)
  ------------------
  |  Branch (264:7): [True: 0, False: 2.06k]
  ------------------
  265|      0|    return *this;
  266|  2.06k|  key_.reset();
  267|  2.06k|  if (rhs.key_)
  ------------------
  |  Branch (267:7): [True: 2.06k, False: 0]
  ------------------
  268|  2.06k|    key_ = rhs.key_->clone();  // deep copy
  269|  2.06k|  value_.reset();
  270|  2.06k|  if (rhs.value_)
  ------------------
  |  Branch (270:7): [True: 2.06k, False: 0]
  ------------------
  271|  2.06k|    value_ = rhs.value_->clone();  // deep copy
  272|  2.06k|  return *this;
  273|  2.06k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   151k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   151k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   181k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   181k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  281|  2.06k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  282|  2.06k|  if (this == &rhs)
  ------------------
  |  Branch (282:7): [True: 0, False: 2.06k]
  ------------------
  283|      0|    return *this;
  284|  2.06k|  *p_ = *rhs.p_;
  285|  2.06k|  return *this;
  286|  2.06k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   333k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  15.5M|std::string Xmpdatum::key() const {
  291|  15.5M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 15.5M, False: 0]
  ------------------
  292|  15.5M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  298|  91.2k|std::string Xmpdatum::groupName() const {
  299|  91.2k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (299:10): [True: 91.2k, False: 0]
  ------------------
  300|  91.2k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  302|   249k|std::string Xmpdatum::tagName() const {
  303|   249k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (303:10): [True: 249k, False: 0]
  ------------------
  304|   249k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|   451k|TypeId Xmpdatum::typeId() const {
  319|   451k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 451k, False: 0]
  ------------------
  320|   451k|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|   149k|size_t Xmpdatum::count() const {
  331|   149k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 149k, False: 0]
  ------------------
  332|   149k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  338|  3.44k|std::string Xmpdatum::toString() const {
  339|  3.44k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (339:10): [True: 3.44k, False: 0]
  ------------------
  340|  3.44k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  342|   325k|std::string Xmpdatum::toString(size_t n) const {
  343|   325k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 325k, False: 0]
  ------------------
  344|   325k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|   257k|const Value& Xmpdatum::value() const {
  363|   257k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 257k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|   257k|  return *p_->value_;
  366|   257k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  376|  22.1k|void Xmpdatum::setValue(const Value* pValue) {
  377|  22.1k|  p_->value_.reset();
  378|  22.1k|  if (pValue)
  ------------------
  |  Branch (378:7): [True: 22.1k, False: 0]
  ------------------
  379|  22.1k|    p_->value_ = pValue->clone();
  380|  22.1k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   836k|int Xmpdatum::setValue(const std::string& value) {
  383|   836k|  XmpProperties::XmpLock lock;
  384|   836k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 38.9k, False: 797k]
  ------------------
  385|  38.9k|    TypeId type = xmpText;
  386|  38.9k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 38.9k, False: 0]
  ------------------
  387|  38.9k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  38.9k|    }
  389|  38.9k|    p_->value_ = Value::create(type);
  390|  38.9k|  }
  391|   836k|  return p_->value_->read(value);
  392|   836k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   861k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   861k|  XmpProperties::XmpLock lock;
  396|   861k|  XmpKey xmpKey(key, lock);
  397|   861k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   861k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 50.0k, False: 811k]
  ------------------
  399|  50.0k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  50.0k|  }
  401|   811k|  return *pos;
  402|   861k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  3.22k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  3.22k|  XmpProperties::XmpLock lock;
  406|  3.22k|  return addUnlocked(key, value, lock);
  407|  3.22k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   101k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   101k|  xmpMetadata_.emplace_back(key, value);
  411|   101k|  return 0;
  412|   101k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  9.62k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  9.62k|  XmpProperties::XmpLock lock;
  426|  9.62k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  9.62k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   247k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   247k|  XmpProperties::XmpLock lock;
  431|   247k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   247k|}
_ZN5Exiv27XmpData5clearEv:
  434|  33.1k|void XmpData::clear() {
  435|  33.1k|  XmpProperties::XmpLock lock;
  436|  33.1k|  clearUnlocked(lock);
  437|  33.1k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  41.2k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  41.2k|  xmpMetadata_.clear();
  441|  41.2k|}
_ZNK5Exiv27XmpData5beginEv:
  452|  3.93k|XmpData::const_iterator XmpData::begin() const {
  453|  3.93k|  return xmpMetadata_.begin();
  454|  3.93k|}
_ZNK5Exiv27XmpData3endEv:
  456|  13.5k|XmpData::const_iterator XmpData::end() const {
  457|  13.5k|  return xmpMetadata_.end();
  458|  13.5k|}
_ZNK5Exiv27XmpData5emptyEv:
  460|  2.69k|bool XmpData::empty() const {
  461|  2.69k|  XmpProperties::XmpLock lock;
  462|  2.69k|  return emptyUnlocked(lock);
  463|  2.69k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  465|  33.4k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  466|  33.4k|  return xmpMetadata_.empty();
  467|  33.4k|}
_ZN5Exiv27XmpData5beginEv:
  478|  5.70k|XmpData::iterator XmpData::begin() {
  479|  5.70k|  return xmpMetadata_.begin();
  480|  5.70k|}
_ZN5Exiv27XmpData3endEv:
  482|   253k|XmpData::iterator XmpData::end() {
  483|   253k|  return xmpMetadata_.end();
  484|   253k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  486|    867|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  487|    867|  XmpProperties::XmpLock lock;
  488|    867|  return xmpMetadata_.erase(pos);
  489|    867|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  535|   122k|void xmpToolkitEnsureInitialized() {
  536|   122k|  static XmpToolkitLifetimeManager instance;
  537|   122k|  (void)instance;
  538|   122k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  540|  83.5k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  541|  83.5k|  xmpToolkitEnsureInitialized();
  542|  83.5k|  try {
  543|  83.5k|    std::string existingPrefix;
  544|  83.5k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (544:9): [True: 82.7k, False: 772]
  ------------------
  545|  82.7k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (545:11): [True: 82.7k, False: 0]
  |  Branch (545:38): [True: 82.7k, False: 0]
  ------------------
  546|  82.7k|        existingPrefix.pop_back();
  547|  82.7k|      }
  548|  82.7k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (548:11): [True: 82.4k, False: 322]
  ------------------
  549|       |        // Already registered correctly, skip overhead
  550|  82.4k|        return;
  551|  82.4k|      }
  552|  82.7k|    }
  553|       |
  554|  1.09k|    SXMPMeta::DeleteNamespace(ns.c_str());
  555|       |#ifdef EXV_ADOBE_XMPSDK
  556|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  557|       |#else
  558|  1.09k|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  559|  1.09k|#endif
  560|  1.09k|  } catch (const XMP_Error& /* e */) {
  561|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  562|      0|  }
  563|  83.5k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  660|  9.38k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  661|  9.38k|  try {
  662|  9.38k|    xmpData.setPacket(xmpPacket);
  663|  9.38k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (663:9): [True: 1.22k, False: 8.15k]
  ------------------
  664|  1.22k|      xmpData.clear();
  665|  1.22k|      return 0;
  666|  1.22k|    }
  667|       |
  668|       |    // Acquire Giant Lock
  669|  8.15k|    XmpProperties::XmpLock lock;
  670|  8.15k|    try {
  671|  8.15k|      xmpToolkitEnsureInitialized();
  672|  8.15k|    } catch (const Error&) {
  673|      0|#ifndef SUPPRESS_WARNINGS
  674|      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()
  ------------------
  675|      0|#endif
  676|      0|      return 2;
  677|      0|    }
  678|       |
  679|  8.15k|    xmpData.clearUnlocked(lock);
  680|       |
  681|       |    // Make sure the unterminated substring is used
  682|  8.15k|    size_t len = xmpPacket.size();
  683|  1.02M|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (683:12): [True: 1.02M, False: 218]
  |  Branch (683:23): [True: 1.01M, False: 7.93k]
  ------------------
  684|  1.01M|      --len;
  685|       |
  686|  8.15k|    XMLValidator::check(xmpPacket.data(), len);
  687|  8.15k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  688|  8.15k|    SXMPIterator iter(meta);
  689|  8.15k|    std::string schemaNs;
  690|  8.15k|    std::string propPath;
  691|  8.15k|    std::string propValue;
  692|  8.15k|    XMP_OptionBits opt = 0;
  693|   118k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (693:12): [True: 110k, False: 8.15k]
  ------------------
  694|   110k|      printNode(schemaNs, propPath, propValue, opt);
  695|   110k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (695:11): [True: 0, False: 110k]
  ------------------
  696|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  697|      0|      }
  698|   110k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (698:11): [True: 11.9k, False: 98.3k]
  ------------------
  699|       |        // Register unknown namespaces with Exiv2
  700|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  701|  11.9k|        if (XmpProperties::prefixUnlocked(schemaNs, lock).empty()) {
  ------------------
  |  Branch (701:13): [True: 5.86k, False: 6.08k]
  ------------------
  702|  5.86k|          std::string prefix;
  703|  5.86k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (703:15): [True: 0, False: 5.86k]
  ------------------
  704|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  705|  5.86k|          prefix.pop_back();
  706|  5.86k|          XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  707|  5.86k|        }
  708|  11.9k|        continue;
  709|  11.9k|      }
  710|  98.3k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  711|  98.3k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (711:11): [True: 977, False: 97.3k]
  ------------------
  712|       |        // Read Lang Alt property
  713|    977|        auto val = std::make_unique<LangAltValue>();
  714|    977|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  715|  7.10k|        while (count-- > 0) {
  ------------------
  |  Branch (715:16): [True: 6.13k, False: 977]
  ------------------
  716|       |          // Get the text
  717|  6.13k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  718|  6.13k|          printNode(schemaNs, propPath, propValue, opt);
  719|  6.13k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (719:15): [True: 0, False: 6.13k]
  |  Branch (719:28): [True: 0, False: 6.13k]
  |  Branch (719:54): [True: 0, False: 6.13k]
  ------------------
  720|      0|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  721|      0|          }
  722|  6.13k|          std::string text = propValue;
  723|       |          // Get the language qualifier
  724|  6.13k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  725|  6.13k|          printNode(schemaNs, propPath, propValue, opt);
  726|  6.13k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (726:15): [True: 0, False: 6.13k]
  |  Branch (726:15): [True: 0, False: 6.13k]
  |  Branch (726:28): [True: 0, False: 6.13k]
  |  Branch (726:54): [True: 0, False: 6.13k]
  ------------------
  727|  6.13k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (727:15): [True: 0, False: 6.13k]
  ------------------
  728|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  729|      0|          }
  730|  6.13k|          val->value_[propValue] = std::move(text);
  731|  6.13k|        }
  732|    977|        xmpData.addUnlocked(*key, val.get(), lock);
  733|    977|        continue;
  734|    977|      }
  735|  97.3k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (735:11): [True: 2.66k, False: 94.6k]
  |  Branch (735:35): [True: 2.66k, False: 0]
  |  Branch (735:66): [True: 2.66k, False: 0]
  ------------------
  736|       |        // Check if all elements are simple
  737|  2.66k|        bool simpleArray = true;
  738|  2.66k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  739|  2.66k|        std::string aSchemaNs;
  740|  2.66k|        std::string aPropPath;
  741|  2.66k|        std::string aPropValue;
  742|  2.66k|        XMP_OptionBits aOpt = 0;
  743|  65.0k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (743:16): [True: 62.6k, False: 2.31k]
  ------------------
  744|  62.6k|          if (propPath == aPropPath)
  ------------------
  |  Branch (744:15): [True: 2.66k, False: 60.0k]
  ------------------
  745|  2.66k|            continue;
  746|  60.0k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (746:15): [True: 210, False: 59.8k]
  |  Branch (746:42): [True: 143, False: 59.6k]
  |  Branch (746:73): [True: 0, False: 59.6k]
  ------------------
  747|  60.0k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (747:15): [True: 0, False: 59.6k]
  |  Branch (747:41): [True: 0, False: 59.6k]
  ------------------
  748|    353|            simpleArray = false;
  749|    353|            break;
  750|    353|          }
  751|  60.0k|        }
  752|  2.66k|        if (simpleArray) {
  ------------------
  |  Branch (752:13): [True: 2.31k, False: 353]
  ------------------
  753|       |          // Read the array into an XmpArrayValue
  754|  2.31k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  755|  2.31k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  756|  60.4k|          while (count-- > 0) {
  ------------------
  |  Branch (756:18): [True: 58.1k, False: 2.31k]
  ------------------
  757|  58.1k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  758|  58.1k|            printNode(schemaNs, propPath, propValue, opt);
  759|  58.1k|            val->read(propValue);
  760|  58.1k|          }
  761|  2.31k|          xmpData.addUnlocked(*key, val.get(), lock);
  762|  2.31k|          continue;
  763|  2.31k|        }
  764|  2.66k|      }
  765|       |
  766|  95.0k|      auto val = std::make_unique<XmpTextValue>();
  767|  95.0k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (767:11): [True: 7.51k, False: 87.5k]
  |  Branch (767:36): [True: 353, False: 87.1k]
  ------------------
  768|       |        // Create a metadatum with only XMP options
  769|  7.86k|        val->setXmpArrayType(xmpArrayType(opt));
  770|  7.86k|        val->setXmpStruct(xmpStruct(opt));
  771|  7.86k|        xmpData.addUnlocked(*key, val.get(), lock);
  772|  7.86k|        continue;
  773|  7.86k|      }
  774|  87.1k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (774:11): [True: 87.1k, False: 0]
  |  Branch (774:36): [True: 0, False: 0]
  ------------------
  775|  87.1k|        val->read(propValue);
  776|  87.1k|        xmpData.addUnlocked(*key, val.get(), lock);
  777|  87.1k|        continue;
  778|  87.1k|      }
  779|       |      // Don't let any node go by unnoticed
  780|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  781|  87.1k|    }  // iterate through all XMP nodes
  782|       |
  783|  8.15k|    return 0;
  784|  8.15k|  }
  785|  9.38k|#ifndef SUPPRESS_WARNINGS
  786|  9.38k|  catch (const Error& e) {
  787|     53|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (787:9): [True: 0, False: 53]
  ------------------
  788|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  789|      0|    }
  790|     53|    throw;
  791|  3.46k|  } catch (const XMP_Error& e) {
  792|  3.46k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  3.46k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.46k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.46k|  LogMsg(LogMsg::error).os()
  ------------------
  793|  3.46k|    xmpData.clear();
  794|  3.46k|    return 3;
  795|  3.46k|  }
  796|       |#else
  797|       |  catch (const XMP_Error&) {
  798|       |    xmpData.clear();
  799|       |    return 3;
  800|       |  }
  801|       |#endif  // SUPPRESS_WARNINGS
  802|  9.38k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  816|  30.7k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  817|  30.7k|  try {
  818|       |    // Acquire Giant Lock
  819|  30.7k|    XmpProperties::XmpLock lock;
  820|  30.7k|    try {
  821|  30.7k|      xmpToolkitEnsureInitialized();
  822|  30.7k|    } catch (const Error&) {
  823|      0|#ifndef SUPPRESS_WARNINGS
  824|      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()
  ------------------
  825|      0|#endif
  826|      0|      return 2;
  827|      0|    }
  828|       |
  829|  30.7k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (829:9): [True: 26.7k, False: 3.93k]
  ------------------
  830|  26.7k|      xmpPacket.clear();
  831|  26.7k|      return 0;
  832|  26.7k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  833|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  834|  83.5k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (834:33): [True: 83.5k, False: 3.93k]
  ------------------
  835|       |#ifdef EXIV2_DEBUG_MESSAGES
  836|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  837|       |#endif
  838|       |      // registerNsImpl is safe since we hold the lock
  839|  83.5k|      registerNsImpl(xmp, uri.prefix_);
  840|  83.5k|    }
  841|       |
  842|  3.93k|    SXMPMeta meta;
  843|  91.2k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (843:26): [True: 91.2k, False: 3.93k]
  ------------------
  844|       |      // Must use Unlocked version of ns() because we hold the lock!
  845|  91.2k|      const std::string ns = XmpProperties::nsUnlocked(xmp.groupName(), lock);
  846|  91.2k|      XMP_OptionBits options = 0;
  847|       |
  848|  91.2k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (848:11): [True: 877, False: 90.3k]
  ------------------
  849|       |        // Encode Lang Alt property
  850|    877|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  851|    877|        if (!la)
  ------------------
  |  Branch (851:13): [True: 0, False: 877]
  ------------------
  852|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  853|       |
  854|    877|        int idx = 1;
  855|  3.49k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (855:40): [True: 3.49k, False: 877]
  ------------------
  856|  3.49k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (856:15): [True: 3.45k, False: 39]
  ------------------
  857|  3.45k|            printNode(ns, xmp.tagName(), specs, 0);
  858|  3.45k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  859|  3.45k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  860|  3.45k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  861|  3.45k|          }
  862|  3.49k|        }
  863|    877|        continue;
  864|    877|      }
  865|       |
  866|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  867|  90.3k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  868|  90.3k|      if (!val)
  ------------------
  |  Branch (868:11): [True: 0, False: 90.3k]
  ------------------
  869|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  870|  90.3k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  871|  90.3k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (871:11): [True: 231, False: 90.1k]
  |  Branch (871:37): [True: 1.38k, False: 88.7k]
  |  Branch (871:63): [True: 276, False: 88.4k]
  ------------------
  872|  1.88k|        printNode(ns, xmp.tagName(), "", options);
  873|  1.88k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  874|  60.0k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (874:30): [True: 58.1k, False: 1.88k]
  ------------------
  875|  58.1k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  876|  58.1k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  877|  58.1k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  878|  58.1k|        }
  879|  1.88k|        continue;
  880|  1.88k|      }
  881|  88.4k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (881:11): [True: 88.4k, False: 0]
  ------------------
  882|  88.4k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  883|  88.4k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (883:13): [True: 3.34k, False: 85.1k]
  |  Branch (883:33): [True: 6.41k, False: 78.7k]
  |  Branch (883:72): [True: 267, False: 78.4k]
  ------------------
  884|  10.0k|          printNode(ns, xmp.tagName(), "", options);
  885|  10.0k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  886|  78.4k|        } else {
  887|  78.4k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  888|  78.4k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  889|  78.4k|        }
  890|  88.4k|        continue;
  891|  88.4k|      }
  892|       |      // Don't let any Xmpdatum go by unnoticed
  893|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  894|  88.4k|    }
  895|  3.93k|    std::string tmpPacket;
  896|  3.93k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  897|  3.93k|                           padding);  // throws
  898|  3.93k|    xmpPacket = std::move(tmpPacket);
  899|       |
  900|  3.93k|    return 0;
  901|  3.93k|  }
  902|  30.7k|#ifndef SUPPRESS_WARNINGS
  903|  30.7k|  catch (const Error& /* e */) {
  904|      0|    throw;
  905|    110|  } catch (const XMP_Error& e) {
  906|    110|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    110|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 110]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    110|  LogMsg(LogMsg::error).os()
  ------------------
  907|    110|    return 3;
  908|    110|  }
  909|       |#else
  910|       |  catch (const XMP_Error&) {
  911|       |    return 3;
  912|       |  }
  913|       |#endif  // SUPPRESS_WARNINGS
  914|  30.7k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1076|  98.3k|                                                      const XmpProperties::XmpLock& lock) {
 1077|  98.3k|  std::string property;
 1078|  98.3k|  std::string::size_type idx = propPath.find(':');
 1079|  98.3k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1079:7): [True: 0, False: 98.3k]
  ------------------
 1080|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1081|      0|  }
 1082|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1083|  98.3k|  property = propPath.substr(idx + 1);
 1084|  98.3k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1085|  98.3k|  if (prefix.empty()) {
  ------------------
  |  Branch (1085:7): [True: 0, False: 98.3k]
  ------------------
 1086|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1087|      0|  }
 1088|  98.3k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1089|  98.3k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  15.5M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  15.5M|    return key_ == xmpdatum.key();
  203|  15.5M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|  1.11M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|  1.11M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  8.15k|  static void check(const char* buf, size_t buflen) {
   67|  8.15k|    XMLValidator validator;
   68|  8.15k|    validator.check_internal(buf, buflen);
   69|  8.15k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  8.15k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  8.15k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 8.15k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  8.15k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  8.15k|  void check_internal(const char* buf, size_t buflen) {
  103|  8.15k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 8.15k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  8.15k|    XML_SetUserData(parser_, this);
  108|  8.15k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  8.15k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  8.15k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  8.15k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 2.18k, False: 5.97k]
  ------------------
  113|  2.18k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  2.18k|    }
  115|       |
  116|  8.15k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 2.18k, False: 5.97k]
  ------------------
  117|  2.18k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  2.18k|    }
  119|  8.15k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   146k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   146k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   146k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   146k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   146k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 504, False: 146k]
  ------------------
  123|    504|      setError("Too deeply nested");
  124|    504|    }
  125|   146k|    ++element_depth_;
  126|   146k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   131k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   131k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   131k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   131k|  void endElement(const XML_Char*) noexcept {
  129|   131k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 131k, False: 0]
  ------------------
  130|   131k|      --element_depth_;
  131|   131k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   131k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  50.2k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  50.2k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  50.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  50.2k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  50.2k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 425, False: 49.8k]
  ------------------
  138|    425|      setError("Too deeply nested");
  139|    425|    }
  140|  50.2k|    ++namespace_depth_;
  141|  50.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  39.4k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  39.4k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  39.4k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  39.4k|  void endNamespace(const XML_Char*) noexcept {
  144|  39.4k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 39.4k, False: 0]
  ------------------
  145|  39.4k|      --namespace_depth_;
  146|  39.4k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  39.4k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  181|     37|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  182|     37|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  183|     37|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  151|     37|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  152|       |    // DOCTYPE is used for XXE attacks.
  153|     37|    setError("DOCTYPE not supported");
  154|     37|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  3.14k|  void setError(const char* msg) {
   88|  3.14k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  3.14k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  3.14k|#ifndef SUPPRESS_WARNINGS
   91|  3.14k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  3.14k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 3.14k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  3.14k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  3.14k|#endif
   93|       |    // If this is the first error, then save it.
   94|  3.14k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 2.18k, False: 966]
  ------------------
   95|  2.18k|      haserror_ = true;
   96|  2.18k|      errmsg_ = msg;
   97|  2.18k|      errlinenum_ = errlinenum;
   98|  2.18k|      errcolnum_ = errcolnum;
   99|  2.18k|    }
  100|  3.14k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  8.15k|  ~XMLValidator() {
   84|  8.15k|    XML_ParserFree(parser_);
   85|  8.15k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  933|  7.86k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  934|  7.86k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  935|  7.86k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (935:7): [True: 7.51k, False: 353]
  ------------------
  936|  7.51k|    var = Exiv2::XmpValue::xsStruct;
  937|  7.51k|  }
  938|  7.86k|  return var;
  939|  7.86k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  941|  90.3k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  942|  90.3k|  XMP_OptionBits var(0);
  943|  90.3k|  switch (xs) {
  ------------------
  |  Branch (943:11): [True: 90.3k, False: 0]
  ------------------
  944|  83.9k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (944:5): [True: 83.9k, False: 6.41k]
  ------------------
  945|  83.9k|      break;
  946|  6.41k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (946:5): [True: 6.41k, False: 83.9k]
  ------------------
  947|  6.41k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  948|  6.41k|      break;
  949|  90.3k|  }
  950|  90.3k|  return var;
  951|  90.3k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  953|  10.1k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  954|  10.1k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  955|  10.1k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (955:7): [True: 2.66k, False: 7.51k]
  ------------------
  956|  2.66k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (956:9): [True: 540, False: 2.12k]
  ------------------
  957|    540|      typeId = Exiv2::xmpAlt;
  958|  2.12k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (958:14): [True: 1.85k, False: 270]
  ------------------
  959|  1.85k|      typeId = Exiv2::xmpSeq;
  960|    270|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (960:14): [True: 270, False: 0]
  ------------------
  961|    270|      typeId = Exiv2::xmpBag;
  962|  2.66k|  }
  963|  10.1k|  return typeId;
  964|  10.1k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  966|  7.86k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  967|  7.86k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  968|  7.86k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
  970|  90.3k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
  971|  90.3k|  XMP_OptionBits var(0);
  972|  90.3k|  switch (xat) {
  ------------------
  |  Branch (972:11): [True: 90.3k, False: 0]
  ------------------
  973|  88.2k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (973:5): [True: 88.2k, False: 2.15k]
  ------------------
  974|  88.2k|      break;
  975|    329|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (975:5): [True: 329, False: 90.0k]
  ------------------
  976|    329|      XMP_SetOption(var, kXMP_PropValueIsArray);
  977|    329|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
  978|    329|      break;
  979|  1.59k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (979:5): [True: 1.59k, False: 88.7k]
  ------------------
  980|  1.59k|      XMP_SetOption(var, kXMP_PropValueIsArray);
  981|  1.59k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
  982|  1.59k|      break;
  983|    235|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (983:5): [True: 235, False: 90.1k]
  ------------------
  984|    235|      XMP_SetOption(var, kXMP_PropValueIsArray);
  985|    235|      break;
  986|  90.3k|  }
  987|  90.3k|  return var;
  988|  90.3k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
  994|  3.82k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
  995|  3.82k|  XMP_OptionBits var(0);
  996|  3.82k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (996:7): [True: 1.13k, False: 2.68k]
  ------------------
  997|  1.13k|    var |= kXMP_OmitPacketWrapper;
  998|  3.82k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (998:7): [True: 0, False: 3.82k]
  ------------------
  999|      0|    var |= kXMP_ReadOnlyPacket;
 1000|  3.82k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1000:7): [True: 3.82k, False: 0]
  ------------------
 1001|  3.82k|    var |= kXMP_UseCompactFormat;
 1002|  3.82k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1002:7): [True: 0, False: 3.82k]
  ------------------
 1003|      0|    var |= kXMP_IncludeThumbnailPad;
 1004|  3.82k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1004:7): [True: 0, False: 3.82k]
  ------------------
 1005|      0|    var |= kXMP_ExactPacketLength;
 1006|  3.82k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1006:7): [True: 0, False: 3.82k]
  ------------------
 1007|      0|    var |= kXMP_WriteAliasComments;
 1008|  3.82k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1008:7): [True: 12, False: 3.81k]
  ------------------
 1009|     12|    var |= kXMP_OmitAllFormatting;
 1010|  3.82k|  return var;
 1011|  3.82k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1069|   332k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1070|   332k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   333k|  ~Impl() = default;

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

_ZN5Exiv210XmpSidecarC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   29|  1.97k|XmpSidecar::XmpSidecar(BasicIo::UniquePtr io, bool create) : Image(ImageType::xmp, mdXmp, std::move(io)) {
   30|  1.97k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 1.97k]
  |  Branch (30:17): [True: 0, False: 0]
  ------------------
   31|      0|    IoCloser closer(*io_);
   32|      0|    io_->write(reinterpret_cast<const byte*>(xmlHeader), xmlHdrCnt);
   33|      0|  }
   34|  1.97k|}  // XmpSidecar::XmpSidecar
_ZN5Exiv210XmpSidecar12readMetadataEv:
   45|  1.97k|void XmpSidecar::readMetadata() {
   46|       |#ifdef EXIV2_DEBUG_MESSAGES
   47|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   48|       |#endif
   49|  1.97k|  if (io_->open() != 0) {
  ------------------
  |  Branch (49:7): [True: 0, False: 1.97k]
  ------------------
   50|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   51|      0|  }
   52|  1.97k|  IoCloser closer(*io_);
   53|       |  // Ensure that this is the correct image type
   54|  1.97k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (54:7): [True: 0, False: 1.97k]
  ------------------
   55|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (55:9): [True: 0, False: 0]
  |  Branch (55:25): [True: 0, False: 0]
  ------------------
   56|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   57|      0|    throw Error(ErrorCode::kerNotAnImage, "XMP");
   58|      0|  }
   59|       |  // Read the XMP packet from the IO stream
   60|  1.97k|  std::string xmpPacket;
   61|  1.97k|  const long len = 64 * 1024;
   62|  1.97k|  auto buf = std::make_unique<byte[]>(len);
   63|  4.68k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (63:15): [True: 2.71k, False: 1.97k]
  ------------------
   64|  2.71k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   65|  2.71k|  }
   66|  1.97k|  if (io_->error())
  ------------------
  |  Branch (66:7): [True: 0, False: 1.97k]
  ------------------
   67|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   68|  1.97k|  clearMetadata();
   69|  1.97k|  xmpPacket_ = std::move(xmpPacket);
   70|  1.97k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (70:7): [True: 1.97k, False: 1]
  |  Branch (70:30): [True: 246, False: 1.72k]
  ------------------
   71|    246|#ifndef SUPPRESS_WARNINGS
   72|    246|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    246|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 246]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    246|  LogMsg(LogMsg::warn).os()
  ------------------
   73|    246|#endif
   74|    246|  }
   75|       |
   76|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   77|  15.1k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (77:24): [True: 15.1k, False: 1.97k]
  ------------------
   78|  15.1k|    std::string key(xmp.key());
   79|  15.1k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (79:9): [True: 873, False: 14.2k]
  ------------------
   80|    873|      dates_[key] = xmp.value().toString();
   81|    873|    }
   82|  15.1k|  }
   83|       |
   84|  1.97k|  copyXmpToIptc(xmpData_, iptcData_);
   85|  1.97k|  copyXmpToExif(xmpData_, exifData_);
   86|  1.97k|}  // XmpSidecar::readMetadata
_ZN5Exiv210XmpSidecar13writeMetadataEv:
   92|  1.89k|void XmpSidecar::writeMetadata() {
   93|  1.89k|  if (io_->open() != 0) {
  ------------------
  |  Branch (93:7): [True: 0, False: 1.89k]
  ------------------
   94|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   95|      0|  }
   96|  1.89k|  IoCloser closer(*io_);
   97|       |
   98|  1.89k|  if (!writeXmpFromPacket()) {
  ------------------
  |  Branch (98:7): [True: 1.89k, False: 0]
  ------------------
   99|       |    // #589 copy XMP tags
  100|  1.89k|    Exiv2::XmpData copy;
  101|  15.0k|    for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (101:26): [True: 15.0k, False: 1.89k]
  ------------------
  102|  15.0k|      if (!matchi(xmp.key(), "exif") && !matchi(xmp.key(), "iptc")) {
  ------------------
  |  Branch (102:11): [True: 12.1k, False: 2.82k]
  |  Branch (102:11): [True: 11.0k, False: 3.91k]
  |  Branch (102:41): [True: 11.0k, False: 1.08k]
  ------------------
  103|  11.0k|        copy[xmp.key()] = xmp.value();
  104|  11.0k|      }
  105|  15.0k|    }
  106|       |
  107|       |    // run the converters
  108|  1.89k|    copyExifToXmp(exifData_, xmpData_);
  109|  1.89k|    copyIptcToXmp(iptcData_, xmpData_);
  110|       |
  111|       |    // #1112 - restore dates if they lost their TZ info
  112|  1.89k|    for (const auto& [sKey, value_orig] : dates_) {
  ------------------
  |  Branch (112:41): [True: 869, False: 1.89k]
  ------------------
  113|    869|      Exiv2::XmpKey key(sKey);
  114|    869|      if (xmpData_.findKey(key) != xmpData_.end()) {
  ------------------
  |  Branch (114:11): [True: 868, False: 1]
  ------------------
  115|    868|        std::string value_now(xmpData_[sKey].value().toString());
  116|       |        // std::cout << key << " -> " << value_now << " => " << value_orig << '\n';
  117|    868|        if (Internal::contains(value_orig, value_now.substr(0, 10))) {
  ------------------
  |  Branch (117:13): [True: 761, False: 107]
  ------------------
  118|    761|          xmpData_[sKey] = value_orig;
  119|    761|        }
  120|    868|      }
  121|    869|    }
  122|       |
  123|       |    // #589 - restore tags which were modified by the converters
  124|  11.0k|    for (const auto& xmp : copy) {
  ------------------
  |  Branch (124:26): [True: 11.0k, False: 1.89k]
  ------------------
  125|  11.0k|      xmpData_[xmp.key()] = xmp.value();
  126|  11.0k|    }
  127|       |
  128|  1.89k|    if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::omitPacketWrapper | XmpParser::useCompactFormat) > 1) {
  ------------------
  |  Branch (128:9): [True: 71, False: 1.82k]
  ------------------
  129|     71|#ifndef SUPPRESS_WARNINGS
  130|     71|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     71|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 71]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     71|  LogMsg(LogMsg::error).os()
  ------------------
  131|     71|#endif
  132|     71|    }
  133|  1.89k|  }
  134|  1.89k|  if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (134:7): [True: 1.21k, False: 683]
  ------------------
  135|  1.21k|    if (!xmpPacket_.starts_with("<?xml")) {
  ------------------
  |  Branch (135:9): [True: 1.21k, False: 0]
  ------------------
  136|  1.21k|      xmpPacket_ = xmlHeader + xmpPacket_ + xmlFooter;
  137|  1.21k|    }
  138|  1.21k|    MemIo tempIo;
  139|       |
  140|       |    // Write XMP packet
  141|  1.21k|    if (tempIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (141:9): [True: 0, False: 1.21k]
  ------------------
  142|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  143|  1.21k|    if (tempIo.error())
  ------------------
  |  Branch (143:9): [True: 0, False: 1.21k]
  ------------------
  144|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  145|  1.21k|    io_->close();
  146|  1.21k|    io_->transfer(tempIo);  // may throw
  147|  1.21k|  }
  148|  1.89k|}  // XmpSidecar::writeMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  152|  1.97k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, bool create) {
  153|  1.97k|  auto image = std::make_unique<XmpSidecar>(std::move(io), create);
  154|  1.97k|  if (!image->good()) {
  ------------------
  |  Branch (154:7): [True: 0, False: 1.97k]
  ------------------
  155|      0|    return nullptr;
  156|      0|  }
  157|  1.97k|  return image;
  158|  1.97k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  160|  18.4k|bool isXmpType(BasicIo& iIo, bool advance) {
  161|       |  /*
  162|       |    Check if the file starts with an optional XML declaration followed by
  163|       |    either an XMP header (<?xpacket ... ?>) or an <x:xmpmeta> element.
  164|       |
  165|       |    In addition, in order for empty XmpSidecar objects as created by
  166|       |    Exiv2 to pass the test, just an XML header is also considered ok.
  167|       |   */
  168|  18.4k|  const int32_t len = 80;
  169|  18.4k|  byte buf[len];
  170|  18.4k|  iIo.read(buf, xmlHdrCnt + 1);
  171|  18.4k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (171:7): [True: 285, False: 18.1k]
  |  Branch (171:20): [True: 3, False: 282]
  ------------------
  172|      3|    return true;
  173|      3|  }
  174|  18.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (174:7): [True: 0, False: 18.4k]
  |  Branch (174:22): [True: 282, False: 18.1k]
  ------------------
  175|    282|    return false;
  176|    282|  }
  177|  18.1k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  178|  18.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (178:7): [True: 0, False: 18.1k]
  |  Branch (178:22): [True: 70, False: 18.1k]
  ------------------
  179|     70|    return false;
  180|     70|  }
  181|       |  // Skip leading BOM
  182|  18.1k|  int32_t start = 0;
  183|  18.1k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (183:7): [True: 96, False: 18.0k]
  ------------------
  184|     96|    start = 3;
  185|     96|  }
  186|  18.1k|  bool rc = false;
  187|  18.1k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  188|  18.1k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (188:7): [True: 134, False: 17.9k]
  ------------------
  189|       |    // Forward to the next tag
  190|    134|    auto it = std::find(head.begin() + 5, head.end(), '<');
  191|    134|    if (it != head.end())
  ------------------
  |  Branch (191:9): [True: 115, False: 19]
  ------------------
  192|    115|      head = head.substr(std::distance(head.begin(), it));
  193|    134|  }
  194|  18.1k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (194:7): [True: 3.03k, False: 15.0k]
  |  Branch (194:40): [True: 2.88k, False: 12.1k]
  ------------------
  195|  5.91k|    rc = true;
  196|  5.91k|  }
  197|  18.1k|  if (!advance || !rc) {
  ------------------
  |  Branch (197:7): [True: 18.1k, False: 0]
  |  Branch (197:19): [True: 0, False: 0]
  ------------------
  198|  18.1k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  199|  18.1k|  }
  200|  18.1k|  return rc;
  201|  18.1k|}
xmpsidecar.cpp:_ZN5Exiv2L6matchiERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKc:
   88|  27.1k|static bool matchi(const std::string& key, const char* substr) {
   89|  27.1k|  return Internal::contains(Internal::lower(key), substr);
   90|  27.1k|}

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  5.48k|{
  625|  5.48k|	IgnoreParam(options);
  ------------------
  |  |  117|  5.48k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  5.48k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  5.48k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  5.48k|{
  647|       |
  648|  5.48k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 21, False: 5.46k]
  ------------------
  649|  5.46k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  5.46k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  5.46k|{
  664|  5.46k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  5.46k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  5.46k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  5.46k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  23.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 18.1k, False: 5.46k]
  ------------------
  670|  18.1k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 12.6k, False: 5.57k]
  ------------------
  671|  5.57k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  5.57k|	}
  673|       |
  674|  5.46k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  10.2k|{
  695|  10.2k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  10.2k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.76k, False: 5.51k]
  |  Branch (696:45): [True: 38, False: 4.72k]
  ------------------
  697|     38|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     38|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  10.2k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 5.57k, False: 4.66k]
  |  Branch (700:21): [True: 116, False: 5.46k]
  ------------------
  701|    116|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    116|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  10.1k|	} else {
  703|  10.1k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  10.1k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  10.1k|	}
  706|       |
  707|  10.2k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   249k|{
  265|   249k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   249k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 249k, False: 143]
  |  Branch (269:28): [True: 104k, False: 145k]
  ------------------
  270|       |
  271|   104k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 82.8k, False: 21.6k]
  ------------------
  272|  82.8k|			term = kRDFTerm_li;
  273|  82.8k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 3, False: 21.6k]
  ------------------
  274|      3|			term = kRDFTerm_parseType;
  275|  21.6k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 5.52k, False: 16.1k]
  ------------------
  276|  5.52k|			term = kRDFTerm_Description;
  277|  16.1k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 982, False: 15.1k]
  ------------------
  278|    982|			term = kRDFTerm_about;
  279|  15.1k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 45, False: 15.0k]
  ------------------
  280|     45|			term = kRDFTerm_resource;
  281|  15.0k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 19, False: 15.0k]
  ------------------
  282|     19|			term = kRDFTerm_RDF;
  283|  15.0k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 68, False: 14.9k]
  ------------------
  284|     68|			term = kRDFTerm_ID;
  285|  14.9k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 96, False: 14.8k]
  ------------------
  286|     96|			term = kRDFTerm_nodeID;
  287|  14.8k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 21, False: 14.8k]
  ------------------
  288|     21|			term = kRDFTerm_datatype;
  289|  14.8k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 6, False: 14.8k]
  ------------------
  290|      6|			term = kRDFTerm_aboutEach;
  291|  14.8k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 10, False: 14.8k]
  ------------------
  292|     10|			term = kRDFTerm_aboutEachPrefix;
  293|  14.8k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 42, False: 14.8k]
  ------------------
  294|     42|			term = kRDFTerm_bagID;
  295|     42|		}
  296|       |
  297|   104k|	}
  298|       |
  299|   249k|	return term;
  300|       |
  301|   249k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  10.1k|{
  732|  10.1k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  10.1k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  10.1k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  30.4k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 20.7k, False: 9.75k]
  ------------------
  738|       |
  739|  20.7k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  20.7k|		switch ( attrTerm ) {
  742|       |
  743|     28|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 28, False: 20.6k]
  ------------------
  744|     38|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 10, False: 20.6k]
  ------------------
  745|    999|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 961, False: 19.7k]
  ------------------
  746|       |
  747|    999|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 10, False: 989]
  ------------------
  748|    989|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|    989|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 974, False: 15]
  |  Branch (750:24): [True: 949, False: 25]
  ------------------
  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|    949|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|    949|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|    949|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 901, False: 48]
  ------------------
  755|    901|						xmpParent->name = (*currAttr)->value;
  756|    901|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 48, False: 0]
  ------------------
  757|     48|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     33|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 33, False: 15]
  ------------------
  758|     15|					}
  759|    949|				}
  760|       |
  761|    956|				break;
  762|       |
  763|  19.6k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 19.6k, False: 1.08k]
  ------------------
  764|  19.6k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  19.6k|				break;
  766|       |
  767|     88|			default :
  ------------------
  |  Branch (767:4): [True: 88, False: 20.6k]
  ------------------
  768|     88|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     88|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  20.7k|		}
  771|       |
  772|  20.7k|	}
  773|       |
  774|  10.1k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   139k|{
  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|   139k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 272, False: 139k]
  ------------------
  371|    272|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    272|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   139k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   139k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   139k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   139k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   139k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 28.0k, False: 111k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  28.0k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  28.0k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  28.0k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  28.0k|#define kXMP_CreateNodes	true
  ------------------
  384|  28.0k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  28.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  14.7k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 14.7k, False: 13.3k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  28.0k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  28.0k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 28.0k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  28.0k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   139k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 56.4k, False: 82.7k]
  ------------------
  398|  56.4k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  56.4k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 22, False: 56.4k]
  ------------------
  399|     22|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  56.4k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   139k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   139k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 139k, False: 28]
  |  Branch (406:26): [True: 22, False: 6]
  ------------------
  407|   139k|		 xmpParent->children.push_back ( newChild );
  408|   139k|	} else {
  409|     16|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     16|	}
  411|   139k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 28, False: 139k]
  ------------------
  412|     28|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     28|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 18, False: 10]
  |  Branch (412:22): [True: 10, False: 0]
  ------------------
  413|      0|		xmpParent->options |= kRDF_HasValueElem;
  414|      0|	}
  415|       |	
  416|   139k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 82.6k, False: 56.4k]
  ------------------
  417|  82.6k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 22, False: 82.6k]
  ------------------
  418|  82.6k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  82.6k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  82.6k|	}
  423|       |	
  424|   139k|	return newChild;
  425|       |
  426|   139k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  10.0k|{
  787|  10.0k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  10.0k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   297k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 288k, False: 9.89k]
  ------------------
  791|   288k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 195k, False: 92.7k]
  ------------------
  792|  92.7k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 130, False: 92.6k]
  ------------------
  793|    130|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    130|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  92.6k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  92.6k|	}
  797|       |
  798|  10.0k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  92.6k|{
  854|  92.6k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  92.6k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     25|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 25, False: 92.5k]
  ------------------
  856|       |	
  857|  92.5k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 4.96k, False: 87.6k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  4.96k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  87.6k|	} 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|  87.6k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  87.6k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  87.6k|		XMP_VarString * attrName = 0;
  870|       |
  871|  98.3k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 15.9k, False: 82.3k]
  ------------------
  872|  15.9k|			attrName = &((*currAttr)->name);
  873|  15.9k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 5.27k, False: 10.6k]
  |  Branch (873:38): [True: 5.24k, False: 24]
  ------------------
  874|  15.9k|		}
  875|       |
  876|  87.6k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 5.24k, False: 82.3k]
  ------------------
  877|       |
  878|  5.24k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  5.24k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  5.24k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  5.24k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 46, False: 5.20k]
  ------------------
  882|     46|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  5.20k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 4.88k, False: 320]
  ------------------
  884|  4.88k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  4.88k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 10, False: 310]
  ------------------
  886|     10|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    310|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 266, False: 44]
  ------------------
  888|    266|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    266|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 7, False: 37]
  ------------------
  890|      7|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     37|			} else {
  892|     37|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     37|			}
  894|       |
  895|  82.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|  82.3k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 1.73k, False: 80.6k]
  ------------------
  901|       |
  902|  1.73k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  80.6k|			} else {
  905|       |			
  906|  80.6k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  80.6k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|   167k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 91.8k, False: 75.8k]
  ------------------
  910|  91.8k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.76k, False: 87.0k]
  ------------------
  911|  91.8k|				}
  912|       |				
  913|  80.6k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 75.8k, False: 4.76k]
  ------------------
  914|  75.8k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  75.8k|				} else {
  916|  4.76k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.76k|				}
  918|       |			
  919|  80.6k|			}
  920|       |
  921|  82.3k|		}
  922|       |		
  923|  87.6k|	}
  924|       |
  925|  92.5k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  92.6k|{
  350|       |
  351|  92.6k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 6, False: 92.5k]
  |  Branch (351:42): [True: 1, False: 92.5k]
  ------------------
  352|  92.5k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  92.6k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  92.5k|{
  334|       |
  335|  92.5k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 1, False: 92.5k]
  |  Branch (335:39): [True: 1, False: 0]
  ------------------
  336|  92.5k|	return false;
  337|       |
  338|  92.5k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  92.5k|{
  317|       |
  318|  92.5k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 82.8k, False: 9.76k]
  |  Branch (318:40): [True: 18, False: 82.8k]
  ------------------
  319|  92.5k|	return false;
  320|       |
  321|  92.5k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  11.5k|{
 1190|  11.5k|	bool hasPropertyAttrs = false;
 1191|  11.5k|	bool hasResourceAttr  = false;
 1192|  11.5k|	bool hasNodeIDAttr    = false;
 1193|  11.5k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  11.5k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  11.5k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     74|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 74, False: 11.5k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  11.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  11.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|  75.4k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 64.0k, False: 11.4k]
  ------------------
 1205|       |
 1206|  64.0k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  64.0k|		switch ( attrTerm ) {
 1209|       |
 1210|     20|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 20, False: 63.9k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     20|				break;
 1213|       |
 1214|     36|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 36, False: 63.9k]
  ------------------
 1215|     36|				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: 36]
  ------------------
 1216|     36|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 10, False: 26]
  ------------------
 1217|     26|				hasResourceAttr = true;
 1218|     26|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 26, False: 0]
  ------------------
 1219|     26|				break;
 1220|       |
 1221|     48|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 48, False: 63.9k]
  ------------------
 1222|     48|				if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1222:10): [True: 10, False: 38]
  ------------------
 1223|     38|				hasNodeIDAttr = true;
 1224|     38|				break;
 1225|       |
 1226|  63.8k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 63.8k, False: 133]
  ------------------
 1227|  63.8k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 1.43k, False: 62.4k]
  ------------------
 1228|  1.43k|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 5, False: 1.43k]
  ------------------
 1229|  1.43k|					hasValueAttr = true;
 1230|  1.43k|					valueNode = *currAttr;
 1231|  62.4k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 62.3k, False: 98]
  ------------------
 1232|  62.3k|					hasPropertyAttrs = true;
 1233|  62.3k|				}
 1234|  63.8k|				break;
 1235|       |
 1236|  63.8k|			default :
  ------------------
  |  Branch (1236:4): [True: 29, False: 63.9k]
  ------------------
 1237|     29|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     29|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  64.0k|		}
 1241|       |
 1242|  64.0k|	}
 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|  11.4k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  11.4k|	bool childIsStruct = false;
 1250|       |	
 1251|  11.4k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 1.43k, False: 10.0k]
  ------------------
 1252|  1.43k|		childNode->value = valueNode->value;
 1253|  1.43k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 11, False: 1.42k]
  ------------------
 1254|  10.0k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 8.26k, False: 1.75k]
  ------------------
 1255|  8.26k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  8.26k|		childIsStruct = true;
 1257|  8.26k|	}
 1258|       |		
 1259|  11.4k|	currAttr = xmlNode.attrs.begin();
 1260|  11.4k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|  75.0k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 63.7k, False: 11.3k]
  ------------------
 1263|       |
 1264|  63.7k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 1.42k, False: 62.3k]
  ------------------
 1265|  62.3k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  62.3k|		switch ( attrTerm ) {
 1268|       |
 1269|     20|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 20, False: 62.2k]
  ------------------
 1270|     58|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 38, False: 62.2k]
  ------------------
 1271|     58|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 62.3k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  62.2k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 62.2k, False: 58]
  ------------------
 1278|  62.2k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 34.7k, False: 27.4k]
  |  Branch (1278:31): [True: 9, False: 27.4k]
  ------------------
 1279|  34.7k|					AddQualifierNode ( childNode, **currAttr );
 1280|  34.7k|				} else {
 1281|  27.4k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  27.4k|				}
 1283|  62.2k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 62.3k]
  ------------------
 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|  62.3k|		}
 1290|       |
 1291|  62.3k|	}
 1292|       |
 1293|  11.4k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  45.3k|{
  484|  45.3k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 25, False: 45.3k]
  ------------------
  485|     25|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     25|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  45.3k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  45.3k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  45.4k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  45.4k|	const bool isLang = (name == "xml:lang");
  443|  45.4k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  45.4k|	XMP_Node * newQual = 0;
  446|       |
  447|  45.4k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  45.4k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 34.6k, False: 10.7k]
  ------------------
  450|  34.6k|			xmpParent->qualifiers.push_back ( newQual );
  451|  34.6k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 10.6k, False: 124]
  ------------------
  452|  10.6k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 10.6k, False: 12]
  ------------------
  453|  10.6k|				xmpParent->qualifiers.push_back ( newQual );
  454|  10.6k|			} else {
  455|     12|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     12|			}
  457|  10.6k|			xmpParent->options |= kXMP_PropHasLang;
  458|  10.6k|		} else {
  459|    124|			XMP_Assert ( isType );
  ------------------
  |  |  142|    124|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    124|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 97, False: 27]
  ------------------
  461|     97|				xmpParent->qualifiers.push_back ( newQual );
  462|     97|			} else {
  463|     27|				size_t offset = 0;
  464|     27|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 10, False: 17]
  ------------------
  465|     27|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|     27|			}
  467|    124|			xmpParent->options |= kXMP_PropHasType;
  468|    124|		}
  469|       |
  470|  45.4k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  45.4k|	return newQual;
  473|       |
  474|  45.4k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  75.9k|{
 1015|  75.9k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  75.9k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  75.9k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  86.5k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 10.6k, False: 75.8k]
  ------------------
 1021|  10.6k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  10.6k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 10.5k, False: 93]
  ------------------
 1023|  10.5k|			AddQualifierNode ( newChild, **currAttr );
 1024|  10.5k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 11, False: 82]
  |  Branch (1024:41): [True: 46, False: 36]
  ------------------
 1025|     57|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     57|		} else {
 1027|     36|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     36|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  10.6k|	}
 1030|       |	
 1031|  75.8k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  75.8k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  75.8k|	size_t      textSize  = 0;
 1034|       |
 1035|   152k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 76.9k, False: 75.8k]
  ------------------
 1036|  76.9k|		if ( (*currChild)->kind != kCDataNode ) XMP_Throw ( "Invalid child of literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1036:8): [True: 10, False: 76.9k]
  ------------------
 1037|  76.9k|		textSize += (*currChild)->value.size();
 1038|  76.9k|	}
 1039|       |	
 1040|  75.8k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|   152k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 76.9k, False: 75.8k]
  ------------------
 1043|  76.9k|		newChild->value += (*currChild)->value;
 1044|  76.9k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  75.8k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|     10|{
 1065|     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
  ------------------
 1066|       |	
 1067|     10|	XMP_Throw ( "ParseTypeLiteral property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1068|       |
 1069|      0|}	// RDF_ParseTypeLiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    266|{
 1087|       |
 1088|    266|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    266|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    266|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    266|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    532|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 266, False: 266]
  ------------------
 1095|    266|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    266|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 266, False: 0]
  ------------------
 1097|    266|			continue;	// ! The caller ensured the value is "Resource".
 1098|    266|		} else if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1098:15): [True: 0, False: 0]
  ------------------
 1099|      0|			AddQualifierNode ( newStruct, **currAttr );
 1100|      0|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (1100:15): [True: 0, False: 0]
  ------------------
 1101|      0|			continue;	// Ignore all rdf:ID attributes.
 1102|      0|		} else {
 1103|      0|			XMP_Throw ( "Invalid attribute for ParseTypeResource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1104|      0|		}
 1105|    266|	}
 1106|       |
 1107|    266|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    266|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 266]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    266|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL38RDF_ParseTypeCollectionPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1127|      7|{
 1128|      7|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      7|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      7|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      7|#define IgnoreParam(p)	(void)p
  ------------------
 1129|       |
 1130|      7|	XMP_Throw ( "ParseTypeCollection property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      7|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1131|       |
 1132|      0|}	// RDF_ParseTypeCollectionPropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|     37|{
 1147|     37|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     37|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     37|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     37|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     37|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     37|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  4.76k|{
  943|  4.76k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.61k, False: 152]
  |  Branch (943:21): [True: 0, False: 4.61k]
  ------------------
  944|       |	
  945|  4.76k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.76k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.76k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.78k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 20, False: 4.76k]
  ------------------
  951|     20|		XMP_VarString & attrName = (*currAttr)->name;
  952|     20|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 17, False: 3]
  ------------------
  953|     17|			AddQualifierNode ( newCompound, **currAttr );
  954|     17|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 3, False: 0]
  ------------------
  955|      3|			continue;	// Ignore all rdf:ID attributes.
  956|      3|		} 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|     20|	}
  960|       |	
  961|  4.76k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.76k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  14.7k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 14.7k, False: 0]
  ------------------
  965|  14.7k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.76k, False: 9.98k]
  ------------------
  966|  14.7k|	}
  967|  4.76k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 4.76k]
  ------------------
  968|  4.76k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     52|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 52, False: 4.71k]
  ------------------
  969|       |
  970|  4.71k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 194, False: 4.52k]
  ------------------
  971|    194|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.52k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.37k, False: 2.14k]
  ------------------
  973|  2.37k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.37k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.98k, False: 167]
  ------------------
  975|  1.98k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.98k|	} else {
  977|    167|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    167|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 110, False: 57]
  ------------------
  979|    110|			XMP_VarString typeName ( (*currChild)->ns );
  980|    110|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    110|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 10, False: 100]
  ------------------
  982|    100|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    100|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    100|		}
  985|    167|	}
  986|       |
  987|  4.70k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.70k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 4.70k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  4.70k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.73k, False: 2.96k]
  ------------------
  991|  1.73k|		DetectAltText ( newCompound );
  992|  1.73k|	}
  993|       |
  994|  13.5k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 8.89k, False: 4.66k]
  ------------------
  995|  8.89k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     40|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 40, False: 8.85k]
  ------------------
  996|  8.85k|	}
  997|       |
  998|  4.70k|}	// 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|  23.3k|{
  568|  23.3k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  23.3k|	size_t unitCount = 0;
  570|       |
  571|  23.3k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  23.3k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 23.3k]
  ------------------
  573|  23.3k|	inUnit = *utf8In;
  574|  23.3k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 23.3k, 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|  23.3k|MultiByte:
  584|  23.3k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  23.3k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  23.3k|{
  517|  23.3k|	UTF8Unit  inUnit = *utf8In;
  518|  23.3k|	size_t    unitCount = 0;
  519|  23.3k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  23.3k|	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|  23.3k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|  72.1k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 48.7k, False: 23.3k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  23.3k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     18|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 11, False: 23.3k]
  |  Branch (538:28): [True: 7, False: 23.3k]
  ------------------
  539|  23.3k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 23.3k]
  ------------------
  540|  23.3k|	unitCount = bytesNeeded;
  541|       |	
  542|  23.3k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  23.3k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  48.7k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 25.3k, False: 23.3k]
  ------------------
  546|  25.3k|		inUnit = *utf8Pos;
  547|  25.3k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     16|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 16, False: 25.3k]
  ------------------
  548|  25.3k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  25.3k|	}
  550|       |	
  551|  23.3k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 646, False: 22.7k]
  ------------------
  552|    646|		if ( (0xD800 <= cp) && (cp <= 0xDFFF) ) UC_Throw ( "Bad UTF-8 - surrogate code point", kXMPErr_BadParam );
  ------------------
  |  |   18|      1|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (552:8): [True: 646, False: 0]
  |  Branch (552:26): [True: 1, False: 645]
  ------------------
  553|    645|		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: 645]
  ------------------
  554|    645|	}
  555|       |	
  556|  23.3k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  23.3k|Done:	
  559|  23.3k|	*utf8Read = unitCount;
  560|  23.3k|	return;
  561|       |	
  562|  23.3k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   895k|{
   88|       |
   89|   895k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   895k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   895k|	const XMP_Uns8 * namePos   = nameStart;
   92|   895k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   895k|	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: 895k]
  ------------------
   97|       |
   98|   895k|	cp = *namePos;
   99|   895k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 894k, False: 251]
  ------------------
  100|   894k|		++namePos;
  101|   894k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 894k]
  ------------------
  102|   894k|	} else {
  103|    251|		cp = GetCodePoint ( &namePos );
  104|    251|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 251]
  ------------------
  105|    251|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  66.0M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 65.1M, False: 895k]
  ------------------
  110|  65.1M|		cp = *namePos;
  111|  65.1M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 65.1M, False: 10.9k]
  ------------------
  112|  65.1M|			++namePos;
  113|  65.1M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 299k, False: 64.8M]
  |  Branch (113:38): [True: 0, False: 299k]
  ------------------
  114|  65.1M|		} else {
  115|  10.9k|			cp = GetCodePoint ( &namePos );
  116|  10.9k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 2.85k, False: 8.07k]
  |  Branch (116:41): [True: 0, False: 2.85k]
  ------------------
  117|  10.9k|		}
  118|  65.1M|	}
  119|       |
  120|   895k|	return;
  121|       |
  122|   895k|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|  66.0M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  66.0M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 37.8M, False: 28.1M]
  |  Branch (33:23): [True: 37.8M, False: 0]
  |  Branch (33:40): [True: 27.8M, False: 299k]
  |  Branch (33:55): [True: 27.7M, False: 36.5k]
  |  Branch (33:71): [True: 36.5k, False: 299k]
  ------------------
   34|   299k|	return false;
   35|  66.0M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  11.1k|{
   20|  11.1k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  11.1k|	XMP_Uns32 cp;
   22|  11.1k|	size_t u8Len;
   23|  11.1k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  11.1k|	*utf8Str_io = u8Ptr + u8Len;
   25|  11.1k|	return cp;
   26|  11.1k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  11.1k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  11.1k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 9.37k, False: 1.79k]
  |  Branch (43:24): [True: 358, False: 9.02k]
  |  Branch (43:43): [True: 9.02k, False: 1.79k]
  |  Branch (43:59): [True: 4.15k, False: 4.87k]
  ------------------
   44|  6.66k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 4.87k, False: 1.79k]
  |  Branch (44:24): [True: 2.75k, False: 2.11k]
  |  Branch (44:43): [True: 1.06k, False: 2.85k]
  |  Branch (44:60): [True: 0, False: 1.06k]
  ------------------
   45|       |
   46|  3.91k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.06k, False: 2.85k]
  |  Branch (46:25): [True: 741, False: 321]
  |  Branch (46:46): [True: 321, False: 2.85k]
  |  Branch (46:64): [True: 0, False: 321]
  ------------------
   47|  3.17k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 321, False: 2.85k]
  |  Branch (47:26): [True: 0, False: 321]
  |  Branch (47:46): [True: 321, False: 2.85k]
  |  Branch (47:64): [True: 0, False: 321]
  ------------------
   48|  3.17k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 321, False: 2.85k]
  |  Branch (48:26): [True: 321, False: 0]
  |  Branch (48:46): [True: 0, False: 2.85k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  2.85k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 2.85k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 2.85k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  2.85k|	return false;
   52|       |
   53|  2.85k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   299k|{
   59|       |	// ASCII following characters for an XML name.
   60|   299k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 238k, False: 60.7k]
  |  Branch (60:23): [True: 238k, False: 0]
  |  Branch (60:39): [True: 17.4k, False: 43.2k]
  |  Branch (60:54): [True: 43.2k, False: 0]
  ------------------
   61|      0|	return false;
   62|   299k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  2.85k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  2.85k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 1.79k, False: 1.05k]
  |  Branch (69:24): [True: 1.05k, False: 0]
  |  Branch (69:41): [True: 1.05k, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  2.85k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  7.35k|{
   20|  7.35k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  7.35k|	XMP_Uns32 cp;
   22|  7.35k|	size_t u8Len;
   23|  7.35k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  7.35k|	*utf8Str_io = u8Ptr + u8Len;
   25|  7.35k|	return cp;
   26|  7.35k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  40.0k|{
   88|       |
   89|  40.0k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  40.0k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  40.0k|	const XMP_Uns8 * namePos   = nameStart;
   92|  40.0k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  40.0k|	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: 40.0k]
  ------------------
   97|       |
   98|  40.0k|	cp = *namePos;
   99|  40.0k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 39.7k, False: 285]
  ------------------
  100|  39.7k|		++namePos;
  101|  39.7k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 39.7k]
  ------------------
  102|  39.7k|	} else {
  103|    285|		cp = GetCodePoint ( &namePos );
  104|    285|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 285]
  ------------------
  105|    285|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  6.34M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 6.30M, False: 40.0k]
  ------------------
  110|  6.30M|		cp = *namePos;
  111|  6.30M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 6.30M, False: 4.57k]
  ------------------
  112|  6.30M|			++namePos;
  113|  6.30M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 33.6k, False: 6.27M]
  |  Branch (113:38): [True: 0, False: 33.6k]
  ------------------
  114|  6.30M|		} else {
  115|  4.57k|			cp = GetCodePoint ( &namePos );
  116|  4.57k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 1.54k, False: 3.03k]
  |  Branch (116:41): [True: 0, False: 1.54k]
  ------------------
  117|  4.57k|		}
  118|  6.30M|	}
  119|       |
  120|  40.0k|	return;
  121|       |
  122|  40.0k|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|  6.34M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  6.34M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 6.21M, False: 127k]
  |  Branch (33:23): [True: 6.21M, False: 0]
  |  Branch (33:40): [True: 94.1k, False: 33.6k]
  |  Branch (33:55): [True: 86.4k, False: 7.72k]
  |  Branch (33:71): [True: 7.72k, False: 33.6k]
  ------------------
   34|  33.6k|	return false;
   35|  6.34M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  4.86k|{
   20|  4.86k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  4.86k|	XMP_Uns32 cp;
   22|  4.86k|	size_t u8Len;
   23|  4.86k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  4.86k|	*utf8Str_io = u8Ptr + u8Len;
   25|  4.86k|	return cp;
   26|  4.86k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  4.86k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  4.86k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 3.52k, False: 1.33k]
  |  Branch (43:24): [True: 151, False: 3.37k]
  |  Branch (43:43): [True: 3.37k, False: 1.33k]
  |  Branch (43:59): [True: 455, False: 2.92k]
  ------------------
   44|  4.25k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 2.92k, False: 1.33k]
  |  Branch (44:24): [True: 2.05k, False: 868]
  |  Branch (44:43): [True: 657, False: 1.54k]
  |  Branch (44:60): [True: 0, False: 657]
  ------------------
   45|       |
   46|  2.20k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 657, False: 1.54k]
  |  Branch (46:25): [True: 412, False: 245]
  |  Branch (46:46): [True: 245, False: 1.54k]
  |  Branch (46:64): [True: 0, False: 245]
  ------------------
   47|  1.78k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 245, False: 1.54k]
  |  Branch (47:26): [True: 0, False: 245]
  |  Branch (47:46): [True: 245, False: 1.54k]
  |  Branch (47:64): [True: 0, False: 245]
  ------------------
   48|  1.78k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 245, False: 1.54k]
  |  Branch (48:26): [True: 245, False: 0]
  |  Branch (48:46): [True: 0, False: 1.54k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  1.54k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 1.54k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 1.54k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  1.54k|	return false;
   52|       |
   53|  1.54k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  33.6k|{
   59|       |	// ASCII following characters for an XML name.
   60|  33.6k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 11.6k, False: 22.0k]
  |  Branch (60:23): [True: 11.6k, False: 0]
  |  Branch (60:39): [True: 3.35k, False: 18.6k]
  |  Branch (60:54): [True: 18.6k, False: 0]
  ------------------
   61|      0|	return false;
   62|  33.6k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  1.54k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  1.54k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 1.33k, False: 211]
  |  Branch (69:24): [True: 211, False: 0]
  |  Branch (69:41): [True: 211, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  1.54k|}

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

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|  9.91k|{
   78|  9.91k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CTor_1" )
  ------------------
  |  |  241|  9.91k|	AnnounceEntry ( proc );									\
  |  |  242|  9.91k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  9.91k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  9.91k|	try {													\
  |  |  245|  9.91k|		XMP_AutoMutex mutex;								\
  |  |  246|  9.91k|		wResult->errMessage = 0;
  ------------------
   79|       |
   80|  9.91k|		XMPMeta * xmpObj = new XMPMeta();
   81|  9.91k|		++xmpObj->clientRefs;
   82|  9.91k|		XMP_Assert ( xmpObj->clientRefs == 1 );
  ------------------
  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   83|  9.91k|		wResult->ptrResult = XMPMetaRef ( xmpObj );
   84|       |
   85|  9.91k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  9.91k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  9.91k|	} 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|  9.91k|	AnnounceExit();
  ------------------
   86|  9.91k|}
WXMPMeta_DecrementRefCount_1:
  108|  9.91k|{
  109|  9.91k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  110|  9.91k|	XMP_ENTER_WRAPPER ( "WXMPMeta_DecrementRefCount_1" )
  ------------------
  |  |  241|  9.91k|	AnnounceEntry ( proc );									\
  |  |  242|  9.91k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  9.91k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  9.91k|	try {													\
  |  |  245|  9.91k|		XMP_AutoMutex mutex;								\
  |  |  246|  9.91k|		wResult->errMessage = 0;
  ------------------
  111|       |
  112|  9.91k|		XMPMeta * thiz = (XMPMeta*)xmpRef;
  113|       |		
  114|  9.91k|		XMP_Assert ( thiz->clientRefs > 0 );
  ------------------
  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  115|  9.91k|		--thiz->clientRefs;
  116|  9.91k|		if ( thiz->clientRefs <= 0 ) delete ( thiz );
  ------------------
  |  Branch (116:8): [True: 9.91k, False: 0]
  ------------------
  117|       |
  118|  9.91k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  9.91k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  9.91k|	AnnounceExit();
  ------------------
  119|  9.91k|}
WXMPMeta_Unlock_1:
  207|  88.6k|{
  208|  88.6k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
  209|  88.6k|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Unlock_1" )
  ------------------
  |  |  235|  88.6k|	AnnounceNoLock ( proc );								\
  |  |  236|  88.6k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  88.6k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|  88.6k|	try {													\
  |  |  238|  88.6k|		wResult->errMessage = 0;
  ------------------
  210|       |
  211|  88.6k|		XMPMeta::Unlock ( options );
  212|       |
  213|  88.6k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  88.6k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  88.6k|	AnnounceExit();
  ------------------
  214|  88.6k|}
WXMPMeta_RegisterNamespace_1:
  222|  1.11k|{
  223|  1.11k|	XMP_ENTER_WRAPPER ( "WXMPMeta_RegisterNamespace_1" )
  ------------------
  |  |  241|  1.11k|	AnnounceEntry ( proc );									\
  |  |  242|  1.11k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  1.11k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  1.11k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  1.11k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  1.11k|	try {													\
  |  |  245|  1.11k|		XMP_AutoMutex mutex;								\
  |  |  246|  1.11k|		wResult->errMessage = 0;
  ------------------
  224|       |
  225|  1.11k|		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: 1.11k]
  |  Branch (225:31): [True: 0, False: 1.11k]
  ------------------
  226|  1.11k|		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: 1.11k]
  |  Branch (226:25): [True: 0, False: 1.11k]
  ------------------
  227|       |
  228|  1.11k|		XMPMeta::RegisterNamespace ( namespaceURI, prefix );
  229|       |
  230|  1.11k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  1.11k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  1.11k|	} 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.11k|	AnnounceExit();
  ------------------
  231|  1.11k|}
WXMPMeta_GetNamespacePrefix_1:
  240|  89.3k|{
  241|  89.3k|	XMP_ENTER_WRAPPER ( "WXMPMeta_GetNamespacePrefix_1" )
  ------------------
  |  |  241|  89.3k|	AnnounceEntry ( proc );									\
  |  |  242|  89.3k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  89.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  89.3k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  89.3k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  89.3k|	try {													\
  |  |  245|  89.3k|		XMP_AutoMutex mutex;								\
  |  |  246|  89.3k|		wResult->errMessage = 0;
  ------------------
  242|       |
  243|  89.3k|		if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (243:8): [True: 0, False: 89.3k]
  |  Branch (243:31): [True: 0, False: 89.3k]
  ------------------
  244|       |
  245|  89.3k|		if ( namespacePrefix == 0 ) namespacePrefix = &voidStringPtr;
  ------------------
  |  Branch (245:8): [True: 0, False: 89.3k]
  ------------------
  246|  89.3k|		if ( prefixSize == 0 ) prefixSize = &voidStringLen;
  ------------------
  |  Branch (246:8): [True: 0, False: 89.3k]
  ------------------
  247|       |
  248|  89.3k|		bool found = XMPMeta::GetNamespacePrefix ( namespaceURI, namespacePrefix, prefixSize );
  249|  89.3k|		wResult->int32Result = found;
  250|       |		
  251|  89.3k|	XMP_EXIT_WRAPPER_KEEP_LOCK ( found )
  ------------------
  |  |  253|  89.3k|		if ( keep ) mutex.KeepLock();		\
  |  |  ------------------
  |  |  |  Branch (253:8): [True: 88.6k, False: 772]
  |  |  ------------------
  |  |  254|  89.3k|	XMP_CATCH_EXCEPTIONS					\
  |  |  ------------------
  |  |  |  |  265|  89.3k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  255|  89.3k|	AnnounceExit();
  ------------------
  252|  89.3k|}
WXMPMeta_DeleteNamespace_1:
  280|  1.09k|{
  281|  1.09k|	XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteNamespace_1" )
  ------------------
  |  |  241|  1.09k|	AnnounceEntry ( proc );									\
  |  |  242|  1.09k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  1.09k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  1.09k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  1.09k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  1.09k|	try {													\
  |  |  245|  1.09k|		XMP_AutoMutex mutex;								\
  |  |  246|  1.09k|		wResult->errMessage = 0;
  ------------------
  282|       |
  283|  1.09k|		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 (283:8): [True: 0, False: 1.09k]
  |  Branch (283:31): [True: 0, False: 1.09k]
  ------------------
  284|       |
  285|  1.09k|		XMPMeta::DeleteNamespace ( namespaceURI );
  286|       |
  287|  1.09k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  1.09k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  1.09k|	} 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.09k|	AnnounceExit();
  ------------------
  288|  1.09k|}
WXMPMeta_SetProperty_1:
  522|   148k|{
  523|   148k|	XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_1" )
  ------------------
  |  |  241|   148k|	AnnounceEntry ( proc );									\
  |  |  242|   148k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|   148k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|   148k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|   148k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|   148k|	try {													\
  |  |  245|   148k|		XMP_AutoMutex mutex;								\
  |  |  246|   148k|		wResult->errMessage = 0;
  ------------------
  524|       |
  525|   148k|		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 (525:8): [True: 0, False: 148k]
  |  Branch (525:27): [True: 0, False: 148k]
  ------------------
  526|   148k|		if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (526:8): [True: 0, False: 148k]
  |  Branch (526:27): [True: 0, False: 148k]
  ------------------
  527|       |
  528|   148k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|   148k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 148k]
  |  |  ------------------
  ------------------
  529|   148k|		meta->SetProperty ( schemaNS, propName, propValue, options );
  530|       |		
  531|   148k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|   148k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|   148k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|    110|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|    110|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|    110|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|    110|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 110]
  |  |  |  |  ------------------
  |  |  |  |  270|    110|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|    110|	} 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|   148k|	AnnounceExit();
  ------------------
  532|   148k|}
WXMPMeta_AppendArrayItem_1:
  566|  3.45k|{
  567|  3.45k|	XMP_ENTER_WRAPPER ( "WXMPMeta_AppendArrayItem_1" )
  ------------------
  |  |  241|  3.45k|	AnnounceEntry ( proc );									\
  |  |  242|  3.45k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.45k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.45k|	try {													\
  |  |  245|  3.45k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.45k|		wResult->errMessage = 0;
  ------------------
  568|       |
  569|  3.45k|		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 (569:8): [True: 0, False: 3.45k]
  |  Branch (569:27): [True: 0, False: 3.45k]
  ------------------
  570|  3.45k|		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 (570:8): [True: 0, False: 3.45k]
  |  Branch (570:28): [True: 0, False: 3.45k]
  ------------------
  571|       |
  572|  3.45k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|  3.45k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 3.45k]
  |  |  ------------------
  ------------------
  573|  3.45k|		meta->AppendArrayItem ( schemaNS, arrayName, arrayOptions, itemValue, options );
  574|       |		
  575|  3.45k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  3.45k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  3.45k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  3.45k|	AnnounceExit();
  ------------------
  576|  3.45k|}
WXMPMeta_SetQualifier_1:
  614|  3.45k|{
  615|  3.45k|	XMP_ENTER_WRAPPER ( "WXMPMeta_SetQualifier_1" )
  ------------------
  |  |  241|  3.45k|	AnnounceEntry ( proc );									\
  |  |  242|  3.45k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.45k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.45k|	try {													\
  |  |  245|  3.45k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.45k|		wResult->errMessage = 0;
  ------------------
  616|       |
  617|  3.45k|		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 (617:8): [True: 0, False: 3.45k]
  |  Branch (617:27): [True: 0, False: 3.45k]
  ------------------
  618|  3.45k|		if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (618:8): [True: 0, False: 3.45k]
  |  Branch (618:27): [True: 0, False: 3.45k]
  ------------------
  619|  3.45k|		if ( (qualNS == 0) || (*qualNS == 0) ) XMP_Throw ( "Empty qualifier namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (619:8): [True: 0, False: 3.45k]
  |  Branch (619:25): [True: 0, False: 3.45k]
  ------------------
  620|  3.45k|		if ( (qualName == 0) || (*qualName == 0) ) XMP_Throw ( "Empty qualifier name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (620:8): [True: 0, False: 3.45k]
  |  Branch (620:27): [True: 0, False: 3.45k]
  ------------------
  621|       |
  622|  3.45k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|  3.45k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 3.45k]
  |  |  ------------------
  ------------------
  623|  3.45k|		meta->SetQualifier ( schemaNS, propName, qualNS, qualName, qualValue, options );
  624|       |		
  625|  3.45k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  3.45k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  3.45k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  3.45k|	AnnounceExit();
  ------------------
  626|  3.45k|}
WXMPMeta_CountArrayItems_1:
 1168|  3.29k|{
 1169|  3.29k|	XMP_ENTER_WRAPPER ( "WXMPMeta_CountArrayItems_1" )
  ------------------
  |  |  241|  3.29k|	AnnounceEntry ( proc );									\
  |  |  242|  3.29k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.29k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.29k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.29k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.29k|	try {													\
  |  |  245|  3.29k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.29k|		wResult->errMessage = 0;
  ------------------
 1170|       |		
 1171|  3.29k|		if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1171:8): [True: 0, False: 3.29k]
  |  Branch (1171:27): [True: 0, False: 3.29k]
  ------------------
 1172|  3.29k|		if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1172:8): [True: 0, False: 3.29k]
  |  Branch (1172:28): [True: 0, False: 3.29k]
  ------------------
 1173|       |
 1174|  3.29k|		const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  3.29k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
 1175|  3.29k|		XMP_Index count = meta.CountArrayItems ( schemaNS, arrayName );
 1176|  3.29k|		wResult->int32Result = count;
 1177|       |		
 1178|  3.29k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  3.29k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  3.29k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|      0|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|      0|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|      0|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  270|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|      0|	} catch ( std::exception & stdErr ) {							\
  |  |  |  |  272|      0|		wResult->int32Result = kXMPErr_StdException; 				\
  |  |  |  |  273|      0|		wResult->errMessage  = stdErr.what(); 						\
  |  |  |  |  274|      0|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (274:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  275|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  276|      0|	} catch ( ... ) {												\
  |  |  |  |  277|      0|		wResult->int32Result = kXMPErr_UnknownException; 			\
  |  |  |  |  278|      0|		wResult->errMessage  = "Caught unknown exception";			\
  |  |  |  |  279|      0|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  280|      0|	}
  |  |  ------------------
  |  |  250|  3.29k|	AnnounceExit();
  ------------------
 1179|  3.29k|}
WXMPMeta_UnlockObject_1:
 1186|  3.82k|{
 1187|  3.82k|	WXMP_Result * wResult = &void_wResult;	// ! Needed to "fool" the EnterWrapper macro.
 1188|  3.82k|	XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_UnlockObject_1" )
  ------------------
  |  |  235|  3.82k|	AnnounceNoLock ( proc );								\
  |  |  236|  3.82k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.82k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  237|  3.82k|	try {													\
  |  |  238|  3.82k|		wResult->errMessage = 0;
  ------------------
 1189|       |	
 1190|  3.82k|		const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  3.82k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
 1191|  3.82k|		meta.UnlockObject ( options );
 1192|       |
 1193|  3.82k|	XMP_EXIT_WRAPPER_NO_THROW
  ------------------
  |  |  258|  3.82k|	} catch ( ... )	{							\
  |  |  259|      0|		AnnounceCatch ( "no-throw catch-all" );	\
  |  |  260|      0|		/* Do nothing. */						\
  |  |  261|      0|	}											\
  |  |  262|  3.82k|	AnnounceExit();
  ------------------
 1194|  3.82k|}
WXMPMeta_ParseFromBuffer_1:
 1270|  5.97k|{
 1271|  5.97k|	XMP_ENTER_WRAPPER ( "WXMPMeta_ParseFromBuffer_1" )
  ------------------
  |  |  241|  5.97k|	AnnounceEntry ( proc );									\
  |  |  242|  5.97k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  5.97k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  5.97k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  5.97k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  5.97k|	try {													\
  |  |  245|  5.97k|		XMP_AutoMutex mutex;								\
  |  |  246|  5.97k|		wResult->errMessage = 0;
  ------------------
 1272|       |
 1273|  5.97k|		XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef );
  ------------------
  |  |  109|  5.97k|#define WtoXMPMeta_Ptr(xmpRef)	(((xmpRef) == 0) ? 0 : (XMPMeta *)(xmpRef))
  |  |  ------------------
  |  |  |  Branch (109:33): [True: 0, False: 5.97k]
  |  |  ------------------
  ------------------
 1274|  5.97k|		meta->ParseFromBuffer ( buffer, bufferSize, options );
 1275|       |		
 1276|  5.97k|	XMP_EXIT_WRAPPER
  ------------------
  |  |  249|  5.97k|	XMP_CATCH_EXCEPTIONS	\
  |  |  ------------------
  |  |  |  |  265|  5.97k|	} catch ( XMP_Error & xmpErr ) {								\
  |  |  |  |  266|  1.20k|		wResult->int32Result = xmpErr.GetID(); 						\
  |  |  |  |  267|  1.20k|		wResult->ptrResult   = (void*)"XMP";						\
  |  |  |  |  268|  1.20k|		wResult->errMessage  = xmpErr.GetErrMsg();					\
  |  |  |  |  269|  1.20k|		if ( wResult->errMessage == 0 ) wResult->errMessage = "";	\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (269:8): [True: 0, False: 1.20k]
  |  |  |  |  ------------------
  |  |  |  |  270|  1.20k|		AnnounceCatch ( wResult->errMessage );						\
  |  |  |  |  271|  1.20k|	} 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.97k|	AnnounceExit();
  ------------------
 1277|  5.97k|}
WXMPMeta_SerializeToBuffer_1:
 1291|  3.82k|{
 1292|  3.82k|	XMP_ENTER_WRAPPER ( "WXMPMeta_SerializeToBuffer_1" )
  ------------------
  |  |  241|  3.82k|	AnnounceEntry ( proc );									\
  |  |  242|  3.82k|	XMP_Assert ( sXMP_InitCount > 0 );	                    \
  |  |  ------------------
  |  |  |  |  142|  3.82k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  243|  3.82k|	XMP_Assert ( (0 <= sLockCount) && (sLockCount <= 1) );	\
  |  |  ------------------
  |  |  |  |  142|  3.82k|	#define XMP_Assert(c)	((void) 0)
  |  |  ------------------
  |  |  244|  3.82k|	try {													\
  |  |  245|  3.82k|		XMP_AutoMutex mutex;								\
  |  |  246|  3.82k|		wResult->errMessage = 0;
  ------------------
 1293|       |
 1294|  3.82k|		if ( rdfString == 0 ) rdfString = &voidStringPtr;
  ------------------
  |  Branch (1294:8): [True: 0, False: 3.82k]
  ------------------
 1295|  3.82k|		if ( rdfSize == 0 ) rdfSize = &voidStringLen;
  ------------------
  |  Branch (1295:8): [True: 0, False: 3.82k]
  ------------------
 1296|       |		
 1297|  3.82k|		if ( newline == 0 ) newline = "";
  ------------------
  |  Branch (1297:8): [True: 0, False: 3.82k]
  ------------------
 1298|  3.82k|		if ( indent == 0 ) indent = "";
  ------------------
  |  Branch (1298:8): [True: 0, False: 3.82k]
  ------------------
 1299|       |		
 1300|  3.82k|		const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef );
  ------------------
  |  |  108|  3.82k|#define WtoXMPMeta_Ref(xmpRef)	*((const XMPMeta *)(xmpRef))
  ------------------
 1301|  3.82k|		meta.SerializeToBuffer ( rdfString, rdfSize, options, padding, newline, indent, baseIndent );
 1302|       |
 1303|  3.82k|	XMP_EXIT_WRAPPER_KEEP_LOCK ( true ) // ! Always keep the lock, a string is always returned!
  ------------------
  |  |  253|  3.82k|		if ( keep ) mutex.KeepLock();		\
  |  |  ------------------
  |  |  |  Branch (253:8): [True: 3.82k, Folded]
  |  |  ------------------
  |  |  254|  3.82k|	XMP_CATCH_EXCEPTIONS					\
  |  |  ------------------
  |  |  |  |  265|  3.82k|	} 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|  3.82k|	AnnounceExit();
  ------------------
 1304|  3.82k|}

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

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   329k|{
   40|   329k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 102k, False: 227k]
  ------------------
   41|       |
   42|   888k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 661k, False: 226k]
  ------------------
   43|   661k|		unsigned char ch = this->value[i];
   44|   661k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   661k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 547k, False: 114k]
  |  |  |  Branch (45:49): [True: 463, False: 113k]
  |  |  |  Branch (45:67): [True: 113k, False: 347]
  |  |  |  Branch (45:85): [True: 11, False: 336]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|    336|		return false;	// All the checks failed, this isn't whitespace.
   47|   661k|	}
   48|       |
   49|   226k|	return true;
   50|       |
   51|   227k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   619k|{
  428|       |
  429|   720k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 101k, False: 619k]
  ------------------
  430|   619k|	this->attrs.clear();
  431|       |
  432|   619k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   619k|{
  440|       |
  441|  1.13M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 511k, False: 619k]
  ------------------
  442|   619k|	this->content.clear();
  443|       |
  444|   619k|}	// 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|   545k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   545k|		int err = pthread_mutex_lock ( &mutex );
  125|   545k|		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: 545k]
  ------------------
  126|   545k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   545k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   545k|		int err = pthread_mutex_unlock ( &mutex );
  130|   545k|		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: 545k]
  ------------------
  131|   545k|	}
_Z16VerifySetOptionsjPKc:
  563|   159k|{
  564|       |
  565|   159k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 58, False: 159k]
  ------------------
  566|   159k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 3.84k, False: 155k]
  ------------------
  567|   159k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 5.48k, False: 153k]
  ------------------
  568|       |	
  569|   159k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 159k]
  ------------------
  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|   159k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 6.41k, False: 152k]
  |  Branch (573:45): [True: 0, False: 6.41k]
  ------------------
  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|   159k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 159k]
  |  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|   159k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 143k, False: 15.5k]
  |  Branch (581:27): [True: 0, False: 143k]
  ------------------
  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|   159k|	return options;
  586|       |
  587|   159k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   403k|{
  663|   403k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   403k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   403k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   403k|	XMP_StringPtr	qualName, nameEnd;
  667|   403k|	XMP_VarString	currStep;
  668|       |		
  669|   403k|	qualName = nameEnd = NULL;
  670|   403k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  68.6M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 68.2M, False: 403k]
  ------------------
  672|  68.2M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 127k, False: 68.0M]
  |  Branch (672:29): [True: 340k, False: 67.7M]
  ------------------
  673|  68.2M|	}
  674|       |	
  675|   403k|	expandedXPath->clear();
  676|   403k|	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|   403k|	stepBegin = propPath;
  683|   403k|	stepEnd = stepBegin;
  684|  48.9M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 48.9M, False: 57.8k]
  |  Branch (684:29): [True: 48.9M, False: 5.38k]
  |  Branch (684:50): [True: 48.5M, False: 340k]
  |  Branch (684:71): [True: 48.5M, False: 0]
  ------------------
  685|   403k|	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: 403k]
  ------------------
  686|   403k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   403k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   403k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   403k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 403k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   403k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   871k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 467k, False: 403k]
  ------------------
  700|       |
  701|   467k|		stepBegin = stepEnd;
  702|   467k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 127k, False: 340k]
  ------------------
  703|   467k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 467k]
  ------------------
  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|   467k|		stepEnd = stepBegin;
  708|       |
  709|   467k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 127k, False: 340k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|   127k|			qualName = stepBegin;
  713|  18.0M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 17.8M, False: 125k]
  |  Branch (713:31): [True: 17.8M, False: 417]
  |  Branch (713:52): [True: 17.8M, False: 714]
  |  Branch (713:73): [True: 17.8M, False: 0]
  ------------------
  714|   127k|			nameEnd = stepEnd;
  715|   127k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   340k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   340k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   340k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 340k, False: 0]
  |  Branch (723:30): [True: 340k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|  1.27M|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 1.27M, False: 0]
  |  Branch (726:32): [True: 1.27M, False: 0]
  |  Branch (726:53): [True: 938k, False: 340k]
  ------------------
  727|   340k|				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: 340k]
  ------------------
  728|   340k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   340k|			} 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|   340k|			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: 340k]
  ------------------
  774|   340k|			++stepEnd;
  775|       |			
  776|   340k|		}
  777|       |
  778|   467k|		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: 467k]
  ------------------
  779|   467k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   467k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   467k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 127k, False: 340k]
  ------------------
  782|       |
  783|   127k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 127k]
  ------------------
  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|   127k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 78.4k, False: 48.6k]
  ------------------
  788|  78.4k|				++qualName;
  789|  78.4k|				stepFlags = kXMP_QualifierStep;
  790|  78.4k|			}
  791|   127k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   340k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   340k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 340k]
  ------------------
  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|   467k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   467k|	}
  812|       |
  813|   403k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   475k|{
  829|   475k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   475k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   475k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|  1.30M|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 1.24M, False: 63.2k]
  ------------------
  834|  1.24M|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|  1.24M|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|  1.24M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|  1.24M|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 412k, False: 828k]
  ------------------
  837|   412k|			schemaNode = currSchema;
  838|   412k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 385k, False: 27.3k]
  ------------------
  839|   412k|			break;
  840|   412k|		}
  841|  1.24M|	}
  842|       |	
  843|   475k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 63.2k, False: 412k]
  |  Branch (843:28): [True: 26.1k, False: 37.0k]
  ------------------
  844|       |
  845|  26.1k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  26.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  26.1k|		XMP_StringPtr prefixPtr;
  847|  26.1k|		XMP_StringLen prefixLen;
  848|  26.1k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  26.1k|		XMP_Assert ( found );
  ------------------
  |  |  142|  26.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  26.1k|		UNUSED(found);
  851|       |
  852|  26.1k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  26.1k|		xmpTree->children.push_back ( schemaNode );
  854|  26.1k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 11.3k, False: 14.7k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  26.1k|	}
  861|       |	
  862|   475k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   475k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   475k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   475k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   475k|	return schemaNode;
  865|       |	
  866|   475k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   503k|{
  882|   503k|	XMP_Node * childNode = 0;
  883|       |
  884|   503k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 10, False: 503k]
  ------------------
  885|     10|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     10|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 10, False: 0]
  ------------------
  886|     10|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|		}
  888|      0|		if ( parent->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|      0|			XMP_Throw ( "Named children not allowed for arrays", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  890|      0|		}
  891|      0|		if ( ! createNodes ) {	// *** Should be assert? If !createNodes, why is the parent a new implicit node?
  ------------------
  |  Branch (891:8): [True: 0, False: 0]
  ------------------
  892|      0|			XMP_Throw ( "Parent is new implicit node, but createNodes is false", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  893|      0|		}
  894|      0|		parent->options |= kXMP_PropValueIsStruct;
  895|      0|	}
  896|       |	
  897|  2.03M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 1.93M, False: 101k]
  ------------------
  898|  1.93M|		XMP_Node * currChild = parent->children[childNum];
  899|  1.93M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  1.93M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  1.93M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 402k, False: 1.52M]
  ------------------
  901|   402k|			childNode = currChild;
  902|   402k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 402k, False: 318]
  ------------------
  903|   402k|			break;
  904|   402k|		}
  905|  1.93M|	}
  906|       |	
  907|   503k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 101k, False: 402k]
  |  Branch (907:27): [True: 42.8k, False: 58.3k]
  ------------------
  908|  42.8k|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  42.8k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|  42.8k|		parent->children.push_back ( childNode );
  910|  42.8k|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 42.8k, False: 0]
  ------------------
  911|  42.8k|	}
  912|       |	
  913|   503k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   503k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   503k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   503k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   503k|	return childNode;
  916|       |	
  917|   503k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|  78.4k|{
  935|  78.4k|	XMP_Node * qualNode = 0;
  936|       |	
  937|  78.4k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|  78.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|   962k|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 925k, False: 37.3k]
  ------------------
  940|   925k|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|   925k|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|   925k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|   925k|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 41.0k, False: 884k]
  ------------------
  943|  41.0k|			qualNode = currQual;
  944|  41.0k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 41.0k, False: 0]
  ------------------
  945|  41.0k|			break;
  946|  41.0k|		}
  947|   925k|	}
  948|       |	
  949|  78.4k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 37.3k, False: 41.0k]
  |  Branch (949:26): [True: 37.3k, False: 0]
  ------------------
  950|       |
  951|  37.3k|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|  37.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|  37.3k|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|  37.3k|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|  37.3k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|  37.3k|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|  37.3k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|  37.3k|		const bool isSpecial = isLang | isType;
  957|       |
  958|  37.3k|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 7.31k, False: 30.0k]
  ------------------
  959|  7.31k|			parent->options |= kXMP_PropHasLang;
  960|  30.0k|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 17, False: 30.0k]
  ------------------
  961|     17|			parent->options |= kXMP_PropHasType;
  962|     17|		}
  963|       |		
  964|  37.3k|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 8.50k, False: 28.8k]
  |  Branch (964:38): [True: 28.8k, False: 4]
  ------------------
  965|  37.3k|			parent->qualifiers.push_back ( qualNode );
  966|  37.3k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 37.3k, False: 0]
  ------------------
  967|  37.3k|		} else {
  968|      4|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      4|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 4, False: 0]
  |  Branch (969:19): [True: 4, False: 0]
  ------------------
  970|      4|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      4|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 4, False: 0]
  ------------------
  972|      4|		}
  973|       |
  974|  37.3k|	}
  975|       |	
  976|  78.4k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|  78.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|  78.4k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  78.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|  78.4k|	return qualNode;
  979|       |	
  980|  78.4k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   397k|{
 1063|   397k|	XMP_Node *     currNode = 0;
 1064|   397k|	XMP_NodePtrPos currPos;
 1065|   397k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   397k|	bool           leafIsNew = false;
 1067|       |	
 1068|   397k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   397k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   397k|	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: 397k]
  ------------------
 1071|       |	
 1072|   397k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   397k|	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|   397k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 397k, False: 0]
  ------------------
 1082|       |		
 1083|   397k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   397k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 363, False: 396k]
  ------------------
 1085|       |
 1086|   396k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   396k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 11.3k, False: 385k]
  ------------------
 1087|  11.3k|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  11.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|  11.3k|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 11.3k, False: 0]
  ------------------
 1089|  11.3k|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|  11.3k|		}
 1091|       |
 1092|   396k|	} 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|   396k|	try {
 1138|  1.25M|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 861k, False: 396k]
  ------------------
 1139|   861k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   861k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 483, False: 860k]
  ------------------
 1141|   860k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   860k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 152k, False: 707k]
  ------------------
 1142|   152k|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|   152k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|   152k|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|   152k|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 141k, False: 11.4k]
  ------------------
 1145|   152k|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|   152k|			}
 1147|   860k|		}
 1148|   396k|	} catch ( ... ) {
 1149|     18|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 18, False: 0]
  ------------------
 1150|     18|		throw;
 1151|     18|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   396k|EXIT:
 1156|       |
 1157|   396k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   396k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   396k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   396k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   396k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 152k, False: 243k]
  ------------------
 1161|   152k|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 152k, False: 0]
  ------------------
 1162|   152k|			currNode->options |= leafOptions;
 1163|   152k|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|   152k|	}
 1167|       |
 1168|   396k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 396k, False: 483]
  |  Branch (1168:26): [True: 0, False: 396k]
  ------------------
 1169|   396k|	return currNode;
 1170|       |	
 1171|   396k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  18.5k|{
 1344|  18.5k|	char * tagStart;
 1345|  18.5k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  18.5k|	tagStart = (char*) value->c_str();
 1350|   752k|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 746k, False: 6.77k]
  |  Branch (1350:45): [True: 734k, False: 11.7k]
  ------------------
 1351|   734k|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 713k, False: 20.8k]
  |  Branch (1351:28): [True: 7.45k, False: 706k]
  ------------------
 1352|   734k|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  18.5k|	tagStart = tagEnd;
 1357|  18.5k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 11.7k, False: 6.77k]
  ------------------
 1358|  1.64M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 1.62M, False: 17.3k]
  |  Branch (1358:45): [True: 1.62M, False: 1.14k]
  ------------------
 1359|  1.62M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.58M, False: 39.8k]
  |  Branch (1359:28): [True: 10.7k, False: 1.57M]
  ------------------
 1360|  1.62M|	}
 1361|  18.5k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 1.52k, False: 16.9k]
  ------------------
 1362|  1.52k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 97, False: 1.42k]
  |  Branch (1362:30): [True: 97, False: 0]
  ------------------
 1363|  1.52k|		++tagStart;
 1364|  1.52k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 1.51k, False: 12]
  |  Branch (1364:30): [True: 671, False: 840]
  ------------------
 1365|  1.52k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  20.8k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 20.8k, Folded]
  ------------------
 1370|  20.8k|		tagStart = tagEnd;
 1371|  20.8k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 2.44k, False: 18.4k]
  ------------------
 1372|  20.8k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 18.5k, False: 2.37k]
  ------------------
 1373|  8.75M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 8.75M, False: 1.08k]
  |  Branch (1373:46): [True: 8.75M, False: 1.29k]
  ------------------
 1374|  8.75M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 8.70M, False: 47.5k]
  |  Branch (1374:29): [True: 30.4k, False: 8.67M]
  ------------------
 1375|  8.75M|		}
 1376|  2.37k|	}
 1377|       |	
 1378|  18.5k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    851|{
 1391|    851|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    851|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    851|	size_t itemNum;
 1394|    851|	size_t itemLim = array->children.size();
 1395|    851|	bool   hasDefault = false;
 1396|       |	
 1397|  5.74k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 5.02k, False: 720]
  ------------------
 1398|       |	
 1399|  5.02k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 5.02k]
  ------------------
 1400|  5.02k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 5.02k]
  ------------------
 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|  5.02k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 131, False: 4.89k]
  ------------------
 1405|    131|			hasDefault = true;
 1406|    131|			break;
 1407|    131|		}
 1408|       |
 1409|  5.02k|	}
 1410|       |
 1411|    851|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 131, False: 720]
  ------------------
 1412|       |
 1413|    131|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 40, False: 91]
  ------------------
 1414|     40|			XMP_Node * temp = array->children[0];
 1415|     40|			array->children[0] = array->children[itemNum];
 1416|     40|			array->children[itemNum] = temp;
 1417|     40|		}
 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|    131|	}
 1423|       |	
 1424|    851|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.73k|{
 1435|  1.73k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.73k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.73k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  7.33k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 6.44k, False: 886]
  ------------------
 1440|  6.44k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  6.44k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 97, False: 6.34k]
  |  Branch (1441:50): [True: 753, False: 5.59k]
  ------------------
 1442|  6.44k|	}
 1443|       |	
 1444|  1.73k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.70k, False: 35]
  |  Branch (1444:25): [True: 851, False: 850]
  ------------------
 1445|    851|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    851|		NormalizeLangArray ( xmpParent );
 1447|    851|	}
 1448|       |
 1449|  1.73k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   403k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   403k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   403k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   403k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   403k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   403k|	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: 403k]
  ------------------
  161|       |
  162|   403k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 403k]
  |  Branch (162:29): [True: 0, False: 403k]
  ------------------
  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|  48.9M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 48.5M, False: 403k]
  ------------------
  166|  48.5M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 48.5M]
  |  Branch (166:24): [True: 0, False: 48.5M]
  ------------------
  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|  48.5M|	}
  170|       |
  171|   403k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   403k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 403k]
  ------------------
  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|   403k|	XMP_StringPtr colonPos = propName;
  177|  33.6M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 33.5M, False: 165k]
  |  Branch (177:30): [True: 33.2M, False: 237k]
  ------------------
  178|   403k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   403k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 165k, False: 237k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|   165k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|   165k|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|   165k|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   237k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   237k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   237k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   237k|		XMP_VarString prefix ( propName, prefixLen );
  198|   237k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   237k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 237k]
  ------------------
  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|   237k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 78, False: 237k]
  ------------------
  203|     78|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     78|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   237k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   237k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   237k|	}
  210|       |
  211|   403k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|   127k|{
  220|   127k|	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: 127k]
  ------------------
  221|       |
  222|   127k|	XMP_StringPtr colonPos = qualName;
  223|  13.4M|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 13.4M, False: 0]
  |  Branch (223:34): [True: 13.2M, False: 127k]
  ------------------
  224|   127k|	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: 127k]
  |  Branch (224:33): [True: 0, False: 127k]
  ------------------
  225|       |
  226|   127k|	VerifySimpleXMLName ( qualName, colonPos );
  227|   127k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|   127k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|   127k|	XMP_VarString prefix ( qualName, prefixLen );
  231|   127k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|   127k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 57, False: 127k]
  ------------------
  233|     57|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|     57|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|   127k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   861k|{
  395|   861k|	XMP_Node * nextNode = 0;
  396|   861k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   861k|	XMP_Index      index    = 0;
  398|   861k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   861k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   861k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   861k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 445k, False: 415k]
  ------------------
  403|       |
  404|   445k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   445k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 78.4k, False: 337k]
  ------------------
  407|       |	
  408|  78.4k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|  78.4k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|  78.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|  78.4k|		++qualStep;
  411|  78.4k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   337k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   337k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 18, False: 337k]
  ------------------
  418|     18|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|     18|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   337k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 337k, False: 0]
  ------------------
  422|   337k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   337k|		} 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|   337k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 337k, False: 0]
  |  Branch (437:24): [True: 337k, False: 0]
  ------------------
  438|       |
  439|   337k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 337k]
  |  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|   337k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 337k, False: 0]
  |  Branch (464:27): [True: 337k, False: 0]
  ------------------
  465|       |	
  466|   337k|	}
  467|       |
  468|   861k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   860k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 860k, False: 483]
  |  Branch (468:26): [True: 152k, False: 707k]
  ------------------
  469|   152k|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|   152k|	}
  471|       |	
  472|   861k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   861k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   861k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   861k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   861k|	return nextNode;
  475|       |	
  476|   861k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   337k|{
  249|   337k|	XMP_Index index = 0;
  250|   337k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   337k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   337k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|  1.27M|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 934k, False: 337k]
  ------------------
  255|   934k|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|   934k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|   934k|		index = (index * 10) + (indexStep[chNum] - '0');
  257|   934k|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 934k]
  ------------------
  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|   934k|	}
  261|       |
  262|   337k|	--index;	// Change to a C-style, zero based index.
  263|   337k|	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: 337k]
  ------------------
  264|       |
  265|   337k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 72.6k, False: 264k]
  |  Branch (265:59): [True: 72.6k, False: 0]
  ------------------
  266|  72.6k|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|  72.6k|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  72.6k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|  72.6k|		arrayNode->children.push_back ( newItem );
  268|  72.6k|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   337k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 337k]
  ------------------
  272|   337k|	return index;
  273|       |	
  274|   337k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|   152k|{
  488|       |
  489|   152k|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 19, False: 152k]
  ------------------
  490|     19|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 19, False: 0]
  ------------------
  491|     19|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|     19|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 1, False: 18]
  ------------------
  492|       |
  493|      1|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      1|	}
  496|       |
  497|   152k|}	// CheckImplicitStruct
XMPCore_Impl.cpp:_ZL13DeleteSubtreeNSt3__111__wrap_iterIPP8XMP_NodeEE:
  507|     18|{
  508|     18|	XMP_Node * rootNode   = *rootNodePos;
  509|     18|	XMP_Node * rootParent = rootNode->parent;
  510|       |
  511|     18|	if ( ! (rootNode->options & kXMP_PropIsQualifier) ) {
  ------------------
  |  Branch (511:7): [True: 18, False: 0]
  ------------------
  512|       |
  513|     18|		rootParent->children.erase ( rootNodePos );
  514|       |
  515|     18|	} else {
  516|       |
  517|      0|		rootParent->qualifiers.erase ( rootNodePos );
  518|       |
  519|      0|		XMP_Assert ( rootParent->options & kXMP_PropHasQualifiers);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  520|      0|		if ( rootParent->qualifiers.empty() ) rootParent->options ^= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (520:8): [True: 0, False: 0]
  ------------------
  521|       |
  522|      0|		if ( rootNode->name == "xml:lang" ) {
  ------------------
  |  Branch (522:8): [True: 0, False: 0]
  ------------------
  523|      0|			XMP_Assert ( rootParent->options & kXMP_PropHasLang);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  524|      0|			rootParent->options ^= kXMP_PropHasLang;
  525|      0|		} else if ( rootNode->name == "rdf:type" ) {
  ------------------
  |  Branch (525:15): [True: 0, False: 0]
  ------------------
  526|      0|			XMP_Assert ( rootParent->options & kXMP_PropHasType);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  527|      0|			rootParent->options ^= kXMP_PropHasType;
  528|      0|		}
  529|       |
  530|      0|	}
  531|       |
  532|     18|	delete rootNode;
  533|       |
  534|     18|}	// DeleteSubtree

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

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

_ZN7XMPMeta11SetPropertyEPKcS1_S1_j:
  454|   152k|{
  455|   152k|	XMP_Assert ( (schemaNS != 0) && (propName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|   152k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  456|       |
  457|   152k|	options = VerifySetOptions ( options, propValue );
  458|       |
  459|   152k|	XMP_ExpandedXPath expPath;
  460|   152k|	ExpandXPath ( schemaNS, propName, &expPath );
  461|       |
  462|   152k|	XMP_Node * propNode = FindNode ( &tree, expPath, kXMP_CreateNodes, options );
  ------------------
  |  |  295|   152k|#define kXMP_CreateNodes	true
  ------------------
  463|   152k|	if ( propNode == 0 ) XMP_Throw ( "Specified property does not exist", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (463:7): [True: 0, False: 152k]
  ------------------
  464|       |	
  465|   152k|	SetNode ( propNode, propValue, options );
  466|       |	
  467|   152k|}	// SetProperty
_ZN7XMPMeta15AppendArrayItemEPKcS1_jS1_j:
  503|  3.45k|{
  504|  3.45k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  505|       |
  506|  3.45k|	arrayOptions = VerifySetOptions ( arrayOptions, 0 );
  507|  3.45k|	if ( (arrayOptions & ~kXMP_PropArrayFormMask) != 0 ) {
  ------------------
  |  Branch (507:7): [True: 0, False: 3.45k]
  ------------------
  508|      0|		XMP_Throw ( "Only array form flags allowed for arrayOptions", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  509|      0|	}
  510|       |	
  511|       |	// Locate or create the array. If it already exists, make sure the array form from the options
  512|       |	// parameter is compatible with the current state.
  513|       |	
  514|  3.45k|	XMP_ExpandedXPath arrayPath;
  515|  3.45k|	ExpandXPath ( schemaNS, arrayName, &arrayPath );
  516|  3.45k|	XMP_Node * arrayNode = FindNode ( &tree, arrayPath, kXMP_ExistingOnly );	// Just lookup, don't try to create.
  ------------------
  |  |  296|  3.45k|#define kXMP_ExistingOnly	false
  ------------------
  517|       |	
  518|  3.45k|	if ( arrayNode != 0 ) {
  ------------------
  |  Branch (518:7): [True: 2.61k, False: 846]
  ------------------
  519|       |		// The array exists, make sure the form is compatible. Zero arrayForm means take what exists.
  520|  2.61k|		if ( ! (arrayNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 2.61k]
  ------------------
  521|      0|			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 ); }
  ------------------
  522|      0|		}
  523|       |		#if 0
  524|       |			// *** Disable for now. Need to do some general rethinking of semantic checks.
  525|       |			if ( (arrayOptions != 0) && (arrayOptions != (arrayNode->options & kXMP_PropArrayFormMask)) ) {
  526|       |				XMP_Throw ( "Mismatch of existing and specified array form", kXMPErr_BadOptions );
  527|       |			}
  528|       |		#endif
  529|  2.61k|	} else {
  530|       |		// The array does not exist, try to create it.
  531|    846|		if ( arrayOptions == 0 ) XMP_Throw ( "Explicit arrayOptions required to create new array", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (531:8): [True: 0, False: 846]
  ------------------
  532|    846|		arrayNode = FindNode ( &tree, arrayPath, kXMP_CreateNodes, arrayOptions );
  ------------------
  |  |  295|    846|#define kXMP_CreateNodes	true
  ------------------
  533|    846|		if ( arrayNode == 0 ) XMP_Throw ( "Failure creating array node", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (533:8): [True: 0, False: 846]
  ------------------
  534|    846|	}
  535|       |	
  536|  3.45k|	DoSetArrayItem ( arrayNode, kXMP_ArrayLastItem, itemValue, (options | kXMP_InsertAfterItem) );
  537|       |	
  538|  3.45k|}	// AppendArrayItem
_ZN7XMPMeta12SetQualifierEPKcS1_S1_S1_S1_j:
  575|  3.45k|{
  576|  3.45k|	XMP_Assert ( (schemaNS != 0) && (propName != 0) && (qualNS != 0) && (qualName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  577|       |
  578|  3.45k|	XMP_StringPtr	qualPath;
  579|  3.45k|	XMP_StringLen	pathLen;
  580|       |
  581|  3.45k|	XMP_ExpandedXPath expPath;
  582|  3.45k|	ExpandXPath ( schemaNS, propName, &expPath );
  583|  3.45k|	XMP_Node * propNode = FindNode ( &tree, expPath, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.45k|#define kXMP_ExistingOnly	false
  ------------------
  584|  3.45k|	if ( propNode == 0 ) XMP_Throw ( "Specified property does not exist", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (584:7): [True: 0, False: 3.45k]
  ------------------
  585|       |
  586|  3.45k|	XMPUtils::ComposeQualifierPath ( schemaNS, propName, qualNS, qualName, &qualPath, &pathLen );
  587|  3.45k|	SetProperty ( schemaNS, qualPath, qualValue, options );
  588|       |
  589|  3.45k|}	// SetQualifier
XMPMeta-GetSet.cpp:_ZL7SetNodeP8XMP_NodePKcj:
  117|   155k|{
  118|   155k|	if ( options & kXMP_DeleteExisting ) {
  ------------------
  |  Branch (118:7): [True: 0, False: 155k]
  ------------------
  119|      0|		XMP_ClearOption ( options, kXMP_DeleteExisting );
  120|      0|		node->options = options;
  121|      0|		node->value.erase();
  122|      0|		node->RemoveChildren();
  123|      0|		node->RemoveQualifiers();
  124|      0|	}
  125|       |	
  126|   155k|	node->options |= options;	// Keep options set by FindNode when creating a new node.
  127|       |
  128|   155k|	if ( value != 0 ) {
  ------------------
  |  Branch (128:7): [True: 143k, False: 11.9k]
  ------------------
  129|       |	
  130|       |		// This is setting the value of a leaf node.
  131|   143k|		if ( node->options & kXMP_PropCompositeMask ) XMP_Throw ( "Composite nodes can't have values", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (131:8): [True: 0, False: 143k]
  ------------------
  132|   143k|		XMP_Assert ( node->children.empty() );
  ------------------
  |  |  142|   143k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  133|   143k|		SetNodeValue ( node, value );
  134|       |	
  135|   143k|	} else {
  136|       |	
  137|       |		// This is setting up an array or struct.
  138|  11.9k|		if ( ! node->value.empty() ) XMP_Throw ( "Composite nodes can't have values", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (138:8): [True: 0, False: 11.9k]
  ------------------
  139|  11.9k|		if ( node->options & kXMP_PropCompositeMask ) {	// Can't change an array to a struct, or vice versa.
  ------------------
  |  Branch (139:8): [True: 8.56k, False: 3.34k]
  ------------------
  140|  8.56k|			if ( (options & kXMP_PropCompositeMask) != (node->options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8.56k]
  ------------------
  141|      0|				XMP_Throw ( "Requested and existing composite form mismatch", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  142|      0|			}
  143|  8.56k|		}
  144|  11.9k|		node->RemoveChildren();
  145|       |	
  146|  11.9k|	}
  147|       |	
  148|   155k|}	// SetNode
XMPMeta-GetSet.cpp:_ZL14DoSetArrayItemP8XMP_NodeiPKcj:
  160|  3.45k|{
  161|  3.45k|	XMP_OptionBits itemLoc = options & kXMP_PropArrayLocationMask;
  162|  3.45k|	XMP_Index      arraySize = arrayNode->children.size();
  163|       |	
  164|  3.45k|	options &= ~kXMP_PropArrayLocationMask;
  165|  3.45k|	options = VerifySetOptions ( options, itemValue );
  166|       |	
  167|       |	// Now locate or create the item node and set the value. Note the index parameter is one-based!
  168|       |	// The index can be in the range [0..size+1] or "last", normalize it and check the insert flags.
  169|       |	// The order of the normalization checks is important. If the array is empty we end up with an
  170|       |	// index and location to set item size+1.
  171|       |	
  172|  3.45k|	XMP_Node * itemNode = 0;
  173|       |	
  174|  3.45k|	if ( itemIndex == kXMP_ArrayLastItem ) itemIndex = arraySize;
  ------------------
  |  Branch (174:7): [True: 3.45k, False: 0]
  ------------------
  175|  3.45k|	if ( (itemIndex == 0) && (itemLoc == kXMP_InsertAfterItem) ) {
  ------------------
  |  Branch (175:7): [True: 846, False: 2.61k]
  |  Branch (175:27): [True: 846, False: 0]
  ------------------
  176|    846|		itemIndex = 1;
  177|    846|		itemLoc = kXMP_InsertBeforeItem;
  178|    846|	}
  179|  3.45k|	if ( (itemIndex == arraySize) && (itemLoc == kXMP_InsertAfterItem) ) {
  ------------------
  |  Branch (179:7): [True: 2.61k, False: 846]
  |  Branch (179:35): [True: 2.61k, False: 0]
  ------------------
  180|  2.61k|		itemIndex += 1;
  181|  2.61k|		itemLoc = 0;
  182|  2.61k|	}
  183|  3.45k|	if ( (itemIndex == arraySize+1) && (itemLoc == kXMP_InsertBeforeItem) ) itemLoc = 0;
  ------------------
  |  Branch (183:7): [True: 3.45k, False: 0]
  |  Branch (183:37): [True: 846, False: 2.61k]
  ------------------
  184|       |	
  185|  3.45k|	if ( itemIndex == arraySize+1 ) {
  ------------------
  |  Branch (185:7): [True: 3.45k, False: 0]
  ------------------
  186|       |
  187|  3.45k|		if ( itemLoc != 0 ) XMP_Throw ( "Can't insert before or after implicit new item", kXMPErr_BadIndex );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (187:8): [True: 0, False: 3.45k]
  ------------------
  188|  3.45k|		itemNode = new XMP_Node ( arrayNode, kXMP_ArrayItemName, 0 );
  ------------------
  |  |  293|  3.45k|#define kXMP_ArrayItemName	"[]"
  ------------------
  189|  3.45k|		arrayNode->children.push_back ( itemNode );
  190|       |
  191|  3.45k|	} else {
  192|       |
  193|      0|		if ( (itemIndex < 1) || (itemIndex > arraySize) ) XMP_Throw ( "Array index out of bounds", kXMPErr_BadIndex );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (193:8): [True: 0, False: 0]
  |  Branch (193:27): [True: 0, False: 0]
  ------------------
  194|      0|		--itemIndex;	// ! Convert the index to a C zero-based value!
  195|      0|		if ( itemLoc == 0 ) {
  ------------------
  |  Branch (195:8): [True: 0, False: 0]
  ------------------
  196|      0|			itemNode = arrayNode->children[itemIndex];
  197|      0|		} else {
  198|      0|			XMP_NodePtrPos itemPos = arrayNode->children.begin() + itemIndex;
  199|      0|			if ( itemLoc == kXMP_InsertAfterItem ) ++itemPos;
  ------------------
  |  Branch (199:9): [True: 0, False: 0]
  ------------------
  200|      0|			itemNode = new XMP_Node ( arrayNode, kXMP_ArrayItemName, 0 );
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  201|      0|			itemPos = arrayNode->children.insert ( itemPos, itemNode );
  202|      0|		}
  203|       |
  204|      0|	}
  205|       |	
  206|  3.45k|	SetNode ( itemNode, itemValue, options );
  207|       |	
  208|  3.45k|}	// DoSetArrayItem
XMPMeta-GetSet.cpp:_ZL12SetNodeValueP8XMP_NodePKc:
   76|   143k|{
   77|       |
   78|       |	#if XMP_DebugBuild	// ! Hack to force an assert.
   79|       |		if ( (node->name == "xmp:TestAssertNotify") && XMP_LitMatch ( value, "DoIt!" ) ) {
   80|       |			XMP_Assert ( node->name != "xmp:TestAssertNotify" );
   81|       |		}
   82|       |	#endif
   83|       |	
   84|   143k|	node->value = value;
   85|       |	
   86|   143k|	XMP_Uns8* chPtr = (XMP_Uns8*) node->value.c_str();	// Check for valid UTF-8, replace ASCII controls with a space.
   87|   294k|	while ( *chPtr != 0 ) {
  ------------------
  |  Branch (87:10): [True: 150k, False: 143k]
  ------------------
   88|  13.5M|		while ( (*chPtr != 0) && (*chPtr < 0x80) ) {
  ------------------
  |  Branch (88:11): [True: 13.4M, False: 143k]
  |  Branch (88:28): [True: 13.4M, False: 7.35k]
  ------------------
   89|  13.4M|			if ( *chPtr < 0x20 ) {
  ------------------
  |  Branch (89:9): [True: 4.30k, False: 13.4M]
  ------------------
   90|  4.30k|				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  100|  4.30k|#define kTab ((char)0x09)
  ------------------
              				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  101|  1.97k|#define kLF ((char)0x0A)
  ------------------
              				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  102|  1.00k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (90:10): [True: 1.97k, False: 2.32k]
  |  Branch (90:30): [True: 1.00k, False: 965]
  |  Branch (90:49): [True: 676, False: 330]
  ------------------
   91|  13.4M|			} else if (*chPtr == 0x7F ) {
  ------------------
  |  Branch (91:15): [True: 259, False: 13.4M]
  ------------------
   92|    259|				*chPtr = 0x20;
   93|    259|			}
   94|  13.4M|			++chPtr;
   95|  13.4M|		}
   96|   150k|		XMP_Assert ( (*chPtr == 0) || (*chPtr >= 0x80) );
  ------------------
  |  |  142|   150k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   97|   150k|		if ( *chPtr != 0 ) (void) GetCodePoint ( (const XMP_Uns8 **) &chPtr );	// Throws for bad UTF-8.
  ------------------
  |  Branch (97:8): [True: 7.35k, False: 143k]
  ------------------
   98|   150k|	}
   99|       |
  100|   143k|	if ( XMP_PropIsQualifier(node->options) && (node->name == "xml:lang") ) NormalizeLangValue ( &node->value );
  ------------------
  |  Branch (100:7): [True: 37.1k, False: 106k]
  |  Branch (100:45): [True: 7.17k, False: 30.0k]
  ------------------
  101|       |
  102|       |	#if 0	// *** XMP_DebugBuild
  103|       |		node->_valuePtr = node->value.c_str();
  104|       |	#endif
  105|       |	
  106|   143k|}	// SetNodeValue

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  5.97k|{
 1097|  5.97k|	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: 5.97k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  5.97k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 5.97k]
  ------------------
 1099|       |	
 1100|  5.97k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  5.97k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  5.97k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 5.97k, False: 0]
  ------------------
 1105|  5.97k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 5.97k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  5.97k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  5.97k|	}
 1108|       |	
 1109|  5.97k|	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|  5.97k|	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|  5.97k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 5.97k, False: 0]
  ------------------
 1127|       |
 1128|  5.97k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 5.97k, False: 0]
  |  Branch (1128:39): [True: 5.94k, False: 31]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  5.94k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  5.94k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     31|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     31|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 31, False: 0]
  ------------------
 1139|       |
 1140|     31|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     31|				buffer += pendingOverlap;
 1142|     31|				xmpSize -= pendingOverlap;
 1143|     31|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     31|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 31]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     31|				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|     31|			}
 1153|       |
 1154|  5.97k|		}
 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|  5.97k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  5.97k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  5.97k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 5.97k]
  ------------------
 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|  5.97k|		} 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|  6.00k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 31, False: 5.97k]
  ------------------
 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|     31|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     31|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 31, False: 0]
  ------------------
 1190|       |				
 1191|     31|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     31|				parser.pendingCount += pendingOverlap;
 1193|     31|				buffer += pendingOverlap;
 1194|     31|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     31|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 31]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     31|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     31|				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|     31|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 31, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     31|					parser.pendingCount = 0;
 1208|       |
 1209|     31|				} 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|     31|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  5.97k|			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|  5.97k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 5.97k]
  ------------------
 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|  5.97k|		}
 1258|       |		
 1259|  5.97k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 5.94k, False: 31]
  ------------------
 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|  5.94k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  5.94k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 5.48k, False: 459]
  ------------------
 1269|       |
 1270|  5.48k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  5.48k|				NormalizeDCArrays ( &this->tree );
 1272|  5.48k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 5.48k]
  ------------------
 1273|  5.48k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  5.48k|				size_t schemaNum = 0;
 1277|  17.5k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 12.0k, False: 5.48k]
  ------------------
 1278|  12.0k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  12.0k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 12.0k, False: 0]
  ------------------
 1280|  12.0k|						++schemaNum;
 1281|  12.0k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  12.0k|				}
 1286|       |				
 1287|  5.48k|			}
 1288|       |
 1289|  5.94k|			delete this->xmlParser;
 1290|  5.94k|			this->xmlParser = 0;
 1291|       |
 1292|  5.94k|		}
 1293|       |		
 1294|  5.97k|	} catch ( ... ) {
 1295|       |
 1296|  1.20k|		delete this->xmlParser;
 1297|  1.20k|		this->xmlParser = 0;
 1298|  1.20k|		prevTkVer = 0;
 1299|  1.20k|		this->tree.ClearNode();
 1300|  1.20k|		throw;
 1301|       |
 1302|  1.20k|	}
 1303|       |	
 1304|  5.97k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  5.97k|{
  811|  5.97k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 5.97k]
  ------------------
  812|       |	
  813|  5.97k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  5.97k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 5.97k]
  ------------------
  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|  5.97k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 5.95k, False: 16]
  ------------------
  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|  5.95k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 5.95k, 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|     16|	} 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|     16|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 16, 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|  5.97k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  6.00k|{
  977|  6.00k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  6.00k|	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|  6.00k|	std::string copy;
  992|       |		
  993|  71.2M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 71.2M, False: 6.00k]
  ------------------
  994|       |
  995|  71.2M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 70.9M, False: 279k]
  |  Branch (995:30): [True: 70.9M, False: 46.9k]
  |  Branch (995:52): [True: 70.3M, False: 537k]
  ------------------
  996|  70.3M|			copy.push_back(*spanEnd);
  997|  70.3M|			continue;	// A regular ASCII character.
  998|  70.3M|		}
  999|       |
 1000|   863k|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 24.3k, False: 839k]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  24.3k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  24.3k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 24.3k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  24.3k|				copy.append((const char*)spanEnd, uniLen);
 1010|  24.3k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  24.3k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|   839k|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 279k, False: 560k]
  |  Branch (1026:36): [True: 22.5k, False: 537k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   301k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   301k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   293k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|  26.6k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 8.04k, False: 293k]
  |  Branch (1030:31): [True: 267k, False: 26.6k]
  |  Branch (1030:52): [True: 4.13k, False: 22.5k]
  ------------------
 1031|   279k|				copy.push_back(*spanEnd);
 1032|   279k|				continue;
 1033|   279k|			}
 1034|       |
 1035|  22.5k|			copy.push_back(' ');
 1036|       |		
 1037|   537k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   537k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   537k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   537k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   537k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 4, False: 537k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|      4|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 4, False: 0]
  ------------------
 1048|      4|					copy.push_back('&');
 1049|      4|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|      4|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   537k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 28.6k, False: 508k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  28.6k|				copy.push_back(' ');
 1058|  28.6k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   508k|			} else {
 1061|   508k|				copy.push_back('&');
 1062|   508k|			}
 1063|       |
 1064|   537k|		}
 1065|       |		
 1066|   863k|	}
 1067|       |	
 1068|  6.00k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  6.00k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  6.00k|	copy.push_back(' ');
 1070|  6.00k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  6.00k|	return length;
 1072|       |
 1073|  6.00k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  24.3k|{
  868|  24.3k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  24.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  24.3k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 24.3k]
  ------------------
  870|  24.3k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 24.3k]
  ------------------
  871|       |	
  872|  24.3k|	int byteCount = 2;
  873|  24.3k|	XMP_Uns8 firstByte = *charStart;
  874|  31.7k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 7.32k, False: 24.3k]
  ------------------
  875|       |	
  876|  24.3k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 24.3k]
  ------------------
  877|       |
  878|  56.0k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 31.7k, False: 24.3k]
  ------------------
  879|  31.7k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 31.7k]
  ------------------
  880|  31.7k|	}
  881|       |	
  882|  24.3k|	return byteCount;
  883|       |	
  884|  24.3k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   537k|{
  898|   537k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   537k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   537k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 537k]
  ------------------
  900|   537k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   537k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   537k|	size_t tailLen = bufEnd - escStart;
  903|   537k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 4, False: 537k]
  ------------------
  904|       |	
  905|   537k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 249k, False: 287k]
  ------------------
  906|       |	
  907|   287k|	XMP_Uns8 escValue = 0;
  908|   287k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   287k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 285k, False: 2.34k]
  |  Branch (910:27): [True: 242k, False: 42.4k]
  ------------------
  911|   242k|		escValue = *escPos - '0';
  912|   242k|		++escPos;
  913|   242k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 39.2k, False: 5.52k]
  |  Branch (913:34): [True: 14.2k, False: 24.9k]
  ------------------
  914|  14.2k|		escValue = *escPos - 'A' + 10;
  915|  14.2k|		++escPos;
  916|  30.4k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 24.2k, False: 6.21k]
  |  Branch (916:34): [True: 14.1k, False: 10.1k]
  ------------------
  917|  14.1k|		escValue = *escPos - 'a' + 10;
  918|  14.1k|		++escPos;
  919|  14.1k|	}
  920|       |	
  921|   287k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 254k, False: 32.8k]
  |  Branch (921:27): [True: 88.0k, False: 166k]
  ------------------
  922|  88.0k|		escValue = (escValue << 4) + (*escPos - '0');
  923|  88.0k|		++escPos;
  924|   199k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 46.8k, False: 152k]
  |  Branch (924:34): [True: 13.3k, False: 33.5k]
  ------------------
  925|  13.3k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  13.3k|		++escPos;
  927|   186k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 29.3k, False: 157k]
  |  Branch (927:34): [True: 4.36k, False: 25.0k]
  ------------------
  928|  4.36k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|  4.36k|		++escPos;
  930|  4.36k|	}
  931|       |	
  932|   287k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 287k]
  ------------------
  933|   287k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 165k, False: 122k]
  ------------------
  934|       |	
  935|   122k|	size_t escLen = escPos - escStart + 1;
  936|   122k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 2.54k, False: 119k]
  ------------------
  937|       |	
  938|   119k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|   119k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  29.3k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  28.9k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 90.6k, False: 29.3k]
  |  Branch (938:29): [True: 315, False: 28.9k]
  |  Branch (938:50): [True: 329, False: 28.6k]
  ------------------
  939|       |	
  940|  28.6k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|   119k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  5.94k|{
  152|  5.94k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  5.94k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 103, False: 5.83k]
  ------------------
  155|  5.94k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 459, False: 5.48k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  5.48k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  5.48k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  5.48k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  5.48k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 5.48k]
  ------------------
  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|  6.01k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.62k, False: 4.38k]
  ------------------
  168|  1.62k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.62k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 1.07k, False: 554]
  |  Branch (169:42): [True: 27, False: 527]
  ------------------
  170|  1.09k|				verStr = currAttr->value.c_str();
  171|  1.09k|				break;
  172|  1.09k|			}
  173|  1.62k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  5.48k|	unsigned long part;
  178|  35.8k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 31.3k, False: 4.41k]
  |  Branch (178:29): [True: 2.60k, False: 28.7k]
  |  Branch (178:48): [True: 27.7k, False: 1.06k]
  ------------------
  179|       |	
  180|  5.48k|	part = 0;
  181|  8.33k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.91k, False: 4.42k]
  |  Branch (181:28): [True: 3.01k, False: 905]
  |  Branch (181:48): [True: 2.85k, False: 156]
  ------------------
  182|  2.85k|		part = (part * 10) + (*verStr - '0');
  183|  2.85k|		++verStr;
  184|  2.85k|	}
  185|  5.48k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 149, False: 5.33k]
  ------------------
  186|  5.48k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  5.48k|	part = 0;
  189|  5.48k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 616, False: 4.86k]
  ------------------
  190|  7.55k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 3.13k, False: 4.42k]
  |  Branch (190:28): [True: 2.24k, False: 887]
  |  Branch (190:48): [True: 2.07k, False: 173]
  ------------------
  191|  2.07k|		part = (part * 10) + (*verStr - '0');
  192|  2.07k|		++verStr;
  193|  2.07k|	}
  194|  5.48k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 126, False: 5.35k]
  ------------------
  195|  5.48k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  5.48k|	part = 0;
  198|  5.48k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 129, False: 5.35k]
  ------------------
  199|  6.51k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 2.08k, False: 4.42k]
  |  Branch (199:28): [True: 1.27k, False: 809]
  |  Branch (199:48): [True: 1.02k, False: 248]
  ------------------
  200|  1.02k|		part = (part * 10) + (*verStr - '0');
  201|  1.02k|		++verStr;
  202|  1.02k|	}
  203|  5.48k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 49, False: 5.43k]
  ------------------
  204|  5.48k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  5.48k|	part = 0;
  207|  5.48k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 521, False: 4.96k]
  ------------------
  208|  6.29k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.85k, False: 4.43k]
  |  Branch (208:28): [True: 1.54k, False: 314]
  |  Branch (208:48): [True: 807, False: 738]
  ------------------
  209|    807|		part = (part * 10) + (*verStr - '0');
  210|    807|		++verStr;
  211|    807|	}
  212|  5.48k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 27, False: 5.45k]
  ------------------
  213|  5.48k|	thiz->prevTkVer += part;
  214|       |	
  215|  5.48k|	return rootNode;
  216|       |	
  217|  5.48k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|    834|{
  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|  6.18k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 5.48k, False: 707]
  ------------------
  116|  5.48k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  5.48k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 3.62k, False: 1.85k]
  ------------------
  118|  1.85k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 127, False: 1.72k]
  |  Branch (118:44): [True: 0, False: 1.72k]
  ------------------
  119|  1.85k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|    707|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 707, False: 0]
  ------------------
  122|  4.94k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 4.32k, False: 613]
  ------------------
  123|  4.32k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  4.32k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 2.80k, False: 1.52k]
  ------------------
  125|  1.52k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 94, False: 1.42k]
  ------------------
  126|  1.52k|		}
  127|    707|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  1.21k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 604, False: 609]
  ------------------
  131|    604|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|    604|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 4, False: 600]
  ------------------
  133|    604|	}
  134|       |	
  135|    609|	return 0;
  136|       |
  137|    613|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  4.31k|{
  232|  4.31k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.31k|#define kXMP_ExistingOnly	false
  ------------------
  233|  4.31k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 3.91k, False: 396]
  ------------------
  234|       |	
  235|  1.55k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 1.15k, False: 396]
  ------------------
  236|  1.15k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  1.15k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  1.15k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 205, False: 954]
  ------------------
  240|       |		
  241|    954|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 41, False: 913]
  ------------------
  242|    913|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 6, False: 907]
  ------------------
  243|     47|			arrayForm = kXMP_PropArrayIsOrdered;
  244|    907|		} else if (
  245|    907|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 3, False: 904]
  ------------------
  246|    904|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 11, False: 893]
  ------------------
  247|    893|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 44, False: 849]
  ------------------
  248|     58|			arrayForm = kXMP_PropArrayIsAltText;
  249|    849|		} else if (
  250|    849|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 19, False: 830]
  ------------------
  251|    830|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 18, False: 812]
  ------------------
  252|    812|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 11, False: 801]
  ------------------
  253|    801|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 16, False: 785]
  ------------------
  254|    785|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 31, False: 754]
  ------------------
  255|    754|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 0, False: 754]
  ------------------
  256|     95|			arrayForm = kXMP_PropValueIsArray;
  257|     95|		}
  258|    954|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 754, False: 200]
  ------------------
  259|       |		
  260|    200|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    200|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    200|		dcSchema->children[propNum] = newArray;
  263|    200|		newArray->children.push_back ( currProp );
  264|    200|		currProp->parent = newArray;
  265|    200|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    200|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    200|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 58, False: 142]
  |  Branch (267:44): [True: 32, False: 26]
  ------------------
  268|     32|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|     32|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|     32|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 32, False: 0]
  ------------------
  271|     32|				currProp->qualifiers.push_back ( newLang );
  272|     32|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|     32|		}
  276|       |
  277|    200|	}
  278|       |	
  279|    396|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  4.31k|{
  666|  4.31k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  4.31k|	XMP_Node * currSchema = 0;
  671|       |
  672|  4.31k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.31k|#define kXMP_ExistingOnly	false
  ------------------
  673|  4.31k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 18, False: 4.29k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     18|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     18|#define kXMP_ExistingOnly	false
  ------------------
  677|     18|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 18]
  ------------------
  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|     18|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     18|#define kXMP_ExistingOnly	false
  ------------------
  682|     18|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 18]
  |  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|     18|	}
  697|       |
  698|  4.31k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.31k|#define kXMP_ExistingOnly	false
  ------------------
  699|  4.31k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 4.31k]
  ------------------
  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|      0|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|      0|#define kXMP_ExistingOnly	false
  ------------------
  703|      0|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 0]
  ------------------
  704|      0|	}
  705|       |
  706|  4.31k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  4.31k|#define kXMP_ExistingOnly	false
  ------------------
  707|  4.31k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 396, False: 3.91k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    396|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    396|#define kXMP_ExistingOnly	false
  ------------------
  710|    396|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 35, False: 361]
  ------------------
  711|     35|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     35|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     35|		}
  714|    396|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  4.31k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  4.31k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  4.31k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  4.31k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  4.31k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  4.31k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 234, False: 4.07k]
  ------------------
  732|       |
  733|    234|		bool nameIsUUID = false;
  734|    234|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    234|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    234|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 31, False: 203]
  |  |  ------------------
  ------------------
  737|       |
  738|     31|			nameIsUUID = true;
  739|       |
  740|    203|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 117, False: 86]
  ------------------
  741|       |
  742|    117|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  2.23k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 2.21k, False: 16]
  ------------------
  744|  2.21k|				char ch = nameStr[i];
  745|  2.21k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 136, False: 2.08k]
  ------------------
  746|    136|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 64, False: 72]
  |  Branch (746:23): [True: 24, False: 48]
  |  Branch (746:36): [True: 11, False: 37]
  |  Branch (746:49): [True: 13, False: 24]
  ------------------
  747|     24|					nameIsUUID = false;
  748|     24|					break;
  749|  2.08k|				} else {
  750|  2.08k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 2.07k, False: 13]
  |  Branch (750:27): [True: 1.17k, False: 898]
  |  Branch (750:44): [True: 865, False: 46]
  |  Branch (750:59): [True: 834, False: 31]
  ------------------
  751|     77|					nameIsUUID = false;
  752|     77|					break;
  753|  2.08k|				}
  754|  2.21k|			}
  755|       |
  756|    117|		}
  757|       |		
  758|    234|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 47, False: 187]
  ------------------
  759|       |
  760|     47|			XMP_ExpandedXPath expPath;
  761|     47|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     47|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     47|#define kXMP_CreateNodes	true
  ------------------
  763|     47|			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: 47]
  ------------------
  764|       |
  765|     47|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     47|			idNode->value = tree.name;
  767|     47|			idNode->RemoveChildren();
  768|     47|			idNode->RemoveQualifiers();
  769|       |
  770|     47|			tree.name.erase();
  771|       |
  772|     47|		}
  773|       |
  774|    234|	}
  775|       |
  776|  4.31k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  21.5k|{
  610|  21.5k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  21.5k|#define kXMP_ExistingOnly	false
  ------------------
  611|  21.5k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 20.2k, False: 1.27k]
  ------------------
  612|       |	
  613|  1.27k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.27k|#define kXMP_ExistingOnly	false
  ------------------
  614|  1.27k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.01k, False: 261]
  |  Branch (614:27): [True: 143, False: 118]
  ------------------
  615|       |	
  616|    118|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 10, False: 108]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|    108|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|    916|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 808, False: 108]
  ------------------
  622|       |
  623|    808|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|    808|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 43, False: 765]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     43|			delete ( currChild );
  629|     43|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|    765|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 617, False: 148]
  ------------------
  632|       |		
  633|    617|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 25, False: 592]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     25|				delete ( currChild );
  637|     25|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|    592|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|    592|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|    592|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 592, False: 0]
  ------------------
  644|    592|					currChild->qualifiers.push_back ( repairLang );
  645|    592|				} else {
  646|      0|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|      0|				}
  648|    592|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|    592|			}
  651|       |
  652|    617|		}
  653|       |
  654|    808|	}
  655|       |
  656|    108|}	// RepairAltText

_ZNK7XMPMeta17SerializeToBufferEPPKcPjjjS1_S1_i:
 1165|  3.82k|{
 1166|  3.82k|	XMP_Assert ( (rdfString != 0) && (rdfSize != 0) && (newline != 0) && (indentStr != 0) );
  ------------------
  |  |  142|  3.82k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1167|       |
 1168|       |	// Fix up some default parameters.
 1169|       |	
 1170|  3.82k|	enum { kDefaultPad = 2048 };
 1171|  3.82k|	size_t unicodeUnitSize = 1;
 1172|  3.82k|	XMP_OptionBits charEncoding = options & kXMP_EncodingMask;
 1173|       |
 1174|  3.82k|	if ( charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1174:7): [True: 0, False: 3.82k]
  ------------------
 1175|      0|		if ( options & _XMP_UTF16_Bit ) {
  ------------------
  |  Branch (1175:8): [True: 0, False: 0]
  ------------------
 1176|      0|			if ( options & _XMP_UTF32_Bit ) XMP_Throw ( "Can't use both _XMP_UTF16_Bit and _XMP_UTF32_Bit", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1176:9): [True: 0, False: 0]
  ------------------
 1177|      0|			unicodeUnitSize = 2;
 1178|      0|		} else if ( options & _XMP_UTF32_Bit ) {
  ------------------
  |  Branch (1178:15): [True: 0, False: 0]
  ------------------
 1179|      0|			unicodeUnitSize = 4;
 1180|      0|		} else {
 1181|      0|			XMP_Throw ( "Can't use _XMP_LittleEndian_Bit by itself", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1182|      0|		}
 1183|      0|	}
 1184|       |	
 1185|  3.82k|	if ( options & kXMP_OmitAllFormatting ) {
  ------------------
  |  Branch (1185:7): [True: 12, False: 3.81k]
  ------------------
 1186|     12|		newline = " ";	// ! Yes, a space for "newline". This ensures token separation.
 1187|     12|		indentStr = "";
 1188|  3.81k|	} else {
 1189|  3.81k|		if ( *newline == 0 ) newline = "\xA";	// Linefeed
  ------------------
  |  Branch (1189:8): [True: 3.81k, False: 0]
  ------------------
 1190|  3.81k|		if ( *indentStr == 0 ) {
  ------------------
  |  Branch (1190:8): [True: 3.81k, False: 0]
  ------------------
 1191|  3.81k|			indentStr = " ";
 1192|  3.81k|			if ( ! (options & kXMP_UseCompactFormat) ) indentStr  = "   ";
  ------------------
  |  Branch (1192:9): [True: 0, False: 3.81k]
  ------------------
 1193|  3.81k|		}
 1194|  3.81k|	}
 1195|       |	
 1196|  3.82k|	if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1196:7): [True: 0, False: 3.82k]
  ------------------
 1197|      0|		if ( options & (kXMP_OmitPacketWrapper | kXMP_IncludeThumbnailPad) ) {
  ------------------
  |  Branch (1197:8): [True: 0, False: 0]
  ------------------
 1198|      0|			XMP_Throw ( "Inconsistent options for exact size serialize", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1199|      0|		}
 1200|      0|		if ( (padding & (unicodeUnitSize-1)) != 0 ) {
  ------------------
  |  Branch (1200:8): [True: 0, False: 0]
  ------------------
 1201|      0|			XMP_Throw ( "Exact size must be a multiple of the Unicode element", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1202|      0|		}
 1203|  3.82k|	} else if ( options & kXMP_ReadOnlyPacket ) {
  ------------------
  |  Branch (1203:14): [True: 0, False: 3.82k]
  ------------------
 1204|      0|		if ( options & (kXMP_OmitPacketWrapper | kXMP_IncludeThumbnailPad) ) {
  ------------------
  |  Branch (1204:8): [True: 0, False: 0]
  ------------------
 1205|      0|			XMP_Throw ( "Inconsistent options for read-only packet", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1206|      0|		}
 1207|      0|		padding = 0;
 1208|  3.82k|	} else if ( options & kXMP_OmitPacketWrapper ) {
  ------------------
  |  Branch (1208:14): [True: 1.13k, False: 2.68k]
  ------------------
 1209|  1.13k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1209:8): [True: 0, False: 1.13k]
  ------------------
 1210|      0|			XMP_Throw ( "Inconsistent options for non-packet serialize", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1211|      0|		}
 1212|  1.13k|		padding = 0;
 1213|  2.68k|	} else {
 1214|  2.68k|		if ( padding == 0 ) padding = kDefaultPad * unicodeUnitSize;
  ------------------
  |  Branch (1214:8): [True: 2.68k, False: 0]
  ------------------
 1215|  2.68k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1215:8): [True: 0, False: 2.68k]
  ------------------
 1216|      0|			if ( ! this->DoesPropertyExist ( kXMP_NS_XMP, "Thumbnails" ) ) padding += (10000 * unicodeUnitSize);	// *** Need a better estimate.
  ------------------
  |  Branch (1216:9): [True: 0, False: 0]
  ------------------
 1217|      0|		}
 1218|  2.68k|	}
 1219|       |
 1220|       |	// Serialize as UTF-8, then convert to UTF-16 or UTF-32 if necessary, and assemble with the padding and tail.
 1221|       |	
 1222|  3.82k|	std::string tailStr;
 1223|       |
 1224|  3.82k|	SerializeAsRDF ( *this, *sOutputStr, tailStr, options, newline, indentStr, baseIndent );
 1225|  3.82k|	if ( charEncoding == kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1225:7): [True: 3.82k, False: 0]
  ------------------
 1226|       |
 1227|  3.82k|		if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1227:8): [True: 0, False: 3.82k]
  ------------------
 1228|      0|			size_t minSize = sOutputStr->size() + tailStr.size();
 1229|      0|			if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1229:9): [True: 0, False: 0]
  ------------------
 1230|      0|			padding -= minSize;	// Now the actual amount of padding to add.
 1231|      0|		}
 1232|       |		
 1233|  3.82k|		size_t newlineLen = strlen ( newline );
 1234|       |	
 1235|  3.82k|		if ( padding < newlineLen ) {
  ------------------
  |  Branch (1235:8): [True: 1.13k, False: 2.68k]
  ------------------
 1236|  1.13k|			sOutputStr->append ( padding, ' ' );
 1237|  2.68k|		} else {
 1238|  2.68k|			padding -= newlineLen;	// Write this newline last.
 1239|  56.4k|			while ( padding >= (100 + newlineLen) ) {
  ------------------
  |  Branch (1239:12): [True: 53.7k, False: 2.68k]
  ------------------
 1240|  53.7k|				sOutputStr->append ( 100, ' ' );
 1241|  53.7k|				*sOutputStr += newline;
 1242|  53.7k|				padding -= (100 + newlineLen);
 1243|  53.7k|			}
 1244|  2.68k|			sOutputStr->append ( padding, ' ' );
 1245|  2.68k|			*sOutputStr += newline;
 1246|  2.68k|		}
 1247|       |
 1248|  3.82k|		*sOutputStr += tailStr;
 1249|       |	
 1250|  3.82k|	} else {
 1251|       |	
 1252|       |		// Need to convert the encoding. Swap the UTF-8 into a local string and convert back. Assemble everything.
 1253|       |		
 1254|      0|		XMP_VarString utf8Str, newlineStr;
 1255|      0|		bool bigEndian = ((charEncoding & _XMP_LittleEndian_Bit) == 0);
 1256|       |		
 1257|      0|		if ( charEncoding & _XMP_UTF16_Bit ) {
  ------------------
  |  Branch (1257:8): [True: 0, False: 0]
  ------------------
 1258|       |
 1259|      0|			std::string padStr ( "  " );  padStr[0] = 0;	// Assume big endian.
 1260|       |			
 1261|      0|			utf8Str.swap ( *sOutputStr );
 1262|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), sOutputStr, bigEndian );
 1263|      0|			utf8Str.swap ( tailStr );
 1264|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &tailStr, bigEndian );
 1265|       |
 1266|      0|			if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1266:9): [True: 0, False: 0]
  ------------------
 1267|      0|				size_t minSize = sOutputStr->size() + tailStr.size();
 1268|      0|				if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1268:10): [True: 0, False: 0]
  ------------------
 1269|      0|				padding -= minSize;	// Now the actual amount of padding to add (in bytes).
 1270|      0|			}
 1271|       |
 1272|      0|			utf8Str.assign ( newline );
 1273|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &newlineStr, bigEndian );
 1274|      0|			size_t newlineLen = newlineStr.size();
 1275|       |	
 1276|      0|			if ( padding < newlineLen ) {
  ------------------
  |  Branch (1276:9): [True: 0, False: 0]
  ------------------
 1277|      0|				for ( int i = padding/2; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1277:30): [True: 0, False: 0]
  ------------------
 1278|      0|			} else {
 1279|      0|				padding -= newlineLen;	// Write this newline last.
 1280|      0|				while ( padding >= (200 + newlineLen) ) {
  ------------------
  |  Branch (1280:13): [True: 0, False: 0]
  ------------------
 1281|      0|					for ( int i = 100; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1281:25): [True: 0, False: 0]
  ------------------
 1282|      0|					*sOutputStr += newlineStr;
 1283|      0|					padding -= (200 + newlineLen);
 1284|      0|				}
 1285|      0|				for ( int i = padding/2; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1285:30): [True: 0, False: 0]
  ------------------
 1286|      0|				*sOutputStr += newlineStr;
 1287|      0|			}
 1288|       |
 1289|      0|			*sOutputStr += tailStr;
 1290|       |
 1291|      0|		} else {
 1292|       |
 1293|      0|			std::string padStr ( "    " );  padStr[0] = padStr[1] = padStr[2] = 0;	// Assume big endian.
 1294|       |//			UTF8_to_UTF32_Proc Converter = UTF8_to_UTF32BE;
 1295|       |
 1296|      0|			if ( charEncoding & _XMP_LittleEndian_Bit ) {
  ------------------
  |  Branch (1296:9): [True: 0, False: 0]
  ------------------
 1297|      0|				padStr[0] = ' '; padStr[1] = padStr[2] = padStr[3] = 0;
 1298|       |//				Converter = UTF8_to_UTF32LE;
 1299|      0|			}
 1300|       |			
 1301|      0|			utf8Str.swap ( *sOutputStr );
 1302|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), sOutputStr, bigEndian );
 1303|      0|			utf8Str.swap ( tailStr );
 1304|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &tailStr, bigEndian );
 1305|       |
 1306|      0|			if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1306:9): [True: 0, False: 0]
  ------------------
 1307|      0|				size_t minSize = sOutputStr->size() + tailStr.size();
 1308|      0|				if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1308:10): [True: 0, False: 0]
  ------------------
 1309|      0|				padding -= minSize;	// Now the actual amount of padding to add (in bytes).
 1310|      0|			}
 1311|       |
 1312|      0|			utf8Str.assign ( newline );
 1313|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &newlineStr, bigEndian );
 1314|      0|			size_t newlineLen = newlineStr.size();
 1315|       |	
 1316|      0|			if ( padding < newlineLen ) {
  ------------------
  |  Branch (1316:9): [True: 0, False: 0]
  ------------------
 1317|      0|				for ( int i = padding/4; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1317:30): [True: 0, False: 0]
  ------------------
 1318|      0|			} else {
 1319|      0|				padding -= newlineLen;	// Write this newline last.
 1320|      0|				while ( padding >= (400 + newlineLen) ) {
  ------------------
  |  Branch (1320:13): [True: 0, False: 0]
  ------------------
 1321|      0|					for ( int i = 100; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1321:25): [True: 0, False: 0]
  ------------------
 1322|      0|					*sOutputStr += newlineStr;
 1323|      0|					padding -= (400 + newlineLen);
 1324|      0|				}
 1325|      0|				for ( int i = padding/4; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1325:30): [True: 0, False: 0]
  ------------------
 1326|      0|				*sOutputStr += newlineStr;
 1327|      0|			}
 1328|       |
 1329|      0|			*sOutputStr += tailStr;
 1330|       |
 1331|      0|		}
 1332|       |	
 1333|      0|	}
 1334|       |
 1335|       |	// Return the finished string.
 1336|       |	
 1337|  3.82k|	*rdfString = sOutputStr->c_str();
 1338|  3.82k|	*rdfSize   = sOutputStr->size();
 1339|       |
 1340|  3.82k|}	// SerializeToBuffer
XMPMeta-Serialize.cpp:_ZL14SerializeAsRDFRK7XMPMetaRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_jPKcSB_i:
 1058|  3.82k|{
 1059|  3.82k|	const size_t treeNameLen = xmpObj.tree.name.size();
 1060|  3.82k|	const size_t indentLen   = strlen ( indentStr );
 1061|       |
 1062|       |	// First estimate the worst case space and reserve room in the output string. This optimization
 1063|       |	// avoids reallocating and copying the output as it grows. The initial count does not look at
 1064|       |	// the values of properties, so it does not account for character entities, e.g. &#xA; for newline.
 1065|       |	// Since there can be a lot of these in things like the base 64 encoding of a large thumbnail,
 1066|       |	// inflate the count by 1/4 (easy to do) to accommodate.
 1067|       |	
 1068|       |	// *** Need to include estimate for alias comments.
 1069|       |	
 1070|  3.82k|	size_t outputLen = 2 * (strlen(kPacketHeader) + strlen(kRDF_XMPMetaStart) + strlen(kRDF_RDFStart) + 3*baseIndent*indentLen);
 1071|       |	
 1072|  14.9k|	for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum < schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (1072:71): [True: 11.1k, False: 3.82k]
  ------------------
 1073|  11.1k|		const XMP_Node * currSchema = xmpObj.tree.children[schemaNum];
 1074|  11.1k|		outputLen += 2*(baseIndent+2)*indentLen + strlen(kRDF_SchemaStart) + treeNameLen + strlen(kRDF_SchemaEnd) + 2;
 1075|  11.1k|		outputLen += EstimateRDFSize ( currSchema, baseIndent+2, indentLen );
 1076|  11.1k|	}
 1077|       |	
 1078|  3.82k|	outputLen += (outputLen >> 2);	// Inflate by 1/4, an empirical fudge factor.
 1079|       |	
 1080|       |	// Now generate the RDF into the head string as UTF-8.
 1081|       |	
 1082|  3.82k|	XMP_Index level;
 1083|       |	
 1084|  3.82k|	headStr.erase();
 1085|  3.82k|	headStr.reserve ( outputLen );
 1086|       |	
 1087|       |	// Write the packet header PI.
 1088|  3.82k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1088:7): [True: 2.68k, False: 1.13k]
  ------------------
 1089|  2.68k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1089:29): [True: 0, False: 2.68k]
  ------------------
 1090|  2.68k|		headStr += kPacketHeader;
 1091|  2.68k|		headStr += newline;
 1092|  2.68k|	}
 1093|       |
 1094|       |	// Write the xmpmeta element's start tag.
 1095|  3.82k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1095:7): [True: 3.82k, False: 0]
  ------------------
 1096|  3.82k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1096:29): [True: 0, False: 3.82k]
  ------------------
 1097|  3.82k|		headStr += kRDF_XMPMetaStart;
 1098|  3.82k|		headStr += kXMPCore_VersionMessage "\">";
  ------------------
  |  |  134|  3.82k|	#define kXMPCore_VersionMessage	kXMPCoreName " " XMP_API_VERSION_STRING
  |  |  ------------------
  |  |  |  |  133|  3.82k|	#define kXMPCoreName "XMP Core"
  |  |  ------------------
  ------------------
 1099|  3.82k|		headStr += newline;
 1100|  3.82k|	}
 1101|       |
 1102|       |	// Write the rdf:RDF start tag.
 1103|  7.65k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1103:30): [True: 3.82k, False: 3.82k]
  ------------------
 1104|  3.82k|	headStr += kRDF_RDFStart;
 1105|  3.82k|	headStr += newline;
 1106|       |	
 1107|       |	// Write all of the properties.
 1108|  3.82k|	if ( options & kXMP_UseCompactFormat ) {
  ------------------
  |  Branch (1108:7): [True: 3.82k, False: 0]
  ------------------
 1109|  3.82k|		SerializeCompactRDFSchemas ( xmpObj.tree, headStr, newline, indentStr, baseIndent );
 1110|  3.82k|	} else {
 1111|      0|		if ( xmpObj.tree.children.size() > 0 ) {
  ------------------
  |  Branch (1111:8): [True: 0, False: 0]
  ------------------
 1112|      0|			for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum < schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (1112:73): [True: 0, False: 0]
  ------------------
 1113|      0|				const XMP_Node * currSchema = xmpObj.tree.children[schemaNum];
 1114|      0|				SerializePrettyRDFSchema ( xmpObj.tree.name, currSchema, headStr, options, newline, indentStr, baseIndent );
 1115|      0|			}
 1116|      0|		} else {
 1117|      0|			for ( XMP_Index level = baseIndent+2; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1117:42): [True: 0, False: 0]
  ------------------
 1118|      0|			headStr += kRDF_SchemaStart;	// Special case an empty XMP object.
 1119|      0|			headStr += '"';
 1120|      0|			headStr += xmpObj.tree.name;
 1121|      0|			headStr += "\"/>";
 1122|      0|			headStr += newline;
 1123|      0|		}
 1124|      0|	}
 1125|       |
 1126|       |	// Write the rdf:RDF end tag.
 1127|  7.65k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1127:30): [True: 3.82k, False: 3.82k]
  ------------------
 1128|  3.82k|	headStr += kRDF_RDFEnd;
 1129|  3.82k|	headStr += newline;
 1130|       |
 1131|       |	// Write the xmpmeta end tag.
 1132|  3.82k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1132:7): [True: 3.82k, False: 0]
  ------------------
 1133|  3.82k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1133:29): [True: 0, False: 3.82k]
  ------------------
 1134|  3.82k|		headStr += kRDF_XMPMetaEnd;
 1135|  3.82k|		headStr += newline;
 1136|  3.82k|	}
 1137|       |	
 1138|       |	// Write the packet trailer PI into the tail string as UTF-8.
 1139|  3.82k|	tailStr.erase();
 1140|  3.82k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1140:7): [True: 2.68k, False: 1.13k]
  ------------------
 1141|  2.68k|		tailStr.reserve ( strlen(kPacketTrailer) + (strlen(indentStr) * baseIndent) );
 1142|  2.68k|		for ( level = baseIndent; level > 0; --level ) tailStr += indentStr;
  ------------------
  |  Branch (1142:29): [True: 0, False: 2.68k]
  ------------------
 1143|  2.68k|		tailStr += kPacketTrailer;
 1144|  2.68k|		if ( options & kXMP_ReadOnlyPacket ) tailStr[tailStr.size()-4] = 'r';
  ------------------
  |  Branch (1144:8): [True: 0, False: 2.68k]
  ------------------
 1145|  2.68k|	}
 1146|       |	
 1147|       |	// ! This assert is just a performance check, to see if the reserve was enough.
 1148|       |	// *** XMP_Assert ( headStr.size() <= outputLen );
 1149|       |	// *** Don't use an assert. Think of some way to track this without risk of aborting the client.
 1150|       |	
 1151|  3.82k|}	// SerializeAsRDF
XMPMeta-Serialize.cpp:_ZL15EstimateRDFSizePK8XMP_Nodeim:
   83|   166k|{
   84|   166k|	size_t outputLen = 2 * (indent*indentLen + currNode->name.size() + 4);	// The property element tags.
   85|       |	
   86|   166k|	if ( ! currNode->qualifiers.empty() ) {
  ------------------
  |  Branch (86:7): [True: 8.50k, False: 158k]
  ------------------
   87|       |		// This node has qualifiers, assume it is written using rdf:value and estimate the qualifiers.
   88|       |
   89|  8.50k|		indent += 2;	// Everything else is indented inside the rdf:Description element.
   90|  8.50k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
   91|  8.50k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_ValueStart) + 2);		// The rdf:value tags.
   92|       |
   93|  45.8k|		for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (93:68): [True: 37.3k, False: 8.50k]
  ------------------
   94|  37.3k|			const XMP_Node * currQual = currNode->qualifiers[qualNum];
   95|  37.3k|			outputLen += EstimateRDFSize ( currQual, indent, indentLen );
   96|  37.3k|		}
   97|       |
   98|  8.50k|	}
   99|       |	
  100|   166k|	if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (100:7): [True: 6.37k, False: 160k]
  ------------------
  101|  6.37k|		indent += 1;
  102|  6.37k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
  103|   160k|	} else if ( currNode->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (103:14): [True: 2.94k, False: 157k]
  ------------------
  104|  2.94k|		indent += 2;
  105|  2.94k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_BagStart) + 2);		// The rdf:Bag/Seq/Alt tags.
  106|  2.94k|		outputLen += 2 * currNode->children.size() * (strlen(kRDF_ItemStart) + 2);	// The rdf:li tags, indent counted in children.
  107|   157k|	} else if ( ! (currNode->options & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (107:14): [True: 146k, False: 11.1k]
  ------------------
  108|   146k|		outputLen += currNode->value.size();	// This is a leaf value node.
  109|   146k|	}
  110|       |
  111|   284k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (111:67): [True: 118k, False: 166k]
  ------------------
  112|   118k|		const XMP_Node * currChild = currNode->children[childNum];
  113|   118k|		outputLen += EstimateRDFSize ( currChild, indent+1, indentLen );
  114|   118k|	}
  115|       |
  116|   166k|	return outputLen;
  117|       |	
  118|   166k|}	// EstimateRDFSize
XMPMeta-Serialize.cpp:_ZL26SerializeCompactRDFSchemasRK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  973|  3.82k|{
  974|  3.82k|	XMP_Index level;
  975|  3.82k|	size_t schema, schemaLim;
  976|       |	
  977|       |	// Begin the rdf:Description start tag.
  978|  11.4k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (978:30): [True: 7.65k, False: 3.82k]
  ------------------
  979|  3.82k|	outputStr += kRDF_SchemaStart;
  980|  3.82k|	outputStr += '"';
  981|  3.82k|	outputStr += xmpTree.name;
  982|  3.82k|	outputStr += '"';
  983|       |	
  984|       |	// Write all necessary xmlns attributes.
  985|       |	
  986|  3.82k|	size_t totalLen = 8;	// Start at 8 for "xml:rdf:".
  987|  3.82k|	XMP_cStringMapPos currPos = sNamespacePrefixToURIMap->begin();
  988|  3.82k|	XMP_cStringMapPos endPos  = sNamespacePrefixToURIMap->end();
  989|  1.02M|	for ( ; currPos != endPos; ++currPos ) totalLen += currPos->first.size();
  ------------------
  |  Branch (989:10): [True: 1.02M, False: 3.82k]
  ------------------
  990|       |
  991|  3.82k|	XMP_VarString usedNS;
  992|  3.82k|	usedNS.reserve ( totalLen );
  993|  3.82k|	usedNS = "xml:rdf:";
  994|       |
  995|  14.9k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (995:57): [True: 11.1k, False: 3.82k]
  ------------------
  996|  11.1k|		const XMP_Node * currSchema = xmpTree.children[schema];
  997|  11.1k|		DeclareUsedNamespaces ( currSchema, usedNS, outputStr, newline, indentStr, baseIndent+4 );
  998|  11.1k|	}
  999|       |	
 1000|       |	// Write the top level "attrProps" and close the rdf:Description start tag.
 1001|  3.82k|	bool allAreAttrs = true;
 1002|  14.9k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1002:57): [True: 11.1k, False: 3.82k]
  ------------------
 1003|  11.1k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1004|  11.1k|		allAreAttrs &= SerializeCompactRDFAttrProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1005|  11.1k|	}
 1006|  3.82k|	if ( ! allAreAttrs ) {
  ------------------
  |  Branch (1006:7): [True: 1.42k, False: 2.40k]
  ------------------
 1007|  1.42k|		outputStr += ">";
 1008|  1.42k|		outputStr += newline;
 1009|  2.40k|	} else {
 1010|  2.40k|		outputStr += "/>";
 1011|  2.40k|		outputStr += newline;
 1012|  2.40k|		return;	// ! Done if all properties in all schema are written as attributes.
 1013|  2.40k|	}
 1014|       |
 1015|       |	// Write the remaining properties for each schema.
 1016|  6.01k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1016:57): [True: 4.59k, False: 1.42k]
  ------------------
 1017|  4.59k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1018|  4.59k|		SerializeCompactRDFElemProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1019|  4.59k|	}
 1020|       |	
 1021|       |	// Write the rdf:Description end tag.
 1022|       |	// *** Elide the end tag if everything (all props in all schema) is an attr.
 1023|  4.26k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (1023:30): [True: 2.84k, False: 1.42k]
  ------------------
 1024|  1.42k|	outputStr += kRDF_SchemaEnd;
 1025|  1.42k|	outputStr += newline;
 1026|       |
 1027|  1.42k|}	// SerializeCompactRDFSchemas
XMPMeta-Serialize.cpp:_ZL21DeclareUsedNamespacesPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_PKcSB_i:
  191|   166k|{
  192|       |
  193|   166k|	if ( currNode->options & kXMP_SchemaNode ) {
  ------------------
  |  Branch (193:7): [True: 11.1k, False: 155k]
  ------------------
  194|       |		// The schema node name is the URI, the value is the prefix.
  195|  11.1k|		DeclareOneNamespace ( currNode->value, currNode->name, usedNS, outputStr, newline, indentStr, indent );
  196|   155k|	} else if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (196:14): [True: 6.37k, False: 149k]
  ------------------
  197|  29.0k|		for ( size_t fieldNum = 0, fieldLim = currNode->children.size(); fieldNum < fieldLim; ++fieldNum ) {
  ------------------
  |  Branch (197:68): [True: 22.6k, False: 6.37k]
  ------------------
  198|  22.6k|			const XMP_Node * currField = currNode->children[fieldNum];
  199|  22.6k|			DeclareElemNamespace ( currField->name, usedNS, outputStr, newline, indentStr, indent );
  200|  22.6k|		}
  201|  6.37k|	}
  202|       |
  203|   284k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (203:67): [True: 118k, False: 166k]
  ------------------
  204|   118k|		const XMP_Node * currChild = currNode->children[childNum];
  205|   118k|		DeclareUsedNamespaces ( currChild, usedNS, outputStr, newline, indentStr, indent );
  206|   118k|	}
  207|       |
  208|   204k|	for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (208:67): [True: 37.3k, False: 166k]
  ------------------
  209|  37.3k|		const XMP_Node * currQual = currNode->qualifiers[qualNum];
  210|  37.3k|		DeclareElemNamespace ( currQual->name, usedNS, outputStr, newline, indentStr, indent );
  211|  37.3k|		DeclareUsedNamespaces ( currQual, usedNS, outputStr, newline, indentStr, indent );
  212|  37.3k|	}
  213|       |	
  214|   166k|}	// DeclareUsedNamespaces
XMPMeta-Serialize.cpp:_ZL19DeclareOneNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_RS5_S8_PKcSA_i:
  133|  71.1k|{
  134|  71.1k|	size_t nsPos = usedNS.find ( nsPrefix );
  135|       |
  136|  71.1k|	if ( nsPos == XMP_VarString::npos ) {
  ------------------
  |  Branch (136:7): [True: 8.55k, False: 62.6k]
  ------------------
  137|       |		
  138|  8.55k|		outputStr += newline;
  139|  42.7k|		for ( ; indent > 0; --indent ) outputStr += indentStr;
  ------------------
  |  Branch (139:11): [True: 34.2k, False: 8.55k]
  ------------------
  140|  8.55k|		outputStr += "xmlns:";
  141|  8.55k|		outputStr += nsPrefix;
  142|  8.55k|		outputStr[outputStr.size()-1] = '=';	// Change the colon to =.
  143|  8.55k|		outputStr += '"';
  144|  8.55k|		outputStr += nsURI;
  145|  8.55k|		outputStr += '"';
  146|       |
  147|  8.55k|		usedNS += nsPrefix;
  148|       |
  149|  8.55k|	}
  150|       |
  151|  71.1k|}	// DeclareOneNamespace
XMPMeta-Serialize.cpp:_ZL20DeclareElemNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_S8_PKcSA_i:
  165|  60.0k|{
  166|  60.0k|	size_t colonPos = elemName.find ( ':' );
  167|       |
  168|  60.0k|	if ( colonPos != XMP_VarString::npos ) {
  ------------------
  |  Branch (168:7): [True: 60.0k, False: 0]
  ------------------
  169|  60.0k|		XMP_VarString nsPrefix ( elemName.substr ( 0, colonPos+1 ) );
  170|  60.0k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( nsPrefix );
  171|  60.0k|		XMP_Enforce ( prefixPos != sNamespacePrefixToURIMap->end() );
  ------------------
  |  |  148|  60.0k|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 60.0k]
  |  |  ------------------
  |  |  149|      0|			const char * assert_msg = _NotifyMsg ( XMP_Enforce, (c), __FILE__, __LINE__ );			\
  |  |  ------------------
  |  |  |  |  139|      0|#define _NotifyMsg(n,c,f,l)	#n " failed: " #c " in " f " at line " _MakeStr(l)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define _MakeStr(p)			#p
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|			XMP_Throw ( assert_msg , kXMPErr_EnforceFailure );										\
  |  |  ------------------
  |  |  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  |  |  ------------------
  |  |  151|      0|		}
  ------------------
  172|  60.0k|		DeclareOneNamespace ( nsPrefix, prefixPos->second, usedNS, outputStr, newline, indentStr, indent );
  173|  60.0k|	}
  174|       |
  175|  60.0k|}	// DeclareElemNamespace
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFAttrPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  682|  17.5k|{
  683|  17.5k|	size_t prop, propLim;
  684|  17.5k|	bool allAreAttrs = true;
  685|       |
  686|  60.0k|	for ( prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (686:57): [True: 42.4k, False: 17.5k]
  ------------------
  687|       |
  688|  42.4k|		const XMP_Node * currProp = parentNode->children[prop];
  689|  42.4k|		if ( ! CanBeRDFAttrProp ( currProp ) ) {
  ------------------
  |  Branch (689:8): [True: 4.08k, False: 38.3k]
  ------------------
  690|  4.08k|			allAreAttrs = false;
  691|  4.08k|			continue;
  692|  4.08k|		}
  693|       |		
  694|  38.3k|		outputStr += newline;
  695|   218k|		for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (695:35): [True: 180k, False: 38.3k]
  ------------------
  696|  38.3k|		outputStr += currProp->name;
  697|  38.3k|		outputStr += "=\"";
  698|  38.3k|		AppendNodeValue ( outputStr, currProp->value, kForAttribute );
  699|  38.3k|		outputStr += '"';
  700|       |
  701|  38.3k|	}
  702|       |	
  703|  17.5k|	return allAreAttrs;
  704|       |
  705|  17.5k|}	// SerializeCompactRDFAttrProps
XMPMeta-Serialize.cpp:_ZL16CanBeRDFAttrPropPK8XMP_Node:
  341|   153k|{
  342|       |	
  343|   153k|	if ( propNode->name[0] == '[' ) return false;
  ------------------
  |  Branch (343:7): [True: 75.7k, False: 77.7k]
  ------------------
  344|  77.7k|	if ( ! propNode->qualifiers.empty() ) return false;
  ------------------
  |  Branch (344:7): [True: 148, False: 77.6k]
  ------------------
  345|  77.6k|	if ( propNode->options & kXMP_PropValueIsURI ) return false;
  ------------------
  |  Branch (345:7): [True: 0, False: 77.6k]
  ------------------
  346|  77.6k|	if ( propNode->options & kXMP_PropCompositeMask ) return false;
  ------------------
  |  Branch (346:7): [True: 8.04k, False: 69.5k]
  ------------------
  347|       |	
  348|  69.5k|	return true;
  349|       |	
  350|  77.6k|}	// CanBeRDFAttrProp
XMPMeta-Serialize.cpp:_ZL15AppendNodeValueRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_b:
  281|   146k|{
  282|       |
  283|   146k|	unsigned char * runStart = (unsigned char *) value.c_str();
  284|   146k|	unsigned char * runLimit  = runStart + value.size();
  285|   146k|	unsigned char * runEnd;
  286|   146k|	unsigned char   ch=0;
  287|       |	
  288|  2.48M|	while ( runStart < runLimit ) {
  ------------------
  |  Branch (288:10): [True: 2.33M, False: 146k]
  ------------------
  289|       |	
  290|  13.5M|		for ( runEnd = runStart; runEnd < runLimit; ++runEnd ) {
  ------------------
  |  Branch (290:28): [True: 13.4M, False: 140k]
  ------------------
  291|  13.4M|			ch = *runEnd;
  292|  13.4M|			if ( forAttribute && (ch == '"') ) break;
  ------------------
  |  Branch (292:9): [True: 7.21M, False: 6.20M]
  |  Branch (292:25): [True: 1.87k, False: 7.21M]
  ------------------
  293|  13.4M|			if ( (ch < 0x20) || (ch == '&') || (ch == '<') || (ch == '>') ) break;
  ------------------
  |  Branch (293:9): [True: 3.58k, False: 13.4M]
  |  Branch (293:24): [True: 495, False: 13.4M]
  |  Branch (293:39): [True: 332, False: 13.4M]
  |  Branch (293:54): [True: 2.19M, False: 11.2M]
  ------------------
  294|  13.4M|		}
  295|       |		
  296|  2.33M|		outputStr.append ( (char *) runStart, (runEnd - runStart) );
  297|       |		
  298|  2.33M|		if ( runEnd < runLimit ) {
  ------------------
  |  Branch (298:8): [True: 2.19M, False: 140k]
  ------------------
  299|       |
  300|  2.19M|			if ( ch < 0x20 ) {
  ------------------
  |  Branch (300:9): [True: 3.58k, False: 2.19M]
  ------------------
  301|       |			
  302|  3.58k|				XMP_Assert ( (ch == kTab) || (ch == kLF) || (ch == kCR) );
  ------------------
  |  |  142|  3.58k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  303|       |
  304|  3.58k|				char hexBuf[16];
  305|  3.58k|				memcpy ( hexBuf, "&#xn;", 5 );
  306|  3.58k|				hexBuf[3] = kHexDigits[ch&0xF];
  ------------------
  |  |   94|  3.58k|#define kHexDigits "0123456789ABCDEF"
  ------------------
  307|  3.58k|				outputStr.append ( hexBuf, 5 );
  308|       |
  309|  2.19M|			} else {
  310|       |
  311|  2.19M|				if ( ch == '"' ) {
  ------------------
  |  Branch (311:10): [True: 1.87k, False: 2.19M]
  ------------------
  312|  1.87k|					outputStr += "&quot;";
  313|  2.19M|				} else if ( ch == '<' ) {
  ------------------
  |  Branch (313:17): [True: 332, False: 2.19M]
  ------------------
  314|    332|					outputStr += "&lt;";
  315|  2.19M|				} else if ( ch == '>' ) {
  ------------------
  |  Branch (315:17): [True: 2.19M, False: 495]
  ------------------
  316|  2.19M|					outputStr += "&gt;";
  317|  2.19M|				} else {
  318|    495|					XMP_Assert ( ch == '&' );
  ------------------
  |  |  142|    495|	#define XMP_Assert(c)	((void) 0)
  ------------------
  319|    495|					outputStr += "&amp;";
  320|    495|				}
  321|       |
  322|  2.19M|			}
  323|       |
  324|  2.19M|			++runEnd;
  325|       |
  326|  2.19M|		}
  327|       |		
  328|  2.33M|		runStart = runEnd;
  329|       |	
  330|  2.33M|	}
  331|       |
  332|   146k|}	// AppendNodeValue
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFElemPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  753|  7.56k|{
  754|  7.56k|	XMP_Index level;
  755|       |
  756|  95.9k|	for ( size_t prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (756:64): [True: 88.3k, False: 7.56k]
  ------------------
  757|       |
  758|  88.3k|		const XMP_Node * propNode = parentNode->children[prop];
  759|  88.3k|		if ( CanBeRDFAttrProp ( propNode ) ) continue;
  ------------------
  |  Branch (759:8): [True: 8.54k, False: 79.8k]
  ------------------
  760|       |
  761|  79.8k|		bool emitEndTag = true;
  762|  79.8k|		bool indentEndTag = true;
  763|       |
  764|  79.8k|		XMP_OptionBits propForm = propNode->options & kXMP_PropCompositeMask;
  765|       |
  766|       |		// -----------------------------------------------------------------------------------
  767|       |		// Determine the XML element name, write the name part of the start tag. Look over the
  768|       |		// qualifiers to decide on "normal" versus "rdf:value" form. Emit the attribute
  769|       |		// qualifiers at the same time.
  770|       |		
  771|  79.8k|		XMP_StringPtr elemName = propNode->name.c_str();
  772|  79.8k|		if ( *elemName == '[' ) elemName = "rdf:li";
  ------------------
  |  Branch (772:8): [True: 75.7k, False: 4.08k]
  ------------------
  773|       |
  774|   470k|		for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (774:25): [True: 391k, False: 79.8k]
  ------------------
  775|  79.8k|		outputStr += '<';
  776|  79.8k|		outputStr += elemName;
  777|       |
  778|  79.8k|		#define isCompact	false
  779|  79.8k|		bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  778|  79.8k|		#define isCompact	false
  ------------------
  780|  79.8k|		bool hasRDFResourceQual   = false;
  781|       |
  782|   117k|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (782:68): [True: 37.3k, False: 79.8k]
  ------------------
  783|  37.3k|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  784|  37.3k|			if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (784:9): [True: 30.0k, False: 7.31k]
  ------------------
  785|  30.0k|				hasGeneralQualifiers = true;
  786|  30.0k|			} else {
  787|  7.31k|				if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (787:10): [True: 0, False: 7.31k]
  ------------------
  788|  7.31k|				outputStr += ' ';
  789|  7.31k|				outputStr += currQual->name;
  790|  7.31k|				outputStr += "=\"";
  791|  7.31k|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  792|  7.31k|				outputStr += '"';
  793|  7.31k|			}
  794|  37.3k|		}
  795|       |		
  796|       |		// --------------------------------------------------------
  797|       |		// Process the property according to the standard patterns.
  798|       |	
  799|  79.8k|		if ( hasGeneralQualifiers ) {
  ------------------
  |  Branch (799:8): [True: 1.20k, False: 78.6k]
  ------------------
  800|       |		
  801|       |			// -------------------------------------------------------------------------------------
  802|       |			// The node has general qualifiers, ones that can't be attributes on a property element.
  803|       |			// Emit using the qualified property pseudo-struct form. The value is output by a call
  804|       |			// to SerializePrettyRDFProperty with emitAsRDFValue set.
  805|       |			
  806|       |			// *** We're losing compactness in the calls to SerializePrettyRDFProperty.
  807|       |			// *** Should refactor to have SerializeCompactRDFProperty that does one node.
  808|       |
  809|  1.20k|			outputStr += " rdf:parseType=\"Resource\">";
  810|  1.20k|			outputStr += newline;
  811|       |
  812|  1.20k|			SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  813|       |		
  814|  1.20k|			size_t qualNum = 0;
  815|  1.20k|			size_t qualLim = propNode->qualifiers.size();
  816|  1.20k|			if ( propNode->options & kXMP_PropHasLang ) ++qualNum;
  ------------------
  |  Branch (816:9): [True: 15, False: 1.18k]
  ------------------
  817|       |			
  818|  31.2k|			for ( ; qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (818:12): [True: 30.0k, False: 1.20k]
  ------------------
  819|  30.0k|				const XMP_Node * currQual = propNode->qualifiers[qualNum];
  820|  30.0k|				SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  821|  30.0k|			}
  822|       |			
  823|  78.6k|		} else {
  824|       |
  825|       |			// --------------------------------------------------------------------
  826|       |			// This node has only attribute qualifiers. Emit as a property element.
  827|       |			
  828|  78.6k|			if ( propForm == 0 ) {
  ------------------
  |  Branch (828:9): [True: 69.2k, False: 9.31k]
  ------------------
  829|       |			
  830|       |				// --------------------------
  831|       |				// This is a simple property.
  832|       |				
  833|  69.2k|				if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (833:10): [True: 0, False: 69.2k]
  ------------------
  834|      0|					outputStr += " rdf:resource=\"";
  835|      0|					AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  836|      0|					outputStr += "\"/>";
  837|      0|					outputStr += newline;
  838|      0|					emitEndTag = false;
  839|  69.2k|				} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (839:17): [True: 39, False: 69.2k]
  ------------------
  840|     39|					outputStr += "/>";
  841|     39|					outputStr += newline;
  842|     39|					emitEndTag = false;
  843|  69.2k|				} else {
  844|  69.2k|					outputStr += '>';
  845|  69.2k|					AppendNodeValue ( outputStr, propNode->value, kForElement );
  846|  69.2k|					indentEndTag = false;
  847|  69.2k|				}
  848|       |				
  849|  69.2k|			} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (849:16): [True: 2.94k, False: 6.36k]
  ------------------
  850|       |
  851|       |				// -----------------
  852|       |				// This is an array.
  853|       |				
  854|  2.94k|				outputStr += '>';
  855|  2.94k|				outputStr += newline;
  856|  2.94k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  857|       |			
  858|  2.94k|				if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (858:10): [True: 0, False: 2.94k]
  ------------------
  859|  2.94k|				SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+2 );
  860|       |
  861|  2.94k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  862|       |
  863|  6.36k|			} else {
  864|       |
  865|       |				// ----------------------
  866|       |				// This must be a struct.
  867|       |				
  868|  6.36k|				XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|  6.36k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|       |
  870|  6.36k|				bool hasAttrFields = false;
  871|  6.36k|				bool hasElemFields = false;
  872|       |			
  873|  6.36k|				size_t field, fieldLim;
  874|  28.9k|				for ( field = 0, fieldLim = propNode->children.size(); field != fieldLim; ++field ) {
  ------------------
  |  Branch (874:60): [True: 22.6k, False: 6.34k]
  ------------------
  875|  22.6k|					XMP_Node * currField = propNode->children[field];
  876|  22.6k|					if ( CanBeRDFAttrProp ( currField ) ) {
  ------------------
  |  Branch (876:11): [True: 22.6k, False: 23]
  ------------------
  877|  22.6k|						hasAttrFields = true;
  878|  22.6k|						if ( hasElemFields ) break;	// No sense looking further.
  ------------------
  |  Branch (878:12): [True: 0, False: 22.6k]
  ------------------
  879|  22.6k|					} else {
  880|     23|						hasElemFields = true;
  881|     23|						if ( hasAttrFields ) break;	// No sense looking further.
  ------------------
  |  Branch (881:12): [True: 23, False: 0]
  ------------------
  882|     23|					}
  883|  22.6k|				}
  884|       |				
  885|  6.36k|				if ( hasRDFResourceQual && hasElemFields ) {
  ------------------
  |  Branch (885:10): [True: 0, False: 6.36k]
  |  Branch (885:32): [True: 0, False: 0]
  ------------------
  886|      0|					XMP_Throw ( "Can't mix rdf:resource qualifier and element fields", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|				}
  888|       |				
  889|  6.36k|				if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (889:10): [True: 16, False: 6.35k]
  ------------------
  890|       |				
  891|       |					// Catch an empty struct as a special case. The case below would emit an empty
  892|       |					// XML element, which gets reparsed as a simple property with an empty value.
  893|     16|					outputStr += " rdf:parseType=\"Resource\"/>";
  894|     16|					outputStr += newline;
  895|     16|					emitEndTag = false;
  896|       |				
  897|  6.35k|				} else if ( ! hasElemFields ) {
  ------------------
  |  Branch (897:17): [True: 6.33k, False: 23]
  ------------------
  898|       |
  899|       |					// All fields can be attributes, use the emptyPropertyElt form.
  900|  6.33k|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+1 );
  901|  6.33k|					outputStr += "/>";
  902|  6.33k|					outputStr += newline;
  903|  6.33k|					emitEndTag = false;
  904|       |
  905|  6.33k|				} else if ( ! hasAttrFields ) {
  ------------------
  |  Branch (905:17): [True: 0, False: 23]
  ------------------
  906|       |				
  907|       |					// All fields must be elements, use the parseTypeResourcePropertyElt form.
  908|      0|					outputStr += " rdf:parseType=\"Resource\">";
  909|      0|					outputStr += newline;
  910|      0|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  911|       |				
  912|     23|				} else {
  913|       |				
  914|       |					// Have a mix of attributes and elements, use an inner rdf:Description.
  915|     23|					outputStr += '>';
  916|     23|					outputStr += newline;
  917|    149|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (917:30): [True: 126, False: 23]
  ------------------
  918|     23|					outputStr += "<rdf:Description";
  919|     23|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+2 );
  920|     23|					outputStr += ">";
  921|     23|					outputStr += newline;
  922|     23|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  923|    149|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (923:30): [True: 126, False: 23]
  ------------------
  924|     23|					outputStr += kRDF_StructEnd;
  925|     23|					outputStr += newline;
  926|       |
  927|     23|				}
  928|       |
  929|  6.36k|			}
  930|       |
  931|  78.6k|		}
  932|       |		
  933|       |		// ----------------------------------
  934|       |		// Emit the property element end tag.
  935|       |		
  936|  79.8k|		if ( emitEndTag ) {
  ------------------
  |  Branch (936:8): [True: 73.4k, False: 6.38k]
  ------------------
  937|  73.4k|			if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (937:9): [True: 4.17k, False: 69.2k]
  |  Branch (937:46): [True: 14.9k, False: 4.17k]
  ------------------
  938|  73.4k|			outputStr += "</";
  939|  73.4k|			outputStr += elemName;
  940|  73.4k|			outputStr += '>';
  941|  73.4k|			outputStr += newline;
  942|  73.4k|		}
  943|       |
  944|  79.8k|	}
  945|       |	
  946|  7.56k|}	// SerializeCompactRDFElemProps
XMPMeta-Serialize.cpp:_ZL18IsRDFAttrQualifierNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  361|  67.4k|{
  362|       |
  363|   367k|	for ( size_t i = 0; *sAttrQualifiers[i] != 0; ++i ) {
  ------------------
  |  Branch (363:22): [True: 307k, False: 60.0k]
  ------------------
  364|   307k|		if ( qualName == sAttrQualifiers[i] ) return true;
  ------------------
  |  Branch (364:8): [True: 7.33k, False: 300k]
  ------------------
  365|   307k|	}
  366|       |
  367|  60.0k|	return false;
  368|       |	
  369|  67.4k|}	// IsRDFAttrQualifier
XMPMeta-Serialize.cpp:_ZL26SerializePrettyRDFPropertyPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_ib:
  410|  31.2k|{
  411|  31.2k|	XMP_Index level;
  412|  31.2k|	bool emitEndTag   = true;
  413|  31.2k|	bool indentEndTag = true;
  414|       |
  415|  31.2k|	XMP_OptionBits propForm = propNode->options & kXMP_PropCompositeMask;
  416|       |
  417|       |	// ------------------------------------------------------------------------------------------
  418|       |	// Determine the XML element name. Open the start tag with the name and attribute qualifiers.
  419|       |	
  420|  31.2k|	XMP_StringPtr elemName = propNode->name.c_str();
  421|  31.2k|	if ( emitAsRDFValue ) {
  ------------------
  |  Branch (421:7): [True: 1.20k, False: 30.0k]
  ------------------
  422|  1.20k|		elemName= "rdf:value";
  423|  30.0k|	} else if ( *elemName == '[' ) {
  ------------------
  |  Branch (423:14): [True: 0, False: 30.0k]
  ------------------
  424|      0|		elemName = "rdf:li";
  425|      0|	}
  426|       |
  427|   218k|	for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (427:24): [True: 187k, False: 31.2k]
  ------------------
  428|  31.2k|	outputStr += '<';
  429|  31.2k|	outputStr += elemName;
  430|       |	
  431|  31.2k|	#define isCompact	false
  432|  31.2k|	bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  431|  31.2k|	#define isCompact	false
  ------------------
  433|  31.2k|	bool hasRDFResourceQual   = false;
  434|       |	
  435|  61.2k|	for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (435:67): [True: 30.0k, False: 31.2k]
  ------------------
  436|  30.0k|		const XMP_Node * currQual = propNode->qualifiers[qualNum];
  437|  30.0k|		if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (437:8): [True: 30.0k, False: 15]
  ------------------
  438|  30.0k|			hasGeneralQualifiers = true;
  439|  30.0k|		} else {
  440|     15|			if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (440:9): [True: 0, False: 15]
  ------------------
  441|     15|			if ( ! emitAsRDFValue ) {
  ------------------
  |  Branch (441:9): [True: 0, False: 15]
  ------------------
  442|      0|				outputStr += ' ';
  443|      0|				outputStr += currQual->name;
  444|      0|				outputStr += "=\"";
  445|      0|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  446|      0|				outputStr += '"';
  447|      0|			}
  448|     15|		}
  449|  30.0k|	}
  450|       |	
  451|       |	// --------------------------------------------------------
  452|       |	// Process the property according to the standard patterns.
  453|       |	
  454|  31.2k|	if ( hasGeneralQualifiers && (! emitAsRDFValue) ) {
  ------------------
  |  Branch (454:7): [True: 1.20k, False: 30.0k]
  |  Branch (454:31): [True: 0, False: 1.20k]
  ------------------
  455|       |	
  456|       |		// -----------------------------------------------------------------------------------------
  457|       |		// This node has general, non-attribute, qualifiers. Emit using the qualified property form.
  458|       |		// ! The value is output by a recursive call ON THE SAME NODE with emitAsRDFValue set.
  459|       |
  460|      0|		if ( hasRDFResourceQual ) {
  ------------------
  |  Branch (460:8): [True: 0, False: 0]
  ------------------
  461|      0|			XMP_Throw ( "Can't mix rdf:resource and general qualifiers", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  462|      0|		}
  463|       |		
  464|      0|		outputStr += " rdf:parseType=\"Resource\">";
  465|      0|		outputStr += newline;
  466|       |
  467|      0|		SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  468|       |		
  469|      0|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (469:68): [True: 0, False: 0]
  ------------------
  470|      0|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  471|      0|			if ( IsRDFAttrQualifier ( currQual->name ) ) continue;
  ------------------
  |  Branch (471:9): [True: 0, False: 0]
  ------------------
  472|      0|			SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  473|      0|		}
  474|       |		
  475|  31.2k|	} else {
  476|       |
  477|       |		// --------------------------------------------------------------------
  478|       |		// This node has no general qualifiers. Emit using an unqualified form.
  479|       |		
  480|  31.2k|		if ( propForm == 0 ) {
  ------------------
  |  Branch (480:8): [True: 31.2k, False: 2]
  ------------------
  481|       |		
  482|       |			// --------------------------
  483|       |			// This is a simple property.
  484|       |			
  485|  31.2k|			if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (485:9): [True: 0, False: 31.2k]
  ------------------
  486|      0|				outputStr += " rdf:resource=\"";
  487|      0|				AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  488|      0|				outputStr += "\"/>";
  489|      0|				outputStr += newline;
  490|      0|				emitEndTag = false;
  491|  31.2k|			} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (491:16): [True: 45, False: 31.1k]
  ------------------
  492|     45|				outputStr += "/>";
  493|     45|				outputStr += newline;
  494|     45|				emitEndTag = false;
  495|  31.1k|			} else {
  496|  31.1k|				outputStr += '>';
  497|  31.1k|				AppendNodeValue ( outputStr, propNode->value, kForElement );
  498|  31.1k|				indentEndTag = false;
  499|  31.1k|			}
  500|       |			
  501|  31.2k|		} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (501:15): [True: 0, False: 2]
  ------------------
  502|       |		
  503|       |			// This is an array.
  504|      0|			outputStr += '>';
  505|      0|			outputStr += newline;
  506|      0|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  507|      0|			if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (507:9): [True: 0, False: 0]
  ------------------
  508|      0|			for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (508:69): [True: 0, False: 0]
  ------------------
  509|      0|				const XMP_Node * currChild = propNode->children[childNum];
  510|      0|				SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+2 );
  511|      0|			}
  512|      0|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  513|       |		
  514|       |		
  515|      2|		} else if ( ! hasRDFResourceQual ) {
  ------------------
  |  Branch (515:15): [True: 2, False: 0]
  ------------------
  516|       |		
  517|       |			// This is a "normal" struct, use the rdf:parseType="Resource" form.
  518|      2|			XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|      2|	#define XMP_Assert(c)	((void) 0)
  ------------------
  519|      2|			if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (519:9): [True: 2, False: 0]
  ------------------
  520|      2|				outputStr += " rdf:parseType=\"Resource\"/>";
  521|      2|				outputStr += newline;
  522|      2|				emitEndTag = false;
  523|      2|			} else {
  524|      0|				outputStr += " rdf:parseType=\"Resource\">";
  525|      0|				outputStr += newline;
  526|      0|				for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (526:70): [True: 0, False: 0]
  ------------------
  527|      0|					const XMP_Node * currChild = propNode->children[childNum];
  528|      0|					SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+1 );
  529|      0|				}
  530|      0|			}
  531|       |		
  532|      2|		} else {
  533|       |		
  534|       |			// This is a struct with an rdf:resource attribute, use the "empty property element" form.
  535|      0|			XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  536|      0|			for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (536:69): [True: 0, False: 0]
  ------------------
  537|      0|				const XMP_Node * currChild = propNode->children[childNum];
  538|      0|				if ( ! CanBeRDFAttrProp ( currChild ) ) {
  ------------------
  |  Branch (538:10): [True: 0, False: 0]
  ------------------
  539|      0|					XMP_Throw ( "Can't mix rdf:resource and complex fields", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  540|      0|				}
  541|      0|				outputStr += newline;
  542|      0|				for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (542:29): [True: 0, False: 0]
  ------------------
  543|      0|				outputStr += ' ';
  544|      0|				outputStr += currChild->name;
  545|      0|				outputStr += "=\"";
  546|      0|				outputStr += currChild->value;
  547|      0|				outputStr += '"';
  548|      0|			}
  549|      0|			outputStr += "/>";
  550|      0|			outputStr += newline;
  551|      0|			emitEndTag = false;
  552|       |		
  553|      0|		}
  554|       |		
  555|  31.2k|	}
  556|       |	
  557|       |	// ----------------------------------
  558|       |	// Emit the property element end tag.
  559|       |	
  560|  31.2k|	if ( emitEndTag ) {
  ------------------
  |  Branch (560:7): [True: 31.1k, False: 47]
  ------------------
  561|  31.1k|		if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (561:8): [True: 0, False: 31.1k]
  |  Branch (561:45): [True: 0, False: 0]
  ------------------
  562|  31.1k|		outputStr += "</";
  563|  31.1k|		outputStr += elemName;
  564|  31.1k|		outputStr += '>';
  565|  31.1k|		outputStr += newline;
  566|  31.1k|	}
  567|       |	
  568|  31.2k|}	// SerializePrettyRDFProperty
XMPMeta-Serialize.cpp:_ZL15EmitRDFArrayTagjRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKcS8_iib:
  235|  5.89k|{
  236|  5.89k|	if ( (! isStartTag) && (arraySize == 0) ) return;
  ------------------
  |  Branch (236:7): [True: 2.94k, False: 2.94k]
  |  Branch (236:25): [True: 27, False: 2.91k]
  ------------------
  237|       |	
  238|  29.4k|	for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (238:34): [True: 23.6k, False: 5.86k]
  ------------------
  239|  5.86k|	if ( isStartTag ) {
  ------------------
  |  Branch (239:7): [True: 2.94k, False: 2.91k]
  ------------------
  240|  2.94k|		outputStr += "<rdf:";
  241|  2.94k|	} else {
  242|  2.91k|		outputStr += "</rdf:";
  243|  2.91k|	}
  244|       |
  245|  5.86k|	if ( arrayForm & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (245:7): [True: 2.33k, False: 3.52k]
  ------------------
  246|  2.33k|		outputStr += "Alt";
  247|  3.52k|	} else if ( arrayForm & kXMP_PropArrayIsOrdered ) {
  ------------------
  |  Branch (247:14): [True: 3.05k, False: 469]
  ------------------
  248|  3.05k|		outputStr += "Seq";
  249|  3.05k|	} else {
  250|    469|		outputStr += "Bag";
  251|    469|	}
  252|       |	
  253|  5.86k|	if ( isStartTag && (arraySize == 0) ) outputStr += '/';
  ------------------
  |  Branch (253:7): [True: 2.94k, False: 2.91k]
  |  Branch (253:21): [True: 27, False: 2.91k]
  ------------------
  254|  5.86k|	outputStr += '>';
  255|  5.86k|	outputStr += newline;
  256|       |
  257|  5.86k|}	// EmitRDFArrayTag

_ZN7XMPMetaC2Ev:
  588|  9.91k|XMPMeta::XMPMeta() : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
  589|  9.91k|{
  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|  9.91k|}	// XMPMeta
_ZN7XMPMetaD2Ev:
  599|  9.91k|{
  600|       |	#if XMP_TraceCTorDTor
  601|       |		printf ( "Destruct XMPMeta @ %.8X\n", this );
  602|       |	#endif
  603|       |
  604|  9.91k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  9.91k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  605|  9.91k|	if ( xmlParser != 0 ) delete ( xmlParser );
  ------------------
  |  Branch (605:7): [True: 0, False: 9.91k]
  ------------------
  606|  9.91k|	xmlParser = 0;
  607|       |
  608|  9.91k|}	// ~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|   335k|{
  845|   335k|	UNUSED(options);
  846|       |
  847|       |    #if TraceXMPLocking
  848|       |    	fprintf ( xmpOut, "  Unlocking XMP toolkit, count = %d\n", sLockCount ); fflush ( xmpOut );
  849|       |	#endif
  850|   335k|    --sLockCount;
  851|   335k|    XMP_Assert ( sLockCount == 0 );
  ------------------
  |  |  142|   335k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  852|   335k|	XMP_ExitCriticalRegion ( sXMPCoreLock );
  853|       |
  854|   335k|}	// Unlock
_ZNK7XMPMeta12UnlockObjectEj:
  863|  3.82k|{
  864|  3.82k|	UNUSED(options);
  865|       |
  866|  3.82k|	XMPMeta::Unlock ( 0 );
  867|       |
  868|  3.82k|}	// UnlockObject
_ZN7XMPMeta17RegisterNamespaceEPKcS1_:
 1041|  40.0k|{
 1042|  40.0k|	if ( (*namespaceURI == 0) || (*prefix == 0) ) {
  ------------------
  |  Branch (1042:7): [True: 0, False: 40.0k]
  |  Branch (1042:31): [True: 0, False: 40.0k]
  ------------------
 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|  40.0k|	XMP_VarString	nsURI ( namespaceURI );
 1047|  40.0k|	XMP_VarString	prfix ( prefix );
 1048|  40.0k|	if ( prfix[prfix.size()-1] != ':' ) prfix += ':';
  ------------------
  |  Branch (1048:7): [True: 40.0k, False: 0]
  ------------------
 1049|  40.0k|	VerifySimpleXMLName ( prefix, prefix+prfix.size()-1 );	// Exclude the colon.
 1050|       |	
 1051|       |        // Set the new namespace in both maps.
 1052|  40.0k|        (*sNamespaceURIToPrefixMap)[nsURI] = prfix;
 1053|  40.0k|        (*sNamespacePrefixToURIMap)[prfix] = nsURI;
 1054|       |	
 1055|  40.0k|}	// RegisterNamespace
_ZN7XMPMeta18GetNamespacePrefixEPKcPS1_Pj:
 1066|   344k|{
 1067|   344k|	bool	found	= false;
 1068|       |	
 1069|   344k|	XMP_Assert ( *namespaceURI != 0 ); 	// ! Enforced by wrapper.
  ------------------
  |  |  142|   344k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1070|   344k|	XMP_Assert ( (namespacePrefix != 0) && (prefixSize != 0) );	// ! Enforced by wrapper.
  ------------------
  |  |  142|   344k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1071|       |
 1072|   344k|	XMP_VarString    nsURI ( namespaceURI );
 1073|   344k|	XMP_StringMapPos uriPos	= sNamespaceURIToPrefixMap->find ( nsURI );
 1074|       |	
 1075|   344k|	if ( uriPos != sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (1075:7): [True: 343k, False: 772]
  ------------------
 1076|   343k|		*namespacePrefix = uriPos->second.c_str();
 1077|   343k|		*prefixSize = uriPos->second.size();
 1078|   343k|		found = true;
 1079|   343k|	}
 1080|       |	
 1081|   344k|	return found;
 1082|       |	
 1083|   344k|}	// GetNamespacePrefix
_ZN7XMPMeta15DeleteNamespaceEPKc:
 1126|  1.09k|{
 1127|  1.09k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( namespaceURI );
 1128|  1.09k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) return;
  ------------------
  |  Branch (1128:7): [True: 772, False: 322]
  ------------------
 1129|       |
 1130|    322|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( uriPos->second );
 1131|    322|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) return;
  ------------------
  |  Branch (1131:7): [True: 1, False: 321]
  ------------------
 1132|       |	
 1133|    321|	sNamespaceURIToPrefixMap->erase ( uriPos );
 1134|    321|	sNamespacePrefixToURIMap->erase ( prefixPos );
 1135|       |
 1136|    321|}	// DeleteNamespace
_ZNK7XMPMeta15CountArrayItemsEPKcS1_:
 1510|  3.29k|{
 1511|  3.29k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.29k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1512|       |
 1513|  3.29k|	XMP_ExpandedXPath	expPath;
 1514|  3.29k|	ExpandXPath ( schemaNS, arrayName, &expPath );
 1515|       |	
 1516|  3.29k|	const XMP_Node * arrayNode = FindConstNode ( &tree, expPath );
  ------------------
  |  |  301|  3.29k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.29k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
 1517|       |
 1518|  3.29k|	if ( arrayNode == 0 ) return 0;
  ------------------
  |  Branch (1518:7): [True: 0, False: 3.29k]
  ------------------
 1519|  3.29k|	if ( ! (arrayNode->options & kXMP_PropValueIsArray) ) XMP_Throw ( "The named property is not an array", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1519:7): [True: 0, False: 3.29k]
  ------------------
 1520|  3.29k|	return arrayNode->children.size();
 1521|       |	
 1522|  3.29k|}	// 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
_ZN8XMPUtils20ComposeQualifierPathEPKcS1_S1_S1_PS1_Pj:
  790|  3.45k|{
  791|  3.45k|	XMP_Assert ( (schemaNS != 0) && (qualNS != 0) );		// Enforced by wrapper.
  ------------------
  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  792|  3.45k|	XMP_Assert ( (*propName != 0) && (*qualName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  793|  3.45k|	XMP_Assert ( (fullPath != 0) && (pathSize != 0) );		// Enforced by wrapper.
  ------------------
  |  |  142|  3.45k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  794|       |
  795|  3.45k|	XMP_ExpandedXPath expPath;	// Just for side effects to check namespace and basic path.
  796|  3.45k|	ExpandXPath ( schemaNS, propName, &expPath );
  797|       |
  798|  3.45k|	XMP_ExpandedXPath qualPath;
  799|  3.45k|	ExpandXPath ( qualNS, qualName, &qualPath );
  800|  3.45k|	if ( qualPath.size() != 2 ) XMP_Throw ( "The qualifier name must be simple", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (800:7): [True: 0, False: 3.45k]
  ------------------
  801|       |
  802|  3.45k|	XMP_StringLen reserveLen = strlen(propName) + qualPath[kRootPropStep].step.size() + 2;
  803|       |
  804|  3.45k|	sComposedPath->erase();
  805|  3.45k|	sComposedPath->reserve ( reserveLen );
  806|  3.45k|	*sComposedPath = propName;
  807|  3.45k|	*sComposedPath += "/?";
  808|  3.45k|	*sComposedPath += qualPath[kRootPropStep].step;
  809|       |
  810|  3.45k|	*fullPath = sComposedPath->c_str();
  811|  3.45k|	*pathSize = sComposedPath->size();
  812|       |
  813|  3.45k|}	// ComposeQualifierPath
_ZN8XMPUtils13ConvertToDateEPKcP12XMP_DateTime:
 1293|    341|{
 1294|    341|	if ( (strValue == 0) || (*strValue == 0) ) XMP_Throw ( "Empty convert-from string", kXMPErr_BadValue);
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1294:7): [True: 0, False: 341]
  |  Branch (1294:26): [True: 2, False: 339]
  ------------------
 1295|       |
 1296|    339|	size_t	 pos = 0;
 1297|    339|	XMP_Int32 temp;
 1298|       |
 1299|    339|	XMP_Assert ( sizeof(*binValue) == sizeof(XMP_DateTime) );
  ------------------
  |  |  142|    339|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1300|    339|	(void) memset ( binValue, 0, sizeof(*binValue) );	// AUDIT: Safe, using sizeof destination.
 1301|       |
 1302|    339|	bool timeOnly = ( (strValue[0] == 'T') ||
  ------------------
  |  Branch (1302:20): [True: 94, False: 245]
  ------------------
 1303|    245|					  ((strlen(strValue) >= 2) && (strValue[1] == ':')) ||
  ------------------
  |  Branch (1303:9): [True: 243, False: 2]
  |  Branch (1303:36): [True: 63, False: 180]
  ------------------
 1304|    182|					  ((strlen(strValue) >= 3) && (strValue[2] == ':')) );
  ------------------
  |  Branch (1304:9): [True: 173, False: 9]
  |  Branch (1304:36): [True: 22, False: 151]
  ------------------
 1305|       |
 1306|    339|	if ( ! timeOnly ) {
  ------------------
  |  Branch (1306:7): [True: 160, False: 179]
  ------------------
 1307|       |
 1308|    160|		if ( strValue[0] == '-' ) pos = 1;
  ------------------
  |  Branch (1308:8): [True: 78, False: 82]
  ------------------
 1309|       |
 1310|    160|		temp = GatherInt ( strValue, &pos, "Invalid year in date string" ); // Extract the year.
 1311|    160|		if ( (strValue[pos] != 0) && (strValue[pos] != '-') ) XMP_Throw ( "Invalid date string, after year", kXMPErr_BadParam );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1311:8): [True: 94, False: 66]
  |  Branch (1311:32): [True: 22, False: 72]
  ------------------
 1312|    138|		if ( strValue[0] == '-' ) temp = -temp;
  ------------------
  |  Branch (1312:8): [True: 66, False: 72]
  ------------------
 1313|    138|		binValue->year = temp;
 1314|    138|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1314:8): [True: 42, False: 96]
  ------------------
 1315|       |
 1316|     96|		++pos;
 1317|     96|		temp = GatherInt ( strValue, &pos, "Invalid month in date string" );	// Extract the month.
 1318|     96|		if ( (temp < 1) || (temp > 12) ) XMP_Throw ( "Month is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|     14|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1318:8): [True: 36, False: 60]
  |  Branch (1318:22): [True: 13, False: 47]
  ------------------
 1319|     82|		if ( (strValue[pos] != 0) && (strValue[pos] != '-') ) XMP_Throw ( "Invalid date string, after month", kXMPErr_BadParam );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1319:8): [True: 28, False: 54]
  |  Branch (1319:32): [True: 2, False: 26]
  ------------------
 1320|     80|		binValue->month = temp;
 1321|     80|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1321:8): [True: 19, False: 61]
  ------------------
 1322|       |
 1323|     61|		++pos;
 1324|     61|		temp = GatherInt ( strValue, &pos, "Invalid day in date string" );	// Extract the day.
 1325|     61|		if ( (temp < 1) || (temp > 31) ) XMP_Throw ( "Day is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1325:8): [True: 41, False: 20]
  |  Branch (1325:22): [True: 7, False: 13]
  ------------------
 1326|     53|		if ( (strValue[pos] != 0) && (strValue[pos] != 'T') ) XMP_Throw ( "Invalid date string, after day", kXMPErr_BadParam );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1326:8): [True: 4, False: 49]
  |  Branch (1326:32): [True: 3, False: 1]
  ------------------
 1327|     50|		binValue->day = temp;
 1328|     50|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1328:8): [True: 9, False: 41]
  ------------------
 1329|       |
 1330|       |		// Allow year, month, and day to all be zero; implies the date portion is missing.
 1331|     41|		if ( (binValue->year != 0) || (binValue->month != 0) || (binValue->day != 0) ) {
  ------------------
  |  Branch (1331:8): [True: 41, False: 0]
  |  Branch (1331:33): [True: 0, 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|      1|			if ( binValue->month < 1 ) binValue->month = 1;
  ------------------
  |  Branch (1335:9): [True: 0, False: 1]
  ------------------
 1336|      1|			if ( binValue->month > 12 ) binValue->month = 12;
  ------------------
  |  Branch (1336:9): [True: 0, False: 1]
  ------------------
 1337|      1|			if ( binValue->day < 1 ) binValue->day = 1;
  ------------------
  |  Branch (1337:9): [True: 0, False: 1]
  ------------------
 1338|      1|			if ( binValue->day > 31 ) binValue->day = 31;
  ------------------
  |  Branch (1338:9): [True: 0, False: 1]
  ------------------
 1339|      1|		}
 1340|       |
 1341|     41|	}
 1342|       |
 1343|    220|	if ( strValue[pos] == 'T' ) {
  ------------------
  |  Branch (1343:7): [True: 95, False: 125]
  ------------------
 1344|     95|		++pos;
 1345|    125|	} else if ( ! timeOnly ) {
  ------------------
  |  Branch (1345:14): [True: 0, False: 125]
  ------------------
 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|    220|	temp = GatherInt ( strValue, &pos, "Invalid hour in date string" ); // Extract the hour.
 1350|    220|	if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after hour", kXMPErr_BadParam );
  ------------------
  |  |  199|      9|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1350:7): [True: 9, False: 211]
  ------------------
 1351|    211|	if ( temp < 0 || temp > 23 ) temp = 23;	// *** 1269463: XMP_Throw ( "Hour is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1351:7): [True: 51, False: 160]
  |  Branch (1351:19): [True: 58, False: 102]
  ------------------
 1352|    211|	binValue->hour = temp;
 1353|       |	// Don't check for done, we have to work up to the time zone.
 1354|       |
 1355|    211|	++pos;
 1356|    211|	temp = GatherInt ( strValue, &pos, "Invalid minute in date string" );	// And the minute.
 1357|    211|	if ( (strValue[pos] != ':') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1357:7): [True: 66, False: 145]
  |  Branch (1357:33): [True: 64, False: 2]
  ------------------
 1358|    203|		 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) XMP_Throw ( "Invalid date string, after minute", kXMPErr_BadParam );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1358:4): [True: 29, False: 35]
  |  Branch (1358:30): [True: 21, False: 8]
  |  Branch (1358:56): [True: 8, False: 13]
  ------------------
 1359|    203|	if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Minute is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1359:7): [True: 68, False: 135]
  |  Branch (1359:19): [True: 56, False: 79]
  ------------------
 1360|    203|	binValue->minute = temp;
 1361|       |	// Don't check for done, we have to work up to the time zone.
 1362|       |
 1363|    203|	if ( strValue[pos] == ':' ) {
  ------------------
  |  Branch (1363:7): [True: 77, False: 126]
  ------------------
 1364|       |
 1365|     77|		++pos;
 1366|     77|		temp = GatherInt ( strValue, &pos, "Invalid whole seconds in date string" );	// Extract the whole seconds.
 1367|     77|		if ( (strValue[pos] != '.') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1367:8): [True: 21, False: 56]
  |  Branch (1367:34): [True: 20, False: 1]
  ------------------
 1368|     20|			 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1368:5): [True: 17, False: 3]
  |  Branch (1368:31): [True: 12, False: 5]
  |  Branch (1368:57): [True: 4, False: 8]
  ------------------
 1369|      4|			XMP_Throw ( "Invalid date string, after whole seconds", kXMPErr_BadParam );
  ------------------
  |  |  199|      4|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1370|      0|		}
 1371|     73|		if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Whole second is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1371:8): [True: 10, False: 63]
  |  Branch (1371:20): [True: 22, False: 41]
  ------------------
 1372|     73|		binValue->second = temp;
 1373|       |		// Don't check for done, we have to work up to the time zone.
 1374|       |
 1375|     73|		if ( strValue[pos] == '.' ) {
  ------------------
  |  Branch (1375:8): [True: 46, False: 27]
  ------------------
 1376|       |
 1377|     46|			++pos;
 1378|     46|			size_t digits = pos;	// Will be the number of digits later.
 1379|       |
 1380|     46|			temp = GatherInt ( strValue, &pos, "Invalid fractional seconds in date string" );	// Extract the fractional seconds.
 1381|     46|			if ( (strValue[pos] != 'Z') && (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1381:9): [True: 28, False: 18]
  |  Branch (1381:35): [True: 23, False: 5]
  |  Branch (1381:61): [True: 19, False: 4]
  |  Branch (1381:87): [True: 12, False: 7]
  ------------------
 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|     34|			digits = pos - digits;
 1386|    133|			for ( ; digits > 9; --digits ) temp = temp / 10;
  ------------------
  |  Branch (1386:12): [True: 99, False: 34]
  ------------------
 1387|     72|			for ( ; digits < 9; ++digits ) temp = temp * 10;
  ------------------
  |  Branch (1387:12): [True: 38, False: 34]
  ------------------
 1388|       |
 1389|     34|			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: 17, False: 17]
  |  Branch (1389:21): [True: 0, False: 17]
  ------------------
 1390|     34|			binValue->nanoSecond = temp;
 1391|       |			// Don't check for done, we have to work up to the time zone.
 1392|       |
 1393|     34|		}
 1394|       |
 1395|     73|	}
 1396|       |
 1397|    187|	if ( strValue[pos] == 'Z' ) {
  ------------------
  |  Branch (1397:7): [True: 4, False: 183]
  ------------------
 1398|       |
 1399|      4|		++pos;
 1400|       |
 1401|    183|	} else if ( strValue[pos] != 0 ) {
  ------------------
  |  Branch (1401:14): [True: 60, False: 123]
  ------------------
 1402|       |
 1403|     60|		if ( strValue[pos] == '+' ) {
  ------------------
  |  Branch (1403:8): [True: 43, False: 17]
  ------------------
 1404|     43|			binValue->tzSign = kXMP_TimeEastOfUTC;
 1405|     43|		} else if ( strValue[pos] == '-' ) {
  ------------------
  |  Branch (1405:15): [True: 17, False: 0]
  ------------------
 1406|     17|			binValue->tzSign = kXMP_TimeWestOfUTC;
 1407|     17|		} 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|     60|		++pos;
 1412|     60|		temp = GatherInt ( strValue, &pos, "Invalid time zone hour in date string" );	// Extract the time zone hour.
 1413|     60|		if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after time zone hour", kXMPErr_BadParam );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1413:8): [True: 22, False: 38]
  ------------------
 1414|     38|		if ( temp < 0 || temp > 23 ) XMP_Throw ( "Time zone hour is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1414:8): [True: 13, False: 25]
  |  Branch (1414:20): [True: 1, False: 24]
  ------------------
 1415|     37|		binValue->tzHour = temp;
 1416|       |
 1417|     37|		++pos;
 1418|     37|		temp = GatherInt ( strValue, &pos, "Invalid time zone minute in date string" ); // Extract the time zone minute.
 1419|     37|		if ( temp < 0 || temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1419:8): [True: 17, False: 20]
  |  Branch (1419:20): [True: 5, False: 15]
  ------------------
 1420|     32|		binValue->tzMinute = temp;
 1421|       |
 1422|    123|	} else {
 1423|       |
 1424|    123|		XMPUtils::SetTimeZone( binValue );
 1425|       |
 1426|    123|	}
 1427|       |
 1428|    159|	if ( strValue[pos] != 0 ) XMP_Throw ( "Invalid date string, extra chars at end", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1428:7): [True: 6, False: 153]
  ------------------
 1429|       |
 1430|    153|}	// ConvertToDate
_ZN8XMPUtils11SetTimeZoneEP12XMP_DateTime:
 1946|    139|{
 1947|    139|	XMP_Assert ( xmpTime != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    139|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1948|       |
 1949|    139|	if ( (xmpTime->tzSign != 0) || (xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0) ) {
  ------------------
  |  Branch (1949:7): [True: 0, False: 139]
  |  Branch (1949:33): [True: 0, False: 139]
  |  Branch (1949:59): [True: 0, False: 139]
  ------------------
 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|    139|	ansi_tt ttTime;
 1956|    139|	ansi_tm tmLocal, tmUTC;
 1957|       |
 1958|    139|	if ( (xmpTime->year == 0) && (xmpTime->month == 0) && (xmpTime->day == 0) ) {
  ------------------
  |  Branch (1958:7): [True: 65, False: 74]
  |  Branch (1958:31): [True: 63, False: 2]
  |  Branch (1958:56): [True: 63, False: 0]
  ------------------
 1959|     63|		ansi_tt now = ansi_time(0);
  ------------------
  |  |   69|     63|	#define ansi_time		time
  ------------------
 1960|     63|		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: 63]
  ------------------
 1961|     63|		ansi_localtime ( &now, &tmLocal );
  ------------------
  |  |   74|     63|	#define ansi_localtime	localtime_r
  ------------------
 1962|     76|	} else {
 1963|     76|		if (xmpTime->year < std::numeric_limits<decltype(tmLocal.tm_year)>::min() + 1900) {
  ------------------
  |  Branch (1963:7): [True: 1, False: 75]
  ------------------
 1964|      1|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      1|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1965|     75|		} else if (xmpTime->year > std::numeric_limits<decltype(tmLocal.tm_year)>::max()) {
  ------------------
  |  Branch (1965:14): [True: 0, False: 75]
  ------------------
 1966|      0|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1967|     75|		} else {
 1968|     75|			tmLocal.tm_year = xmpTime->year - 1900;
 1969|     75|		}
 1970|     75|		tmLocal.tm_mon	 = xmpTime->month - 1;
 1971|     75|		tmLocal.tm_mday	 = xmpTime->day;
 1972|     75|	}
 1973|       |
 1974|    138|	tmLocal.tm_hour = xmpTime->hour;
 1975|    138|	tmLocal.tm_min = xmpTime->minute;
 1976|    138|	tmLocal.tm_sec = xmpTime->second;
 1977|    138|	tmLocal.tm_isdst = -1;	// Don't know if daylight time is in effect.
 1978|       |
 1979|    138|	ttTime = ansi_mktime ( &tmLocal );
  ------------------
  |  |   70|    138|	#define ansi_mktime		mktime
  ------------------
 1980|    138|	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: 138]
  ------------------
 1981|       |
 1982|       |	// Convert back to a localized ansi_tm time and get the corresponding UTC ansi_tm time.
 1983|       |
 1984|    138|	ansi_localtime ( &ttTime, &tmLocal );
  ------------------
  |  |   74|    138|	#define ansi_localtime	localtime_r
  ------------------
 1985|    138|	ansi_gmtime ( &ttTime, &tmUTC );
  ------------------
  |  |   73|    138|	#define ansi_gmtime		gmtime_r
  ------------------
 1986|       |
 1987|       |	// Get the offset direction and amount.
 1988|       |
 1989|    138|	ansi_tm tmx = tmLocal;	// ! Note that mktime updates the ansi_tm parameter, messing up difftime!
 1990|    138|	ansi_tm tmy = tmUTC;
 1991|    138|	tmx.tm_isdst = tmy.tm_isdst = 0;
 1992|    138|	ansi_tt ttx = ansi_mktime ( &tmx );
  ------------------
  |  |   70|    138|	#define ansi_mktime		mktime
  ------------------
 1993|    138|	ansi_tt tty = ansi_mktime ( &tmy );
  ------------------
  |  |   70|    138|	#define ansi_mktime		mktime
  ------------------
 1994|    138|	double diffSecs;
 1995|       |
 1996|    138|	if ( (ttx != -1) && (tty != -1) ) {
  ------------------
  |  Branch (1996:7): [True: 138, False: 0]
  |  Branch (1996:22): [True: 138, False: 0]
  ------------------
 1997|    138|		diffSecs = ansi_difftime ( ttx, tty );
  ------------------
  |  |   71|    138|	#define ansi_difftime	difftime
  ------------------
 1998|    138|	} 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|    138|	if ( diffSecs > 0.0 ) {
  ------------------
  |  Branch (2017:7): [True: 0, False: 138]
  ------------------
 2018|      0|		xmpTime->tzSign = kXMP_TimeEastOfUTC;
 2019|    138|	} else if ( diffSecs == 0.0 ) {
  ------------------
  |  Branch (2019:14): [True: 138, False: 0]
  ------------------
 2020|    138|		xmpTime->tzSign = kXMP_TimeIsUTC;
 2021|    138|	} else {
 2022|      0|		xmpTime->tzSign = kXMP_TimeWestOfUTC;
 2023|      0|		diffSecs = -diffSecs;
 2024|      0|	}
 2025|    138|	xmpTime->tzHour = XMP_Int32 ( diffSecs / 3600.0 );
 2026|    138|	xmpTime->tzMinute = XMP_Int32 ( (diffSecs / 60.0) - (xmpTime->tzHour * 60.0) );
 2027|       |
 2028|       |	// *** Save the tm_isdst flag in a qualifier?
 2029|       |
 2030|    138|	XMP_Assert ( (0 <= xmpTime->tzHour) && (xmpTime->tzHour <= 23) );
  ------------------
  |  |  142|    138|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2031|    138|	XMP_Assert ( (0 <= xmpTime->tzMinute) && (xmpTime->tzMinute <= 59) );
  ------------------
  |  |  142|    138|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2032|    138|	XMP_Assert ( (-1 <= xmpTime->tzSign) && (xmpTime->tzSign <= +1) );
  ------------------
  |  |  142|    138|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2033|    138|	XMP_Assert ( (xmpTime->tzSign == 0) ? ((xmpTime->tzHour == 0) && (xmpTime->tzMinute == 0)) :
  ------------------
  |  |  142|    138|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2034|    138|										  ((xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0)) );
 2035|       |
 2036|    138|}	// SetTimeZone
_ZN8XMPUtils16ConvertToUTCTimeEP12XMP_DateTime:
 2045|    111|{
 2046|    111|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2047|       |
 2048|    111|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2049|    111|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2050|    111|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2051|    111|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2052|    111|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2053|       |
 2054|    111|	if ( time->tzSign == kXMP_TimeEastOfUTC ) {
  ------------------
  |  Branch (2054:7): [True: 9, False: 102]
  ------------------
 2055|       |		// We are before (east of) GMT, subtract the offset from the time.
 2056|      9|		time->hour -= time->tzHour;
 2057|      9|		time->minute -= time->tzMinute;
 2058|    102|	} else if ( time->tzSign == kXMP_TimeWestOfUTC ) {
  ------------------
  |  Branch (2058:14): [True: 4, False: 98]
  ------------------
 2059|       |		// We are behind (west of) GMT, add the offset to the time.
 2060|      4|		time->hour += time->tzHour;
 2061|      4|		time->minute += time->tzMinute;
 2062|      4|	}
 2063|       |
 2064|    111|	AdjustTimeOverflow ( time );
 2065|    111|	time->tzSign = time->tzHour = time->tzMinute = 0;
 2066|       |
 2067|    111|}	// ConvertToUTCTime
_ZN8XMPUtils18ConvertToLocalTimeEP12XMP_DateTime:
 2076|    111|{
 2077|    111|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2078|       |
 2079|    111|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2080|    111|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2081|    111|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2082|    111|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|    111|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2083|    111|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2084|       |
 2085|    111|	ConvertToUTCTime ( time );	// The existing time zone might not be the local one.
 2086|    111|	SetTimeZone ( time );		// Fill in the local timezone offset, then adjust the time.
 2087|       |
 2088|    111|	if ( time->tzSign > 0 ) {
  ------------------
  |  Branch (2088:7): [True: 0, False: 111]
  ------------------
 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|    111|	} else if ( time->tzSign < 0 ) {
  ------------------
  |  Branch (2092:14): [True: 0, False: 111]
  ------------------
 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|    111|	AdjustTimeOverflow ( time );
 2099|       |
 2100|    111|}	// ConvertToLocalTime
XMPUtils.cpp:_ZL9GatherIntPKcPmS0_:
  368|    805|{
  369|    805|	size_t	 pos   = *_pos;
  370|    805|	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|    805|	const XMP_Int32 tens_upperbound = std::numeric_limits<XMP_Int32>::max() / 10;
  378|    805|	const XMP_Int32 ones_upperbound = std::numeric_limits<XMP_Int32>::max() % 10;
  379|       |
  380|  6.39k|	for ( char ch = strValue[pos]; ('0' <= ch) && (ch <= '9'); ++pos, ch = strValue[pos] ) {
  ------------------
  |  Branch (380:33): [True: 5.99k, False: 396]
  |  Branch (380:48): [True: 5.63k, False: 363]
  ------------------
  381|  5.63k|		const XMP_Int32 digit = ch - '0';
  382|  5.63k|		if (value >= tens_upperbound) {
  ------------------
  |  Branch (382:7): [True: 59, False: 5.57k]
  ------------------
  383|     59|			if (value > tens_upperbound || digit > ones_upperbound) {
  ------------------
  |  Branch (383:8): [True: 38, False: 21]
  |  Branch (383:35): [True: 8, False: 13]
  ------------------
  384|     46|				XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     46|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  385|      0|			}
  386|     59|		}
  387|  5.58k|		value = (value * 10) + digit;
  388|  5.58k|	}
  389|       |
  390|    759|	if ( pos == *_pos ) XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     66|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (390:7): [True: 66, False: 693]
  ------------------
  391|    693|	*_pos = pos;
  392|    693|	return value;
  393|       |
  394|    759|}	// GatherInt
XMPUtils.cpp:_ZL18AdjustTimeOverflowP12XMP_DateTime:
  214|    221|{
  215|    221|	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|    221|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (225:7): [True: 141, False: 80]
  |  Branch (225:28): [True: 4, False: 76]
  |  Branch (225:50): [True: 0, False: 76]
  ------------------
  226|       |
  227|    187|		while ( time->month < 1 ) {
  ------------------
  |  Branch (227:11): [True: 42, False: 145]
  ------------------
  228|     42|			time->year -= 1;
  229|     42|			time->month += 12;
  230|     42|		}
  231|       |
  232|    145|		while ( time->month > 12 ) {
  ------------------
  |  Branch (232:11): [True: 0, False: 145]
  ------------------
  233|      0|			time->year += 1;
  234|      0|			time->month -= 12;
  235|      0|		}
  236|       |
  237|    206|		while ( time->day < 1 ) {
  ------------------
  |  Branch (237:11): [True: 61, False: 145]
  ------------------
  238|     61|			time->month -= 1;
  239|     61|			if ( time->month < 1 ) {	// ! Keep the months in range for indexing daysInMonth!
  ------------------
  |  Branch (239:9): [True: 6, False: 55]
  ------------------
  240|      6|				time->year -= 1;
  241|      6|				time->month += 12;
  242|      6|			}
  243|     61|			time->day += DaysInMonth ( time->year, time->month );	// ! Decrement month before so index here is right!
  244|     61|		}
  245|       |
  246|    150|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (246:11): [True: 5, False: 145]
  ------------------
  247|      5|			time->day -= DaysInMonth ( time->year, time->month );	// ! Increment month after so index here is right!
  248|      5|			time->month += 1;
  249|      5|			if ( time->month > 12 ) {
  ------------------
  |  Branch (249:9): [True: 0, False: 5]
  ------------------
  250|      0|				time->year += 1;
  251|      0|				time->month -= 12;
  252|      0|			}
  253|      5|		}
  254|       |
  255|    145|	}
  256|       |
  257|    226|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (257:10): [True: 5, False: 221]
  ------------------
  258|      5|		time->day -= 1;
  259|      5|		time->hour += 24;
  260|      5|	}
  261|       |
  262|    221|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (262:10): [True: 0, False: 221]
  ------------------
  263|      0|		time->day += 1;
  264|      0|		time->hour -= 24;
  265|      0|	}
  266|       |
  267|    225|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (267:10): [True: 4, False: 221]
  ------------------
  268|      4|		time->hour -= 1;
  269|      4|		time->minute += 60;
  270|      4|	}
  271|       |
  272|    222|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (272:10): [True: 1, False: 221]
  ------------------
  273|      1|		time->hour += 1;
  274|      1|		time->minute -= 60;
  275|      1|	}
  276|       |
  277|    221|	while ( time->second < 0 ) {
  ------------------
  |  Branch (277:10): [True: 0, False: 221]
  ------------------
  278|      0|		time->minute -= 1;
  279|      0|		time->second += 60;
  280|      0|	}
  281|       |
  282|    221|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (282:10): [True: 0, False: 221]
  ------------------
  283|      0|		time->minute += 1;
  284|      0|		time->second -= 60;
  285|      0|	}
  286|       |
  287|    221|	while ( time->nanoSecond < 0 ) {
  ------------------
  |  Branch (287:10): [True: 0, False: 221]
  ------------------
  288|      0|		time->second -= 1;
  289|      0|		time->nanoSecond += kBillion;
  290|      0|	}
  291|       |
  292|    221|	while ( time->nanoSecond >= kBillion ) {
  ------------------
  |  Branch (292:10): [True: 0, False: 221]
  ------------------
  293|      0|		time->second += 1;
  294|      0|		time->nanoSecond -= kBillion;
  295|      0|	}
  296|       |
  297|    221|	while ( time->second < 0 ) {
  ------------------
  |  Branch (297:10): [True: 0, False: 221]
  ------------------
  298|      0|		time->minute -= 1;
  299|      0|		time->second += 60;
  300|      0|	}
  301|       |
  302|    221|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (302:10): [True: 0, False: 221]
  ------------------
  303|      0|		time->minute += 1;
  304|      0|		time->second -= 60;
  305|      0|	}
  306|       |
  307|    221|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (307:10): [True: 0, False: 221]
  ------------------
  308|      0|		time->hour -= 1;
  309|      0|		time->minute += 60;
  310|      0|	}
  311|       |
  312|    221|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (312:10): [True: 0, False: 221]
  ------------------
  313|      0|		time->hour += 1;
  314|      0|		time->minute -= 60;
  315|      0|	}
  316|       |
  317|    222|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (317:10): [True: 1, False: 221]
  ------------------
  318|      1|		time->day -= 1;
  319|      1|		time->hour += 24;
  320|      1|	}
  321|       |
  322|    221|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (322:10): [True: 0, False: 221]
  ------------------
  323|      0|		time->day += 1;
  324|      0|		time->hour -= 24;
  325|      0|	}
  326|       |
  327|    221|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (327:7): [True: 141, False: 80]
  |  Branch (327:28): [True: 4, False: 76]
  |  Branch (327:50): [True: 6, False: 70]
  ------------------
  328|       |
  329|    157|		while ( time->month < 1 ) { // Make sure the months are OK first, for DaysInMonth.
  ------------------
  |  Branch (329:11): [True: 6, False: 151]
  ------------------
  330|      6|			time->year -= 1;
  331|      6|			time->month += 12;
  332|      6|		}
  333|       |
  334|    151|		while ( time->month > 12 ) {
  ------------------
  |  Branch (334:11): [True: 0, False: 151]
  ------------------
  335|      0|			time->year += 1;
  336|      0|			time->month -= 12;
  337|      0|		}
  338|       |
  339|    157|		while ( time->day < 1 ) {
  ------------------
  |  Branch (339:11): [True: 6, False: 151]
  ------------------
  340|      6|			time->month -= 1;
  341|      6|			if ( time->month < 1 ) {
  ------------------
  |  Branch (341:9): [True: 0, False: 6]
  ------------------
  342|      0|				time->year -= 1;
  343|      0|				time->month += 12;
  344|      0|			}
  345|      6|			time->day += DaysInMonth ( time->year, time->month );
  346|      6|		}
  347|       |
  348|    151|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (348:11): [True: 0, False: 151]
  ------------------
  349|      0|			time->day -= DaysInMonth ( time->year, time->month );
  350|      0|			time->month += 1;
  351|      0|			if ( time->month > 12 ) {
  ------------------
  |  Branch (351:9): [True: 0, False: 0]
  ------------------
  352|      0|				time->year += 1;
  353|      0|				time->month -= 12;
  354|      0|			}
  355|      0|		}
  356|       |
  357|    151|	}
  358|       |
  359|    221|}	// AdjustTimeOverflow
XMPUtils.cpp:_ZL11DaysInMonthii:
  195|    373|{
  196|       |
  197|    373|	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|    373|	int days = daysInMonth [ month ];
  201|    373|	if ( (month == 2) && IsLeapYear ( year ) ) days += 1;
  ------------------
  |  Branch (201:7): [True: 78, False: 295]
  |  Branch (201:23): [True: 36, False: 42]
  ------------------
  202|       |
  203|    373|	return days;
  204|       |
  205|    373|}	// DaysInMonth
XMPUtils.cpp:_ZL10IsLeapYearl:
  176|     78|{
  177|       |	// This code uses the Gregorian calendar algorithm:
  178|       |	// https://en.wikipedia.org/wiki/Leap_year#Algorithm
  179|       |
  180|     78|	if ( (year % 4) != 0 ) return false;	// Not a multiple of 4.
  ------------------
  |  Branch (180:7): [True: 31, False: 47]
  ------------------
  181|     47|	if ( (year % 100) != 0 ) return true;	// A multiple of 4 but not a multiple of 100.
  ------------------
  |  Branch (181:7): [True: 29, False: 18]
  ------------------
  182|     18|	if ( (year % 400) == 0 ) return true;	// A multiple of 400.
  ------------------
  |  Branch (182:7): [True: 7, False: 11]
  ------------------
  183|       |
  184|     11|	return false;							// A multiple of 100 but not a multiple of 400.
  185|       |
  186|     18|}	// IsLeapYear

