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

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

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

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

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

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  9.04M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  13.1M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   527k|  Key(const Key&) = default;

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  5.87M|  [[nodiscard]] auto begin() noexcept {
  151|  5.87M|    return pData_.begin();
  152|  5.87M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  66.3k|  [[nodiscard]] auto end() noexcept {
  155|  66.3k|    return pData_.end();
  156|  66.3k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  18.9k|  [[nodiscard]] auto begin() const noexcept {
  159|  18.9k|    return pData_.begin();
  160|  18.9k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  18.6k|  [[nodiscard]] auto end() const noexcept {
  163|  18.6k|    return pData_.end();
  164|  18.6k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  9.48M|  [[nodiscard]] size_t size() const {
  167|  9.48M|    return pData_.size();
  168|  9.48M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  63.6k|  [[nodiscard]] bool empty() const {
  195|  63.6k|    return pData_.empty();
  196|  63.6k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.41M|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  39.6k|const T* find(T (&src)[N], const K& key) {
  448|  39.6k|  static_assert(N > 0, "Passed zero length find");
  449|  39.6k|  auto rc = std::find(src, src + N, key);
  450|  39.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 39.6k]
  ------------------
  451|  39.6k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   112k|std::string toString(const T& arg) {
  467|   112k|  return toStringHelper(arg, std::is_integral<T>());
  468|   112k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   112k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   112k|  return std::to_string(arg);
  457|   112k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  38.2M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  38.2M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 2.61M, False: 35.6M]
  ------------------
  229|  2.61M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  2.61M|  }
  231|  35.6M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  38.2M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|   249k|const T* find(T (&src)[N], const K& key) {
  448|   249k|  static_assert(N > 0, "Passed zero length find");
  449|   249k|  auto rc = std::find(src, src + N, key);
  450|   249k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 245k, False: 3.55k]
  ------------------
  451|   249k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  10.6M|const T* find(T (&src)[N], const K& key) {
  448|  10.6M|  static_assert(N > 0, "Passed zero length find");
  449|  10.6M|  auto rc = std::find(src, src + N, key);
  450|  10.6M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.26M, False: 8.41M]
  ------------------
  451|  10.6M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     14|T stringTo(const std::string& s, bool& ok) {
  483|     14|  std::istringstream is(s);
  484|     14|  T tmp = T();
  485|     14|  ok = static_cast<bool>(is >> tmp);
  486|     14|  std::string rest;
  487|     14|  is >> std::skipws >> rest;
  488|     14|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 0, False: 14]
  ------------------
  489|      0|    ok = false;
  490|     14|  return tmp;
  491|     14|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  34.8k|std::string toString(const T& arg) {
  467|  34.8k|  return toStringHelper(arg, std::is_integral<T>());
  468|  34.8k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  34.8k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  34.8k|  return std::to_string(arg);
  457|  34.8k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  2.13k|std::string toString(const T& arg) {
  467|  2.13k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.13k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  2.13k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  2.13k|  return std::to_string(arg);
  457|  2.13k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   203k|std::string toString(const T& arg) {
  467|   203k|  return toStringHelper(arg, std::is_integral<T>());
  468|   203k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   203k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   203k|  return std::to_string(arg);
  457|   203k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  4.43k|std::string toString(const T& arg) {
  467|  4.43k|  return toStringHelper(arg, std::is_integral<T>());
  468|  4.43k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  4.43k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  4.43k|  std::ostringstream os;
  462|  4.43k|  os << arg;
  463|  4.43k|  return os.str();
  464|  4.43k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   187k|std::string toString(const T& arg) {
  467|   187k|  return toStringHelper(arg, std::is_integral<T>());
  468|   187k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|   187k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   187k|  std::ostringstream os;
  462|   187k|  os << arg;
  463|   187k|  return os.str();
  464|   187k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  82.1k|std::string toString(const T& arg) {
  467|  82.1k|  return toStringHelper(arg, std::is_integral<T>());
  468|  82.1k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  82.1k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  82.1k|  return std::to_string(arg);
  457|  82.1k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  2.12k|const T* find(T (&src)[N], const K& key) {
  448|  2.12k|  static_assert(N > 0, "Passed zero length find");
  449|  2.12k|  auto rc = std::find(src, src + N, key);
  450|  2.12k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.00k, False: 1.11k]
  ------------------
  451|  2.12k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|    941|const T* find(T (&src)[N], const K& key) {
  448|    941|  static_assert(N > 0, "Passed zero length find");
  449|    941|  auto rc = std::find(src, src + N, key);
  450|    941|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 509, False: 432]
  ------------------
  451|    941|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    870|const T* find(T (&src)[N], const K& key) {
  448|    870|  static_assert(N > 0, "Passed zero length find");
  449|    870|  auto rc = std::find(src, src + N, key);
  450|    870|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 843, False: 27]
  ------------------
  451|    870|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|   158k|const T* find(T (&src)[N], const K& key) {
  448|   158k|  static_assert(N > 0, "Passed zero length find");
  449|   158k|  auto rc = std::find(src, src + N, key);
  450|   158k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.64k, False: 157k]
  ------------------
  451|   158k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  7.45k|const T* find(T (&src)[N], const K& key) {
  448|  7.45k|  static_assert(N > 0, "Passed zero length find");
  449|  7.45k|  auto rc = std::find(src, src + N, key);
  450|  7.45k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.01k, False: 3.44k]
  ------------------
  451|  7.45k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  5.31k|const T* find(T (&src)[N], const K& key) {
  448|  5.31k|  static_assert(N > 0, "Passed zero length find");
  449|  5.31k|  auto rc = std::find(src, src + N, key);
  450|  5.31k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.23k, False: 2.08k]
  ------------------
  451|  5.31k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  8.14k|const T* find(T (&src)[N], const K& key) {
  448|  8.14k|  static_assert(N > 0, "Passed zero length find");
  449|  8.14k|  auto rc = std::find(src, src + N, key);
  450|  8.14k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 6.83k, False: 1.31k]
  ------------------
  451|  8.14k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  4.46k|std::string toString(const T& arg) {
  467|  4.46k|  return toStringHelper(arg, std::is_integral<T>());
  468|  4.46k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  4.46k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  4.46k|  std::ostringstream os;
  462|  4.46k|  os << arg;
  463|  4.46k|  return os.str();
  464|  4.46k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  2.79k|std::string toString(const T& arg) {
  467|  2.79k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.79k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  2.79k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  2.79k|  return std::to_string(arg);
  457|  2.79k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|  1.23M|std::string toString(const T& arg) {
  467|  1.23M|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.23M|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|  1.23M|std::string toStringHelper(const T& arg, std::false_type) {
  461|  1.23M|  std::ostringstream os;
  462|  1.23M|  os << arg;
  463|  1.23M|  return os.str();
  464|  1.23M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|  1.06k|const T* find(T (&src)[N], const K& key) {
  448|  1.06k|  static_assert(N > 0, "Passed zero length find");
  449|  1.06k|  auto rc = std::find(src, src + N, key);
  450|  1.06k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 964, False: 99]
  ------------------
  451|  1.06k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|  11.2k|const T* find(T (&src)[N], const K& key) {
  448|  11.2k|  static_assert(N > 0, "Passed zero length find");
  449|  11.2k|  auto rc = std::find(src, src + N, key);
  450|  11.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.60k, False: 5.64k]
  ------------------
  451|  11.2k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|  11.2k|const T* find(T (&src)[N], const K& key) {
  448|  11.2k|  static_assert(N > 0, "Passed zero length find");
  449|  11.2k|  auto rc = std::find(src, src + N, key);
  450|  11.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 10.0k, False: 1.21k]
  ------------------
  451|  11.2k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  6.68k|const T* find(T (&src)[N], const K& key) {
  448|  6.68k|  static_assert(N > 0, "Passed zero length find");
  449|  6.68k|  auto rc = std::find(src, src + N, key);
  450|  6.68k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.83k, False: 2.85k]
  ------------------
  451|  6.68k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|   105k|const T* find(T (&src)[N], const K& key) {
  448|   105k|  static_assert(N > 0, "Passed zero length find");
  449|   105k|  auto rc = std::find(src, src + N, key);
  450|   105k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 93.1k, False: 12.4k]
  ------------------
  451|   105k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  27.5k|const T* find(T (&src)[N], const K& key) {
  448|  27.5k|  static_assert(N > 0, "Passed zero length find");
  449|  27.5k|  auto rc = std::find(src, src + N, key);
  450|  27.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 12.7k, False: 14.7k]
  ------------------
  451|  27.5k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  4.44k|const T* find(T (&src)[N], const K& key) {
  448|  4.44k|  static_assert(N > 0, "Passed zero length find");
  449|  4.44k|  auto rc = std::find(src, src + N, key);
  450|  4.44k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.41k, False: 1.03k]
  ------------------
  451|  4.44k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  4.44k|const T* find(T (&src)[N], const K& key) {
  448|  4.44k|  static_assert(N > 0, "Passed zero length find");
  449|  4.44k|  auto rc = std::find(src, src + N, key);
  450|  4.44k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.94k, False: 1.49k]
  ------------------
  451|  4.44k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|    567|const T* find(T (&src)[N], const K& key) {
  448|    567|  static_assert(N > 0, "Passed zero length find");
  449|    567|  auto rc = std::find(src, src + N, key);
  450|    567|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 249, False: 318]
  ------------------
  451|    567|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   499k|const T* find(T (&src)[N], const K& key) {
  448|   499k|  static_assert(N > 0, "Passed zero length find");
  449|   499k|  auto rc = std::find(src, src + N, key);
  450|   499k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 484k, False: 15.0k]
  ------------------
  451|   499k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|   109k|const T* find(T (&src)[N], const K& key) {
  448|   109k|  static_assert(N > 0, "Passed zero length find");
  449|   109k|  auto rc = std::find(src, src + N, key);
  450|   109k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 105k, False: 3.97k]
  ------------------
  451|   109k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  3.30k|const T* find(T (&src)[N], const K& key) {
  448|  3.30k|  static_assert(N > 0, "Passed zero length find");
  449|  3.30k|  auto rc = std::find(src, src + N, key);
  450|  3.30k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 535, False: 2.76k]
  ------------------
  451|  3.30k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  6.48k|const T* find(T (&src)[N], const K& key) {
  448|  6.48k|  static_assert(N > 0, "Passed zero length find");
  449|  6.48k|  auto rc = std::find(src, src + N, key);
  450|  6.48k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.83k, False: 4.65k]
  ------------------
  451|  6.48k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  7.12M|const T* find(T (&src)[N], const K& key) {
  448|  7.12M|  static_assert(N > 0, "Passed zero length find");
  449|  7.12M|  auto rc = std::find(src, src + N, key);
  450|  7.12M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 7.12M]
  ------------------
  451|  7.12M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  5.92M|const T* find(T (&src)[N], const K& key) {
  448|  5.92M|  static_assert(N > 0, "Passed zero length find");
  449|  5.92M|  auto rc = std::find(src, src + N, key);
  450|  5.92M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 5.92M]
  ------------------
  451|  5.92M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  4.84M|const T* find(T (&src)[N], const K& key) {
  448|  4.84M|  static_assert(N > 0, "Passed zero length find");
  449|  4.84M|  auto rc = std::find(src, src + N, key);
  450|  4.84M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.83M, False: 16.0k]
  ------------------
  451|  4.84M|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|  95.0k|const T* find(T (&src)[N], const K& key) {
  448|  95.0k|  static_assert(N > 0, "Passed zero length find");
  449|  95.0k|  auto rc = std::find(src, src + N, key);
  450|  95.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 7.01k, False: 88.0k]
  ------------------
  451|  95.0k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|  1.15M|const T* find(T (&src)[N], const K& key) {
  448|  1.15M|  static_assert(N > 0, "Passed zero length find");
  449|  1.15M|  auto rc = std::find(src, src + N, key);
  450|  1.15M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 86, False: 1.15M]
  ------------------
  451|  1.15M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  19.0k|const T* find(T (&src)[N], const K& key) {
  448|  19.0k|  static_assert(N > 0, "Passed zero length find");
  449|  19.0k|  auto rc = std::find(src, src + N, key);
  450|  19.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.97k, False: 13.0k]
  ------------------
  451|  19.0k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  447|  8.36k|const T* find(T (&src)[N], const K& key) {
  448|  8.36k|  static_assert(N > 0, "Passed zero length find");
  449|  8.36k|  auto rc = std::find(src, src + N, key);
  450|  8.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 8.36k]
  ------------------
  451|  8.36k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|  1.51k|const T* find(T (&src)[N], const K& key) {
  448|  1.51k|  static_assert(N > 0, "Passed zero length find");
  449|  1.51k|  auto rc = std::find(src, src + N, key);
  450|  1.51k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 322, False: 1.19k]
  ------------------
  451|  1.51k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|    172|T stringTo(const std::string& s, bool& ok) {
  483|    172|  std::istringstream is(s);
  484|    172|  T tmp = T();
  485|    172|  ok = static_cast<bool>(is >> tmp);
  486|    172|  std::string rest;
  487|    172|  is >> std::skipws >> rest;
  488|    172|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 79, False: 93]
  ------------------
  489|     79|    ok = false;
  490|    172|  return tmp;
  491|    172|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     99|const T* find(T (&src)[N], const K& key) {
  448|     99|  static_assert(N > 0, "Passed zero length find");
  449|     99|  auto rc = std::find(src, src + N, key);
  450|     99|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 99, False: 0]
  ------------------
  451|     99|}

_ZNK5Exiv25Value6typeIdEv:
   85|  10.5M|  TypeId typeId() const {
   86|  10.5M|    return type_;
   87|  10.5M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  12.0M|  UniquePtr clone() const {
   94|  12.0M|    return UniquePtr(clone_());
   95|  12.0M|  }
_ZNK5Exiv25Value2okEv:
  181|   114k|  bool ok() const {
  182|   114k|    return ok_;
  183|   114k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  32.8k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  32.8k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 21.0k, False: 11.7k]
  ------------------
  797|  21.0k|      return str1.size() > str2.size();
  798|       |
  799|  11.7k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  11.7k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  32.8k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   267k|inline TypeId getType<uint16_t>() {
 1084|   267k|  return unsignedShort;
 1085|   267k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  4.73k|inline TypeId getType<uint32_t>() {
 1089|  4.73k|  return unsignedLong;
 1090|  4.73k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  13.0k|inline TypeId getType<URational>() {
 1094|  13.0k|  return unsignedRational;
 1095|  13.0k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  22.2k|inline TypeId getType<int16_t>() {
 1099|  22.2k|  return signedShort;
 1100|  22.2k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  30.9k|inline TypeId getType<int32_t>() {
 1104|  30.9k|  return signedLong;
 1105|  30.9k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  11.6k|inline TypeId getType<Rational>() {
 1109|  11.6k|  return signedRational;
 1110|  11.6k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  8.42k|inline TypeId getType<float>() {
 1114|  8.42k|  return tiffFloat;
 1115|  8.42k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  11.5k|inline TypeId getType<double>() {
 1119|  11.5k|  return tiffDouble;
 1120|  11.5k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  2.73M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  2.73M|  return getUShort(buf, byteOrder);
 1316|  2.73M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  1.57M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  1.57M|  return getULong(buf, byteOrder);
 1321|  1.57M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   661k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   661k|  return getURational(buf, byteOrder);
 1326|   661k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   291k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   291k|  return getShort(buf, byteOrder);
 1331|   291k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   730k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   730k|  return getLong(buf, byteOrder);
 1336|   730k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   540k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   540k|  return getRational(buf, byteOrder);
 1341|   540k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  50.8k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  50.8k|  return getFloat(buf, byteOrder);
 1346|  50.8k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   464k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   464k|  return getDouble(buf, byteOrder);
 1351|   464k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  2.93M|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  2.93M|  return us2Data(buf, t, byteOrder);
 1374|  2.93M|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|   470k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|   470k|  return ul2Data(buf, t, byteOrder);
 1382|   470k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   527k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   527k|  return ur2Data(buf, t, byteOrder);
 1390|   527k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   279k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   279k|  return s2Data(buf, t, byteOrder);
 1398|   279k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   565k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   565k|  return l2Data(buf, t, byteOrder);
 1406|   565k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   309k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   309k|  return r2Data(buf, t, byteOrder);
 1414|   309k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  33.3k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  33.3k|  return f2Data(buf, t, byteOrder);
 1422|  33.3k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   237k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   237k|  return d2Data(buf, t, byteOrder);
 1430|   237k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  2.41k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  2.41k|  return float_to_integer_helper<int64_t>(n);
 1550|  2.41k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  7.75k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  7.75k|  return float_to_integer_helper<uint32_t>(n);
 1555|  7.75k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  4.67k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  4.67k|  return float_to_integer_helper<int64_t>(n);
 1560|  4.67k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  13.6k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  13.6k|  return float_to_integer_helper<uint32_t>(n);
 1564|  13.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  7.63k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  7.63k|  return rational_to_integer_helper<int64_t>(n);
 1569|  7.63k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  22.5k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  22.5k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  22.5k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  7.33k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  7.33k|  return rational_to_integer_helper<int64_t>(n);
 1578|  7.33k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  41.6k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  41.6k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  41.6k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  2.41k|  I float_to_integer_helper(size_t n) const {
 1213|  2.41k|    const auto v = value_.at(n);
 1214|  2.41k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 2.10k, False: 310]
  ------------------
 1215|  2.10k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 1.49k, False: 613]
  ------------------
 1216|  1.49k|      return static_cast<I>(std::lround(v));
 1217|  1.49k|    }
 1218|    923|    return 0;
 1219|  2.41k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  7.75k|  I float_to_integer_helper(size_t n) const {
 1213|  7.75k|    const auto v = value_.at(n);
 1214|  7.75k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.51k, False: 1.23k]
  ------------------
 1215|  6.51k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 5.45k, False: 1.05k]
  ------------------
 1216|  5.45k|      return static_cast<I>(std::lround(v));
 1217|  5.45k|    }
 1218|  2.29k|    return 0;
 1219|  7.75k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  4.67k|  I float_to_integer_helper(size_t n) const {
 1213|  4.67k|    const auto v = value_.at(n);
 1214|  4.67k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.97k, False: 698]
  ------------------
 1215|  3.97k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.07k, False: 908]
  ------------------
 1216|  3.07k|      return static_cast<I>(std::lround(v));
 1217|  3.07k|    }
 1218|  1.60k|    return 0;
 1219|  4.67k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  13.6k|  I float_to_integer_helper(size_t n) const {
 1213|  13.6k|    const auto v = value_.at(n);
 1214|  13.6k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 10.2k, False: 3.37k]
  ------------------
 1215|  10.2k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 8.95k, False: 1.28k]
  ------------------
 1216|  8.95k|      return static_cast<I>(std::lround(v));
 1217|  8.95k|    }
 1218|  4.66k|    return 0;
 1219|  13.6k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  7.63k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.63k|    auto a = value_.at(n).first;
 1225|  7.63k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.63k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.48k, False: 5.15k]
  ------------------
 1229|  2.48k|      return 0;
 1230|  2.48k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.15k|#ifdef __cpp_if_constexpr
 1234|  5.15k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  5.15k|      const auto imin = std::numeric_limits<I>::min();
 1240|  5.15k|      const auto imax = std::numeric_limits<I>::max();
 1241|  5.15k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 5.15k]
  |  Branch (1241:23): [True: 0, False: 5.15k]
  |  Branch (1241:35): [True: 0, False: 5.15k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  5.15k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  5.15k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.63k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  22.5k|  I rational_to_integer_helper(size_t n) const {
 1224|  22.5k|    auto a = value_.at(n).first;
 1225|  22.5k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  22.5k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 4.41k, False: 18.1k]
  ------------------
 1229|  4.41k|      return 0;
 1230|  4.41k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  18.1k|#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|  18.1k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  18.1k|      const auto imax = std::numeric_limits<I>::max();
 1257|  18.1k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 1.27k, False: 16.8k]
  ------------------
 1258|  1.27k|        return 0;
 1259|  1.27k|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  16.8k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  16.8k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  16.8k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 16.8k]
  |  Branch (1263:25): [True: 0, False: 16.8k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  16.8k|    }
 1267|       |
 1268|  16.8k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  22.5k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  7.33k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.33k|    auto a = value_.at(n).first;
 1225|  7.33k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.33k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 685, False: 6.64k]
  ------------------
 1229|    685|      return 0;
 1230|    685|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.64k|#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|  6.64k|    } 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|  6.64k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  6.64k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 6.64k]
  |  Branch (1251:23): [True: 0, False: 6.64k]
  ------------------
 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|  6.64k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.33k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  41.6k|  I rational_to_integer_helper(size_t n) const {
 1224|  41.6k|    auto a = value_.at(n).first;
 1225|  41.6k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  41.6k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.91k, False: 39.7k]
  ------------------
 1229|  1.91k|      return 0;
 1230|  1.91k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  39.7k|#ifdef __cpp_if_constexpr
 1234|  39.7k|    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|  39.7k|      const auto imin = std::numeric_limits<I>::min();
 1240|  39.7k|      const auto imax = std::numeric_limits<I>::max();
 1241|  39.7k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 39.7k]
  |  Branch (1241:23): [True: 0, False: 39.7k]
  |  Branch (1241:35): [True: 0, False: 39.7k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  39.7k|#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|  39.7k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  41.6k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   267k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   267k|}
_ZN5Exiv25ValueD2Ev:
   43|  15.3M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   265k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   265k|  value_.clear();
 1469|   265k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   265k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 265k, False: 0]
  |  Branch (1470:17): [True: 414, False: 265k]
  ------------------
 1471|    414|    len = (len / ts) * ts;
 1472|  3.00M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 2.73M, False: 265k]
  ------------------
 1473|  2.73M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  2.73M|  }
 1475|   265k|  return 0;
 1476|   265k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.30k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.30k|  std::istringstream is(buf);
 1481|  1.30k|  T tmp;
 1482|  1.30k|  ValueList val;
 1483|  2.16k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 857, False: 1.30k]
  ------------------
 1484|    857|    val.push_back(tmp);
 1485|  1.30k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 10, False: 1.29k]
  ------------------
 1486|     10|    return 1;
 1487|  1.29k|  value_ = std::move(val);
 1488|  1.29k|  return 0;
 1489|  1.30k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.55k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.55k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.26k, False: 292]
  ------------------
 1651|  1.26k|    pDataArea_ = Blob(buf, buf + len);
 1652|    292|  else
 1653|    292|    pDataArea_.clear();
 1654|  1.55k|  return 0;
 1655|  1.55k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|   249k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|   249k|  size_t offset = 0;
 1494|  2.93M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 2.93M, False: 249k]
  ------------------
 1495|  2.93M|    offset += toData(buf + offset, val, byteOrder);
 1496|  2.93M|  }
 1497|   249k|  return offset;
 1498|   249k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   588k|size_t ValueType<T>::count() const {
 1502|   588k|  return value_.size();
 1503|   588k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  1.87M|size_t ValueType<T>::size() const {
 1507|  1.87M|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  1.87M|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    504|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    504|  auto end = value_.end();
 1518|    504|  auto i = value_.begin();
 1519|  60.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 60.2k, False: 504]
  ------------------
 1520|  60.2k|    os << std::setprecision(15) << *i;
 1521|  60.2k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 59.8k, False: 372]
  ------------------
 1522|  59.8k|      os << " ";
 1523|  60.2k|  }
 1524|    504|  return os;
 1525|    504|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  52.4k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  52.4k|  ok_ = true;
 1537|  52.4k|  return static_cast<int64_t>(value_.at(n));
 1538|  52.4k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|  65.3k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  65.3k|  ok_ = true;
 1542|  65.3k|  return static_cast<uint32_t>(value_.at(n));
 1543|  65.3k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  4.39k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.39k|  return pDataArea_.size();
 1641|  4.39k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    972|DataBuf ValueType<T>::dataArea() const {
 1645|    972|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    972|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   671k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   671k|  return new ValueType<T>(*this);
 1513|   671k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   671k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   671k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.03k, False: 668k]
  ------------------
 1449|  3.03k|    pDataArea_ = rhs.pDataArea_;
 1450|   671k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  10.9M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  56.2k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  56.2k|  value_.clear();
 1469|  56.2k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  56.2k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 56.2k, False: 0]
  |  Branch (1470:17): [True: 90, False: 56.2k]
  ------------------
 1471|     90|    len = (len / ts) * ts;
 1472|  1.62M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.57M, False: 56.2k]
  ------------------
 1473|  1.57M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.57M|  }
 1475|  56.2k|  return 0;
 1476|  56.2k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    489|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    489|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 298, False: 191]
  ------------------
 1651|    298|    pDataArea_ = Blob(buf, buf + len);
 1652|    191|  else
 1653|    191|    pDataArea_.clear();
 1654|    489|  return 0;
 1655|    489|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  44.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  44.3k|  size_t offset = 0;
 1494|   470k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 470k, False: 44.3k]
  ------------------
 1495|   470k|    offset += toData(buf + offset, val, byteOrder);
 1496|   470k|  }
 1497|  44.3k|  return offset;
 1498|  44.3k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   199k|size_t ValueType<T>::count() const {
 1502|   199k|  return value_.size();
 1503|   199k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   208k|size_t ValueType<T>::size() const {
 1507|   208k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   208k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  4.34k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  4.34k|  auto end = value_.end();
 1518|  4.34k|  auto i = value_.begin();
 1519|   107k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 103k, False: 4.34k]
  ------------------
 1520|   103k|    os << std::setprecision(15) << *i;
 1521|   103k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 99.3k, False: 3.95k]
  ------------------
 1522|  99.3k|      os << " ";
 1523|   103k|  }
 1524|  4.34k|  return os;
 1525|  4.34k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  8.55k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  8.55k|  ok_ = true;
 1537|  8.55k|  return static_cast<int64_t>(value_.at(n));
 1538|  8.55k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|   101k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   101k|  ok_ = true;
 1542|   101k|  return static_cast<uint32_t>(value_.at(n));
 1543|   101k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  4.02k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.02k|  return pDataArea_.size();
 1641|  4.02k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    470|DataBuf ValueType<T>::dataArea() const {
 1645|    470|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    470|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   196k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   196k|  return new ValueType<T>(*this);
 1513|   196k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   196k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   196k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 368, False: 196k]
  ------------------
 1449|    368|    pDataArea_ = rhs.pDataArea_;
 1450|   196k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  13.0k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  13.0k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_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: 0, False: 12.6k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   674k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 661k, False: 12.6k]
  ------------------
 1473|   661k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   661k|  }
 1475|  12.6k|  return 0;
 1476|  12.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    762|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    762|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 369, False: 393]
  ------------------
 1651|    369|    pDataArea_ = Blob(buf, buf + len);
 1652|    393|  else
 1653|    393|    pDataArea_.clear();
 1654|    762|  return 0;
 1655|    762|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  11.8k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  11.8k|  size_t offset = 0;
 1494|   527k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 527k, False: 11.8k]
  ------------------
 1495|   527k|    offset += toData(buf + offset, val, byteOrder);
 1496|   527k|  }
 1497|  11.8k|  return offset;
 1498|  11.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  64.6k|size_t ValueType<T>::count() const {
 1502|  64.6k|  return value_.size();
 1503|  64.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  29.8k|size_t ValueType<T>::size() const {
 1507|  29.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  29.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    635|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    635|  auto end = value_.end();
 1518|    635|  auto i = value_.begin();
 1519|  3.40k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 2.76k, False: 635]
  ------------------
 1520|  2.76k|    os << std::setprecision(15) << *i;
 1521|  2.76k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 2.38k, False: 380]
  ------------------
 1522|  2.38k|      os << " ";
 1523|  2.76k|  }
 1524|    635|  return os;
 1525|    635|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  2.02k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.02k|  return pDataArea_.size();
 1641|  2.02k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    333|DataBuf ValueType<T>::dataArea() const {
 1645|    333|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    333|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  39.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  39.6k|  return new ValueType<T>(*this);
 1513|  39.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  39.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  39.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 870, False: 38.7k]
  ------------------
 1449|    870|    pDataArea_ = rhs.pDataArea_;
 1450|  39.6k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  22.2k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  22.2k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  17.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  17.1k|  value_.clear();
 1469|  17.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  17.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 17.1k, False: 0]
  |  Branch (1470:17): [True: 19, False: 17.0k]
  ------------------
 1471|     19|    len = (len / ts) * ts;
 1472|   308k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 291k, False: 17.1k]
  ------------------
 1473|   291k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   291k|  }
 1475|  17.1k|  return 0;
 1476|  17.1k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  5.17k|int ValueType<T>::read(const std::string& buf) {
 1480|  5.17k|  std::istringstream is(buf);
 1481|  5.17k|  T tmp;
 1482|  5.17k|  ValueList val;
 1483|  14.2k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 9.03k, False: 5.17k]
  ------------------
 1484|  9.03k|    val.push_back(tmp);
 1485|  5.17k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 5.17k]
  ------------------
 1486|      0|    return 1;
 1487|  5.17k|  value_ = std::move(val);
 1488|  5.17k|  return 0;
 1489|  5.17k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    794|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    794|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 513, False: 281]
  ------------------
 1651|    513|    pDataArea_ = Blob(buf, buf + len);
 1652|    281|  else
 1653|    281|    pDataArea_.clear();
 1654|    794|  return 0;
 1655|    794|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  8.25k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  8.25k|  size_t offset = 0;
 1494|   279k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 279k, False: 8.25k]
  ------------------
 1495|   279k|    offset += toData(buf + offset, val, byteOrder);
 1496|   279k|  }
 1497|  8.25k|  return offset;
 1498|  8.25k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  53.4k|size_t ValueType<T>::count() const {
 1502|  53.4k|  return value_.size();
 1503|  53.4k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  33.4k|size_t ValueType<T>::size() const {
 1507|  33.4k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  33.4k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    906|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    906|  auto end = value_.end();
 1518|    906|  auto i = value_.begin();
 1519|  7.73k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 6.82k, False: 906]
  ------------------
 1520|  6.82k|    os << std::setprecision(15) << *i;
 1521|  6.82k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 6.14k, False: 688]
  ------------------
 1522|  6.14k|      os << " ";
 1523|  6.82k|  }
 1524|    906|  return os;
 1525|    906|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  5.77k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  5.77k|  ok_ = true;
 1537|  5.77k|  return static_cast<int64_t>(value_.at(n));
 1538|  5.77k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   111k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   111k|  ok_ = true;
 1542|   111k|  return static_cast<uint32_t>(value_.at(n));
 1543|   111k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.76k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.76k|  return pDataArea_.size();
 1641|  1.76k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    557|DataBuf ValueType<T>::dataArea() const {
 1645|    557|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    557|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  52.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  52.2k|  return new ValueType<T>(*this);
 1513|  52.2k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  52.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  52.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.10k, False: 51.1k]
  ------------------
 1449|  1.10k|    pDataArea_ = rhs.pDataArea_;
 1450|  52.2k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  30.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  30.9k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  30.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  30.9k|  value_.clear();
 1469|  30.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  30.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 30.9k, False: 0]
  |  Branch (1470:17): [True: 116, False: 30.7k]
  ------------------
 1471|    116|    len = (len / ts) * ts;
 1472|   761k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 730k, False: 30.9k]
  ------------------
 1473|   730k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   730k|  }
 1475|  30.9k|  return 0;
 1476|  30.9k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    805|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    805|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 441, False: 364]
  ------------------
 1651|    441|    pDataArea_ = Blob(buf, buf + len);
 1652|    364|  else
 1653|    364|    pDataArea_.clear();
 1654|    805|  return 0;
 1655|    805|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  28.2k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  28.2k|  size_t offset = 0;
 1494|   565k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 565k, False: 28.2k]
  ------------------
 1495|   565k|    offset += toData(buf + offset, val, byteOrder);
 1496|   565k|  }
 1497|  28.2k|  return offset;
 1498|  28.2k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|  99.2k|size_t ValueType<T>::count() const {
 1502|  99.2k|  return value_.size();
 1503|  99.2k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   211k|size_t ValueType<T>::size() const {
 1507|   211k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   211k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    590|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    590|  auto end = value_.end();
 1518|    590|  auto i = value_.begin();
 1519|   431k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 430k, False: 590]
  ------------------
 1520|   430k|    os << std::setprecision(15) << *i;
 1521|   430k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 430k, False: 322]
  ------------------
 1522|   430k|      os << " ";
 1523|   430k|  }
 1524|    590|  return os;
 1525|    590|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  9.30k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  9.30k|  ok_ = true;
 1537|  9.30k|  return static_cast<int64_t>(value_.at(n));
 1538|  9.30k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  14.1k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  14.1k|  ok_ = true;
 1542|  14.1k|  return static_cast<uint32_t>(value_.at(n));
 1543|  14.1k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  3.95k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.95k|  return pDataArea_.size();
 1641|  3.95k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    428|DataBuf ValueType<T>::dataArea() const {
 1645|    428|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    428|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   106k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   106k|  return new ValueType<T>(*this);
 1513|   106k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   106k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   106k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 933, False: 105k]
  ------------------
 1449|    933|    pDataArea_ = rhs.pDataArea_;
 1450|   106k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  11.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  11.6k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  11.6k|  value_.clear();
 1469|  11.6k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  11.6k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 11.6k, False: 0]
  |  Branch (1470:17): [True: 0, False: 11.6k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   552k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 540k, False: 11.6k]
  ------------------
 1473|   540k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   540k|  }
 1475|  11.6k|  return 0;
 1476|  11.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    844|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    844|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 649, False: 195]
  ------------------
 1651|    649|    pDataArea_ = Blob(buf, buf + len);
 1652|    195|  else
 1653|    195|    pDataArea_.clear();
 1654|    844|  return 0;
 1655|    844|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  7.27k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  7.27k|  size_t offset = 0;
 1494|   309k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 309k, False: 7.27k]
  ------------------
 1495|   309k|    offset += toData(buf + offset, val, byteOrder);
 1496|   309k|  }
 1497|  7.27k|  return offset;
 1498|  7.27k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  28.3k|size_t ValueType<T>::count() const {
 1502|  28.3k|  return value_.size();
 1503|  28.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  19.1k|size_t ValueType<T>::size() const {
 1507|  19.1k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  19.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    777|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    777|  auto end = value_.end();
 1518|    777|  auto i = value_.begin();
 1519|  5.02k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.24k, False: 777]
  ------------------
 1520|  4.24k|    os << std::setprecision(15) << *i;
 1521|  4.24k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.67k, False: 568]
  ------------------
 1522|  3.67k|      os << " ";
 1523|  4.24k|  }
 1524|    777|  return os;
 1525|    777|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  1.38k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.38k|  return pDataArea_.size();
 1641|  1.38k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     71|DataBuf ValueType<T>::dataArea() const {
 1645|     71|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     71|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  33.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  33.1k|  return new ValueType<T>(*this);
 1513|  33.1k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  33.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  33.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 941, False: 32.1k]
  ------------------
 1449|    941|    pDataArea_ = rhs.pDataArea_;
 1450|  33.1k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  8.42k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  8.42k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  8.42k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.42k|  value_.clear();
 1469|  8.42k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.42k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.42k, False: 0]
  |  Branch (1470:17): [True: 0, False: 8.42k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  59.2k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 50.8k, False: 8.42k]
  ------------------
 1473|  50.8k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  50.8k|  }
 1475|  8.42k|  return 0;
 1476|  8.42k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.37k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.37k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.16k, False: 208]
  ------------------
 1651|  1.16k|    pDataArea_ = Blob(buf, buf + len);
 1652|    208|  else
 1653|    208|    pDataArea_.clear();
 1654|  1.37k|  return 0;
 1655|  1.37k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  5.65k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.65k|  size_t offset = 0;
 1494|  33.3k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 33.3k, False: 5.65k]
  ------------------
 1495|  33.3k|    offset += toData(buf + offset, val, byteOrder);
 1496|  33.3k|  }
 1497|  5.65k|  return offset;
 1498|  5.65k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  37.7k|size_t ValueType<T>::count() const {
 1502|  37.7k|  return value_.size();
 1503|  37.7k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  13.9k|size_t ValueType<T>::size() const {
 1507|  13.9k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  13.9k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    604|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    604|  auto end = value_.end();
 1518|    604|  auto i = value_.begin();
 1519|  67.3k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 66.7k, False: 604]
  ------------------
 1520|  66.7k|    os << std::setprecision(15) << *i;
 1521|  66.7k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 66.3k, False: 396]
  ------------------
 1522|  66.3k|      os << " ";
 1523|  66.7k|  }
 1524|    604|  return os;
 1525|    604|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  6.69k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.69k|  return pDataArea_.size();
 1641|  6.69k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    294|DataBuf ValueType<T>::dataArea() const {
 1645|    294|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    294|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  28.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  28.4k|  return new ValueType<T>(*this);
 1513|  28.4k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  28.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  28.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.18k, False: 26.2k]
  ------------------
 1449|  2.18k|    pDataArea_ = rhs.pDataArea_;
 1450|  28.4k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  11.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.5k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_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|   475k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 464k, False: 11.5k]
  ------------------
 1473|   464k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   464k|  }
 1475|  11.5k|  return 0;
 1476|  11.5k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    826|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    826|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 408, False: 418]
  ------------------
 1651|    408|    pDataArea_ = Blob(buf, buf + len);
 1652|    418|  else
 1653|    418|    pDataArea_.clear();
 1654|    826|  return 0;
 1655|    826|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  4.34k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  4.34k|  size_t offset = 0;
 1494|   237k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 237k, False: 4.34k]
  ------------------
 1495|   237k|    offset += toData(buf + offset, val, byteOrder);
 1496|   237k|  }
 1497|  4.34k|  return offset;
 1498|  4.34k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  31.6k|size_t ValueType<T>::count() const {
 1502|  31.6k|  return value_.size();
 1503|  31.6k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  14.6k|size_t ValueType<T>::size() const {
 1507|  14.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  14.6k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    368|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    368|  auto end = value_.end();
 1518|    368|  auto i = value_.begin();
 1519|    988|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 620, False: 368]
  ------------------
 1520|    620|    os << std::setprecision(15) << *i;
 1521|    620|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 452, False: 168]
  ------------------
 1522|    452|      os << " ";
 1523|    620|  }
 1524|    368|  return os;
 1525|    368|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  4.57k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.57k|  return pDataArea_.size();
 1641|  4.57k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    678|DataBuf ValueType<T>::dataArea() const {
 1645|    678|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    678|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  32.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  32.8k|  return new ValueType<T>(*this);
 1513|  32.8k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  32.8k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  32.8k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 932, False: 31.9k]
  ------------------
 1449|    932|    pDataArea_ = rhs.pDataArea_;
 1450|  32.8k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   574k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  4.73k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.73k|}

_ZNK5Exiv27XmpData9usePacketEv:
  215|  21.4k|  [[nodiscard]] bool usePacket() const {
  216|  21.4k|    return usePacket_;
  217|  21.4k|  }
_ZN5Exiv27XmpData9usePacketEb:
  220|  17.5k|  bool usePacket(bool b) {
  221|  17.5k|    bool r = usePacket_;
  222|  17.5k|    usePacket_ = b;
  223|  17.5k|    return r;
  224|  17.5k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  226|  10.9k|  void setPacket(std::string xmpPacket) {
  227|  10.9k|    xmpPacket_ = std::move(xmpPacket);
  228|  10.9k|    usePacket(false);
  229|  10.9k|  }
_ZN5Exiv27XmpDataC2Ev:
  139|  49.8k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  366|  29.0k|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|  29.0k|    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  29.0k|  return *this;
  376|  29.0k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  366|  95.2k|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|  95.2k|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  95.2k|  return *this;
  376|  95.2k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  366|   187k|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|   187k|    setValue(Exiv2::toString(value));
  375|   187k|  return *this;
  376|   187k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  366|  19.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|       |    setValue(&value);
  373|       |  else
  374|  19.1k|    setValue(Exiv2::toString(value));
  375|  19.1k|  return *this;
  376|  19.1k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  366|  34.8k|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|  34.8k|    setValue(Exiv2::toString(value));
  375|  34.8k|  return *this;
  376|  34.8k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  366|  4.46k|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.46k|    setValue(Exiv2::toString(value));
  375|  4.46k|  return *this;
  376|  4.46k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  366|  1.91k|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.91k|    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.91k|  return *this;
  376|  1.91k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  366|  2.79k|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.79k|    setValue(Exiv2::toString(value));
  375|  2.79k|  return *this;
  376|  2.79k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  366|  4.43k|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.43k|    setValue(Exiv2::toString(value));
  375|  4.43k|  return *this;
  376|  4.43k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  366|    632|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|    632|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|    632|  return *this;
  376|    632|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  366|   112k|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|   112k|    setValue(Exiv2::toString(value));
  375|   112k|  return *this;
  376|   112k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  366|  2.13k|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.13k|    setValue(Exiv2::toString(value));
  375|  2.13k|  return *this;
  376|  2.13k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  366|   187k|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|   187k|    setValue(Exiv2::toString(value));
  375|   187k|  return *this;
  376|   187k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  366|  30.7k|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|  30.7k|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|  30.7k|  return *this;
  376|  30.7k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  366|   199k|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|   199k|    setValue(Exiv2::toString(value));
  375|   199k|  return *this;
  376|   199k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  366|     18|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|     18|    setValue(value);
  371|       |  else if constexpr (std::is_base_of_v<Value, T>)
  372|       |    setValue(&value);
  373|       |  else
  374|       |    setValue(Exiv2::toString(value));
  375|     18|  return *this;
  376|     18|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  10.9k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  10.9k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 3.71k, False: 7.21k]
  |  Branch (43:36): [True: 3.68k, False: 25]
  |  Branch (43:62): [True: 3.66k, False: 24]
  |  Branch (43:88): [True: 3.65k, False: 12]
  ------------------
   44|  10.9k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  18.0k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  18.0k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  18.0k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  18.0k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  18.0k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  18.0k|}
_ZNK5Exiv28AsfVideo7GUIDTag9to_stringEv:
   53|    601|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|    601|  return stringFormat("{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}", data1_, data2_, data3_,
  ------------------
  |  |   18|    601|#define stringFormat std::format
  ------------------
   58|    601|                      data4_[0], data4_[1], data4_[2], data4_[3], data4_[4], data4_[5], data4_[6], data4_[7]);
   59|    601|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  46.2k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  46.2k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 34.5k, False: 11.7k]
  ------------------
   63|  34.5k|    return data1_ < other.data1_;
   64|  11.7k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 263, False: 11.4k]
  ------------------
   65|    263|    return data2_ < other.data2_;
   66|  11.4k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 390, False: 11.0k]
  ------------------
   67|    390|    return data3_ < other.data3_;
   68|  11.0k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  11.4k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  182|  1.21k|AsfVideo::AsfVideo(BasicIo::UniquePtr io) : Image(ImageType::asf, mdNone, std::move(io)) {
  183|  1.21k|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  185|  1.21k|std::string AsfVideo::mimeType() const {
  186|  1.21k|  return "video/asf";
  187|  1.21k|}
_ZN5Exiv28AsfVideo13writeMetadataEv:
  189|      8|void AsfVideo::writeMetadata() {
  190|      8|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  192|  1.21k|void AsfVideo::readMetadata() {
  193|  1.21k|  if (io_->open() != 0)
  ------------------
  |  Branch (193:7): [True: 0, False: 1.21k]
  ------------------
  194|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  195|       |
  196|       |  // Ensure that this is the correct image type
  197|  1.21k|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (197:7): [True: 0, False: 1.21k]
  ------------------
  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.21k|  IoCloser closer(*io_);
  204|  1.21k|  clearMetadata();
  205|  1.21k|  io_->seek(0, BasicIo::beg);
  206|  1.21k|  height_ = width_ = 1;
  207|       |
  208|  1.21k|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  209|  1.21k|  xmpData()["Xmp.video.MimeType"] = mimeType();
  210|       |
  211|  1.21k|  decodeBlock();
  212|       |
  213|  1.21k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  214|  1.21k|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  216|  6.19k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  217|  6.19k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (217:7): [True: 6.19k, False: 0]
  ------------------
  218|  6.19k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  219|       |
  220|  6.19k|    size_ = readQWORDTag(io);
  221|  6.19k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (221:9): [True: 4.30k, False: 1.89k]
  ------------------
  222|  4.30k|      remaining_size_ = size_ - GUID - QWORD;
  223|  6.19k|  }
  224|  6.19k|}
_ZN5Exiv28AsfVideo11decodeBlockEv:
  226|  6.24k|void AsfVideo::decodeBlock() {
  227|  6.24k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  228|  6.24k|  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|  6.24k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  234|  6.24k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  235|       |
  236|  6.24k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (236:7): [True: 4.48k, False: 1.75k]
  ------------------
  237|  4.48k|    if (tag->second == "Header")
  ------------------
  |  Branch (237:9): [True: 1.42k, False: 3.06k]
  ------------------
  238|  1.42k|      decodeHeader();
  239|  3.06k|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (239:14): [True: 607, False: 2.45k]
  ------------------
  240|    607|      fileProperties();
  241|  2.45k|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (241:14): [True: 605, False: 1.85k]
  ------------------
  242|    605|      streamProperties();
  243|  1.85k|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (243:14): [True: 297, False: 1.55k]
  ------------------
  244|    297|      headerExtension();
  245|  1.55k|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (245:14): [True: 270, False: 1.28k]
  ------------------
  246|    270|      codecList();
  247|  1.28k|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (247:14): [True: 629, False: 658]
  ------------------
  248|    629|      extendedContentDescription();
  249|    658|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (249:14): [True: 388, False: 270]
  ------------------
  250|    388|      contentDescription();
  251|    270|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (251:14): [True: 78, False: 192]
  ------------------
  252|     78|      extendedStreamProperties();
  253|    192|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (253:14): [True: 0, False: 192]
  ------------------
  254|      0|      DegradableJPEGMedia();
  255|    192|    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|    192|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  259|    192|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  260|    192|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  261|    192|    }
  262|  4.48k|  } 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.75k|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  266|  1.75k|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  267|  1.75k|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  268|  1.75k|  }
  269|       |
  270|  6.24k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEv:
  272|  1.42k|void AsfVideo::decodeHeader() {
  273|  1.42k|  DataBuf nbHeadersBuf(DWORD + 1);
  274|  1.42k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|       |
  276|  1.42k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  277|  1.42k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  278|  1.42k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  279|  1.42k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  280|  6.45k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (280:24): [True: 5.03k, False: 1.42k]
  ------------------
  281|  5.03k|    decodeBlock();
  282|  5.03k|  }
  283|  1.42k|}
_ZN5Exiv28AsfVideo24extendedStreamPropertiesEv:
  285|     78|void AsfVideo::extendedStreamProperties() {
  286|     78|  xmpData()["Xmp.video.StartTimecode"] = readQWORDTag(io_);  // Start Time
  287|     78|  xmpData()["Xmp.video.EndTimecode"] = readWORDTag(io_);     // End Time
  288|       |
  289|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Data Bitrate
  290|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Buffer Size
  291|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Initial Buffer Fullness
  292|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Data Bitrate
  293|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Buffer Size
  294|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Initial Buffer Fullness
  295|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Maximum Object Size
  296|     78|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Flags Buffer Size
  297|     78|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Flags Stream Number
  298|     78|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Stream Language ID Index
  299|       |
  300|     78|  xmpData()["Xmp.video.FrameRate"] = readWORDTag(io_);  // Average Time Per Frame
  301|     78|  uint16_t stream_name_count = readWORDTag(io_);
  302|     78|  uint16_t payload_ext_sys_count = readWORDTag(io_);
  303|       |
  304|    903|  for (uint16_t i = 0; i < stream_name_count; i++) {
  ------------------
  |  Branch (304:24): [True: 825, False: 78]
  ------------------
  305|    825|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Language ID Index
  306|    825|    uint16_t stream_length = readWORDTag(io_);
  307|    825|    if (stream_length)
  ------------------
  |  Branch (307:9): [True: 512, False: 313]
  ------------------
  308|    512|      io_->seek(io_->tell() + stream_length, BasicIo::beg);  // ignore Stream name
  309|    825|  }
  310|       |
  311|    761|  for (uint16_t i = 0; i < payload_ext_sys_count; i++) {
  ------------------
  |  Branch (311:24): [True: 683, False: 78]
  ------------------
  312|    683|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Extension System ID
  313|    683|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Extension Data Size
  314|    683|    uint16_t ext_sys_info_length = readWORDTag(io_);
  315|    683|    if (ext_sys_info_length)
  ------------------
  |  Branch (315:9): [True: 391, False: 292]
  ------------------
  316|    391|      io_->seek(io_->tell() + ext_sys_info_length, BasicIo::beg);  // ignore Extension System Info
  317|    683|  }
  318|     78|}  // AsfVideo::extendedStreamProperties
_ZN5Exiv28AsfVideo16streamPropertiesEv:
  335|    605|void AsfVideo::streamProperties() {
  336|    605|  DataBuf streamTypedBuf(GUID);
  337|    605|  io_->readOrThrow(streamTypedBuf.data(), streamTypedBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  338|       |
  339|    605|  enum class streamTypeInfo { Audio = 1, Video = 2 };
  340|    605|  auto stream = streamTypeInfo{0};
  341|       |
  342|    605|  auto tag_stream_type = GUIDReferenceTags.find(GUIDTag(streamTypedBuf.data()));
  343|    605|  if (tag_stream_type != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (343:7): [True: 210, False: 395]
  ------------------
  344|    210|    if (tag_stream_type->second == "Audio_Media")
  ------------------
  |  Branch (344:9): [True: 3, False: 207]
  ------------------
  345|      3|      stream = streamTypeInfo::Audio;
  346|    207|    else if (tag_stream_type->second == "Video_Media")
  ------------------
  |  Branch (346:14): [True: 20, False: 187]
  ------------------
  347|     20|      stream = streamTypeInfo::Video;
  348|       |
  349|    210|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Error Correction Type
  350|       |
  351|    210|    uint64_t time_offset = readQWORDTag(io_);
  352|    210|    if (stream == streamTypeInfo::Video)
  ------------------
  |  Branch (352:9): [True: 20, False: 190]
  ------------------
  353|     20|      xmpData()["Xmp.video.TimeOffset"] = time_offset;
  354|    190|    else if (stream == streamTypeInfo::Audio)
  ------------------
  |  Branch (354:14): [True: 3, False: 187]
  ------------------
  355|      3|      xmpData()["Xmp.audio.TimeOffset"] = time_offset;
  356|       |
  357|    210|    auto specific_data_length = readDWORDTag(io_);
  358|    210|    auto correction_data_length = readDWORDTag(io_);
  359|       |
  360|    210|    io_->seek(io_->tell() + WORD /*Flags*/ + DWORD /*Reserved*/ + specific_data_length + correction_data_length,
  361|    210|              BasicIo::beg);
  362|    210|  }
  363|       |
  364|    605|}  // AsfVideo::streamProperties
_ZN5Exiv28AsfVideo9codecListEv:
  366|    270|void AsfVideo::codecList() {
  367|    270|  io_->seek(io_->tell() + GUID /*reserved*/, BasicIo::beg);
  368|    270|  auto entries_count = readDWORDTag(io_);
  369|  1.74k|  for (uint32_t i = 0; i < entries_count; i++) {
  ------------------
  |  Branch (369:24): [True: 1.47k, False: 270]
  ------------------
  370|  1.47k|    uint16_t codec_type = readWORDTag(io_) * 2;
  371|  1.47k|    std::string codec = (codec_type == 1) ? "Xmp.video" : "Xmp.audio";
  ------------------
  |  Branch (371:25): [True: 0, False: 1.47k]
  ------------------
  372|       |
  373|  1.47k|    if (uint16_t codec_name_length = readWORDTag(io_) * 2)
  ------------------
  |  Branch (373:18): [True: 1.03k, False: 440]
  ------------------
  374|  1.03k|      xmpData()[codec + std::string(".CodecName")] = readStringWcharTag(io_, codec_name_length);
  375|       |
  376|  1.47k|    if (uint16_t codec_desc_length = readWORDTag(io_))
  ------------------
  |  Branch (376:18): [True: 1.10k, False: 367]
  ------------------
  377|  1.10k|      xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
  378|       |
  379|  1.47k|    uint16_t codec_info_length = readWORDTag(io_);
  380|  1.47k|    Internal::enforce(codec_info_length && codec_info_length < io_->size() - io_->tell(),
  ------------------
  |  Branch (380:23): [True: 1.28k, False: 191]
  |  Branch (380:44): [True: 1.23k, False: 43]
  ------------------
  381|  1.47k|                      Exiv2::ErrorCode::kerCorruptedMetadata);
  382|  1.47k|    xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
  383|  1.47k|  }
  384|    270|}  // AsfVideo::codecList
_ZNK5Exiv28AsfVideo15headerExtensionEv:
  386|    297|void AsfVideo::headerExtension() const {
  387|    297|  io_->seek(io_->tell() + GUID /*reserved1*/ + WORD /*Reserved2*/, BasicIo::beg);
  388|    297|  auto header_ext_data_length = readDWORDTag(io_);
  389|    297|  io_->seek(io_->tell() + header_ext_data_length, BasicIo::beg);
  390|    297|}  // AsfVideo::headerExtension
_ZN5Exiv28AsfVideo26extendedContentDescriptionEv:
  392|    629|void AsfVideo::extendedContentDescription() {
  393|    629|  uint16_t content_descriptor_count = readWORDTag(io_);
  394|    629|  std::string value;
  395|       |
  396|  40.3k|  for (uint16_t i = 0; i < content_descriptor_count; i++) {
  ------------------
  |  Branch (396:24): [True: 39.8k, False: 572]
  ------------------
  397|  39.8k|    if (uint16_t descriptor_name_length = readWORDTag(io_))
  ------------------
  |  Branch (397:18): [True: 16.8k, False: 23.0k]
  ------------------
  398|  16.8k|      value += readStringWcharTag(io_, descriptor_name_length);  // Descriptor Name
  399|       |
  400|  39.8k|    uint16_t descriptor_value_data_type = readWORDTag(io_);
  401|  39.8k|    if (uint16_t descriptor_value_length = readWORDTag(io_)) {
  ------------------
  |  Branch (401:18): [True: 18.7k, False: 21.1k]
  ------------------
  402|       |      // Descriptor Value
  403|  18.7k|      switch (descriptor_value_data_type) {
  ------------------
  |  Branch (403:15): [True: 4.16k, False: 14.5k]
  ------------------
  404|  2.33k|        case 0 /*Unicode string */:
  ------------------
  |  Branch (404:9): [True: 2.33k, False: 16.3k]
  ------------------
  405|  2.33k|          value += std::string(": ") + readStringWcharTag(io_, descriptor_value_length);
  406|  2.33k|          break;
  407|    102|        case 1 /*BYTE array  */:
  ------------------
  |  Branch (407:9): [True: 102, False: 18.6k]
  ------------------
  408|    102|          value += std::string(": ") + readStringTag(io_, descriptor_value_length);
  409|    102|          break;
  410|    423|        case 2 /*BOOL*/:
  ------------------
  |  Branch (410:9): [True: 423, False: 18.2k]
  ------------------
  411|    423|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  412|    423|          break;
  413|    128|        case 3 /*DWORD */:
  ------------------
  |  Branch (413:9): [True: 128, False: 18.5k]
  ------------------
  414|    128|          value += std::string(": ") + std::to_string(readDWORDTag(io_));
  415|    128|          break;
  416|     96|        case 4 /*QWORD */:
  ------------------
  |  Branch (416:9): [True: 96, False: 18.6k]
  ------------------
  417|     96|          value += std::string(": ") + std::to_string(readQWORDTag(io_));
  418|     96|          break;
  419|  1.08k|        case 5 /*WORD*/:
  ------------------
  |  Branch (419:9): [True: 1.08k, False: 17.6k]
  ------------------
  420|  1.08k|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  421|  1.08k|          break;
  422|  18.7k|      }
  423|  18.7k|    }
  424|  39.7k|    value += std::string(", ");
  425|  39.7k|  }
  426|       |
  427|    572|  xmpData()["Xmp.video.ExtendedContentDescription"] = value;
  428|    572|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  430|    388|void AsfVideo::contentDescription() {
  431|    388|  uint16_t title_length = readWORDTag(io_);
  432|    388|  uint16_t author_length = readWORDTag(io_);
  433|    388|  uint16_t copyright_length = readWORDTag(io_);
  434|    388|  uint16_t desc_length = readWORDTag(io_);
  435|    388|  uint16_t rating_length = readWORDTag(io_);
  436|       |
  437|    388|  if (title_length)
  ------------------
  |  Branch (437:7): [True: 290, False: 98]
  ------------------
  438|    290|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  439|       |
  440|    388|  if (author_length)
  ------------------
  |  Branch (440:7): [True: 91, False: 297]
  ------------------
  441|     91|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  442|       |
  443|    388|  if (copyright_length)
  ------------------
  |  Branch (443:7): [True: 102, False: 286]
  ------------------
  444|    102|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  445|       |
  446|    388|  if (desc_length)
  ------------------
  |  Branch (446:7): [True: 78, False: 310]
  ------------------
  447|     78|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  448|       |
  449|    388|  if (rating_length)
  ------------------
  |  Branch (449:7): [True: 95, False: 293]
  ------------------
  450|     95|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  451|       |
  452|    388|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo14filePropertiesEv:
  454|    607|void AsfVideo::fileProperties() {
  455|    607|  DataBuf FileIddBuf(GUID);
  456|    607|  io_->readOrThrow(FileIddBuf.data(), FileIddBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  457|    607|  xmpData()["Xmp.video.FileID"] = GUIDTag(FileIddBuf.data()).to_string();
  458|    607|  xmpData()["Xmp.video.FileLength"] = readQWORDTag(io_);
  459|    607|  xmpData()["Xmp.video.CreationDate"] = readQWORDTag(io_);
  460|    607|  xmpData()["Xmp.video.DataPackets"] = readQWORDTag(io_);
  461|    607|  xmpData()["Xmp.video.duration"] = readQWORDTag(io_);
  462|    607|  xmpData()["Xmp.video.SendDuration"] = readQWORDTag(io_);
  463|    607|  xmpData()["Xmp.video.Preroll"] = readQWORDTag(io_);
  464|       |
  465|    607|  io_->seek(io_->tell() + DWORD + DWORD + DWORD,
  466|    607|            BasicIo::beg);  // ignore Flags, Minimum Data Packet Size and Maximum Data Packet Size
  467|    607|  xmpData()["Xmp.video.MaxBitRate"] = readDWORDTag(io_);
  468|    607|}  // AsfVideo::fileProperties
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  470|  1.21k|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, bool /*create*/) {
  471|  1.21k|  auto image = std::make_unique<AsfVideo>(std::move(io));
  472|  1.21k|  if (!image->good()) {
  ------------------
  |  Branch (472:7): [True: 0, False: 1.21k]
  ------------------
  473|      0|    return nullptr;
  474|      0|  }
  475|  1.21k|  return image;
  476|  1.21k|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  478|  11.2k|bool isAsfType(BasicIo& iIo, bool advance) {
  479|  11.2k|  byte buf[GUID];
  480|  11.2k|  iIo.read(buf, GUID);
  481|       |
  482|  11.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (482:7): [True: 0, False: 11.2k]
  |  Branch (482:22): [True: 357, False: 10.9k]
  ------------------
  483|    357|    return false;
  484|    357|  }
  485|       |
  486|  10.9k|  bool matched = isASFType(buf);
  487|  10.9k|  if (!advance || !matched) {
  ------------------
  |  Branch (487:7): [True: 10.9k, False: 0]
  |  Branch (487:19): [True: 0, False: 0]
  ------------------
  488|  10.9k|    iIo.seek(0, BasicIo::beg);
  489|  10.9k|  }
  490|       |
  491|  10.9k|  return matched;
  492|  11.2k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  10.9k|static bool isASFType(const byte buf[]) {
  179|  10.9k|  return Header == AsfVideo::GUIDTag(buf);
  180|  10.9k|}

_ZN5Exiv27BasicIoD2Ev:
   53|  78.3k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   55|  3.90M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   56|  3.90M|  const size_t nread = read(buf, rcount);
   57|  3.90M|  Internal::enforce(nread == rcount, err);
   58|  3.90M|  Internal::enforce(!error(), err);
   59|  3.90M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   61|  21.2k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   62|  21.2k|  const int r = seek(offset, pos);
   63|  21.2k|  Internal::enforce(r == 0, err);
   64|  21.2k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  617|  40.1k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  618|  40.1k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  671|  6.43M|void MemIo::Impl::reserve(size_t wcount) {
  672|  6.43M|  const size_t need = wcount + idx_;
  673|  6.43M|  size_t blockSize = 32 * 1024;  // 32768
  674|  6.43M|  const size_t maxBlockSize = 4 * 1024 * 1024;
  675|       |
  676|  6.43M|  if (!isMalloced_) {
  ------------------
  |  Branch (676:7): [True: 27.6k, False: 6.40M]
  ------------------
  677|       |    // Minimum size for 1st block
  678|  27.6k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  679|  27.6k|    auto data = static_cast<byte*>(std::malloc(size));
  680|  27.6k|    if (!data) {
  ------------------
  |  Branch (680:9): [True: 0, False: 27.6k]
  ------------------
  681|      0|      throw Error(ErrorCode::kerMallocFailed);
  682|      0|    }
  683|  27.6k|    if (data_) {
  ------------------
  |  Branch (683:9): [True: 0, False: 27.6k]
  ------------------
  684|      0|      std::memcpy(data, data_, size_);
  685|      0|    }
  686|  27.6k|    data_ = data;
  687|  27.6k|    sizeAlloced_ = size;
  688|  27.6k|    isMalloced_ = true;
  689|  27.6k|  }
  690|       |
  691|  6.43M|  if (need > size_) {
  ------------------
  |  Branch (691:7): [True: 5.40M, False: 1.03M]
  ------------------
  692|  5.40M|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (692:9): [True: 16.7k, False: 5.38M]
  ------------------
  693|  16.7k|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  694|       |      // Allocate in blocks
  695|  16.7k|      size_t want = blockSize * (1 + need / blockSize);
  696|  16.7k|      data_ = static_cast<byte*>(std::realloc(data_, want));
  697|  16.7k|      if (!data_) {
  ------------------
  |  Branch (697:11): [True: 0, False: 16.7k]
  ------------------
  698|      0|        throw Error(ErrorCode::kerMallocFailed);
  699|      0|      }
  700|  16.7k|      sizeAlloced_ = want;
  701|  16.7k|    }
  702|  5.40M|    size_ = need;
  703|  5.40M|  }
  704|  6.43M|}
_ZN5Exiv25MemIoC2Ev:
  706|  38.1k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  707|  38.1k|}
_ZN5Exiv25MemIoC2EPKhm:
  709|  40.1k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  710|  40.1k|}
_ZN5Exiv25MemIoD2Ev:
  712|  78.3k|MemIo::~MemIo() {
  713|  78.3k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (713:7): [True: 27.2k, False: 51.0k]
  ------------------
  714|  27.2k|    std::free(p_->data_);
  715|  27.2k|  }
  716|  78.3k|}
_ZN5Exiv25MemIo5writeEPKhm:
  718|  6.38M|size_t MemIo::write(const byte* data, size_t wcount) {
  719|  6.38M|  p_->reserve(wcount);
  720|  6.38M|  if (data) {
  ------------------
  |  Branch (720:7): [True: 5.35M, False: 1.03M]
  ------------------
  721|  5.35M|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  722|  5.35M|  }
  723|  6.38M|  p_->idx_ += wcount;
  724|  6.38M|  return wcount;
  725|  6.38M|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  727|  19.3k|void MemIo::transfer(BasicIo& src) {
  728|  19.3k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (728:12): [True: 19.3k, False: 0]
  ------------------
  729|       |    // Optimization if src is another instance of MemIo
  730|  19.3k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (730:9): [True: 360, False: 18.9k]
  ------------------
  731|    360|      std::free(p_->data_);
  732|    360|    }
  733|  19.3k|    p_->idx_ = 0;
  734|  19.3k|    p_->data_ = memIo->p_->data_;
  735|  19.3k|    p_->size_ = memIo->p_->size_;
  736|  19.3k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  737|  19.3k|    memIo->p_->idx_ = 0;
  738|  19.3k|    memIo->p_->data_ = nullptr;
  739|  19.3k|    memIo->p_->size_ = 0;
  740|  19.3k|    memIo->p_->isMalloced_ = false;
  741|  19.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|  19.3k|  if (error() || src.error())
  ------------------
  |  Branch (750:7): [True: 0, False: 19.3k]
  |  Branch (750:18): [True: 0, False: 19.3k]
  ------------------
  751|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  752|  19.3k|}
_ZN5Exiv25MemIo4putbEh:
  772|  49.5k|int MemIo::putb(byte data) {
  773|  49.5k|  p_->reserve(1);
  774|  49.5k|  p_->data_[p_->idx_++] = data;
  775|  49.5k|  return data;
  776|  49.5k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  778|  1.21M|int MemIo::seek(int64_t offset, Position pos) {
  779|  1.21M|  int64_t newIdx = 0;
  780|       |
  781|  1.21M|  switch (pos) {
  ------------------
  |  Branch (781:11): [True: 1.21M, False: 0]
  ------------------
  782|   846k|    case BasicIo::cur:
  ------------------
  |  Branch (782:5): [True: 846k, False: 371k]
  ------------------
  783|   846k|      newIdx = p_->idx_ + offset;
  784|   846k|      break;
  785|   371k|    case BasicIo::beg:
  ------------------
  |  Branch (785:5): [True: 371k, False: 846k]
  ------------------
  786|   371k|      newIdx = offset;
  787|   371k|      break;
  788|    193|    case BasicIo::end:
  ------------------
  |  Branch (788:5): [True: 193, False: 1.21M]
  ------------------
  789|    193|      newIdx = p_->size_ + offset;
  790|    193|      break;
  791|  1.21M|  }
  792|       |
  793|  1.21M|  if (newIdx < 0)
  ------------------
  |  Branch (793:7): [True: 0, False: 1.21M]
  ------------------
  794|      0|    return 1;
  795|       |
  796|  1.21M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (796:7): [True: 7.63k, False: 1.21M]
  ------------------
  797|  7.63k|    p_->eof_ = true;
  798|  7.63k|    return 1;
  799|  7.63k|  }
  800|       |
  801|  1.21M|  p_->idx_ = static_cast<size_t>(newIdx);
  802|  1.21M|  p_->eof_ = false;
  803|  1.21M|  return 0;
  804|  1.21M|}
_ZN5Exiv25MemIo4mmapEb:
  806|  59.1k|byte* MemIo::mmap(bool /*isWriteable*/) {
  807|  59.1k|  return p_->data_;
  808|  59.1k|}
_ZNK5Exiv25MemIo4tellEv:
  814|   954k|size_t MemIo::tell() const {
  815|   954k|  return p_->idx_;
  816|   954k|}
_ZNK5Exiv25MemIo4sizeEv:
  818|   648k|size_t MemIo::size() const {
  819|   648k|  return p_->size_;
  820|   648k|}
_ZN5Exiv25MemIo4openEv:
  822|   150k|int MemIo::open() {
  823|   150k|  p_->idx_ = 0;
  824|   150k|  p_->eof_ = false;
  825|   150k|  return 0;
  826|   150k|}
_ZNK5Exiv25MemIo6isopenEv:
  828|   116k|bool MemIo::isopen() const {
  829|   116k|  return true;
  830|   116k|}
_ZN5Exiv25MemIo5closeEv:
  832|   114k|int MemIo::close() {
  833|   114k|  return 0;
  834|   114k|}
_ZN5Exiv25MemIo4readEm:
  836|   212k|DataBuf MemIo::read(size_t rcount) {
  837|   212k|  DataBuf buf(rcount);
  838|   212k|  size_t readCount = read(buf.data(), buf.size());
  839|   212k|  buf.resize(readCount);
  840|   212k|  return buf;
  841|   212k|}
_ZN5Exiv25MemIo4readEPhm:
  843|  5.38M|size_t MemIo::read(byte* buf, size_t rcount) {
  844|  5.38M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  845|  5.38M|  const auto allow = std::min<size_t>(rcount, avail);
  846|  5.38M|  if (allow > 0) {
  ------------------
  |  Branch (846:7): [True: 5.04M, False: 341k]
  ------------------
  847|  5.04M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  848|  5.04M|  }
  849|  5.38M|  p_->idx_ += allow;
  850|  5.38M|  if (rcount > avail) {
  ------------------
  |  Branch (850:7): [True: 18.5k, False: 5.36M]
  ------------------
  851|  18.5k|    p_->eof_ = true;
  852|  18.5k|  }
  853|  5.38M|  return allow;
  854|  5.38M|}
_ZN5Exiv25MemIo4getbEv:
  856|  8.09M|int MemIo::getb() {
  857|  8.09M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (857:7): [True: 1.07k, False: 8.09M]
  ------------------
  858|  1.07k|    p_->eof_ = true;
  859|  1.07k|    return EOF;
  860|  1.07k|  }
  861|  8.09M|  return p_->data_[p_->idx_++];
  862|  8.09M|}
_ZNK5Exiv25MemIo5errorEv:
  864|  5.87M|int MemIo::error() const {
  865|  5.87M|  return 0;
  866|  5.87M|}
_ZNK5Exiv25MemIo3eofEv:
  868|  1.17M|bool MemIo::eof() const {
  869|  1.17M|  return p_->eof_;
  870|  1.17M|}
_ZNK5Exiv25MemIo4pathEv:
  872|  13.9k|const std::string& MemIo::path() const noexcept {
  873|  13.9k|  static std::string _path{"MemIo"};
  874|  13.9k|  return _path;
  875|  13.9k|}
_ZN5Exiv25MemIo16populateFakeDataEv:
  877|    271|void MemIo::populateFakeData() {
  878|    271|}
_ZN5Exiv25MemIo4ImplC2Ev:
  597|  38.1k|  Impl() = default;                     //!< Default constructor

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

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

_ZN5Exiv28Internal7canonEvEl:
 3052|    442|float canonEv(int64_t val) {
 3053|       |  // temporarily remove sign
 3054|    442|  int sign = 1;
 3055|    442|  if (val < 0) {
  ------------------
  |  Branch (3055:7): [True: 0, False: 442]
  ------------------
 3056|      0|    sign = -1;
 3057|      0|    val = -val;
 3058|      0|  }
 3059|       |  // remove fraction
 3060|    442|  const auto remainder = val & 0x1f;
 3061|    442|  val -= remainder;
 3062|    442|  auto frac = static_cast<float>(remainder);
 3063|       |  // convert 1/3 (0x0c) and 2/3 (0x14) codes
 3064|    442|  if (frac == 0x0c) {
  ------------------
  |  Branch (3064:7): [True: 40, False: 402]
  ------------------
 3065|     40|    frac = 32.0F / 3;
 3066|    402|  } else if (frac == 0x14) {
  ------------------
  |  Branch (3066:14): [True: 32, False: 370]
  ------------------
 3067|     32|    frac = 64.0F / 3;
 3068|    370|  } else if ((val == 160) && (frac == 0x08)) {  // for Sigma f/6.3 lenses that report f/6.2 to camera
  ------------------
  |  Branch (3068:14): [True: 23, False: 347]
  |  Branch (3068:30): [True: 12, False: 11]
  ------------------
 3069|     12|    frac = 30.0F / 3;
 3070|     12|  }
 3071|    442|  return sign * (val + frac) / 32.0F;
 3072|    442|}

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

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  5.00k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  5.00k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  4.99k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  4.99k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  4.85k|void Converter::cnvToXmp() {
  503|   611k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 611k, False: 4.85k]
  ------------------
  504|   611k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 504k, False: 106k]
  |  Branch (504:37): [True: 252k, False: 252k]
  |  Branch (504:52): [True: 106k, False: 252k]
  |  Branch (504:79): [True: 53.1k, False: 53.3k]
  ------------------
  505|   305k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   305k|    }
  507|   611k|  }
  508|  4.85k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  5.13k|void Converter::cnvFromXmp() {
  511|   647k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 647k, False: 5.13k]
  ------------------
  512|   647k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 534k, False: 112k]
  |  Branch (512:37): [True: 267k, False: 267k]
  |  Branch (512:52): [True: 112k, False: 267k]
  |  Branch (512:79): [True: 56.4k, False: 56.4k]
  ------------------
  513|   323k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   323k|    }
  515|   647k|  }
  516|  5.13k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  4.84k|void Converter::cnvNone(const char*, const char*) {
  519|  4.84k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  6.17k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  6.17k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  6.17k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 6.17k, False: 0]
  ------------------
  524|  6.17k|    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|  1.12k|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|  1.12k|  auto pos = iptcData_->findKey(IptcKey(to));
  533|  1.12k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 1.12k, False: 0]
  ------------------
  534|  1.12k|    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|  1.09k|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|  1.09k|  auto pos = xmpData_->findKey(XmpKey(to));
  545|  1.09k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 1.09k]
  ------------------
  546|      0|    return true;
  547|  1.09k|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 1.09k]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|  1.09k|  xmpData_->erase(pos);
  550|  1.09k|  return true;
  551|  1.09k|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   218k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   218k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   218k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 218k, False: 401]
  ------------------
  556|   218k|    return;
  557|    401|  std::string value = pos->toString();
  558|    401|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 401]
  ------------------
  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|    401|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 401]
  ------------------
  565|      0|    return;
  566|    401|  (*xmpData_)[to] = value;
  567|    401|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 401]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    401|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  2.42k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  2.42k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  2.42k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 2.42k, False: 0]
  ------------------
  574|  2.42k|    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|  2.42k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  2.42k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  2.42k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 2.42k, False: 0]
  ------------------
  599|  2.42k|    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|  9.71k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  9.71k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  9.71k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 9.55k, False: 158]
  ------------------
  619|  9.55k|    return;
  620|    158|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 158]
  ------------------
  621|      0|    return;
  622|    158|  int year = 0;
  623|    158|  int month = 0;
  624|    158|  int day = 0;
  625|    158|  int hour = 0;
  626|    158|  int min = 0;
  627|    158|  int sec = 0;
  628|    158|  std::string subsec;
  629|       |
  630|    158|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 158, False: 0]
  ------------------
  631|    158|    std::string value = pos->toString();
  632|    158|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 158]
  ------------------
  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|    158|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 158]
  ------------------
  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|    158|  } 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|    158|  const char* subsecTag = nullptr;
  711|    158|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 26, False: 132]
  ------------------
  712|     26|    subsecTag = "Exif.Photo.SubSecTime";
  713|    132|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 51, False: 81]
  ------------------
  714|     51|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|     81|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 81, False: 0]
  ------------------
  716|     81|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|     81|  }
  718|       |
  719|    158|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 158, False: 0]
  ------------------
  720|    158|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    158|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 14, False: 144]
  ------------------
  722|     14|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 14, False: 0]
  ------------------
  723|     14|        std::string ss = subsec_pos->toString();
  724|     14|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 14, False: 0]
  ------------------
  725|     14|          bool ok = false;
  726|     14|          stringTo<long>(ss, ok);
  727|     14|          if (ok)
  ------------------
  |  Branch (727:15): [True: 14, False: 0]
  ------------------
  728|     14|            subsec = std::string(".") + ss;
  729|     14|        }
  730|     14|      }
  731|     14|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 14]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     14|    }
  734|    158|  }
  735|       |
  736|    158|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 158]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    158|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    158|#define stringFormat std::format
  ------------------
  740|    158|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 158]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    158|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  4.85k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  4.85k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  4.85k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 4.85k, False: 0]
  ------------------
  747|  4.85k|    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|  2.42k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  2.42k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  2.42k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 2.42k, False: 0]
  ------------------
  764|  2.42k|    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|  2.42k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  2.42k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  2.42k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 2.42k, False: 0]
  |  Branch (780:7): [True: 2.42k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  2.42k|    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|  9.70k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  9.70k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  9.70k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 9.70k, False: 0]
  ------------------
  805|  9.70k|    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|   231k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   231k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   231k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 230k, False: 576]
  ------------------
  847|   230k|    return;
  848|    576|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 576]
  ------------------
  849|      0|    return;
  850|    576|  std::string value;
  851|    576|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 164, False: 412]
  ------------------
  852|    164|#ifndef SUPPRESS_WARNINGS
  853|    164|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    164|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 164]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    164|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    164|#endif
  855|    164|    return;
  856|    164|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    412|  ExifKey key(to);
  859|    412|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 402, False: 10]
  ------------------
  860|    402|    exifData_->add(ed);
  861|    402|  }
  862|    412|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 412]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    412|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  2.56k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  2.56k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 2.56k]
  ------------------
  868|      0|    return;
  869|  2.56k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  2.56k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 2.56k, False: 0]
  ------------------
  871|  2.56k|    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|  2.56k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  2.56k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 2.56k]
  ------------------
  887|      0|    return;
  888|  2.56k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  2.56k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 2.56k, False: 0]
  ------------------
  890|  2.56k|    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|  10.2k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  10.2k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  10.2k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 9.82k, False: 444]
  ------------------
  912|  9.82k|    return;
  913|    444|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 444]
  ------------------
  914|      0|    return;
  915|    444|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    444|  std::string value = pos->toString();
  917|    444|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 444]
  ------------------
  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|    444|  XMP_DateTime datetime;
  924|    444|  try {
  925|    444|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    444|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 158, False: 286]
  ------------------
  927|    158|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    158|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    158|#define stringFormat std::format
  ------------------
  930|    158|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    158|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 14, False: 144]
  ------------------
  933|     14|        const char* subsecTag = nullptr;
  934|     14|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 5, False: 9]
  ------------------
  935|      5|          subsecTag = "Exif.Photo.SubSecTime";
  936|      9|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 6, False: 3]
  ------------------
  937|      6|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|      6|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 3, False: 0]
  ------------------
  939|      3|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|      3|        }
  941|     14|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 14, False: 0]
  ------------------
  942|     14|          prepareExifTarget(subsecTag, true);
  943|     14|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|     14|        }
  945|     14|      }
  946|    286|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    286|      URational rhour(datetime.hour, 1);
  950|    286|      URational rmin(datetime.minute, 1);
  951|    286|      URational rsec(datetime.second, 1);
  952|    286|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 286]
  ------------------
  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|    286|      std::ostringstream array;
  964|    286|      array << rhour << " " << rmin << " " << rsec;
  965|    286|      (*exifData_)[to] = array.str();
  966|       |
  967|    286|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    286|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    286|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    286|#define stringFormat std::format
  ------------------
  970|    286|    }
  971|    444|  }
  972|    444|#ifndef SUPPRESS_WARNINGS
  973|    444|  catch (const XMP_Error& e) {
  974|    286|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    286|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 286]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    286|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    286|    return;
  976|    286|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    158|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 158]
  ------------------
  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|    158|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  5.13k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  5.13k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  5.13k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 5.13k, False: 0]
  ------------------
  995|  5.13k|    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|  2.56k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  2.56k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  2.56k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 2.56k, False: 0]
  ------------------
 1015|  2.56k|    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|  2.56k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  2.56k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  2.56k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 2.56k, False: 0]
  ------------------
 1035|  2.56k|    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|  10.2k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  10.2k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  10.2k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 10.2k, False: 0]
  ------------------
 1105|  10.2k|    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|  48.3k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  48.3k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  48.3k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 47.7k, False: 534]
  ------------------
 1168|  47.7k|    return;
 1169|    534|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 534]
  ------------------
 1170|      0|    return;
 1171|   107k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 107k, False: 534]
  ------------------
 1172|   107k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 54.8k, False: 52.3k]
  ------------------
 1173|  54.8k|      std::string value = pos->toString();
 1174|  54.8k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 54.8k]
  ------------------
 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|  54.8k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 54.8k, False: 0]
  ------------------
 1182|  54.8k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  54.8k|      (*xmpData_)[to] = value;
 1184|  54.8k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 54.8k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  54.8k|    }
 1189|   107k|    ++pos;
 1190|   107k|  }
 1191|    534|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  56.4k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  56.4k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  56.4k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 55.3k, False: 1.12k]
  ------------------
 1196|  55.3k|    return;
 1197|  1.12k|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 1.12k]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|  1.12k|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 337, False: 790]
  |  Branch (1200:35): [True: 549, False: 241]
  ------------------
 1201|    886|    std::string value;
 1202|    886|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 181, False: 705]
  ------------------
 1203|    181|#ifndef SUPPRESS_WARNINGS
 1204|    181|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    181|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 181]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    181|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    181|#endif
 1206|    181|      return;
 1207|    181|    }
 1208|    705|    (*iptcData_)[to] = value;
 1209|    705|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    705|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 705]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    705|    return;
 1213|    886|  }
 1214|       |
 1215|    241|  size_t count = pos->count();
 1216|    241|  bool added = false;
 1217|  56.1k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 55.9k, False: 241]
  ------------------
 1218|  55.9k|    std::string value = pos->toString(i);
 1219|  55.9k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 55.9k]
  ------------------
 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|  55.9k|    IptcKey key(to);
 1226|  55.9k|    Iptcdatum id(key);
 1227|  55.9k|    id.setValue(value);
 1228|  55.9k|    iptcData_->add(id);
 1229|  55.9k|    added = true;
 1230|  55.9k|  }
 1231|    241|  if (added)
  ------------------
  |  Branch (1231:7): [True: 231, False: 10]
  ------------------
 1232|    231|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    241|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 241]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    241|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  2.43k|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|  2.43k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  2.43k|  converter.cnvToXmp();
 1321|  2.43k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  2.56k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  2.56k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  2.56k|  converter.cnvFromXmp();
 1333|  2.56k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  2.42k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  2.42k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 2.42k, False: 0]
  ------------------
 1349|  2.42k|    iptcCharset = iptcData.detectCharset();
 1350|  2.42k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 2.42k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  2.42k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  2.42k|  converter.cnvToXmp();
 1355|  2.42k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  2.56k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  2.56k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  2.56k|  converter.cnvFromXmp();
 1371|  2.56k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  91.9k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  91.9k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 54.8k, False: 37.0k]
  ------------------
 1382|  54.8k|    return true;  // nothing to do
 1383|  37.0k|#ifdef EXV_HAVE_ICONV
 1384|  37.0k|  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|  91.9k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  37.0k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  37.0k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 37.0k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  37.0k|  bool ret = true;
 1407|  37.0k|  auto cd = iconv_open(to.data(), from.data());
 1408|  37.0k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 37.0k]
  ------------------
 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|  37.0k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  37.0k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  37.0k|#endif
 1420|  37.0k|  size_t inbytesleft = str.length();
 1421|  59.3k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 52.6k, False: 6.70k]
  ------------------
 1422|  52.6k|    char outbuf[256];
 1423|  52.6k|    char* outptr = outbuf;
 1424|  52.6k|    size_t outbytesleft = sizeof(outbuf);
 1425|  52.6k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  52.6k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  52.6k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 47.1k, False: 5.47k]
  |  Branch (1427:53): [True: 30.3k, False: 16.8k]
  ------------------
 1428|  30.3k|#ifndef SUPPRESS_WARNINGS
 1429|  30.3k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  30.3k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 30.3k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  30.3k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  30.3k|#endif
 1431|  30.3k|      ret = false;
 1432|  30.3k|      break;
 1433|  30.3k|    }
 1434|  22.2k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  22.2k|  }
 1436|       |
 1437|  37.0k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 37.0k, False: 0]
  ------------------
 1438|  37.0k|    iconv_close(cd);
 1439|       |
 1440|  37.0k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 6.70k, False: 30.3k]
  ------------------
 1441|  6.70k|    str = std::move(outstr);
 1442|  37.0k|  return ret;
 1443|  37.0k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|  1.46k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|  1.46k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 610, False: 852]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    610|    value = pos->toString(0);
 1596|    610|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 540, False: 70]
  |  Branch (1596:31): [True: 195, False: 345]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    195|      value = pos->toString();
 1600|    195|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 195, False: 0]
  |  Branch (1600:32): [True: 195, False: 0]
  ------------------
 1601|    195|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    195|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 195, False: 0]
  ------------------
 1603|    195|          value = value.substr(first_space_pos + 1);
 1604|    195|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    195|      }
 1608|    195|    }
 1609|    852|  } else {
 1610|    852|    value = pos->toString();
 1611|    852|  }
 1612|  1.46k|  return pos->value().ok();
 1613|  1.46k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  39.6k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  39.6k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  39.6k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  39.6k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 39.6k]
  |  Branch (18:17): [True: 0, False: 39.6k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  39.6k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 2.56k, False: 37.0k]
  |  Branch (22:26): [True: 2.52k, False: 47]
  ------------------
   23|  2.52k|    setByteOrder(littleEndian);
   24|  37.1k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 13.5k, False: 23.6k]
  |  Branch (24:33): [True: 13.4k, False: 66]
  ------------------
   25|  13.4k|    setByteOrder(bigEndian);
   26|  23.6k|  } else {
   27|  23.6k|    return false;
   28|  23.6k|  }
   29|  15.9k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 7.07k, False: 8.89k]
  ------------------
   30|  7.07k|    return false;
   31|  8.89k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  8.89k|  if (0 != memcmp(pData + 8, cr2sig_.data(), 4))
  ------------------
  |  Branch (32:7): [True: 7.46k, False: 1.43k]
  ------------------
   33|  7.46k|    return false;
   34|  1.43k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  1.43k|  return true;
   37|  8.89k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    144|DataBuf Cr2Header::write() const {
   40|    144|  DataBuf buf(16);
   41|    144|  switch (byteOrder()) {
   42|    113|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 113, False: 31]
  ------------------
   43|    113|      buf.write_uint8(0, 'I');
   44|    113|      break;
   45|     31|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 31, False: 113]
  ------------------
   46|     31|      buf.write_uint8(0, 'M');
   47|     31|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 144]
  ------------------
   49|      0|      break;
   50|    144|  }
   51|    144|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    144|  buf.write_uint16(2, tag(), byteOrder());
   54|    144|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    144|  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|    144|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    144|  return buf;
   59|    144|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  49.3k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  49.3k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 755, False: 48.5k]
  |  Branch (63:33): [True: 338, False: 48.2k]
  ------------------
   64|  1.09k|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  48.2k|  return isTiffImageTag(tag, group);
   67|  49.3k|}

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

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

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

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

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  7.14k|  [[nodiscard]] const byte* pData() const {
  214|  7.14k|    return pData_;
  215|  7.14k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  6.91k|  [[nodiscard]] size_t size() const {
  204|  6.91k|    return size_;
  205|  6.91k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  16.8k|  static auto signature() {
  419|  16.8k|    return signature_;
  420|  16.8k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  45.9k|  void setDir(uint16_t dir) {
  147|  45.9k|    dir_ = dir;
  148|  45.9k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  6.19k|  [[nodiscard]] uint16_t dir() const {
  184|  6.19k|    return dir_;
  185|  6.19k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|   110k|  [[nodiscard]] uint16_t tag() const {
  189|   110k|    return tag_;
  190|   110k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  4.08k|  [[nodiscard]] size_t offset() const {
  209|  4.08k|    return offset_;
  210|  4.08k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  24.5k|  [[nodiscard]] uint16_t tagId() const {
  219|  24.5k|    return tag_ & 0x3fff;
  220|  24.5k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  1.98k|  [[nodiscard]] TypeId typeId() const {
  224|  1.98k|    return typeId(tag_);
  225|  1.98k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  59.5k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  59.5k|    return dataLocation(tag_);
  230|  59.5k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.41k|  void setSize(size_t size) {
  254|  1.41k|    size_ = size;
  255|  1.41k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.41k|  void setOffset(size_t offset) {
  258|  1.41k|    offset_ = offset;
  259|  1.41k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.13k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.13k|    return byteOrder_;
  446|  1.13k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  46.7k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  47.2k|  virtual ~CiffComponent() = default;

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   310k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   310k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 265k, False: 44.9k]
  |  Branch (378:31): [True: 24.1k, False: 241k]
  ------------------
  379|  24.1k|    return -1;
  380|   286k|  const DataSet* dataSet = records_[recordId];
  381|   286k|  int idx;
  382|  7.59M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 7.31M, False: 272k]
  ------------------
  383|  7.31M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 13.9k, False: 7.30M]
  ------------------
  384|  13.9k|      return -1;
  385|  7.31M|  }
  386|   272k|  return idx;
  387|   286k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|   109k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|   109k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 106k, False: 3.36k]
  |  Branch (390:31): [True: 0, False: 106k]
  ------------------
  391|      0|    return -1;
  392|   109k|  const DataSet* dataSet = records_[recordId];
  393|   109k|  int idx;
  394|  3.24M|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 3.13M, False: 109k]
  ------------------
  395|  3.13M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 3.13M]
  ------------------
  396|      0|      return -1;
  397|  3.13M|  }
  398|   109k|  return idx;
  399|   109k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  86.6k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  86.6k|  int idx = dataSetIdx(number, recordId);
  403|  86.6k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 12.7k, False: 73.9k]
  ------------------
  404|  12.7k|    return unknownDataSet.type_;
  405|  73.9k|  return records_[recordId][idx].type_;
  406|  86.6k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|   138k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|   138k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 126k, False: 12.7k]
  ------------------
  410|   126k|    return records_[recordId][idx].name_;
  411|       |
  412|  12.7k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  12.7k|#define stringFormat std::format
  ------------------
  413|   138k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  85.2k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  85.2k|  int idx = dataSetIdx(number, recordId);
  438|  85.2k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 12.7k, False: 72.5k]
  ------------------
  439|  12.7k|    return unknownDataSet.repeatable_;
  440|  72.5k|  return records_[recordId][idx].repeatable_;
  441|  85.2k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|   109k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|   109k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 109k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|   109k|    return records_[recordId][idx].number_;
  447|   109k|  }
  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|   138k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|   138k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 16.9k, False: 121k]
  |  Branch (454:31): [True: 113k, False: 8.04k]
  ------------------
  455|   130k|    return recordInfo_[recordId].name_;
  456|   130k|  }
  457|       |
  458|  8.04k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  8.04k|#define stringFormat std::format
  ------------------
  459|   138k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|   109k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|   109k|  uint16_t i;
  470|   112k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 112k, False: 0]
  ------------------
  471|   112k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 109k, False: 3.36k]
  ------------------
  472|   109k|      break;
  473|   112k|  }
  474|   109k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 109k]
  ------------------
  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|   109k|  return i;
  480|   109k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|   109k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|   109k|  decomposeKey();
  492|   109k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  29.2k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  29.2k|  makeKey();
  496|  29.2k|}
_ZNK5Exiv27IptcKey3keyEv:
  498|   107k|std::string IptcKey::key() const {
  499|   107k|  return key_;
  500|   107k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|  1.52M|uint16_t IptcKey::tag() const {
  523|  1.52M|  return tag_;
  524|  1.52M|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   610k|uint16_t IptcKey::record() const {
  531|   610k|  return record_;
  532|   610k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   527k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   527k|  return UniquePtr(clone_());
  536|   527k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   527k|IptcKey* IptcKey::clone_() const {
  539|   527k|  return new IptcKey(*this);
  540|   527k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|   109k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|   109k|  auto posDot1 = key_.find('.');
  545|   109k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|   109k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 109k]
  |  Branch (547:39): [True: 0, False: 109k]
  ------------------
  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|   109k|  const std::string familyName = key_.substr(0, posDot1);
  553|   109k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 109k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|   109k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|   109k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|   109k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|   109k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|   109k|  recordName = IptcDataSets::recordName(recId);
  565|   109k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|   109k|  tag_ = dataSet;
  568|   109k|  record_ = recId;
  569|   109k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|   109k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  29.2k|void IptcKey::makeKey() {
  573|  29.2k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  29.2k|         IptcDataSets::dataSetName(tag_, record_);
  575|  29.2k|}

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

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

_ZN5Exiv26LogMsg8setLevelENS0_5LevelE:
  119|  27.5k|void LogMsg::setLevel(LogMsg::Level level) {
  120|  27.5k|  level_ = level;
  121|  27.5k|}
_ZN5Exiv26LogMsg5levelEv:
  127|  4.81M|LogMsg::Level LogMsg::level() {
  128|  4.81M|  return level_;
  129|  4.81M|}
_ZN5Exiv25ErrorC2ENS_9ErrorCodeE:
  155|  15.5k|Error::Error(ErrorCode code) : code_(code) {
  156|  15.5k|  setMsg(0);
  157|  15.5k|}
_ZNK5Exiv25Error4codeEv:
  159|     70|ErrorCode Error::code() const noexcept {
  160|     70|  return code_;
  161|     70|}
_ZN5Exiv25Error6setMsgEi:
  167|  20.9k|void Error::setMsg(int count) {
  168|  20.9k|  std::string msg{_(errList.at(static_cast<size_t>(code_)))};
  ------------------
  |  |   40|  20.9k|#define _(String) (String)
  ------------------
  169|  20.9k|  auto pos = msg.find("%0");
  170|  20.9k|  if (pos != std::string::npos) {
  ------------------
  |  Branch (170:7): [True: 0, False: 20.9k]
  ------------------
  171|      0|    msg.replace(pos, 2, std::to_string(static_cast<int>(code_)));
  172|      0|  }
  173|  20.9k|  if (count > 0) {
  ------------------
  |  Branch (173:7): [True: 5.45k, False: 15.5k]
  ------------------
  174|  5.45k|    pos = msg.find("%1");
  175|  5.45k|    if (pos != std::string::npos) {
  ------------------
  |  Branch (175:9): [True: 5.45k, False: 0]
  ------------------
  176|  5.45k|      msg.replace(pos, 2, arg1_);
  177|  5.45k|    }
  178|  5.45k|  }
  179|  20.9k|  if (count > 1) {
  ------------------
  |  Branch (179:7): [True: 0, False: 20.9k]
  ------------------
  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|  20.9k|  if (count > 2) {
  ------------------
  |  Branch (185:7): [True: 0, False: 20.9k]
  ------------------
  186|      0|    pos = msg.find("%3");
  187|      0|    if (pos != std::string::npos) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      msg.replace(pos, 2, arg3_);
  189|      0|    }
  190|      0|  }
  191|  20.9k|  msg_ = std::move(msg);
  192|  20.9k|}

_ZN5Exiv29ExifdatumC2ERKNS_7ExifKeyEPKNS_5ValueE:
  157|  1.93M|Exifdatum::Exifdatum(const ExifKey& key, const Value* pValue) : key_(key.clone()) {
  158|  1.93M|  if (pValue)
  ------------------
  |  Branch (158:7): [True: 1.92M, False: 5.94k]
  ------------------
  159|  1.92M|    value_ = pValue->clone();
  160|  1.93M|}
_ZN5Exiv29ExifdatumC2ERKS0_:
  162|  6.26M|Exifdatum::Exifdatum(const Exifdatum& rhs) {
  163|  6.26M|  if (rhs.key_)
  ------------------
  |  Branch (163:7): [True: 6.26M, False: 0]
  ------------------
  164|  6.26M|    key_ = rhs.key_->clone();  // deep copy
  165|  6.26M|  if (rhs.value_)
  ------------------
  |  Branch (165:7): [True: 6.26M, False: 0]
  ------------------
  166|  6.26M|    value_ = rhs.value_->clone();  // deep copy
  167|  6.26M|}
_ZN5Exiv29ExifdatumD2Ev:
  169|  8.20M|Exifdatum::~Exifdatum() = default;
_ZNK5Exiv29Exifdatum5valueEv:
  203|  44.8k|const Value& Exifdatum::value() const {
  204|  44.8k|  if (!value_)
  ------------------
  |  Branch (204:7): [True: 0, False: 44.8k]
  ------------------
  205|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  206|  44.8k|  return *value_;
  207|  44.8k|}
_ZN5Exiv29ExifdatumaSERKS0_:
  209|  21.9k|Exifdatum& Exifdatum::operator=(const Exifdatum& rhs) {
  210|  21.9k|  if (this == &rhs)
  ------------------
  |  Branch (210:7): [True: 0, False: 21.9k]
  ------------------
  211|      0|    return *this;
  212|       |
  213|  21.9k|  key_.reset();
  214|  21.9k|  if (rhs.key_)
  ------------------
  |  Branch (214:7): [True: 21.9k, False: 0]
  ------------------
  215|  21.9k|    key_ = rhs.key_->clone();  // deep copy
  216|       |
  217|  21.9k|  value_.reset();
  218|  21.9k|  if (rhs.value_)
  ------------------
  |  Branch (218:7): [True: 21.9k, False: 0]
  ------------------
  219|  21.9k|    value_ = rhs.value_->clone();  // deep copy
  220|       |
  221|  21.9k|  return *this;
  222|  21.9k|}  // Exifdatum::operator=
_ZN5Exiv29ExifdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  224|  4.52k|Exifdatum& Exifdatum::operator=(const std::string& value) {
  225|  4.52k|  setValue(value);
  226|  4.52k|  return *this;
  227|  4.52k|}
_ZN5Exiv29ExifdatumaSERKt:
  229|     73|Exifdatum& Exifdatum::operator=(const uint16_t& value) {
  230|     73|  return Exiv2::setValue(*this, value);
  231|     73|}
_ZN5Exiv29ExifdatumaSERKj:
  233|  4.69k|Exifdatum& Exifdatum::operator=(const uint32_t& value) {
  234|  4.69k|  return Exiv2::setValue(*this, value);
  235|  4.69k|}
_ZN5Exiv29ExifdatumaSERKNS_5ValueE:
  253|  6.46k|Exifdatum& Exifdatum::operator=(const Value& value) {
  254|  6.46k|  setValue(&value);
  255|  6.46k|  return *this;
  256|  6.46k|}
_ZN5Exiv29Exifdatum8setValueEPKNS_5ValueE:
  258|  6.48k|void Exifdatum::setValue(const Value* pValue) {
  259|  6.48k|  value_.reset();
  260|  6.48k|  if (pValue)
  ------------------
  |  Branch (260:7): [True: 6.48k, False: 0]
  ------------------
  261|  6.48k|    value_ = pValue->clone();
  262|  6.48k|}
_ZN5Exiv29Exifdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  264|  4.93k|int Exifdatum::setValue(const std::string& value) {
  265|  4.93k|  if (!value_) {
  ------------------
  |  Branch (265:7): [True: 2.73k, False: 2.19k]
  ------------------
  266|  2.73k|    TypeId type = key_->defaultTypeId();
  267|  2.73k|    value_ = Value::create(type);
  268|  2.73k|  }
  269|  4.93k|  return value_->read(value);
  270|  4.93k|}
_ZNK5Exiv29Exifdatum11setDataAreaEPKhm:
  272|     73|int Exifdatum::setDataArea(const byte* buf, size_t len) const {
  273|     73|  return value_ ? value_->setDataArea(buf, len) : -1;
  ------------------
  |  Branch (273:10): [True: 73, False: 0]
  ------------------
  274|     73|}
_ZNK5Exiv29Exifdatum3keyEv:
  276|  89.3M|std::string Exifdatum::key() const {
  277|  89.3M|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (277:10): [True: 89.3M, False: 0]
  ------------------
  278|  89.3M|}
_ZNK5Exiv29Exifdatum9groupNameEv:
  284|  3.33M|std::string Exifdatum::groupName() const {
  285|  3.33M|  return key_ ? key_->groupName() : "";
  ------------------
  |  Branch (285:10): [True: 3.33M, False: 0]
  ------------------
  286|  3.33M|}
_ZNK5Exiv29Exifdatum7tagNameEv:
  288|    406|std::string Exifdatum::tagName() const {
  289|    406|  return key_ ? key_->tagName() : "";
  ------------------
  |  Branch (289:10): [True: 406, False: 0]
  ------------------
  290|    406|}
_ZNK5Exiv29Exifdatum3tagEv:
  300|  8.92M|uint16_t Exifdatum::tag() const {
  301|  8.92M|  return key_ ? key_->tag() : 0xffff;
  ------------------
  |  Branch (301:10): [True: 8.92M, False: 0]
  ------------------
  302|  8.92M|}
_ZNK5Exiv29Exifdatum5ifdIdEv:
  304|  14.7M|IfdId Exifdatum::ifdId() const {
  305|  14.7M|  return key_ ? key_->ifdId() : IfdId::ifdIdNotSet;
  ------------------
  |  Branch (305:10): [True: 14.7M, False: 0]
  ------------------
  306|  14.7M|}
_ZNK5Exiv29Exifdatum3idxEv:
  312|  3.47M|int Exifdatum::idx() const {
  313|  3.47M|  return key_ ? key_->idx() : 0;
  ------------------
  |  Branch (313:10): [True: 3.47M, False: 0]
  ------------------
  314|  3.47M|}
_ZNK5Exiv29Exifdatum4copyEPhNS_9ByteOrderE:
  316|  4.80k|size_t Exifdatum::copy(byte* buf, ByteOrder byteOrder) const {
  317|  4.80k|  return value_ ? value_->copy(buf, byteOrder) : 0;
  ------------------
  |  Branch (317:10): [True: 4.80k, False: 0]
  ------------------
  318|  4.80k|}
_ZNK5Exiv29Exifdatum6typeIdEv:
  320|    222|TypeId Exifdatum::typeId() const {
  321|    222|  return value_ ? value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 222, False: 0]
  ------------------
  322|    222|}
_ZNK5Exiv29Exifdatum8typeSizeEv:
  328|     95|size_t Exifdatum::typeSize() const {
  329|     95|  return TypeInfo::typeSize(typeId());
  330|     95|}
_ZNK5Exiv29Exifdatum5countEv:
  332|  90.9k|size_t Exifdatum::count() const {
  333|  90.9k|  return value_ ? value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 90.9k, False: 0]
  ------------------
  334|  90.9k|}
_ZNK5Exiv29Exifdatum4sizeEv:
  336|  4.58M|size_t Exifdatum::size() const {
  337|  4.58M|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (337:10): [True: 4.58M, False: 0]
  ------------------
  338|  4.58M|}
_ZNK5Exiv29Exifdatum8toStringEv:
  340|  21.9k|std::string Exifdatum::toString() const {
  341|  21.9k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 21.9k, False: 0]
  ------------------
  342|  21.9k|}
_ZNK5Exiv29Exifdatum7toInt64Em:
  348|   107k|int64_t Exifdatum::toInt64(size_t n) const {
  349|   107k|  return value_ ? value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 107k, False: 0]
  ------------------
  350|   107k|}
_ZNK5Exiv29Exifdatum8getValueEv:
  360|  2.95M|Value::UniquePtr Exifdatum::getValue() const {
  361|  2.95M|  return value_ ? value_->clone() : nullptr;
  ------------------
  |  Branch (361:10): [True: 2.95M, False: 0]
  ------------------
  362|  2.95M|}
_ZNK5Exiv29Exifdatum12sizeDataAreaEv:
  364|    113|size_t Exifdatum::sizeDataArea() const {
  365|    113|  return value_ ? value_->sizeDataArea() : 0;
  ------------------
  |  Branch (365:10): [True: 113, False: 0]
  ------------------
  366|    113|}
_ZNK5Exiv29Exifdatum8dataAreaEv:
  368|    127|DataBuf Exifdatum::dataArea() const {
  369|    127|  return value_ ? value_->dataArea() : DataBuf(nullptr, 0);
  ------------------
  |  Branch (369:10): [True: 127, False: 0]
  ------------------
  370|    127|}
_ZN5Exiv210ExifThumbCC2ERKNS_8ExifDataE:
  372|    286|ExifThumbC::ExifThumbC(const ExifData& exifData) : exifData_(exifData) {
  373|    286|}
_ZNK5Exiv210ExifThumbC4copyEv:
  375|    213|DataBuf ExifThumbC::copy() const {
  376|    213|  auto thumbnail = Thumbnail::create(exifData_);
  377|    213|  if (!thumbnail)
  ------------------
  |  Branch (377:7): [True: 197, False: 16]
  ------------------
  378|    197|    return {};
  379|     16|  return thumbnail->copy(exifData_);
  380|    213|}
_ZN5Exiv29ExifThumbC2ERNS_8ExifDataE:
  411|     73|ExifThumb::ExifThumb(ExifData& exifData) : ExifThumbC(exifData), exifData_(exifData) {
  412|     73|}
_ZN5Exiv29ExifThumb16setJpegThumbnailEPKhm:
  435|     73|void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
  436|     73|  exifData_["Exif.Thumbnail.Compression"] = std::uint16_t{6};
  437|     73|  Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
  438|     73|  format = 0U;
  439|     73|  format.setDataArea(buf, size);
  440|     73|  exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
  441|     73|}
_ZN5Exiv28ExifDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  447|  20.1k|Exifdatum& ExifData::operator[](const std::string& key) {
  448|  20.1k|  ExifKey exifKey(key);
  449|  20.1k|  auto pos = findKey(exifKey);
  450|  20.1k|  if (pos == end()) {
  ------------------
  |  Branch (450:7): [True: 5.53k, False: 14.6k]
  ------------------
  451|  5.53k|    return exifMetadata_.emplace_back(exifKey);
  452|  5.53k|  }
  453|  14.6k|  return *pos;
  454|  20.1k|}
_ZN5Exiv28ExifData3addERKNS_7ExifKeyEPKNS_5ValueE:
  456|  1.92M|void ExifData::add(const ExifKey& key, const Value* pValue) {
  457|  1.92M|  add(Exifdatum(key, pValue));
  458|  1.92M|}
_ZN5Exiv28ExifData3addERKNS_9ExifdatumE:
  460|  2.11M|void ExifData::add(const Exifdatum& exifdatum) {
  461|       |  // allow duplicates
  462|  2.11M|  exifMetadata_.push_back(exifdatum);
  463|  2.11M|}
_ZNK5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  465|   255k|ExifData::const_iterator ExifData::findKey(const ExifKey& key) const {
  466|   255k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  467|   255k|}
_ZN5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  469|   758k|ExifData::iterator ExifData::findKey(const ExifKey& key) {
  470|   758k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  471|   758k|}
_ZN5Exiv28ExifData5clearEv:
  473|  34.3k|void ExifData::clear() {
  474|  34.3k|  exifMetadata_.clear();
  475|  34.3k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEES5_:
  485|  81.5k|ExifData::iterator ExifData::erase(ExifData::iterator beg, ExifData::iterator end) {
  486|  81.5k|  return exifMetadata_.erase(beg, end);
  487|  81.5k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEE:
  489|  75.2k|ExifData::iterator ExifData::erase(ExifData::iterator pos) {
  490|  75.2k|  return exifMetadata_.erase(pos);
  491|  75.2k|}
_ZN5Exiv210ExifParser6decodeERNS_8ExifDataEPKhm:
  493|    249|ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size) {
  494|    249|  IptcData iptcData;
  495|    249|  XmpData xmpData;
  496|    249|  ByteOrder bo = TiffParser::decode(exifData, iptcData, xmpData, pData, size);
  497|    249|#ifndef SUPPRESS_WARNINGS
  498|    249|  if (!iptcData.empty()) {
  ------------------
  |  Branch (498:7): [True: 18, False: 231]
  ------------------
  499|     18|    EXV_WARNING << "Ignoring IPTC information encoded in the Exif data.\n";
  ------------------
  |  |  138|     18|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     18|  LogMsg(LogMsg::warn).os()
  ------------------
  500|     18|  }
  501|    249|  if (!xmpData.empty()) {
  ------------------
  |  Branch (501:7): [True: 9, False: 240]
  ------------------
  502|      9|    EXV_WARNING << "Ignoring XMP information encoded in the Exif data.\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()
  ------------------
  503|      9|  }
  504|    249|#endif
  505|    249|  return bo;
  506|    249|}
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataE:
  512|  5.45k|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.45k|  static constexpr auto filteredIfd0Tags = std::array{
  516|  5.45k|      "Exif.Image.PhotometricInterpretation",
  517|  5.45k|      "Exif.Image.StripOffsets",
  518|  5.45k|      "Exif.Image.RowsPerStrip",
  519|  5.45k|      "Exif.Image.StripByteCounts",
  520|  5.45k|      "Exif.Image.JPEGInterchangeFormat",
  521|  5.45k|      "Exif.Image.JPEGInterchangeFormatLength",
  522|  5.45k|      "Exif.Image.SubIFDs",
  523|       |      // Issue 981.  Never allow manufactured data to be written
  524|  5.45k|      "Exif.Canon.AFInfoSize",
  525|  5.45k|      "Exif.Canon.AFAreaMode",
  526|  5.45k|      "Exif.Canon.AFNumPoints",
  527|  5.45k|      "Exif.Canon.AFValidPoints",
  528|  5.45k|      "Exif.Canon.AFCanonImageWidth",
  529|  5.45k|      "Exif.Canon.AFCanonImageHeight",
  530|  5.45k|      "Exif.Canon.AFImageWidth",
  531|  5.45k|      "Exif.Canon.AFImageHeight",
  532|  5.45k|      "Exif.Canon.AFAreaWidths",
  533|  5.45k|      "Exif.Canon.AFAreaHeights",
  534|  5.45k|      "Exif.Canon.AFXPositions",
  535|  5.45k|      "Exif.Canon.AFYPositions",
  536|  5.45k|      "Exif.Canon.AFPointsInFocus",
  537|  5.45k|      "Exif.Canon.AFPointsSelected",
  538|  5.45k|      "Exif.Canon.AFPointsUnusable",
  539|  5.45k|      "Exif.Canon.AFFineRotation",
  540|  5.45k|  };
  541|   125k|  for (auto&& filteredIfd0Tag : filteredIfd0Tags) {
  ------------------
  |  Branch (541:31): [True: 125k, False: 5.45k]
  ------------------
  542|   125k|    auto pos = exifData.findKey(ExifKey(filteredIfd0Tag));
  543|   125k|    if (pos != exifData.end()) {
  ------------------
  |  Branch (543:9): [True: 511, False: 124k]
  ------------------
  544|       |#ifdef EXIV2_DEBUG_MESSAGES
  545|       |      std::cerr << "Warning: Exif tag " << pos->key() << " not encoded\n";
  546|       |#endif
  547|    511|      exifData.erase(pos);
  548|    511|    }
  549|   125k|  }
  550|       |
  551|       |  // Delete IFDs which do not occur in JPEGs
  552|  5.45k|  static constexpr auto filteredIfds = std::array{
  553|  5.45k|      IfdId::subImage1Id, IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id,
  554|  5.45k|      IfdId::subImage6Id, IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id, IfdId::subThumb1Id,
  555|  5.45k|      IfdId::panaRawId,   IfdId::ifd2Id,      IfdId::ifd3Id,
  556|  5.45k|  };
  557|  70.9k|  for (auto&& filteredIfd : filteredIfds) {
  ------------------
  |  Branch (557:27): [True: 70.9k, False: 5.45k]
  ------------------
  558|       |#ifdef EXIV2_DEBUG_MESSAGES
  559|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  560|       |#endif
  561|  70.9k|    eraseIfd(exifData, filteredIfd);
  562|  70.9k|  }
  563|       |
  564|       |  // IPTC and XMP are stored elsewhere, not in the Exif APP1 segment.
  565|  5.45k|  IptcData emptyIptc;
  566|  5.45k|  XmpData emptyXmp;
  567|       |
  568|       |  // Encode and check if the result fits into a JPEG Exif APP1 segment
  569|  5.45k|  MemIo mio1;
  570|  5.45k|  TiffHeader header(byteOrder, 0x00000008, false);
  571|  5.45k|  WriteMethod wm = TiffParserWorker::encode(mio1, pData, size, exifData, emptyIptc, emptyXmp, Tag::root,
  572|  5.45k|                                            TiffMapping::findEncoder, &header, nullptr);
  573|  5.45k|  if (mio1.size() <= 65527) {
  ------------------
  |  Branch (573:7): [True: 2.95k, False: 2.50k]
  ------------------
  574|  2.95k|    append(blob, mio1.mmap(), mio1.size());
  575|  2.95k|    return wm;
  576|  2.95k|  }
  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.50k|  static constexpr auto filteredPvTags = std::array{
  584|  2.50k|      std::pair(pttLen, "Exif.Minolta.ThumbnailLength"),
  585|  2.50k|      std::pair(pttTag, "Exif.Minolta.ThumbnailOffset"),
  586|  2.50k|      std::pair(pttLen, "Exif.Minolta.Thumbnail"),
  587|  2.50k|      std::pair(pttLen, "Exif.NikonPreview.JPEGInterchangeFormatLength"),
  588|  2.50k|      std::pair(pttIfd, "NikonPreview"),
  589|  2.50k|      std::pair(pttLen, "Exif.Olympus.ThumbnailLength"),
  590|  2.50k|      std::pair(pttTag, "Exif.Olympus.ThumbnailOffset"),
  591|  2.50k|      std::pair(pttLen, "Exif.Olympus.ThumbnailImage"),
  592|  2.50k|      std::pair(pttLen, "Exif.Olympus.Thumbnail"),
  593|  2.50k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailLength"),
  594|  2.50k|      std::pair(pttTag, "Exif.Olympus2.ThumbnailOffset"),
  595|  2.50k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailImage"),
  596|  2.50k|      std::pair(pttLen, "Exif.Olympus2.Thumbnail"),
  597|  2.50k|      std::pair(pttLen, "Exif.OlympusCs.PreviewImageLength"),
  598|  2.50k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageStart"),
  599|  2.50k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageValid"),
  600|  2.50k|      std::pair(pttLen, "Exif.Pentax.PreviewLength"),
  601|  2.50k|      std::pair(pttTag, "Exif.Pentax.PreviewOffset"),
  602|  2.50k|      std::pair(pttTag, "Exif.Pentax.PreviewResolution"),
  603|  2.50k|      std::pair(pttLen, "Exif.PentaxDng.PreviewLength"),
  604|  2.50k|      std::pair(pttTag, "Exif.PentaxDng.PreviewOffset"),
  605|  2.50k|      std::pair(pttTag, "Exif.PentaxDng.PreviewResolution"),
  606|  2.50k|      std::pair(pttLen, "Exif.SamsungPreview.JPEGInterchangeFormatLength"),
  607|  2.50k|      std::pair(pttIfd, "SamsungPreview"),
  608|  2.50k|      std::pair(pttLen, "Exif.Thumbnail.StripByteCounts"),
  609|  2.50k|      std::pair(pttIfd, "Thumbnail"),
  610|  2.50k|      std::pair(pttLen, "Exif.Thumbnail.JPEGInterchangeFormatLength"),
  611|  2.50k|      std::pair(pttIfd, "Thumbnail"),
  612|  2.50k|  };
  613|  2.50k|  bool delTags = false;
  614|  69.8k|  for (auto&& [ptt, key] : filteredPvTags) {
  ------------------
  |  Branch (614:26): [True: 69.8k, False: 2.50k]
  ------------------
  615|  69.8k|    switch (ptt) {
  ------------------
  |  Branch (615:13): [True: 69.8k, False: 0]
  ------------------
  616|  37.4k|      case pttLen: {
  ------------------
  |  Branch (616:7): [True: 37.4k, False: 32.4k]
  ------------------
  617|  37.4k|        delTags = false;
  618|  37.4k|        if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end() && sumToLong(*pos) > 32768) {
  ------------------
  |  Branch (618:56): [True: 1.37k, False: 36.0k]
  |  Branch (618:56): [True: 55, False: 37.3k]
  |  Branch (618:81): [True: 55, False: 1.31k]
  ------------------
  619|     55|          delTags = true;
  620|     55|#ifndef SUPPRESS_WARNINGS
  621|     55|          EXV_WARNING << "Exif tag " << pos->key() << " not encoded\n";
  ------------------
  |  |  138|     55|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 55]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     55|  LogMsg(LogMsg::warn).os()
  ------------------
  622|     55|#endif
  623|     55|          exifData.erase(pos);
  624|     55|        }
  625|  37.4k|        break;
  626|      0|      }
  627|  22.4k|      case pttTag: {
  ------------------
  |  Branch (627:7): [True: 22.4k, False: 47.3k]
  ------------------
  628|  22.4k|        if (delTags) {
  ------------------
  |  Branch (628:13): [True: 35, False: 22.4k]
  ------------------
  629|     35|          if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end()) {
  ------------------
  |  Branch (629:58): [True: 17, False: 18]
  ------------------
  630|     17|#ifndef SUPPRESS_WARNINGS
  631|     17|            EXV_WARNING << "Exif tag " << pos->key() << " not encoded\n";
  ------------------
  |  |  138|     17|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 17]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     17|  LogMsg(LogMsg::warn).os()
  ------------------
  632|     17|#endif
  633|     17|            exifData.erase(pos);
  634|     17|          }
  635|     35|        }
  636|  22.4k|        break;
  637|      0|      }
  638|  9.97k|      case pttIfd:
  ------------------
  |  Branch (638:7): [True: 9.97k, False: 59.8k]
  ------------------
  639|  9.97k|        if (delTags) {
  ------------------
  |  Branch (639:13): [True: 13, False: 9.96k]
  ------------------
  640|     13|#ifndef SUPPRESS_WARNINGS
  641|     13|          EXV_WARNING << "Exif IFD " << key << " not encoded\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()
  ------------------
  642|     13|#endif
  643|     13|          eraseIfd(exifData, Internal::groupId(key));
  644|     13|        }
  645|  9.97k|        break;
  646|  69.8k|    }
  647|  69.8k|  }
  648|       |
  649|       |  // Delete unknown tags larger than 4kB and known tags larger than 20kB.
  650|  2.50k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  651|  2.50k|  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.50k|  MemIo mio2;
  655|  2.50k|  wm = TiffParserWorker::encode(mio2, pData, size, exifData, emptyIptc, emptyXmp, Tag::root, TiffMapping::findEncoder,
  656|  2.50k|                                &header, nullptr);
  657|  2.50k|  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.50k|  return wm;
  666|       |
  667|  2.50k|}  // ExifParser::encode
exif.cpp:_ZNK12_GLOBAL__N_118FindExifdatumByKeyclERKN5Exiv29ExifdatumE:
   45|  89.2M|  bool operator()(const Exiv2::Exifdatum& exifdatum) const {
   46|  89.2M|    return key_ == exifdatum.key();
   47|  89.2M|  }
exif.cpp:_ZN12_GLOBAL__N_118FindExifdatumByKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   39|  1.01M|  explicit FindExifdatumByKey(std::string key) : key_(std::move(key)) {
   40|  1.01M|  }
exif.cpp:_ZZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataEENK3$_0clINS_9ExifdatumEEEDaRKT_:
  650|   808k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  ------------------
  |  Branch (650:42): [True: 406, False: 808k]
  |  Branch (650:63): [True: 287, False: 119]
  |  Branch (650:99): [True: 39, False: 808k]
  ------------------
exif.cpp:_ZN12_GLOBAL__N_19Thumbnail6createERKN5Exiv28ExifDataE:
  675|    213|Thumbnail::UniquePtr Thumbnail::create(const Exiv2::ExifData& exifData) {
  676|    213|  const Exiv2::ExifKey k1("Exif.Thumbnail.Compression");
  677|    213|  auto pos = exifData.findKey(k1);
  678|    213|  if (pos != exifData.end()) {
  ------------------
  |  Branch (678:7): [True: 16, False: 197]
  ------------------
  679|     16|    if (pos->count() == 0)
  ------------------
  |  Branch (679:9): [True: 0, False: 16]
  ------------------
  680|      0|      return nullptr;
  681|     16|    if (pos->toInt64() == 6)
  ------------------
  |  Branch (681:9): [True: 16, False: 0]
  ------------------
  682|     16|      return std::make_unique<JpegThumbnail>();
  683|      0|    return std::make_unique<TiffThumbnail>();
  684|     16|  }
  685|       |
  686|    197|  const Exiv2::ExifKey k2("Exif.Thumbnail.JPEGInterchangeFormat");
  687|    197|  pos = exifData.findKey(k2);
  688|    197|  if (pos != exifData.end())
  ------------------
  |  Branch (688:7): [True: 0, False: 197]
  ------------------
  689|      0|    return std::make_unique<JpegThumbnail>();
  690|    197|  return nullptr;
  691|    197|}
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailC2Ev:
   67|     16|  Thumbnail() = default;
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailD2Ev:
   69|     16|  virtual ~Thumbnail() = default;
exif.cpp:_ZNK12_GLOBAL__N_113JpegThumbnail4copyERKN5Exiv28ExifDataE:
  726|     16|Exiv2::DataBuf JpegThumbnail::copy(const Exiv2::ExifData& exifData) const {
  727|     16|  Exiv2::ExifKey key("Exif.Thumbnail.JPEGInterchangeFormat");
  728|     16|  auto format = exifData.findKey(key);
  729|     16|  if (format == exifData.end())
  ------------------
  |  Branch (729:7): [True: 0, False: 16]
  ------------------
  730|      0|    return {};
  731|     16|  return format->dataArea();
  732|     16|}
exif.cpp:_ZN12_GLOBAL__N_19sumToLongERKN5Exiv29ExifdatumE:
  734|  1.37k|int64_t sumToLong(const Exiv2::Exifdatum& md) {
  735|  1.37k|  int64_t sum = 0;
  736|  53.7k|  for (size_t i = 0; i < md.count(); ++i) {
  ------------------
  |  Branch (736:22): [True: 52.3k, False: 1.37k]
  ------------------
  737|  52.3k|    sum = Safe::add(sum, md.toInt64(i));
  738|  52.3k|  }
  739|  1.37k|  return sum;
  740|  1.37k|}
exif.cpp:_ZN12_GLOBAL__N_18eraseIfdERN5Exiv28ExifDataENS0_5IfdIdE:
  742|  70.9k|void eraseIfd(Exiv2::ExifData& ed, Exiv2::IfdId ifdId) {
  743|  70.9k|  ed.erase(std::remove_if(ed.begin(), ed.end(), Exiv2::FindExifdatum(ifdId)), ed.end());
  744|  70.9k|}
_ZN5Exiv28setValueItEERNS_9ExifdatumES2_RKT_:
  150|     73|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|     73|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|     73|  v->value_.push_back(value);
  153|     73|  exifDatum.value_ = std::move(v);
  154|     73|  return exifDatum;
  155|     73|}
_ZN5Exiv28setValueIjEERNS_9ExifdatumES2_RKT_:
  150|  4.69k|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|  4.69k|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|  4.69k|  v->value_.push_back(value);
  153|  4.69k|  exifDatum.value_ = std::move(v);
  154|  4.69k|  return exifDatum;
  155|  4.69k|}

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

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

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

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

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  86.6k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  86.6k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 29.2k, False: 57.3k]
  ------------------
   58|  29.2k|    value_ = pValue->clone();
   59|  86.6k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   326k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   326k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 326k, False: 0]
  ------------------
   63|   326k|    key_ = rhs.key_->clone();  // deep copy
   64|   326k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 326k, False: 0]
  ------------------
   65|   326k|    value_ = rhs.value_->clone();  // deep copy
   66|   326k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   413k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|   107k|std::string Iptcdatum::key() const {
   79|   107k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 107k, False: 0]
  ------------------
   80|   107k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   556k|uint16_t Iptcdatum::record() const {
   87|   556k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 556k, False: 0]
  ------------------
   88|   556k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|  1.47M|uint16_t Iptcdatum::tag() const {
  111|  1.47M|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 1.47M, False: 0]
  ------------------
  112|  1.47M|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|  75.3k|size_t Iptcdatum::size() const {
  131|  75.3k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 75.3k, False: 0]
  ------------------
  132|  75.3k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  55.5k|std::string Iptcdatum::toString() const {
  135|  55.5k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 55.5k, False: 0]
  ------------------
  136|  55.5k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  93.2k|const Value& Iptcdatum::value() const {
  159|  93.2k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 93.2k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  93.2k|  return *value_;
  162|  93.2k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|   114k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|   114k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 114k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|   114k|  key_.reset();
  169|   114k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 114k, False: 0]
  ------------------
  170|   114k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|   114k|  value_.reset();
  173|   114k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 114k, False: 0]
  ------------------
  174|   114k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|   114k|  return *this;
  177|   114k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.64k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.64k|  setValue(value);
  188|  1.64k|  return *this;
  189|  1.64k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  57.5k|int Iptcdatum::setValue(const std::string& value) {
  203|  57.5k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 57.3k, False: 253]
  ------------------
  204|  57.3k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  57.3k|    value_ = Value::create(type);
  206|  57.3k|  }
  207|  57.5k|  return value_->read(value);
  208|  57.5k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.64k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.64k|  IptcKey iptcKey(key);
  212|  1.64k|  auto pos = findKey(iptcKey);
  213|  1.64k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.38k, False: 253]
  ------------------
  214|  1.38k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.38k|  }
  216|    253|  return *pos;
  217|  1.64k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|  1.36k|size_t IptcData::size() const {
  220|  1.36k|  size_t newSize = 0;
  221|  37.6k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 37.6k, False: 1.36k]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  37.6k|    newSize += 5;
  224|  37.6k|    size_t dataSize = iptc.size();
  225|  37.6k|    newSize += dataSize;
  226|  37.6k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 37.6k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  37.6k|  }
  231|  1.36k|  return newSize;
  232|  1.36k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  29.2k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  29.2k|  return add(Iptcdatum(key, value));
  236|  29.2k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  85.2k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  85.2k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 16.8k, False: 68.3k]
  |  Branch (239:7): [True: 13.1k, False: 72.0k]
  ------------------
  240|  16.8k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 13.1k, False: 3.67k]
  ------------------
  241|  13.1k|    return 6;
  242|  13.1k|  }
  243|       |  // allow duplicates
  244|  72.0k|  iptcMetadata_.push_back(iptcDatum);
  245|  72.0k|  return 0;
  246|  85.2k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  2.42k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  2.42k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  2.42k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  51.0k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  51.0k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  51.0k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  16.8k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  16.8k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  16.8k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  2.42k|const char* IptcData::detectCharset() const {
  305|  2.42k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  2.42k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 676, False: 1.75k]
  ------------------
  307|    676|    const std::string value = pos->toString();
  308|    676|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 676, False: 0]
  |  Branch (308:30): [True: 676, False: 0]
  ------------------
  309|    676|      return "UTF-8";
  310|    676|  }
  311|       |
  312|  1.75k|  bool ascii = true;
  313|  1.75k|  bool utf8 = true;
  314|       |
  315|  1.75k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 1.75k]
  ------------------
  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.75k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 1.75k, False: 0]
  ------------------
  356|  1.75k|    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.53k|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.53k|  auto pRead = pData;
  367|  2.53k|  const auto pEnd = pData + size;
  368|  2.53k|  iptcData.clear();
  369|       |
  370|  2.53k|  uint16_t record = 0;
  371|  2.53k|  uint16_t dataSet = 0;
  372|  2.53k|  uint32_t sizeData = 0;
  373|  2.53k|  byte extTest = 0;
  374|       |
  375|   987k|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 986k, False: 1.77k]
  ------------------
  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|   986k|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 956k, False: 30.0k]
  ------------------
  380|   956k|      continue;
  381|  30.0k|    record = *pRead++;
  382|  30.0k|    dataSet = *pRead++;
  383|       |
  384|  30.0k|    extTest = *pRead;
  385|  30.0k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 894, False: 29.1k]
  ------------------
  386|       |      // extended dataset
  387|    894|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|    894|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 182, False: 712]
  ------------------
  389|    182|        return 5;
  390|    712|      pRead += 2;
  391|    712|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 6, False: 706]
  ------------------
  392|      6|        return 6;
  393|    706|      sizeData = 0;
  394|  1.29k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 593, False: 706]
  ------------------
  395|    593|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|    593|      }
  397|  29.1k|    } else {
  398|       |      // standard dataset
  399|  29.1k|      sizeData = getUShort(pRead, bigEndian);
  400|  29.1k|      pRead += 2;
  401|  29.1k|    }
  402|  29.9k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 29.3k, False: 573]
  ------------------
  403|  29.3k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  29.3k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 29.3k]
  ------------------
  405|      0|#ifndef SUPPRESS_WARNINGS
  406|      0|        EXV_WARNING << "Failed to read IPTC dataset " << IptcKey(dataSet, record) << " (rc = " << rc << "); skipped.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  407|      0|#endif
  408|      0|      }
  409|  29.3k|    } else {
  410|    573|#ifndef SUPPRESS_WARNINGS
  411|    573|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    573|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 573]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    573|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    573|#endif
  413|    573|      return 7;
  414|    573|    }
  415|  29.3k|    pRead += sizeData;
  416|  29.3k|  }
  417|       |
  418|  1.77k|  return 0;
  419|  2.53k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  22.6k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  22.6k|  DataBuf buf;
  423|  22.6k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 21.2k, False: 1.36k]
  ------------------
  424|  21.2k|    return buf;
  425|       |
  426|  1.36k|  buf = DataBuf(iptcData.size());
  427|  1.36k|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|  1.36k|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|  1.36k|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|  1.36k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  37.6k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 37.6k, False: 1.36k]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  37.6k|    *pWrite++ = marker_;
  437|  37.6k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  37.6k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  37.6k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 37.6k]
  ------------------
  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|  37.6k|    } else {
  449|  37.6k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  37.6k|      pWrite += 2;
  451|  37.6k|    }
  452|  37.6k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  37.6k|  }
  454|       |
  455|  1.36k|  return buf;
  456|  22.6k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|  1.27M|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|  1.27M|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 19.2k, False: 1.25M]
  |  Branch (42:43): [True: 14.6k, False: 4.64k]
  ------------------
   43|  1.27M|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  70.3k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  70.3k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  29.3k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  29.3k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  29.3k|  auto value = Exiv2::Value::create(type);
  466|  29.3k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  29.3k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 18.7k, False: 10.5k]
  ------------------
  468|  18.7k|    Exiv2::IptcKey key(dataSet, record);
  469|  18.7k|    iptcData.add(key, value.get());
  470|  18.7k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 10.5k, False: 51]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  10.5k|    value = Exiv2::Value::create(Exiv2::string);
  473|  10.5k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  10.5k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 10.5k, False: 0]
  ------------------
  475|  10.5k|      Exiv2::IptcKey key(dataSet, record);
  476|  10.5k|      iptcData.add(key, value.get());
  477|  10.5k|    }
  478|  10.5k|  }
  479|  29.3k|  return rc;
  480|  29.3k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|   170k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

_ZN5Exiv28Jp2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  100|  1.48k|Jp2Image::Jp2Image(BasicIo::UniquePtr io, bool create) : Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io)) {
  101|  1.48k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (101:7): [True: 0, False: 1.48k]
  |  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.48k|}
_ZN5Exiv28Jp2Image12readMetadataEv:
  134|  1.47k|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.47k|  if (io_->open() != 0) {
  ------------------
  |  Branch (138:7): [True: 0, False: 1.47k]
  ------------------
  139|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  140|      0|  }
  141|  1.47k|  IoCloser closer(*io_);
  142|  1.47k|  if (!isJp2Type(*io_, false)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 1.47k]
  ------------------
  143|      0|    throw Error(ErrorCode::kerNotAnImage, "JPEG-2000");
  144|      0|  }
  145|       |
  146|  1.47k|  Internal::Jp2BoxHeader box = {0, 0};
  147|  1.47k|  Internal::Jp2BoxHeader subBox = {0, 0};
  148|  1.47k|  Internal::Jp2ImageHeaderBox ihdr = {0, 0, 0, 0, 0, 0, 0};
  149|  1.47k|  Internal::Jp2UuidBox uuid = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  150|  1.47k|  size_t boxesCount = 0;
  151|  1.47k|  const size_t boxem = 1000;  // boxes max
  152|  1.47k|  uint32_t lastBoxTypeRead = 0;
  153|  1.47k|  bool boxSignatureFound = false;
  154|  1.47k|  bool boxFileTypeFound = false;
  155|       |
  156|  21.6k|  while (io_->read(reinterpret_cast<byte*>(&box), boxHSize) == boxHSize) {
  ------------------
  |  Branch (156:10): [True: 21.1k, False: 443]
  ------------------
  157|  21.1k|    boxes_check(boxesCount++, boxem);
  158|  21.1k|    const size_t position = io_->tell();
  159|  21.1k|    box.length = getULong(reinterpret_cast<byte*>(&box.length), bigEndian);
  160|  21.1k|    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|  21.1k|    Internal::enforce(box.length <= boxHSize + io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  166|       |
  167|  21.1k|    if (box.length == 0)
  ------------------
  |  Branch (167:9): [True: 400, False: 20.7k]
  ------------------
  168|    400|      return;
  169|       |
  170|  20.7k|    if (box.length == 1) {
  ------------------
  |  Branch (170:9): [True: 19, False: 20.7k]
  ------------------
  171|       |      /// \todo In this case, the real box size is given in XLBox (bytes 8-15)
  172|     19|    }
  173|       |
  174|  20.7k|    switch (box.type) {
  175|  1.49k|      case kJp2BoxType::Signature: {
  ------------------
  |  Branch (175:7): [True: 1.49k, False: 19.2k]
  ------------------
  176|  1.49k|        if (boxSignatureFound)  // Only one is allowed
  ------------------
  |  Branch (176:13): [True: 21, False: 1.47k]
  ------------------
  177|     21|          throw Error(ErrorCode::kerCorruptedMetadata);
  178|  1.47k|        boxSignatureFound = true;
  179|  1.47k|        break;
  180|  1.49k|      }
  181|    208|      case kJp2BoxType::FileTypeBox: {
  ------------------
  |  Branch (181:7): [True: 208, False: 20.5k]
  ------------------
  182|       |        // This box shall immediately follow the JPEG 2000 Signature box
  183|    208|        if (boxFileTypeFound || lastBoxTypeRead != kJp2BoxType::Signature) {  // Only one is allowed
  ------------------
  |  Branch (183:13): [True: 0, False: 208]
  |  Branch (183:33): [True: 27, False: 181]
  ------------------
  184|     27|          throw Error(ErrorCode::kerCorruptedMetadata);
  185|     27|        }
  186|    181|        boxFileTypeFound = true;
  187|    181|        Blob boxData(box.length - boxHSize);
  188|    181|        io_->readOrThrow(boxData.data(), boxData.size(), ErrorCode::kerCorruptedMetadata);
  189|    181|        if (!Internal::isValidBoxFileType(boxData))
  ------------------
  |  Branch (189:13): [True: 176, False: 5]
  ------------------
  190|    176|          throw Error(ErrorCode::kerCorruptedMetadata);
  191|      5|        brand_ = getULong(boxData.data(), bigEndian);
  192|      5|        break;
  193|    181|      }
  194|  5.93k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (194:7): [True: 5.93k, False: 14.8k]
  ------------------
  195|       |#ifdef EXIV2_DEBUG_MESSAGES
  196|       |        std::cout << "Exiv2::Jp2Image::readMetadata: JP2Header box found\n";
  197|       |#endif
  198|  5.93k|        size_t restore = io_->tell();
  199|       |
  200|   116k|        while (io_->read(reinterpret_cast<byte*>(&subBox), boxHSize) == boxHSize && subBox.length) {
  ------------------
  |  Branch (200:16): [True: 113k, False: 2.24k]
  |  Branch (200:85): [True: 110k, False: 3.56k]
  ------------------
  201|   110k|          boxes_check(boxesCount++, boxem);
  202|   110k|          subBox.length = getULong(reinterpret_cast<byte*>(&subBox.length), bigEndian);
  203|   110k|          subBox.type = getULong(reinterpret_cast<byte*>(&subBox.type), bigEndian);
  204|   110k|          if (subBox.length > io_->size()) {
  ------------------
  |  Branch (204:15): [True: 71, False: 110k]
  ------------------
  205|     71|            throw Error(ErrorCode::kerCorruptedMetadata);
  206|     71|          }
  207|       |#ifdef EXIV2_DEBUG_MESSAGES
  208|       |          std::cout << "Exiv2::Jp2Image::readMetadata: "
  209|       |                    << "subBox = " << toAscii(subBox.type) << " length = " << subBox.length << '\n';
  210|       |#endif
  211|   110k|          if (subBox.type == kJp2BoxType::ColorSpec && subBox.length != 15) {
  ------------------
  |  Branch (211:15): [True: 858, False: 109k]
  |  Branch (211:56): [True: 106, False: 752]
  ------------------
  212|       |#ifdef EXIV2_DEBUG_MESSAGES
  213|       |            std::cout << "Exiv2::Jp2Image::readMetadata: "
  214|       |                      << "Color data found" << '\n';
  215|       |#endif
  216|       |
  217|    106|            const size_t pad = 3;  // 3 padding bytes 2 0 0
  218|    106|            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|    106|            if (data_length > io_->size() - io_->tell()) {
  ------------------
  |  Branch (220:17): [True: 2, False: 104]
  ------------------
  221|      2|              throw Error(ErrorCode::kerCorruptedMetadata);
  222|      2|            }
  223|    104|            DataBuf data(data_length);
  224|    104|            io_->read(data.data(), data.size());
  225|    104|            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|    104|            if (iccLength > data.size() - pad) {
  ------------------
  |  Branch (228:17): [True: 21, False: 83]
  ------------------
  229|     21|              throw Error(ErrorCode::kerCorruptedMetadata);
  230|     21|            }
  231|     83|            DataBuf icc(iccLength);
  232|     83|            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|     83|            setIccProfile(std::move(icc));
  243|     83|          }
  244|       |
  245|   110k|          if (subBox.type == kJp2BoxType::ImageHeader) {
  ------------------
  |  Branch (245:15): [True: 97, False: 110k]
  ------------------
  246|     97|            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|     97|            ihdr.imageHeight = getULong(reinterpret_cast<byte*>(&ihdr.imageHeight), bigEndian);
  251|     97|            ihdr.imageWidth = getULong(reinterpret_cast<byte*>(&ihdr.imageWidth), bigEndian);
  252|     97|            ihdr.componentCount = getShort(reinterpret_cast<byte*>(&ihdr.componentCount), bigEndian);
  253|     97|            Internal::enforce(ihdr.c == 7, ErrorCode::kerCorruptedMetadata);
  254|       |
  255|     97|            pixelWidth_ = ihdr.imageWidth;
  256|     97|            pixelHeight_ = ihdr.imageHeight;
  257|     97|          }
  258|       |
  259|   110k|          io_->seek(restore, BasicIo::beg);
  260|   110k|          if (io_->seek(subBox.length, BasicIo::cur) != 0) {
  ------------------
  |  Branch (260:15): [True: 36, False: 110k]
  ------------------
  261|     36|            throw Error(ErrorCode::kerCorruptedMetadata);
  262|     36|          }
  263|   110k|          restore = io_->tell();
  264|   110k|        }
  265|  5.80k|        break;
  266|  5.93k|      }
  267|       |
  268|  5.80k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (268:7): [True: 4.02k, False: 16.7k]
  ------------------
  269|       |#ifdef EXIV2_DEBUG_MESSAGES
  270|       |        std::cout << "Exiv2::Jp2Image::readMetadata: UUID box found" << '\n';
  271|       |#endif
  272|       |
  273|  4.02k|        if (io_->read(reinterpret_cast<byte*>(&uuid), sizeof(uuid)) == sizeof(uuid)) {
  ------------------
  |  Branch (273:13): [True: 4.02k, False: 1]
  ------------------
  274|  4.02k|          DataBuf rawData;
  275|  4.02k|          size_t bufRead;
  276|  4.02k|          bool bIsExif = uuid.uuid == kJp2UuidExif;
  277|  4.02k|          bool bIsIPTC = uuid.uuid == kJp2UuidIptc;
  278|  4.02k|          bool bIsXMP = uuid.uuid == kJp2UuidXmp;
  279|       |
  280|  4.02k|          if (bIsExif) {
  ------------------
  |  Branch (280:15): [True: 1.01k, False: 3.00k]
  ------------------
  281|       |#ifdef EXIV2_DEBUG_MESSAGES
  282|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Exif data found" << '\n';
  283|       |#endif
  284|  1.01k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  285|  1.01k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  286|  1.01k|            bufRead = io_->read(rawData.data(), rawData.size());
  287|  1.01k|            if (io_->error())
  ------------------
  |  Branch (287:17): [True: 0, False: 1.01k]
  ------------------
  288|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  289|  1.01k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (289:17): [True: 0, False: 1.01k]
  ------------------
  290|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  291|       |
  292|  1.01k|            if (rawData.size() > 8)  // "II*\0long"
  ------------------
  |  Branch (292:17): [True: 923, False: 96]
  ------------------
  293|    923|            {
  294|       |              // Find the position of Exif header in bytes array.
  295|    923|              const char a = rawData.read_uint8(0);
  296|    923|              const char b = rawData.read_uint8(1);
  297|    923|              const size_t notfound = std::numeric_limits<size_t>::max();
  298|    923|              size_t pos = (a == b && (a == 'I' || a == 'M')) ? 0 : notfound;
  ------------------
  |  Branch (298:29): [True: 880, False: 43]
  |  Branch (298:40): [True: 22, False: 858]
  |  Branch (298:52): [True: 437, False: 421]
  ------------------
  299|       |
  300|       |              // #1242  Forgive having Exif\0\0 in rawData.pData_
  301|    923|              std::array<byte, 6> exifHeader{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  302|  51.5k|              for (size_t i = 0; pos == notfound && i < (rawData.size() - exifHeader.size()); i++) {
  ------------------
  |  Branch (302:34): [True: 50.6k, False: 874]
  |  Branch (302:53): [True: 50.5k, False: 49]
  ------------------
  303|  50.5k|                if (rawData.cmpBytes(i, exifHeader.data(), exifHeader.size()) == 0) {
  ------------------
  |  Branch (303:21): [True: 415, False: 50.1k]
  ------------------
  304|    415|                  pos = i + sizeof(exifHeader);
  305|    415|#ifndef SUPPRESS_WARNINGS
  306|    415|                  EXV_WARNING << "Reading non-standard UUID-EXIF_bad box in " << io_->path() << '\n';
  ------------------
  |  |  138|    415|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 415]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    415|  LogMsg(LogMsg::warn).os()
  ------------------
  307|    415|#endif
  308|    415|                }
  309|  50.5k|              }
  310|       |
  311|       |              // If found it, store only these data at from this place.
  312|    923|              if (pos != notfound) {
  ------------------
  |  Branch (312:19): [True: 874, False: 49]
  ------------------
  313|       |#ifdef EXIV2_DEBUG_MESSAGES
  314|       |                std::cout << "Exiv2::Jp2Image::readMetadata: Exif header found at position " << pos << '\n';
  315|       |#endif
  316|    874|                ByteOrder bo =
  317|    874|                    TiffParser::decode(exifData(), iptcData(), xmpData(), rawData.c_data(pos), rawData.size() - pos);
  318|    874|                setByteOrder(bo);
  319|    874|              }
  320|    923|            } else {
  321|     96|#ifndef SUPPRESS_WARNINGS
  322|     96|              EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|     96|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 96]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     96|  LogMsg(LogMsg::warn).os()
  ------------------
  323|     96|#endif
  324|     96|              exifData_.clear();
  325|     96|            }
  326|  1.01k|          }
  327|       |
  328|  4.02k|          if (bIsIPTC) {
  ------------------
  |  Branch (328:15): [True: 1.52k, False: 2.50k]
  ------------------
  329|       |#ifdef EXIV2_DEBUG_MESSAGES
  330|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Iptc data found" << '\n';
  331|       |#endif
  332|  1.52k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  333|  1.52k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  334|  1.52k|            bufRead = io_->read(rawData.data(), rawData.size());
  335|  1.52k|            if (io_->error())
  ------------------
  |  Branch (335:17): [True: 0, False: 1.52k]
  ------------------
  336|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  337|  1.52k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (337:17): [True: 0, False: 1.52k]
  ------------------
  338|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  339|       |
  340|  1.52k|            if (IptcParser::decode(iptcData_, rawData.c_data(), rawData.size())) {
  ------------------
  |  Branch (340:17): [True: 406, False: 1.11k]
  ------------------
  341|    406|#ifndef SUPPRESS_WARNINGS
  342|    406|              EXV_WARNING << "Failed to decode IPTC metadata." << '\n';
  ------------------
  |  |  138|    406|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 406]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    406|  LogMsg(LogMsg::warn).os()
  ------------------
  343|    406|#endif
  344|    406|              iptcData_.clear();
  345|    406|            }
  346|  1.52k|          }
  347|       |
  348|  4.02k|          if (bIsXMP) {
  ------------------
  |  Branch (348:15): [True: 956, False: 3.07k]
  ------------------
  349|       |#ifdef EXIV2_DEBUG_MESSAGES
  350|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Xmp data found" << '\n';
  351|       |#endif
  352|    956|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  353|    956|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  354|    956|            bufRead = io_->read(rawData.data(), rawData.size());
  355|    956|            if (io_->error())
  ------------------
  |  Branch (355:17): [True: 0, False: 956]
  ------------------
  356|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  357|    956|            if (bufRead != rawData.size())
  ------------------
  |  Branch (357:17): [True: 0, False: 956]
  ------------------
  358|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  359|    956|            xmpPacket_.assign(rawData.c_str(), rawData.size());
  360|       |
  361|    956|            if (auto idx = xmpPacket_.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (361:59): [True: 136, False: 820]
  |  Branch (361:87): [True: 125, False: 11]
  ------------------
  362|    125|#ifndef SUPPRESS_WARNINGS
  363|    125|              EXV_WARNING << "Removing " << static_cast<uint32_t>(idx)
  ------------------
  |  |  138|    125|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 125]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    125|  LogMsg(LogMsg::warn).os()
  ------------------
  364|      0|                          << " characters from the beginning of the XMP packet" << '\n';
  365|    125|#endif
  366|    125|              xmpPacket_ = xmpPacket_.substr(idx);
  367|    125|            }
  368|       |
  369|    956|            if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (369:17): [True: 184, False: 772]
  |  Branch (369:40): [True: 178, False: 6]
  ------------------
  370|    178|#ifndef SUPPRESS_WARNINGS
  371|    178|              EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|    178|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 178]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    178|  LogMsg(LogMsg::warn).os()
  ------------------
  372|    178|#endif
  373|    178|            }
  374|    956|          }
  375|  4.02k|        }
  376|  4.02k|        break;
  377|  4.02k|      }
  378|       |
  379|  8.90k|      default:
  ------------------
  |  Branch (379:7): [True: 8.90k, False: 11.8k]
  ------------------
  380|  8.90k|        break;
  381|  20.7k|    }
  382|  20.1k|    lastBoxTypeRead = box.type;
  383|       |
  384|       |    // Move to the next box.
  385|  20.1k|    io_->seek(static_cast<int64_t>(position - boxHSize + box.length), BasicIo::beg);
  386|  20.1k|    if (io_->error())
  ------------------
  |  Branch (386:9): [True: 0, False: 20.1k]
  ------------------
  387|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  388|  20.1k|  }
  389|       |
  390|  1.47k|}  // Jp2Image::readMetadata
_ZN5Exiv28Jp2Image13writeMetadataEv:
  583|    794|void Jp2Image::writeMetadata() {
  584|    794|  if (io_->open() != 0) {
  ------------------
  |  Branch (584:7): [True: 0, False: 794]
  ------------------
  585|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  586|      0|  }
  587|    794|  IoCloser closer(*io_);
  588|    794|  MemIo tempIo;
  589|       |
  590|    794|  doWriteMetadata(tempIo);  // may throw
  591|    794|  io_->close();
  592|    794|  io_->transfer(tempIo);  // may throw
  593|       |
  594|    794|}  // Jp2Image::writeMetadata
_ZN5Exiv28Jp2Image15encodeJp2HeaderERKNS_7DataBufERS1_:
  596|  5.67k|void Jp2Image::encodeJp2Header(const DataBuf& boxBuf, DataBuf& outBuf) {
  597|  5.67k|  DataBuf output(boxBuf.size() + iccProfile_.size() + 100);  // allocate sufficient space
  598|  5.67k|  size_t outlen = boxHSize;                                  // now many bytes have we written to output?
  599|  5.67k|  size_t inlen = boxHSize;                                   // how many bytes have we read from boxBuf?
  600|  5.67k|  Internal::enforce(boxHSize <= output.size(), ErrorCode::kerCorruptedMetadata);
  601|  5.67k|  uint32_t length = getULong(boxBuf.c_data(0), bigEndian);
  602|  5.67k|  Internal::enforce(length <= output.size(), ErrorCode::kerCorruptedMetadata);
  603|  5.67k|  uint32_t count = boxHSize;
  604|  5.67k|  bool bWroteColor = false;
  605|       |
  606|  6.03k|  while (count < length && !bWroteColor) {
  ------------------
  |  Branch (606:10): [True: 381, False: 5.65k]
  |  Branch (606:28): [True: 366, False: 15]
  ------------------
  607|    366|    Internal::enforce(boxHSize <= length - count, ErrorCode::kerCorruptedMetadata);
  608|    366|    Internal::Jp2BoxHeader subBox;
  609|    366|    std::memcpy(&subBox, boxBuf.c_data(count), boxHSize);
  610|    366|    Internal::Jp2BoxHeader newBox = subBox;
  611|       |
  612|    366|    if (count < length) {
  ------------------
  |  Branch (612:9): [True: 361, False: 5]
  ------------------
  613|    361|      subBox.length = getULong(boxBuf.c_data(count), bigEndian);
  614|    361|      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|    361|      Internal::enforce(subBox.length > 0, ErrorCode::kerCorruptedMetadata);
  620|    361|      Internal::enforce(subBox.length <= length - count, ErrorCode::kerCorruptedMetadata);
  621|    361|      count += subBox.length;
  622|    361|      newBox.type = subBox.type;
  623|    361|    } else {
  624|      5|      subBox.length = 0;
  625|      5|      newBox.type = kJp2BoxType::ColorSpec;
  626|      5|      count = length;
  627|      5|    }
  628|       |
  629|    366|    size_t newlen = subBox.length;
  630|    366|    if (newBox.type == kJp2BoxType::ColorSpec) {
  ------------------
  |  Branch (630:9): [True: 15, False: 351]
  ------------------
  631|     15|      bWroteColor = true;
  632|     15|      if (!iccProfileDefined()) {
  ------------------
  |  Branch (632:11): [True: 4, False: 11]
  ------------------
  633|      4|        const char* pad = "\x01\x00\x00\x00\x00\x00\x10\x00\x00\x05\x1cuuid";
  634|      4|        uint32_t psize = 15;
  635|      4|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  636|      4|        ul2Data(reinterpret_cast<byte*>(&newBox.length), psize, bigEndian);
  637|      4|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  638|      4|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  639|      4|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  640|     11|      } else {
  641|     11|        const char* pad = "\x02\x00\x00";
  642|     11|        uint32_t psize = 3;
  643|     11|        newlen = sizeof(newBox) + psize + iccProfile_.size();
  644|     11|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  645|     11|        ul2Data(reinterpret_cast<byte*>(&newBox.length), static_cast<uint32_t>(newlen), bigEndian);
  646|     11|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  647|     11|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  648|     11|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  649|     11|        std::copy(iccProfile_.begin(), iccProfile_.end(), output.begin() + outlen + sizeof(newBox) + psize);
  650|     11|      }
  651|    351|    } else {
  652|    351|      Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  653|    351|      std::copy_n(boxBuf.begin() + inlen, subBox.length, output.begin() + outlen);
  654|    351|    }
  655|       |
  656|    366|    outlen += newlen;
  657|    366|    inlen += subBox.length;
  658|    366|  }
  659|       |
  660|       |  // allocate the correct number of bytes, copy the data and update the box header
  661|  5.67k|  outBuf.alloc(outlen);
  662|  5.67k|  std::copy_n(output.begin(), outlen, outBuf.begin());
  663|  5.67k|  ul2Data(outBuf.data(0), static_cast<uint32_t>(outlen), bigEndian);
  664|  5.67k|  ul2Data(outBuf.data(4), kJp2BoxType::Header, bigEndian);
  665|  5.67k|}
_ZN5Exiv28Jp2Image15doWriteMetadataERNS_7BasicIoE:
  667|    794|void Jp2Image::doWriteMetadata(BasicIo& outIo) {
  668|    794|  if (!io_->isopen())
  ------------------
  |  Branch (668:7): [True: 0, False: 794]
  ------------------
  669|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  670|    794|  if (!outIo.isopen())
  ------------------
  |  Branch (670:7): [True: 0, False: 794]
  ------------------
  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|    794|  if (!isJp2Type(*io_, true)) {
  ------------------
  |  Branch (679:7): [True: 0, False: 794]
  ------------------
  680|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  681|      0|  }
  682|       |
  683|       |  // Write JPEG2000 Signature (This is the 1st box)
  684|    794|  if (outIo.write(Jp2Signature.data(), Jp2Signature.size()) != 12)
  ------------------
  |  Branch (684:7): [True: 0, False: 794]
  ------------------
  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|    794|  Internal::Jp2BoxHeader box = {0, 0};
  692|       |
  693|    794|  std::array<byte, 4> boxDataSize;
  694|    794|  std::array<byte, 4> boxUUIDtype;
  695|    794|  DataBuf bheaderBuf(8);
  696|       |
  697|  16.8k|  while (io_->tell() < io_->size()) {
  ------------------
  |  Branch (697:10): [True: 16.4k, False: 475]
  ------------------
  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|  16.4k|    io_->readOrThrow(bheaderBuf.data(), bheaderBuf.size(), ErrorCode::kerInputDataReadFailed);
  704|       |
  705|       |    // Decode box header.
  706|  16.4k|    box.length = bheaderBuf.read_uint32(0, bigEndian);
  707|  16.4k|    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|  16.4k|    if (box.length == 0) {
  ------------------
  |  Branch (714:9): [True: 361, False: 16.0k]
  ------------------
  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|    361|      box.length = static_cast<uint32_t>(io_->size() - io_->tell() + 8);
  721|    361|    }
  722|  16.4k|    if (box.length < 8) {
  ------------------
  |  Branch (722:9): [True: 3, False: 16.4k]
  ------------------
  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|  16.4k|    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|  16.4k|    DataBuf boxBuf(box.length);                                       // Box header (8 bytes) + box data.
  732|  16.4k|    std::copy(bheaderBuf.begin(), bheaderBuf.end(), boxBuf.begin());  // Copy header.
  733|  16.4k|    io_->readOrThrow(boxBuf.data(8), box.length - 8, ErrorCode::kerInputDataReadFailed);  // Extract box data.
  734|       |
  735|  16.4k|    switch (box.type) {
  736|  5.67k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (736:7): [True: 5.67k, False: 10.7k]
  ------------------
  737|  5.67k|        DataBuf newBuf;
  738|  5.67k|        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.67k|        if (outIo.write(newBuf.data(), newBuf.size()) != newBuf.size())
  ------------------
  |  Branch (742:13): [True: 0, False: 5.67k]
  ------------------
  743|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  744|       |
  745|       |        // Write all updated metadata here, just after JP2Header.
  746|       |
  747|  5.67k|        if (!exifData_.empty()) {
  ------------------
  |  Branch (747:13): [True: 5.17k, False: 499]
  ------------------
  748|       |          // Update Exif data to a new UUID box
  749|       |
  750|  5.17k|          Blob blob;
  751|  5.17k|          ExifParser::encode(blob, littleEndian, exifData_);
  752|  5.17k|          if (!blob.empty()) {
  ------------------
  |  Branch (752:15): [True: 5.15k, False: 13]
  ------------------
  753|  5.15k|            DataBuf rawExif(blob.size());
  754|  5.15k|            std::copy(blob.begin(), blob.end(), rawExif.begin());
  755|       |
  756|  5.15k|            DataBuf boxData(8 + 16 + rawExif.size());
  757|  5.15k|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  758|  5.15k|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  759|  5.15k|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  760|  5.15k|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  761|  5.15k|            std::copy(kJp2UuidExif.begin(), kJp2UuidExif.end(), boxData.begin() + 8);
  762|  5.15k|            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|  5.15k|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (768:17): [True: 0, False: 5.15k]
  ------------------
  769|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  770|  5.15k|          }
  771|  5.17k|        }
  772|       |
  773|  5.67k|        if (!iptcData_.empty()) {
  ------------------
  |  Branch (773:13): [True: 486, False: 5.18k]
  ------------------
  774|       |          // Update Iptc data to a new UUID box
  775|       |
  776|    486|          DataBuf rawIptc = IptcParser::encode(iptcData_);
  777|    486|          if (!rawIptc.empty()) {
  ------------------
  |  Branch (777:15): [True: 486, False: 0]
  ------------------
  778|    486|            DataBuf boxData(8 + 16 + rawIptc.size());
  779|    486|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  780|    486|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  781|    486|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  782|    486|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  783|    486|            std::copy(kJp2UuidIptc.begin(), kJp2UuidIptc.end(), boxData.begin() + 8);
  784|    486|            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|    486|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (790:17): [True: 0, False: 486]
  ------------------
  791|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  792|    486|          }
  793|    486|        }
  794|       |
  795|  5.67k|        if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (795:13): [True: 5.64k, False: 28]
  |  Branch (795:38): [True: 0, False: 5.64k]
  ------------------
  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.67k|        if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (800:13): [True: 205, False: 5.46k]
  ------------------
  801|       |          // Update Xmp data to a new UUID box
  802|       |
  803|    205|          DataBuf xmp(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size());
  804|    205|          DataBuf boxData(8 + 16 + xmp.size());
  805|    205|          ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  806|    205|          ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  807|    205|          std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  808|    205|          std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  809|    205|          std::copy(kJp2UuidXmp.begin(), kJp2UuidXmp.end(), boxData.begin() + 8);
  810|    205|          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|    205|          if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (816:15): [True: 0, False: 205]
  ------------------
  817|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  818|    205|        }
  819|       |
  820|  5.67k|        break;
  821|  5.67k|      }
  822|       |
  823|  5.67k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (823:7): [True: 1.71k, False: 14.6k]
  ------------------
  824|  1.71k|        Internal::enforce(boxBuf.size() >= 24, ErrorCode::kerCorruptedMetadata);
  825|  1.71k|        if (boxBuf.cmpBytes(8, kJp2UuidExif.data(), 16) == 0) {
  ------------------
  |  Branch (825:13): [True: 620, False: 1.09k]
  ------------------
  826|       |#ifdef EXIV2_DEBUG_MESSAGES
  827|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Exif Uuid box" << '\n';
  828|       |#endif
  829|  1.09k|        } else if (boxBuf.cmpBytes(8, kJp2UuidIptc.data(), 16) == 0) {
  ------------------
  |  Branch (829:20): [True: 373, False: 720]
  ------------------
  830|       |#ifdef EXIV2_DEBUG_MESSAGES
  831|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Iptc Uuid box" << '\n';
  832|       |#endif
  833|    720|        } else if (boxBuf.cmpBytes(8, kJp2UuidXmp.data(), 16) == 0) {
  ------------------
  |  Branch (833:20): [True: 458, False: 262]
  ------------------
  834|       |#ifdef EXIV2_DEBUG_MESSAGES
  835|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Xmp Uuid box" << '\n';
  836|       |#endif
  837|    458|        } else {
  838|       |#ifdef EXIV2_DEBUG_MESSAGES
  839|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: write Uuid box (length: " << box.length << ")" << '\n';
  840|       |#endif
  841|    262|          if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (841:15): [True: 0, False: 262]
  ------------------
  842|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  843|    262|        }
  844|  1.71k|        break;
  845|  1.71k|      }
  846|       |
  847|  8.73k|      default: {
  ------------------
  |  Branch (847:7): [True: 8.73k, False: 7.67k]
  ------------------
  848|       |#ifdef EXIV2_DEBUG_MESSAGES
  849|       |        std::cout << "Exiv2::Jp2Image::doWriteMetadata: write box (length: " << box.length << ")" << '\n';
  850|       |#endif
  851|  8.73k|        if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (851:13): [True: 0, False: 8.73k]
  ------------------
  852|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  853|       |
  854|  8.73k|        break;
  855|  8.73k|      }
  856|  16.4k|    }
  857|  16.4k|  }
  858|       |
  859|       |#ifdef EXIV2_DEBUG_MESSAGES
  860|       |  std::cout << "Exiv2::Jp2Image::doWriteMetadata: EOF" << '\n';
  861|       |#endif
  862|       |
  863|    794|}  // Jp2Image::doWriteMetadata
_ZN5Exiv214newJp2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  867|  1.48k|Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, bool create) {
  868|  1.48k|  auto image = std::make_unique<Jp2Image>(std::move(io), create);
  869|  1.48k|  if (!image->good()) {
  ------------------
  |  Branch (869:7): [True: 3, False: 1.47k]
  ------------------
  870|      3|    return nullptr;
  871|      3|  }
  872|  1.47k|  return image;
  873|  1.48k|}
_ZN5Exiv29isJp2TypeERNS_7BasicIoEb:
  875|  17.6k|bool isJp2Type(BasicIo& iIo, bool advance) {
  876|  17.6k|  std::array<byte, Jp2Signature.size()> buf;
  877|  17.6k|  const size_t bytesRead = iIo.read(buf.data(), Jp2Signature.size());
  878|  17.6k|  if (iIo.error() || iIo.eof() || bytesRead != Jp2Signature.size()) {
  ------------------
  |  Branch (878:7): [True: 0, False: 17.6k]
  |  Branch (878:22): [True: 357, False: 17.2k]
  |  Branch (878:35): [True: 0, False: 17.2k]
  ------------------
  879|    357|    return false;
  880|    357|  }
  881|  17.2k|  bool matched = buf == Jp2Signature;
  882|  17.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (882:7): [True: 16.4k, False: 794]
  |  Branch (882:19): [True: 0, False: 794]
  ------------------
  883|  16.4k|    iIo.seek(-static_cast<int64_t>(Jp2Signature.size()), BasicIo::cur);  // Return to original position
  884|  16.4k|  }
  885|  17.2k|  return matched;
  886|  17.6k|}
jp2image.cpp:_ZN5Exiv212_GLOBAL__N_111boxes_checkEmm:
   89|   131k|void boxes_check(size_t b, size_t m) {
   90|   131k|  if (b > m) {
  ------------------
  |  Branch (90:7): [True: 2, False: 131k]
  ------------------
   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|   131k|}

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    179|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|    179|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 21, False: 158]
  |  Branch (15:29): [True: 23, False: 135]
  ------------------
   16|     44|    return false;
   17|     44|  }
   18|       |
   19|    135|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    135|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    135|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    135|  bool clWithRightBrand = false;
   24|  1.21k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.08k, False: 126]
  ------------------
   25|  1.08k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.08k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 181, False: 904]
  |  Branch (26:31): [True: 6, False: 175]
  |  Branch (26:66): [True: 269, False: 810]
  |  Branch (26:87): [True: 3, False: 266]
  ------------------
   27|      9|      clWithRightBrand = true;
   28|      9|      break;
   29|      9|    }
   30|  1.08k|  }
   31|    135|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 15, False: 120]
  |  Branch (31:32): [True: 3, False: 12]
  ------------------
   32|    179|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEEbPKhm:
  116|  1.53k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
  117|  1.53k|  if (create) {
  ------------------
  |  Branch (117:7): [True: 0, False: 1.53k]
  ------------------
  118|      0|    initImage(initData, dataSize);
  119|      0|  }
  120|  1.53k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  133|  2.40M|byte JpegBase::advanceToMarker(ErrorCode err) const {
  134|  2.40M|  int c = -1;
  135|       |  // Skips potential padding between markers
  136|  5.20M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (136:10): [True: 2.79M, False: 2.40M]
  ------------------
  137|  2.79M|    if (c == EOF)
  ------------------
  |  Branch (137:9): [True: 984, False: 2.79M]
  ------------------
  138|    984|      throw Error(err);
  139|  2.79M|  }
  140|       |
  141|       |  // Markers can start with any number of 0xff
  142|  2.88M|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (142:10): [True: 477k, False: 2.40M]
  ------------------
  143|   477k|  }
  144|  2.40M|  if (c == EOF)
  ------------------
  |  Branch (144:7): [True: 95, False: 2.40M]
  ------------------
  145|     95|    throw Error(err);
  146|       |
  147|  2.40M|  return static_cast<byte>(c);
  148|  2.40M|}
_ZN5Exiv28JpegBase12readMetadataEv:
  150|  1.53k|void JpegBase::readMetadata() {
  151|  1.53k|  int rc = 0;  // Todo: this should be the return value
  152|       |
  153|  1.53k|  if (io_->open() != 0)
  ------------------
  |  Branch (153:7): [True: 0, False: 1.53k]
  ------------------
  154|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  155|  1.53k|  IoCloser closer(*io_);
  156|       |  // Ensure that this is the correct image type
  157|  1.53k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (157:7): [True: 73, False: 1.46k]
  ------------------
  158|     73|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (158:9): [True: 0, False: 73]
  |  Branch (158:25): [True: 0, False: 73]
  ------------------
  159|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  160|     73|    throw Error(ErrorCode::kerNotAJpeg);
  161|     73|  }
  162|  1.46k|  clearMetadata();
  163|  1.46k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  164|  1.46k|  Blob psBlob;
  165|  1.46k|  bool foundCompletePsData = false;
  166|  1.46k|  bool foundExifData = false;
  167|  1.46k|  bool foundXmpData = false;
  168|  1.46k|  bool foundIccData = false;
  169|       |
  170|       |  // Read section marker
  171|  1.46k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  172|       |
  173|   249k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (173:10): [True: 249k, False: 184]
  |  Branch (173:28): [True: 249k, False: 191]
  |  Branch (173:46): [True: 249k, False: 11]
  ------------------
  174|   249k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  175|       |
  176|       |    // Read the rest of the segment.
  177|   249k|    DataBuf buf(size);
  178|       |    // check if the segment is not empty
  179|   249k|    if (size > 2) {
  ------------------
  |  Branch (179:9): [True: 38.9k, False: 210k]
  ------------------
  180|  38.9k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  181|  38.9k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  182|  38.9k|    }
  183|       |
  184|   249k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (184:14): [True: 3.55k, False: 245k]
  ------------------
  185|  3.55k|      sof_encoding_process_ = itSofMarker->label_;
  186|  3.55k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (186:11): [True: 1.94k, False: 1.60k]
  |  Branch (186:24): [True: 1.53k, False: 411]
  ------------------
  187|  1.53k|        num_color_components_ = *buf.c_data(7);
  188|  1.53k|      }
  189|  3.55k|    }
  190|       |
  191|   249k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (191:9): [True: 236k, False: 12.9k]
  |  Branch (191:27): [True: 2.03k, False: 234k]
  |  Branch (191:46): [True: 1.70k, False: 326]
  ------------------
  192|  1.70k|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (192:12): [True: 109, False: 1.59k]
  ------------------
  193|    109|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8);
  194|    109|      setByteOrder(bo);
  195|    109|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (195:11): [True: 77, False: 32]
  |  Branch (195:23): [True: 0, False: 77]
  ------------------
  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|    109|      --search;
  202|    109|      foundExifData = true;
  203|   249k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (203:16): [True: 231k, False: 17.9k]
  |  Branch (203:33): [True: 1.82k, False: 229k]
  |  Branch (203:52): [True: 1.23k, False: 593]
  ------------------
  204|  1.23k|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (204:19): [True: 59, False: 1.17k]
  ------------------
  205|     59|      xmpPacket_.assign(buf.c_str(31), size - 31);
  206|     59|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (206:11): [True: 53, False: 6]
  |  Branch (206:34): [True: 36, False: 17]
  ------------------
  207|     36|#ifndef SUPPRESS_WARNINGS
  208|     36|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     36|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 36]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     36|  LogMsg(LogMsg::warn).os()
  ------------------
  209|     36|#endif
  210|     36|      }
  211|     59|      --search;
  212|     59|      foundXmpData = true;
  213|   249k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (213:16): [True: 248k, False: 1.10k]
  |  Branch (213:40): [True: 27.0k, False: 221k]
  ------------------
  214|  27.0k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (214:16): [True: 26.9k, False: 178]
  ------------------
  215|  26.9k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (215:19): [True: 14.9k, False: 12.0k]
  ------------------
  216|       |#ifdef EXIV2_DEBUG_MESSAGES
  217|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  218|       |#endif
  219|  14.9k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (219:11): [True: 12.3k, False: 2.50k]
  ------------------
  220|  12.3k|        append(psBlob, buf.c_data(16), size - 16);
  221|  12.3k|      }
  222|       |      // Check whether psBlob is complete
  223|  14.9k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (223:11): [True: 13.1k, False: 1.73k]
  |  Branch (223:30): [True: 122, False: 13.0k]
  ------------------
  224|    122|        --search;
  225|    122|        foundCompletePsData = true;
  226|    122|      }
  227|   234k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (227:16): [True: 684, False: 233k]
  |  Branch (227:34): [True: 257, False: 427]
  ------------------
  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|    257|      comment_.assign(buf.c_str(2), size - 2);
  232|  12.9k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (232:14): [True: 12.7k, False: 156]
  |  Branch (232:35): [True: 12.6k, False: 101]
  ------------------
  233|  12.6k|        comment_.pop_back();
  234|  12.6k|      }
  235|    257|      --search;
  236|   234k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (236:16): [True: 15.9k, False: 218k]
  |  Branch (236:35): [True: 5.37k, False: 10.6k]
  ------------------
  237|  5.37k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (237:19): [True: 4.59k, False: 777]
  ------------------
  238|  4.59k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (238:11): [True: 54, False: 4.54k]
  ------------------
  239|     54|        rc = 8;
  240|     54|        break;
  241|     54|      }
  242|       |      // ICC profile
  243|  4.54k|      if (!foundIccData) {
  ------------------
  |  Branch (243:11): [True: 205, False: 4.33k]
  ------------------
  244|    205|        foundIccData = true;
  245|    205|        --search;
  246|    205|      }
  247|  4.54k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  248|  4.54k|      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|  4.54k|      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|  4.54k|      size_t icc_size = size - 2 - 14;
  260|  4.54k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (260:11): [True: 602, False: 3.93k]
  |  Branch (260:25): [True: 136, False: 466]
  ------------------
  261|    136|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  262|    136|        icc_size = s;
  263|    136|      }
  264|       |
  265|  4.54k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  266|   229k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (266:16): [True: 159k, False: 70.4k]
  |  Branch (266:37): [True: 749, False: 158k]
  ------------------
  267|       |      // We hit a SOFn (start-of-frame) marker
  268|    749|      if (size < 8) {
  ------------------
  |  Branch (268:11): [True: 85, False: 664]
  ------------------
  269|     85|        rc = 7;
  270|     85|        break;
  271|     85|      }
  272|    664|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  273|    664|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  274|    664|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (274:11): [True: 170, False: 494]
  ------------------
  275|    170|        --search;
  276|    664|    }
  277|       |
  278|       |    // Read the beginning of the next segment
  279|   249k|    try {
  280|   249k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  281|   249k|    } catch (const Error&) {
  282|    581|      rc = 5;
  283|    581|      break;
  284|    581|    }
  285|   249k|  }  // while there are segments to process
  286|       |
  287|  1.10k|  if (!psBlob.empty()) {
  ------------------
  |  Branch (287:7): [True: 201, False: 905]
  ------------------
  288|       |    // Find actual IPTC data within the psBlob
  289|    201|    Blob iptcBlob;
  290|    201|    const byte* record = nullptr;
  291|    201|    uint32_t sizeIptc = 0;
  292|    201|    uint32_t sizeHdr = 0;
  293|    201|    const byte* pCur = psBlob.data();
  294|    201|    const byte* pEnd = pCur + psBlob.size();
  295|  10.6k|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (295:12): [True: 10.6k, False: 21]
  |  Branch (295:27): [True: 10.4k, False: 180]
  ------------------
  296|       |#ifdef EXIV2_DEBUG_MESSAGES
  297|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  298|       |#endif
  299|  10.4k|      if (sizeIptc) {
  ------------------
  |  Branch (299:11): [True: 708, False: 9.73k]
  ------------------
  300|    708|        append(iptcBlob, record + sizeHdr, sizeIptc);
  301|    708|      }
  302|  10.4k|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  303|  10.4k|    }
  304|    201|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (304:9): [True: 93, False: 108]
  |  Branch (304:30): [True: 31, False: 62]
  ------------------
  305|     31|#ifndef SUPPRESS_WARNINGS
  306|     31|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     31|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 31]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     31|  LogMsg(LogMsg::warn).os()
  ------------------
  307|     31|#endif
  308|     31|      iptcData_.clear();
  309|     31|    }
  310|    201|  }
  311|       |
  312|  1.10k|  if (rc != 0) {
  ------------------
  |  Branch (312:7): [True: 719, False: 387]
  ------------------
  313|    719|#ifndef SUPPRESS_WARNINGS
  314|    719|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    719|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 719]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    719|  LogMsg(LogMsg::warn).os()
  ------------------
  315|    719|#endif
  316|    719|  }
  317|  1.10k|}  // JpegBase::readMetadata
_ZN5Exiv28JpegBase13writeMetadataEv:
  575|    766|void JpegBase::writeMetadata() {
  576|    766|  if (io_->open() != 0) {
  ------------------
  |  Branch (576:7): [True: 0, False: 766]
  ------------------
  577|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  578|      0|  }
  579|    766|  IoCloser closer(*io_);
  580|    766|  MemIo tempIo;
  581|       |
  582|    766|  doWriteMetadata(tempIo);  // may throw
  583|    766|  io_->close();
  584|    766|  io_->transfer(tempIo);  // may throw
  585|    766|}
_ZN5Exiv28JpegBase15readNextSegmentEh:
  587|  2.15M|DataBuf JpegBase::readNextSegment(byte marker) {
  588|  2.15M|  const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  589|       |
  590|       |  // Read the rest of the segment if not empty.
  591|  2.15M|  DataBuf buf(size);
  592|  2.15M|  if (size > 0) {
  ------------------
  |  Branch (592:7): [True: 92.3k, False: 2.06M]
  ------------------
  593|  92.3k|    std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  594|  92.3k|    if (size > 2) {
  ------------------
  |  Branch (594:9): [True: 65.5k, False: 26.8k]
  ------------------
  595|  65.5k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  596|  65.5k|    }
  597|  92.3k|  }
  598|  2.15M|  return buf;
  599|  2.15M|}
_ZN5Exiv28JpegBase15doWriteMetadataERNS_7BasicIoE:
  601|    766|void JpegBase::doWriteMetadata(BasicIo& outIo) {
  602|    766|  if (!io_->isopen())
  ------------------
  |  Branch (602:7): [True: 0, False: 766]
  ------------------
  603|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  604|    766|  if (!outIo.isopen())
  ------------------
  |  Branch (604:7): [True: 0, False: 766]
  ------------------
  605|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  606|       |
  607|       |  // Ensure that this is the correct image type
  608|    766|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (608:7): [True: 0, False: 766]
  ------------------
  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|    766|  static const size_t notfound = std::numeric_limits<size_t>::max();
  616|       |
  617|    766|  const size_t seek = io_->tell();
  618|    766|  size_t count = 0;
  619|    766|  size_t search = 0;
  620|    766|  size_t insertPos = 0;
  621|    766|  size_t comPos = 0;
  622|    766|  size_t skipApp1Exif = notfound;
  623|    766|  size_t skipApp1Xmp = notfound;
  624|    766|  bool foundCompletePsData = false;
  625|    766|  bool foundIccData = false;
  626|    766|  std::vector<size_t> skipApp13Ps3;
  627|    766|  std::vector<size_t> skipApp2Icc;
  628|    766|  size_t skipCom = notfound;
  629|    766|  Blob psBlob;
  630|    766|  DataBuf rawExif;
  631|    766|  xmpData().usePacket(writeXmpFromPacket());
  632|       |
  633|       |  // Write image header
  634|    766|  if (writeHeader(outIo))
  ------------------
  |  Branch (634:7): [True: 0, False: 766]
  ------------------
  635|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  636|       |
  637|       |  // Read section marker
  638|    766|  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|  1.10M|  while (marker != sos_ && marker != eoi_ && search < 6) {
  ------------------
  |  Branch (643:10): [True: 1.10M, False: 583]
  |  Branch (643:28): [True: 1.10M, False: 172]
  |  Branch (643:46): [True: 1.10M, False: 11]
  ------------------
  644|  1.10M|    DataBuf buf = readNextSegment(marker);
  645|       |
  646|  1.10M|    if (marker == app0_) {
  ------------------
  |  Branch (646:9): [True: 216, False: 1.10M]
  ------------------
  647|    216|      insertPos = count + 1;
  648|  1.10M|    } else if (skipApp1Exif == notfound && marker == app1_ &&
  ------------------
  |  Branch (648:16): [True: 993k, False: 112k]
  |  Branch (648:44): [True: 2.68k, False: 990k]
  ------------------
  649|  2.68k|               buf.size() >= 8 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (649:16): [True: 1.73k, False: 954]
  ------------------
  650|  1.73k|               buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (650:16): [True: 93, False: 1.64k]
  ------------------
  651|     93|      skipApp1Exif = count;
  652|     93|      ++search;
  653|     93|      if (buf.size() > 8) {
  ------------------
  |  Branch (653:11): [True: 79, False: 14]
  ------------------
  654|     79|        rawExif.alloc(buf.size() - 8);
  655|     79|        std::copy_n(buf.begin() + 8, rawExif.size(), rawExif.begin());
  656|     79|      }
  657|  1.10M|    } else if (skipApp1Xmp == notfound && marker == app1_ &&
  ------------------
  |  Branch (657:16): [True: 1.08M, False: 25.9k]
  |  Branch (657:43): [True: 2.59k, False: 1.07M]
  ------------------
  658|  2.59k|               buf.size() >= 31 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (658:16): [True: 1.22k, False: 1.36k]
  ------------------
  659|  1.22k|               buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (659:16): [True: 51, False: 1.17k]
  ------------------
  660|     51|      skipApp1Xmp = count;
  661|     51|      ++search;
  662|  1.10M|    } else if (marker == app2_ && buf.size() >= 13 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (662:16): [True: 13.9k, False: 1.09M]
  |  Branch (662:35): [True: 4.83k, False: 9.13k]
  ------------------
  663|  4.83k|               buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (663:16): [True: 3.97k, False: 866]
  ------------------
  664|  3.97k|      skipApp2Icc.push_back(count);
  665|  3.97k|      if (!foundIccData) {
  ------------------
  |  Branch (665:11): [True: 91, False: 3.87k]
  ------------------
  666|     91|        ++search;
  667|     91|        foundIccData = true;
  668|     91|      }
  669|  1.10M|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (669:16): [True: 1.10M, False: 634]
  |  Branch (669:40): [True: 26.6k, False: 1.07M]
  ------------------
  670|  26.6k|               buf.size() >= 16 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (670:16): [True: 26.4k, False: 174]
  ------------------
  671|  26.4k|               buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (671:16): [True: 14.5k, False: 11.8k]
  ------------------
  672|       |#ifdef EXIV2_DEBUG_MESSAGES
  673|       |      std::cerr << "Found APP13 Photoshop PS3 segment\n";
  674|       |#endif
  675|  14.5k|      skipApp13Ps3.push_back(count);
  676|       |      // Append to psBlob
  677|  14.5k|      append(psBlob, buf.c_data(16), buf.size() - 16);
  678|       |      // Check whether psBlob is complete
  679|  14.5k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (679:11): [True: 12.8k, False: 1.75k]
  |  Branch (679:30): [True: 60, False: 12.7k]
  ------------------
  680|     60|        foundCompletePsData = true;
  681|     60|      }
  682|  1.08M|    } else if (marker == com_ && skipCom == notfound) {
  ------------------
  |  Branch (682:16): [True: 552, False: 1.08M]
  |  Branch (682:34): [True: 100, False: 452]
  ------------------
  683|       |      // Jpegs can have multiple comments, but for now only handle
  684|       |      // the first one (most jpegs only have one anyway).
  685|    100|      skipCom = count;
  686|    100|      ++search;
  687|    100|    }
  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|  1.10M|    if (comPos == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (694:9): [True: 149k, False: 956k]
  |  Branch (694:24): [True: 260, False: 149k]
  ------------------
  695|    260|      comPos = count;
  696|    260|      ++search;
  697|    260|    }
  698|  1.10M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  699|  1.10M|    ++count;
  700|  1.10M|  }
  701|       |
  702|    766|  if (!foundCompletePsData && !psBlob.empty())
  ------------------
  |  Branch (702:7): [True: 238, False: 528]
  |  Branch (702:31): [True: 12, False: 226]
  ------------------
  703|     12|    throw Error(ErrorCode::kerNoImageInInputData);
  704|    754|  search += skipApp13Ps3.size() + skipApp2Icc.size();
  705|       |
  706|    754|  if (comPos == 0) {
  ------------------
  |  Branch (706:7): [True: 232, False: 522]
  ------------------
  707|    232|    if (marker == eoi_)
  ------------------
  |  Branch (707:9): [True: 147, False: 85]
  ------------------
  708|    147|      comPos = count;
  709|     85|    else
  710|     85|      comPos = insertPos;
  711|    232|    ++search;
  712|    232|  }
  713|    754|  if (!exifData_.empty())
  ------------------
  |  Branch (713:7): [True: 54, False: 700]
  ------------------
  714|     54|    ++search;
  715|    754|  if (!writeXmpFromPacket() && !xmpData_.empty())
  ------------------
  |  Branch (715:7): [True: 273, False: 481]
  |  Branch (715:32): [True: 12, False: 261]
  ------------------
  716|     12|    ++search;
  717|    754|  if (writeXmpFromPacket() && !xmpPacket_.empty())
  ------------------
  |  Branch (717:7): [True: 0, False: 754]
  |  Branch (717:31): [True: 0, False: 0]
  ------------------
  718|      0|    ++search;
  719|    754|  if (foundCompletePsData || !iptcData_.empty())
  ------------------
  |  Branch (719:7): [True: 528, False: 226]
  |  Branch (719:30): [True: 0, False: 226]
  ------------------
  720|     47|    ++search;
  721|    754|  if (!comment_.empty())
  ------------------
  |  Branch (721:7): [True: 23, False: 731]
  ------------------
  722|     23|    ++search;
  723|       |
  724|    754|  io_->seekOrThrow(seek, BasicIo::beg, ErrorCode::kerNoImageInInputData);
  725|    754|  count = 0;
  726|    754|  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|  1.05M|  while (marker != sos_ && search > 0) {
  ------------------
  |  Branch (732:10): [True: 1.05M, False: 546]
  |  Branch (732:28): [True: 1.05M, False: 55]
  ------------------
  733|  1.05M|    DataBuf buf = readNextSegment(marker);
  734|       |
  735|  1.05M|    if (insertPos == count) {
  ------------------
  |  Branch (735:9): [True: 269, False: 1.05M]
  ------------------
  736|       |      // Write Exif data first so that - if there is no app0 - we
  737|       |      // create "Exif images" according to the Exif standard.
  738|    269|      if (!exifData_.empty()) {
  ------------------
  |  Branch (738:11): [True: 54, False: 215]
  ------------------
  739|     54|        Blob blob;
  740|     54|        ByteOrder bo = byteOrder();
  741|     54|        if (bo == invalidByteOrder) {
  ------------------
  |  Branch (741:13): [True: 0, False: 54]
  ------------------
  742|      0|          bo = littleEndian;
  743|      0|          setByteOrder(bo);
  744|      0|        }
  745|     54|        const byte* pExifData = rawExif.c_data();
  746|     54|        size_t exifSize = rawExif.size();
  747|     54|        if (ExifParser::encode(blob, pExifData, exifSize, bo, exifData_) == wmIntrusive) {
  ------------------
  |  Branch (747:13): [True: 39, False: 15]
  ------------------
  748|     39|          pExifData = !blob.empty() ? blob.data() : nullptr;
  ------------------
  |  Branch (748:23): [True: 38, False: 1]
  ------------------
  749|     39|          exifSize = blob.size();
  750|     39|        }
  751|     54|        if (exifSize > 0) {
  ------------------
  |  Branch (751:13): [True: 50, False: 4]
  ------------------
  752|     50|          std::array<byte, 10> tmpBuf;
  753|       |          // Write APP1 marker, size of APP1 field, Exif id and Exif data
  754|     50|          tmpBuf[0] = 0xff;
  755|     50|          tmpBuf[1] = app1_;
  756|       |
  757|     50|          if (exifSize > 0xffff - 8)
  ------------------
  |  Branch (757:15): [True: 8, False: 42]
  ------------------
  758|      8|            throw Error(ErrorCode::kerTooLargeJpegSegment, "Exif");
  759|     42|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(exifSize + 8), bigEndian);
  760|     42|          std::copy(exifId_.begin(), exifId_.end(), tmpBuf.begin() + 4);
  761|     42|          if (outIo.write(tmpBuf.data(), 10) != 10)
  ------------------
  |  Branch (761:15): [True: 0, False: 42]
  ------------------
  762|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  763|       |
  764|       |          // Write new Exif data buffer
  765|     42|          if (outIo.write(pExifData, exifSize) != exifSize)
  ------------------
  |  Branch (765:15): [True: 0, False: 42]
  ------------------
  766|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  767|     42|          if (outIo.error())
  ------------------
  |  Branch (767:15): [True: 0, False: 42]
  ------------------
  768|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  769|     42|          --search;
  770|     42|        }
  771|     54|      }
  772|    261|      if (!writeXmpFromPacket() &&
  ------------------
  |  Branch (772:11): [True: 258, False: 3]
  ------------------
  773|    258|          XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {
  ------------------
  |  Branch (773:11): [True: 0, False: 258]
  ------------------
  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|    261|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (778:11): [True: 12, False: 249]
  ------------------
  779|     12|        std::array<byte, 33> tmpBuf;
  780|       |        // Write APP1 marker, size of APP1 field, XMP id and XMP packet
  781|     12|        tmpBuf[0] = 0xff;
  782|     12|        tmpBuf[1] = app1_;
  783|       |
  784|     12|        if (xmpPacket_.size() > 0xffff - 31)
  ------------------
  |  Branch (784:13): [True: 0, False: 12]
  ------------------
  785|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "XMP");
  786|     12|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(xmpPacket_.size() + 31), bigEndian);
  787|     12|        std::copy(xmpId_.begin(), xmpId_.end(), tmpBuf.begin() + 4);
  788|     12|        if (outIo.write(tmpBuf.data(), 33) != 33)
  ------------------
  |  Branch (788:13): [True: 0, False: 12]
  ------------------
  789|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  790|       |
  791|       |        // Write new XMP packet
  792|     12|        if (outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (792:13): [True: 0, False: 12]
  ------------------
  793|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  794|     12|        if (outIo.error())
  ------------------
  |  Branch (794:13): [True: 0, False: 12]
  ------------------
  795|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  796|     12|        --search;
  797|     12|      }
  798|       |
  799|    261|      if (iccProfileDefined()) {
  ------------------
  |  Branch (799:11): [True: 26, False: 235]
  ------------------
  800|     26|        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|     26|        tmpBuf[0] = 0xff;
  804|     26|        tmpBuf[1] = app2_;
  805|       |
  806|     26|        const size_t chunk_size = (256 * 256) - 40;  // leave bytes for marker, header and padding
  807|     26|        size_t size = iccProfile_.size();
  808|     26|        if (size >= 255 * chunk_size)
  ------------------
  |  Branch (808:13): [True: 0, False: 26]
  ------------------
  809|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "IccProfile");
  810|     26|        const size_t chunks = 1 + ((size - 1) / chunk_size);
  811|     82|        for (size_t chunk = 0; chunk < chunks; chunk++) {
  ------------------
  |  Branch (811:32): [True: 56, False: 26]
  ------------------
  812|     56|          auto bytes = std::min<size_t>(size, chunk_size);  // bytes to write
  813|     56|          size -= bytes;
  814|       |
  815|       |          // write JPEG marker (2 bytes)
  816|     56|          if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (816:15): [True: 0, False: 56]
  ------------------
  817|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Marker
  818|       |          // write length (2 bytes).  length includes the 2 bytes for the length
  819|     56|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(2 + 14 + bytes), bigEndian);
  820|     56|          if (outIo.write(tmpBuf.data() + 2, 2) != 2)
  ------------------
  |  Branch (820:15): [True: 0, False: 56]
  ------------------
  821|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Length
  822|       |
  823|       |          // write the ICC_PROFILE header (14 bytes)
  824|     56|          uint8_t pad[2];
  825|     56|          pad[0] = static_cast<uint8_t>(chunk + 1);
  826|     56|          pad[1] = static_cast<uint8_t>(chunks);
  827|     56|          outIo.write(reinterpret_cast<const byte*>(iccId_), 12);
  828|     56|          outIo.write(reinterpret_cast<const byte*>(pad), 2);
  829|     56|          if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes)
  ------------------
  |  Branch (829:15): [True: 0, False: 56]
  ------------------
  830|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  831|     56|          if (outIo.error())
  ------------------
  |  Branch (831:15): [True: 0, False: 56]
  ------------------
  832|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  833|     56|        }
  834|     26|        --search;
  835|     26|      }
  836|       |
  837|    261|      if (foundCompletePsData || !iptcData_.empty()) {
  ------------------
  |  Branch (837:11): [True: 50, False: 211]
  |  Branch (837:34): [True: 0, False: 211]
  ------------------
  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|     47|        DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
  841|     47|        const size_t maxChunkSize = 0xffff - 16;
  842|     47|        const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
  ------------------
  |  Branch (842:34): [True: 3, False: 44]
  ------------------
  843|     47|        const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);
  ------------------
  |  Branch (843:32): [True: 3, False: 44]
  ------------------
  844|     99|        while (chunkStart < chunkEnd) {
  ------------------
  |  Branch (844:16): [True: 52, False: 47]
  ------------------
  845|       |          // Determine size of next chunk
  846|     52|          size_t chunkSize = (chunkEnd + 1 - chunkStart);
  847|     52|          if (chunkSize > maxChunkSize) {
  ------------------
  |  Branch (847:15): [True: 10, False: 42]
  ------------------
  848|     10|            chunkSize = maxChunkSize;
  849|       |            // Don't break at a valid IRB boundary
  850|     10|            const auto writtenSize = chunkStart - newPsData.c_data();
  851|     10|            if (Photoshop::valid(newPsData.c_data(), writtenSize + chunkSize)) {
  ------------------
  |  Branch (851:17): [True: 0, False: 10]
  ------------------
  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|     10|          }
  857|       |
  858|       |          // Write APP13 marker, chunk size, and ps3Id
  859|     52|          std::array<byte, 18> tmpBuf;
  860|     52|          tmpBuf[0] = 0xff;
  861|     52|          tmpBuf[1] = app13_;
  862|     52|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(chunkSize + 16), bigEndian);
  863|     52|          std::copy_n(Photoshop::ps3Id_, 14, tmpBuf.begin() + 4);
  864|     52|          if (outIo.write(tmpBuf.data(), 18) != 18)
  ------------------
  |  Branch (864:15): [True: 0, False: 52]
  ------------------
  865|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  866|     52|          if (outIo.error())
  ------------------
  |  Branch (866:15): [True: 0, False: 52]
  ------------------
  867|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  868|       |
  869|       |          // Write next chunk of the Photoshop IRB data buffer
  870|     52|          if (outIo.write(chunkStart, chunkSize) != chunkSize)
  ------------------
  |  Branch (870:15): [True: 0, False: 52]
  ------------------
  871|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  872|     52|          if (outIo.error())
  ------------------
  |  Branch (872:15): [True: 0, False: 52]
  ------------------
  873|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  874|       |
  875|     52|          chunkStart += chunkSize;
  876|     52|        }
  877|     47|        --search;
  878|     47|      }
  879|    261|    }
  880|  1.05M|    if (comPos == count) {
  ------------------
  |  Branch (880:9): [True: 257, False: 1.05M]
  ------------------
  881|    257|      if (!comment_.empty()) {
  ------------------
  |  Branch (881:11): [True: 23, False: 234]
  ------------------
  882|     23|        std::array<byte, 4> tmpBuf;
  883|       |        // Write COM marker, size of comment, and string
  884|     23|        tmpBuf[0] = 0xff;
  885|     23|        tmpBuf[1] = com_;
  886|       |
  887|     23|        if (comment_.length() > 0xffff - 3)
  ------------------
  |  Branch (887:13): [True: 2, False: 21]
  ------------------
  888|      2|          throw Error(ErrorCode::kerTooLargeJpegSegment, "JPEG comment");
  889|     21|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
  890|       |
  891|     21|        if (outIo.write(tmpBuf.data(), 4) != 4)
  ------------------
  |  Branch (891:13): [True: 0, False: 21]
  ------------------
  892|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  893|     21|        if (outIo.write(reinterpret_cast<byte*>(comment_.data()), comment_.length()) != comment_.length())
  ------------------
  |  Branch (893:13): [True: 0, False: 21]
  ------------------
  894|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  895|     21|        if (outIo.putb(0) == EOF)
  ------------------
  |  Branch (895:13): [True: 0, False: 21]
  ------------------
  896|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  897|     21|        if (outIo.error())
  ------------------
  |  Branch (897:13): [True: 0, False: 21]
  ------------------
  898|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  899|     21|        --search;
  900|     21|      }
  901|    255|      --search;
  902|    255|    }
  903|  1.05M|    if (marker == eoi_) {
  ------------------
  |  Branch (903:9): [True: 143, False: 1.05M]
  ------------------
  904|    143|      break;
  905|    143|    }
  906|  1.05M|    if (skipApp1Exif == count || skipApp1Xmp == count ||
  ------------------
  |  Branch (906:9): [True: 76, False: 1.05M]
  |  Branch (906:9): [True: 13.8k, False: 1.03M]
  |  Branch (906:34): [True: 34, False: 1.05M]
  ------------------
  907|  1.05M|        std::find(skipApp13Ps3.begin(), skipApp13Ps3.end(), count) != skipApp13Ps3.end() ||
  ------------------
  |  Branch (907:9): [True: 10.2k, False: 1.04M]
  ------------------
  908|  1.04M|        std::find(skipApp2Icc.begin(), skipApp2Icc.end(), count) != skipApp2Icc.end() || skipCom == count) {
  ------------------
  |  Branch (908:9): [True: 3.49k, False: 1.03M]
  |  Branch (908:90): [True: 47, False: 1.03M]
  ------------------
  909|  13.8k|      --search;
  910|  1.03M|    } else {
  911|  1.03M|      std::array<byte, 2> tmpBuf;
  912|       |      // Write marker and a copy of the segment.
  913|  1.03M|      tmpBuf[0] = 0xff;
  914|  1.03M|      tmpBuf[1] = marker;
  915|  1.03M|      if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (915:11): [True: 0, False: 1.03M]
  ------------------
  916|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  917|  1.03M|      if (outIo.write(buf.c_data(), buf.size()) != buf.size())
  ------------------
  |  Branch (917:11): [True: 0, False: 1.03M]
  ------------------
  918|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  919|  1.03M|      if (outIo.error())
  ------------------
  |  Branch (919:11): [True: 0, False: 1.03M]
  ------------------
  920|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  921|  1.03M|    }
  922|       |
  923|       |    // Next marker
  924|  1.05M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  925|  1.05M|    ++count;
  926|  1.05M|  }
  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|    744|  io_->populateFakeData();
  931|       |
  932|       |  // Write the final marker, then copy rest of the Io.
  933|    744|  byte tmpBuf[2];
  934|    744|  tmpBuf[0] = 0xff;
  935|    744|  tmpBuf[1] = marker;
  936|    744|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (936:7): [True: 0, False: 744]
  ------------------
  937|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  938|       |
  939|    744|  DataBuf buf(4096);
  940|    744|  size_t readSize = io_->read(buf.data(), buf.size());
  941|  1.22k|  while (readSize != 0) {
  ------------------
  |  Branch (941:10): [True: 476, False: 744]
  ------------------
  942|    476|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (942:9): [True: 0, False: 476]
  ------------------
  943|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  944|    476|    readSize = io_->read(buf.data(), buf.size());
  945|    476|  }
  946|    744|  if (outIo.error())
  ------------------
  |  Branch (946:7): [True: 0, False: 744]
  ------------------
  947|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  948|       |
  949|    744|}  // JpegBase::doWriteMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
  968|  1.46k|    JpegBase(ImageType::jpeg, std::move(io), create, blank_, sizeof(blank_)) {
  969|  1.46k|}
_ZNK5Exiv29JpegImage11writeHeaderERNS_7BasicIoE:
  975|    746|int JpegImage::writeHeader(BasicIo& outIo) const {
  976|       |  // Jpeg header
  977|    746|  byte tmpBuf[2];
  978|    746|  tmpBuf[0] = 0xff;
  979|    746|  tmpBuf[1] = soi_;
  980|    746|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (980:7): [True: 0, False: 746]
  ------------------
  981|      0|    return 4;
  982|    746|  if (outIo.error())
  ------------------
  |  Branch (982:7): [True: 0, False: 746]
  ------------------
  983|      0|    return 4;
  984|    746|  return 0;
  985|    746|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  987|  2.21k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  988|  2.21k|  return isJpegType(iIo, advance);
  989|  2.21k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  991|  1.37k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, bool create) {
  992|  1.37k|  auto image = std::make_unique<JpegImage>(std::move(io), create);
  993|  1.37k|  if (!image->good()) {
  ------------------
  |  Branch (993:7): [True: 0, False: 1.37k]
  ------------------
  994|      0|    return nullptr;
  995|      0|  }
  996|  1.37k|  return image;
  997|  1.37k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
  999|  43.6k|bool isJpegType(BasicIo& iIo, bool advance) {
 1000|  43.6k|  bool result = true;
 1001|  43.6k|  byte tmpBuf[2];
 1002|  43.6k|  iIo.read(tmpBuf, 2);
 1003|  43.6k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1003:7): [True: 0, False: 43.6k]
  |  Branch (1003:22): [True: 37, False: 43.6k]
  ------------------
 1004|     37|    return false;
 1005|       |
 1006|  43.6k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1006:7): [True: 38.5k, False: 5.07k]
  |  Branch (1006:28): [True: 174, False: 4.90k]
  ------------------
 1007|  38.7k|    result = false;
 1008|  38.7k|  }
 1009|  43.6k|  if (!advance || !result)
  ------------------
  |  Branch (1009:7): [True: 41.4k, False: 2.21k]
  |  Branch (1009:19): [True: 73, False: 2.14k]
  ------------------
 1010|  41.4k|    iIo.seek(-2, BasicIo::cur);
 1011|  43.6k|  return result;
 1012|  43.6k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
 1015|     67|    JpegBase(ImageType::exv, std::move(io), create, blank_, sizeof(blank_)) {
 1016|     67|}
_ZNK5Exiv28ExvImage11writeHeaderERNS_7BasicIoE:
 1022|     20|int ExvImage::writeHeader(BasicIo& outIo) const {
 1023|       |  // Exv header
 1024|     20|  auto tmpBuf = std::array<byte, 7>{0xff, 0x01};
 1025|     20|  std::copy_n(exiv2Id_, 5, tmpBuf.begin() + 2);
 1026|     20|  if (outIo.write(tmpBuf.data(), 7) != 7)
  ------------------
  |  Branch (1026:7): [True: 0, False: 20]
  ------------------
 1027|      0|    return 4;
 1028|     20|  if (outIo.error())
  ------------------
  |  Branch (1028:7): [True: 0, False: 20]
  ------------------
 1029|      0|    return 4;
 1030|     20|  return 0;
 1031|     20|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1033|     87|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1034|     87|  return isExvType(iIo, advance);
 1035|     87|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1037|     67|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, bool create) {
 1038|     67|  auto image = std::make_unique<ExvImage>(std::move(io), create);
 1039|     67|  if (!image->good())
  ------------------
  |  Branch (1039:7): [True: 0, False: 67]
  ------------------
 1040|      0|    return nullptr;
 1041|     67|  return image;
 1042|     67|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1044|  38.8k|bool isExvType(BasicIo& iIo, bool advance) {
 1045|  38.8k|  bool result = true;
 1046|  38.8k|  byte tmpBuf[7];
 1047|  38.8k|  iIo.read(tmpBuf, 7);
 1048|  38.8k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1048:7): [True: 0, False: 38.8k]
  |  Branch (1048:22): [True: 80, False: 38.7k]
  ------------------
 1049|     80|    return false;
 1050|       |
 1051|  38.7k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1051:7): [True: 38.4k, False: 304]
  |  Branch (1051:28): [True: 57, False: 247]
  |  Branch (1051:49): [True: 26, False: 221]
  ------------------
 1052|  38.5k|    result = false;
 1053|  38.5k|  }
 1054|  38.7k|  if (!advance || !result)
  ------------------
  |  Branch (1054:7): [True: 38.6k, False: 87]
  |  Branch (1054:19): [True: 0, False: 87]
  ------------------
 1055|  38.6k|    iIo.seek(-7, BasicIo::cur);
 1056|  38.7k|  return result;
 1057|  38.8k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  2.40M|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  2.40M|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  2.40M|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  2.40M|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 145k, False: 2.26M]
  ------------------
  107|   145k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|   145k|    size = getUShort(buf.data(), bigEndian);
  109|   145k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|   145k|  }
  111|  2.40M|  return {buf, size};
  112|  2.40M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|   309k|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|   309k|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 427, False: 308k]
  |  Branch (92:38): [True: 582, False: 308k]
  ------------------
   93|   309k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|   617k|constexpr bool inRange(int lo, int value, int hi) {
   88|   617k|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 610k, False: 7.13k]
  |  Branch (88:25): [True: 1.00k, False: 609k]
  ------------------
   89|   617k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  2.40M|bool markerHasLength(byte m) {
   99|  2.40M|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 2.38M, False: 20.3k]
  |  Branch (99:44): [True: 2.26M, False: 124k]
  ------------------
  100|  2.40M|  return !markerWithoutLength;
  101|  2.40M|}

_ZNK5Exiv28Internal14TiffMnRegistryeqENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  133|   249k|bool TiffMnRegistry::operator==(std::string_view key) const {
  134|   249k|  if (!key.empty() && key.front() == '-')
  ------------------
  |  Branch (134:7): [True: 197k, False: 52.5k]
  |  Branch (134:23): [True: 14.9k, False: 182k]
  ------------------
  135|  14.9k|    return false;
  136|   234k|  return key.starts_with(make_);
  137|   249k|}
_ZNK5Exiv28Internal14TiffMnRegistryeqENS_5IfdIdE:
  139|   100k|bool TiffMnRegistry::operator==(IfdId key) const {
  140|   100k|  return mnGroup_ == key;
  141|   100k|}
_ZN5Exiv28Internal13TiffMnCreator6createEtNS_5IfdIdENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPKhmNS_9ByteOrderE:
  144|  19.0k|                                                        const byte* pData, size_t size, ByteOrder byteOrder) {
  145|  19.0k|  if (auto tmr = Exiv2::find(registry_, make))
  ------------------
  |  Branch (145:12): [True: 13.0k, False: 5.97k]
  ------------------
  146|  13.0k|    return tmr->newMnFct_(tag, group, tmr->mnGroup_, pData, size, byteOrder);
  147|  5.97k|  return nullptr;
  148|  19.0k|}  // TiffMnCreator::create
_ZN5Exiv28Internal13TiffMnCreator6createEtNS_5IfdIdES2_:
  150|  8.36k|std::unique_ptr<TiffIfdMakernote> TiffMnCreator::create(uint16_t tag, IfdId group, IfdId mnGroup) {
  151|  8.36k|  if (auto tmr = Exiv2::find(registry_, mnGroup)) {
  ------------------
  |  Branch (151:12): [True: 8.36k, False: 0]
  ------------------
  152|  8.36k|    if (tmr->newMnFct2_) {
  ------------------
  |  Branch (152:9): [True: 8.36k, False: 0]
  ------------------
  153|  8.36k|      return tmr->newMnFct2_(tag, group, mnGroup);
  154|  8.36k|    }
  155|      0|    std::cout << "mnGroup = " << mnGroup << "\n";
  156|      0|  }
  157|      0|  return nullptr;
  158|  8.36k|}  // TiffMnCreator::create
_ZN5Exiv28Internal8MnHeader12setByteOrderENS_9ByteOrderE:
  160|  5.82k|void MnHeader::setByteOrder(ByteOrder) {
  161|  5.82k|}
_ZNK5Exiv28Internal8MnHeader9ifdOffsetEv:
  163|    162|size_t MnHeader::ifdOffset() const {
  164|    162|  return 0;
  165|    162|}
_ZNK5Exiv28Internal8MnHeader9byteOrderEv:
  167|  19.2k|ByteOrder MnHeader::byteOrder() const {
  168|  19.2k|  return invalidByteOrder;
  169|  19.2k|}
_ZNK5Exiv28Internal8MnHeader10baseOffsetEm:
  171|  1.81k|size_t MnHeader::baseOffset(size_t /*mnOffset*/) const {
  172|  1.81k|  return 0;
  173|  1.81k|}
_ZN5Exiv28Internal15OlympusMnHeader15sizeOfSignatureEv:
  177|  3.97k|size_t OlympusMnHeader::sizeOfSignature() {
  178|  3.97k|  return sizeof(signature_);
  179|  3.97k|}
_ZN5Exiv28Internal15OlympusMnHeaderC2Ev:
  181|    412|OlympusMnHeader::OlympusMnHeader() {
  182|    412|  read(signature_, sizeOfSignature(), invalidByteOrder);
  183|    412|}
_ZNK5Exiv28Internal15OlympusMnHeader4sizeEv:
  185|    379|size_t OlympusMnHeader::size() const {
  186|    379|  return header_.size();
  187|    379|}
_ZNK5Exiv28Internal15OlympusMnHeader9ifdOffsetEv:
  189|     55|size_t OlympusMnHeader::ifdOffset() const {
  190|     55|  return sizeOfSignature();
  191|     55|}
_ZN5Exiv28Internal15OlympusMnHeader4readEPKhmNS_9ByteOrderE:
  193|    781|bool OlympusMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  194|    781|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (194:7): [True: 0, False: 781]
  |  Branch (194:17): [True: 0, False: 781]
  ------------------
  195|      0|    return false;
  196|    781|  header_.alloc(sizeOfSignature());
  197|    781|  std::copy_n(pData, header_.size(), header_.begin());
  198|    781|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 6);
  ------------------
  |  Branch (198:10): [True: 781, False: 0]
  |  Branch (198:49): [True: 467, False: 314]
  ------------------
  199|    781|}
_ZNK5Exiv28Internal15OlympusMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  201|     41|size_t OlympusMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  202|     41|  ioWrapper.write(signature_, sizeOfSignature());
  203|     41|  return sizeOfSignature();
  204|     41|}  // OlympusMnHeader::write
_ZN5Exiv28Internal16Olympus2MnHeader15sizeOfSignatureEv:
  208|  9.04k|size_t Olympus2MnHeader::sizeOfSignature() {
  209|  9.04k|  return sizeof(signature_);
  210|  9.04k|}
_ZN5Exiv28Internal16Olympus2MnHeaderC2Ev:
  212|  1.00k|Olympus2MnHeader::Olympus2MnHeader() {
  213|  1.00k|  read(signature_, sizeOfSignature(), invalidByteOrder);
  214|  1.00k|}
_ZNK5Exiv28Internal16Olympus2MnHeader4sizeEv:
  216|     20|size_t Olympus2MnHeader::size() const {
  217|     20|  return header_.size();
  218|     20|}
_ZNK5Exiv28Internal16Olympus2MnHeader9ifdOffsetEv:
  220|  1.00k|size_t Olympus2MnHeader::ifdOffset() const {
  221|  1.00k|  return sizeOfSignature();
  222|  1.00k|}
_ZNK5Exiv28Internal16Olympus2MnHeader10baseOffsetEm:
  224|  1.00k|size_t Olympus2MnHeader::baseOffset(size_t mnOffset) const {
  225|  1.00k|  return mnOffset;
  226|  1.00k|}
_ZN5Exiv28Internal16Olympus2MnHeader4readEPKhmNS_9ByteOrderE:
  228|  2.00k|bool Olympus2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  229|  2.00k|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (229:7): [True: 0, False: 2.00k]
  |  Branch (229:17): [True: 0, False: 2.00k]
  ------------------
  230|      0|    return false;
  231|  2.00k|  header_.alloc(sizeOfSignature());
  232|  2.00k|  std::copy_n(pData, header_.size(), header_.begin());
  233|  2.00k|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 10);
  ------------------
  |  Branch (233:10): [True: 2.00k, False: 0]
  |  Branch (233:49): [True: 2.00k, False: 0]
  ------------------
  234|  2.00k|}
_ZN5Exiv28Internal16OMSystemMnHeader15sizeOfSignatureEv:
  244|  41.9k|size_t OMSystemMnHeader::sizeOfSignature() {
  245|  41.9k|  return sizeof(signature_);
  246|  41.9k|}
_ZN5Exiv28Internal16OMSystemMnHeaderC2Ev:
  248|  5.74k|OMSystemMnHeader::OMSystemMnHeader() {
  249|  5.74k|  read(signature_, sizeOfSignature(), invalidByteOrder);
  250|  5.74k|}
_ZNK5Exiv28Internal16OMSystemMnHeader4sizeEv:
  252|  47.7k|size_t OMSystemMnHeader::size() const {
  253|  47.7k|  return header_.size();
  254|  47.7k|}
_ZNK5Exiv28Internal16OMSystemMnHeader9ifdOffsetEv:
  256|     76|size_t OMSystemMnHeader::ifdOffset() const {
  257|     76|  return sizeOfSignature();
  258|     76|}
_ZNK5Exiv28Internal16OMSystemMnHeader10baseOffsetEm:
  260|  5.37k|size_t OMSystemMnHeader::baseOffset(size_t mnOffset) const {
  261|  5.37k|  return mnOffset;
  262|  5.37k|}
_ZN5Exiv28Internal16OMSystemMnHeader4readEPKhmNS_9ByteOrderE:
  264|  6.15k|bool OMSystemMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  265|  6.15k|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (265:7): [True: 0, False: 6.15k]
  |  Branch (265:17): [True: 0, False: 6.15k]
  ------------------
  266|      0|    return false;
  267|  6.15k|  header_.alloc(sizeOfSignature());
  268|  6.15k|  std::copy_n(pData, header_.size(), header_.begin());
  269|  6.15k|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, sizeOfSignature() - 2);
  ------------------
  |  Branch (269:10): [True: 6.15k, False: 0]
  |  Branch (269:49): [True: 5.81k, False: 336]
  ------------------
  270|  6.15k|}
_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|  3.41k|size_t FujiMnHeader::sizeOfSignature() {
  281|  3.41k|  return sizeof(signature_);
  282|  3.41k|}
_ZN5Exiv28Internal12FujiMnHeaderC2Ev:
  284|    409|FujiMnHeader::FujiMnHeader() {
  285|    409|  read(signature_, sizeOfSignature(), byteOrder_);
  286|    409|}
_ZNK5Exiv28Internal12FujiMnHeader4sizeEv:
  288|    553|size_t FujiMnHeader::size() const {
  289|    553|  return header_.size();
  290|    553|}
_ZNK5Exiv28Internal12FujiMnHeader9ifdOffsetEv:
  292|    184|size_t FujiMnHeader::ifdOffset() const {
  293|    184|  return start_;
  294|    184|}
_ZNK5Exiv28Internal12FujiMnHeader9byteOrderEv:
  296|    804|ByteOrder FujiMnHeader::byteOrder() const {
  297|    804|  return byteOrder_;
  298|    804|}
_ZNK5Exiv28Internal12FujiMnHeader10baseOffsetEm:
  300|    245|size_t FujiMnHeader::baseOffset(size_t mnOffset) const {
  301|    245|  return mnOffset;
  302|    245|}
_ZN5Exiv28Internal12FujiMnHeader4readEPKhmNS_9ByteOrderE:
  304|    755|bool FujiMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  305|    755|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (305:7): [True: 0, False: 755]
  |  Branch (305:17): [True: 0, False: 755]
  ------------------
  306|      0|    return false;
  307|    755|  header_.alloc(sizeOfSignature());
  308|    755|  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|    755|  start_ = header_.read_uint32(8, byteOrder_);
  312|    755|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 8);
  ------------------
  |  Branch (312:10): [True: 755, False: 0]
  |  Branch (312:49): [True: 593, False: 162]
  ------------------
  313|    755|}
_ZNK5Exiv28Internal12FujiMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  315|     61|size_t FujiMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  316|     61|  ioWrapper.write(signature_, sizeOfSignature());
  317|     61|  return sizeOfSignature();
  318|     61|}  // FujiMnHeader::write
_ZN5Exiv28Internal14Nikon2MnHeader15sizeOfSignatureEv:
  322|  2.77k|size_t Nikon2MnHeader::sizeOfSignature() {
  323|  2.77k|  return sizeof(signature_);
  324|  2.77k|}
_ZN5Exiv28Internal14Nikon2MnHeaderC2Ev:
  326|    319|Nikon2MnHeader::Nikon2MnHeader() {
  327|    319|  read(signature_, sizeOfSignature(), invalidByteOrder);
  328|    319|}
_ZNK5Exiv28Internal14Nikon2MnHeader4sizeEv:
  330|    200|size_t Nikon2MnHeader::size() const {
  331|    200|  return sizeOfSignature();
  332|    200|}
_ZNK5Exiv28Internal14Nikon2MnHeader9ifdOffsetEv:
  334|    295|size_t Nikon2MnHeader::ifdOffset() const {
  335|    295|  return start_;
  336|    295|}
_ZN5Exiv28Internal14Nikon2MnHeader4readEPKhmNS_9ByteOrderE:
  338|    614|bool Nikon2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  339|    614|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (339:7): [True: 0, False: 614]
  |  Branch (339:17): [True: 0, False: 614]
  ------------------
  340|      0|    return false;
  341|    614|  if (0 != memcmp(pData, signature_, 6))
  ------------------
  |  Branch (341:7): [True: 0, False: 614]
  ------------------
  342|      0|    return false;
  343|    614|  buf_.alloc(sizeOfSignature());
  344|    614|  std::copy_n(pData, buf_.size(), buf_.begin());
  345|    614|  start_ = sizeOfSignature();
  346|    614|  return true;
  347|    614|}  // Nikon2MnHeader::read
_ZNK5Exiv28Internal14Nikon2MnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  349|     21|size_t Nikon2MnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  350|     21|  ioWrapper.write(signature_, sizeOfSignature());
  351|     21|  return sizeOfSignature();
  352|     21|}  // Nikon2MnHeader::write
_ZN5Exiv28Internal14Nikon3MnHeader15sizeOfSignatureEv:
  357|  9.69k|size_t Nikon3MnHeader::sizeOfSignature() {
  358|  9.69k|  return sizeof(signature_);
  359|  9.69k|}
_ZN5Exiv28Internal14Nikon3MnHeaderC2Ev:
  361|  1.48k|Nikon3MnHeader::Nikon3MnHeader() : start_(sizeOfSignature()) {
  362|  1.48k|  buf_.alloc(sizeOfSignature());
  363|  1.48k|  std::copy_n(signature_, buf_.size(), buf_.begin());
  364|  1.48k|}
_ZNK5Exiv28Internal14Nikon3MnHeader4sizeEv:
  366|  3.43k|size_t Nikon3MnHeader::size() const {
  367|  3.43k|  return sizeOfSignature();
  368|  3.43k|}
_ZNK5Exiv28Internal14Nikon3MnHeader9ifdOffsetEv:
  370|  1.08k|size_t Nikon3MnHeader::ifdOffset() const {
  371|  1.08k|  return start_;
  372|  1.08k|}
_ZNK5Exiv28Internal14Nikon3MnHeader9byteOrderEv:
  374|  5.07k|ByteOrder Nikon3MnHeader::byteOrder() const {
  375|  5.07k|  return byteOrder_;
  376|  5.07k|}
_ZNK5Exiv28Internal14Nikon3MnHeader10baseOffsetEm:
  378|  1.45k|size_t Nikon3MnHeader::baseOffset(size_t mnOffset) const {
  379|  1.45k|  return Safe::add<size_t>(mnOffset, 10);
  380|  1.45k|}
_ZN5Exiv28Internal14Nikon3MnHeader4readEPKhmNS_9ByteOrderE:
  382|  1.08k|bool Nikon3MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  383|  1.08k|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (383:7): [True: 0, False: 1.08k]
  |  Branch (383:17): [True: 0, False: 1.08k]
  ------------------
  384|      0|    return false;
  385|  1.08k|  if (0 != memcmp(pData, signature_, 6))
  ------------------
  |  Branch (385:7): [True: 0, False: 1.08k]
  ------------------
  386|      0|    return false;
  387|  1.08k|  buf_.alloc(sizeOfSignature());
  388|  1.08k|  std::copy_n(pData, buf_.size(), buf_.begin());
  389|  1.08k|  TiffHeader th;
  390|  1.08k|  if (!th.read(buf_.data(10), 8))
  ------------------
  |  Branch (390:7): [True: 0, False: 1.08k]
  ------------------
  391|      0|    return false;
  392|  1.08k|  byteOrder_ = th.byteOrder();
  393|  1.08k|  start_ = 10 + th.offset();
  394|  1.08k|  return true;
  395|  1.08k|}  // Nikon3MnHeader::read
_ZNK5Exiv28Internal14Nikon3MnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  397|    371|size_t Nikon3MnHeader::write(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  398|    371|  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|    371|  TiffHeader th(byteOrder);
  401|    371|  DataBuf buf = th.write();
  402|    371|  ioWrapper.write(buf.c_data(), buf.size());
  403|    371|  return 10 + buf.size();
  404|    371|}
_ZN5Exiv28Internal14Nikon3MnHeader12setByteOrderENS_9ByteOrderE:
  406|    400|void Nikon3MnHeader::setByteOrder(ByteOrder byteOrder) {
  407|    400|  byteOrder_ = byteOrder;
  408|    400|}
_ZN5Exiv28Internal17PanasonicMnHeader15sizeOfSignatureEv:
  412|  1.36k|size_t PanasonicMnHeader::sizeOfSignature() {
  413|  1.36k|  return sizeof(signature_);
  414|  1.36k|}
_ZN5Exiv28Internal17PanasonicMnHeaderC2Ev:
  416|    178|PanasonicMnHeader::PanasonicMnHeader() {
  417|    178|  read(signature_, sizeOfSignature(), invalidByteOrder);
  418|    178|}
_ZNK5Exiv28Internal17PanasonicMnHeader4sizeEv:
  420|     49|size_t PanasonicMnHeader::size() const {
  421|     49|  return sizeOfSignature();
  422|     49|}
_ZNK5Exiv28Internal17PanasonicMnHeader9ifdOffsetEv:
  424|    100|size_t PanasonicMnHeader::ifdOffset() const {
  425|    100|  return start_;
  426|    100|}
_ZN5Exiv28Internal17PanasonicMnHeader4readEPKhmNS_9ByteOrderE:
  428|    349|bool PanasonicMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  429|    349|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (429:7): [True: 0, False: 349]
  |  Branch (429:17): [True: 0, False: 349]
  ------------------
  430|      0|    return false;
  431|    349|  if (0 != memcmp(pData, signature_, 9))
  ------------------
  |  Branch (431:7): [True: 71, False: 278]
  ------------------
  432|     71|    return false;
  433|    278|  buf_.alloc(sizeOfSignature());
  434|    278|  std::copy_n(pData, buf_.size(), buf_.begin());
  435|    278|  start_ = sizeOfSignature();
  436|    278|  return true;
  437|    349|}  // PanasonicMnHeader::read
_ZNK5Exiv28Internal17PanasonicMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  439|      5|size_t PanasonicMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  440|      5|  ioWrapper.write(signature_, sizeOfSignature());
  441|      5|  return sizeOfSignature();
  442|      5|}  // PanasonicMnHeader::write
_ZN5Exiv28Internal17PentaxDngMnHeader15sizeOfSignatureEv:
  446|  10.4k|size_t PentaxDngMnHeader::sizeOfSignature() {
  447|  10.4k|  return sizeof(signature_);
  448|  10.4k|}
_ZN5Exiv28Internal17PentaxDngMnHeaderC2Ev:
  450|  1.70k|PentaxDngMnHeader::PentaxDngMnHeader() {
  451|  1.70k|  read(signature_, sizeOfSignature(), invalidByteOrder);
  452|  1.70k|}
_ZNK5Exiv28Internal17PentaxDngMnHeader4sizeEv:
  454|  8.10k|size_t PentaxDngMnHeader::size() const {
  455|  8.10k|  return header_.size();
  456|  8.10k|}
_ZNK5Exiv28Internal17PentaxDngMnHeader10baseOffsetEm:
  458|  1.70k|size_t PentaxDngMnHeader::baseOffset(size_t mnOffset) const {
  459|  1.70k|  return mnOffset;
  460|  1.70k|}
_ZNK5Exiv28Internal17PentaxDngMnHeader9ifdOffsetEv:
  462|     81|size_t PentaxDngMnHeader::ifdOffset() const {
  463|     81|  return sizeOfSignature();
  464|     81|}
_ZN5Exiv28Internal17PentaxDngMnHeader4readEPKhmNS_9ByteOrderE:
  466|  1.78k|bool PentaxDngMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  467|  1.78k|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (467:7): [True: 0, False: 1.78k]
  |  Branch (467:17): [True: 0, False: 1.78k]
  ------------------
  468|      0|    return false;
  469|  1.78k|  header_.alloc(sizeOfSignature());
  470|  1.78k|  std::copy_n(pData, header_.size(), header_.begin());
  471|  1.78k|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 7);
  ------------------
  |  Branch (471:10): [True: 1.78k, False: 0]
  |  Branch (471:49): [True: 1.78k, False: 0]
  ------------------
  472|  1.78k|}
_ZNK5Exiv28Internal17PentaxDngMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  474|  1.62k|size_t PentaxDngMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  475|  1.62k|  ioWrapper.write(signature_, sizeOfSignature());
  476|  1.62k|  return sizeOfSignature();
  477|  1.62k|}  // PentaxDngMnHeader::write
_ZN5Exiv28Internal14PentaxMnHeader15sizeOfSignatureEv:
  481|  1.39k|size_t PentaxMnHeader::sizeOfSignature() {
  482|  1.39k|  return sizeof(signature_);
  483|  1.39k|}
_ZN5Exiv28Internal14PentaxMnHeaderC2Ev:
  485|    164|PentaxMnHeader::PentaxMnHeader() {
  486|    164|  read(signature_, sizeOfSignature(), invalidByteOrder);
  487|    164|}
_ZNK5Exiv28Internal14PentaxMnHeader4sizeEv:
  489|    382|size_t PentaxMnHeader::size() const {
  490|    382|  return header_.size();
  491|    382|}
_ZNK5Exiv28Internal14PentaxMnHeader9ifdOffsetEv:
  493|    120|size_t PentaxMnHeader::ifdOffset() const {
  494|    120|  return sizeOfSignature();
  495|    120|}
_ZN5Exiv28Internal14PentaxMnHeader4readEPKhmNS_9ByteOrderE:
  497|    284|bool PentaxMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  498|    284|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (498:7): [True: 0, False: 284]
  |  Branch (498:17): [True: 0, False: 284]
  ------------------
  499|      0|    return false;
  500|    284|  header_.alloc(sizeOfSignature());
  501|    284|  std::copy_n(pData, header_.size(), header_.begin());
  502|    284|  return header_.size() >= sizeOfSignature() && 0 == header_.cmpBytes(0, signature_, 3);
  ------------------
  |  Branch (502:10): [True: 284, False: 0]
  |  Branch (502:49): [True: 284, False: 0]
  ------------------
  503|    284|}
_ZNK5Exiv28Internal14PentaxMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  505|     42|size_t PentaxMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  506|     42|  ioWrapper.write(signature_, sizeOfSignature());
  507|     42|  return sizeOfSignature();
  508|     42|}
_ZN5Exiv28Internal15SamsungMnHeaderC2Ev:
  510|    197|SamsungMnHeader::SamsungMnHeader() {
  511|    197|  read(nullptr, 0, invalidByteOrder);
  512|    197|}
_ZNK5Exiv28Internal15SamsungMnHeader4sizeEv:
  514|    312|size_t SamsungMnHeader::size() const {
  515|    312|  return 0;
  516|    312|}
_ZNK5Exiv28Internal15SamsungMnHeader10baseOffsetEm:
  518|    195|size_t SamsungMnHeader::baseOffset(size_t mnOffset) const {
  519|    195|  return mnOffset;
  520|    195|}
_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|     33|size_t SamsungMnHeader::write(IoWrapper& /*ioWrapper*/, ByteOrder) const {
  527|     33|  return 0;
  528|     33|}  // SamsungMnHeader::write
_ZN5Exiv28Internal13SigmaMnHeader15sizeOfSignatureEv:
  533|  2.35k|size_t SigmaMnHeader::sizeOfSignature() {
  534|  2.35k|  return sizeof(signature1_);
  535|  2.35k|}
_ZN5Exiv28Internal13SigmaMnHeaderC2Ev:
  537|    286|SigmaMnHeader::SigmaMnHeader() {
  538|    286|  read(signature1_, sizeOfSignature(), invalidByteOrder);
  539|    286|}
_ZNK5Exiv28Internal13SigmaMnHeader4sizeEv:
  541|     94|size_t SigmaMnHeader::size() const {
  542|     94|  return sizeOfSignature();
  543|     94|}
_ZNK5Exiv28Internal13SigmaMnHeader9ifdOffsetEv:
  545|    153|size_t SigmaMnHeader::ifdOffset() const {
  546|    153|  return start_;
  547|    153|}
_ZN5Exiv28Internal13SigmaMnHeader4readEPKhmNS_9ByteOrderE:
  549|    560|bool SigmaMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  550|    560|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (550:7): [True: 0, False: 560]
  |  Branch (550:17): [True: 0, False: 560]
  ------------------
  551|      0|    return false;
  552|    560|  if (0 != memcmp(pData, signature1_, 8) && 0 != memcmp(pData, signature2_, 8))
  ------------------
  |  Branch (552:7): [True: 236, False: 324]
  |  Branch (552:45): [True: 121, False: 115]
  ------------------
  553|    121|    return false;
  554|    439|  buf_.alloc(sizeOfSignature());
  555|    439|  std::copy_n(pData, buf_.size(), buf_.begin());
  556|    439|  start_ = sizeOfSignature();
  557|    439|  return true;
  558|    560|}  // SigmaMnHeader::read
_ZNK5Exiv28Internal13SigmaMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  560|     10|size_t SigmaMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  561|     10|  ioWrapper.write(signature1_, sizeOfSignature());
  562|     10|  return sizeOfSignature();
  563|     10|}  // SigmaMnHeader::write
_ZN5Exiv28Internal12SonyMnHeader15sizeOfSignatureEv:
  567|  10.7k|size_t SonyMnHeader::sizeOfSignature() {
  568|  10.7k|  return sizeof(signature_);
  569|  10.7k|}
_ZN5Exiv28Internal12SonyMnHeaderC2Ev:
  571|    907|SonyMnHeader::SonyMnHeader() {
  572|    907|  read(signature_, sizeOfSignature(), invalidByteOrder);
  573|    907|}
_ZNK5Exiv28Internal12SonyMnHeader4sizeEv:
  575|  2.50k|size_t SonyMnHeader::size() const {
  576|  2.50k|  return sizeOfSignature();
  577|  2.50k|}
_ZNK5Exiv28Internal12SonyMnHeader9ifdOffsetEv:
  579|    625|size_t SonyMnHeader::ifdOffset() const {
  580|    625|  return start_;
  581|    625|}
_ZN5Exiv28Internal12SonyMnHeader4readEPKhmNS_9ByteOrderE:
  583|  1.53k|bool SonyMnHeader::read(const byte* pData, size_t size, ByteOrder) {
  584|  1.53k|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (584:7): [True: 0, False: 1.53k]
  |  Branch (584:17): [True: 0, False: 1.53k]
  ------------------
  585|      0|    return false;
  586|  1.53k|  if (0 != memcmp(pData, signature_, sizeOfSignature()))
  ------------------
  |  Branch (586:7): [True: 0, False: 1.53k]
  ------------------
  587|      0|    return false;
  588|  1.53k|  buf_.alloc(sizeOfSignature());
  589|  1.53k|  std::copy_n(pData, buf_.size(), buf_.begin());
  590|  1.53k|  start_ = sizeOfSignature();
  591|  1.53k|  return true;
  592|  1.53k|}  // SonyMnHeader::read
_ZNK5Exiv28Internal12SonyMnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  594|    277|size_t SonyMnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  595|    277|  ioWrapper.write(signature_, sizeOfSignature());
  596|    277|  return sizeOfSignature();
  597|    277|}  // SonyMnHeader::write
_ZN5Exiv28Internal14Casio2MnHeader15sizeOfSignatureEv:
  602|    750|size_t Casio2MnHeader::sizeOfSignature() {
  603|    750|  return sizeof(signature_);
  604|    750|}
_ZN5Exiv28Internal14Casio2MnHeaderC2Ev:
  606|     77|Casio2MnHeader::Casio2MnHeader() {
  607|     77|  read(signature_, sizeOfSignature(), invalidByteOrder);
  608|     77|}
_ZNK5Exiv28Internal14Casio2MnHeader4sizeEv:
  610|     83|size_t Casio2MnHeader::size() const {
  611|     83|  return sizeOfSignature();
  612|     83|}
_ZNK5Exiv28Internal14Casio2MnHeader9ifdOffsetEv:
  614|     66|size_t Casio2MnHeader::ifdOffset() const {
  615|     66|  return start_;
  616|     66|}
_ZNK5Exiv28Internal14Casio2MnHeader9byteOrderEv:
  618|    242|ByteOrder Casio2MnHeader::byteOrder() const {
  619|    242|  return byteOrder_;
  620|    242|}
_ZN5Exiv28Internal14Casio2MnHeader4readEPKhmNS_9ByteOrderE:
  622|    143|bool Casio2MnHeader::read(const byte* pData, size_t size, ByteOrder) {
  623|    143|  if (!pData || size < sizeOfSignature())
  ------------------
  |  Branch (623:7): [True: 0, False: 143]
  |  Branch (623:17): [True: 0, False: 143]
  ------------------
  624|      0|    return false;
  625|    143|  if (0 != memcmp(pData, signature_, sizeOfSignature()))
  ------------------
  |  Branch (625:7): [True: 0, False: 143]
  ------------------
  626|      0|    return false;
  627|    143|  buf_.alloc(sizeOfSignature());
  628|    143|  std::copy_n(pData, buf_.size(), buf_.begin());
  629|    143|  start_ = sizeOfSignature();
  630|    143|  return true;
  631|    143|}  // Casio2MnHeader::read
_ZNK5Exiv28Internal14Casio2MnHeader5writeERNS0_9IoWrapperENS_9ByteOrderE:
  633|      9|size_t Casio2MnHeader::write(IoWrapper& ioWrapper, ByteOrder) const {
  634|      9|  ioWrapper.write(signature_, sizeOfSignature());
  635|      9|  return sizeOfSignature();
  636|      9|}  // Casio2MnHeader::write
_ZN5Exiv28Internal8newIfdMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  642|  2.77k|                                           ByteOrder) {
  643|       |  // Require at least an IFD with 1 entry, but not necessarily a next pointer
  644|  2.77k|  if (size < 14)
  ------------------
  |  Branch (644:7): [True: 1.25k, False: 1.51k]
  ------------------
  645|  1.25k|    return nullptr;
  646|  1.51k|  return newIfdMn2(tag, group, mnGroup);
  647|  2.77k|}
_ZN5Exiv28Internal9newIfdMn2EtNS_5IfdIdES1_:
  649|  2.86k|std::unique_ptr<TiffIfdMakernote> newIfdMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  650|  2.86k|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, nullptr);
  651|  2.86k|}
_ZN5Exiv28Internal12newOlympusMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  654|  2.26k|                                               ByteOrder) {
  655|       |  // FIXME: workaround for overwritten OM System header in Olympus files (https://github.com/Exiv2/exiv2/issues/2542)
  656|  2.26k|  if (size >= 14 && std::string(reinterpret_cast<const char*>(pData), 14) == std::string("OM SYSTEM\0\0\0II", 14)) {
  ------------------
  |  Branch (656:7): [True: 1.51k, False: 744]
  |  Branch (656:7): [True: 141, False: 2.12k]
  |  Branch (656:21): [True: 141, False: 1.37k]
  ------------------
  657|       |    // Require at least the header and an IFD with 1 entry
  658|    141|    if (size < OMSystemMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (658:9): [True: 65, False: 76]
  ------------------
  659|     65|      return nullptr;
  660|     76|    return newOMSystemMn2(tag, group, IfdId::olympus2Id);
  661|    141|  }
  662|  2.12k|  if (size < 10 || std::string(reinterpret_cast<const char*>(pData), 10) != std::string("OLYMPUS\0II", 10)) {
  ------------------
  |  Branch (662:7): [True: 518, False: 1.60k]
  |  Branch (662:7): [True: 1.08k, False: 1.03k]
  |  Branch (662:20): [True: 565, False: 1.03k]
  ------------------
  663|       |    // Require at least the header and an IFD with 1 entry
  664|  1.08k|    if (size < OlympusMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (664:9): [True: 714, False: 369]
  ------------------
  665|    714|      return nullptr;
  666|    369|    return newOlympusMn2(tag, group, IfdId::olympusId);
  667|  1.08k|  }
  668|       |  // Require at least the header and an IFD with 1 entry
  669|  1.03k|  if (size < Olympus2MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (669:7): [True: 37, False: 1.00k]
  ------------------
  670|     37|    return nullptr;
  671|  1.00k|  return newOlympus2Mn2(tag, group, IfdId::olympus2Id);
  672|  1.03k|}
_ZN5Exiv28Internal13newOlympusMn2EtNS_5IfdIdES1_:
  674|    412|std::unique_ptr<TiffIfdMakernote> newOlympusMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  675|    412|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<OlympusMnHeader>());
  676|    412|}
_ZN5Exiv28Internal14newOlympus2Mn2EtNS_5IfdIdES1_:
  678|  1.00k|std::unique_ptr<TiffIfdMakernote> newOlympus2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  679|  1.00k|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Olympus2MnHeader>());
  680|  1.00k|}
_ZN5Exiv28Internal13newOMSystemMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  683|    736|                                                ByteOrder) {
  684|       |  // Require at least the header and an IFD with 1 entry
  685|    736|  if (size < OMSystemMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (685:7): [True: 400, False: 336]
  ------------------
  686|    400|    return nullptr;
  687|    336|  return newOMSystemMn2(tag, group, mnGroup);
  688|    736|}
_ZN5Exiv28Internal14newOMSystemMn2EtNS_5IfdIdES1_:
  690|  5.74k|std::unique_ptr<TiffIfdMakernote> newOMSystemMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  691|  5.74k|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<OMSystemMnHeader>());
  692|  5.74k|}
_ZN5Exiv28Internal9newFujiMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  695|    620|                                            ByteOrder) {
  696|       |  // Require at least the header and an IFD with 1 entry
  697|    620|  if (size < FujiMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (697:7): [True: 274, False: 346]
  ------------------
  698|    274|    return nullptr;
  699|    346|  return newFujiMn2(tag, group, mnGroup);
  700|    620|}
_ZN5Exiv28Internal10newFujiMn2EtNS_5IfdIdES1_:
  702|    409|std::unique_ptr<TiffIfdMakernote> newFujiMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  703|    409|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<FujiMnHeader>());
  704|    409|}
_ZN5Exiv28Internal10newNikonMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  707|  2.27k|                                             ByteOrder) {
  708|       |  // If there is no "Nikon" string it must be Nikon1 format
  709|  2.27k|  if (size < 6 || std::string(reinterpret_cast<const char*>(pData), 6) != std::string("Nikon\0", 6)) {
  ------------------
  |  Branch (709:7): [True: 302, False: 1.97k]
  |  Branch (709:7): [True: 785, False: 1.48k]
  |  Branch (709:19): [True: 483, False: 1.48k]
  ------------------
  710|       |    // Require at least an IFD with 1 entry
  711|    785|    if (size < 18)
  ------------------
  |  Branch (711:9): [True: 384, False: 401]
  ------------------
  712|    384|      return nullptr;
  713|    401|    return newIfdMn2(tag, group, IfdId::nikon1Id);
  714|    785|  }
  715|       |  // If the "Nikon" string is not followed by a TIFF header, we assume
  716|       |  // Nikon2 format
  717|  1.48k|  TiffHeader tiffHeader;
  718|  1.48k|  if (size < 18 || !tiffHeader.read(pData + 10, size - 10) || tiffHeader.tag() != 0x002a) {
  ------------------
  |  Branch (718:7): [True: 39, False: 1.44k]
  |  Branch (718:20): [True: 250, False: 1.19k]
  |  Branch (718:63): [True: 79, False: 1.11k]
  ------------------
  719|       |    // Require at least the header and an IFD with 1 entry
  720|    368|    if (size < Nikon2MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (720:9): [True: 73, False: 295]
  ------------------
  721|     73|      return nullptr;
  722|    295|    return newNikon2Mn2(tag, group, IfdId::nikon2Id);
  723|    368|  }
  724|       |  // Else we have a Nikon3 makernote
  725|       |  // Require at least the header and an IFD with 1 entry
  726|  1.11k|  if (size < Nikon3MnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (726:7): [True: 34, False: 1.08k]
  ------------------
  727|     34|    return nullptr;
  728|  1.08k|  return newNikon3Mn2(tag, group, IfdId::nikon3Id);
  729|  1.11k|}
_ZN5Exiv28Internal12newNikon2Mn2EtNS_5IfdIdES1_:
  731|    319|std::unique_ptr<TiffIfdMakernote> newNikon2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  732|    319|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Nikon2MnHeader>());
  733|    319|}
_ZN5Exiv28Internal12newNikon3Mn2EtNS_5IfdIdES1_:
  735|  1.48k|std::unique_ptr<TiffIfdMakernote> newNikon3Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  736|  1.48k|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Nikon3MnHeader>());
  737|  1.48k|}
_ZN5Exiv28Internal14newPanasonicMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  740|    221|                                                 ByteOrder) {
  741|       |  // Require at least the header and an IFD with 1 entry, but without a next pointer
  742|    221|  if (size < PanasonicMnHeader::sizeOfSignature() + 14)
  ------------------
  |  Branch (742:7): [True: 50, False: 171]
  ------------------
  743|     50|    return nullptr;
  744|    171|  return newPanasonicMn2(tag, group, mnGroup);
  745|    221|}
_ZN5Exiv28Internal15newPanasonicMn2EtNS_5IfdIdES1_:
  747|    178|std::unique_ptr<TiffIfdMakernote> newPanasonicMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  748|    178|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PanasonicMnHeader>(), false);
  749|    178|}
_ZN5Exiv28Internal11newPentaxMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  752|    403|                                              ByteOrder) {
  753|    403|  if (size > 8 && std::string(reinterpret_cast<const char*>(pData), 8) == std::string("PENTAX \0", 8)) {
  ------------------
  |  Branch (753:7): [True: 229, False: 174]
  |  Branch (753:7): [True: 88, False: 315]
  |  Branch (753:19): [True: 88, False: 141]
  ------------------
  754|       |    // Require at least the header and an IFD with 1 entry
  755|     88|    if (size < PentaxDngMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (755:9): [True: 7, False: 81]
  ------------------
  756|      7|      return nullptr;
  757|     81|    return newPentaxDngMn2(tag, group, (tag == 0xc634 ? IfdId::pentaxDngId : IfdId::pentaxId));
  ------------------
  |  Branch (757:41): [True: 81, False: 0]
  ------------------
  758|     88|  }
  759|    315|  if (size > 4 && std::string(reinterpret_cast<const char*>(pData), 4) == std::string("AOC\0", 4)) {
  ------------------
  |  Branch (759:7): [True: 178, False: 137]
  |  Branch (759:7): [True: 64, False: 251]
  |  Branch (759:19): [True: 64, False: 114]
  ------------------
  760|       |    // Require at least the header and an IFD with 1 entry
  761|     64|    if (size < PentaxMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (761:9): [True: 21, False: 43]
  ------------------
  762|     21|      return nullptr;
  763|     43|    return newPentaxMn2(tag, group, IfdId::pentaxId);
  764|     64|  }
  765|    251|  return nullptr;
  766|    315|}
_ZN5Exiv28Internal12newPentaxMn2EtNS_5IfdIdES1_:
  768|    164|std::unique_ptr<TiffIfdMakernote> newPentaxMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  769|    164|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PentaxMnHeader>());
  770|    164|}
_ZN5Exiv28Internal15newPentaxDngMn2EtNS_5IfdIdES1_:
  772|  1.70k|std::unique_ptr<TiffIfdMakernote> newPentaxDngMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  773|  1.70k|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<PentaxDngMnHeader>());
  774|  1.70k|}
_ZN5Exiv28Internal12newSamsungMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  777|    454|                                               ByteOrder) {
  778|    454|  if (size > 4 && std::string(reinterpret_cast<const char*>(pData), 4) == std::string("AOC\0", 4)) {
  ------------------
  |  Branch (778:7): [True: 340, False: 114]
  |  Branch (778:7): [True: 110, False: 344]
  |  Branch (778:19): [True: 110, False: 230]
  ------------------
  779|       |    // Samsung branded Pentax camera:
  780|       |    // Require at least the header and an IFD with 1 entry
  781|    110|    if (size < PentaxMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (781:9): [True: 33, False: 77]
  ------------------
  782|     33|      return nullptr;
  783|     77|    return newPentaxMn2(tag, group, IfdId::pentaxId);
  784|    110|  }
  785|       |  // Genuine Samsung camera:
  786|       |  // Require at least an IFD with 1 entry
  787|    344|  if (size < 18)
  ------------------
  |  Branch (787:7): [True: 182, False: 162]
  ------------------
  788|    182|    return nullptr;
  789|    162|  return newSamsungMn2(tag, group, mnGroup);
  790|    344|}
_ZN5Exiv28Internal13newSamsungMn2EtNS_5IfdIdES1_:
  792|    197|std::unique_ptr<TiffIfdMakernote> newSamsungMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  793|    197|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SamsungMnHeader>());
  794|    197|}
_ZN5Exiv28Internal10newSigmaMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  797|    518|                                             ByteOrder) {
  798|       |  // Require at least the header and an IFD with 1 entry
  799|    518|  if (size < SigmaMnHeader::sizeOfSignature() + 18)
  ------------------
  |  Branch (799:7): [True: 244, False: 274]
  ------------------
  800|    244|    return nullptr;
  801|    274|  return newSigmaMn2(tag, group, mnGroup);
  802|    518|}
_ZN5Exiv28Internal11newSigmaMn2EtNS_5IfdIdES1_:
  804|    286|std::unique_ptr<TiffIfdMakernote> newSigmaMn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  805|    286|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SigmaMnHeader>());
  806|    286|}
_ZN5Exiv28Internal9newSonyMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  809|  1.70k|                                            ByteOrder) {
  810|       |  // If there is no "SONY DSC " string we assume it's a simple IFD Makernote
  811|  1.70k|  if (size < 12 || std::string(reinterpret_cast<const char*>(pData), 12) != std::string("SONY DSC \0\0\0", 12)) {
  ------------------
  |  Branch (811:7): [True: 209, False: 1.49k]
  |  Branch (811:7): [True: 1.06k, False: 640]
  |  Branch (811:20): [True: 857, False: 640]
  ------------------
  812|       |    // Require at least an IFD with 1 entry
  813|  1.06k|    if (size < 18)
  ------------------
  |  Branch (813:9): [True: 230, False: 836]
  ------------------
  814|    230|      return nullptr;
  815|    836|    return newSony2Mn2(tag, group, IfdId::sony2Id);
  816|  1.06k|  }
  817|       |  // Require at least the header and an IFD with 1 entry, but without a next pointer
  818|    640|  if (size < SonyMnHeader::sizeOfSignature() + 14)
  ------------------
  |  Branch (818:7): [True: 15, False: 625]
  ------------------
  819|     15|    return nullptr;
  820|    625|  return newSony1Mn2(tag, group, IfdId::sony1Id);
  821|    640|}
_ZN5Exiv28Internal11newSony1Mn2EtNS_5IfdIdES1_:
  823|    907|std::unique_ptr<TiffIfdMakernote> newSony1Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  824|    907|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<SonyMnHeader>(), false);
  825|    907|}
_ZN5Exiv28Internal11newSony2Mn2EtNS_5IfdIdES1_:
  827|    929|std::unique_ptr<TiffIfdMakernote> newSony2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  828|    929|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, nullptr, true);
  829|    929|}
_ZN5Exiv28Internal10newCasioMnEtNS_5IfdIdES1_PKhmNS_9ByteOrderE:
  832|  1.10k|                                             ByteOrder) {
  833|  1.10k|  if (size > 6 && std::string(reinterpret_cast<const char*>(pData), 6) == std::string("QVC\0\0\0", 6))
  ------------------
  |  Branch (833:7): [True: 650, False: 454]
  |  Branch (833:7): [True: 66, False: 1.03k]
  |  Branch (833:19): [True: 66, False: 584]
  ------------------
  834|     66|    return newCasio2Mn2(tag, group, IfdId::casio2Id);
  835|       |  // Require at least an IFD with 1 entry, but not necessarily a next pointer
  836|  1.03k|  if (size < 14)
  ------------------
  |  Branch (836:7): [True: 490, False: 548]
  ------------------
  837|    490|    return nullptr;
  838|    548|  return newIfdMn2(tag, group, IfdId::casioId);
  839|  1.03k|}
_ZN5Exiv28Internal12newCasio2Mn2EtNS_5IfdIdES1_:
  841|     77|std::unique_ptr<TiffIfdMakernote> newCasio2Mn2(uint16_t tag, IfdId group, IfdId mnGroup) {
  842|     77|  return std::make_unique<TiffIfdMakernote>(tag, group, mnGroup, std::make_unique<Casio2MnHeader>());
  843|     77|}
_ZN5Exiv28Internal13nikonSelectorEtPKhmPNS0_13TiffComponentE:
  910|    892|int nikonSelector(uint16_t tag, const byte* pData, size_t size, TiffComponent* /*pRoot*/) {
  911|    892|  if (size < 4)
  ------------------
  |  Branch (911:7): [True: 11, False: 881]
  ------------------
  912|     11|    return -1;
  913|       |
  914|    881|  auto ix = NikonArrayIdx::Key{tag, reinterpret_cast<const char*>(pData), size};
  915|    881|  if (auto it = Exiv2::find(nikonArrayIdx, ix))
  ------------------
  |  Branch (915:12): [True: 559, False: 322]
  ------------------
  916|    559|    return it->idx_;
  917|    322|  return -1;
  918|    881|}
_ZN5Exiv28Internal10nikonCryptEtPKhmPNS0_13TiffComponentE:
  920|    636|DataBuf nikonCrypt(uint16_t tag, const byte* pData, size_t size, TiffComponent* pRoot) {
  921|    636|  DataBuf buf;
  922|       |
  923|    636|  if (size < 4)
  ------------------
  |  Branch (923:7): [True: 0, False: 636]
  ------------------
  924|      0|    return buf;
  925|    636|  auto nci = Exiv2::find(nikonArrayIdx, NikonArrayIdx::Key{tag, reinterpret_cast<const char*>(pData), size});
  926|    636|  if (!nci || nci->start_ == NA || size <= nci->start_)
  ------------------
  |  |  865|  1.27k|#define NA std::numeric_limits<uint32_t>::max()
  ------------------
  |  Branch (926:7): [True: 0, False: 636]
  |  Branch (926:15): [True: 63, False: 573]
  |  Branch (926:36): [True: 54, False: 519]
  ------------------
  927|    117|    return buf;
  928|       |
  929|       |  // Find Exif.Nikon3.ShutterCount
  930|    519|  TiffFinder finder(0x00a7, IfdId::nikon3Id);
  931|    519|  pRoot->accept(finder);
  932|    519|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  933|    519|  if (!te || !te->pValue() || te->pValue()->count() == 0)
  ------------------
  |  Branch (933:7): [True: 149, False: 370]
  |  Branch (933:14): [True: 25, False: 345]
  |  Branch (933:31): [True: 27, False: 318]
  ------------------
  934|    201|    return buf;
  935|    318|  auto count = te->pValue()->toUint32();
  936|       |
  937|       |  // Find Exif.Nikon3.SerialNumber
  938|    318|  finder.init(0x001d, IfdId::nikon3Id);
  939|    318|  pRoot->accept(finder);
  940|    318|  te = dynamic_cast<const TiffEntryBase*>(finder.result());
  941|    318|  if (!te || !te->pValue() || te->pValue()->count() == 0)
  ------------------
  |  Branch (941:7): [True: 46, False: 272]
  |  Branch (941:14): [True: 25, False: 247]
  |  Branch (941:31): [True: 75, False: 172]
  ------------------
  942|    146|    return buf;
  943|    172|  bool ok(false);
  944|    172|  auto serial = stringTo<uint32_t>(te->pValue()->toString(), ok);
  945|    172|  if (!ok) {
  ------------------
  |  Branch (945:7): [True: 144, False: 28]
  ------------------
  946|    144|    std::string model = getExifModel(pRoot);
  947|    144|    if (model.empty())
  ------------------
  |  Branch (947:9): [True: 67, False: 77]
  ------------------
  948|     67|      return buf;
  949|     77|    if (Internal::contains(model, "D50")) {
  ------------------
  |  Branch (949:9): [True: 33, False: 44]
  ------------------
  950|     33|      serial = 0x22;
  951|     44|    } else {
  952|     44|      serial = 0x60;
  953|     44|    }
  954|     77|  }
  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|    172|}
_ZN5Exiv28Internal14sonyCsSelectorEtPKhmPNS0_13TiffComponentE:
  961|    259|int sonyCsSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  962|    259|  std::string model = getExifModel(pRoot);
  963|    259|  if (model.empty())
  ------------------
  |  Branch (963:7): [True: 120, False: 139]
  ------------------
  964|    120|    return -1;
  965|    139|  int idx = 0;
  966|    139|  if (Internal::contains(model, "DSLR-A330") || Internal::contains(model, "DSLR-A380")) {
  ------------------
  |  Branch (966:7): [True: 20, False: 119]
  |  Branch (966:49): [True: 22, False: 97]
  ------------------
  967|     42|    idx = 1;
  968|     42|  }
  969|    139|  return idx;
  970|    259|}
_ZN5Exiv28Internal17sony2010eSelectorEtPKhmPNS0_13TiffComponentE:
  971|     99|int sony2010eSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  972|     99|  static constexpr const char* models[] = {
  973|     99|      "SLT-A58",   "SLT-A99",  "ILCE-3000", "ILCE-3500", "NEX-3N",    "NEX-5R",   "NEX-5T",
  974|     99|      "NEX-6",     "VG30E",    "VG900",     "DSC-RX100", "DSC-RX1",   "DSC-RX1R", "DSC-HX300",
  975|     99|      "DSC-HX50V", "DSC-TX30", "DSC-WX60",  "DSC-WX200", "DSC-WX300",
  976|     99|  };
  977|     99|  return Exiv2::find(models, getExifModel(pRoot)) ? 0 : -1;
  ------------------
  |  Branch (977:10): [True: 0, False: 99]
  ------------------
  978|     99|}
_ZN5Exiv28Internal15sony2FpSelectorEtPKhmPNS0_13TiffComponentE:
  980|    387|int sony2FpSelector(uint16_t /*tag*/, const byte* /*pData*/, size_t /*size*/, TiffComponent* pRoot) {
  981|       |  // Not valid for models beginning
  982|    387|  std::string model = getExifModel(pRoot);
  983|    387|  for (auto str : {"SLT-", "HV", "ILCA-"})
  ------------------
  |  Branch (983:17): [True: 1.12k, False: 361]
  ------------------
  984|  1.12k|    if (model.starts_with(str))
  ------------------
  |  Branch (984:9): [True: 26, False: 1.10k]
  ------------------
  985|     26|      return -1;
  986|    361|  return 0;
  987|    387|}
_ZN5Exiv28Internal18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentE:
  989|     73|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|     73|  auto value = getExifValue(pRoot, 0x9404, Exiv2::IfdId::sony1Id);
  995|     73|  if (!value) {
  ------------------
  |  Branch (995:7): [True: 21, False: 52]
  ------------------
  996|     21|    value = getExifValue(pRoot, 0x9404, Exiv2::IfdId::sony2Id);
  997|     21|    if (!value)
  ------------------
  |  Branch (997:9): [True: 0, False: 21]
  ------------------
  998|      0|      return -1;
  999|     21|  }
 1000|       |
 1001|     73|  if (value->count() < 4)
  ------------------
  |  Branch (1001:7): [True: 22, False: 51]
  ------------------
 1002|     22|    return -1;
 1003|       |
 1004|     51|  switch (value->toInt64(0)) {                 // Using encrypted values
 1005|      4|    case 231:                                  // 231 == 9
  ------------------
  |  Branch (1005:5): [True: 4, False: 47]
  ------------------
 1006|      6|    case 234:                                  // 234 == 12
  ------------------
  |  Branch (1006:5): [True: 2, False: 49]
  ------------------
 1007|      7|    case 205:                                  // 205 == 13
  ------------------
  |  Branch (1007:5): [True: 1, False: 50]
  ------------------
 1008|     10|    case 138:                                  // 138 == 15
  ------------------
  |  Branch (1008:5): [True: 3, False: 48]
  ------------------
 1009|     17|    case 112:                                  // 112 == 16
  ------------------
  |  Branch (1009:5): [True: 7, False: 44]
  ------------------
 1010|     17|      return value->toInt64(3) == 8 ? 0 : -1;  // 8   == 2
  ------------------
  |  Branch (1010:14): [True: 6, False: 11]
  ------------------
 1011|     34|    default:
  ------------------
  |  Branch (1011:5): [True: 34, False: 17]
  ------------------
 1012|     34|      break;
 1013|     51|  }
 1014|     34|  return -1;
 1015|     51|}
_ZN5Exiv28Internal18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentE:
 1016|    268|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|    268|  auto value = getExifValue(pRoot, 0x9400, Exiv2::IfdId::sony1Id);
 1022|    268|  if (!value) {
  ------------------
  |  Branch (1022:7): [True: 52, False: 216]
  ------------------
 1023|     52|    value = getExifValue(pRoot, 0x9400, Exiv2::IfdId::sony2Id);
 1024|     52|    if (!value)
  ------------------
  |  Branch (1024:9): [True: 0, False: 52]
  ------------------
 1025|      0|      return -1;
 1026|     52|  }
 1027|       |
 1028|    268|  if (value->count() < 1)
  ------------------
  |  Branch (1028:7): [True: 5, False: 263]
  ------------------
 1029|      5|    return -1;
 1030|       |
 1031|    263|  switch (value->toInt64()) {
 1032|     38|    case 35:  // 0x23 for DSC-RX10/HX60V/HX350/HX400V/WX220/WX350, ILCE-7/7R/5000/6000, ILCA-68/77M2
  ------------------
  |  Branch (1032:5): [True: 38, False: 225]
  ------------------
 1033|     57|    case 36:  // 0x24 for ILCA-99M2,ILCE-5100/6300/6500/7M2/7RM2/7S/7SM2/QX1,
  ------------------
  |  Branch (1033:5): [True: 19, False: 244]
  ------------------
 1034|       |              // DSC-HX80/HX90V/QX30/RX0/RX100M3/RX100M4/RX100M5/RX10M2/RX10M3/RX1RM2/WX500
 1035|     77|    case 38:  // 0x26 for ILCE-6100/6400/6600/7M3/7RM3/9, DSC-RX0M2/RX10M4/RX100M5A/RX100M6/HX95/HX99
  ------------------
  |  Branch (1035:5): [True: 20, False: 243]
  ------------------
 1036|    112|    case 40:  // 0x28 for ILCE-7RM4/9M2, DSC-RX100M7, ZV-1/1F/1M2/E10
  ------------------
  |  Branch (1036:5): [True: 35, False: 228]
  ------------------
 1037|    132|    case 49:  // 0x31 for ILCE-1/7M4/7SM3, ILME-FX3
  ------------------
  |  Branch (1037:5): [True: 20, False: 243]
  ------------------
 1038|    166|    case 50:  // 0x32 for ILCE-7RM5, ILME-FX30
  ------------------
  |  Branch (1038:5): [True: 34, False: 229]
  ------------------
 1039|    200|    case 51:  // 0x33 for ILCE-6700/7CM2/7CR/9M3, ZV-E1
  ------------------
  |  Branch (1039:5): [True: 34, False: 229]
  ------------------
 1040|    218|    case 65:  // 0x41 for ILCE-7M5
  ------------------
  |  Branch (1040:5): [True: 18, False: 245]
  ------------------
 1041|    218|      return 0;
 1042|     45|    default:
  ------------------
  |  Branch (1042:5): [True: 45, False: 218]
  ------------------
 1043|     45|      break;
 1044|    263|  }
 1045|     45|  return -1;
 1046|    263|}
makernote_int.cpp:_ZN12_GLOBAL__N_112getExifValueEPN5Exiv28Internal13TiffComponentEtNS0_5IfdIdE:
 1052|  1.30k|const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, uint16_t tag, Exiv2::IfdId group) {
 1053|  1.30k|  Exiv2::Internal::TiffFinder finder(tag, group);
 1054|  1.30k|  if (!pRoot)
  ------------------
  |  Branch (1054:7): [True: 0, False: 1.30k]
  ------------------
 1055|      0|    return nullptr;
 1056|  1.30k|  pRoot->accept(finder);
 1057|  1.30k|  auto te = dynamic_cast<const Exiv2::Internal::TiffEntryBase*>(finder.result());
 1058|  1.30k|  return (!te || !te->pValue()) ? nullptr : te->pValue();
  ------------------
  |  Branch (1058:11): [True: 327, False: 976]
  |  Branch (1058:18): [True: 109, False: 867]
  ------------------
 1059|  1.30k|}
makernote_int.cpp:_ZN12_GLOBAL__N_112getExifModelEPN5Exiv28Internal13TiffComponentE:
 1061|    889|std::string getExifModel(Exiv2::Internal::TiffComponent* pRoot) {
 1062|       |  // Lookup the Exif.Image.Model tag
 1063|    889|  const auto value = getExifValue(pRoot, 0x0110, Exiv2::IfdId::ifd0Id);
 1064|    889|  return (!value || value->count() == 0) ? std::string() : value->toString();
  ------------------
  |  Branch (1064:11): [True: 363, False: 526]
  |  Branch (1064:21): [True: 100, False: 426]
  ------------------
 1065|    889|}
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|  35.7k|  for (uint32_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (1105:24): [True: 35.6k, False: 105]
  ------------------
 1106|  35.6k|    cj += ci * ck++;
 1107|  35.6k|    pData[i] ^= cj;
 1108|  35.6k|  }
 1109|    105|}
_ZNK5Exiv28Internal13NikonArrayIdxeqERKNS1_3KeyE:
  854|  23.8k|  bool operator==(const Key& key) const {
  855|  23.8k|    return key.tag_ == tag_ && 0 == strncmp(key.ver_, ver_, strlen(ver_)) && (size_ == 0 || key.size_ == size_);
  ------------------
  |  Branch (855:12): [True: 7.19k, False: 16.6k]
  |  Branch (855:32): [True: 1.28k, False: 5.91k]
  |  Branch (855:79): [True: 1.19k, False: 85]
  |  Branch (855:93): [True: 0, False: 85]
  ------------------
  856|  23.8k|  }

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  599|  3.12k|MatroskaVideo::MatroskaVideo(BasicIo::UniquePtr io) : Image(ImageType::mkv, mdNone, std::move(io)) {
  600|  3.12k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  602|  3.12k|std::string MatroskaVideo::mimeType() const {
  603|  3.12k|  return "video/matroska";
  604|  3.12k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  606|  1.85k|void MatroskaVideo::writeMetadata() {
  607|  1.85k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  609|  3.12k|void MatroskaVideo::readMetadata() {
  610|  3.12k|  if (io_->open() != 0)
  ------------------
  |  Branch (610:7): [True: 0, False: 3.12k]
  ------------------
  611|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  612|       |
  613|       |  // Ensure that this is the correct image type
  614|  3.12k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 3.12k]
  ------------------
  615|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (615:9): [True: 0, False: 0]
  |  Branch (615:25): [True: 0, False: 0]
  ------------------
  616|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  617|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  618|      0|  }
  619|       |
  620|  3.12k|  IoCloser closer(*io_);
  621|  3.12k|  clearMetadata();
  622|  3.12k|  continueTraversing_ = true;
  623|  3.12k|  height_ = width_ = 1;
  624|       |
  625|  3.12k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  626|  3.12k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  627|       |
  628|   162k|  while (continueTraversing_)
  ------------------
  |  Branch (628:10): [True: 159k, False: 3.12k]
  ------------------
  629|   159k|    decodeBlock();
  630|       |
  631|  3.12k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  632|  3.12k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  634|   159k|void MatroskaVideo::decodeBlock() {
  635|   159k|  byte buf[8];
  636|   159k|  io_->read(buf, 1);
  637|       |
  638|   159k|  if (io_->eof()) {
  ------------------
  |  Branch (638:7): [True: 344, False: 159k]
  ------------------
  639|    344|    continueTraversing_ = false;
  640|    344|    return;
  641|    344|  }
  642|       |
  643|   159k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  644|   159k|  if (block_size > 0)
  ------------------
  |  Branch (644:7): [True: 158k, False: 444]
  ------------------
  645|   158k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  646|       |
  647|   159k|  auto tag_id = returnTagValue(buf, block_size);
  648|   159k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  649|       |
  650|   159k|  if (!tag) {
  ------------------
  |  Branch (650:7): [True: 1.64k, False: 157k]
  ------------------
  651|  1.64k|    continueTraversing_ = false;
  652|  1.64k|    return;
  653|  1.64k|  }
  654|       |
  655|       |  // tag->dump(std::cout);
  656|       |
  657|   157k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (657:7): [True: 503, False: 157k]
  |  Branch (657:27): [True: 1, False: 157k]
  ------------------
  658|      2|    continueTraversing_ = false;
  659|      2|    return;
  660|      2|  }
  661|       |
  662|   157k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  663|   157k|  block_size = findBlockSize(buf[0]);  // 0-8
  664|       |
  665|   157k|  if (block_size > 0)
  ------------------
  |  Branch (665:7): [True: 157k, False: 607]
  ------------------
  666|   157k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  667|   157k|  size_t size = returnTagValue(buf, block_size);
  668|       |
  669|   157k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (669:7): [True: 94.6k, False: 63.1k]
  |  Branch (669:29): [True: 94.6k, False: 0]
  ------------------
  670|  94.6k|    return;
  671|       |
  672|  63.1k|  const size_t bufMaxSize = 200;
  673|       |
  674|  63.1k|#ifndef SUPPRESS_WARNINGS
  675|  63.1k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (675:7): [True: 61.1k, False: 2.07k]
  |  Branch (675:28): [True: 197, False: 60.9k]
  ------------------
  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|  63.1k|#endif
  680|  63.1k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (680:7): [True: 2.07k, False: 61.1k]
  |  Branch (680:27): [True: 197, False: 60.9k]
  ------------------
  681|  1.64k|    io_->seek(size, BasicIo::cur);
  682|  1.64k|    return;
  683|  1.64k|  }
  684|       |
  685|  61.5k|  DataBuf buf2(bufMaxSize + 1);
  686|  61.5k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  687|  61.5k|  switch (tag->_type) {
  688|  14.0k|    case InternalField:
  ------------------
  |  Branch (688:5): [True: 14.0k, False: 47.5k]
  ------------------
  689|  14.0k|      decodeInternalTags(tag, buf2.data());
  690|  14.0k|      break;
  691|  6.11k|    case String:
  ------------------
  |  Branch (691:5): [True: 6.11k, False: 55.4k]
  ------------------
  692|  6.11k|    case Utf8:
  ------------------
  |  Branch (692:5): [True: 0, False: 61.5k]
  ------------------
  693|  6.11k|      decodeStringTags(tag, buf2.data());
  694|  6.11k|      break;
  695|  16.3k|    case Integer:
  ------------------
  |  Branch (695:5): [True: 16.3k, False: 45.1k]
  ------------------
  696|  20.7k|    case UInteger:
  ------------------
  |  Branch (696:5): [True: 4.43k, False: 57.0k]
  ------------------
  697|  20.7k|      decodeIntegerTags(tag, buf2.data());
  698|  20.7k|      break;
  699|  14.8k|    case Boolean:
  ------------------
  |  Branch (699:5): [True: 14.8k, False: 46.6k]
  ------------------
  700|  14.8k|      decodeBooleanTags(tag, buf2.data());
  701|  14.8k|      break;
  702|  1.89k|    case Date:
  ------------------
  |  Branch (702:5): [True: 1.89k, False: 59.6k]
  ------------------
  703|  1.89k|      decodeDateTags(tag, buf2.data(), size);
  704|  1.89k|      break;
  705|  3.01k|    case Float:
  ------------------
  |  Branch (705:5): [True: 3.01k, False: 58.5k]
  ------------------
  706|  3.01k|      decodeFloatTags(tag, buf2.data());
  707|  3.01k|      break;
  708|      0|    case Binary:
  ------------------
  |  Branch (708:5): [True: 0, False: 61.5k]
  ------------------
  709|      0|      break;
  710|      0|    case Master:
  ------------------
  |  Branch (710:5): [True: 0, False: 61.5k]
  ------------------
  711|      0|      break;
  712|      0|    default:
  ------------------
  |  Branch (712:5): [True: 0, False: 61.5k]
  ------------------
  713|      0|      break;
  714|  61.5k|  }
  715|  61.5k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  717|  14.0k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  718|  14.0k|  uint64_t key = getULongLong(buf, bigEndian);
  719|  14.0k|  if (!key)
  ------------------
  |  Branch (719:7): [True: 228, False: 13.7k]
  ------------------
  720|    228|    return;
  721|       |
  722|  13.7k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  13.7k|    switch (tag->_id) {
  724|  13.7k|      case Xmp_video_VideoScanTpye:
  725|  13.7k|        return Exiv2::find(videoScanType, key);
  726|  13.7k|      case Xmp_audio_ChannelType:
  727|  13.7k|        return Exiv2::find(audioChannels, key);
  728|  13.7k|      case Xmp_video_ContentCompressAlgo:
  729|  13.7k|        return Exiv2::find(compressionAlgorithm, key);
  730|  13.7k|      case Xmp_video_ContentEncryptAlgo:
  731|  13.7k|        return Exiv2::find(encryptionAlgorithm, key);
  732|  13.7k|      case Xmp_video_ContentSignAlgo_1:
  733|  13.7k|      case Xmp_video_ContentSignAlgo_2:
  734|  13.7k|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|  13.7k|      case Xmp_video_ContentSignHashAlgo_1:
  736|  13.7k|      case Xmp_video_ContentSignHashAlgo_2:
  737|  13.7k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  13.7k|      case Xmp_video_ContentEncodingType:
  739|  13.7k|        return Exiv2::find(encodingType, key);
  740|  13.7k|      case Xmp_video_DisplayUnit:
  741|  13.7k|        return Exiv2::find(displayUnit, key);
  742|  13.7k|      case Xmp_video_AspectRatioType:
  743|  13.7k|        return Exiv2::find(aspectRatioType, key);
  744|  13.7k|      case Xmp_video_PhysicalEquivalent:
  745|  13.7k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|  13.7k|      case Xmp_video_TranslateCodec:
  747|  13.7k|        return Exiv2::find(chapterTranslateCodec, key);
  748|  13.7k|      case Video_Audio_CodecID:
  749|  13.7k|        return Exiv2::find(trackCodec, key);
  750|  13.7k|      case Video_Audio_CodecName:
  751|  13.7k|        return Exiv2::find(codecInfo, key);
  752|  13.7k|      case CodecDownloadURL:
  753|  13.7k|      case CodecInfoURL:
  754|  13.7k|        return Exiv2::find(codecDownloadUrl, key);
  755|  13.7k|    }
  756|  13.7k|    return nullptr;
  757|  13.7k|  }();
  758|  13.7k|  if (internalMt) {
  ------------------
  |  Branch (758:7): [True: 5.59k, False: 8.19k]
  ------------------
  759|  5.59k|    xmpData_[tag->_label] = internalMt->_label;
  760|  8.19k|  } else {
  761|  8.19k|    xmpData_[tag->_label] = key;
  762|  8.19k|  }
  763|  13.7k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  765|  6.11k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  766|  6.11k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (766:7): [True: 1.65k, False: 4.46k]
  ------------------
  767|  1.65k|    track_count_++;
  768|  1.65k|    xmpData_[tag->_label] = track_count_;
  769|  4.46k|  } else {
  770|  4.46k|    xmpData_[tag->_label] = buf;
  771|  4.46k|  }
  772|  6.11k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  774|  20.7k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  775|  20.7k|  uint64_t value = getULongLong(buf, bigEndian);
  776|  20.7k|  if (!value)
  ------------------
  |  Branch (776:7): [True: 17.2k, False: 3.50k]
  ------------------
  777|  17.2k|    return;
  778|       |
  779|  3.50k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (779:7): [True: 1.41k, False: 2.08k]
  |  Branch (779:40): [True: 723, False: 1.36k]
  ------------------
  780|  2.14k|    width_ = value;
  781|  3.50k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (781:7): [True: 659, False: 2.84k]
  |  Branch (781:41): [True: 456, False: 2.38k]
  ------------------
  782|  1.11k|    height_ = value;
  783|  3.50k|  xmpData_[tag->_label] = value;
  784|  3.50k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  786|  14.8k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  787|  14.8k|  const MatroskaTag* internalMt = nullptr;
  788|  14.8k|  uint64_t key = getULongLong(buf, bigEndian);
  789|  14.8k|  if (!key)
  ------------------
  |  Branch (789:7): [True: 4.95k, False: 9.88k]
  ------------------
  790|  4.95k|    return;
  791|       |
  792|  9.88k|  switch (tag->_id) {
  793|  5.79k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (793:5): [True: 5.79k, False: 4.09k]
  ------------------
  794|  5.79k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (794:16): [True: 411, False: 5.38k]
  ------------------
  795|    411|        stream_ = f->_id;
  796|    411|      }
  797|  5.79k|      break;
  798|    360|    case TrackUsed:
  ------------------
  |  Branch (798:5): [True: 360, False: 9.52k]
  ------------------
  799|    360|      internalMt = Exiv2::find(trackEnable, key);
  800|    360|      break;
  801|    940|    case TrackDefault:
  ------------------
  |  Branch (801:5): [True: 940, False: 8.94k]
  ------------------
  802|    940|      internalMt = Exiv2::find(defaultOn, key);
  803|    940|      break;
  804|  1.01k|    case TrackForced:
  ------------------
  |  Branch (804:5): [True: 1.01k, False: 8.87k]
  ------------------
  805|  1.01k|      internalMt = Exiv2::find(trackForced, key);
  806|  1.01k|      break;
  807|    543|    case TrackLacing:
  ------------------
  |  Branch (807:5): [True: 543, False: 9.34k]
  ------------------
  808|    543|      internalMt = Exiv2::find(trackLacing, key);
  809|    543|      break;
  810|    734|    case CodecDecodeAll:
  ------------------
  |  Branch (810:5): [True: 734, False: 9.15k]
  ------------------
  811|    734|      internalMt = Exiv2::find(codecDecodeAll, key);
  812|    734|      break;
  813|    244|    case CodecSettings:
  ------------------
  |  Branch (813:5): [True: 244, False: 9.64k]
  ------------------
  814|    244|      internalMt = Exiv2::find(codecSettings, key);
  815|    244|      break;
  816|    261|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (816:5): [True: 261, False: 9.62k]
  ------------------
  817|    261|      internalMt = tag;
  818|    261|      break;
  819|      0|    default:
  ------------------
  |  Branch (819:5): [True: 0, False: 9.88k]
  ------------------
  820|      0|      break;
  821|  9.88k|  }
  822|       |
  823|  9.88k|  if (internalMt) {
  ------------------
  |  Branch (823:7): [True: 1.84k, False: 8.04k]
  ------------------
  824|  1.84k|    xmpData_[internalMt->_label] = "Yes";
  825|  1.84k|  }
  826|  9.88k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  828|  1.89k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  829|  1.89k|  int64_t duration_in_ms = 0;
  830|  1.89k|  uint64_t value;
  831|  1.89k|  switch (tag->_id) {
  832|    708|    case Xmp_video_Duration:
  ------------------
  |  Branch (832:5): [True: 708, False: 1.18k]
  ------------------
  833|    708|      if (size <= 4) {
  ------------------
  |  Branch (833:11): [True: 481, False: 227]
  ------------------
  834|    481|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  835|    481|      } else {
  836|    227|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  837|    227|      }
  838|    708|      xmpData_[tag->_label] = duration_in_ms;
  839|    708|      break;
  840|    508|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (840:5): [True: 508, False: 1.38k]
  ------------------
  841|    508|      value = getULongLong(buf, bigEndian);
  842|    508|      if (!value)
  ------------------
  |  Branch (842:11): [True: 289, False: 219]
  ------------------
  843|    289|        return;
  844|    219|      duration_in_ms = value / 1000000000;
  845|    219|      xmpData_[tag->_label] = duration_in_ms;
  846|    219|      break;
  847|       |
  848|    674|    case TimecodeScale:
  ------------------
  |  Branch (848:5): [True: 674, False: 1.21k]
  ------------------
  849|    674|      value = getULongLong(buf, bigEndian);
  850|    674|      if (!value)
  ------------------
  |  Branch (850:11): [True: 518, False: 156]
  ------------------
  851|    518|        return;
  852|    156|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  853|    156|      xmpData_[tag->_label] = time_code_scale_;
  854|    156|      break;
  855|      0|    default:
  ------------------
  |  Branch (855:5): [True: 0, False: 1.89k]
  ------------------
  856|      0|      break;
  857|  1.89k|  }
  858|  1.89k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  860|  3.01k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  861|  3.01k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  862|       |
  863|  3.01k|  switch (tag->_id) {
  864|  1.13k|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (864:5): [True: 1.13k, False: 1.87k]
  ------------------
  865|  1.42k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (865:5): [True: 281, False: 2.73k]
  ------------------
  866|  1.42k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  867|  1.42k|      break;
  868|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (868:5): [True: 0, False: 3.01k]
  ------------------
  869|  1.59k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (869:5): [True: 1.59k, False: 1.42k]
  ------------------
  870|  1.59k|      uint64_t key = getULongLong(buf, bigEndian);
  871|  1.59k|      if (!key)
  ------------------
  |  Branch (871:11): [True: 178, False: 1.42k]
  ------------------
  872|    178|        return;
  873|  1.42k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (873:16): [True: 817, False: 603]
  ------------------
  874|    817|        double frame_rate = 0;
  875|    817|        switch (stream_) {
  876|    419|          case 1:  // video
  ------------------
  |  Branch (876:11): [True: 419, False: 398]
  ------------------
  877|    419|            frame_rate = 1000000000.0 / static_cast<double>(key);
  878|    419|            break;
  879|     44|          case 2:  // audio
  ------------------
  |  Branch (879:11): [True: 44, False: 773]
  ------------------
  880|     44|            frame_rate = static_cast<double>(key) / 1000;
  881|     44|            break;
  882|    354|          default:
  ------------------
  |  Branch (882:11): [True: 354, False: 463]
  ------------------
  883|    354|            break;
  884|    817|        }
  885|    817|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (885:13): [True: 463, False: 354]
  ------------------
  886|    463|          xmpData_[internalMt->_label] = frame_rate;
  887|    817|      } else
  888|    603|        xmpData_[tag->_label] = "Variable Bit Rate";
  889|  1.42k|    } break;
  890|  1.42k|    default:
  ------------------
  |  Branch (890:5): [True: 0, False: 3.01k]
  ------------------
  891|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  892|      0|      break;
  893|  3.01k|  }
  894|  3.01k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  896|   316k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  897|   316k|  if (b & 128)
  ------------------
  |  Branch (897:7): [True: 273k, False: 43.3k]
  ------------------
  898|   273k|    return 1;
  899|  43.3k|  if (b & 64)
  ------------------
  |  Branch (899:7): [True: 25.4k, False: 17.9k]
  ------------------
  900|  25.4k|    return 2;
  901|  17.9k|  if (b & 32)
  ------------------
  |  Branch (901:7): [True: 4.26k, False: 13.6k]
  ------------------
  902|  4.26k|    return 3;
  903|  13.6k|  if (b & 16)
  ------------------
  |  Branch (903:7): [True: 7.25k, False: 6.38k]
  ------------------
  904|  7.25k|    return 4;
  905|  6.38k|  if (b & 8)
  ------------------
  |  Branch (905:7): [True: 2.45k, False: 3.93k]
  ------------------
  906|  2.45k|    return 5;
  907|  3.93k|  if (b & 4)
  ------------------
  |  Branch (907:7): [True: 390, False: 3.54k]
  ------------------
  908|    390|    return 6;
  909|  3.54k|  if (b & 2)
  ------------------
  |  Branch (909:7): [True: 471, False: 3.06k]
  ------------------
  910|    471|    return 7;
  911|  3.06k|  if (b & 1)
  ------------------
  |  Branch (911:7): [True: 2.55k, False: 519]
  ------------------
  912|  2.55k|    return 8;
  913|    519|  return 0;
  914|  3.06k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  916|  3.12k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, bool /*create*/) {
  917|  3.12k|  auto image = std::make_unique<MatroskaVideo>(std::move(io));
  918|  3.12k|  if (!image->good()) {
  ------------------
  |  Branch (918:7): [True: 0, False: 3.12k]
  ------------------
  919|      0|    return nullptr;
  920|      0|  }
  921|  3.12k|  return image;
  922|  3.12k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  924|  13.1k|bool isMkvType(BasicIo& iIo, bool advance) {
  925|  13.1k|  bool result = true;
  926|  13.1k|  byte tmpBuf[4];
  927|  13.1k|  iIo.read(tmpBuf, 4);
  928|       |
  929|  13.1k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (929:7): [True: 0, False: 13.1k]
  |  Branch (929:22): [True: 357, False: 12.7k]
  ------------------
  930|    357|    return false;
  931|       |
  932|  12.7k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (932:7): [True: 3.33k, False: 9.42k]
  |  Branch (932:28): [True: 23, False: 9.40k]
  |  Branch (932:49): [True: 22, False: 9.38k]
  |  Branch (932:70): [True: 20, False: 9.36k]
  ------------------
  933|  3.39k|    result = false;
  934|  3.39k|  }
  935|       |
  936|  12.7k|  if (!advance || !result)
  ------------------
  |  Branch (936:7): [True: 12.7k, False: 0]
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|  12.7k|    iIo.seek(0, BasicIo::beg);
  938|  12.7k|  return result;
  939|  13.1k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   316k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   316k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 316k, False: 519]
  |  Branch (583:23): [True: 316k, False: 0]
  ------------------
  584|       |
  585|   316k|  size_t b0 = buf[0] & (0xff >> size);
  586|   316k|  size_t tag = b0 << ((size - 1) * 8);
  587|   404k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 87.9k, False: 316k]
  ------------------
  588|  87.9k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  87.9k|  }
  590|       |
  591|   316k|  return tag;
  592|   316k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  722|  13.7k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  13.7k|    switch (tag->_id) {
  ------------------
  |  Branch (723:13): [True: 13.7k, False: 0]
  ------------------
  724|    599|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (724:7): [True: 599, False: 13.1k]
  ------------------
  725|    599|        return Exiv2::find(videoScanType, key);
  726|  1.13k|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (726:7): [True: 1.13k, False: 12.6k]
  ------------------
  727|  1.13k|        return Exiv2::find(audioChannels, key);
  728|    986|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (728:7): [True: 986, False: 12.8k]
  ------------------
  729|    986|        return Exiv2::find(compressionAlgorithm, key);
  730|    941|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (730:7): [True: 941, False: 12.8k]
  ------------------
  731|    941|        return Exiv2::find(encryptionAlgorithm, key);
  732|    207|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (732:7): [True: 207, False: 13.5k]
  ------------------
  733|    626|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (733:7): [True: 419, False: 13.3k]
  ------------------
  734|    626|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|    158|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (735:7): [True: 158, False: 13.6k]
  ------------------
  736|  1.09k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (736:7): [True: 933, False: 12.8k]
  ------------------
  737|  1.09k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  4.26k|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (738:7): [True: 4.26k, False: 9.53k]
  ------------------
  739|  4.26k|        return Exiv2::find(encodingType, key);
  740|    870|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (740:7): [True: 870, False: 12.9k]
  ------------------
  741|    870|        return Exiv2::find(displayUnit, key);
  742|    181|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (742:7): [True: 181, False: 13.6k]
  ------------------
  743|    181|        return Exiv2::find(aspectRatioType, key);
  744|  2.34k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (744:7): [True: 2.34k, False: 11.4k]
  ------------------
  745|  2.34k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|    547|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (746:7): [True: 547, False: 13.2k]
  ------------------
  747|    547|        return Exiv2::find(chapterTranslateCodec, key);
  748|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (748:7): [True: 0, False: 13.7k]
  ------------------
  749|      0|        return Exiv2::find(trackCodec, key);
  750|    104|      case Video_Audio_CodecName:
  ------------------
  |  Branch (750:7): [True: 104, False: 13.6k]
  ------------------
  751|    104|        return Exiv2::find(codecInfo, key);
  752|     12|      case CodecDownloadURL:
  ------------------
  |  Branch (752:7): [True: 12, False: 13.7k]
  ------------------
  753|    108|      case CodecInfoURL:
  ------------------
  |  Branch (753:7): [True: 96, False: 13.6k]
  ------------------
  754|    108|        return Exiv2::find(codecDownloadUrl, key);
  755|  13.7k|    }
  756|      0|    return nullptr;
  757|  13.7k|  }();

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

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

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

_ZN5Exiv28Internal15Nikon1MakerNote7tagListEv:
   38|    536|  static constexpr auto tagList() {
   39|    536|    return tagInfo_;
   40|    536|  }
_ZN5Exiv28Internal15Nikon2MakerNote7tagListEv:
   71|    427|  static constexpr auto tagList() {
   72|    427|    return tagInfo_;
   73|    427|  }
_ZN5Exiv28Internal15Nikon3MakerNote7tagListEv:
   91|  12.4k|  static constexpr auto tagList() {
   92|  12.4k|    return tagInfo_;
   93|  12.4k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListVrEv:
   95|    796|  static constexpr auto tagListVr() {
   96|    796|    return tagInfoVr_;
   97|    796|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListPcEv:
   99|    533|  static constexpr auto tagListPc() {
  100|    533|    return tagInfoPc_;
  101|    533|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListWtEv:
  103|    280|  static constexpr auto tagListWt() {
  104|    280|    return tagInfoWt_;
  105|    280|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListIiEv:
  107|    562|  static constexpr auto tagListIi() {
  108|    562|    return tagInfoIi_;
  109|    562|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListAfEv:
  111|  1.31k|  static constexpr auto tagListAf() {
  112|  1.31k|    return tagInfoAf_;
  113|  1.31k|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf21Ev:
  115|    523|  static constexpr auto tagListAf21() {
  116|    523|    return tagInfoAf21_;
  117|    523|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf22Ev:
  119|    615|  static constexpr auto tagListAf22() {
  120|    615|    return tagInfoAf22_;
  121|    615|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListAFTEv:
  123|    946|  static constexpr auto tagListAFT() {
  124|    946|    return tagInfoAFT_;
  125|    946|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListFiEv:
  127|    102|  static constexpr auto tagListFi() {
  128|    102|    return tagInfoFi_;
  129|    102|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListMeEv:
  131|     68|  static constexpr auto tagListMe() {
  132|     68|    return tagInfoMe_;
  133|     68|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl1Ev:
  135|     51|  static constexpr auto tagListFl1() {
  136|     51|    return tagInfoFl1_;
  137|     51|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl2Ev:
  139|     44|  static constexpr auto tagListFl2() {
  140|     44|    return tagInfoFl2_;
  141|     44|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl3Ev:
  143|     23|  static constexpr auto tagListFl3() {
  144|     23|    return tagInfoFl3_;
  145|     23|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl6Ev:
  147|     72|  static constexpr auto tagListFl6() {
  148|     72|    return tagInfoFl6_;
  149|     72|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl7Ev:
  151|     87|  static constexpr auto tagListFl7() {
  152|     87|    return tagInfoFl7_;
  153|     87|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi1Ev:
  155|    137|  static constexpr auto tagListSi1() {
  156|    137|    return tagInfoSi1_;
  157|    137|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi2Ev:
  159|     78|  static constexpr auto tagListSi2() {
  160|     78|    return tagInfoSi2_;
  161|     78|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi5Ev:
  171|    537|  static constexpr auto tagListSi5() {
  172|    537|    return tagInfoSi5_;
  173|    537|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb1Ev:
  175|     14|  static constexpr auto tagListCb1() {
  176|     14|    return tagInfoCb1_;
  177|     14|  }
_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|    158|  static constexpr auto tagListCb2b() {
  188|    158|    return tagInfoCb2b_;
  189|    158|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb3Ev:
  191|     15|  static constexpr auto tagListCb3() {
  192|     15|    return tagInfoCb3_;
  193|     15|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb4Ev:
  195|     88|  static constexpr auto tagListCb4() {
  196|     88|    return tagInfoCb4_;
  197|     88|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd1Ev:
  199|    364|  static constexpr auto tagListLd1() {
  200|    364|    return tagInfoLd1_;
  201|    364|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd2Ev:
  203|  4.57k|  static constexpr auto tagListLd2() {
  204|  4.57k|    return tagInfoLd2_;
  205|  4.57k|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd3Ev:
  207|     78|  static constexpr auto tagListLd3() {
  208|     78|    return tagInfoLd3_;
  209|     78|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd4Ev:
  211|    700|  static constexpr auto tagListLd4() {
  212|    700|    return tagInfoLd4_;
  213|    700|  }

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

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

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

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

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

_ZN5Exiv28PgfImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   53|    822|    Image(ImageType::pgf, mdExif | mdIptc | mdXmp | mdComment, std::move(io)), bSwap_(isBigEndianPlatform()) {
   54|    822|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (54:7): [True: 0, False: 822]
  |  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|    822|}  // PgfImage::PgfImage
_ZN5Exiv28PgfImage12readMetadataEv:
   67|    822|void PgfImage::readMetadata() {
   68|       |#ifdef EXIV2_DEBUG_MESSAGES
   69|       |  std::cerr << "Exiv2::PgfImage::readMetadata: Reading PGF file " << io_->path() << "\n";
   70|       |#endif
   71|    822|  if (io_->open() != 0) {
  ------------------
  |  Branch (71:7): [True: 0, False: 822]
  ------------------
   72|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   73|      0|  }
   74|    822|  IoCloser closer(*io_);
   75|       |  // Ensure that this is the correct image type
   76|    822|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (76:7): [True: 0, False: 822]
  ------------------
   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|    822|  clearMetadata();
   82|       |
   83|    822|  readPgfMagicNumber(*io_);
   84|       |
   85|    822|  size_t headerSize = readPgfHeaderSize(*io_);
   86|    822|  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|    822|  Internal::enforce(headerSize <= std::numeric_limits<size_t>::max() - 8, ErrorCode::kerCorruptedMetadata);
   91|    822|  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|    822|  if (size > io_->size())
  ------------------
  |  Branch (97:7): [True: 96, False: 726]
  ------------------
   98|     96|    throw Error(ErrorCode::kerInputDataReadFailed);
   99|    726|  if (size == 0)
  ------------------
  |  Branch (99:7): [True: 22, False: 704]
  ------------------
  100|     22|    return;
  101|       |
  102|    704|  DataBuf imgData(size);
  103|    704|  const size_t bufRead = io_->read(imgData.data(), imgData.size());
  104|    704|  if (io_->error())
  ------------------
  |  Branch (104:7): [True: 0, False: 704]
  ------------------
  105|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  106|    704|  if (bufRead != imgData.size())
  ------------------
  |  Branch (106:7): [True: 15, False: 689]
  ------------------
  107|     15|    throw Error(ErrorCode::kerInputDataReadFailed);
  108|       |
  109|    689|  auto image = Exiv2::ImageFactory::open(imgData.c_data(), imgData.size());
  110|    689|  image->readMetadata();
  111|    689|  exifData() = image->exifData();
  112|    689|  iptcData() = image->iptcData();
  113|    689|  xmpData() = image->xmpData();
  114|    689|}
_ZN5Exiv28PgfImage13writeMetadataEv:
  116|    365|void PgfImage::writeMetadata() {
  117|    365|  if (io_->open() != 0) {
  ------------------
  |  Branch (117:7): [True: 0, False: 365]
  ------------------
  118|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  119|      0|  }
  120|    365|  IoCloser closer(*io_);
  121|    365|  MemIo tempIo;
  122|       |
  123|    365|  doWriteMetadata(tempIo);  // may throw
  124|    365|  io_->close();
  125|    365|  io_->transfer(tempIo);  // may throw
  126|       |
  127|    365|}  // PgfImage::writeMetadata
_ZN5Exiv28PgfImage15doWriteMetadataERNS_7BasicIoE:
  129|    365|void PgfImage::doWriteMetadata(BasicIo& outIo) {
  130|    365|  if (!io_->isopen())
  ------------------
  |  Branch (130:7): [True: 0, False: 365]
  ------------------
  131|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  132|    365|  if (!outIo.isopen())
  ------------------
  |  Branch (132:7): [True: 0, False: 365]
  ------------------
  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|    365|  if (!isPgfType(*io_, true)) {
  ------------------
  |  Branch (141:7): [True: 0, False: 365]
  ------------------
  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|    365|  byte mnb = readPgfMagicNumber(*io_);
  149|       |
  150|    365|  readPgfHeaderSize(*io_);
  151|       |
  152|    365|  uint32_t w = 0;
  153|    365|  uint32_t h = 0;
  154|    365|  DataBuf header = readPgfHeaderStructure(*io_, w, h);
  155|       |
  156|    365|  auto img = ImageFactory::create(ImageType::png);
  157|       |
  158|    365|  img->setExifData(exifData_);
  159|    365|  img->setIptcData(iptcData_);
  160|    365|  img->setXmpData(xmpData_);
  161|    365|  img->writeMetadata();
  162|    365|  size_t imgSize = img->io().size();
  163|    365|  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|    365|  if (outIo.write(pgfSignature.data(), 3) != 3)
  ------------------
  |  Branch (172:7): [True: 0, False: 365]
  ------------------
  173|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  174|       |
  175|       |  // Write Magic number.
  176|    365|  if (outIo.putb(mnb) == EOF)
  ------------------
  |  Branch (176:7): [True: 0, False: 365]
  ------------------
  177|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  178|       |
  179|       |  // Write new Header size.
  180|    365|  auto newHeaderSize = static_cast<uint32_t>(header.size() + imgSize);
  181|    365|  DataBuf buffer(4);
  182|    365|  std::memcpy(buffer.data(), &newHeaderSize, sizeof(uint32_t));
  183|    365|  byteSwap_(buffer, 0, bSwap_);
  184|    365|  if (outIo.write(buffer.c_data(), 4) != 4)
  ------------------
  |  Branch (184:7): [True: 0, False: 365]
  ------------------
  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|    365|  if (outIo.write(header.c_data(), header.size()) != header.size())
  ------------------
  |  Branch (197:7): [True: 0, False: 365]
  ------------------
  198|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  199|       |
  200|       |  // Write new metadata byte array.
  201|    365|  if (outIo.write(imgBuf.c_data(), imgBuf.size()) != imgBuf.size())
  ------------------
  |  Branch (201:7): [True: 0, False: 365]
  ------------------
  202|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  203|       |
  204|       |  // Copy the rest of PGF image data.
  205|       |
  206|    365|  DataBuf buf(4096);
  207|    365|  size_t readSize = io_->read(buf.data(), buf.size());
  208|  1.12k|  while (readSize != 0) {
  ------------------
  |  Branch (208:10): [True: 760, False: 365]
  ------------------
  209|    760|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (209:9): [True: 0, False: 760]
  ------------------
  210|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  211|    760|    readSize = io_->read(buf.data(), buf.size());
  212|    760|  }
  213|    365|  if (outIo.error())
  ------------------
  |  Branch (213:7): [True: 0, False: 365]
  ------------------
  214|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  215|       |
  216|    365|}  // PgfImage::doWriteMetadata
_ZN5Exiv28PgfImage18readPgfMagicNumberERNS_7BasicIoE:
  218|  1.18k|byte PgfImage::readPgfMagicNumber(BasicIo& iIo) {
  219|  1.18k|  auto b = static_cast<byte>(iIo.getb());
  220|  1.18k|  if (iIo.error())
  ------------------
  |  Branch (220:7): [True: 0, False: 1.18k]
  ------------------
  221|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|       |
  223|  1.18k|  if (b < 0x36)  // 0x36 = '6'.
  ------------------
  |  Branch (223:7): [True: 116, False: 1.07k]
  ------------------
  224|    116|  {
  225|       |    // Not right Magick version.
  226|       |#ifdef EXIV2_DEBUG_MESSAGES
  227|       |    std::cout << "Exiv2::PgfImage::readMetadata: wrong Magick number\n";
  228|       |#endif
  229|    116|  }
  230|       |
  231|  1.18k|  return b;
  232|  1.18k|}  // PgfImage::readPgfMagicNumber
_ZNK5Exiv28PgfImage17readPgfHeaderSizeERNS_7BasicIoE:
  234|  1.18k|size_t PgfImage::readPgfHeaderSize(BasicIo& iIo) const {
  235|  1.18k|  DataBuf buffer(4);
  236|  1.18k|  const size_t bufRead = iIo.read(buffer.data(), buffer.size());
  237|  1.18k|  if (iIo.error())
  ------------------
  |  Branch (237:7): [True: 0, False: 1.18k]
  ------------------
  238|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  239|  1.18k|  if (bufRead != buffer.size())
  ------------------
  |  Branch (239:7): [True: 0, False: 1.18k]
  ------------------
  240|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  241|       |
  242|  1.18k|  auto headerSize = static_cast<size_t>(byteSwap_(buffer, 0, bSwap_));
  243|  1.18k|  if (headerSize == 0)
  ------------------
  |  Branch (243:7): [True: 20, False: 1.16k]
  ------------------
  244|     20|    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.16k|  return headerSize;
  251|  1.18k|}
_ZNK5Exiv28PgfImage22readPgfHeaderStructureERNS_7BasicIoERjS3_:
  253|  1.16k|DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const {
  254|  1.16k|  DataBuf header(16);
  255|  1.16k|  size_t bufRead = iIo.read(header.data(), header.size());
  256|  1.16k|  if (iIo.error())
  ------------------
  |  Branch (256:7): [True: 0, False: 1.16k]
  ------------------
  257|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  258|  1.16k|  if (bufRead != header.size())
  ------------------
  |  Branch (258:7): [True: 0, False: 1.16k]
  ------------------
  259|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  260|       |
  261|  1.16k|  DataBuf work(header.data(), 8);  // don't disturb the binary data - doWriteMetadata reuses it
  262|  1.16k|  width = byteSwap_(work, 0, bSwap_);
  263|  1.16k|  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.16k|  if (header.read_uint8(12) == 2)  // Indexed color image. We pass color table (256 * 3 bytes).
  ------------------
  |  Branch (272:7): [True: 18, False: 1.14k]
  ------------------
  273|     18|  {
  274|     18|    header.alloc(16 + (256 * 3));
  275|       |
  276|     18|    bufRead = iIo.read(header.data(16), 256 * 3);
  277|     18|    if (iIo.error())
  ------------------
  |  Branch (277:9): [True: 0, False: 18]
  ------------------
  278|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  279|     18|    if (bufRead != 256 * 3)
  ------------------
  |  Branch (279:9): [True: 13, False: 5]
  ------------------
  280|     13|      throw Error(ErrorCode::kerInputDataReadFailed);
  281|     18|  }
  282|       |
  283|  1.15k|  return header;
  284|  1.16k|}  // PgfImage::readPgfHeaderStructure
_ZN5Exiv214newPgfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  288|    822|Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create) {
  289|    822|  auto image = std::make_unique<PgfImage>(std::move(io), create);
  290|    822|  if (!image->good()) {
  ------------------
  |  Branch (290:7): [True: 0, False: 822]
  ------------------
  291|      0|    return nullptr;
  292|      0|  }
  293|    822|  return image;
  294|    822|}
_ZN5Exiv29isPgfTypeERNS_7BasicIoEb:
  296|  23.7k|bool isPgfType(BasicIo& iIo, bool advance) {
  297|  23.7k|  const int32_t len = 3;
  298|  23.7k|  std::array<byte, len> buf;
  299|  23.7k|  iIo.read(buf.data(), len);
  300|  23.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (300:7): [True: 0, False: 23.7k]
  |  Branch (300:22): [True: 0, False: 23.7k]
  ------------------
  301|      0|    return false;
  302|      0|  }
  303|  23.7k|  bool rc = buf == pgfSignature;
  304|  23.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (304:7): [True: 22.5k, False: 1.18k]
  |  Branch (304:19): [True: 0, False: 1.18k]
  ------------------
  305|  22.5k|    iIo.seek(-len, BasicIo::cur);
  306|  22.5k|  }
  307|       |
  308|  23.7k|  return rc;
  309|  23.7k|}
pgfimage.cpp:_ZN5Exiv2L9byteSwap_ERNS_7DataBufEmb:
   39|  3.88k|static uint32_t byteSwap_(Exiv2::DataBuf& buf, size_t offset, bool bSwap) {
   40|  3.88k|  uint32_t v = 0;
   41|  3.88k|  auto p = reinterpret_cast<byte*>(&v);
   42|  3.88k|  int i;
   43|  19.4k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (43:15): [True: 15.5k, False: 3.88k]
  ------------------
   44|  15.5k|    p[i] = buf.read_uint8(offset + i);
   45|  3.88k|  uint32_t result = Image::byteSwap(v, bSwap);
   46|  3.88k|  p = reinterpret_cast<byte*>(&result);
   47|  19.4k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (47:15): [True: 15.5k, False: 3.88k]
  ------------------
   48|  15.5k|    buf.write_uint8(offset + i, p[i]);
   49|  3.88k|  return result;
   50|  3.88k|}

_ZN5Exiv29Photoshop5isIrbEPKh:
   17|  29.2M|bool Photoshop::isIrb(const byte* pPsData) {
   18|  29.2M|  if (pPsData == nullptr) {
  ------------------
  |  Branch (18:7): [True: 0, False: 29.2M]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|  29.2M|  return std::any_of(irbId_.begin(), irbId_.end(), [pPsData](auto id) { return memcmp(pPsData, id, 4) == 0; });
   22|  29.2M|}
_ZN5Exiv29Photoshop5validEPKhm:
   24|  26.0k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   25|  26.0k|  const byte* record = nullptr;
   26|  26.0k|  uint32_t sizeIptc = 0;
   27|  26.0k|  uint32_t sizeHdr = 0;
   28|  26.0k|  const byte* pCur = pPsData;
   29|  26.0k|  const byte* pEnd = pPsData + sizePsData;
   30|  26.0k|  int ret = 0;
   31|  14.6M|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (31:10): [True: 14.6M, False: 35]
  |  Branch (31:25): [True: 14.6M, False: 25.9k]
  ------------------
   32|  14.6M|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   33|  14.6M|  }
   34|  26.0k|  return ret >= 0;
   35|  26.0k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   41|  14.7M|                         uint32_t& sizeData) {
   42|  14.7M|  if (sizePsData < 12) {
  ------------------
  |  Branch (42:7): [True: 1.71k, False: 14.7M]
  ------------------
   43|  1.71k|    return 3;
   44|  1.71k|  }
   45|       |
   46|       |  // Used for error checking
   47|  14.7M|  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|  29.2M|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (52:10): [True: 29.2M, False: 260]
  |  Branch (52:43): [True: 29.2M, False: 3.61k]
  ------------------
   53|  29.2M|    const byte* hrd = pPsData + position;
   54|  29.2M|    position += 4;
   55|  29.2M|    uint16_t type = getUShort(pPsData + position, bigEndian);
   56|  29.2M|    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|  29.2M|    byte psSize = pPsData[position] + 1;
   62|  29.2M|    psSize += (psSize & 1);
   63|  29.2M|    position += psSize;
   64|  29.2M|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (64:9): [True: 17.8k, False: 29.2M]
  ------------------
   65|       |#ifdef EXIV2_DEBUG_MESSAGES
   66|       |      std::cerr << "Warning: "
   67|       |                << "Invalid or extended Photoshop IRB\n";
   68|       |#endif
   69|  17.8k|      return -2;
   70|  17.8k|    }
   71|  29.2M|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   72|  29.2M|    position += 4;
   73|  29.2M|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (73:9): [True: 4.35k, False: 29.2M]
  ------------------
   74|       |#ifdef EXIV2_DEBUG_MESSAGES
   75|       |      std::cerr << "Warning: "
   76|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   77|       |#endif
   78|  4.35k|      return -2;
   79|  4.35k|    }
   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|  29.2M|    if (type == psTag) {
  ------------------
  |  Branch (86:9): [True: 14.6M, False: 14.5M]
  ------------------
   87|       |#ifdef EXIV2_DEBUG_MESSAGES
   88|       |      std::cerr << "ok\n";
   89|       |#endif
   90|  14.6M|      sizeData = dataSize;
   91|  14.6M|      sizeHdr = psSize + 10;
   92|  14.6M|      *record = hrd;
   93|  14.6M|      return 0;
   94|  14.6M|    }
   95|       |    // Data size is also padded to be even
   96|  14.5M|    position += dataSize + (dataSize & 1);
   97|  14.5M|  }
   98|       |#ifdef EXIV2_DEBUG_MESSAGES
   99|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  100|       |#endif
  101|  3.87k|  if (position < sizePsData) {
  ------------------
  |  Branch (101:7): [True: 3.82k, False: 50]
  ------------------
  102|       |#ifdef EXIV2_DEBUG_MESSAGES
  103|       |    std::cerr << "Warning: "
  104|       |              << "Invalid or extended Photoshop IRB\n";
  105|       |#endif
  106|  3.82k|    return -2;
  107|  3.82k|  }
  108|     50|  return 3;
  109|  3.87k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  112|  14.7M|                             uint32_t& sizeData) {
  113|  14.7M|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  114|  14.7M|}
_ZN5Exiv29Photoshop10setIptcIrbEPKhmRKNS_8IptcDataE:
  121|    811|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|    811|  const byte* record = pPsData;
  130|    811|  uint32_t sizeIptc = 0;
  131|    811|  uint32_t sizeHdr = 0;
  132|    811|  DataBuf rc;
  133|    811|  if (0 > Photoshop::locateIptcIrb(pPsData, sizePsData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (133:7): [True: 103, False: 708]
  ------------------
  134|    103|    return rc;
  135|    103|  }
  136|       |
  137|    708|  Blob psBlob;
  138|    708|  const auto sizeFront = static_cast<size_t>(record - pPsData);
  139|       |  // Write data before old record.
  140|    708|  if (sizePsData > 0 && sizeFront > 0) {
  ------------------
  |  Branch (140:7): [True: 178, False: 530]
  |  Branch (140:25): [True: 9, False: 169]
  ------------------
  141|      9|    append(psBlob, pPsData, sizeFront);
  142|      9|  }
  143|       |
  144|       |  // Write new iptc record if we have it
  145|    708|  if (DataBuf rawIptc = IptcParser::encode(iptcData); !rawIptc.empty()) {
  ------------------
  |  Branch (145:55): [True: 210, False: 498]
  ------------------
  146|    210|    std::array<byte, 12> tmpBuf;
  147|    210|    std::copy_n(Photoshop::irbId_.front(), 4, tmpBuf.begin());
  148|    210|    us2Data(tmpBuf.data() + 4, iptc_, bigEndian);
  149|    210|    tmpBuf[6] = 0;
  150|    210|    tmpBuf[7] = 0;
  151|    210|    ul2Data(tmpBuf.data() + 8, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  152|    210|    append(psBlob, tmpBuf.data(), 12);
  153|    210|    append(psBlob, rawIptc.c_data(), rawIptc.size());
  154|       |    // Data is padded to be even (but not included in size)
  155|    210|    if (rawIptc.size() & 1)
  ------------------
  |  Branch (155:9): [True: 109, False: 101]
  ------------------
  156|    109|      psBlob.push_back(0x00);
  157|    210|  }
  158|       |
  159|       |  // Write existing stuff after record, skip the current and all remaining IPTC blocks
  160|    708|  size_t pos = sizeFront;
  161|    708|  auto nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  162|    708|  Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  163|  10.6k|  while (0 == Photoshop::locateIptcIrb(pPsData + pos, nextSizeData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (163:10): [True: 9.90k, False: 708]
  ------------------
  164|  9.90k|    const auto newPos = static_cast<size_t>(record - pPsData);
  165|  9.90k|    if (newPos > pos) {  // Copy data up to the IPTC IRB
  ------------------
  |  Branch (165:9): [True: 8.91k, False: 991]
  ------------------
  166|  8.91k|      append(psBlob, pPsData + pos, newPos - pos);
  167|  8.91k|    }
  168|  9.90k|    pos = newPos + sizeHdr + sizeIptc + (sizeIptc & 1);  // Skip the IPTC IRB
  169|  9.90k|    nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  170|  9.90k|    Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  171|  9.90k|  }
  172|    708|  if (pos < sizePsData) {
  ------------------
  |  Branch (172:7): [True: 168, False: 540]
  ------------------
  173|    168|    append(psBlob, pPsData + pos, sizePsData - pos);
  174|    168|  }
  175|       |
  176|       |  // Data is rounded to be even
  177|    708|  if (!psBlob.empty())
  ------------------
  |  Branch (177:7): [True: 374, False: 334]
  ------------------
  178|    374|    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|    708|  return rc;
  187|    811|}
photoshop.cpp:_ZZN5Exiv29Photoshop5isIrbEPKhENK3$_0clIPKcEEDaT_:
   21|   117M|  return std::any_of(irbId_.begin(), irbId_.end(), [pPsData](auto id) { return memcmp(pPsData, id, 4) == 0; });

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|    729|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|    729|  *outWidth = data.read_uint32(0, bigEndian);
   48|    729|  *outHeight = data.read_uint32(4, bigEndian);
   49|    729|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  7.56k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  7.56k|  DataBuf key = keyTXTChunk(data);
   53|  7.56k|  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.56k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 6.72k, False: 840]
  ------------------
   59|  6.72k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  7.56k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  9.37k|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|  9.37k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 1.81k, False: 7.56k]
  ------------------
   74|  9.37k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 39, False: 9.33k]
  ------------------
   75|     39|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  9.33k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  9.33k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 46, False: 9.28k]
  ------------------
   79|     46|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  9.28k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  9.33k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.47k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.47k|  DataBuf arr;
   86|       |
   87|  7.47k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 340, False: 7.13k]
  ------------------
   88|    340|    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|    340|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 18, False: 322]
  ------------------
   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|     18|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     18|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    322|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    322|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 51, False: 271]
  ------------------
  104|     51|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     51|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     51|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     51|    }
  109|  7.13k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 2.51k, False: 4.62k]
  ------------------
  110|  2.51k|    enforce(data.size() >= Safe::add(keysize, std::size_t{1}), ErrorCode::kerCorruptedMetadata);
  111|       |    // Extract a non-compressed Latin-1 text chunk
  112|       |
  113|       |    // the text comes after the key, but isn't null terminated
  114|  2.51k|    size_t textsize = data.size() - keysize - 1;
  115|  2.51k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 1.37k, False: 1.14k]
  ------------------
  116|  1.37k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  1.37k|      arr = DataBuf(text, textsize);
  119|  1.37k|    }
  120|  4.62k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 4.62k, False: 0]
  ------------------
  121|  4.62k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  4.62k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  4.62k|    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|  4.62k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  4.62k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  4.62k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 4.48k, False: 142]
  |  Branch (132:40): [True: 96, False: 46]
  ------------------
  133|  4.62k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 96, False: 4.52k]
  ------------------
  134|     96|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  4.62k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  4.62k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  4.62k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  4.62k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  4.62k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  4.62k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  4.62k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  4.62k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  4.62k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  4.62k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  4.62k|    const auto textsize =
  152|  4.62k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  4.62k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 4.42k, False: 199]
  ------------------
  154|  4.42k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  4.42k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 4.35k, False: 69]
  ------------------
  157|       |        // then it's an uncompressed iTXt chunk
  158|       |#ifdef EXIV2_DEBUG_MESSAGES
  159|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
  160|       |#endif
  161|  4.35k|        arr = DataBuf(text, textsize);
  162|  4.35k|      } 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|     69|        zlibUncompress(text, textsize, arr);
  170|     69|      }
  171|  4.42k|    }
  172|  4.62k|  } 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.45k|  return arr;
  180|  7.47k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  6.72k|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.72k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 3.10k, False: 3.61k]
  ------------------
  186|  3.10k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 33, False: 3.07k]
  |  Branch (186:57): [True: 388, False: 2.68k]
  ------------------
  187|    421|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 421, False: 0]
  ------------------
  188|    421|    DataBuf exifData = readRawProfile(arr, false);
  189|    421|    size_t length = exifData.size();
  190|       |
  191|    421|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 241, False: 180]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|    241|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|    241|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|    241|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    359|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 118, False: 241]
  ------------------
  200|    118|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 118]
  ------------------
  201|    118|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 118]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|    118|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|    241|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 241]
  ------------------
  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|    241|      } else {
  217|    241|#ifndef SUPPRESS_WARNINGS
  218|    241|        EXV_WARNING << "Failed to decode Exif metadata.\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()
  ------------------
  219|    241|#endif
  220|    241|        pImage->exifData().clear();
  221|    241|      }
  222|    241|    }
  223|    421|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  6.72k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 3.09k, False: 3.63k]
  |  Branch (227:24): [True: 758, False: 2.33k]
  |  Branch (227:73): [True: 690, False: 68]
  ------------------
  228|    690|    DataBuf psData = readRawProfile(arr, false);
  229|    690|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 117, False: 573]
  ------------------
  230|    117|      Blob iptcBlob;
  231|    117|      const byte* record = nullptr;
  232|    117|      uint32_t sizeIptc = 0;
  233|    117|      uint32_t sizeHdr = 0;
  234|       |
  235|    117|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|    117|      const byte* pCur = psData.c_data();
  237|    117|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 111, False: 6]
  |  Branch (237:29): [True: 0, False: 111]
  ------------------
  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|    117|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 117]
  |  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|    117|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 117, False: 0]
  |  Branch (254:31): [True: 75, False: 42]
  ------------------
  255|     75|#ifndef SUPPRESS_WARNINGS
  256|     75|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     75|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 75]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     75|  LogMsg(LogMsg::warn).os()
  ------------------
  257|     75|#endif
  258|     75|        pImage->clearIptcData();
  259|     75|      }
  260|    117|    }  // if (psData.size() > 0)
  261|    690|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  6.72k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 3.09k, False: 3.62k]
  |  Branch (265:24): [True: 506, False: 2.58k]
  |  Branch (265:72): [True: 503, False: 3]
  ------------------
  266|    503|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|    503|    size_t length = xmpBuf.size();
  268|       |
  269|    503|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 52, False: 451]
  ------------------
  270|     52|      std::string& xmpPacket = pImage->xmpPacket();
  271|     52|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|     52|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 40, False: 12]
  |  Branch (272:80): [True: 39, False: 1]
  ------------------
  273|     39|#ifndef SUPPRESS_WARNINGS
  274|     39|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     39|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 39]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     39|  LogMsg(LogMsg::warn).os()
  ------------------
  275|     39|#endif
  276|     39|        xmpPacket = xmpPacket.substr(idx);
  277|     39|      }
  278|     52|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 52, False: 0]
  ------------------
  279|     52|#ifndef SUPPRESS_WARNINGS
  280|     52|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     52|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 52]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     52|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     52|#endif
  282|     52|      }
  283|     52|    }
  284|    503|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  6.72k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 5.30k, False: 1.41k]
  |  Branch (288:24): [True: 968, False: 4.34k]
  |  Branch (288:69): [True: 953, False: 15]
  |  Branch (288:98): [True: 563, False: 390]
  ------------------
  289|    563|    std::string& xmpPacket = pImage->xmpPacket();
  290|    563|    xmpPacket.assign(arr.c_str(), arr.size());
  291|    563|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 180, False: 383]
  |  Branch (291:78): [True: 170, False: 10]
  ------------------
  292|    170|#ifndef SUPPRESS_WARNINGS
  293|    170|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    170|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 170]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    170|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    170|#endif
  296|    170|      xmpPacket = xmpPacket.substr(idx);
  297|    170|    }
  298|    563|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 527, False: 36]
  ------------------
  299|    527|#ifndef SUPPRESS_WARNINGS
  300|    527|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    527|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 527]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    527|  LogMsg(LogMsg::warn).os()
  ------------------
  301|    527|#endif
  302|    527|    }
  303|    563|  }
  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.72k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 5.64k, False: 1.08k]
  |  Branch (308:7): [True: 144, False: 6.57k]
  |  Branch (308:24): [True: 780, False: 4.86k]
  |  Branch (308:63): [True: 144, False: 636]
  ------------------
  309|    144|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|    144|  }
  311|       |
  312|  6.72k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk17makeMetadataChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_10MetadataIdE:
  314|  2.10k|std::string PngChunk::makeMetadataChunk(std::string_view metadata, MetadataId type) {
  315|  2.10k|  std::string rawProfile;
  316|       |
  317|  2.10k|  switch (type) {
  ------------------
  |  Branch (317:11): [True: 2.10k, False: 0]
  ------------------
  318|    719|    case mdComment:
  ------------------
  |  Branch (318:5): [True: 719, False: 1.38k]
  ------------------
  319|    719|      return makeUtf8TxtChunk("Description", metadata, true);
  320|     77|    case mdIptc:
  ------------------
  |  Branch (320:5): [True: 77, False: 2.03k]
  ------------------
  321|     77|      rawProfile = writeRawProfile(metadata, "iptc");
  322|     77|      return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
  323|  1.31k|    case mdXmp:
  ------------------
  |  Branch (323:5): [True: 1.31k, False: 796]
  ------------------
  324|  1.31k|      return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
  325|      0|    case mdExif:
  ------------------
  |  Branch (325:5): [True: 0, False: 2.10k]
  ------------------
  326|      0|    case mdIccProfile:
  ------------------
  |  Branch (326:5): [True: 0, False: 2.10k]
  ------------------
  327|      0|    case mdNone:
  ------------------
  |  Branch (327:5): [True: 0, False: 2.10k]
  ------------------
  328|      0|      return {};
  329|  2.10k|  }
  330|       |
  331|      0|  return {};
  332|       |
  333|  2.10k|}  // PngChunk::makeMetadataChunk
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|    120|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|    120|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|    120|  int zlibResult = Z_BUF_ERROR;
  338|    120|  int dos = 0;
  339|       |
  340|    162|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 139, False: 23]
  ------------------
  341|    139|    arr.alloc(uncompressedLen);
  342|    139|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|    139|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 23, False: 116]
  ------------------
  344|     23|      arr.resize(uncompressedLen);
  345|    116|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 19, False: 97]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     19|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     19|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 0, False: 19]
  ------------------
  350|      0|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|          break;
  352|      0|        uncompressedLen = 131072;
  353|      0|      }
  354|     97|    } else {
  355|       |      // something bad happened
  356|     97|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|     97|    }
  358|    139|  }
  359|       |
  360|     23|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (360:7): [True: 0, False: 23]
  ------------------
  361|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  362|      0|  }
  363|     23|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk12zlibCompressENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  365|    796|std::string PngChunk::zlibCompress(std::string_view text) {
  366|    796|  auto compressedLen = static_cast<uLongf>(text.size() * 2);  // just a starting point
  367|    796|  int zlibResult = Z_BUF_ERROR;
  368|       |
  369|    796|  DataBuf arr;
  370|  2.36k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (370:10): [True: 1.56k, False: 796]
  ------------------
  371|  1.56k|    arr.resize(compressedLen);
  372|  1.56k|    zlibResult = compress2(arr.data(), &compressedLen, reinterpret_cast<const Bytef*>(text.data()),
  373|  1.56k|                           static_cast<uLong>(text.size()), Z_BEST_COMPRESSION);
  374|       |
  375|  1.56k|    switch (zlibResult) {
  376|    796|      case Z_OK:
  ------------------
  |  Branch (376:7): [True: 796, False: 770]
  ------------------
  377|    796|        arr.resize(compressedLen);
  378|    796|        break;
  379|    770|      case Z_BUF_ERROR:
  ------------------
  |  Branch (379:7): [True: 770, False: 796]
  ------------------
  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|    770|        compressedLen *= 2;
  385|       |        // DoS protection. Cap max compressed size
  386|    770|        if (compressedLen > 131072)
  ------------------
  |  Branch (386:13): [True: 0, False: 770]
  ------------------
  387|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  388|    770|        break;
  389|    770|      default:
  ------------------
  |  Branch (389:7): [True: 0, False: 1.56k]
  ------------------
  390|       |        // Something bad happened
  391|      0|        throw Error(ErrorCode::kerFailedToReadImageData);
  392|  1.56k|    }
  393|  1.56k|  }
  394|       |
  395|    796|  return {arr.c_str(), arr.size()};
  396|       |
  397|    796|}  // PngChunk::zlibCompress
_ZN5Exiv28Internal8PngChunk17makeAsciiTxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  399|     77|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|     77|  auto chunkData = std::string(keyword) + '\0';
  412|     77|  std::string chunkType;
  413|     77|  if (compress) {
  ------------------
  |  Branch (413:7): [True: 77, False: 0]
  ------------------
  414|     77|    chunkData += '\0' + zlibCompress(text);
  415|     77|    chunkType = "zTXt";
  416|     77|  } else {
  417|      0|    chunkData += text;
  418|      0|    chunkType = "tEXt";
  419|      0|  }
  420|       |  // Determine length of the chunk data
  421|     77|  byte length[4];
  422|     77|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  423|       |  // Calculate CRC on chunk type and chunk data
  424|     77|  std::string crcData = chunkType + chunkData;
  425|     77|  uLong tmp = crc32(0L, Z_NULL, 0);
  426|     77|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  427|     77|  byte crc[4];
  428|     77|  ul2Data(crc, tmp, bigEndian);
  429|       |  // Assemble the chunk
  430|     77|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  431|     77|         std::string(reinterpret_cast<const char*>(crc), 4);
  432|       |
  433|     77|}  // PngChunk::makeAsciiTxtChunk
_ZN5Exiv28Internal8PngChunk16makeUtf8TxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  435|  2.03k|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.03k|  auto chunkData = std::string(keyword);
  446|  2.03k|  if (compress) {
  ------------------
  |  Branch (446:7): [True: 719, False: 1.31k]
  ------------------
  447|    719|    static const char flags[] = {0x00, 0x01, 0x00, 0x00, 0x00};
  448|    719|    chunkData += std::string(flags, 5) + zlibCompress(text);
  449|  1.31k|  } else {
  450|  1.31k|    static const char flags[] = {0x00, 0x00, 0x00, 0x00, 0x00};
  451|  1.31k|    chunkData += std::string(flags, 5) + text.data();
  452|  1.31k|  }
  453|       |  // Determine length of the chunk data
  454|  2.03k|  byte length[4];
  455|  2.03k|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  456|       |  // Calculate CRC on chunk type and chunk data
  457|  2.03k|  std::string chunkType = "iTXt";
  458|  2.03k|  std::string crcData = chunkType + chunkData;
  459|  2.03k|  uLong tmp = crc32(0L, Z_NULL, 0);
  460|  2.03k|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  461|  2.03k|  byte crc[4];
  462|  2.03k|  ul2Data(crc, tmp, bigEndian);
  463|       |  // Assemble the chunk
  464|  2.03k|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  465|  2.03k|         std::string(reinterpret_cast<const char*>(crc), 4);
  466|       |
  467|  2.03k|}  // PngChunk::makeUtf8TxtChunk
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  469|  1.61k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  1.61k|  DataBuf info;
  471|  1.61k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 264, False: 1.35k]
  ------------------
  472|    264|    return info;
  473|    264|  }
  474|       |
  475|  1.35k|  const unsigned char unhex[103] = {
  476|  1.35k|      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.35k|      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.35k|      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.35k|  };
  480|       |
  481|  1.35k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 1.35k]
  ------------------
  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.35k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  1.35k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  1.35k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 221, False: 1.12k]
  ------------------
  491|    221|    return info;
  492|    221|  }
  493|       |
  494|       |  // Look for newline
  495|  12.1k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 11.1k, False: 954]
  ------------------
  496|  11.1k|    sp++;
  497|  11.1k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 175, False: 11.0k]
  ------------------
  498|    175|      return info;
  499|    175|    }
  500|  11.1k|  }
  501|    954|  sp++;  // step over '\n'
  502|    954|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 78, False: 876]
  ------------------
  503|     78|    return info;
  504|     78|  }
  505|       |
  506|       |  // Look for length
  507|  4.14k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 1.80k, False: 2.34k]
  |  Branch (507:25): [True: 567, False: 1.77k]
  |  Branch (507:39): [True: 1.00k, False: 776]
  ------------------
  508|  3.37k|    sp++;
  509|  3.37k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 100, False: 3.27k]
  ------------------
  510|    100|      return info;
  511|    100|    }
  512|  3.37k|  }
  513|       |
  514|       |  // Parse the length.
  515|    776|  size_t length = 0;
  516|  2.25k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 1.89k, False: 363]
  |  Branch (516:24): [True: 1.48k, False: 407]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  1.48k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  1.48k|    length = newlength;
  520|  1.48k|    sp++;
  521|  1.48k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 6, False: 1.48k]
  ------------------
  522|      6|      return info;
  523|      6|    }
  524|  1.48k|  }
  525|    770|  sp++;  // step over '\n'
  526|    770|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 155, False: 615]
  ------------------
  527|    155|    return info;
  528|    155|  }
  529|       |
  530|    615|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|    615|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 70, False: 545]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|     70|  }
  538|    615|  info.alloc(length);
  539|    615|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 615]
  ------------------
  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|    615|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 70, False: 545]
  ------------------
  547|     70|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|    545|  unsigned char* dp = info.data();  // decode pointer
  551|    545|  size_t nibbles = length * 2;
  552|       |
  553|  7.79k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 7.32k, False: 469]
  ------------------
  554|  7.32k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  17.5k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 5.19k, False: 12.3k]
  |  Branch (555:26): [True: 7.06k, False: 5.24k]
  |  Branch (555:39): [True: 2.26k, False: 4.80k]
  |  Branch (555:53): [True: 2.82k, False: 7.22k]
  ------------------
  556|  10.2k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 76, False: 10.1k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|     76|        return {};
  561|     76|      }
  562|       |
  563|  10.1k|      sp++;
  564|  10.1k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  10.1k|    }
  566|       |
  567|  7.25k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 3.64k, False: 3.60k]
  ------------------
  568|  3.64k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  3.60k|    else
  570|  3.60k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  7.25k|  }
  572|       |
  573|    469|  return info;
  574|       |
  575|    545|}  // PngChunk::readRawProfile
_ZN5Exiv28Internal8PngChunk15writeRawProfileENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKc:
  577|     77|std::string PngChunk::writeRawProfile(std::string_view profileData, const char* profileType) {
  578|     77|  static const byte hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  579|       |
  580|     77|  auto ss = stringFormat("\n{}\n{:08}", profileType, profileData.size());
  ------------------
  |  |   18|     77|#define stringFormat std::format
  ------------------
  581|     77|  auto sp = reinterpret_cast<const byte*>(profileData.data());
  582|   335k|  for (std::string::size_type i = 0; i < profileData.size(); ++i) {
  ------------------
  |  Branch (582:38): [True: 335k, False: 77]
  ------------------
  583|   335k|    if (i % 36 == 0)
  ------------------
  |  Branch (583:9): [True: 9.34k, False: 325k]
  ------------------
  584|  9.34k|      ss += '\n';
  585|   335k|    ss += hex[*sp >> 4 & 0x0fU];
  586|   335k|    ss += hex[*sp++ & 0x0fU];
  587|   335k|  }
  588|     77|  ss += '\n';
  589|     77|  return ss;
  590|       |
  591|     77|}  // PngChunk::writeRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   56|  1.67k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
   57|  1.67k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 365, False: 1.31k]
  |  Branch (57:17): [True: 365, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    365|    IoCloser closer(*io_);
   62|    365|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 365]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    365|  }
   68|  1.67k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.31k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.31k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.31k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.31k|  IoCloser closer(*io_);
  400|  1.31k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.31k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.31k|  clearMetadata();
  404|       |
  405|  1.31k|  const size_t imgSize = io_->size();
  406|  1.31k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  26.4k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 25.8k, False: 619]
  ------------------
  409|  25.8k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  25.8k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  25.8k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 307, False: 25.5k]
  ------------------
  414|    307|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    307|    }
  416|       |
  417|  25.5k|    std::string chunkType(cheaderBuf.c_str(4), 4);
  418|       |#ifdef EXIV2_DEBUG_MESSAGES
  419|       |    std::cout << "Exiv2::PngImage::readMetadata: chunk type: " << chunkType << " length: " << chunkLength << '\n';
  420|       |#endif
  421|       |
  422|       |    /// \todo analyse remaining chunks of the standard
  423|       |    // Perform a chunk triage for item that we need.
  424|  25.5k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 290, False: 25.2k]
  |  Branch (424:32): [True: 3.25k, False: 21.9k]
  |  Branch (424:55): [True: 2.51k, False: 19.4k]
  |  Branch (424:78): [True: 393, False: 19.0k]
  ------------------
  425|  19.0k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 281, False: 18.8k]
  |  Branch (425:32): [True: 4.65k, False: 14.1k]
  |  Branch (425:55): [True: 758, False: 13.3k]
  ------------------
  426|  12.0k|      DataBuf chunkData(chunkLength);
  427|  12.0k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 9.11k, False: 2.93k]
  ------------------
  428|  9.11k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  9.11k|      }
  430|       |
  431|  12.0k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 195, False: 11.8k]
  ------------------
  432|    195|        return;  // Last chunk found: we stop parsing.
  433|    195|      }
  434|  11.8k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 3.25k, False: 8.60k]
  |  Branch (434:34): [True: 729, False: 2.52k]
  ------------------
  435|    729|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  11.1k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 2.51k, False: 8.60k]
  ------------------
  437|  2.51k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  8.60k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 393, False: 8.21k]
  ------------------
  439|    393|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  8.21k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 4.65k, False: 3.56k]
  ------------------
  441|  4.65k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  4.65k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 281, False: 3.27k]
  ------------------
  443|    281|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    281|        setByteOrder(bo);
  445|  3.27k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 758, False: 2.52k]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    758|        uint32_t iccOffset = 0;
  448|  5.51k|        do {
  449|  5.51k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 5.50k, False: 11]
  |  Branch (449:37): [True: 5.49k, False: 8]
  ------------------
  450|  5.51k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 4.75k, False: 758]
  ------------------
  451|       |
  452|    758|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    758|        ++iccOffset;  // +1 = 'compressed' flag
  454|    758|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    758|        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|    758|      }
  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.8k|      chunkLength = 0;
  466|  11.8k|    }
  467|       |
  468|       |    // Move to the next chunk: chunk data size + 4 CRC bytes.
  469|       |#ifdef EXIV2_DEBUG_MESSAGES
  470|       |    std::cout << "Exiv2::PngImage::readMetadata: Seek to offset: " << chunkLength + 4 << '\n';
  471|       |#endif
  472|  25.3k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  25.3k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 619, False: 24.7k]
  |  Branch (473:25): [True: 192, False: 24.5k]
  ------------------
  474|    192|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    192|    }
  476|  25.3k|  }
  477|  1.31k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  479|    555|void PngImage::writeMetadata() {
  480|    555|  if (io_->open() != 0) {
  ------------------
  |  Branch (480:7): [True: 0, False: 555]
  ------------------
  481|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  482|      0|  }
  483|    555|  IoCloser closer(*io_);
  484|    555|  MemIo tempIo;
  485|       |
  486|    555|  doWriteMetadata(tempIo);  // may throw
  487|    555|  io_->close();
  488|    555|  io_->transfer(tempIo);  // may throw
  489|       |
  490|    555|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  492|    555|void PngImage::doWriteMetadata(BasicIo& outIo) {
  493|    555|  if (!io_->isopen())
  ------------------
  |  Branch (493:7): [True: 0, False: 555]
  ------------------
  494|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  495|    555|  if (!outIo.isopen())
  ------------------
  |  Branch (495:7): [True: 0, False: 555]
  ------------------
  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|    555|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (503:7): [True: 0, False: 555]
  ------------------
  504|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  505|      0|  }
  506|       |
  507|       |  // Write PNG Signature.
  508|    555|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (508:7): [True: 0, False: 555]
  ------------------
  509|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  510|       |
  511|    555|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  512|       |
  513|  10.7k|  while (!io_->eof()) {
  ------------------
  |  Branch (513:10): [True: 10.7k, False: 5]
  ------------------
  514|       |    // Read chunk header.
  515|  10.7k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  516|  10.7k|    if (io_->error())
  ------------------
  |  Branch (516:9): [True: 0, False: 10.7k]
  ------------------
  517|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  518|  10.7k|    if (bufRead != 8)
  ------------------
  |  Branch (518:9): [True: 0, False: 10.7k]
  ------------------
  519|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  520|       |
  521|       |    // Decode chunk data length.
  522|       |
  523|  10.7k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  524|  10.7k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (524:9): [True: 0, False: 10.7k]
  ------------------
  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|  10.7k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  530|  10.7k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  531|  10.7k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  532|  10.7k|    if (io_->error())
  ------------------
  |  Branch (532:9): [True: 0, False: 10.7k]
  ------------------
  533|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  534|  10.7k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (534:9): [True: 72, False: 10.6k]
  ------------------
  535|     72|      throw Error(ErrorCode::kerInputDataReadFailed);
  536|       |
  537|  10.6k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  538|       |
  539|  10.6k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (539:9): [True: 478, False: 10.2k]
  ------------------
  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|    478|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (544:11): [True: 0, False: 478]
  ------------------
  545|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  546|    478|      return;
  547|    478|    }
  548|  10.2k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (548:9): [True: 110, False: 10.0k]
  |  Branch (548:30): [True: 107, False: 9.98k]
  ------------------
  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|  9.98k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (555:16): [True: 2.44k, False: 7.53k]
  ------------------
  556|       |#ifdef EXIV2_DEBUG_MESSAGES
  557|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  558|       |#endif
  559|  2.44k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (559:11): [True: 0, False: 2.44k]
  ------------------
  560|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  561|       |
  562|       |      // Write all updated metadata here, just after IHDR.
  563|  2.44k|      if (!comment_.empty()) {
  ------------------
  |  Branch (563:11): [True: 719, False: 1.73k]
  ------------------
  564|       |        // Update Comment data to a new PNG chunk
  565|    719|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  566|    719|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (566:13): [True: 0, False: 719]
  ------------------
  567|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  568|      0|        }
  569|    719|      }
  570|       |
  571|  2.44k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (571:11): [True: 198, False: 2.25k]
  ------------------
  572|       |        // Update Exif data to a new PNG chunk
  573|    198|        Blob blob;
  574|    198|        ExifParser::encode(blob, littleEndian, exifData_);
  575|    198|        if (!blob.empty()) {
  ------------------
  |  Branch (575:13): [True: 182, False: 16]
  ------------------
  576|    182|          byte length[4];
  577|    182|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  578|       |
  579|       |          // calculate CRC
  580|    182|          uLong tmp = crc32(0L, Z_NULL, 0);
  581|    182|          tmp = crc32(tmp, typeExif, 4);
  582|    182|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  583|    182|          byte crc[4];
  584|    182|          ul2Data(crc, tmp, bigEndian);
  585|       |
  586|    182|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (586:15): [True: 0, False: 182]
  |  Branch (586:46): [True: 0, False: 182]
  ------------------
  587|    182|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (587:15): [True: 0, False: 182]
  |  Branch (587:71): [True: 0, False: 182]
  ------------------
  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|    182|        }
  595|    198|      }
  596|       |
  597|  2.44k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (597:11): [True: 77, False: 2.37k]
  ------------------
  598|       |        // Update IPTC data to a new PNG chunk
  599|     77|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  600|     77|        if (!newPsData.empty()) {
  ------------------
  |  Branch (600:13): [True: 77, False: 0]
  ------------------
  601|     77|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  602|     77|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  603|     77|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (603:15): [True: 0, False: 77]
  ------------------
  604|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  605|      0|          }
  606|     77|        }
  607|     77|      }
  608|       |
  609|  2.44k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (609:11): [True: 227, False: 2.22k]
  ------------------
  610|    227|        DataBuf compressed;
  611|    227|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  612|    227|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (612:13): [True: 227, False: 0]
  ------------------
  613|    227|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  614|    227|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  615|    227|          byte length[4];
  616|    227|          ul2Data(length, chunkLength, bigEndian);
  617|       |
  618|       |          // calculate CRC
  619|    227|          uLong tmp = crc32(0L, Z_NULL, 0);
  620|    227|          tmp = crc32(tmp, typeICCP, 4);
  621|    227|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  622|    227|          tmp = crc32(tmp, nullComp, 2);
  623|    227|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  624|    227|          byte crc[4];
  625|    227|          ul2Data(crc, tmp, bigEndian);
  626|       |
  627|    227|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (627:15): [True: 0, False: 227]
  |  Branch (627:46): [True: 0, False: 227]
  ------------------
  628|    227|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (628:15): [True: 0, False: 227]
  ------------------
  629|    227|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (629:15): [True: 0, False: 227]
  ------------------
  630|    227|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (630:15): [True: 0, False: 227]
  |  Branch (630:91): [True: 0, False: 227]
  ------------------
  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|    227|        }
  638|    227|      }
  639|       |
  640|  2.44k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (640:11): [True: 2.44k, False: 5]
  |  Branch (640:36): [True: 41, False: 2.40k]
  ------------------
  641|     41|#ifndef SUPPRESS_WARNINGS
  642|     41|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     41|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 41]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     41|  LogMsg(LogMsg::error).os()
  ------------------
  643|     41|#endif
  644|     41|      }
  645|  2.44k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (645:11): [True: 1.31k, False: 1.13k]
  ------------------
  646|       |        // Update XMP data to a new PNG chunk
  647|  1.31k|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  648|  1.31k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (648:13): [True: 0, False: 1.31k]
  ------------------
  649|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  650|      0|        }
  651|  1.31k|      }
  652|  7.53k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (652:16): [True: 713, False: 6.82k]
  |  Branch (652:37): [True: 41, False: 6.78k]
  |  Branch (652:58): [True: 1.05k, False: 5.72k]
  ------------------
  653|  1.81k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  654|  1.81k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (654:11): [True: 1.66k, False: 151]
  |  Branch (654:28): [True: 26, False: 1.63k]
  |  Branch (654:69): [True: 70, False: 1.56k]
  ------------------
  655|  1.56k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (655:28): [True: 165, False: 1.39k]
  |  Branch (655:69): [True: 13, False: 1.38k]
  ------------------
  656|  1.38k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (656:28): [True: 198, False: 1.18k]
  |  Branch (656:65): [True: 630, False: 558]
  ------------------
  657|       |#ifdef EXIV2_DEBUG_MESSAGES
  658|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  659|       |                  << '\n';
  660|       |#endif
  661|  1.10k|      } else {
  662|       |#ifdef EXIV2_DEBUG_MESSAGES
  663|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  664|       |                  << '\n';
  665|       |#endif
  666|    709|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (666:13): [True: 0, False: 709]
  ------------------
  667|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  668|    709|      }
  669|  5.72k|    } 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|  5.72k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (675:11): [True: 0, False: 5.72k]
  ------------------
  676|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  677|  5.72k|    }
  678|  10.2k|  }
  679|       |
  680|    555|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  684|  1.67k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, bool create) {
  685|  1.67k|  auto image = std::make_unique<PngImage>(std::move(io), create);
  686|  1.67k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.67k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.67k|  return image;
  690|  1.67k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  26.8k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  26.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 26.8k]
  |  Branch (693:22): [True: 282, False: 26.6k]
  ------------------
  694|    282|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    282|  }
  696|  26.6k|  const int32_t len = 8;
  697|  26.6k|  std::array<byte, len> buf;
  698|  26.6k|  iIo.read(buf.data(), len);
  699|  26.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 26.6k]
  |  Branch (699:22): [True: 0, False: 26.6k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  26.6k|  bool rc = buf == pngSignature;
  703|  26.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 24.7k, False: 1.86k]
  |  Branch (703:19): [True: 0, False: 1.86k]
  ------------------
  704|  24.7k|    iIo.seek(-len, BasicIo::cur);
  705|  24.7k|  }
  706|       |
  707|  26.6k|  return rc;
  708|  26.6k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    729|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    729|  uLongf uncompressedLen = length;  // just a starting point
   76|    729|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.64k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 919, False: 729]
  ------------------
   79|    919|    result.alloc(uncompressedLen);
   80|    919|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    919|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 23, False: 896]
  |  Branch (82:31): [True: 20, False: 3]
  ------------------
   83|     20|      result.reset();
   84|       |
   85|     20|      result.alloc(uncompressedLen);
   86|     20|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|     20|    }
   88|    919|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 190, False: 729]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    190|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    190|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 190]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    190|      else
   96|    190|        uncompressedLen *= 2;
   97|    190|    }
   98|    919|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    729|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  34.9k|static void readChunk(DataBuf& buffer, BasicIo& io) {
  380|       |#ifdef EXIV2_DEBUG_MESSAGES
  381|       |  std::cout << "Exiv2::PngImage::readMetadata: Position: " << io.tell() << '\n';
  382|       |#endif
  383|  34.9k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  34.9k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 34.9k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  34.9k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 95, False: 34.8k]
  ------------------
  388|     95|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     95|  }
  390|  34.9k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    227|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    227|  uLongf compressedLen = length;  // just a starting point
  105|    227|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|  1.00k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 778, False: 227]
  ------------------
  108|    778|    result.alloc(compressedLen);
  109|    778|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    778|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 551, False: 227]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|    551|      result.reset();
  113|    551|      compressedLen *= 2;
  114|    551|    } else {
  115|    227|      result.reset();
  116|    227|      result.alloc(compressedLen);
  117|    227|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    227|    }
  119|    778|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    227|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  8.83k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  8.83k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  8.83k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  8.83k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  953|  1.36k|    properties_(std::move(properties)), preview_(std::move(data)) {
  954|  1.36k|}
_ZNK5Exiv212PreviewImage5pDataEv:
  980|  1.36k|const byte* PreviewImage::pData() const {
  981|  1.36k|  return preview_.c_data();
  982|  1.36k|}
_ZNK5Exiv212PreviewImage4sizeEv:
  984|  1.36k|uint32_t PreviewImage::size() const {
  985|  1.36k|  return static_cast<uint32_t>(preview_.size());
  986|  1.36k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1008|  6.11k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1009|  6.11k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1011|  6.11k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1012|  6.11k|  PreviewPropertiesList list;
 1013|       |  // go through the loader table and store all successfully created loaders in the list
 1014|   212k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1014:26): [True: 206k, False: 6.11k]
  ------------------
 1015|   206k|    auto loader = Loader::create(id, image_);
 1016|   206k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1016:9): [True: 12.5k, False: 193k]
  |  Branch (1016:19): [True: 7.04k, False: 5.55k]
  ------------------
 1017|  7.04k|      PreviewProperties props = loader->getProperties();
 1018|  7.04k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1019|  7.04k|      props.size_ = buf.size();         //     update the size
 1020|  7.04k|      list.push_back(std::move(props));
 1021|  7.04k|    }
 1022|   206k|  }
 1023|  6.11k|  std::sort(list.begin(), list.end(),
 1024|  6.11k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1025|       |
 1026|  6.11k|  return list;
 1027|  6.11k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1029|  1.36k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1030|  1.36k|  auto loader = Loader::create(properties.id_, image_);
 1031|  1.36k|  DataBuf buf;
 1032|  1.36k|  if (loader) {
  ------------------
  |  Branch (1032:7): [True: 1.36k, False: 0]
  ------------------
 1033|  1.36k|    buf = loader->getData();
 1034|  1.36k|  }
 1035|       |
 1036|  1.36k|  return {properties, std::move(buf)};
 1037|  1.36k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  341|   419k|PreviewId Loader::getNumLoaders() {
  342|   419k|  return PreviewId{std::size(loaderList_)};
  343|   419k|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  359|  24.4k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  360|  24.4k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  361|  24.4k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  345|  24.4k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  346|  24.4k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (346:7): [True: 0, False: 24.4k]
  |  Branch (346:21): [True: 24.4k, False: 0]
  ------------------
  347|  24.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|   195k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  335|   195k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  337|  7.04k|PreviewProperties Loader::getProperties() const {
  338|  7.04k|  return {"", "", size_, width_, height_, id_};
  339|  7.04k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   68|  2.05k|  virtual bool readDimensions() {
   69|  2.05k|    return true;
   70|  2.05k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   45|   195k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   57|   212k|  [[nodiscard]] virtual bool valid() const {
   58|   212k|    return valid_;
   59|   212k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  552|  73.3k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  553|  73.3k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  554|  73.3k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  539|  73.3k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  540|  73.3k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (540:55): [True: 113, False: 73.2k]
  ------------------
  541|    113|    size_ = pos->sizeDataArea();  // indirect data
  542|    113|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (542:9): [True: 113, False: 0]
  |  Branch (542:23): [True: 81, False: 32]
  ------------------
  543|     81|      size_ = pos->size();  // direct data
  544|    113|  }
  545|       |
  546|  73.3k|  if (size_ == 0)
  ------------------
  |  Branch (546:7): [True: 73.2k, False: 80]
  ------------------
  547|  73.2k|    return;
  548|       |
  549|     80|  valid_ = true;
  550|     80|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  556|     31|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  557|     31|  PreviewProperties prop = Loader::getProperties();
  558|     31|  prop.mimeType_ = "image/jpeg";
  559|     31|  prop.extension_ = ".jpg";
  560|     31|  return prop;
  561|     31|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  563|    111|DataBuf LoaderExifDataJpeg::getData() const {
  564|    111|  DataBuf buf;
  565|       |
  566|    111|  if (!valid())
  ------------------
  |  Branch (566:7): [True: 0, False: 111]
  ------------------
  567|      0|    return buf;
  568|       |
  569|    111|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (569:55): [True: 111, False: 0]
  ------------------
  570|    111|    buf = pos->dataArea();  // indirect data
  571|       |
  572|    111|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (572:9): [True: 111, False: 0]
  ------------------
  573|    111|      buf = DataBuf(pos->size());
  574|    111|      pos->copy(buf.data(), invalidByteOrder);
  575|    111|    }
  576|       |
  577|    111|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  578|    111|    return buf;
  579|    111|  }
  580|       |
  581|      0|  return buf;
  582|    111|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  584|     57|bool LoaderExifDataJpeg::readDimensions() {
  585|     57|  if (!valid())
  ------------------
  |  Branch (585:7): [True: 0, False: 57]
  ------------------
  586|      0|    return false;
  587|       |
  588|     57|  DataBuf buf = getData();
  589|     57|  if (buf.empty())
  ------------------
  |  Branch (589:7): [True: 0, False: 57]
  ------------------
  590|      0|    return false;
  591|       |
  592|     57|  try {
  593|     57|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  594|     57|    if (!image)
  ------------------
  |  Branch (594:9): [True: 0, False: 57]
  ------------------
  595|      0|      return false;
  596|     57|    image->readMetadata();
  597|       |
  598|     57|    width_ = image->pixelWidth();
  599|     57|    height_ = image->pixelHeight();
  600|     57|  } catch (const Error& /* error */) {
  601|     25|    return false;
  602|     25|  }
  603|       |
  604|     31|  return true;
  605|     57|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  665|  42.5k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  666|  42.5k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  667|  42.5k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  608|  42.5k|    Loader(id, image), group_(param_[parIdx].group_) {
  609|  42.5k|  const ExifData& exifData = image_.exifData();
  610|       |
  611|  42.5k|  size_t offsetCount = 0;
  612|  42.5k|  ExifData::const_iterator pos;
  613|       |
  614|       |  // check if the group_ contains a preview image
  615|  42.5k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (615:7): [True: 36.5k, False: 6.00k]
  ------------------
  616|  36.5k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  617|  36.5k|    if (pos == exifData.end())
  ------------------
  |  Branch (617:9): [True: 33.0k, False: 3.42k]
  ------------------
  618|  33.0k|      return;
  619|  3.42k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (619:9): [True: 3.42k, False: 0]
  |  Branch (619:9): [True: 413, False: 3.00k]
  |  Branch (619:39): [True: 413, False: 3.00k]
  ------------------
  620|    413|      return;
  621|  3.42k|  }
  622|       |
  623|  9.01k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  624|  9.01k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (624:7): [True: 2.74k, False: 6.26k]
  ------------------
  625|  2.74k|    offsetTag_ = "StripOffsets";
  626|  2.74k|    sizeTag_ = "StripByteCounts";
  627|  2.74k|    offsetCount = pos->value().count();
  628|  6.26k|  } else {
  629|  6.26k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  630|  6.26k|    if (pos == exifData.end())
  ------------------
  |  Branch (630:9): [True: 6.10k, False: 162]
  ------------------
  631|  6.10k|      return;
  632|    162|    offsetTag_ = "TileOffsets";
  633|    162|    sizeTag_ = "TileByteCounts";
  634|    162|    offsetCount = pos->value().count();
  635|    162|  }
  636|       |
  637|  2.90k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  638|  2.90k|  if (pos == exifData.end())
  ------------------
  |  Branch (638:7): [True: 103, False: 2.80k]
  ------------------
  639|    103|    return;
  640|  2.80k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (640:7): [True: 47, False: 2.75k]
  ------------------
  641|     47|    return;
  642|  23.3k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (642:22): [True: 20.6k, False: 2.75k]
  ------------------
  643|  20.6k|    size_ += pos->toUint32(i);
  644|  20.6k|  }
  645|       |
  646|  2.75k|  if (size_ == 0)
  ------------------
  |  Branch (646:7): [True: 81, False: 2.67k]
  ------------------
  647|     81|    return;
  648|       |
  649|  2.67k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  650|  2.67k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (650:7): [True: 2.62k, False: 50]
  |  Branch (650:7): [True: 2.42k, False: 257]
  |  Branch (650:32): [True: 2.42k, False: 207]
  ------------------
  651|  2.42k|    width_ = pos->toUint32();
  652|  2.42k|  }
  653|       |
  654|  2.67k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  655|  2.67k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (655:7): [True: 2.53k, False: 142]
  |  Branch (655:7): [True: 2.38k, False: 290]
  |  Branch (655:32): [True: 2.38k, False: 148]
  ------------------
  656|  2.38k|    height_ = pos->toUint32();
  657|  2.38k|  }
  658|       |
  659|  2.67k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (659:7): [True: 289, False: 2.38k]
  |  Branch (659:22): [True: 179, False: 2.21k]
  ------------------
  660|    468|    return;
  661|       |
  662|  2.21k|  valid_ = true;
  663|  2.21k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  669|  2.05k|PreviewProperties LoaderTiff::getProperties() const {
  670|  2.05k|  PreviewProperties prop = Loader::getProperties();
  671|  2.05k|  prop.mimeType_ = "image/tiff";
  672|  2.05k|  prop.extension_ = ".tif";
  673|  2.05k|  return prop;
  674|  2.05k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  676|  2.21k|DataBuf LoaderTiff::getData() const {
  677|  2.21k|  const ExifData& exifData = image_.exifData();
  678|       |
  679|  2.21k|  ExifData preview;
  680|       |
  681|       |  // copy tags
  682|   368k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (682:19): [True: 368k, False: 2.21k]
  ------------------
  683|   368k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (683:9): [True: 88.4k, False: 280k]
  ------------------
  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|  88.4k|      uint16_t tag = pos.tag();
  692|  88.4k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (692:11): [True: 86.0k, False: 2.39k]
  |  Branch (692:28): [True: 85.2k, False: 742]
  |  Branch (692:45): [True: 32.7k, False: 52.4k]
  ------------------
  693|  32.7k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  694|  32.7k|      }
  695|  88.4k|    }
  696|   368k|  }
  697|       |
  698|  2.21k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  699|       |
  700|  2.21k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (700:7): [True: 2.21k, False: 0]
  ------------------
  701|       |    // image data are not available via exifData, read them from image_.io()
  702|  2.21k|    BasicIo& io = image_.io();
  703|       |
  704|  2.21k|    if (io.open() != 0) {
  ------------------
  |  Branch (704:9): [True: 0, False: 2.21k]
  ------------------
  705|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  706|      0|    }
  707|  2.21k|    IoCloser closer(io);
  708|       |
  709|  2.21k|    const Exiv2::byte* base = io.mmap();
  710|       |
  711|  2.21k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  712|       |
  713|  2.21k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (713:9): [True: 2.21k, False: 0]
  ------------------
  714|  2.21k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (714:11): [True: 1.93k, False: 272]
  ------------------
  715|       |        // this saves one copying of the buffer
  716|  1.93k|        uint32_t offset = dataValue.toUint32(0);
  717|  1.93k|        uint32_t size = sizes.toUint32(0);
  718|  1.93k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (718:13): [True: 412, False: 1.52k]
  ------------------
  719|    412|          dataValue.setDataArea(base + offset, size);
  720|  1.93k|      } else {
  721|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  722|    272|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  723|    272|        DataBuf buf(size_);
  724|    272|        uint32_t idxBuf = 0;
  725|  5.50k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (725:28): [True: 5.23k, False: 272]
  ------------------
  726|  5.23k|          uint32_t offset = dataValue.toUint32(i);
  727|  5.23k|          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.23k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  734|  5.23k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (734:15): [True: 2.61k, False: 2.61k]
  |  Branch (734:28): [True: 1.41k, False: 1.19k]
  ------------------
  735|  1.41k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  736|  1.41k|          }
  737|       |
  738|  5.23k|          idxBuf += size;
  739|  5.23k|        }
  740|    272|        dataValue.setDataArea(buf.c_data(), buf.size());
  741|    272|      }
  742|  2.21k|    }
  743|  2.21k|  }
  744|       |
  745|       |  // Fix compression value in the CR2 IFD2 image
  746|  2.21k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (746:7): [True: 0, False: 2.21k]
  |  Branch (746:7): [True: 0, False: 2.21k]
  |  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|  2.21k|  MemIo mio;
  752|  2.21k|  IptcData emptyIptc;
  753|  2.21k|  XmpData emptyXmp;
  754|  2.21k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  755|  2.21k|  return {mio.mmap(), mio.size()};
  756|  2.21k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  480|  49.2k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  481|  49.2k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  482|  49.2k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  451|  49.2k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  452|  49.2k|  const ExifData& exifData = image_.exifData();
  453|  49.2k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  454|  49.2k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (454:7): [True: 12.8k, False: 36.4k]
  |  Branch (454:7): [True: 12.2k, False: 36.9k]
  |  Branch (454:32): [True: 12.2k, False: 595]
  ------------------
  455|  12.2k|    offset_ = pos->toUint32();
  456|  12.2k|  }
  457|       |
  458|  49.2k|  size_ = 0;
  459|  49.2k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  460|  49.2k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (460:7): [True: 13.1k, False: 36.0k]
  |  Branch (460:7): [True: 12.2k, False: 36.9k]
  |  Branch (460:32): [True: 12.2k, False: 899]
  ------------------
  461|  12.2k|    size_ = pos->toUint32();
  462|  12.2k|  }
  463|       |
  464|  49.2k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (464:7): [True: 37.1k, False: 12.0k]
  |  Branch (464:23): [True: 176, False: 11.8k]
  ------------------
  465|  37.3k|    return;
  466|       |
  467|  11.8k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (467:7): [True: 0, False: 11.8k]
  ------------------
  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|  11.8k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (474:7): [True: 227, False: 11.6k]
  ------------------
  475|    227|    return;
  476|       |
  477|  11.6k|  valid_ = true;
  478|  11.6k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  484|  4.95k|PreviewProperties LoaderExifJpeg::getProperties() const {
  485|  4.95k|  PreviewProperties prop = Loader::getProperties();
  486|  4.95k|  prop.mimeType_ = "image/jpeg";
  487|  4.95k|  prop.extension_ = ".jpg";
  488|  4.95k|  return prop;
  489|  4.95k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  491|  6.14k|DataBuf LoaderExifJpeg::getData() const {
  492|  6.14k|  if (!valid())
  ------------------
  |  Branch (492:7): [True: 0, False: 6.14k]
  ------------------
  493|      0|    return {};
  494|  6.14k|  BasicIo& io = image_.io();
  495|       |
  496|  6.14k|  if (io.open() != 0) {
  ------------------
  |  Branch (496:7): [True: 0, False: 6.14k]
  ------------------
  497|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  498|      0|  }
  499|  6.14k|  IoCloser closer(io);
  500|       |
  501|  6.14k|  const Exiv2::byte* base = io.mmap();
  502|       |
  503|  6.14k|  return {base + offset_, size_};
  504|  6.14k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  506|  10.4k|bool LoaderExifJpeg::readDimensions() {
  507|  10.4k|  if (!valid())
  ------------------
  |  Branch (507:7): [True: 0, False: 10.4k]
  ------------------
  508|      0|    return false;
  509|  10.4k|  if (width_ || height_)
  ------------------
  |  Branch (509:7): [True: 0, False: 10.4k]
  |  Branch (509:17): [True: 0, False: 10.4k]
  ------------------
  510|      0|    return true;
  511|       |
  512|  10.4k|  BasicIo& io = image_.io();
  513|       |
  514|  10.4k|  if (io.open() != 0) {
  ------------------
  |  Branch (514:7): [True: 0, False: 10.4k]
  ------------------
  515|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  516|      0|  }
  517|  10.4k|  IoCloser closer(io);
  518|  10.4k|  const Exiv2::byte* base = io.mmap();
  519|       |
  520|  10.4k|  try {
  521|  10.4k|    auto image = ImageFactory::open(base + offset_, size_);
  522|  10.4k|    if (!image)
  ------------------
  |  Branch (522:9): [True: 0, False: 10.4k]
  ------------------
  523|      0|      return false;
  524|  10.4k|    image->readMetadata();
  525|       |
  526|  10.4k|    width_ = image->pixelWidth();
  527|  10.4k|    height_ = image->pixelHeight();
  528|  10.4k|  } catch (const Error& /* error */) {
  529|  5.51k|#ifndef SUPPRESS_WARNINGS
  530|  5.51k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  5.51k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.51k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.51k|  LogMsg(LogMsg::warn).os()
  ------------------
  531|  5.51k|#endif
  532|  5.51k|    return false;
  533|  5.51k|  }
  534|       |
  535|  4.95k|  return true;
  536|  10.4k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  791|  6.00k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  792|  6.00k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  793|  6.00k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  758|  6.00k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  759|  6.00k|  (void)parIdx;
  760|       |
  761|  6.00k|  const XmpData& xmpData = image_.xmpData();
  762|       |
  763|  6.00k|  std::string prefix = "xmpGImg";
  764|  6.00k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (764:7): [True: 0, False: 6.00k]
  ------------------
  765|      0|    prefix = "xapGImg";
  766|      0|  }
  767|       |
  768|  6.00k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  769|  6.00k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (769:7): [True: 6.00k, False: 0]
  ------------------
  770|  6.00k|    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|   207k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  320|   207k|  Loader::UniquePtr loader;
  321|   207k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (321:7): [True: 0, False: 207k]
  |  Branch (321:17): [True: 0, False: 207k]
  ------------------
  322|      0|    return loader;
  323|       |
  324|   207k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (324:7): [True: 18.1k, False: 189k]
  |  Branch (324:7): [True: 12.0k, False: 195k]
  |  Branch (324:41): [True: 12.0k, False: 6.13k]
  ------------------
  325|  12.0k|    return loader;
  326|       |
  327|   195k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  328|   195k|  if (!loader->valid())
  ------------------
  |  Branch (328:7): [True: 181k, False: 13.9k]
  ------------------
  329|   181k|    loader = nullptr;
  330|       |
  331|   195k|  return loader;
  332|   207k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1024|  5.87k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|   944k|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|   944k|  return ns_ == ns.ns_;
 4941|   944k|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  88.3M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  88.3M|  return prefix_ == prefix.prefix_;
 4945|  88.3M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.56M|std::mutex& XmpProperties::getMutex() {
 4953|  2.56M|  static std::mutex m;
 4954|  2.56M|  return m;
 4955|  2.56M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.66M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  55.6M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 55.6M, False: 2.26M]
  ------------------
 4965|  55.6M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 401k, False: 55.2M]
  ------------------
 4966|   401k|      return &p;
 4967|  55.6M|  }
 4968|  2.26M|  return nullptr;
 4969|  2.66M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|  7.01k|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|  7.01k|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 7.01k]
  ------------------
 4978|      0|    return;
 4979|  7.01k|  std::string ns2 = ns;
 4980|  7.01k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 5.49k, False: 1.51k]
  |  Branch (4980:28): [True: 4.29k, False: 1.20k]
  ------------------
 4981|  4.29k|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|  7.01k|  auto it = nsRegistry_.find(ns2);
 4985|  7.01k|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 7.01k]
  |  Branch (4985:7): [True: 0, False: 7.01k]
  |  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|  7.01k|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 6.98k, False: 27]
  ------------------
 4991|  6.98k|#ifndef SUPPRESS_WARNINGS
 4992|  6.98k|    if (ns2 != xnp->ns_)
  ------------------
  |  Branch (4992:9): [True: 6.98k, False: 0]
  ------------------
 4993|  6.98k|      EXV_WARNING << "Updating namespace URI for " << prefix << " from " << xnp->ns_ << " to " << ns2 << "\n";
  ------------------
  |  |  138|  6.98k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.98k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.98k|  LogMsg(LogMsg::warn).os()
  ------------------
 4994|  6.98k|#endif
 4995|  6.98k|    unregisterNsUnlocked(xnp->ns_, lock);
 4996|  6.98k|  }
 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|  7.01k|  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|  7.01k|  XmpNsInfo xn;
 5005|  7.01k|  auto c = new char[ns2.size() + 1];
 5006|  7.01k|  std::strcpy(c, ns2.c_str());
 5007|  7.01k|  xn.ns_ = c;
 5008|  7.01k|  c = new char[prefix.size() + 1];
 5009|  7.01k|  std::strcpy(c, prefix.c_str());
 5010|  7.01k|  xn.prefix_ = c;
 5011|  7.01k|  xn.xmpPropertyInfo_ = nullptr;
 5012|  7.01k|  xn.desc_ = "";
 5013|  7.01k|  nsRegistry_[ns2] = xn;
 5014|  7.01k|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|  13.9k|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|  13.9k|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|  13.9k|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|  14.0k|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|  14.0k|  auto i = nsRegistry_.find(ns);
 5027|  14.0k|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 7.01k, False: 7.01k]
  ------------------
 5028|  7.01k|    delete[] i->second.prefix_;
 5029|  7.01k|    delete[] i->second.ns_;
 5030|  7.01k|    nsRegistry_.erase(i);
 5031|  7.01k|  }
 5032|  14.0k|}
_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|     28|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 27, False: 1]
  ------------------
 5046|     27|    auto kill = i++;
 5047|     27|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     27|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   143k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   143k|  std::string ns2 = ns;
 5058|   143k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 29.2k, False: 113k]
  |  Branch (5058:28): [True: 20.4k, False: 8.84k]
  ------------------
 5059|  20.4k|    ns2 += '/';
 5060|       |
 5061|   143k|  auto i = nsRegistry_.find(ns2);
 5062|   143k|  std::string p;
 5063|   143k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 48.1k, False: 95.0k]
  ------------------
 5064|  48.1k|    p = i->second.prefix_;
 5065|  95.0k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 88.0k, False: 7.01k]
  ------------------
 5066|  88.0k|    p = std::string(xn->prefix_);
 5067|   143k|  return p;
 5068|   143k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.50M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.50M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 393k, False: 1.10M]
  ------------------
 5077|   393k|    return xn->ns_;
 5078|  1.10M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.50M|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5106|  43.9k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5107|  43.9k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5108|  43.9k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5108:10): [True: 41.4k, False: 2.43k]
  ------------------
 5109|  43.9k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5116|  43.9k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5117|  43.9k|  std::string prefix = key.groupName();
 5118|  43.9k|  std::string property = key.tagName();
 5119|       |  // If property is a path for a nested property, determines the innermost element
 5120|  43.9k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5120:44): [True: 0, False: 43.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|  43.9k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5132:12): [True: 42.8k, False: 1.08k]
  ------------------
 5133|  5.64M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5133:24): [True: 5.64M, False: 1.34k]
  ------------------
 5134|  5.64M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5134:11): [True: 41.4k, False: 5.60M]
  ------------------
 5135|  41.4k|        return pl + j;
 5136|  41.4k|      }
 5137|  5.64M|    }
 5138|  42.8k|  }
 5139|  2.43k|  return nullptr;
 5140|  43.9k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5157|  43.9k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5158|  43.9k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5159|  43.9k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5166|  1.15M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5167|  1.15M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5168|  1.15M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5169|  1.15M|  if (!xn)
  ------------------
  |  Branch (5169:7): [True: 1.15M, False: 1.08k]
  ------------------
 5170|  1.15M|    xn = Exiv2::find(xmpNsInfo, pf);
 5171|  1.15M|  if (!xn)
  ------------------
  |  Branch (5171:7): [True: 86, False: 1.15M]
  ------------------
 5172|     86|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5173|  1.15M|  return xn;
 5174|  1.15M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5245|   129k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5246|       |  // Validate prefix unlocked (must hold lock)
 5247|   129k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5247:7): [True: 0, False: 129k]
  ------------------
 5248|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5249|       |
 5250|   129k|  property_ = property;
 5251|   129k|  prefix_ = prefix;
 5252|   129k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5254|   342k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5255|   342k|  p_->decomposeKey(key);
 5256|   342k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5258|   914k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5259|   914k|  p_->decomposeKeyUnlocked(key, lock);
 5260|   914k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5266|   129k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5267|   129k|}
_ZN5Exiv26XmpKeyD2Ev:
 5269|  1.81M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5271|   433k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5272|   433k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5281|   433k|XmpKey::UniquePtr XmpKey::clone() const {
 5282|   433k|  return UniquePtr(clone_());
 5283|   433k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5285|   433k|XmpKey* XmpKey::clone_() const {
 5286|   433k|  return new XmpKey(*this);
 5287|   433k|}
_ZNK5Exiv26XmpKey3keyEv:
 5289|  20.6M|std::string XmpKey::key() const {
 5290|  20.6M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5291|  20.6M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5297|   161k|std::string XmpKey::groupName() const {
 5298|   161k|  return p_->prefix_;
 5299|   161k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5301|   352k|std::string XmpKey::tagName() const {
 5302|   352k|  return p_->property_;
 5303|   352k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5331|   342k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5332|   342k|  XmpProperties::XmpLock lock;
 5333|   342k|  decomposeKeyUnlocked(key, lock);
 5334|   342k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5336|  1.25M|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.25M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5338:7): [True: 212, False: 1.25M]
  ------------------
 5339|    212|    throw Error(ErrorCode::kerInvalidKey, key);
 5340|  1.25M|  std::string::size_type pos1 = key.find('.');
 5341|  1.25M|  std::string::size_type pos0 = pos1 + 1;
 5342|  1.25M|  pos1 = key.find('.', pos0);
 5343|  1.25M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5343:7): [True: 0, False: 1.25M]
  ------------------
 5344|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|  1.25M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5346|  1.25M|  if (prefix.empty())
  ------------------
  |  Branch (5346:7): [True: 0, False: 1.25M]
  ------------------
 5347|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5348|  1.25M|  std::string property = key.substr(pos1 + 1);
 5349|  1.25M|  if (property.empty())
  ------------------
  |  Branch (5349:7): [True: 0, False: 1.25M]
  ------------------
 5350|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5351|       |
 5352|       |  // Validate prefix unlocked (must hold lock)
 5353|  1.25M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5353:7): [True: 0, False: 1.25M]
  ------------------
 5354|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5355|       |
 5356|  1.25M|  property_ = std::move(property);
 5357|  1.25M|  prefix_ = std::move(prefix);
 5358|  1.25M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5219|  1.25M|  Impl() = default;                                                                             //!< Default constructor

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  100|    559|PsdImage::PsdImage(BasicIo::UniquePtr io) : Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io)) {
  101|    559|}  // PsdImage::PsdImage
_ZN5Exiv28PsdImage12readMetadataEv:
  112|    553|void PsdImage::readMetadata() {
  113|       |#ifdef EXIV2_DEBUG_MESSAGES
  114|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  115|       |#endif
  116|    553|  if (io_->open() != 0) {
  ------------------
  |  Branch (116:7): [True: 0, False: 553]
  ------------------
  117|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  118|      0|  }
  119|    553|  IoCloser closer(*io_);
  120|       |  // Ensure that this is the correct image type
  121|    553|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (121:7): [True: 0, False: 553]
  ------------------
  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|    553|  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|    553|  byte buf[26];
  144|    553|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (144:7): [True: 0, False: 553]
  ------------------
  145|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  146|      0|  }
  147|    553|  pixelWidth_ = getLong(buf + 18, bigEndian);
  148|    553|  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|    553|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (152:7): [True: 0, False: 553]
  ------------------
  153|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  154|      0|  }
  155|       |
  156|       |  // skip it
  157|    553|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (157:7): [True: 21, False: 532]
  ------------------
  158|     21|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  159|     21|  }
  160|       |
  161|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  162|    532|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (162:7): [True: 12, False: 520]
  ------------------
  163|     12|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  164|     12|  }
  165|    520|  uint32_t resourcesLength = getULong(buf, bigEndian);
  166|    520|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  1.25k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (168:10): [True: 959, False: 298]
  ------------------
  169|    959|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  170|    959|    resourcesLength -= 8;
  171|    959|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (171:9): [True: 41, False: 918]
  ------------------
  172|     41|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  173|     41|    }
  174|       |
  175|    918|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (175:9): [True: 169, False: 749]
  ------------------
  176|    169|      break;  // bad resource type
  177|    169|    }
  178|    749|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  179|    749|    uint32_t resourceNameLength = buf[6] & ~1;
  180|       |
  181|       |    // skip the resource name, plus any padding
  182|    749|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  183|    749|    resourcesLength -= resourceNameLength;
  184|    749|    io_->seek(resourceNameLength, BasicIo::cur);
  185|       |
  186|       |    // read resource size
  187|    749|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  188|    749|    resourcesLength -= 4;
  189|    749|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (189:9): [True: 12, False: 737]
  ------------------
  190|     12|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  191|     12|    }
  192|    737|    uint32_t resourceSize = getULong(buf, bigEndian);
  193|    737|    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|    737|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  201|    737|    readResourceBlock(resourceId, resourceSize);
  202|    737|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  203|    737|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  204|    737|    resourcesLength -= resourceSize;
  205|    737|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  206|    737|  }
  207|       |
  208|    520|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  210|    627|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  211|    627|  switch (resourceId) {
  212|    153|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (212:5): [True: 153, False: 474]
  ------------------
  213|    153|      DataBuf rawIPTC(resourceSize);
  214|    153|      io_->read(rawIPTC.data(), rawIPTC.size());
  215|    153|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (215:11): [True: 0, False: 153]
  |  Branch (215:27): [True: 7, False: 146]
  ------------------
  216|      7|        throw Error(ErrorCode::kerFailedToReadImageData);
  217|    146|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (217:11): [True: 42, False: 104]
  ------------------
  218|     42|#ifndef SUPPRESS_WARNINGS
  219|     42|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     42|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 42]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     42|  LogMsg(LogMsg::warn).os()
  ------------------
  220|     42|#endif
  221|     42|        iptcData_.clear();
  222|     42|      }
  223|    146|      break;
  224|    153|    }
  225|       |
  226|     32|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (226:5): [True: 32, False: 595]
  ------------------
  227|     32|      DataBuf rawExif(resourceSize);
  228|     32|      io_->read(rawExif.data(), rawExif.size());
  229|     32|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (229:11): [True: 0, False: 32]
  |  Branch (229:27): [True: 3, False: 29]
  ------------------
  230|      3|        throw Error(ErrorCode::kerFailedToReadImageData);
  231|     29|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size());
  232|     29|      setByteOrder(bo);
  233|     29|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (233:11): [True: 2, False: 27]
  |  Branch (233:31): [True: 0, False: 2]
  ------------------
  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|     29|      break;
  240|     32|    }
  241|       |
  242|     69|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (242:5): [True: 69, False: 558]
  ------------------
  243|     69|      DataBuf xmpPacket(resourceSize);
  244|     69|      io_->read(xmpPacket.data(), xmpPacket.size());
  245|     69|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (245:11): [True: 0, False: 69]
  |  Branch (245:27): [True: 7, False: 62]
  ------------------
  246|      7|        throw Error(ErrorCode::kerFailedToReadImageData);
  247|     62|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  248|     62|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (248:11): [True: 45, False: 17]
  |  Branch (248:34): [True: 41, False: 4]
  ------------------
  249|     41|#ifndef SUPPRESS_WARNINGS
  250|     41|        EXV_WARNING << "Failed to decode XMP 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()
  ------------------
  251|     41|#endif
  252|     41|      }
  253|     62|      break;
  254|     69|    }
  255|       |
  256|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  257|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  258|    144|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (258:5): [True: 144, False: 483]
  ------------------
  259|    155|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (259:5): [True: 11, False: 616]
  ------------------
  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|    155|      byte buf[28];
  277|    155|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (277:11): [True: 25, False: 130]
  ------------------
  278|     25|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  279|     25|      }
  280|    130|      NativePreview nativePreview;
  281|    130|      nativePreview.position_ = io_->tell();
  282|    130|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  283|    130|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  284|    130|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  285|    130|      const uint32_t format = getLong(buf + 0, bigEndian);
  286|       |
  287|    130|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  288|    130|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  289|       |
  290|    130|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (290:11): [True: 51, False: 79]
  |  Branch (290:38): [True: 51, False: 0]
  ------------------
  291|     51|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  292|     51|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (292:13): [True: 0, False: 51]
  |  Branch (292:29): [True: 25, False: 26]
  ------------------
  293|     25|          throw Error(ErrorCode::kerFailedToReadImageData);
  294|       |
  295|       |        // unsupported format of native preview
  296|     26|        if (format != 1)
  ------------------
  |  Branch (296:13): [True: 25, False: 1]
  ------------------
  297|     25|          break;
  298|      1|        nativePreview.filter_ = "";
  299|      1|        nativePreview.mimeType_ = "image/jpeg";
  300|      1|        nativePreviews_.push_back(std::move(nativePreview));
  301|      1|      }
  302|     80|      break;
  303|    130|    }
  304|       |
  305|    218|    default:
  ------------------
  |  Branch (305:5): [True: 218, False: 409]
  ------------------
  306|    218|      break;
  307|    627|  }
  308|    627|}  // PsdImage::readResourceBlock
_ZN5Exiv28PsdImage13writeMetadataEv:
  310|     75|void PsdImage::writeMetadata() {
  311|     75|  if (io_->open() != 0) {
  ------------------
  |  Branch (311:7): [True: 0, False: 75]
  ------------------
  312|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  313|      0|  }
  314|     75|  IoCloser closer(*io_);
  315|     75|  MemIo tempIo;
  316|       |
  317|     75|  doWriteMetadata(tempIo);  // may throw
  318|     75|  io_->close();
  319|     75|  io_->transfer(tempIo);  // may throw
  320|       |
  321|     75|}  // PsdImage::writeMetadata
_ZN5Exiv28PsdImage15doWriteMetadataERNS_7BasicIoE:
  323|     75|void PsdImage::doWriteMetadata(BasicIo& outIo) {
  324|     75|  if (!io_->isopen())
  ------------------
  |  Branch (324:7): [True: 0, False: 75]
  ------------------
  325|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  326|     75|  if (!outIo.isopen())
  ------------------
  |  Branch (326:7): [True: 0, False: 75]
  ------------------
  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|     75|  if (!isPsdType(*io_, true)) {
  ------------------
  |  Branch (335:7): [True: 0, False: 75]
  ------------------
  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|     75|  io_->seek(0, BasicIo::beg);  // rewind
  342|       |
  343|     75|  DataBuf lbuf(4096);
  344|     75|  byte buf[8];
  345|       |
  346|       |  // Get Photoshop header from original file
  347|     75|  byte psd_head[26];
  348|     75|  if (io_->read(psd_head, 26) != 26)
  ------------------
  |  Branch (348:7): [True: 0, False: 75]
  ------------------
  349|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  350|       |
  351|       |  // Write Photoshop header data out to new PSD file
  352|     75|  if (outIo.write(psd_head, 26) != 26)
  ------------------
  |  Branch (352:7): [True: 0, False: 75]
  ------------------
  353|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  354|       |
  355|       |  // Read colorDataLength from original PSD
  356|     75|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (356:7): [True: 0, False: 75]
  ------------------
  357|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  358|       |
  359|     75|  uint32_t colorDataLength = getULong(buf, bigEndian);
  360|       |
  361|       |  // Write colorDataLength
  362|     75|  ul2Data(buf, colorDataLength, bigEndian);
  363|     75|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (363:7): [True: 0, False: 75]
  ------------------
  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|     75|  size_t readTotal = 0;
  370|    118|  while (readTotal < colorDataLength) {
  ------------------
  |  Branch (370:10): [True: 43, False: 75]
  ------------------
  371|     43|    auto toRead = std::min<size_t>(colorDataLength - readTotal, lbuf.size());
  372|     43|    if (io_->read(lbuf.data(), toRead) != toRead)
  ------------------
  |  Branch (372:9): [True: 0, False: 43]
  ------------------
  373|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  374|     43|    readTotal += toRead;
  375|     43|    if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (375:9): [True: 0, False: 43]
  ------------------
  376|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  377|     43|  }
  378|     75|  if (outIo.error())
  ------------------
  |  Branch (378:7): [True: 0, False: 75]
  ------------------
  379|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  380|       |
  381|     75|  const size_t resLenOffset = io_->tell();  // remember for later update
  382|       |
  383|       |  // Read length of all resource blocks from original PSD
  384|     75|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (384:7): [True: 0, False: 75]
  ------------------
  385|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  386|       |
  387|     75|  uint32_t oldResLength = getULong(buf, bigEndian);
  388|     75|  uint32_t newResLength = 0;
  389|       |
  390|       |  // Write oldResLength (will be updated later)
  391|     75|  ul2Data(buf, oldResLength, bigEndian);
  392|     75|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (392:7): [True: 0, False: 75]
  ------------------
  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|     75|  bool iptcDone = false;
  404|     75|  bool exifDone = false;
  405|     75|  bool xmpDone = false;
  406|    215|  while (oldResLength > 0) {
  ------------------
  |  Branch (406:10): [True: 192, False: 23]
  ------------------
  407|    192|    if (io_->read(buf, 8) != 8)
  ------------------
  |  Branch (407:9): [True: 0, False: 192]
  ------------------
  408|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  409|       |
  410|       |    // read resource type and ID
  411|    192|    uint32_t resourceType = getULong(buf, bigEndian);
  412|       |
  413|    192|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (413:9): [True: 50, False: 142]
  ------------------
  414|     50|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");  // bad resource type
  415|     50|    }
  416|    142|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  417|    142|    uint32_t resourceNameLength = buf[6];
  418|    142|    uint32_t adjResourceNameLen = resourceNameLength & ~1;
  419|    142|    unsigned char resourceNameFirstChar = buf[7];
  420|       |
  421|       |    // read rest of resource name, plus any padding
  422|    142|    DataBuf resName(256);
  423|    142|    if (io_->read(resName.data(), adjResourceNameLen) != adjResourceNameLen)
  ------------------
  |  Branch (423:9): [True: 1, False: 141]
  ------------------
  424|      1|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  425|       |
  426|       |    // read resource size (actual length w/o padding!)
  427|    141|    if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (427:9): [True: 0, False: 141]
  ------------------
  428|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  429|       |
  430|    141|    uint32_t resourceSize = getULong(buf, bigEndian);
  431|    141|    uint32_t pResourceSize = (resourceSize + 1) & ~1;  // padded resource size
  432|    141|    const size_t curOffset = io_->tell();
  433|       |
  434|       |    // Write IPTC_NAA resource block
  435|    141|    if (resourceId >= kPhotoshopResourceID::IPTC_NAA && !iptcDone) {
  ------------------
  |  Branch (435:9): [True: 137, False: 4]
  |  Branch (435:57): [True: 57, False: 80]
  ------------------
  436|     57|      newResLength += writeIptcData(iptcData_, outIo);
  437|     57|      iptcDone = true;
  438|     57|    }
  439|       |
  440|       |    // Write ExifInfo resource block
  441|     84|    else if (resourceId >= kPhotoshopResourceID::ExifInfo && !exifDone) {
  ------------------
  |  Branch (441:14): [True: 45, False: 39]
  |  Branch (441:62): [True: 24, False: 21]
  ------------------
  442|     24|      newResLength += writeExifData(exifData_, outIo);
  443|     24|      exifDone = true;
  444|     24|    }
  445|       |
  446|       |    // Write XMPpacket resource block
  447|     60|    else if (resourceId >= kPhotoshopResourceID::XMPPacket && !xmpDone) {
  ------------------
  |  Branch (447:14): [True: 18, False: 42]
  |  Branch (447:63): [True: 17, False: 1]
  ------------------
  448|     17|      newResLength += writeXmpData(xmpData_, outIo);
  449|     17|      xmpDone = true;
  450|     17|    }
  451|       |
  452|       |    // Copy all other resource blocks
  453|    141|    if (resourceId != kPhotoshopResourceID::IPTC_NAA && resourceId != kPhotoshopResourceID::ExifInfo &&
  ------------------
  |  Branch (453:9): [True: 93, False: 48]
  |  Branch (453:57): [True: 81, False: 12]
  ------------------
  454|     81|        resourceId != kPhotoshopResourceID::XMPPacket) {
  ------------------
  |  Branch (454:9): [True: 62, False: 19]
  ------------------
  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|     62|      ul2Data(buf, resourceType, bigEndian);
  462|     62|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (462:11): [True: 0, False: 62]
  ------------------
  463|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  464|     62|      us2Data(buf, resourceId, bigEndian);
  465|     62|      if (outIo.write(buf, 2) != 2)
  ------------------
  |  Branch (465:11): [True: 0, False: 62]
  ------------------
  466|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  467|       |      // Write resource name as Pascal string
  468|     62|      buf[0] = resourceNameLength & 0x00ff;
  469|     62|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (469:11): [True: 0, False: 62]
  ------------------
  470|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  471|     62|      buf[0] = resourceNameFirstChar;
  472|     62|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (472:11): [True: 0, False: 62]
  ------------------
  473|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  474|     62|      if (outIo.write(resName.c_data(), adjResourceNameLen) != static_cast<size_t>(adjResourceNameLen))
  ------------------
  |  Branch (474:11): [True: 0, False: 62]
  ------------------
  475|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  476|     62|      ul2Data(buf, resourceSize, bigEndian);
  477|     62|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (477:11): [True: 0, False: 62]
  ------------------
  478|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  479|       |
  480|     62|      readTotal = 0;
  481|    176|      while (readTotal < pResourceSize) {
  ------------------
  |  Branch (481:14): [True: 115, False: 61]
  ------------------
  482|       |        /// \todo almost same code as in lines 403-410. Factor out & reuse!
  483|    115|        auto toRead = std::min<size_t>(pResourceSize - readTotal, lbuf.size());
  484|    115|        if (io_->read(lbuf.data(), toRead) != toRead) {
  ------------------
  |  Branch (484:13): [True: 1, False: 114]
  ------------------
  485|      1|          throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  486|      1|        }
  487|    114|        readTotal += toRead;
  488|    114|        if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (488:13): [True: 0, False: 114]
  ------------------
  489|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  490|    114|      }
  491|     61|      if (outIo.error())
  ------------------
  |  Branch (491:11): [True: 0, False: 61]
  ------------------
  492|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  493|     61|      newResLength += pResourceSize + adjResourceNameLen + 12;
  494|     61|    }
  495|       |
  496|    140|    io_->seek(curOffset + pResourceSize, BasicIo::beg);
  497|    140|    oldResLength -= (12 + adjResourceNameLen + pResourceSize);
  498|    140|  }
  499|       |
  500|       |  // Append IPTC_NAA resource block, if not yet written
  501|     23|  if (!iptcDone) {
  ------------------
  |  Branch (501:7): [True: 15, False: 8]
  ------------------
  502|     15|    newResLength += writeIptcData(iptcData_, outIo);
  503|     15|    iptcDone = true;
  504|     15|  }
  505|       |
  506|       |  // Append ExifInfo resource block, if not yet written
  507|     23|  if (!exifDone) {
  ------------------
  |  Branch (507:7): [True: 21, False: 2]
  ------------------
  508|     21|    newResLength += writeExifData(exifData_, outIo);
  509|     21|  }
  510|       |
  511|       |  // Append XmpPacket resource block, if not yet written
  512|     23|  if (!xmpDone) {
  ------------------
  |  Branch (512:7): [True: 22, False: 1]
  ------------------
  513|     22|    newResLength += writeXmpData(xmpData_, outIo);
  514|     22|  }
  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|     23|  io_->populateFakeData();
  519|       |
  520|       |  // Copy remaining data
  521|     23|  size_t readSize = io_->read(lbuf.data(), lbuf.size());
  522|    229|  while (readSize != 0) {
  ------------------
  |  Branch (522:10): [True: 206, False: 23]
  ------------------
  523|    206|    if (outIo.write(lbuf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (523:9): [True: 0, False: 206]
  ------------------
  524|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  525|    206|    readSize = io_->read(lbuf.data(), lbuf.size());
  526|    206|  }
  527|     23|  if (outIo.error())
  ------------------
  |  Branch (527:7): [True: 0, False: 23]
  ------------------
  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|     23|  outIo.seek(resLenOffset, BasicIo::beg);
  535|     23|  ul2Data(buf, newResLength, bigEndian);
  536|     23|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (536:7): [True: 0, False: 23]
  ------------------
  537|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  538|       |
  539|     23|}  // PsdImage::doWriteMetadata
_ZN5Exiv28PsdImage13writeIptcDataERKNS_8IptcDataERNS_7BasicIoE:
  541|     72|uint32_t PsdImage::writeIptcData(const IptcData& iptcData, BasicIo& out) {
  542|     72|  uint32_t resLength = 0;
  543|     72|  byte buf[8];
  544|       |
  545|     72|  if (!iptcData.empty()) {
  ------------------
  |  Branch (545:7): [True: 13, False: 59]
  ------------------
  546|     13|    DataBuf rawIptc = IptcParser::encode(iptcData);
  547|     13|    if (!rawIptc.empty()) {
  ------------------
  |  Branch (547:9): [True: 13, 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|     13|      if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_.front()), 4) != 4)
  ------------------
  |  Branch (552:11): [True: 0, False: 13]
  ------------------
  553|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  554|     13|      us2Data(buf, kPhotoshopResourceID::IPTC_NAA, bigEndian);
  555|     13|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (555:11): [True: 0, False: 13]
  ------------------
  556|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  557|     13|      us2Data(buf, 0, bigEndian);  // NULL resource name
  558|     13|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (558:11): [True: 0, False: 13]
  ------------------
  559|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  560|     13|      ul2Data(buf, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  561|     13|      if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (561:11): [True: 0, False: 13]
  ------------------
  562|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  563|       |      // Write encoded Iptc data
  564|     13|      if (out.write(rawIptc.c_data(), rawIptc.size()) != rawIptc.size())
  ------------------
  |  Branch (564:11): [True: 0, False: 13]
  ------------------
  565|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  566|     13|      resLength += static_cast<uint32_t>(rawIptc.size()) + 12;
  567|     13|      if (rawIptc.size() & 1)  // even padding
  ------------------
  |  Branch (567:11): [True: 11, False: 2]
  ------------------
  568|     11|      {
  569|     11|        buf[0] = 0;
  570|     11|        if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (570:13): [True: 0, False: 11]
  ------------------
  571|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  572|     11|        resLength++;
  573|     11|      }
  574|     13|    }
  575|     13|  }
  576|     72|  return resLength;
  577|     72|}  // PsdImage::writeIptcData
_ZN5Exiv28PsdImage13writeExifDataERNS_8ExifDataERNS_7BasicIoE:
  579|     45|uint32_t PsdImage::writeExifData(ExifData& exifData, BasicIo& out) {
  580|     45|  uint32_t resLength = 0;
  581|     45|  byte buf[8];
  582|       |
  583|     45|  if (!exifData.empty()) {
  ------------------
  |  Branch (583:7): [True: 2, False: 43]
  ------------------
  584|      2|    Blob blob;
  585|      2|    ByteOrder bo = byteOrder();
  586|      2|    if (bo == invalidByteOrder) {
  ------------------
  |  Branch (586:9): [True: 0, False: 2]
  ------------------
  587|      0|      bo = littleEndian;
  588|      0|      setByteOrder(bo);
  589|      0|    }
  590|      2|    ExifParser::encode(blob, bo, exifData);
  591|       |
  592|      2|    if (!blob.empty()) {
  ------------------
  |  Branch (592:9): [True: 1, False: 1]
  ------------------
  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|      2|  }
  621|     45|  return resLength;
  622|     45|}  // PsdImage::writeExifData
_ZNK5Exiv28PsdImage12writeXmpDataERKNS_7XmpDataERNS_7BasicIoE:
  624|     39|uint32_t PsdImage::writeXmpData(const XmpData& xmpData, BasicIo& out) const {
  625|     39|  std::string xmpPacket;
  626|     39|  uint32_t resLength = 0;
  627|     39|  byte buf[8];
  628|       |
  629|       |#ifdef EXIV2_DEBUG_MESSAGES
  630|       |  std::cerr << "writeXmpFromPacket(): " << writeXmpFromPacket() << "\n";
  631|       |#endif
  632|       |  //        writeXmpFromPacket(true);
  633|     39|  if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket, xmpData) > 1) {
  ------------------
  |  Branch (633:7): [True: 39, False: 0]
  |  Branch (633:32): [True: 0, False: 39]
  ------------------
  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|     39|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (639:7): [True: 4, False: 35]
  ------------------
  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|      4|    if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_.front()), 4) != 4)
  ------------------
  |  Branch (644:9): [True: 0, False: 4]
  ------------------
  645|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  646|      4|    us2Data(buf, kPhotoshopResourceID::XMPPacket, bigEndian);
  647|      4|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (647:9): [True: 0, False: 4]
  ------------------
  648|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  649|      4|    us2Data(buf, 0, bigEndian);  // NULL resource name
  650|      4|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (650:9): [True: 0, False: 4]
  ------------------
  651|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  652|      4|    ul2Data(buf, static_cast<uint32_t>(xmpPacket.size()), bigEndian);
  653|      4|    if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (653:9): [True: 0, False: 4]
  ------------------
  654|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  655|       |    // Write XMPPacket
  656|      4|    if (out.write(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size()) != xmpPacket.size())
  ------------------
  |  Branch (656:9): [True: 0, False: 4]
  ------------------
  657|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  658|      4|    if (out.error())
  ------------------
  |  Branch (658:9): [True: 0, False: 4]
  ------------------
  659|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  660|      4|    resLength += static_cast<uint32_t>(xmpPacket.size()) + 12;
  661|      4|    if (xmpPacket.size() & 1)  // even padding
  ------------------
  |  Branch (661:9): [True: 1, False: 3]
  ------------------
  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|      4|  }
  669|     39|  return resLength;
  670|     39|}  // PsdImage::writeXmpData
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  674|    559|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, bool /*create*/) {
  675|    559|  auto image = std::make_unique<PsdImage>(std::move(io));
  676|    559|  if (!image->good()) {
  ------------------
  |  Branch (676:7): [True: 6, False: 553]
  ------------------
  677|      6|    return nullptr;
  678|      6|  }
  679|    553|  return image;
  680|    559|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  682|  15.6k|bool isPsdType(BasicIo& iIo, bool advance) {
  683|  15.6k|  const int32_t len = 6;
  684|  15.6k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  685|  15.6k|  std::array<byte, len> buf;
  686|  15.6k|  iIo.read(buf.data(), len);
  687|  15.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 15.6k]
  |  Branch (687:22): [True: 369, False: 15.3k]
  ------------------
  688|    369|    return false;
  689|    369|  }
  690|  15.3k|  bool matched = buf == PsdHeader;
  691|  15.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (691:7): [True: 15.2k, False: 75]
  |  Branch (691:19): [True: 0, False: 75]
  ------------------
  692|  15.2k|    iIo.seek(-len, BasicIo::cur);
  693|  15.2k|  }
  694|       |
  695|  15.3k|  return matched;
  696|  15.6k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  540|  3.52k|    Image(ImageType::qtime, mdNone, std::move(io)),
  541|  3.52k|    mvhdTimeScale_(1),
  542|  3.52k|    mdhdTimeScale_(1),
  543|  3.52k|    currentStream_(Null),
  544|  3.52k|    max_recursion_depth_(max_recursion_depth) {
  545|  3.52k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  3.51k|std::string QuickTimeVideo::mimeType() const {
  548|  3.51k|  return "video/quicktime";
  549|  3.51k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  551|    241|void QuickTimeVideo::writeMetadata() {
  552|    241|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  3.51k|void QuickTimeVideo::readMetadata() {
  555|  3.51k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.51k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  3.51k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 3.51k]
  ------------------
  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.51k|  IoCloser closer(*io_);
  566|  3.51k|  clearMetadata();
  567|  3.51k|  continueTraversing_ = true;
  568|  3.51k|  height_ = width_ = 1;
  569|       |
  570|  3.51k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  3.51k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  60.7k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 57.2k, False: 3.51k]
  ------------------
  574|  57.2k|    decodeBlock(0);
  575|       |
  576|  3.51k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  3.51k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  70.1k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|  70.1k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|  70.1k|  const long bufMinSize = 4;
  583|  70.1k|  DataBuf buf(bufMinSize + 1);
  584|  70.1k|  uint64_t size = 0;
  585|  70.1k|  buf.data()[4] = '\0';
  586|       |
  587|  70.1k|  io_->read(buf.data(), 4);
  588|  70.1k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 370, False: 69.7k]
  ------------------
  589|    370|    continueTraversing_ = false;
  590|    370|    return;
  591|    370|  }
  592|       |
  593|  69.7k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|  69.7k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|  69.7k|  size_t hdrsize = 8;
  599|       |
  600|  69.7k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 154, False: 69.6k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    154|    DataBuf data(8);
  603|    154|    hdrsize += 8;
  604|    154|    io_->readOrThrow(data.data(), data.size());
  605|    154|    size = data.read_uint64(0, bigEndian);
  606|  69.6k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 3.41k, False: 66.2k]
  |  Branch (606:27): [True: 3.25k, False: 168]
  ------------------
  607|  3.25k|    size = buf.read_uint32(0, bigEndian);
  608|  3.25k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  3.25k|  }
  610|       |
  611|  69.7k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|  69.7k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|  69.7k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|  69.7k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|  69.7k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 8.47k, False: 61.3k]
  ------------------
  618|  8.47k|    discard(newsize);
  619|  8.47k|    return;
  620|  8.47k|  }
  621|  61.3k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 47.1k, False: 14.1k]
  ------------------
  622|  47.1k|    buf.resize(newsize);
  623|  47.1k|  }
  624|  61.3k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|  61.3k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  62.7k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  62.7k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  62.7k|  assert(buf.size() > 4);
  638|       |
  639|  62.7k|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 62.7k]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  62.7k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 9.62k, False: 53.1k]
  ------------------
  643|  9.62k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|  53.1k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 4.60k, False: 48.5k]
  ------------------
  645|  4.60k|    fileTypeDecoder(size);
  646|       |
  647|  48.5k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 2.10k, False: 46.4k]
  ------------------
  648|  2.10k|    setMediaStream(size);
  649|       |
  650|  46.4k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 216, False: 46.2k]
  ------------------
  651|    216|    movieHeaderDecoder(size);
  652|       |
  653|  46.2k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 1.38k, False: 44.8k]
  ------------------
  654|  1.38k|    trackHeaderDecoder(size);
  655|       |
  656|  44.8k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 2.75k, False: 42.0k]
  ------------------
  657|  2.75k|    mediaHeaderDecoder(size);
  658|       |
  659|  42.0k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 6.48k, False: 35.5k]
  ------------------
  660|  6.48k|    handlerDecoder(size);
  661|       |
  662|  35.5k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 3.75k, False: 31.8k]
  ------------------
  663|  3.75k|    videoHeaderDecoder(size);
  664|       |
  665|  31.8k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 9.90k, False: 21.9k]
  ------------------
  666|  9.90k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  21.9k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 2.73k, False: 19.1k]
  ------------------
  669|  2.73k|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  19.1k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 1.49k, False: 17.6k]
  ------------------
  672|  1.49k|    sampleDesc(size);
  673|       |
  674|  17.6k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 1.21k, False: 16.4k]
  ------------------
  675|  1.21k|    timeToSampleDecoder();
  676|       |
  677|  16.4k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 1.02k, False: 15.4k]
  ------------------
  678|  1.02k|    previewTagDecoder(size);
  679|       |
  680|  15.4k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 1.10k, False: 14.3k]
  ------------------
  681|  1.10k|    trackApertureTagDecoder(size);
  682|       |
  683|  14.3k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 543, False: 13.8k]
  ------------------
  684|    543|    keysTagDecoder(size);
  685|       |
  686|  13.8k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 355, False: 13.4k]
  ------------------
  687|    355|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 103, False: 252]
  ------------------
  688|    103|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    252|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 201, False: 51]
  ------------------
  690|    201|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|     51|    else
  692|     51|      discard(size);
  693|    355|  }
  694|       |
  695|  13.4k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 2.15k, False: 11.3k]
  ------------------
  696|  2.15k|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 1.54k, False: 607]
  ------------------
  697|  1.54k|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    607|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 540, False: 67]
  ------------------
  699|    540|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|     67|    else
  701|     67|      discard(size);
  702|  2.15k|  }
  703|       |
  704|  11.3k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 157, False: 11.1k]
  ------------------
  705|    157|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|    157|  }
  707|       |
  708|  11.1k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 262, False: 10.8k]
  ------------------
  709|    262|    io_->readOrThrow(buf.data(), 4);
  710|    262|    io_->readOrThrow(buf.data(), 4);
  711|    262|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|    262|  }
  713|       |
  714|  10.8k|  else {
  715|  10.8k|    discard(size);
  716|  10.8k|  }
  717|  62.7k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  19.4k|void QuickTimeVideo::discard(size_t size) {
  720|  19.4k|  size_t cur_pos = io_->tell();
  721|  19.4k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  19.4k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|  1.02k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|  1.02k|  DataBuf buf(4);
  726|  1.02k|  size_t cur_pos = io_->tell();
  727|  1.02k|  io_->readOrThrow(buf.data(), 4);
  728|  1.02k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|  1.02k|  io_->readOrThrow(buf.data(), 2);
  730|  1.02k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|  1.02k|  io_->readOrThrow(buf.data(), 4);
  733|  1.02k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 6, False: 1.01k]
  ------------------
  734|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|  1.01k|  else
  736|  1.01k|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|  1.02k|  io_->seek(cur_pos + size, BasicIo::beg);
  739|  1.02k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|    543|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|    543|  DataBuf buf(4);
  743|    543|  size_t cur_pos = io_->tell();
  744|    543|  io_->readOrThrow(buf.data(), 4);
  745|    543|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|    543|  io_->readOrThrow(buf.data(), 2);
  747|    543|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|    543|  io_->readOrThrow(buf.data(), 4);
  750|    543|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 23, False: 520]
  ------------------
  751|     23|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    520|  else
  753|    520|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|    543|  io_->seek(cur_pos + size, BasicIo::beg);
  756|    543|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|  1.10k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|  1.10k|  DataBuf buf(4);
  760|  1.10k|  DataBuf buf2(2);
  761|  1.10k|  size_t cur_pos = io_->tell();
  762|  1.10k|  byte n = 3;
  763|       |
  764|  4.40k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 3.29k, False: 1.10k]
  ------------------
  765|  3.29k|    io_->seek(4L, BasicIo::cur);
  766|  3.29k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  3.29k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 52, False: 3.24k]
  ------------------
  769|     52|      io_->seek(4L, BasicIo::cur);
  770|     52|      io_->readOrThrow(buf.data(), 2);
  771|     52|      io_->readOrThrow(buf2.data(), 2);
  772|     52|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|     52|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     52|#define stringFormat std::format
  ------------------
  774|     52|      io_->readOrThrow(buf.data(), 2);
  775|     52|      io_->readOrThrow(buf2.data(), 2);
  776|     52|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|     52|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     52|#define stringFormat std::format
  ------------------
  778|     52|    }
  779|       |
  780|  3.24k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 97, False: 3.15k]
  ------------------
  781|     97|      io_->seek(4L, BasicIo::cur);
  782|     97|      io_->readOrThrow(buf.data(), 2);
  783|     97|      io_->readOrThrow(buf2.data(), 2);
  784|     97|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|     97|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     97|#define stringFormat std::format
  ------------------
  786|     97|      io_->readOrThrow(buf.data(), 2);
  787|     97|      io_->readOrThrow(buf2.data(), 2);
  788|     97|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|     97|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     97|#define stringFormat std::format
  ------------------
  790|     97|    }
  791|       |
  792|  3.15k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 47, False: 3.10k]
  ------------------
  793|     47|      io_->seek(4L, BasicIo::cur);
  794|     47|      io_->readOrThrow(buf.data(), 2);
  795|     47|      io_->readOrThrow(buf2.data(), 2);
  796|     47|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|     47|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     47|#define stringFormat std::format
  ------------------
  798|     47|      io_->readOrThrow(buf.data(), 2);
  799|     47|      io_->readOrThrow(buf2.data(), 2);
  800|     47|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|     47|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     47|#define stringFormat std::format
  ------------------
  802|     47|    }
  803|  3.29k|  }
  804|  1.10k|  io_->seek(cur_pos + size, BasicIo::beg);
  805|  1.10k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|  1.61k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|  1.61k|  size_t cur_pos = io_->tell();
  809|  1.61k|  DataBuf buf(50);
  810|  1.61k|  DataBuf buf2(4);
  811|       |
  812|  1.61k|  io_->readOrThrow(buf.data(), 4);
  813|  1.61k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 1.09k, False: 528]
  ------------------
  814|  1.09k|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|  1.09k|    io_->readOrThrow(buf.data(), 24);
  817|  1.09k|    xmpData_["Xmp.video.Make"] = buf.data();
  818|  1.09k|    io_->readOrThrow(buf.data(), 14);
  819|  1.09k|    xmpData_["Xmp.video.Model"] = buf.data();
  820|  1.09k|    io_->readOrThrow(buf.data(), 4);
  821|  1.09k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.09k|#define stringFormat std::format
  ------------------
  822|  1.09k|    io_->readOrThrow(buf.data(), 4);
  823|  1.09k|    io_->readOrThrow(buf2.data(), 4);
  824|  1.09k|    xmpData_["Xmp.video.FNumber"] =
  825|  1.09k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|  1.09k|    io_->readOrThrow(buf.data(), 4);
  827|  1.09k|    io_->readOrThrow(buf2.data(), 4);
  828|  1.09k|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|  1.09k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|  1.09k|    io_->readOrThrow(buf.data(), 10);
  831|  1.09k|    io_->readOrThrow(buf.data(), 4);
  832|  1.09k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 99, False: 992]
  ------------------
  833|     99|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|     99|#define _(String) (String)
  ------------------
  834|  1.09k|    io_->readOrThrow(buf.data(), 4);
  835|  1.09k|    io_->readOrThrow(buf2.data(), 4);
  836|  1.09k|    xmpData_["Xmp.video.FocalLength"] =
  837|  1.09k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|  1.09k|    io_->seek(95L, BasicIo::cur);
  839|  1.09k|    io_->readOrThrow(buf.data(), 48);
  840|  1.09k|    buf.write_uint8(48, 0);
  841|  1.09k|    xmpData_["Xmp.video.Software"] = buf.data();
  842|  1.09k|    io_->readOrThrow(buf.data(), 4);
  843|  1.09k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|  1.09k|  }
  845|       |
  846|  1.61k|  io_->seek(cur_pos + size, BasicIo::beg);
  847|  1.61k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|  10.0k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|  10.0k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|  10.0k|  size_t cur_pos = io_->tell();
  852|  10.0k|  const TagVocabulary* td;
  853|  10.0k|  const TagVocabulary* tv;
  854|  10.0k|  const TagVocabulary* tv_internal;
  855|       |
  856|  10.0k|  const long bufMinSize = 100;
  857|  10.0k|  DataBuf buf(bufMinSize);
  858|  10.0k|  size_t size_internal = outer_size;
  859|  10.0k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  19.3k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 13.8k, False: 5.53k]
  |  Branch (861:38): [True: 13.8k, False: 0]
  ------------------
  862|  13.8k|    buf.data()[4] = '\0';
  863|  13.8k|    io_->readOrThrow(buf.data(), 4);
  864|  13.8k|    const size_t size = buf.read_uint32(0, bigEndian);
  865|  13.8k|    if (size > size_internal)
  ------------------
  |  Branch (865:9): [True: 2.58k, False: 11.2k]
  ------------------
  866|  2.58k|      break;
  867|  11.2k|    size_internal -= size;
  868|  11.2k|    io_->readOrThrow(buf.data(), 4);
  869|       |
  870|  11.2k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (870:9): [True: 67, False: 11.1k]
  ------------------
  871|     67|      buf.data()[0] = ' ';
  872|  11.2k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  873|       |
  874|  11.2k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  875|       |
  876|  11.2k|    if (size <= 12)
  ------------------
  |  Branch (876:9): [True: 1.89k, False: 9.34k]
  ------------------
  877|  1.89k|      break;
  878|       |
  879|  9.34k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (879:9): [True: 96, False: 9.25k]
  |  Branch (879:40): [True: 21, False: 9.23k]
  ------------------
  880|    112|      userDataDecoder(size - 8, recursion_depth + 1);
  881|       |
  882|  9.23k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (882:14): [True: 1.54k, False: 7.69k]
  ------------------
  883|  1.54k|      NikonTagsDecoder(size - 8);
  884|       |
  885|  7.69k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (885:14): [True: 1.61k, False: 6.07k]
  ------------------
  886|  1.61k|      CameraTagsDecoder(size - 8);
  887|       |
  888|  6.07k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (888:14): [True: 28, False: 6.04k]
  |  Branch (888:45): [True: 395, False: 5.65k]
  |  Branch (888:76): [True: 22, False: 5.62k]
  ------------------
  889|  5.62k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (889:14): [True: 29, False: 5.60k]
  |  Branch (889:45): [True: 320, False: 5.28k]
  ------------------
  890|    789|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  891|    789|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    789|#define _(String) (String)
  ------------------
  892|    789|    }
  893|       |
  894|  5.28k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (894:14): [True: 207, False: 5.07k]
  |  Branch (894:45): [True: 0, False: 5.07k]
  ------------------
  895|    202|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  896|    202|      io_->readOrThrow(buf.data(), 2);
  897|    202|      buf.data()[2] = '\0';
  898|    202|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  899|       |
  900|    202|      if (tv_internal)
  ------------------
  |  Branch (900:11): [True: 137, False: 65]
  ------------------
  901|    137|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    137|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|    137|#define _(String) (String)
  ------------------
  902|     65|      else
  903|     65|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     65|#define _(String) (String)
  ------------------
  904|    202|    }
  905|       |
  906|  5.08k|    else if (tv) {
  ------------------
  |  Branch (906:14): [True: 229, False: 4.85k]
  ------------------
  907|    229|      io_->readOrThrow(buf.data(), 4);
  908|    229|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    229|#define _(String) (String)
  ------------------
  909|    229|    }
  910|       |
  911|  4.85k|    else if (td)
  ------------------
  |  Branch (911:14): [True: 3.24k, False: 1.61k]
  ------------------
  912|  3.24k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  913|  9.34k|  }
  914|       |
  915|  10.0k|  io_->seek(cur_pos + outer_size, BasicIo::beg);
  916|  10.0k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.54k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.54k|  size_t cur_pos = io_->tell();
  920|  1.54k|  DataBuf buf(201);
  921|  1.54k|  DataBuf buf2(4 + 1);
  922|  1.54k|  uint32_t TagID = 0;
  923|  1.54k|  uint16_t dataLength = 0;
  924|  1.54k|  uint16_t dataType = 2;
  925|  1.54k|  const TagDetails* td;
  926|  1.54k|  const TagDetails* td2;
  927|       |
  928|   107k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 105k, False: 1.54k]
  ------------------
  929|   105k|    io_->readOrThrow(buf.data(), 4);
  930|   105k|    TagID = buf.read_uint32(0, bigEndian);
  931|   105k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   105k|    io_->readOrThrow(buf.data(), 2);
  934|   105k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   105k|    std::memset(buf.data(), 0x0, buf.size());
  937|   105k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   105k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 4.55k, False: 101k]
  ------------------
  940|  4.55k|      size_t local_pos = io_->tell();
  941|  4.55k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  4.55k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  4.55k|      io_->readOrThrow(buf.data(), 4);
  945|  4.55k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  4.55k|      io_->readOrThrow(buf.data(), 20);
  947|  4.55k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  4.55k|      io_->readOrThrow(buf.data(), 20);
  949|  4.55k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  4.55k|      io_->readOrThrow(buf.data(), 4);
  951|  4.55k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  4.55k|      io_->readOrThrow(buf.data(), 1);
  954|  4.55k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  4.55k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 2.75k, False: 1.80k]
  ------------------
  956|  2.75k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.75k|#define _(String) (String)
  ------------------
  957|  1.80k|      else
  958|  1.80k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  4.55k|      io_->readOrThrow(buf.data(), 1);
  961|  4.55k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  4.55k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 2.68k, False: 1.87k]
  ------------------
  963|  2.68k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.68k|#define _(String) (String)
  ------------------
  964|       |
  965|  4.55k|      io_->readOrThrow(buf.data(), 1);
  966|  4.55k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  4.55k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 2.88k, False: 1.67k]
  ------------------
  968|  2.88k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  2.88k|#define _(String) (String)
  ------------------
  969|  1.67k|      else
  970|  1.67k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  4.55k|      io_->readOrThrow(buf.data(), 1);
  973|  4.55k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  4.55k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 1.63k, False: 2.92k]
  ------------------
  975|  1.63k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  1.63k|#define _(String) (String)
  ------------------
  976|  2.92k|      else
  977|  2.92k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  4.55k|      io_->readOrThrow(buf.data(), 1);
  980|  4.55k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  4.55k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 2.59k, False: 1.96k]
  ------------------
  982|  2.59k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  2.59k|#define _(String) (String)
  ------------------
  983|  1.96k|      else
  984|  1.96k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  4.55k|      io_->readOrThrow(buf.data(), 1);
  987|  4.55k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  4.55k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 1.84k, False: 2.71k]
  ------------------
  989|  1.84k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  1.84k|#define _(String) (String)
  ------------------
  990|  2.71k|      else
  991|  2.71k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  4.55k|      io_->readOrThrow(buf.data(), 1);
  994|  4.55k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  4.55k|      io_->readOrThrow(buf.data(), 1);
  997|  4.55k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  4.55k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 1.03k, False: 3.52k]
  ------------------
  999|  1.03k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.03k|#define _(String) (String)
  ------------------
 1000|  3.52k|      else
 1001|  3.52k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  4.55k|      io_->readOrThrow(buf.data(), 1);
 1004|  4.55k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  4.55k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 1.49k, False: 3.06k]
  ------------------
 1006|  1.49k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.49k|#define _(String) (String)
  ------------------
 1007|  3.06k|      else
 1008|  3.06k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  4.55k|      io_->readOrThrow(buf.data(), 1);
 1011|  4.55k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  4.55k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  4.55k|    }
 1015|       |
 1016|   101k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 569, False: 100k]
  ------------------
 1017|    569|      size_t local_pos = io_->tell();
 1018|    569|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    569|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    569|      io_->readOrThrow(buf.data(), 2);
 1022|    569|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    569|      io_->readOrThrow(buf.data(), 1);
 1024|    569|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    569|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 318, False: 251]
  ------------------
 1026|    318|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    318|#define _(String) (String)
  ------------------
 1027|       |
 1028|    569|      io_->readOrThrow(buf.data(), 1);
 1029|    569|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    569|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 342, False: 227]
  ------------------
 1031|    342|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    342|#define _(String) (String)
  ------------------
 1032|       |
 1033|    569|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    569|    }
 1035|       |
 1036|   100k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 1.43k, False: 99.2k]
  |  Branch (1036:31): [True: 343, False: 98.9k]
  ------------------
 1037|  1.22k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.22k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.22k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 670, False: 558]
  ------------------
 1042|    670|#ifndef SUPPRESS_WARNINGS
 1043|    670|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    670|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 670]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    670|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    670|#endif
 1046|    670|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    670|        buf.data()[0] = '\0';
 1048|    670|      } else {
 1049|    558|        io_->readOrThrow(buf.data(), dataLength);
 1050|    558|        buf.data()[dataLength] = '\0';
 1051|    558|      }
 1052|       |
 1053|  1.22k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 303, False: 925]
  ------------------
 1054|    303|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    303|#define _(String) (String)
  ------------------
 1055|    303|      }
 1056|  99.5k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 1.10k, False: 98.3k]
  ------------------
 1057|  1.10k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  1.10k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  1.10k|      io_->readOrThrow(buf.data(), 4);
 1060|  1.10k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 375, False: 727]
  ------------------
 1061|    375|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    375|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  1.10k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 535, False: 567]
  |  Branch (1064:31): [True: 326, False: 241]
  ------------------
 1065|    857|#ifndef SUPPRESS_WARNINGS
 1066|    857|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    857|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 857]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    857|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    857|#endif
 1069|    857|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    857|      } else
 1071|    245|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  98.3k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 2.90k, False: 95.4k]
  ------------------
 1073|  2.90k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  2.90k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  2.90k|      io_->readOrThrow(buf.data(), 2);
 1076|  2.90k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 1.35k, False: 1.55k]
  ------------------
 1077|  1.35k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.35k|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  2.90k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 2.30k, False: 593]
  |  Branch (1080:31): [True: 342, False: 251]
  ------------------
 1081|  2.64k|#ifndef SUPPRESS_WARNINGS
 1082|  2.64k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.64k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.64k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.64k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  2.64k|#endif
 1085|  2.64k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  2.64k|      } else
 1087|    254|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  95.4k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 513, False: 94.9k]
  ------------------
 1089|    513|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|    513|      std::memset(buf.data(), 0x0, buf.size());
 1091|    513|      io_->readOrThrow(buf.data(), 4);
 1092|    513|      io_->readOrThrow(buf2.data(), 4);
 1093|    513|      if (td)
  ------------------
  |  Branch (1093:11): [True: 272, False: 241]
  ------------------
 1094|    272|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    272|#define _(String) (String)
  ------------------
 1095|    272|            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|    513|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 330, False: 183]
  |  Branch (1098:31): [True: 79, False: 104]
  ------------------
 1099|    408|#ifndef SUPPRESS_WARNINGS
 1100|    408|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    408|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 408]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    408|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    408|#endif
 1103|    408|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    408|      } else
 1105|    105|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  94.9k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.49k, False: 93.4k]
  ------------------
 1107|  1.49k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.49k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.49k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.49k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.49k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 801, False: 694]
  ------------------
 1112|    801|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    801|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    801|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.49k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 757, False: 738]
  |  Branch (1115:31): [True: 117, False: 621]
  ------------------
 1116|    871|#ifndef SUPPRESS_WARNINGS
 1117|    871|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    871|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 871]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    871|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    871|#endif
 1120|    871|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    871|      } else
 1122|    624|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.49k|    }
 1124|   105k|  }
 1125|       |
 1126|  1.54k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.54k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  2.10k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  2.10k|  size_t current_position = io_->tell();
 1131|  2.10k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  2.10k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 2.10k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  2.10k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  72.7k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 72.7k, False: 0]
  |  Branch (1136:25): [True: 72.2k, False: 431]
  ------------------
 1137|  72.2k|    io_->readOrThrow(buf.data(), 4);
 1138|  72.2k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 1.67k, False: 70.6k]
  ------------------
 1139|  1.67k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 75, False: 1.59k]
  ------------------
 1140|     75|        break;
 1141|  1.59k|      io_->readOrThrow(buf.data(), 4);
 1142|  1.59k|      io_->readOrThrow(buf.data(), 4);
 1143|  1.59k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  1.59k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 41, False: 1.55k]
  ------------------
 1146|     41|        currentStream_ = Video;
 1147|  1.55k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 805, False: 752]
  ------------------
 1148|    805|        currentStream_ = Audio;
 1149|    752|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 51, False: 701]
  ------------------
 1150|     51|        currentStream_ = Hint;
 1151|    701|      else
 1152|    701|        currentStream_ = GenMediaHeader;
 1153|  1.59k|      break;
 1154|  1.67k|    }
 1155|  72.2k|  }
 1156|       |
 1157|  2.10k|  io_->seek(current_position, BasicIo::beg);
 1158|  2.10k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|  1.21k|void QuickTimeVideo::timeToSampleDecoder() {
 1161|  1.21k|  DataBuf buf(4 + 1);
 1162|  1.21k|  io_->readOrThrow(buf.data(), 4);
 1163|  1.21k|  io_->readOrThrow(buf.data(), 4);
 1164|  1.21k|  uint64_t totalframes = 0;
 1165|  1.21k|  uint64_t timeOfFrames = 0;
 1166|  1.21k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  3.06k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 1.84k, False: 1.21k]
  ------------------
 1169|  1.84k|    io_->readOrThrow(buf.data(), 4);
 1170|  1.84k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  1.84k|    totalframes = Safe::add(totalframes, temp);
 1172|  1.84k|    io_->readOrThrow(buf.data(), 4);
 1173|  1.84k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  1.84k|  }
 1175|  1.21k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 223, False: 996]
  ------------------
 1176|    223|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 95, False: 128]
  ------------------
 1177|     95|      timeOfFrames = 1;
 1178|    223|    xmpData_["Xmp.video.FrameRate"] =
 1179|    223|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    223|  }
 1181|  1.21k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.49k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.49k|  DataBuf buf(100);
 1185|  1.49k|  size_t cur_pos = io_->tell();
 1186|  1.49k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.49k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.49k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|   104k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 103k, False: 953]
  ------------------
 1191|   103k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 67.6k, False: 36.3k]
  ------------------
 1192|  67.6k|      imageDescDecoder();
 1193|  36.3k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 35.7k, False: 538]
  ------------------
 1194|  35.7k|      audioDescDecoder();
 1195|    538|    else
 1196|    538|      break;
 1197|   103k|  }
 1198|  1.49k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.49k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  35.7k|void QuickTimeVideo::audioDescDecoder() {
 1202|  35.7k|  DataBuf buf(40);
 1203|  35.7k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  35.7k|  buf.data()[4] = '\0';
 1205|  35.7k|  io_->readOrThrow(buf.data(), 4);
 1206|  35.7k|  size_t size = 82;
 1207|       |
 1208|  35.7k|  const TagVocabulary* td;
 1209|       |
 1210|   750k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 714k, False: 35.7k]
  ------------------
 1211|   714k|    io_->readOrThrow(buf.data(), 4);
 1212|   714k|    switch (i) {
 1213|  35.7k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 35.7k, False: 679k]
  ------------------
 1214|  35.7k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  35.7k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 397, False: 35.3k]
  ------------------
 1216|    397|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    397|#define _(String) (String)
  ------------------
 1217|  35.3k|        else
 1218|  35.3k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  35.7k|        break;
 1220|  35.7k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 35.7k, False: 679k]
  ------------------
 1221|  35.7k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  35.7k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 581, False: 35.1k]
  ------------------
 1223|    581|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    581|#define _(String) (String)
  ------------------
 1224|  35.7k|        break;
 1225|  35.7k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 35.7k, False: 679k]
  ------------------
 1226|  35.7k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  35.7k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  35.7k|        break;
 1229|  35.7k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 35.7k, False: 679k]
  ------------------
 1230|  35.7k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  35.7k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  35.7k|        break;
 1233|   571k|      default:
  ------------------
  |  Branch (1233:7): [True: 571k, False: 143k]
  ------------------
 1234|   571k|        break;
 1235|   714k|    }
 1236|   714k|  }
 1237|  35.7k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  35.7k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  67.6k|void QuickTimeVideo::imageDescDecoder() {
 1241|  67.6k|  DataBuf buf(40);
 1242|  67.6k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  67.6k|  buf.data()[4] = '\0';
 1244|  67.6k|  io_->readOrThrow(buf.data(), 4);
 1245|  67.6k|  size_t size = 82;
 1246|       |
 1247|  67.6k|  const TagVocabulary* td;
 1248|       |
 1249|   811k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 743k, False: 67.5k]
  ------------------
 1250|   743k|    io_->readOrThrow(buf.data(), 4);
 1251|       |
 1252|   743k|    switch (i) {
 1253|  67.6k|      case codec:
  ------------------
  |  Branch (1253:7): [True: 67.6k, False: 676k]
  ------------------
 1254|  67.6k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1255|  67.6k|        if (td)
  ------------------
  |  Branch (1255:13): [True: 489, False: 67.1k]
  ------------------
 1256|    489|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    489|#define _(String) (String)
  ------------------
 1257|  67.1k|        else
 1258|  67.1k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1259|  67.6k|        break;
 1260|  67.6k|      case VendorID:
  ------------------
  |  Branch (1260:7): [True: 67.6k, False: 676k]
  ------------------
 1261|  67.6k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1262|  67.6k|        if (td)
  ------------------
  |  Branch (1262:13): [True: 1.34k, False: 66.2k]
  ------------------
 1263|  1.34k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.34k|#define _(String) (String)
  ------------------
 1264|  67.6k|        break;
 1265|  67.6k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1265:7): [True: 67.6k, False: 676k]
  ------------------
 1266|  67.6k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1267|  67.6k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1268|  67.6k|        break;
 1269|  67.6k|      case XResolution:
  ------------------
  |  Branch (1269:7): [True: 67.6k, False: 676k]
  ------------------
 1270|  67.6k|        xmpData_["Xmp.video.XResolution"] =
 1271|  67.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1272|  67.6k|        break;
 1273|  67.6k|      case YResolution:
  ------------------
  |  Branch (1273:7): [True: 67.6k, False: 676k]
  ------------------
 1274|  67.6k|        xmpData_["Xmp.video.YResolution"] =
 1275|  67.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1276|  67.6k|        io_->readOrThrow(buf.data(), 3);
 1277|  67.6k|        size -= 3;
 1278|  67.6k|        break;
 1279|  67.5k|      case CompressorName:
  ------------------
  |  Branch (1279:7): [True: 67.5k, False: 676k]
  ------------------
 1280|  67.5k|        io_->readOrThrow(buf.data(), 32);
 1281|  67.5k|        size -= 32;
 1282|  67.5k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1283|  67.5k|        break;
 1284|   338k|      default:
  ------------------
  |  Branch (1284:7): [True: 338k, False: 405k]
  ------------------
 1285|   338k|        break;
 1286|   743k|    }
 1287|   743k|  }
 1288|  67.5k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1289|  67.5k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1290|  67.5k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1292|  2.73k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1293|  2.73k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1294|  2.73k|  DataBuf buf(4 + 1);
 1295|  2.73k|  io_->readOrThrow(buf.data(), 4);
 1296|  2.73k|  io_->readOrThrow(buf.data(), 4);
 1297|  2.73k|  uint32_t noOfEntries;
 1298|       |
 1299|  2.73k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1300|       |
 1301|  6.00k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1301:24): [True: 3.37k, False: 2.62k]
  |  Branch (1301:43): [True: 3.27k, False: 102]
  ------------------
 1302|  3.27k|    decodeBlock(recursion_depth + 1);
 1303|  3.27k|  }
 1304|  2.73k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1306|  3.75k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1307|  3.75k|  DataBuf buf(3);
 1308|  3.75k|  std::memset(buf.data(), 0x0, buf.size());
 1309|  3.75k|  buf.data()[2] = '\0';
 1310|  3.75k|  currentStream_ = Video;
 1311|       |
 1312|  3.75k|  const TagDetails* td;
 1313|       |
 1314|  22.7k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1314:19): [True: 19.0k, False: 3.75k]
  ------------------
 1315|  19.0k|    io_->readOrThrow(buf.data(), 2);
 1316|       |
 1317|  19.0k|    switch (i) {
 1318|  3.30k|      case GraphicsMode:
  ------------------
  |  Branch (1318:7): [True: 3.30k, False: 15.7k]
  ------------------
 1319|  3.30k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1320|  3.30k|        if (td)
  ------------------
  |  Branch (1320:13): [True: 2.76k, False: 535]
  ------------------
 1321|  2.76k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.76k|#define _(String) (String)
  ------------------
 1322|  3.30k|        break;
 1323|  3.29k|      case OpColor:
  ------------------
  |  Branch (1323:7): [True: 3.29k, False: 15.7k]
  ------------------
 1324|  3.29k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1325|  3.29k|        break;
 1326|  12.4k|      default:
  ------------------
  |  Branch (1326:7): [True: 12.4k, False: 6.60k]
  ------------------
 1327|  12.4k|        break;
 1328|  19.0k|    }
 1329|  19.0k|  }
 1330|  3.75k|  io_->readOrThrow(buf.data(), size % 2);
 1331|  3.75k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1333|  6.48k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1334|  6.48k|  size_t cur_pos = io_->tell();
 1335|  6.48k|  DataBuf buf(100);
 1336|  6.48k|  std::memset(buf.data(), 0x0, buf.size());
 1337|  6.48k|  buf.data()[4] = '\0';
 1338|       |
 1339|  6.48k|  const TagVocabulary* tv;
 1340|       |
 1341|  38.9k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1341:19): [True: 32.4k, False: 6.48k]
  ------------------
 1342|  32.4k|    io_->readOrThrow(buf.data(), 4);
 1343|       |
 1344|  32.4k|    switch (i) {
  ------------------
  |  Branch (1344:13): [True: 19.4k, False: 12.9k]
  ------------------
 1345|  6.48k|      case HandlerClass:
  ------------------
  |  Branch (1345:7): [True: 6.48k, False: 25.9k]
  ------------------
 1346|  6.48k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1347|  6.48k|        if (tv) {
  ------------------
  |  Branch (1347:13): [True: 2.71k, False: 3.77k]
  ------------------
 1348|  2.71k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1348:15): [True: 1.14k, False: 1.57k]
  ------------------
 1349|  1.14k|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|  1.14k|#define _(String) (String)
  ------------------
 1350|  1.57k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1350:20): [True: 631, False: 943]
  ------------------
 1351|    631|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    631|#define _(String) (String)
  ------------------
 1352|  2.71k|        }
 1353|  6.48k|        break;
 1354|  6.48k|      case HandlerType:
  ------------------
  |  Branch (1354:7): [True: 6.48k, False: 25.9k]
  ------------------
 1355|  6.48k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1356|  6.48k|        if (tv) {
  ------------------
  |  Branch (1356:13): [True: 4.65k, False: 1.83k]
  ------------------
 1357|  4.65k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1357:15): [True: 1.56k, False: 3.08k]
  ------------------
 1358|  1.56k|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.56k|#define _(String) (String)
  ------------------
 1359|  3.08k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1359:20): [True: 1.15k, False: 1.92k]
  ------------------
 1360|  1.15k|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.15k|#define _(String) (String)
  ------------------
 1361|  4.65k|        }
 1362|  6.48k|        break;
 1363|  6.48k|      case HandlerVendorID:
  ------------------
  |  Branch (1363:7): [True: 6.48k, False: 25.9k]
  ------------------
 1364|  6.48k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1365|  6.48k|        if (tv) {
  ------------------
  |  Branch (1365:13): [True: 2.04k, False: 4.44k]
  ------------------
 1366|  2.04k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1366:15): [True: 217, False: 1.82k]
  ------------------
 1367|    217|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    217|#define _(String) (String)
  ------------------
 1368|  1.82k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1368:20): [True: 513, False: 1.31k]
  ------------------
 1369|    513|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    513|#define _(String) (String)
  ------------------
 1370|  2.04k|        }
 1371|  6.48k|        break;
 1372|  32.4k|    }
 1373|  32.4k|  }
 1374|  6.48k|  io_->seek(cur_pos + size, BasicIo::beg);
 1375|  6.48k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1377|  4.60k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1378|  4.60k|  DataBuf buf(5);
 1379|  4.60k|  std::memset(buf.data(), 0x0, buf.size());
 1380|  4.60k|  buf.data()[4] = '\0';
 1381|  4.60k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1382|  4.60k|  const TagVocabulary* td;
 1383|       |
 1384|   387k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1384:19): [True: 382k, False: 4.60k]
  ------------------
 1385|   382k|    io_->readOrThrow(buf.data(), 4);
 1386|   382k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1387|       |
 1388|   382k|    switch (i) {
 1389|  4.57k|      case 0:
  ------------------
  |  Branch (1389:7): [True: 4.57k, False: 378k]
  ------------------
 1390|  4.57k|        if (td)
  ------------------
  |  Branch (1390:13): [True: 2.16k, False: 2.41k]
  ------------------
 1391|  2.16k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  2.16k|#define _(String) (String)
  ------------------
 1392|  4.57k|        break;
 1393|  1.49k|      case 1:
  ------------------
  |  Branch (1393:7): [True: 1.49k, False: 381k]
  ------------------
 1394|  1.49k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1395|  1.49k|        break;
 1396|   376k|      default:
  ------------------
  |  Branch (1396:7): [True: 376k, False: 6.07k]
  ------------------
 1397|   376k|        if (td)
  ------------------
  |  Branch (1397:13): [True: 1.43k, False: 375k]
  ------------------
 1398|  1.43k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.43k|#define _(String) (String)
  ------------------
 1399|   375k|        else
 1400|   375k|          v->read(Exiv2::toString(buf.data()));
 1401|   376k|        break;
 1402|   382k|    }
 1403|   382k|  }
 1404|  4.60k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1405|  4.60k|  io_->readOrThrow(buf.data(), size % 4);
 1406|  4.60k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1408|  2.75k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1409|  2.75k|  DataBuf buf(5);
 1410|  2.75k|  std::memset(buf.data(), 0x0, buf.size());
 1411|  2.75k|  buf.data()[4] = '\0';
 1412|  2.75k|  int64_t time_scale = 1;
 1413|       |
 1414|  17.5k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1414:19): [True: 14.8k, False: 2.75k]
  ------------------
 1415|  14.8k|    io_->readOrThrow(buf.data(), 4);
 1416|       |
 1417|  14.8k|    switch (i) {
 1418|  2.44k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1418:7): [True: 2.44k, False: 12.3k]
  ------------------
 1419|  2.44k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1419:13): [True: 1.44k, False: 994]
  ------------------
 1420|  1.44k|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1421|    994|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1421:18): [True: 259, False: 735]
  ------------------
 1422|    259|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1423|  2.44k|        break;
 1424|  2.43k|      case MediaCreateDate:
  ------------------
  |  Branch (1424:7): [True: 2.43k, False: 12.3k]
  ------------------
 1425|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1426|  2.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1426:13): [True: 1.44k, False: 993]
  ------------------
 1427|  1.44k|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1428|    993|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1428:18): [True: 259, False: 734]
  ------------------
 1429|    259|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1430|  2.43k|        break;
 1431|  2.43k|      case MediaModifyDate:
  ------------------
  |  Branch (1431:7): [True: 2.43k, False: 12.4k]
  ------------------
 1432|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1433|  2.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1433:13): [True: 1.44k, False: 993]
  ------------------
 1434|  1.44k|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1435|    993|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1435:18): [True: 259, False: 734]
  ------------------
 1436|    259|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1437|  2.43k|        break;
 1438|  2.43k|      case MediaTimeScale:
  ------------------
  |  Branch (1438:7): [True: 2.43k, False: 12.4k]
  ------------------
 1439|  2.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1439:13): [True: 1.44k, False: 993]
  ------------------
 1440|  1.44k|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1441|    993|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1441:18): [True: 259, False: 734]
  ------------------
 1442|    259|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1443|  2.43k|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1444|  2.43k|        mdhdTimeScale_ = time_scale;
 1445|  2.43k|        break;
 1446|  2.43k|      case MediaDuration:
  ------------------
  |  Branch (1446:7): [True: 2.43k, False: 12.4k]
  ------------------
 1447|  2.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1447:13): [True: 1.44k, False: 992]
  ------------------
 1448|  1.44k|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1448:49): [True: 1.44k, False: 0]
  ------------------
 1449|    992|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1449:18): [True: 259, False: 733]
  ------------------
 1450|    259|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1450:49): [True: 259, False: 0]
  ------------------
 1451|  2.43k|        break;
 1452|  2.43k|      case MediaLanguageCode:
  ------------------
  |  Branch (1452:7): [True: 2.43k, False: 12.4k]
  ------------------
 1453|  2.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1453:13): [True: 1.44k, False: 992]
  ------------------
 1454|  1.44k|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1455|    992|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1455:18): [True: 259, False: 733]
  ------------------
 1456|    259|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1457|  2.43k|        break;
 1458|       |
 1459|    227|      default:
  ------------------
  |  Branch (1459:7): [True: 227, False: 14.6k]
  ------------------
 1460|    227|        break;
 1461|  14.8k|    }
 1462|  14.8k|  }
 1463|  2.75k|  io_->readOrThrow(buf.data(), size % 4);
 1464|  2.75k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1466|  1.38k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1467|  1.38k|  DataBuf buf(5);
 1468|  1.38k|  std::memset(buf.data(), 0x0, buf.size());
 1469|  1.38k|  buf.data()[4] = '\0';
 1470|  1.38k|  int64_t temp = 0;
 1471|       |
 1472|  25.5k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1472:19): [True: 24.1k, False: 1.38k]
  ------------------
 1473|  24.1k|    io_->readOrThrow(buf.data(), 4);
 1474|       |
 1475|  24.1k|    switch (i) {
 1476|  1.18k|      case TrackHeaderVersion:
  ------------------
  |  Branch (1476:7): [True: 1.18k, False: 22.9k]
  ------------------
 1477|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1477:13): [True: 140, False: 1.04k]
  ------------------
 1478|    140|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1479|  1.04k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1479:18): [True: 429, False: 611]
  ------------------
 1480|    429|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1481|  1.18k|        break;
 1482|  1.17k|      case TrackCreateDate:
  ------------------
  |  Branch (1482:7): [True: 1.17k, False: 22.9k]
  ------------------
 1483|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1484|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1484:13): [True: 140, False: 1.03k]
  ------------------
 1485|    140|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1486|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1486:18): [True: 429, False: 609]
  ------------------
 1487|    429|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1488|  1.17k|        break;
 1489|  1.17k|      case TrackModifyDate:
  ------------------
  |  Branch (1489:7): [True: 1.17k, False: 22.9k]
  ------------------
 1490|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1491|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1491:13): [True: 140, False: 1.03k]
  ------------------
 1492|    140|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1493|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1493:18): [True: 429, False: 608]
  ------------------
 1494|    429|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1495|  1.17k|        break;
 1496|  1.17k|      case TrackID:
  ------------------
  |  Branch (1496:7): [True: 1.17k, False: 22.9k]
  ------------------
 1497|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1497:13): [True: 140, False: 1.03k]
  ------------------
 1498|    140|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1499|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1499:18): [True: 429, False: 607]
  ------------------
 1500|    429|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1501|  1.17k|        break;
 1502|  1.17k|      case TrackDuration:
  ------------------
  |  Branch (1502:7): [True: 1.17k, False: 22.9k]
  ------------------
 1503|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1503:13): [True: 138, False: 1.03k]
  ------------------
 1504|    138|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1504:49): [True: 138, False: 0]
  ------------------
 1505|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1505:18): [True: 429, False: 605]
  ------------------
 1506|    429|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1506:49): [True: 429, False: 0]
  ------------------
 1507|  1.17k|        break;
 1508|  1.11k|      case TrackLayer:
  ------------------
  |  Branch (1508:7): [True: 1.11k, False: 23.0k]
  ------------------
 1509|  1.11k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1509:13): [True: 95, False: 1.02k]
  ------------------
 1510|     95|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1511|  1.02k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1511:18): [True: 428, False: 596]
  ------------------
 1512|    428|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1513|  1.11k|        break;
 1514|  1.11k|      case TrackVolume:
  ------------------
  |  Branch (1514:7): [True: 1.11k, False: 23.0k]
  ------------------
 1515|  1.11k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1515:13): [True: 94, False: 1.02k]
  ------------------
 1516|     94|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1517|  1.02k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1517:18): [True: 428, False: 596]
  ------------------
 1518|    428|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1519|  1.11k|        break;
 1520|  1.08k|      case ImageWidth:
  ------------------
  |  Branch (1520:7): [True: 1.08k, False: 23.0k]
  ------------------
 1521|  1.08k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1521:13): [True: 84, False: 1.00k]
  ------------------
 1522|     84|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1523|     84|          xmpData_["Xmp.video.Width"] = temp;
 1524|     84|          width_ = temp;
 1525|     84|        }
 1526|  1.08k|        break;
 1527|  1.08k|      case ImageHeight:
  ------------------
  |  Branch (1527:7): [True: 1.08k, False: 23.0k]
  ------------------
 1528|  1.08k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1528:13): [True: 84, False: 1.00k]
  ------------------
 1529|     84|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1530|     84|          xmpData_["Xmp.video.Height"] = temp;
 1531|     84|          height_ = temp;
 1532|     84|        }
 1533|  1.08k|        break;
 1534|  13.8k|      default:
  ------------------
  |  Branch (1534:7): [True: 13.8k, False: 10.2k]
  ------------------
 1535|  13.8k|        break;
 1536|  24.1k|    }
 1537|  24.1k|  }
 1538|  1.38k|  io_->readOrThrow(buf.data(), size % 4);
 1539|  1.38k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1541|    216|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1542|    216|  DataBuf buf(5);
 1543|    216|  std::memset(buf.data(), 0x0, buf.size());
 1544|    216|  buf.data()[4] = '\0';
 1545|       |
 1546|  2.84k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1546:19): [True: 2.62k, False: 216]
  ------------------
 1547|  2.62k|    io_->readOrThrow(buf.data(), 4);
 1548|       |
 1549|  2.62k|    switch (i) {
 1550|    142|      case MovieHeaderVersion:
  ------------------
  |  Branch (1550:7): [True: 142, False: 2.48k]
  ------------------
 1551|    142|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1552|    142|        break;
 1553|    140|      case CreateDate:
  ------------------
  |  Branch (1553:7): [True: 140, False: 2.48k]
  ------------------
 1554|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1555|    140|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1556|    140|        break;
 1557|    127|      case ModifyDate:
  ------------------
  |  Branch (1557:7): [True: 127, False: 2.50k]
  ------------------
 1558|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1559|    127|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1560|    127|        break;
 1561|    126|      case TimeScale:
  ------------------
  |  Branch (1561:7): [True: 126, False: 2.50k]
  ------------------
 1562|    126|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1563|    126|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1564|    126|        break;
 1565|    111|      case Duration:
  ------------------
  |  Branch (1565:7): [True: 111, False: 2.51k]
  ------------------
 1566|    111|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1566:13): [True: 111, False: 0]
  ------------------
 1567|    111|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1568|    111|        }
 1569|    111|        break;
 1570|    111|      case PreferredRate:
  ------------------
  |  Branch (1570:7): [True: 111, False: 2.51k]
  ------------------
 1571|    111|        xmpData_["Xmp.video.PreferredRate"] =
 1572|    111|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1573|    111|        break;
 1574|    111|      case PreferredVolume:
  ------------------
  |  Branch (1574:7): [True: 111, False: 2.51k]
  ------------------
 1575|    111|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1576|    111|        break;
 1577|     86|      case PreviewTime:
  ------------------
  |  Branch (1577:7): [True: 86, False: 2.54k]
  ------------------
 1578|     86|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1579|     86|        break;
 1580|     86|      case PreviewDuration:
  ------------------
  |  Branch (1580:7): [True: 86, False: 2.54k]
  ------------------
 1581|     86|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1582|     86|        break;
 1583|     86|      case PosterTime:
  ------------------
  |  Branch (1583:7): [True: 86, False: 2.54k]
  ------------------
 1584|     86|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1585|     86|        break;
 1586|     86|      case SelectionTime:
  ------------------
  |  Branch (1586:7): [True: 86, False: 2.54k]
  ------------------
 1587|     86|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1588|     86|        break;
 1589|     86|      case SelectionDuration:
  ------------------
  |  Branch (1589:7): [True: 86, False: 2.54k]
  ------------------
 1590|     86|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1591|     86|        break;
 1592|     86|      case CurrentTime:
  ------------------
  |  Branch (1592:7): [True: 86, False: 2.54k]
  ------------------
 1593|     86|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1594|     86|        break;
 1595|     86|      case NextTrackID:
  ------------------
  |  Branch (1595:7): [True: 86, False: 2.54k]
  ------------------
 1596|     86|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1597|     86|        break;
 1598|  1.15k|      default:
  ------------------
  |  Branch (1598:7): [True: 1.15k, False: 1.47k]
  ------------------
 1599|  1.15k|        break;
 1600|  2.62k|    }
 1601|  2.62k|  }
 1602|    216|  io_->readOrThrow(buf.data(), size % 4);
 1603|    216|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1605|  3.52k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool /*create*/) {
 1606|  3.52k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io));
 1607|  3.52k|  if (!image->good()) {
  ------------------
  |  Branch (1607:7): [True: 13, False: 3.51k]
  ------------------
 1608|     13|    return nullptr;
 1609|     13|  }
 1610|  3.51k|  return image;
 1611|  3.52k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1613|  19.4k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1614|  19.4k|  auto buf = DataBuf(12);
 1615|  19.4k|  iIo.read(buf.data(), 12);
 1616|       |
 1617|  19.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 19.4k]
  |  Branch (1617:22): [True: 357, False: 19.0k]
  ------------------
 1618|    357|    return false;
 1619|    357|  }
 1620|  19.0k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1621|       |
 1622|  19.0k|  bool matched = false;
 1623|       |
 1624|   133k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1624:24): [True: 133k, False: 5.56k]
  ------------------
 1625|   133k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1626|   133k|    if (tmp == 0) {
  ------------------
  |  Branch (1626:9): [True: 13.4k, False: 119k]
  ------------------
 1627|       |      // we only match if we actually know the video type. This is done
 1628|       |      // to avoid matching just on ftyp because bmffimage also has that
 1629|       |      // header.
 1630|  13.4k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1630:11): [True: 10.5k, False: 2.93k]
  ------------------
 1631|  10.5k|        matched = true;
 1632|  10.5k|      }
 1633|  13.4k|      break;
 1634|  13.4k|    }
 1635|   133k|  }
 1636|       |
 1637|  19.0k|  if (!advance || !matched) {
  ------------------
  |  Branch (1637:7): [True: 19.0k, False: 0]
  |  Branch (1637:19): [True: 0, False: 0]
  ------------------
 1638|  19.0k|    iIo.seek(0L, BasicIo::beg);
 1639|  19.0k|  }
 1640|       |
 1641|  19.0k|  return matched;
 1642|  19.4k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   130k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   130k|  const char ignoreList[13][5] = {
  505|   130k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   130k|  };
  507|       |
  508|   130k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.64M, False: 122k]
  ------------------
  509|  1.64M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 8.47k, False: 1.63M]
  ------------------
  510|  8.47k|      return true;
  511|       |
  512|   122k|  return false;
  513|   130k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  62.7k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  62.7k|  const char ignoreList[8][5] = {
  524|  62.7k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  62.7k|  };
  526|       |
  527|  62.7k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 482k, False: 53.1k]
  ------------------
  528|   482k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 9.62k, False: 472k]
  ------------------
  529|  9.62k|      return true;
  530|       |
  531|  53.1k|  return false;
  532|  62.7k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.79M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.79M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.79M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.79M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  3.25M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  3.56k|static std::string readString(BasicIo& io, size_t size) {
  628|  3.56k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  3.56k|  Exiv2::DataBuf str(size + 1);
  630|  3.56k|  io.readOrThrow(str.data(), size);
  631|  3.56k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  3.56k|  return Exiv2::toString(str.data());
  633|  3.56k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  364|    757|RiffVideo::RiffVideo(BasicIo::UniquePtr io) : Image(ImageType::riff, mdNone, std::move(io)) {
  365|    757|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  367|    757|std::string RiffVideo::mimeType() const {
  368|    757|  return "video/riff";
  369|    757|}
_ZN5Exiv29RiffVideo13writeMetadataEv:
  371|     14|void RiffVideo::writeMetadata() {
  372|     14|}  // RiffVideo::writeMetadata
_ZN5Exiv29RiffVideo12readMetadataEv:
  374|    757|void RiffVideo::readMetadata() {
  375|    757|  if (io_->open() != 0)
  ------------------
  |  Branch (375:7): [True: 0, False: 757]
  ------------------
  376|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  377|       |
  378|       |  // Ensure that this is the correct image type
  379|    757|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (379:7): [True: 0, False: 757]
  ------------------
  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|    757|  IoCloser closer(*io_);
  386|    757|  clearMetadata();
  387|       |
  388|    757|  xmpData_["Xmp.video.FileSize"] = io_->size();
  389|    757|  xmpData_["Xmp.video.MimeType"] = mimeType();
  390|       |
  391|    757|  HeaderReader header(io_);
  392|    757|  xmpData_["Xmp.video.Container"] = header.getId();
  393|       |
  394|    757|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  395|       |
  396|    757|  decodeBlocks();
  397|    757|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  399|  12.9k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  400|  12.9k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  401|  12.9k|  id_ = readStringTag(io);
  402|  12.9k|  size_ = readDWORDTag(io);
  403|  12.9k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  405|  81.3k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  406|  81.3k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (406:7): [True: 35.7k, False: 45.5k]
  ------------------
  407|  35.7k|    return false;
  408|       |
  409|  45.5k|  return Internal::upper(str1) == str2;
  410|  81.3k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  412|  1.05k|void RiffVideo::readList(const HeaderReader& header_) {
  413|  1.05k|  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.05k|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (420:7): [True: 315, False: 742]
  ------------------
  421|    315|    readInfoListChunk(header_.getSize());
  422|    742|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (422:12): [True: 282, False: 460]
  ------------------
  423|    282|    readMoviList(header_.getSize());
  424|    282|  }
  425|  1.05k|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  427|  11.0k|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|  11.0k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (434:7): [True: 2.12k, False: 8.89k]
  ------------------
  435|  2.12k|    readAviHeader();
  436|  8.89k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (436:12): [True: 778, False: 8.11k]
  ------------------
  437|    778|    readStreamHeader();
  438|  8.11k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (438:12): [True: 1.52k, False: 6.59k]
  ------------------
  439|  1.52k|    readStreamFormat(header_.getSize());
  440|  6.59k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (440:12): [True: 726, False: 5.87k]
  ------------------
  441|    726|    streamType_ = Audio;
  442|    726|    readStreamFormat(header_.getSize());
  443|  5.87k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (443:14): [True: 34, False: 5.83k]
  ------------------
  444|     34|    readStreamData(header_.getSize());
  445|  5.83k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (445:12): [True: 52, False: 5.78k]
  ------------------
  446|     52|    StreamName(header_.getSize());
  447|  5.78k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (447:12): [True: 613, False: 5.17k]
  ------------------
  448|    613|    readVPRPChunk(header_.getSize());
  449|  5.17k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (449:12): [True: 205, False: 4.96k]
  ------------------
  450|    205|    readIndexChunk(header_.getSize());
  451|  4.96k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (451:12): [True: 527, False: 4.43k]
  ------------------
  452|    527|    readDataChunk(header_.getSize());
  453|  4.43k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (453:12): [True: 414, False: 4.02k]
  ------------------
  454|    414|    readJunk(header_.getSize());
  455|  4.02k|  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|  4.02k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  462|  4.02k|  }
  463|  11.0k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  465|    757|void RiffVideo::decodeBlocks() {
  466|  12.2k|  do {
  467|  12.2k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (467:35): [True: 1.05k, False: 11.1k]
  ------------------
  468|  1.05k|      readList(header);
  469|  11.1k|    } else {
  470|  11.1k|      readChunk(header);
  471|  11.1k|    }
  472|  12.2k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (472:12): [True: 11.4k, False: 732]
  |  Branch (472:27): [True: 11.4k, False: 25]
  ------------------
  473|    757|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  475|  2.12k|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|  2.12k|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  496|  2.12k|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  497|  2.12k|  double frame_rate = 1000000. / TimeBetweenFrames;
  498|       |
  499|  2.12k|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  500|       |
  501|  2.12k|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  502|  2.12k|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  503|       |
  504|  2.12k|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  505|  2.12k|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  506|       |
  507|  2.12k|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  508|  2.12k|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  509|       |
  510|  2.12k|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  511|       |
  512|  2.12k|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  513|       |
  514|  2.12k|  uint32_t width = readDWORDTag(io_);
  515|  2.12k|  xmpData_["Xmp.video.Width"] = width;
  516|       |
  517|  2.12k|  uint32_t height = readDWORDTag(io_);
  518|  2.12k|  xmpData_["Xmp.video.Height"] = height;
  519|       |
  520|  2.12k|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  521|  2.12k|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  522|       |
  523|  2.12k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  524|       |
  525|  2.12k|  fillDuration(frame_rate, frame_count);
  526|  2.12k|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  528|    778|void RiffVideo::readStreamHeader() {
  529|    778|  std::string stream = readStringTag(io_);
  530|    778|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (530:17): [True: 192, False: 586]
  ------------------
  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|    778|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  555|       |
  556|    778|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  557|    778|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  558|       |
  559|    778|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  560|       |
  561|    778|  if (divisor) {
  ------------------
  |  Branch (561:7): [True: 621, False: 157]
  ------------------
  562|    621|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  563|    621|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (563:14): [True: 141, False: 480]
  ------------------
  564|    621|  }
  565|    778|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  566|       |
  567|    778|  if (divisor) {
  ------------------
  |  Branch (567:7): [True: 600, False: 178]
  ------------------
  568|    600|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  569|    600|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (569:14): [True: 141, False: 459]
  ------------------
  570|    600|  }
  571|       |
  572|    778|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  573|       |
  574|    778|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (574:12): [True: 191, False: 587]
  ------------------
  575|       |
  576|    778|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (576:12): [True: 190, False: 588]
  ------------------
  577|    778|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  578|    778|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  580|  2.24k|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.24k|  if (streamType_ == Video) {
  ------------------
  |  Branch (611:7): [True: 320, False: 1.92k]
  ------------------
  612|    320|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  613|    320|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  614|    320|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  615|    320|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  616|    320|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  617|    320|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  618|    320|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  619|    320|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  620|    320|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (620:18): [True: 292, False: 28]
  ------------------
  621|    292|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  622|     28|    else
  623|     28|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  624|    320|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (624:18): [True: 240, False: 80]
  ------------------
  625|    240|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  626|     80|    else
  627|     80|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  628|  1.92k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (628:14): [True: 1.90k, False: 20]
  ------------------
  629|  1.90k|    uint16_t format_tag = readWORDTag(io_);
  630|  1.90k|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (630:67): [True: 1.03k, False: 872]
  ------------------
  631|  1.03k|      xmpData_["Xmp.audio.Compressor"] = it->second;
  632|    872|    else
  633|    872|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  634|       |
  635|  1.90k|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  636|  1.90k|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  637|  1.90k|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  638|  1.90k|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  639|  1.90k|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  640|  1.90k|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (640:9): [True: 181, False: 1.72k]
  ------------------
  641|    181|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  642|  1.90k|  } else {
  643|     20|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  644|     20|  }
  645|  2.24k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  647|     34|void RiffVideo::readStreamData(uint64_t size_) const {
  648|     34|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  649|     34|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  651|     52|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|     52|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  654|     52|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  656|    315|void RiffVideo::readInfoListChunk(uint64_t size_) {
  657|    315|  uint64_t current_size = DWORD;
  658|  3.28k|  while (current_size < size_) {
  ------------------
  |  Branch (658:10): [True: 2.97k, False: 315]
  ------------------
  659|  2.97k|    std::string type = readStringTag(io_);
  660|  2.97k|    size_t size = readDWORDTag(io_);
  661|  2.97k|    std::string content = readStringTag(io_, size);
  662|  2.97k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end())
  ------------------
  |  Branch (662:50): [True: 533, False: 2.43k]
  ------------------
  663|    533|      xmpData_[it->second] = content;
  664|  2.97k|    current_size += DWORD * 2;
  665|  2.97k|    current_size += size;
  666|  2.97k|  }
  667|    315|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  669|    282|void RiffVideo::readMoviList(uint64_t size_) const {
  670|    282|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  671|    282|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  673|    613|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|    613|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  697|    613|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  699|    205|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|    205|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  717|    205|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  719|    527|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|    527|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  731|    527|  if (size_ % 2 != 0)
  ------------------
  |  Branch (731:7): [True: 373, False: 154]
  ------------------
  732|    373|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  733|    527|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  735|    414|void RiffVideo::readJunk(uint64_t size_) const {
  736|    414|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  737|    414|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  739|  4.02k|std::string RiffVideo::getStreamType(uint32_t stream) {
  740|  4.02k|  if (stream == 1)
  ------------------
  |  Branch (740:7): [True: 141, False: 3.88k]
  ------------------
  741|    141|    return "Mono";
  742|  3.88k|  if (stream == 2)
  ------------------
  |  Branch (742:7): [True: 574, False: 3.30k]
  ------------------
  743|    574|    return "Stereo";
  744|  3.30k|  if (stream == 5)
  ------------------
  |  Branch (744:7): [True: 173, False: 3.13k]
  ------------------
  745|    173|    return "5.1 Surround Sound";
  746|  3.13k|  if (stream == 7)
  ------------------
  |  Branch (746:7): [True: 288, False: 2.84k]
  ------------------
  747|    288|    return "7.1 Surround Sound";
  748|  2.84k|  return "Mono";
  749|  3.13k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  751|  2.09k|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  752|  2.09k|  if (frame_rate == 0)
  ------------------
  |  Branch (752:7): [True: 0, False: 2.09k]
  ------------------
  753|      0|    return;
  754|       |
  755|  2.09k|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  756|  2.09k|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  757|  2.09k|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  758|  2.09k|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  760|    757|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, bool /*create*/) {
  761|    757|  auto image = std::make_unique<RiffVideo>(std::move(io));
  762|    757|  if (!image->good()) {
  ------------------
  |  Branch (762:7): [True: 0, False: 757]
  ------------------
  763|      0|    return nullptr;
  764|      0|  }
  765|    757|  return image;
  766|    757|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  768|  9.14k|bool isRiffType(BasicIo& iIo, bool advance) {
  769|  9.14k|  constexpr int len = 4;
  770|  9.14k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  771|  9.14k|  std::array<byte, len> buf;
  772|  9.14k|  iIo.read(buf.data(), len);
  773|  9.14k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (773:7): [True: 0, False: 9.14k]
  |  Branch (773:22): [True: 357, False: 8.78k]
  ------------------
  774|    357|    return false;
  775|    357|  }
  776|  8.78k|  bool matched = buf == RiffVideoId;
  777|  8.78k|  if (!advance || !matched) {
  ------------------
  |  Branch (777:7): [True: 8.78k, False: 0]
  |  Branch (777:19): [True: 0, False: 0]
  ------------------
  778|  8.78k|    iIo.seek(-1 * len, BasicIo::cur);
  779|  8.78k|  }
  780|  8.78k|  return matched;
  781|  9.14k|}

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  25.5k|  static constexpr auto tagList() {
   30|  25.5k|    return tagInfo_;
   31|  25.5k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    716|  static constexpr auto tagListCs() {
   34|    716|    return tagInfoCs_;
   35|    716|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|  1.14k|  static constexpr auto tagListCs2() {
   38|  1.14k|    return tagInfoCs2_;
   39|  1.14k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|   154k|  static constexpr auto tagListFp() {
   42|   154k|    return tagInfoFp_;
   43|   154k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  3.24k|  static constexpr auto tagListSonyMisc1() {
   46|  3.24k|    return tagInfoSonyMisc1_;
   47|  3.24k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|    267|  static constexpr auto tagListSonyMisc2b() {
   50|    267|    return tagInfoSonyMisc2b_;
   51|    267|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  4.20k|  static constexpr auto tagListSonyMisc3c() {
   54|  4.20k|    return tagInfoSonyMisc3c_;
   55|  4.20k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   580k|  static constexpr auto tagListSonySInfo1() {
   58|   580k|    return tagInfoSonySInfo1_;
   59|   580k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.77M|const TagInfo* ifdTagList() {
 1779|  1.77M|  return ifdTagInfo;
 1780|  1.77M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   328k|const TagInfo* exifTagList() {
 2217|   328k|  return exifTagInfo;
 2218|   328k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   159k|const TagInfo* gpsTagList() {
 2433|   159k|  return gpsTagInfo;
 2434|   159k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  66.9k|const TagInfo* iopTagList() {
 2508|  66.9k|  return iopTagInfo;
 2509|  66.9k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  19.5k|const TagInfo* mnTagList() {
 2524|  19.5k|  return mnTagInfo;
 2525|  19.5k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.25M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.25M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.25M, False: 0]
  ------------------
 2529|  1.25M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.25M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  2.94M|bool isExifIfd(IfdId ifdId) {
 2534|  2.94M|  switch (ifdId) {
 2535|   486k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 486k, False: 2.46M]
  ------------------
 2536|   657k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 171k, False: 2.77M]
  ------------------
 2537|   745k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 88.0k, False: 2.86M]
  ------------------
 2538|   808k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 62.3k, False: 2.88M]
  ------------------
 2539|   861k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 52.7k, False: 2.89M]
  ------------------
 2540|   876k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 15.5k, False: 2.93M]
  ------------------
 2541|   877k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 1.22k, False: 2.94M]
  ------------------
 2542|   877k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 2.94M]
  ------------------
 2543|  1.12M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 252k, False: 2.69M]
  ------------------
 2544|  1.28M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 156k, False: 2.79M]
  ------------------
 2545|  1.41M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 128k, False: 2.82M]
  ------------------
 2546|  1.49M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 77.1k, False: 2.87M]
  ------------------
 2547|  1.50M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 17.5k, False: 2.93M]
  ------------------
 2548|  1.52M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 11.5k, False: 2.93M]
  ------------------
 2549|  1.53M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 15.9k, False: 2.93M]
  ------------------
 2550|  1.54M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 4.49k, False: 2.94M]
  ------------------
 2551|  1.54M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 8.65k, False: 2.94M]
  ------------------
 2552|  1.56M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 18.7k, False: 2.93M]
  ------------------
 2553|  1.69M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 126k, False: 2.82M]
  ------------------
 2554|  1.69M|      return true;
 2555|  1.25M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.25M, False: 1.69M]
  ------------------
 2556|  1.25M|      return false;
 2557|  2.94M|  }
 2558|  2.94M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  3.89M|const TagInfo* tagList(IfdId ifdId) {
 2569|  3.89M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 3.89M, False: 0]
  ------------------
 2570|  3.89M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 3.89M, False: 0]
  ------------------
 2571|  3.89M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  3.89M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  2.94M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  2.94M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 2.94M, False: 0]
  ------------------
 2577|  2.94M|    int idx = 0;
 2578|   220M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 219M, False: 1.73M]
  ------------------
 2579|   219M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.21M, False: 217M]
  ------------------
 2580|  1.21M|        break;
 2581|   219M|    }
 2582|  2.94M|    return ti + idx;
 2583|  2.94M|  }
 2584|      0|  return nullptr;
 2585|  2.94M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   949k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   949k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 949k]
  ------------------
 2589|      0|    return nullptr;
 2590|   949k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 949k, False: 0]
  ------------------
 2591|  54.3M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 54.2M, False: 73.5k]
  ------------------
 2592|  54.2M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 876k, False: 53.4M]
  ------------------
 2593|   876k|        return ti + idx;
 2594|   876k|      }
 2595|  54.2M|    }
 2596|   949k|  }
 2597|  73.5k|  return nullptr;
 2598|   949k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  5.91M|IfdId groupId(const std::string& groupName) {
 2601|  5.91M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 5.91M, False: 0]
  ------------------
 2602|  5.91M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  5.91M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  1.97M|const char* groupName(IfdId ifdId) {
 2613|  1.97M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 1.97M, False: 0]
  ------------------
 2614|  1.97M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  1.97M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    221|float fnumber(float apertureValue) {
 2648|    221|  float result = std::exp2(apertureValue / 2.F);
 2649|    221|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 3, False: 218]
  ------------------
 2650|      3|    result = 3.5F;
 2651|      3|  }
 2652|    221|  return result;
 2653|    221|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    221|URational exposureTime(float shutterSpeedValue) {
 2656|    221|  URational ur(1, 1);
 2657|    221|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    221|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 112, False: 109]
  ------------------
 2659|    112|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    112|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 53, False: 59]
  ------------------
 2662|     53|      ur.second = static_cast<uint32_t>(x);
 2663|     53|    }
 2664|    112|  } else {
 2665|    109|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    109|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 109, False: 0]
  |  Branch (2667:19): [True: 109, False: 0]
  ------------------
 2668|    109|      ur.first = static_cast<uint32_t>(x);
 2669|    109|    }
 2670|    109|  }
 2671|    221|  return ur;
 2672|    221|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   949k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   949k|  auto ti = tagInfo(tagName, ifdId);
 2676|   949k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 876k, False: 73.5k]
  |  Branch (2676:13): [True: 876k, False: 0]
  ------------------
 2677|   876k|    return ti->tag_;
 2678|  73.5k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 73.5k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  73.5k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  73.5k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  6.46k|const TagInfo* tagList(const std::string& groupName) {
 3295|  6.46k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  6.46k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 6.46k]
  |  Branch (3296:14): [True: 0, False: 6.46k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  6.46k|  return ii->tagList_();
 3300|  6.46k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  24.2M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  24.2M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 24.2M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 4.84M, False: 19.3M]
  |  Branch (42:86): [True: 22.4k, False: 19.3M]
  ------------------
   43|  4.87M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 16.0k, False: 4.85M]
  ------------------
   44|  24.2M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  22.0k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  22.0k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 6.69k, False: 15.3k]
  |  Branch (48:20): [True: 0, False: 15.3k]
  ------------------
   49|  6.69k|    wroteHeader_ = true;
   50|  22.0k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  4.18M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  4.18M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 15.1k, False: 4.16M]
  |  Branch (53:24): [True: 15.1k, False: 0]
  ------------------
   54|  15.1k|    io_.write(pHeader_, size_);
   55|  15.1k|    wroteHeader_ = true;
   56|  15.1k|  }
   57|  4.18M|  return io_.write(pData, wcount);
   58|  4.18M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  49.1k|int IoWrapper::putb(byte data) {
   61|  49.1k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 49.1k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  49.1k|  return io_.putb(data);
   66|  49.1k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     45|void IoWrapper::setTarget(int id, size_t target) {
   69|     45|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 45]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     45|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 9, False: 36]
  ------------------
   73|      9|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     45|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   136k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   136k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  47.3k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  47.3k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  16.6k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  16.6k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  16.6k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  28.8k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  28.8k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  4.91k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  4.91k|    cfgSelFct_(cfgSelFct),
   99|  4.91k|    arraySet_(arraySet),
  100|  4.91k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  4.91k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  7.23M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  7.23M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  7.27M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  42.6k|    TiffComponent(rhs),
  125|  42.6k|    tiffType_(rhs.tiffType_),
  126|  42.6k|    count_(rhs.count_),
  127|  42.6k|    offset_(rhs.offset_),
  128|  42.6k|    size_(rhs.size_),
  129|  42.6k|    pData_(rhs.pData_),
  130|  42.6k|    idx_(rhs.idx_),
  131|  42.6k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 22.8k, False: 19.7k]
  ------------------
  132|  42.6k|    storage_(rhs.storage_) {
  133|  42.6k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    606|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    606|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  79.5k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  79.5k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  86.6k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  86.6k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  38.3k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  38.3k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  38.3k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  42.6k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  42.6k|  return UniquePtr(doClone());
  159|  42.6k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  34.4k|TiffEntry* TiffEntry::doClone() const {
  162|  34.4k|  return new TiffEntry(*this);
  163|  34.4k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    350|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    350|  return new TiffDataEntry(*this);
  167|    350|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  2.57k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  2.57k|  return new TiffImageEntry(*this);
  171|  2.57k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  4.65k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  4.65k|  return new TiffSizeEntry(*this);
  175|  4.65k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    606|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    606|  return new TiffSubIfd(*this);
  183|    606|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  17.0M|int TiffEntryBase::idx() const {
  206|  17.0M|  return idx_;
  207|  17.0M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|   969k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|   969k|  storage_ = std::move(buf);
  211|   969k|  pData_ = storage_->data();
  212|   969k|  size_ = storage_->size();
  213|   969k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  2.97M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  2.97M|  pData_ = pData;
  217|  2.97M|  size_ = size;
  218|  2.97M|  storage_ = std::move(storage);
  219|  2.97M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 2.97M]
  ------------------
  220|      0|    size_ = 0;
  221|  2.97M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  2.93M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  2.93M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 2.93M]
  ------------------
  225|      0|    return;
  226|  2.93M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 968k, False: 1.96M]
  ------------------
  227|   968k|    auto d = std::make_shared<DataBuf>(newSize);
  228|   968k|    setData(std::move(d));
  229|   968k|  }
  230|  2.93M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 1.00M, False: 1.92M]
  ------------------
  231|  1.00M|    memset(pData_, 0x0, size_);
  232|  1.00M|  }
  233|  2.93M|  size_ = value->copy(pData_, byteOrder);
  234|  2.93M|  setValue(std::move(value));
  235|  2.93M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  5.96M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  5.96M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 5.96M]
  ------------------
  239|      0|    return;
  240|  5.96M|  tiffType_ = toTiffType(value->typeId());
  241|  5.96M|  count_ = value->count();
  242|  5.96M|  pValue_ = std::move(value);
  243|  5.96M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  12.8k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  12.8k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 382, False: 12.4k]
  |  Branch (246:20): [True: 200, False: 12.2k]
  ------------------
  247|    582|#ifndef SUPPRESS_WARNINGS
  248|    582|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    582|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 582]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    582|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|    582|#endif
  251|    582|    return;
  252|    582|  }
  253|  12.2k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 1.81k, False: 10.4k]
  ------------------
  254|  1.81k|#ifndef SUPPRESS_WARNINGS
  255|  1.81k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.81k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.81k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.81k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  1.81k|#endif
  258|  1.81k|    return;
  259|  1.81k|  }
  260|  10.4k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.43k, False: 8.98k]
  ------------------
  261|  1.43k|#ifndef SUPPRESS_WARNINGS
  262|  1.43k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.43k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.43k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.43k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.43k|#endif
  266|  1.43k|    return;
  267|  1.43k|  }
  268|  8.98k|  size_t size = 0;
  269|  24.9k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 15.9k, False: 8.98k]
  ------------------
  270|  15.9k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  15.9k|  }
  272|  8.98k|  const size_t offset = pValue()->toUint32(0);
  273|  8.98k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 322, False: 8.66k]
  |  Branch (273:26): [True: 664, False: 7.99k]
  |  Branch (273:54): [True: 46, False: 7.95k]
  ------------------
  274|  1.03k|#ifndef SUPPRESS_WARNINGS
  275|  1.03k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.03k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.03k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.03k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.03k|#endif
  278|  1.03k|    return;
  279|  1.03k|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  7.95k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 348, False: 7.60k]
  ------------------
  283|    348|#ifndef SUPPRESS_WARNINGS
  284|    348|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    348|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 348]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    348|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    348|#endif
  287|    348|    return;
  288|    348|  }
  289|  7.60k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  7.60k|  sizeDataArea_ = size;
  291|  7.60k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  7.60k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  44.9k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  44.9k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 2.05k, False: 42.8k]
  |  Branch (295:20): [True: 2.39k, False: 40.5k]
  ------------------
  296|  4.44k|#ifndef SUPPRESS_WARNINGS
  297|  4.44k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  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()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  4.44k|#endif
  300|  4.44k|    return;
  301|  4.44k|  }
  302|  40.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 11.1k, False: 29.3k]
  ------------------
  303|  11.1k|#ifndef SUPPRESS_WARNINGS
  304|  11.1k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  11.1k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11.1k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  11.1k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  11.1k|#endif
  308|  11.1k|    return;
  309|  11.1k|  }
  310|   218k|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 188k, False: 29.3k]
  ------------------
  311|   188k|    const size_t offset = pValue()->toUint32(i);
  312|   188k|    const size_t size = pSize->toUint32(i);
  313|       |
  314|   188k|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 28.9k, False: 160k]
  |  Branch (314:28): [True: 66.1k, False: 93.9k]
  |  Branch (314:56): [True: 350, False: 93.5k]
  ------------------
  315|  95.4k|#ifndef SUPPRESS_WARNINGS
  316|  95.4k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  95.4k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 95.4k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  95.4k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  95.4k|#endif
  319|  95.4k|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 62.4k, False: 31.1k]
  ------------------
  320|  62.4k|      const byte* pStrip = pData + baseOffset + offset;
  321|  62.4k|      strips_.emplace_back(pStrip, size);
  322|  62.4k|    }
  323|   188k|  }
  324|  29.3k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  7.30k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  7.30k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 3.30k, False: 4.00k]
  ------------------
  328|  3.30k|    return 0;
  329|  4.00k|  return pHeader_->ifdOffset();
  330|  7.30k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  29.0k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  29.0k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 6.74k, False: 22.2k]
  |  Branch (333:20): [True: 19.2k, False: 3.05k]
  ------------------
  334|  25.9k|    return imageByteOrder_;
  335|  25.9k|  }
  336|  3.05k|  return pHeader_->byteOrder();
  337|  29.0k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  4.34k|size_t TiffIfdMakernote::mnOffset() const {
  340|  4.34k|  return mnOffset_;
  341|  4.34k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  15.5k|size_t TiffIfdMakernote::baseOffset() const {
  344|  15.5k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.79k, False: 11.7k]
  ------------------
  345|  3.79k|    return 0;
  346|  11.7k|  return pHeader_->baseOffset(mnOffset_);
  347|  15.5k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  8.31k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  8.31k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 3.30k, False: 5.00k]
  ------------------
  351|  3.30k|    return true;
  352|  5.00k|  return pHeader_->read(pData, size, byteOrder);
  353|  8.31k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  6.72k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  6.72k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 6.22k, False: 495]
  ------------------
  357|  6.22k|    pHeader_->setByteOrder(byteOrder);
  358|  6.72k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  68.8k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  68.8k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 4.96k, False: 63.8k]
  ------------------
  362|  4.96k|    return 0;
  363|  63.8k|  return pHeader_->size();
  364|  68.8k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  8.28k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  8.28k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 488, False: 7.79k]
  ------------------
  368|    488|    return 0;
  369|  7.79k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  8.28k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  5.30M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  5.30M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  5.30M|  return count_ * TypeInfo::typeSize(typeId);
  375|  5.30M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.53M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.53M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.53M, False: 410]
  ------------------
  379|  1.53M|    return true;  // Not a complex array or already initialized
  380|       |
  381|    988|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 988, False: 0]
  ------------------
  382|    988|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 410, False: 578]
  ------------------
  383|    410|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    410|      arrayDef_ = arraySet_[idx].def_;
  385|    410|      defSize_ = arraySet_[idx].defSize_;
  386|    410|      return true;
  387|    410|    }
  388|    988|  }
  389|      0|  return false;
  390|    410|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  4.22k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  4.22k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.24k, False: 1.97k]
  ------------------
  394|  2.24k|    return true;  // Not a complex array
  395|       |
  396|  1.97k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  1.97k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.28k, False: 695]
  ------------------
  398|  1.28k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.28k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.28k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.28k|  }
  402|  1.97k|  return idx > -1;
  403|  4.22k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  14.8k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  14.8k|  origData_ = const_cast<byte*>(pData());
  407|  14.8k|  origSize_ = TiffEntryBase::doSize();
  408|  14.8k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     70|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     70|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 70]
  ------------------
  412|      0|    return false;
  413|     70|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 36, False: 34]
  ------------------
  414|     36|    return true;
  415|     34|  std::memcpy(origData_, pData, origSize_);
  416|     34|  return true;
  417|     70|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  1.71M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  1.71M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  1.71M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  1.71M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  1.71M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  1.71M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 1.71M]
  ------------------
  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.71M|  tp->setStart(pData() + idx);
  429|  1.71M|  auto s = storage();
  430|  1.71M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  1.71M|  tp->setElDef(def);
  432|  1.71M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  1.71M|  addChild(std::move(tc));
  434|  1.71M|  return sz;
  435|  1.71M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  18.1M|                                      TiffComponent::UniquePtr object) {
  439|  18.1M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  18.1M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  2.92M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  2.92M|  return this;
  445|  2.92M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  7.30M|                                        TiffComponent::UniquePtr object) {
  449|  7.30M|  tiffPath.pop();
  450|  7.30M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  7.30M|  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|  7.30M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 5.87M, False: 1.43M]
  |  Branch (457:31): [True: 1.77k, False: 1.43M]
  |  Branch (457:62): [True: 1.62k, False: 146]
  ------------------
  458|  5.87M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 39.0k, False: 5.83M]
  ------------------
  459|  39.0k|      tc = pNext_.get();
  460|  5.83M|    } else {
  461|  47.1M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 47.1M, False: 22.9k]
  ------------------
  462|  47.1M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 5.94M, False: 41.1M]
  |  Branch (462:46): [True: 5.81M, False: 134k]
  ------------------
  463|  5.81M|          tc = component.get();
  464|  5.81M|          break;
  465|  5.81M|        }
  466|  47.1M|      }
  467|  5.83M|    }
  468|  5.87M|  }
  469|       |
  470|  7.30M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 5.85M, False: 1.45M]
  ------------------
  471|  5.85M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.45M|  auto atc = [&] {
  474|  1.45M|    if (tiffPath.size() == 1 && object) {
  475|  1.45M|      return std::move(object);
  476|  1.45M|    }
  477|  1.45M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.45M|  }();
  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.45M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.43M, False: 23.6k]
  |  Branch (482:31): [True: 18.3k, False: 1.41M]
  ------------------
  483|  18.3k|    return nullptr;
  484|       |
  485|  1.43M|  tc = [&] {
  486|  1.43M|    if (tpi.extendedTag() == Tag::next)
  487|  1.43M|      return this->addNext(std::move(atc));
  488|  1.43M|    return this->addChild(std::move(atc));
  489|  1.43M|  }();
  490|  1.43M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.45M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  2.21M|                                     TiffComponent::UniquePtr object) {
  495|  2.21M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  2.21M|  tiffPath.pop();
  497|  2.21M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.21M]
  ------------------
  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|  2.21M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  2.21M|  tiffPath.push(tpi1);
  504|  2.21M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.40M, False: 12.6k]
  ------------------
  505|  2.40M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 2.19M, False: 207k]
  ------------------
  506|  2.19M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  12.6k|  auto tc = [&] {
  509|  12.6k|    if (tiffPath.size() == 1 && object) {
  510|  12.6k|      return addChild(std::move(object));
  511|  12.6k|    }
  512|  12.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  12.6k|  }();
  514|  12.6k|  setCount(ifds_.size());
  515|  12.6k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  2.21M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  2.10M|                                      TiffComponent::UniquePtr object) {
  520|  2.10M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  2.10M|  tiffPath.pop();
  522|  2.10M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 13.0k, False: 2.08M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  13.0k|    return this;
  525|  13.0k|  }
  526|  2.08M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  2.08M|  tiffPath.push(tpi1);
  528|  2.08M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 8.36k, False: 2.07M]
  ------------------
  529|  8.36k|    mnGroup_ = tpi2.group();
  530|  8.36k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  8.36k|  }
  532|  2.08M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  2.10M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  2.08M|                                           TiffComponent::UniquePtr object) {
  537|  2.08M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  2.08M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.54M|                                          TiffComponent::UniquePtr object) {
  542|  1.54M|  pRoot_ = pRoot;
  543|  1.54M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 12.1k, False: 1.53M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  12.1k|    return this;
  546|  12.1k|  }
  547|  1.53M|  tiffPath.pop();
  548|  1.53M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.53M|  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.53M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.53M]
  ------------------
  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.53M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.53M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.53M]
  ------------------
  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.53M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.53M|  setCount(elements_.size());
  568|  1.53M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.53M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  7.33M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  7.33M|  return doAddChild(std::move(tiffComponent));
  573|  7.33M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  4.01M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  4.01M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  4.01M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  76.3k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  76.3k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  76.3k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 76.3k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  76.3k|  return ifds_.emplace_back(std::move(d)).get();
  589|  76.3k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  3.24M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  3.24M|  setDecoded(true);
  604|  3.24M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  3.24M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  3.26k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  3.26k|  return doAddNext(std::move(tiffComponent));
  609|  3.26k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  3.26k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  3.26k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 3.26k, False: 0]
  ------------------
  617|  3.26k|    pNext_ = std::move(tiffComponent);
  618|  3.26k|    return pNext_.get();
  619|  3.26k|  }
  620|      0|  return nullptr;
  621|  3.26k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  49.8M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  49.8M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 49.8M, False: 13.3k]
  ------------------
  636|  49.8M|    doAccept(visitor);  // one for NVI :)
  637|  49.8M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  27.8M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  27.8M|  visitor.visitEntry(this);
  641|  27.8M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   301k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   301k|  visitor.visitDataEntry(this);
  645|   301k|}  // 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.48M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.48M|  visitor.visitSizeEntry(this);
  653|  2.48M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  1.42M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  1.42M|  visitor.visitDirectory(this);
  657|  33.5M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 33.5M, False: 1.20M]
  ------------------
  658|  33.5M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 224k, False: 33.3M]
  ------------------
  659|   224k|      break;
  660|  33.3M|    component->accept(visitor);
  661|  33.3M|  }
  662|  1.42M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.18M, False: 238k]
  ------------------
  663|  1.18M|    visitor.visitDirectoryNext(this);
  664|  1.42M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 52.6k, False: 1.37M]
  ------------------
  665|  52.6k|    pNext_->accept(visitor);
  666|  1.42M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.17M, False: 256k]
  ------------------
  667|  1.17M|    visitor.visitDirectoryEnd(this);
  668|  1.42M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   268k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   268k|  visitor.visitSubIfd(this);
  672|  1.01M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 1.01M, False: 221k]
  ------------------
  673|  1.01M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 46.6k, False: 971k]
  ------------------
  674|  46.6k|      break;
  675|   971k|    ifd->accept(visitor);
  676|   971k|  }
  677|   268k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   243k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   243k|  visitor.visitMnEntry(this);
  681|   243k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 88.4k, False: 154k]
  ------------------
  682|  88.4k|    mn_->accept(visitor);
  683|   243k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.51k, False: 241k]
  ------------------
  684|  1.51k|    mn_ = nullptr;
  685|  1.51k|  }
  686|       |
  687|   243k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  81.7k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  81.7k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 81.7k, False: 0]
  ------------------
  691|  81.7k|    visitor.visitIfdMakernote(this);
  692|  81.7k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 80.7k, False: 1.02k]
  ------------------
  693|  80.7k|    ifd_.accept(visitor);
  694|  81.7k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 80.7k, False: 1.02k]
  |  Branch (694:52): [True: 63.3k, False: 17.3k]
  ------------------
  695|  63.3k|    visitor.visitIfdMakernoteEnd(this);
  696|  81.7k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   192k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   192k|  visitor.visitBinaryArray(this);
  700|  14.9M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 14.9M, False: 191k]
  ------------------
  701|  14.9M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 1.40k, False: 14.9M]
  ------------------
  702|  1.40k|      break;
  703|  14.9M|    element->accept(visitor);
  704|  14.9M|  }
  705|   192k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 178k, False: 13.9k]
  ------------------
  706|   178k|    visitor.visitBinaryArrayEnd(this);
  707|   192k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  15.2M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  15.2M|  visitor.visitBinaryElement(this);
  711|  15.2M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  2.96M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  2.96M|  doEncode(encoder, datum);
  715|  2.96M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.53M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.53M|  encoder.encodeBinaryElement(this, datum);
  719|  1.53M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  12.5k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  12.5k|  encoder.encodeBinaryArray(this, datum);
  723|  12.5k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  7.20k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  7.20k|  encoder.encodeDataEntry(this, datum);
  727|  7.20k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.34M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.34M|  encoder.encodeTiffEntry(this, datum);
  731|  1.34M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  16.2k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  16.2k|  encoder.encodeImageEntry(this, datum);
  735|  16.2k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  13.7k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  13.7k|  encoder.encodeMnEntry(this, datum);
  739|  13.7k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  23.8k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  23.8k|  encoder.encodeSizeEntry(this, datum);
  743|  23.8k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  1.90k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  1.90k|  encoder.encodeSubIfd(this, datum);
  747|  1.90k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  1.71M|size_t TiffComponent::count() const {
  750|  1.71M|  return doCount();
  751|  1.71M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   164k|size_t TiffDirectory::doCount() const {
  754|   164k|  return components_.size();
  755|   164k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.53M|size_t TiffEntryBase::doCount() const {
  758|  1.53M|  return count_;
  759|  1.53M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  18.5k|size_t TiffMnEntry::doCount() const {
  762|  18.5k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 10.0k, False: 8.51k]
  ------------------
  763|  10.0k|    return TiffEntryBase::doCount();
  764|  10.0k|  }
  765|  8.51k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  8.51k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 1.85k, False: 6.66k]
  |  Branch (768:36): [True: 1.82k, False: 29]
  |  Branch (768:68): [True: 1.75k, False: 65]
  ------------------
  769|  1.75k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  1.75k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.75k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.75k|  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.75k|  }
  773|  8.51k|#endif
  774|  8.51k|  return mn_->size();
  775|  18.5k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  18.9k|size_t TiffBinaryArray::doCount() const {
  782|  18.9k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 947, False: 17.9k]
  |  Branch (782:17): [True: 11.2k, False: 6.77k]
  ------------------
  783|  12.1k|    return TiffEntryBase::doCount();
  784|       |
  785|  6.77k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 6.77k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  6.77k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  6.77k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  6.77k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 30, False: 6.74k]
  ------------------
  791|     30|#ifndef SUPPRESS_WARNINGS
  792|     30|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|     30|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 30]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     30|  LogMsg(LogMsg::warn).os()
  ------------------
                  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|     30|#endif
  795|     30|    typeSize = 1;
  796|     30|  }
  797|       |
  798|  6.77k|  return size() / typeSize;
  799|  6.77k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|  1.26k|size_t TiffBinaryElement::doCount() const {
  802|  1.26k|  return elDef_.count_;
  803|  1.26k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  3.00M|                            size_t& imageIdx) {
  807|  3.00M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  3.00M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  36.7k|                              size_t& imageIdx) {
  812|  36.7k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  36.7k|  const size_t compCount = count();
  816|  36.7k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 36.7k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  36.7k|  size_t sizeNext = 0;
  821|  36.7k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 913, False: 35.8k]
  ------------------
  822|    913|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  36.7k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 563, False: 36.2k]
  |  Branch (825:25): [True: 172, False: 391]
  ------------------
  826|    172|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  36.6k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 45, False: 36.5k]
  ------------------
  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|     45|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     45|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  36.6k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 36.3k, False: 282]
  ------------------
  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|  36.6k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 27.5k, False: 9.11k]
  ------------------
  842|  27.5k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  27.5k|  }
  844|       |  // Size of IFD values and additional data
  845|  36.6k|  size_t sizeValue = 0;
  846|  36.6k|  size_t sizeData = 0;
  847|  1.42M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.42M, False: 36.6k]
  ------------------
  848|  1.42M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 90.9k, False: 1.33M]
  ------------------
  849|  90.9k|      sv += sv & 1;  // Align value to word boundary
  850|  90.9k|      sizeValue += sv;
  851|  90.9k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.42M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 729k, False: 700k]
  ------------------
  854|   729k|      auto sd = component->sizeData();
  855|   729k|      sd += sd & 1;  // Align data to word boundary
  856|   729k|      sizeData += sd;
  857|   729k|    }
  858|  1.42M|  }
  859|       |
  860|  36.6k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  36.6k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  36.6k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  36.6k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 15.1k, False: 21.4k]
  ------------------
  864|  15.1k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  15.1k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  15.1k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  36.6k|  byte buf[4];
  870|  36.6k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  36.6k|  ioWrapper.write(buf, 2);
  872|  36.6k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.42M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.42M, False: 36.6k]
  ------------------
  875|  1.42M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.42M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 90.2k, False: 1.33M]
  ------------------
  877|  90.2k|      sv += sv & 1;  // Align value to word boundary
  878|  90.2k|      valueIdx += sv;
  879|  90.2k|    }
  880|  1.42M|    auto sd = component->sizeData();
  881|  1.42M|    sd += sd & 1;  // Align data to word boundary
  882|  1.42M|    dataIdx += sd;
  883|  1.42M|  }
  884|       |  // c) Pointer to the next IFD
  885|  36.6k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 36.1k, False: 472]
  ------------------
  886|  36.1k|    memset(buf, 0x0, 4);
  887|  36.1k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 911, False: 35.2k]
  |  Branch (887:19): [True: 910, False: 1]
  ------------------
  888|    910|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|    910|    }
  890|  36.1k|    ioWrapper.write(buf, 4);
  891|  36.1k|    idx += 4;
  892|  36.1k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  36.6k|  valueIdx = sizeDir;
  896|  36.6k|  dataIdx = sizeDir + sizeValue;
  897|  1.41M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.41M, False: 36.6k]
  ------------------
  898|  1.41M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 88.7k, False: 1.32M]
  ------------------
  899|  88.7k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  88.7k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  88.7k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 16.7k, False: 71.9k]
  ------------------
  902|  16.7k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  16.7k|        sv += 1;
  904|  16.7k|      }
  905|  88.7k|      idx += sv;
  906|  88.7k|      valueIdx += sv;
  907|  88.7k|    }
  908|  1.41M|    auto sd = component->sizeData();
  909|  1.41M|    sd += sd & 1;  // Align data to word boundary
  910|  1.41M|    dataIdx += sd;
  911|  1.41M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  36.6k|  dataIdx = sizeDir + sizeValue;
  915|  36.6k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  36.6k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 904, False: 35.7k]
  |  Branch (918:17): [True: 903, False: 1]
  ------------------
  919|    903|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|    903|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  36.6k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 14.6k, False: 21.9k]
  ------------------
  924|  14.6k|    idx += writeImage(ioWrapper, byteOrder);
  925|  14.6k|  }
  926|       |
  927|  36.6k|  return idx;
  928|  36.7k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.42M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.42M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.42M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.42M]
  ------------------
  934|      0|    return 0;
  935|  1.42M|  byte buf[8];
  936|  1.42M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.42M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.42M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.42M|  ioWrapper.write(buf, 8);
  940|  1.42M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 90.2k, False: 1.33M]
  ------------------
  941|  90.2k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  90.2k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  90.2k|    ioWrapper.write(buf, 4);
  944|  1.33M|  } else {
  945|  1.33M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.33M|#ifndef SUPPRESS_WARNINGS
  947|  1.33M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 20, False: 1.33M]
  ------------------
  948|     20|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|     20|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 20]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     20|  LogMsg(LogMsg::error).os()
  ------------------
  949|     20|    }
  950|  1.33M|#endif
  951|  1.33M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.31M, False: 20.2k]
  ------------------
  952|  1.31M|      memset(buf, 0x0, 4);
  953|  1.31M|      ioWrapper.write(buf, 4 - len);
  954|  1.31M|    }
  955|  1.33M|  }
  956|  1.42M|  return 12;
  957|  1.42M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.37M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.37M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 19.7k, False: 1.35M]
  |  Branch (961:19): [True: 1.25M, False: 106k]
  ------------------
  962|  1.27M|    return 0;
  963|       |
  964|   106k|  DataBuf buf(pValue_->size());
  965|   106k|  pValue_->copy(buf.data(), byteOrder);
  966|   106k|  ioWrapper.write(buf.c_data(), buf.size());
  967|   106k|  return buf.size();
  968|  1.37M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  80.4k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  80.4k|  size_t rc = 0;
  972|  80.4k|  switch (tiffType) {
  973|  1.93k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 1.93k, False: 78.4k]
  ------------------
  974|  5.05k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 3.11k, False: 77.3k]
  ------------------
  975|  5.05k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 18, False: 5.03k]
  ------------------
  976|     18|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  5.03k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  5.03k|      break;
  979|  72.9k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 72.9k, False: 7.43k]
  ------------------
  980|  74.9k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 1.99k, False: 78.4k]
  ------------------
  981|  74.9k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  74.9k|      break;
  983|    392|    default:
  ------------------
  |  Branch (983:5): [True: 392, False: 80.0k]
  ------------------
  984|    392|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  80.4k|  }
  986|  80.0k|  return rc;
  987|  80.4k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  990|  3.88k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  991|  3.88k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (991:7): [True: 122, False: 3.76k]
  |  Branch (991:20): [True: 2.17k, False: 1.59k]
  ------------------
  992|  2.29k|    return 0;
  993|       |
  994|  1.59k|  DataBuf buf(pValue()->size());
  995|  1.59k|  size_t idx = 0;
  996|  1.59k|  const size_t prevOffset = pValue()->toUint32(0);
  997|  8.76k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (997:22): [True: 7.17k, False: 1.59k]
  ------------------
  998|  7.17k|    const size_t iOffset = pValue()->toUint32(i);
  999|  7.17k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1000|  7.17k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1001|  7.17k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1002|  7.17k|  }
 1003|  1.59k|  ioWrapper.write(buf.c_data(), buf.size());
 1004|  1.59k|  return buf.size();
 1005|  3.88k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  16.0k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  16.0k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  16.0k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 319, False: 15.7k]
  ------------------
 1012|    319|    o2 = Safe::add<size_t>(offset, dataIdx);
 1013|       |#ifdef EXIV2_DEBUG_MESSAGES
 1014|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1015|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1016|       |#endif
 1017|  16.0k|  DataBuf buf(strips_.size() * 4);
 1018|  16.0k|  size_t idx = 0;
 1019|  60.7k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 60.7k, False: 16.0k]
  ------------------
 1020|  60.7k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  60.7k|    const auto sz = Safe::add(off, off & 1);
 1023|  60.7k|    o2 = Safe::add(o2, sz);
 1024|  60.7k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 60.2k, False: 448]
  ------------------
 1025|  60.2k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  60.7k|  }
 1027|  16.0k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  16.0k|  return buf.size();
 1029|  16.0k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1032|  9.27k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1033|  9.27k|  DataBuf buf(ifds_.size() * 4);
 1034|  9.27k|  size_t idx = 0;
 1035|       |  // Sort IFDs by group, needed if image data tags were copied first
 1036|  9.27k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1037|  12.5k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1037:19): [True: 12.5k, False: 9.27k]
  ------------------
 1038|  12.5k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1039|  12.5k|    dataIdx += ifd->size();
 1040|  12.5k|  }
 1041|  9.27k|  ioWrapper.write(buf.c_data(), buf.size());
 1042|  9.27k|  return buf.size();
 1043|  9.27k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1046|  18.0k|                            size_t& imageIdx) {
 1047|  18.0k|  if (!mn_) {
  ------------------
  |  Branch (1047:7): [True: 9.78k, False: 8.28k]
  ------------------
 1048|  9.78k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1049|  9.78k|  }
 1050|  8.28k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1051|  18.0k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1054|  8.28k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1055|  8.28k|  mnOffset_ = offset;
 1056|  8.28k|  setImageByteOrder(byteOrder);
 1057|  8.28k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1058|  8.28k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1059|  8.28k|                    imageIdx);
 1060|  8.28k|  return len;
 1061|  8.28k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1064|  18.7k|                                size_t dataIdx, size_t& imageIdx) {
 1065|  18.7k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1065:7): [True: 893, False: 17.8k]
  |  Branch (1065:17): [True: 11.1k, False: 6.69k]
  ------------------
 1066|  12.0k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1067|  6.69k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1067:7): [True: 1.21k, False: 5.47k]
  ------------------
 1068|  1.21k|    byteOrder = cfg()->byteOrder_;
 1069|       |  // Tags must be sorted in ascending order
 1070|  6.69k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1071|  6.69k|  size_t idx = 0;
 1072|  6.69k|  MemIo mio;  // memory stream in which to store data
 1073|  6.69k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1074|       |  // Some array entries need to have the size in the first element
 1075|  6.69k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1075:7): [True: 164, False: 6.53k]
  ------------------
 1076|    164|    byte buf[4];
 1077|    164|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1078|    164|    switch (elSize) {
 1079|     97|      case 2:
  ------------------
  |  Branch (1079:7): [True: 97, False: 67]
  ------------------
 1080|     97|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1081|     97|        break;
 1082|     67|      case 4:
  ------------------
  |  Branch (1082:7): [True: 67, False: 97]
  ------------------
 1083|     67|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1084|     67|        break;
 1085|      0|      default:
  ------------------
  |  Branch (1085:7): [True: 0, False: 164]
  ------------------
 1086|      0|        break;
 1087|    164|    }
 1088|    164|    mioWrapper.write(buf, elSize);
 1089|    164|  }
 1090|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1091|  1.53M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1091:23): [True: 1.53M, False: 6.69k]
  ------------------
 1092|       |    // Skip the manufactured tag, if it exists
 1093|  1.53M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1093:9): [True: 45.6k, False: 1.48M]
  |  Branch (1093:28): [True: 164, False: 45.4k]
  ------------------
 1094|    164|      continue;
 1095|  1.53M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1096|  1.53M|    idx += fillGap(mioWrapper, idx, newIdx);
 1097|  1.53M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1098|  1.53M|  }
 1099|  6.69k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1099:7): [True: 5.34k, False: 1.34k]
  |  Branch (1099:29): [True: 5.34k, False: 0]
  ------------------
 1100|  5.34k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1101|  5.34k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1102|  5.34k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1103|  5.34k|  }
 1104|       |
 1105|  6.69k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1105:7): [True: 388, False: 6.30k]
  ------------------
 1106|       |    // Select sonyTagEncipher
 1107|    388|    CryptFct cryptFct = cfg()->cryptFct_;
 1108|    388|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1108:9): [True: 201, False: 187]
  ------------------
 1109|    201|      cryptFct = sonyTagEncipher;
 1110|    201|    }
 1111|    388|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1112|    388|    if (!buf.empty()) {
  ------------------
  |  Branch (1112:9): [True: 226, False: 162]
  ------------------
 1113|    226|      mio.seek(0, Exiv2::BasicIo::beg);
 1114|    226|      mio.write(buf.c_data(), buf.size());
 1115|    226|    }
 1116|    388|  }
 1117|  6.69k|  ioWrapper.write(mio.mmap(), mio.size());
 1118|       |
 1119|  6.69k|  return idx;
 1120|  6.69k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1123|  1.53M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1124|  1.53M|  auto pv = pValue();
 1125|  1.53M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1125:7): [True: 0, False: 1.53M]
  |  Branch (1125:14): [True: 685k, False: 849k]
  ------------------
 1126|   685k|    return 0;
 1127|   849k|  DataBuf buf(pv->size());
 1128|   849k|  pv->copy(buf.data(), byteOrder);
 1129|   849k|  ioWrapper.write(buf.c_data(), buf.size());
 1130|   849k|  return buf.size();
 1131|  1.53M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|  1.44M|                                size_t& imageIdx) const {
 1135|  1.44M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|  1.44M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  36.0k|                                  size_t& imageIdx) const {
 1140|  36.0k|  size_t len = 0;
 1141|  1.40M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 1.40M, False: 36.0k]
  ------------------
 1142|  1.40M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|  1.40M|  }
 1144|  36.0k|  return len;
 1145|  36.0k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|  1.37M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|  1.37M|  return 0;
 1150|  1.37M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  15.5k|                                   size_t& /*imageIdx*/) const {
 1154|  15.5k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  15.5k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 300, False: 15.2k]
  ------------------
 1157|    300|    len = writeImage(ioWrapper, byteOrder);
 1158|    300|  }
 1159|  15.5k|  return len;
 1160|  15.5k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1163|  3.32k|                                  size_t& /*imageIdx*/) const {
 1164|  3.32k|  if (!pValue())
  ------------------
  |  Branch (1164:7): [True: 118, False: 3.20k]
  ------------------
 1165|    118|    return 0;
 1166|       |
 1167|  3.20k|  DataBuf buf = pValue()->dataArea();
 1168|  3.20k|  if (!buf.empty())
  ------------------
  |  Branch (1168:7): [True: 665, False: 2.54k]
  ------------------
 1169|    665|    ioWrapper.write(buf.c_data(), buf.size());
 1170|       |  // Align data to word boundary
 1171|  3.20k|  size_t align = (buf.size() & 1);
 1172|  3.20k|  if (align)
  ------------------
  |  Branch (1172:7): [True: 126, False: 3.08k]
  ------------------
 1173|    126|    ioWrapper.putb(0x0);
 1174|       |
 1175|  3.20k|  return buf.size() + align;
 1176|  3.32k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1179|  9.23k|                               size_t& imageIdx) const {
 1180|  9.23k|  size_t len = 0;
 1181|  12.2k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1181:19): [True: 12.2k, False: 9.23k]
  ------------------
 1182|  12.2k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1183|  12.2k|  }
 1184|       |  // Align data to word boundary
 1185|  9.23k|  size_t align = (len & 1);
 1186|  9.23k|  if (align)
  ------------------
  |  Branch (1186:7): [True: 0, False: 9.23k]
  ------------------
 1187|      0|    ioWrapper.putb(0x0);
 1188|       |
 1189|  9.23k|  return len + align;
 1190|  9.23k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   889k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   889k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   889k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  26.4k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  26.4k|  size_t len = 0;
 1203|  26.4k|  const TiffComponent* pSubIfd = nullptr;
 1204|   862k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 862k, False: 26.4k]
  ------------------
 1205|   862k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 1.52k, False: 861k]
  ------------------
 1206|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1207|  1.52k|#ifndef SUPPRESS_WARNINGS
 1208|  1.52k|      if (pSubIfd) {
  ------------------
  |  Branch (1208:11): [True: 419, False: 1.10k]
  ------------------
 1209|    419|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    419|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 419]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    419|  LogMsg(LogMsg::error).os()
  ------------------
 1210|    419|      }
 1211|  1.52k|#endif
 1212|  1.52k|      pSubIfd = component.get();
 1213|  1.52k|      continue;
 1214|  1.52k|    }
 1215|   861k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   861k|  }
 1217|  26.4k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 1.08k, False: 25.3k]
  ------------------
 1218|  1.08k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|  1.08k|  }
 1220|  26.4k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 714, False: 25.7k]
  ------------------
 1221|    714|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|    714|  }
 1223|  26.4k|  return len;
 1224|  26.4k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   840k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   840k|  return 0;
 1228|   840k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1230|  8.14k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1231|  8.14k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1232|  8.14k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1233|  8.14k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  14.3k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  14.3k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 116, False: 14.2k]
  ------------------
 1245|    116|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  14.2k|  size_t len = pValue()->sizeDataArea();
 1248|  14.2k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 227, False: 14.0k]
  ------------------
 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|    227|    DataBuf buf = pValue()->dataArea();
 1254|    227|    ioWrapper.write(buf.c_data(), buf.size());
 1255|    227|    size_t align = len & 1;  // Align image data to word boundary
 1256|    227|    if (align)
  ------------------
  |  Branch (1256:9): [True: 123, False: 104]
  ------------------
 1257|    123|      ioWrapper.putb(0x0);
 1258|    227|    len += align;
 1259|  14.0k|  } else {
 1260|       |#ifdef EXIV2_DEBUG_MESSAGES
 1261|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1262|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1263|       |#endif
 1264|  14.0k|    len = 0;
 1265|  56.3k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 56.3k, False: 14.0k]
  ------------------
 1266|  56.3k|      ioWrapper.write(f, s);
 1267|  56.3k|      len += s;
 1268|  56.3k|      size_t align = s & 1;  // Align strip data to word boundary
 1269|  56.3k|      if (align)
  ------------------
  |  Branch (1269:11): [True: 32.1k, False: 24.1k]
  ------------------
 1270|  32.1k|        ioWrapper.putb(0x0);
 1271|  56.3k|      len += align;
 1272|  56.3k|    }
 1273|  14.0k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  14.2k|  return len;
 1278|  14.3k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|  17.5M|size_t TiffComponent::size() const {
 1281|  17.5M|  return doSize();
 1282|  17.5M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1284|   127k|size_t TiffDirectory::doSize() const {
 1285|   127k|  size_t compCount = count();
 1286|       |  // Size of the directory, without values and additional data
 1287|   127k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1287:40): [True: 125k, False: 2.54k]
  ------------------
 1288|       |  // Size of IFD values and data
 1289|  5.38M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1289:25): [True: 5.38M, False: 127k]
  ------------------
 1290|  5.38M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1290:40): [True: 284k, False: 5.10M]
  ------------------
 1291|   284k|      sv += sv & 1;  // Align value to word boundary
 1292|   284k|      len += sv;
 1293|   284k|    }
 1294|  5.38M|    auto sd = component->sizeData();
 1295|  5.38M|    sd += sd & 1;  // Align data to word boundary
 1296|  5.38M|    len += sd;
 1297|  5.38M|  }
 1298|       |  // Size of next-IFD, if any
 1299|   127k|  size_t sizeNext = 0;
 1300|   127k|  if (pNext_) {
  ------------------
  |  Branch (1300:7): [True: 234, False: 127k]
  ------------------
 1301|    234|    sizeNext = pNext_->size();
 1302|    234|    len += sizeNext;
 1303|    234|  }
 1304|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1305|   127k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1305:7): [True: 1.11k, False: 126k]
  |  Branch (1305:25): [True: 998, False: 119]
  ------------------
 1306|    998|    len = 0;
 1307|   127k|  return len;
 1308|   127k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  16.0M|size_t TiffEntryBase::doSize() const {
 1311|  16.0M|  return size_;
 1312|  16.0M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|  94.5k|size_t TiffImageEntry::doSize() const {
 1315|  94.5k|  return strips_.size() * 4;
 1316|  94.5k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1318|  46.8k|size_t TiffSubIfd::doSize() const {
 1319|  46.8k|  return ifds_.size() * 4;
 1320|  46.8k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1322|   100k|size_t TiffMnEntry::doSize() const {
 1323|   100k|  if (!mn_) {
  ------------------
  |  Branch (1323:7): [True: 39.9k, False: 60.3k]
  ------------------
 1324|  39.9k|    return TiffEntryBase::doSize();
 1325|  39.9k|  }
 1326|  60.3k|  return mn_->size();
 1327|   100k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1329|  68.8k|size_t TiffIfdMakernote::doSize() const {
 1330|  68.8k|  return sizeHeader() + ifd_.size();
 1331|  68.8k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1333|   252k|size_t TiffBinaryArray::doSize() const {
 1334|   252k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1334:7): [True: 11.7k, False: 240k]
  |  Branch (1334:17): [True: 145k, False: 94.2k]
  ------------------
 1335|   157k|    return TiffEntryBase::doSize();
 1336|       |
 1337|  94.2k|  if (elements_.empty())
  ------------------
  |  Branch (1337:7): [True: 0, False: 94.2k]
  ------------------
 1338|      0|    return 0;
 1339|       |
 1340|       |  // Remaining assumptions:
 1341|       |  // - array elements don't "overlap"
 1342|       |  // - no duplicate tags in the array
 1343|  94.2k|  size_t idx = 0;
 1344|  94.2k|  size_t sz = cfg()->tagStep();
 1345|  21.5M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1345:23): [True: 21.5M, False: 94.2k]
  ------------------
 1346|  21.5M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1346:9): [True: 6.23M, False: 15.2M]
  ------------------
 1347|  6.23M|      idx = element->tag();
 1348|  6.23M|      sz = element->size();
 1349|  6.23M|    }
 1350|  21.5M|  }
 1351|  94.2k|  idx *= cfg()->tagStep();
 1352|  94.2k|  idx += sz;
 1353|       |
 1354|  94.2k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1354:7): [True: 75.1k, False: 19.1k]
  |  Branch (1354:29): [True: 75.1k, False: 0]
  ------------------
 1355|  75.1k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1356|  75.1k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1357|  75.1k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1358|  75.1k|  }
 1359|  94.2k|  return idx;
 1360|       |
 1361|  94.2k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1363|  6.24M|size_t TiffBinaryElement::doSize() const {
 1364|  6.24M|  if (!pValue())
  ------------------
  |  Branch (1364:7): [True: 0, False: 6.24M]
  ------------------
 1365|      0|    return 0;
 1366|  6.24M|  return pValue()->size();
 1367|  6.24M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|  8.95M|size_t TiffComponent::sizeData() const {
 1370|  8.95M|  return doSizeData();
 1371|  8.95M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|  8.83M|size_t TiffEntryBase::doSizeData() const {
 1378|  8.83M|  return 0;
 1379|  8.83M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  71.0k|size_t TiffImageEntry::doSizeData() const {
 1382|  71.0k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  71.0k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 5.11k, False: 65.9k]
  ------------------
 1385|  5.11k|    len = sizeImage();
 1386|  5.11k|  }
 1387|  71.0k|  return len;
 1388|  71.0k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1390|  18.7k|size_t TiffDataEntry::doSizeData() const {
 1391|  18.7k|  if (!pValue())
  ------------------
  |  Branch (1391:7): [True: 366, False: 18.3k]
  ------------------
 1392|    366|    return 0;
 1393|  18.3k|  return pValue()->sizeDataArea();
 1394|  18.7k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1396|  35.6k|size_t TiffSubIfd::doSizeData() const {
 1397|  35.6k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1398|  35.6k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1404|  5.11k|size_t TiffComponent::sizeImage() const {
 1405|  5.11k|  return doSizeImage();
 1406|  5.11k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1426|  5.11k|size_t TiffImageEntry::doSizeImage() const {
 1427|  5.11k|  if (!pValue())
  ------------------
  |  Branch (1427:7): [True: 0, False: 5.11k]
  ------------------
 1428|      0|    return 0;
 1429|  5.11k|  auto len = pValue()->sizeDataArea();
 1430|  5.11k|  if (len != 0)
  ------------------
  |  Branch (1430:7): [True: 0, False: 5.11k]
  ------------------
 1431|      0|    return len;
 1432|       |
 1433|  5.11k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1434|  5.11k|                               [](const auto& s) { return s.second; });
 1435|  5.11k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  9.60M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  9.60M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  9.60M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 11.6k, False: 9.58M]
  ------------------
 1456|  11.6k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 7.65k, False: 4.00k]
  ------------------
 1457|  7.65k|      ti = comment;
 1458|  7.65k|    }
 1459|  11.6k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  9.60M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 5.17M, False: 4.42M]
  ------------------
 1463|  5.17M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 4.87k, False: 5.17M]
  |  Branch (1463:26): [True: 1.43k, False: 3.44k]
  |  Branch (1463:58): [True: 2.32k, False: 5.17M]
  |  Branch (1463:75): [True: 30, False: 2.29k]
  ------------------
 1464|  1.46k|    ti = Exiv2::signedByte;
 1465|  1.46k|  }
 1466|  9.60M|  return ti;
 1467|  9.60M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  5.96M|TiffType toTiffType(TypeId typeId) {
 1470|  5.96M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 5.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|  5.96M|  return static_cast<TiffType>(typeId);
 1478|  5.96M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  31.8M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  31.8M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 24.3M, False: 7.52M]
  ------------------
 1482|  24.3M|    return lhs->tag() < rhs->tag();
 1483|  7.52M|  return lhs->idx() < rhs->idx();
 1484|  31.8M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|  3.66M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|  3.66M|  return std::make_unique<TiffEntry>(tag, group);
 1488|  3.66M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  38.3k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  38.3k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  38.3k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|  3.28M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|  3.28M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|  3.28M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.45M|  auto atc = [&] {
  474|  1.45M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.43M, False: 23.6k]
  |  Branch (474:33): [True: 41.8k, False: 1.39M]
  ------------------
  475|  41.8k|      return std::move(object);
  476|  41.8k|    }
  477|  1.41M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.45M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.43M|  tc = [&] {
  486|  1.43M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 913, False: 1.43M]
  ------------------
  487|    913|      return this->addNext(std::move(atc));
  488|  1.43M|    return this->addChild(std::move(atc));
  489|  1.43M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  12.6k|  auto tc = [&] {
  509|  12.6k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 12.6k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  12.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  12.6k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1036|  3.70k|  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|  11.0k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1434|  13.1k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  58.4k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  58.4k|  const TagInfo* tags = [=] {
 1439|  58.4k|    if (group == IfdId::gpsId)
 1440|  58.4k|      return Internal::gpsTagList();
 1441|  58.4k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  58.4k|  }();
 1443|  58.4k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 12.1k, False: 46.3k]
  ------------------
 1444|   394k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 394k, False: 475]
  ------------------
 1445|   394k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 11.6k, False: 382k]
  ------------------
 1446|  11.6k|        return tags + idx;
 1447|  46.7k|  return nullptr;
 1448|  58.4k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  58.4k|  const TagInfo* tags = [=] {
 1439|  58.4k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 6.31k, False: 52.1k]
  ------------------
 1440|  6.31k|      return Internal::gpsTagList();
 1441|  52.1k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 5.82k, False: 46.3k]
  ------------------
 1442|  58.4k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1503|  1.54M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1504|  1.54M|  if (curr < tobe) {
  ------------------
  |  Branch (1504:7): [True: 224k, False: 1.31M]
  ------------------
 1505|   224k|    Exiv2::DataBuf buf(tobe - curr);
 1506|   224k|    ioWrapper.write(buf.c_data(), buf.size());
 1507|   224k|    return tobe - curr;
 1508|   224k|  }
 1509|  1.31M|  return 0;
 1510|  1.54M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  11.8M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  11.8M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  47.1M|  [[nodiscard]] uint16_t tag() const {
   82|  47.1M|    return static_cast<uint16_t>(extendedTag_);
   83|  47.1M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  11.7M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  11.7M|    return extendedTag_;
   87|  11.7M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  12.8M|  [[nodiscard]] IfdId group() const {
   90|  12.8M|    return group_;
   91|  12.8M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  7.39M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  7.39M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  4.38M|  void setStart(const byte* pStart) {
  217|  4.38M|    pStart_ = const_cast<byte*>(pStart);
  218|  4.38M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   248M|  [[nodiscard]] uint16_t tag() const {
  241|   248M|    return tag_;
  242|   248M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  30.5M|  [[nodiscard]] IfdId group() const {
  245|  30.5M|    return group_;
  246|  30.5M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  4.51M|  [[nodiscard]] byte* start() const {
  249|  4.51M|    return pStart_;
  250|  4.51M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  3.09M|  void setOffset(size_t offset) {
  417|  3.09M|    offset_ = offset;
  418|  3.09M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.57M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.57M|    return tiffType_;
  460|  1.57M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  90.2k|  [[nodiscard]] size_t offset() const {
  466|  90.2k|    return offset_;
  467|  90.2k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  3.54M|  [[nodiscard]] const byte* pData() const {
  477|  3.54M|    return pData_;
  478|  3.54M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  19.8M|  [[nodiscard]] const Value* pValue() const {
  481|  19.8M|    return pValue_.get();
  482|  19.8M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.54M|  void setCount(size_t count) {
  498|  1.54M|    count_ = count;
  499|  1.54M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  3.00M|  void setIdx(int idx) {
  502|  3.00M|    idx_ = idx;
  503|  3.00M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  1.71M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  1.71M|    return storage_;
  542|  1.71M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  59.1k|  [[nodiscard]] uint16_t szTag() const {
  624|  59.1k|    return szTag_;
  625|  59.1k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  59.1k|  [[nodiscard]] IfdId szGroup() const {
  628|  59.1k|    return szGroup_;
  629|  59.1k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  65.0k|  [[nodiscard]] uint16_t dtTag() const {
  790|  65.0k|    return dtTag_;
  791|  65.0k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  65.0k|  [[nodiscard]] IfdId dtGroup() const {
  794|  65.0k|    return dtGroup_;
  795|  65.0k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  25.0k|  [[nodiscard]] bool hasNext() const {
  843|  25.0k|    return hasNext_;
  844|  25.0k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  16.5k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  16.5k|    imageByteOrder_ = byteOrder;
 1108|  16.5k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  7.22M|  bool operator==(size_t idx) const {
 1218|  7.22M|    return idx_ == idx;
 1219|  7.22M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  3.51M|  [[nodiscard]] size_t tagStep() const {
 1235|  3.51M|    return elDefaultDef_.size(0, group_);
 1236|  3.51M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  3.25M|  void setDecoded(bool decoded) {
 1311|  3.25M|    decoded_ = decoded;
 1312|  3.25M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  10.6M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  10.6M|    return arrayCfg_;
 1320|  10.6M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   164k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   164k|    return arrayDef_;
 1324|   164k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  83.8k|  [[nodiscard]] size_t defSize() const {
 1327|  83.8k|    return defSize_;
 1328|  83.8k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   284k|  [[nodiscard]] bool decoded() const {
 1331|   284k|    return decoded_;
 1332|   284k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  1.71M|  void setElDef(const ArrayDef& def) {
 1405|  1.71M|    elDef_ = def;
 1406|  1.71M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  1.71M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  1.71M|    elByteOrder_ = byteOrder;
 1412|  1.71M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  1.74M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  1.74M|    return &elDef_;
 1422|  1.74M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  1.74M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  1.74M|    return elByteOrder_;
 1428|  1.74M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  31.3k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  31.3k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  31.3k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__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_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    120|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    120|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    120|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     26|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     26|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     26|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    283|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    283|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    283|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     12|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     12|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     12|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  10.6k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  10.6k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  10.6k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  8.28k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  8.28k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  8.28k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.05k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.05k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.05k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.13k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.13k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.13k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    426|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    426|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    426|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.79k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.79k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.79k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.8k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.8k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.8k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  13.1k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  13.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  13.1k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.29k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.29k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.29k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.39k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.39k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.39k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.60k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.60k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.60k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__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_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    382|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    382|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    382|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    578|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    578|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    578|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  8.75k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  8.75k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  8.75k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.20k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.20k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.20k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.46k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.46k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.46k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.45k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.45k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.45k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    494|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    494|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    494|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    912|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    912|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    912|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.69k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.69k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.69k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.77k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.77k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.77k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.24k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.24k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.24k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.48k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.48k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.48k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    211|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    211|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    211|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.13k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.13k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.13k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  7.79k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  7.79k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  7.79k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.37k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.37k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.37k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    519|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    519|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    519|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    789|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    789|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    789|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    361|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    361|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    361|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    693|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    693|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    693|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.13k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.13k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.13k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.14k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.14k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.14k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    341|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    341|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    341|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    588|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    588|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    588|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    277|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    277|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    277|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    278|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    278|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    278|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.42k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.42k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.42k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.06k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.06k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.06k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    309|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    309|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    309|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    627|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    627|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    627|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    276|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    276|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    276|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.45k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.45k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.45k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.24k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.24k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.24k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    179|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    179|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    179|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    294|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    294|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    294|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    212|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    212|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    212|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    762|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    762|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    762|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.74k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.74k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.74k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    216|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    216|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    216|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    274|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    274|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    274|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    169|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    169|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    169|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    598|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    598|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    598|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    513|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    513|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    513|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    827|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    827|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    827|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     89|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     89|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     89|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    383|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    383|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    383|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    257|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    257|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    257|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    282|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    282|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    282|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    592|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    592|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    592|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.32k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.32k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.32k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    395|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    395|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    395|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    135|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    135|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    135|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    313|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    313|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    313|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    204|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    204|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    204|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    405|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    405|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    405|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.76k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.76k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.76k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  14.7k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  14.7k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  14.7k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  8.55k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  8.55k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  8.55k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    498|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    498|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    498|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    218|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    218|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    218|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     79|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     79|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     79|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     80|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     80|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     80|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    260|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    260|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    260|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    220|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    220|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    220|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    313|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    313|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    313|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    103|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    103|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    103|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__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_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    349|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    349|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    349|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    430|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    430|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    430|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    203|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    203|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    203|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    221|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    221|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    221|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    201|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    201|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    201|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    389|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    389|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    389|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    363|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    363|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    363|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  10.2k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  10.2k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  10.2k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.69k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.69k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.69k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    456|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    456|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    456|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.76k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.76k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.76k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    272|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    272|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    272|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    153|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    153|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    153|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    205|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    205|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    205|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    198|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    198|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    198|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    149|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    149|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    149|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    191|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    191|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    191|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    407|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    407|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    407|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    453|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    453|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    453|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.26k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.26k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.26k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__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|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    878|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    878|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    878|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.86k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.86k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.86k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.24k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.24k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.24k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.13k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.13k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.13k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.20k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.20k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.20k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    333|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    333|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    333|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.09k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.09k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.09k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.09k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.28k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.28k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.28k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    434|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    434|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    434|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    269|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    269|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    269|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     95|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     95|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     95|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    175|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    175|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    175|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    133|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    133|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    133|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    133|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    235|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    235|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    235|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    227|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    227|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    227|}
tiffimage_int.cpp:_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|    115|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    115|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    115|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     95|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     95|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     95|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     95|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    171|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    171|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    171|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     45|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     45|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     45|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    102|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    102|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     84|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     84|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     84|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     85|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     85|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     85|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    393|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    393|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    393|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    189|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    189|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    189|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    189|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    152|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    152|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    152|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    152|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    309|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    309|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    309|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    309|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    320|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    320|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    320|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    320|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    321|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    321|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    321|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    321|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    673|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    673|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    673|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    673|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    375|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    375|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    375|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    375|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    694|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    694|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    694|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    694|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    238|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    238|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    238|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    238|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    150|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    150|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    150|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    150|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    331|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    331|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    331|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    331|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    347|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    347|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    347|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    347|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    177|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    177|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    177|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    177|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     95|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     95|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     95|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    413|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    413|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    413|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    850|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    850|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    850|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.02k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.02k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.02k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    573|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    573|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    573|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    411|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    411|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    411|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  5.06k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  5.06k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  5.06k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  5.06k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    422|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    422|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    422|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    401|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    401|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    401|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    397|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    397|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    397|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    253|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    253|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    253|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    253|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    746|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    746|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    746|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    746|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    358|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    358|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    358|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    358|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    638|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    638|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    638|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    638|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    212|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    212|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    212|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    212|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.74k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.74k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.74k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.74k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    296|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    296|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    296|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    296|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    160|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    160|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    160|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    314|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    314|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    314|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    314|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    268|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    268|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    268|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    148|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    148|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    148|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    230|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    230|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    230|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    230|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     50|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     50|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     50|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     35|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     35|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     35|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    301|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    301|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    301|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    301|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.99k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.99k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.99k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.99k|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    605|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    605|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    605|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     74|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     74|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     74|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    126|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    126|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    126|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    126|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  6.11k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  6.11k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  6.11k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  7.43M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   136k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  47.9k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  33.7k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  14.5M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  14.5M|  return ifdId_ == md.ifdId();
   31|  14.5M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.88M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.88M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.88M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 9.14k, False: 1.88M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  9.14k|    decoderFct = td->decoderFct_;
 1996|  9.14k|  }
 1997|  1.88M|  return decoderFct;
 1998|  1.88M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  2.96M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  2.96M|  EncoderFct encoderFct = nullptr;
 2002|  2.96M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 6.90k, False: 2.95M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  6.90k|    encoderFct = td->encoderFct_;
 2005|  6.90k|  }
 2006|  2.96M|  return encoderFct;
 2007|  2.96M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  7.38M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  7.38M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  7.38M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  7.38M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 7.03M, False: 344k]
  ------------------
 2014|  7.03M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  7.03M|  }
 2016|  7.38M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 7.29M, False: 86.3k]
  |  Branch (2016:7): [True: 7.28M, False: 101k]
  |  Branch (2016:37): [True: 7.28M, False: 14.9k]
  ------------------
 2017|  7.28M|    return i->second(tag, group);
 2018|  7.28M|  }
 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|   101k|  return nullptr;
 2028|  7.38M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  2.97M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  2.97M|  TiffPath ret;
 2032|  11.8M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 11.8M, Folded]
  ------------------
 2033|  11.8M|    ret.emplace(extendedTag, group);
 2034|  11.8M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  11.8M|    assert(ts != tiffTreeTable_.end());
 2036|  11.8M|    extendedTag = ts->second.second;
 2037|  11.8M|    group = ts->second.first;
 2038|  11.8M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 2.97M, False: 8.84M]
  ------------------
 2039|  2.97M|      break;
 2040|  2.97M|    }
 2041|  11.8M|  }
 2042|  2.97M|  return ret;
 2043|  2.97M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  16.9k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  16.9k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  16.9k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 10.4k, False: 6.51k]
  ------------------
 2050|  10.4k|    ph = std::make_unique<TiffHeader>();
 2051|  10.4k|    pHeader = ph.get();
 2052|  10.4k|  }
 2053|       |
 2054|  16.9k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 16.3k, False: 579]
  ------------------
 2055|  16.3k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  16.3k|    rootDir->accept(decoder);
 2057|  16.3k|  }
 2058|  16.9k|  return pHeader->byteOrder();
 2059|       |
 2060|  16.9k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  16.0k|                                     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|  16.0k|  WriteMethod writeMethod = wmIntrusive;
 2074|  16.0k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  16.0k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  16.0k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 6.09k, False: 9.99k]
  ------------------
 2077|       |    // Attempt to update existing TIFF components based on metadata entries
 2078|  6.09k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2079|  6.09k|    parsedTree->accept(encoder);
 2080|  6.09k|    if (!encoder.dirty())
  ------------------
  |  Branch (2080:9): [True: 773, False: 5.32k]
  ------------------
 2081|    773|      writeMethod = wmNonIntrusive;
 2082|  6.09k|  }
 2083|  16.0k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 15.3k, False: 778]
  ------------------
 2084|  15.3k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  15.3k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 5.32k, False: 9.99k]
  ------------------
 2086|       |      // Copy image tags from the original image to the composite
 2087|  5.32k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2088|  5.32k|      parsedTree->accept(copier);
 2089|  5.32k|    }
 2090|       |    // Add entries from metadata to composite
 2091|  15.3k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  15.3k|                        findEncoderFct);
 2093|  15.3k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  15.3k|    DataBuf header = pHeader->write();
 2096|  15.3k|    auto tempIo = MemIo();
 2097|  15.3k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  15.3k|    auto imageIdx(std::string::npos);
 2099|  15.3k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  15.3k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 133, False: 15.1k]
  ------------------
 2101|    133|      pOffsetWriter->writeOffsets(tempIo);
 2102|  15.3k|    io.transfer(tempIo);  // may throw
 2103|  15.3k|#ifndef SUPPRESS_WARNINGS
 2104|  15.3k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  15.3k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 15.3k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  15.3k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  15.3k|#endif
 2106|  15.3k|  }
 2107|    778|#ifndef SUPPRESS_WARNINGS
 2108|    778|  else {
 2109|    778|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    778|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 778]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    778|  LogMsg(LogMsg::info).os()
  ------------------
 2110|    778|  }
 2111|  16.0k|#endif
 2112|  16.0k|  return writeMethod;
 2113|  16.0k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  33.0k|                                                 TiffHeaderBase* pHeader) {
 2117|  33.0k|  TiffComponent::UniquePtr rootDir;
 2118|  33.0k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 10.3k, False: 22.7k]
  |  Branch (2118:17): [True: 0, False: 22.7k]
  ------------------
 2119|  10.3k|    return rootDir;
 2120|  22.7k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 78, False: 22.6k]
  |  Branch (2120:38): [True: 180, False: 22.4k]
  ------------------
 2121|    258|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    258|  }
 2123|  22.4k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  22.4k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 22.4k, False: 0]
  ------------------
 2125|  22.4k|    rootDir->setStart(pData + pHeader->offset());
 2126|  22.4k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  22.4k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  22.4k|    rootDir->accept(reader);
 2129|  22.4k|    reader.postProcess();
 2130|  22.4k|  }
 2131|  22.4k|  return rootDir;
 2132|       |
 2133|  22.7k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  16.0k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  16.0k|  PrimaryGroups ret;
 2137|  16.0k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 9.99k, False: 6.09k]
  ------------------
 2138|  9.99k|    return ret;
 2139|       |
 2140|  6.09k|  static constexpr auto imageGroups = std::array{
 2141|  6.09k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2142|  6.09k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2143|  6.09k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2144|  6.09k|  };
 2145|       |
 2146|  79.2k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2146:24): [True: 79.2k, False: 6.09k]
  ------------------
 2147|  79.2k|    TiffFinder finder(0x00fe, imageGroup);
 2148|  79.2k|    pSourceDir->accept(finder);
 2149|  79.2k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2150|  79.2k|    if (!te)
  ------------------
  |  Branch (2150:9): [True: 77.9k, False: 1.26k]
  ------------------
 2151|  77.9k|      continue;
 2152|  1.26k|    const Value* pV = te->pValue();
 2153|  1.26k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2153:9): [True: 1.12k, False: 142]
  |  Branch (2153:15): [True: 949, False: 173]
  |  Branch (2153:47): [True: 911, False: 38]
  |  Branch (2153:67): [True: 778, False: 133]
  ------------------
 2154|    778|      ret.push_back(te->group());
 2155|    778|    }
 2156|  1.26k|  }
 2157|  6.09k|  return ret;
 2158|  16.0k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   365k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   365k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   294k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   294k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 294k]
  |  Branch (2165:17): [True: 18, False: 294k]
  ------------------
 2166|     18|    return false;
 2167|       |
 2168|   294k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 7.85k, False: 286k]
  |  Branch (2168:26): [True: 7.50k, False: 353]
  ------------------
 2169|  7.50k|    byteOrder_ = littleEndian;
 2170|   286k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 102k, False: 184k]
  |  Branch (2170:33): [True: 102k, False: 562]
  ------------------
 2171|   102k|    byteOrder_ = bigEndian;
 2172|   184k|  } else {
 2173|   184k|    return false;
 2174|   184k|  }
 2175|   109k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|   109k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 109k, False: 19]
  |  Branch (2176:19): [True: 109k, False: 96]
  |  Branch (2176:33): [True: 32.8k, False: 76.7k]
  ------------------
 2177|  32.8k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  76.9k|  tag_ = t;
 2179|  76.9k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  76.9k|  return true;
 2182|   109k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  15.5k|DataBuf TiffHeaderBase::write() const {
 2185|  15.5k|  DataBuf buf(8);
 2186|  15.5k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 15.5k, False: 0]
  ------------------
 2187|  10.8k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 10.8k, False: 4.69k]
  ------------------
 2188|  10.8k|      buf.write_uint8(0, 'I');
 2189|  10.8k|      break;
 2190|  4.69k|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 4.69k, False: 10.8k]
  ------------------
 2191|  4.69k|      buf.write_uint8(0, 'M');
 2192|  4.69k|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 15.5k]
  ------------------
 2194|      0|      break;
 2195|  15.5k|  }
 2196|  15.5k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  15.5k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  15.5k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  15.5k|  return buf;
 2200|  15.5k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|   105k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|   105k|  return byteOrder_;
 2220|   105k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  16.6k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  16.6k|  byteOrder_ = byteOrder;
 2224|  16.6k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  46.2k|uint32_t TiffHeaderBase::offset() const {
 2227|  46.2k|  return offset_;
 2228|  46.2k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  9.48k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  9.48k|  offset_ = offset;
 2232|  9.48k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  18.0k|uint16_t TiffHeaderBase::tag() const {
 2239|  18.0k|  return tag_;
 2240|  18.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2242|  1.48k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2243|  1.48k|  return false;
 2244|  1.48k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|  3.53M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|  3.53M|  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|  3.53M|  return result;
 2335|  3.53M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   254k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   254k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2341|  3.50M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2342|  3.50M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2342:7): [True: 50.4k, False: 3.45M]
  ------------------
 2343|       |#ifdef EXIV2_DEBUG_MESSAGES
 2344|       |    std::cerr << "No image tags in this image\n";
 2345|       |#endif
 2346|  50.4k|    return false;
 2347|  50.4k|  }
 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|  3.45M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2352:7): [True: 58.7k, False: 3.39M]
  |  Branch (2352:7): [True: 20.7k, False: 3.43M]
  ------------------
 2353|  58.7k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2353:7): [True: 20.7k, False: 37.9k]
  ------------------
 2354|       |#ifdef EXIV2_DEBUG_MESSAGES
 2355|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2356|       |#endif
 2357|  20.7k|    return false;
 2358|  20.7k|  }
 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|  3.43M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2361:7): [True: 37.9k, False: 3.39M]
  |  Branch (2361:34): [True: 36.9k, False: 951]
  ------------------
 2362|       |#ifdef EXIV2_DEBUG_MESSAGES
 2363|       |    ExifKey key(tag, groupName(group));
 2364|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2365|       |#endif
 2366|  36.9k|    return true;
 2367|  36.9k|  }
 2368|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2369|  3.40M|  return isTiffImageTag(tag, group);
 2370|  3.43M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2372|    174|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2373|    174|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2374|    174|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2376|      9|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2377|      9|  auto it = offsetList_.find(id);
 2378|      9|  if (it != offsetList_.end())
  ------------------
  |  Branch (2378:7): [True: 9, False: 0]
  ------------------
 2379|      9|    it->second.target_ = target;
 2380|      9|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2382|    133|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2383|    133|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2383:29): [True: 133, False: 133]
  ------------------
 2384|    133|    io.seek(off.origin_, BasicIo::beg);
 2385|    133|    byte buf[4] = {0, 0, 0, 0};
 2386|    133|    l2Data(buf, off.target_, off.byteOrder_);
 2387|    133|    io.write(buf, 4);
 2388|    133|  }
 2389|    133|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|  3.53M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|  3.53M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 3.06M, False: 465k]
  ------------------
 2248|  3.06M|    return false;
 2249|  3.06M|  }
 2250|       |  //! List of TIFF image tags
 2251|   465k|  switch (tag) {
 2252|    890|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 890, False: 464k]
  ------------------
 2253|  2.11k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 1.22k, False: 464k]
  ------------------
 2254|  12.2k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 10.1k, False: 455k]
  ------------------
 2255|  20.9k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 8.67k, False: 456k]
  ------------------
 2256|  26.6k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 5.69k, False: 459k]
  ------------------
 2257|  27.3k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 713, False: 464k]
  ------------------
 2258|  27.9k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 583, False: 464k]
  ------------------
 2259|  28.3k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 464, False: 464k]
  ------------------
 2260|  31.3k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 2.93k, False: 462k]
  ------------------
 2261|  31.7k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 423, False: 465k]
  ------------------
 2262|  32.1k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 434, False: 465k]
  ------------------
 2263|  35.1k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 2.95k, False: 462k]
  ------------------
 2264|  35.6k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 529, False: 464k]
  ------------------
 2265|  36.1k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 513, False: 464k]
  ------------------
 2266|  36.4k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 253, False: 465k]
  ------------------
 2267|  36.5k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 68, False: 465k]
  ------------------
 2268|  36.7k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 221, False: 465k]
  ------------------
 2269|  36.9k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 226, False: 465k]
  ------------------
 2270|  37.3k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 350, False: 465k]
  ------------------
 2271|  37.6k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 356, False: 465k]
  ------------------
 2272|  37.9k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 258, False: 465k]
  ------------------
 2273|  37.9k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 77, False: 465k]
  ------------------
 2274|  38.1k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 127, False: 465k]
  ------------------
 2275|  38.1k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 42, False: 465k]
  ------------------
 2276|  38.4k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 298, False: 465k]
  ------------------
 2277|  38.8k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 386, False: 465k]
  ------------------
 2278|  39.0k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 201, False: 465k]
  ------------------
 2279|  39.1k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 68, False: 465k]
  ------------------
 2280|  39.1k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 70, False: 465k]
  ------------------
 2281|  39.4k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 241, False: 465k]
  ------------------
 2282|  40.8k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 1.39k, False: 464k]
  ------------------
 2283|  40.9k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 88, False: 465k]
  ------------------
 2284|  41.1k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 224, False: 465k]
  ------------------
 2285|  41.2k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 87, False: 465k]
  ------------------
 2286|  41.3k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 129, False: 465k]
  ------------------
 2287|  41.5k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 203, False: 465k]
  ------------------
 2288|  41.6k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 69, False: 465k]
  ------------------
 2289|  41.9k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 297, False: 465k]
  ------------------
 2290|  42.1k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 255, False: 465k]
  ------------------
 2291|  42.2k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 94, False: 465k]
  ------------------
 2292|  42.5k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 238, False: 465k]
  ------------------
 2293|  42.6k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 130, False: 465k]
  ------------------
 2294|  42.8k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 227, False: 465k]
  ------------------
 2295|  43.1k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 241, False: 465k]
  ------------------
 2296|  43.1k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 73, False: 465k]
  ------------------
 2297|  43.2k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 91, False: 465k]
  ------------------
 2298|  45.2k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 1.92k, False: 463k]
  ------------------
 2299|  54.9k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 9.71k, False: 455k]
  ------------------
 2300|  64.1k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 9.21k, False: 456k]
  ------------------
 2301|  64.4k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 352, False: 465k]
  ------------------
 2302|  64.5k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 86, False: 465k]
  ------------------
 2303|  64.7k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 203, False: 465k]
  ------------------
 2304|  64.8k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 79, False: 465k]
  ------------------
 2305|  64.9k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 152, False: 465k]
  ------------------
 2306|  65.1k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 148, False: 465k]
  ------------------
 2307|  65.5k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 408, False: 465k]
  ------------------
 2308|  65.6k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 100, False: 465k]
  ------------------
 2309|  65.7k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 74, False: 465k]
  ------------------
 2310|  66.0k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 277, False: 465k]
  ------------------
 2311|  66.0k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 73, False: 465k]
  ------------------
 2312|  66.1k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 71, False: 465k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|  66.1k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 38, False: 465k]
  ------------------
 2315|  66.2k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 34, False: 465k]
  ------------------
 2316|  66.3k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 150, False: 465k]
  ------------------
 2317|  66.5k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 220, False: 465k]
  ------------------
 2318|  66.5k|      return true;
 2319|   398k|    default:
  ------------------
  |  Branch (2319:5): [True: 398k, False: 66.5k]
  ------------------
 2320|   398k|      return false;
 2321|   465k|  }
 2322|   465k|}

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

_ZN5Exiv28Internal11TiffVisitor5setGoENS1_7GoEventEb:
   61|  1.11M|void TiffVisitor::setGo(GoEvent event, bool go) {
   62|  1.11M|  go_[event] = go;
   63|  1.11M|}
_ZNK5Exiv28Internal11TiffVisitor2goENS1_7GoEventE:
   65|   103M|bool TiffVisitor::go(GoEvent event) const {
   66|   103M|  return go_[event];
   67|   103M|}
_ZN5Exiv28Internal11TiffVisitor18visitDirectoryNextEPNS0_13TiffDirectoryE:
   69|  1.18M|void TiffVisitor::visitDirectoryNext(TiffDirectory* /*object*/) {
   70|  1.18M|}
_ZN5Exiv28Internal11TiffVisitor17visitDirectoryEndEPNS0_13TiffDirectoryE:
   72|  1.17M|void TiffVisitor::visitDirectoryEnd(TiffDirectory* /*object*/) {
   73|  1.17M|}
_ZN5Exiv28Internal11TiffVisitor20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
   75|  55.6k|void TiffVisitor::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
   76|  55.6k|}
_ZN5Exiv28Internal11TiffVisitor19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
   78|   178k|void TiffVisitor::visitBinaryArrayEnd(TiffBinaryArray* /*object*/) {
   79|   178k|}
_ZN5Exiv28Internal10TiffFinder4initEtNS_5IfdIdE:
   81|    318|void TiffFinder::init(uint16_t tag, IfdId group) {
   82|    318|  tag_ = tag;
   83|    318|  group_ = group;
   84|    318|  tiffComponent_ = nullptr;
   85|    318|  setGo(geTraverse, true);
   86|    318|}
_ZN5Exiv28Internal10TiffFinder10findObjectEPNS0_13TiffComponentE:
   88|  40.9M|void TiffFinder::findObject(TiffComponent* object) {
   89|  40.9M|  if (object->tag() == tag_ && object->group() == group_) {
  ------------------
  |  Branch (89:7): [True: 645k, False: 40.3M]
  |  Branch (89:32): [True: 136k, False: 508k]
  ------------------
   90|   136k|    tiffComponent_ = object;
   91|   136k|    setGo(geTraverse, false);
   92|   136k|  }
   93|  40.9M|}
_ZN5Exiv28Internal10TiffFinder10visitEntryEPNS0_9TiffEntryE:
   95|  23.0M|void TiffFinder::visitEntry(TiffEntry* object) {
   96|  23.0M|  findObject(object);
   97|  23.0M|}
_ZN5Exiv28Internal10TiffFinder14visitDataEntryEPNS0_13TiffDataEntryE:
   99|   276k|void TiffFinder::visitDataEntry(TiffDataEntry* object) {
  100|   276k|  findObject(object);
  101|   276k|}
_ZN5Exiv28Internal10TiffFinder15visitImageEntryEPNS0_14TiffImageEntryE:
  103|  1.71M|void TiffFinder::visitImageEntry(TiffImageEntry* object) {
  104|  1.71M|  findObject(object);
  105|  1.71M|}
_ZN5Exiv28Internal10TiffFinder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  107|  2.35M|void TiffFinder::visitSizeEntry(TiffSizeEntry* object) {
  108|  2.35M|  findObject(object);
  109|  2.35M|}
_ZN5Exiv28Internal10TiffFinder14visitDirectoryEPNS0_13TiffDirectoryE:
  111|  1.22M|void TiffFinder::visitDirectory(TiffDirectory* object) {
  112|  1.22M|  findObject(object);
  113|  1.22M|}
_ZN5Exiv28Internal10TiffFinder11visitSubIfdEPNS0_10TiffSubIfdE:
  115|   226k|void TiffFinder::visitSubIfd(TiffSubIfd* object) {
  116|   226k|  findObject(object);
  117|   226k|}
_ZN5Exiv28Internal10TiffFinder12visitMnEntryEPNS0_11TiffMnEntryE:
  119|   202k|void TiffFinder::visitMnEntry(TiffMnEntry* object) {
  120|   202k|  findObject(object);
  121|   202k|}
_ZN5Exiv28Internal10TiffFinder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  123|  65.8k|void TiffFinder::visitIfdMakernote(TiffIfdMakernote* object) {
  124|  65.8k|  findObject(object);
  125|  65.8k|}
_ZN5Exiv28Internal10TiffFinder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  127|   147k|void TiffFinder::visitBinaryArray(TiffBinaryArray* object) {
  128|   147k|  findObject(object);
  129|   147k|}
_ZN5Exiv28Internal10TiffFinder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  131|  11.7M|void TiffFinder::visitBinaryElement(TiffBinaryElement* object) {
  132|  11.7M|  findObject(object);
  133|  11.7M|}
_ZN5Exiv28Internal10TiffCopierC2EPNS0_13TiffComponentEjPKNS0_14TiffHeaderBaseENSt3__16vectorINS_5IfdIdENS7_9allocatorIS9_EEEE:
  137|  5.32k|    pRoot_(pRoot), root_(root), pHeader_(pHeader), pPrimaryGroups_(std::move(pPrimaryGroups)) {
  138|  5.32k|}
_ZN5Exiv28Internal10TiffCopier10copyObjectEPKNS0_13TiffComponentE:
  140|  1.31M|void TiffCopier::copyObject(const TiffComponent* object) {
  141|  1.31M|  if (pHeader_->isImageTag(object->tag(), object->group(), pPrimaryGroups_)) {
  ------------------
  |  Branch (141:7): [True: 42.6k, False: 1.27M]
  ------------------
  142|  42.6k|    auto clone = object->clone();
  143|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  144|  42.6k|    auto tiffPath = TiffCreator::getPath(object->tag(), object->group(), root_);
  145|  42.6k|    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|  42.6k|  }
  151|  1.31M|}
_ZN5Exiv28Internal10TiffCopier10visitEntryEPNS0_9TiffEntryE:
  153|   426k|void TiffCopier::visitEntry(TiffEntry* object) {
  154|   426k|  copyObject(object);
  155|   426k|}
_ZN5Exiv28Internal10TiffCopier14visitDataEntryEPNS0_13TiffDataEntryE:
  157|  5.21k|void TiffCopier::visitDataEntry(TiffDataEntry* object) {
  158|  5.21k|  copyObject(object);
  159|  5.21k|}
_ZN5Exiv28Internal10TiffCopier15visitImageEntryEPNS0_14TiffImageEntryE:
  161|  10.2k|void TiffCopier::visitImageEntry(TiffImageEntry* object) {
  162|  10.2k|  copyObject(object);
  163|  10.2k|}
_ZN5Exiv28Internal10TiffCopier14visitSizeEntryEPNS0_13TiffSizeEntryE:
  165|  18.1k|void TiffCopier::visitSizeEntry(TiffSizeEntry* object) {
  166|  18.1k|  copyObject(object);
  167|  18.1k|}
_ZN5Exiv28Internal10TiffCopier14visitDirectoryEPNS0_13TiffDirectoryE:
  169|  19.8k|void TiffCopier::visitDirectory(TiffDirectory* /*object*/) {
  170|       |  // Do not copy directories (avoids problems with SubIfds)
  171|  19.8k|}
_ZN5Exiv28Internal10TiffCopier11visitSubIfdEPNS0_10TiffSubIfdE:
  173|  4.94k|void TiffCopier::visitSubIfd(TiffSubIfd* object) {
  174|  4.94k|  copyObject(object);
  175|  4.94k|}
_ZN5Exiv28Internal10TiffCopier12visitMnEntryEPNS0_11TiffMnEntryE:
  177|  8.59k|void TiffCopier::visitMnEntry(TiffMnEntry* object) {
  178|  8.59k|  copyObject(object);
  179|  8.59k|}
_ZN5Exiv28Internal10TiffCopier17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  181|  2.72k|void TiffCopier::visitIfdMakernote(TiffIfdMakernote* object) {
  182|  2.72k|  copyObject(object);
  183|  2.72k|}
_ZN5Exiv28Internal10TiffCopier16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  185|  6.11k|void TiffCopier::visitBinaryArray(TiffBinaryArray* object) {
  186|  6.11k|  copyObject(object);
  187|  6.11k|}
_ZN5Exiv28Internal10TiffCopier18visitBinaryElementEPNS0_17TiffBinaryElementE:
  189|   836k|void TiffCopier::visitBinaryElement(TiffBinaryElement* object) {
  190|   836k|  copyObject(object);
  191|   836k|}
_ZN5Exiv28Internal11TiffDecoderC2ERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPNS0_13TiffComponentEPFMS1_FvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSF_11char_traitsIcEEEEjNS_5IfdIdEE:
  195|  16.3k|    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|  16.3k|  ExifKey key("Exif.Image.Make");
  199|  16.3k|  if (exifData_.findKey(key) != exifData_.end()) {
  ------------------
  |  Branch (199:7): [True: 301, False: 16.0k]
  ------------------
  200|    301|    make_ = exifData_.findKey(key)->toString();
  201|  16.0k|  } else {
  202|       |    // Find camera make by looking for tag 0x010f in IFD0
  203|  16.0k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  204|  16.0k|    pRoot_->accept(finder);
  205|  16.0k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  206|  16.0k|    if (te && te->pValue()) {
  ------------------
  |  Branch (206:9): [True: 3.23k, False: 12.8k]
  |  Branch (206:15): [True: 3.14k, False: 90]
  ------------------
  207|  3.14k|      make_ = te->pValue()->toString();
  208|  3.14k|    }
  209|  16.0k|  }
  210|  16.3k|}
_ZN5Exiv28Internal11TiffDecoder10visitEntryEPNS0_9TiffEntryE:
  212|  1.92M|void TiffDecoder::visitEntry(TiffEntry* object) {
  213|  1.92M|  decodeTiffEntry(object);
  214|  1.92M|}
_ZN5Exiv28Internal11TiffDecoder14visitDataEntryEPNS0_13TiffDataEntryE:
  216|  6.28k|void TiffDecoder::visitDataEntry(TiffDataEntry* object) {
  217|  6.28k|  decodeTiffEntry(object);
  218|  6.28k|}
_ZN5Exiv28Internal11TiffDecoder15visitImageEntryEPNS0_14TiffImageEntryE:
  220|  36.4k|void TiffDecoder::visitImageEntry(TiffImageEntry* object) {
  221|  36.4k|  decodeTiffEntry(object);
  222|  36.4k|}
_ZN5Exiv28Internal11TiffDecoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  224|  46.1k|void TiffDecoder::visitSizeEntry(TiffSizeEntry* object) {
  225|  46.1k|  decodeTiffEntry(object);
  226|  46.1k|}
_ZN5Exiv28Internal11TiffDecoder14visitDirectoryEPNS0_13TiffDirectoryE:
  228|  73.6k|void TiffDecoder::visitDirectory(TiffDirectory* /* object */) {
  229|       |  // Nothing to do
  230|  73.6k|}
_ZN5Exiv28Internal11TiffDecoder11visitSubIfdEPNS0_10TiffSubIfdE:
  232|  14.8k|void TiffDecoder::visitSubIfd(TiffSubIfd* object) {
  233|  14.8k|  decodeTiffEntry(object);
  234|  14.8k|}
_ZN5Exiv28Internal11TiffDecoder12visitMnEntryEPNS0_11TiffMnEntryE:
  236|  11.1k|void TiffDecoder::visitMnEntry(TiffMnEntry* object) {
  237|       |  // Always decode binary makernote tag
  238|  11.1k|  decodeTiffEntry(object);
  239|  11.1k|}
_ZN5Exiv28Internal11TiffDecoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  241|  4.34k|void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
  242|  4.34k|  exifData_["Exif.MakerNote.Offset"] = static_cast<uint32_t>(object->mnOffset());
  243|  4.34k|  switch (object->byteOrder()) {
  ------------------
  |  Branch (243:11): [True: 4.34k, False: 0]
  ------------------
  244|    825|    case littleEndian:
  ------------------
  |  Branch (244:5): [True: 825, False: 3.52k]
  ------------------
  245|    825|      exifData_["Exif.MakerNote.ByteOrder"] = "II";
  246|    825|      break;
  247|  3.52k|    case bigEndian:
  ------------------
  |  Branch (247:5): [True: 3.52k, False: 825]
  ------------------
  248|  3.52k|      exifData_["Exif.MakerNote.ByteOrder"] = "MM";
  249|  3.52k|      break;
  250|      0|    case invalidByteOrder:
  ------------------
  |  Branch (250:5): [True: 0, False: 4.34k]
  ------------------
  251|      0|      break;
  252|  4.34k|  }
  253|  4.34k|}
_ZN5Exiv28Internal11TiffDecoder10getObjDataERPKhRmtNS_5IfdIdEPKNS0_13TiffEntryBaseE:
  255|  7.41k|void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
  256|  7.41k|  if (object && object->tag() == tag && object->group() == group) {
  ------------------
  |  Branch (256:7): [True: 7.41k, False: 0]
  |  Branch (256:17): [True: 7.09k, False: 318]
  |  Branch (256:41): [True: 7.09k, False: 0]
  ------------------
  257|  7.09k|    pData = object->pData();
  258|  7.09k|    size = object->size();
  259|  7.09k|    return;
  260|  7.09k|  }
  261|    318|  TiffFinder finder(tag, group);
  262|    318|  pRoot_->accept(finder);
  263|    318|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (263:12): [True: 58, False: 260]
  ------------------
  264|     58|    pData = te->pData();
  265|     58|    size = te->size();
  266|     58|    return;
  267|     58|  }
  268|    318|}
_ZN5Exiv28Internal11TiffDecoder9decodeXmpEPKNS0_13TiffEntryBaseE:
  270|  6.36k|void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
  271|       |  // add Exif tag anyway
  272|  6.36k|  decodeStdTiffEntry(object);
  273|       |
  274|  6.36k|  const byte* pData = nullptr;
  275|  6.36k|  size_t size = 0;
  276|  6.36k|  getObjData(pData, size, 0x02bc, IfdId::ifd0Id, object);
  277|  6.36k|  if (pData) {
  ------------------
  |  Branch (277:7): [True: 6.36k, False: 0]
  ------------------
  278|  6.36k|    std::string xmpPacket;
  279|  6.36k|    xmpPacket.assign(reinterpret_cast<const char*>(pData), size);
  280|  6.36k|    std::string::size_type idx = xmpPacket.find_first_of('<');
  281|  6.36k|    if (idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (281:9): [True: 4.81k, False: 1.54k]
  |  Branch (281:37): [True: 4.78k, False: 34]
  ------------------
  282|  4.78k|#ifndef SUPPRESS_WARNINGS
  283|  4.78k|      EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|  4.78k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.78k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.78k|  LogMsg(LogMsg::warn).os()
  ------------------
  284|  4.78k|#endif
  285|  4.78k|      xmpPacket = xmpPacket.substr(idx);
  286|  4.78k|    }
  287|  6.36k|    if (XmpParser::decode(xmpData_, xmpPacket)) {
  ------------------
  |  Branch (287:9): [True: 1.93k, False: 4.43k]
  ------------------
  288|  1.93k|#ifndef SUPPRESS_WARNINGS
  289|  1.93k|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  1.93k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.93k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.93k|  LogMsg(LogMsg::warn).os()
  ------------------
  290|  1.93k|#endif
  291|  1.93k|    }
  292|  6.36k|  }
  293|  6.36k|}  // TiffDecoder::decodeXmp
_ZN5Exiv28Internal11TiffDecoder10decodeIptcEPKNS0_13TiffEntryBaseE:
  295|  1.21k|void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
  296|       |  // add Exif tag anyway
  297|  1.21k|  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.21k|  if (decodedIptc_) {
  ------------------
  |  Branch (301:7): [True: 466, False: 748]
  ------------------
  302|    466|    return;
  303|    466|  }
  304|    748|  decodedIptc_ = true;
  305|       |  // 1st choice: IPTCNAA
  306|    748|  const byte* pData = nullptr;
  307|    748|  size_t size = 0;
  308|    748|  getObjData(pData, size, 0x83bb, IfdId::ifd0Id, object);
  309|    748|  if (pData) {
  ------------------
  |  Branch (309:7): [True: 652, False: 96]
  ------------------
  310|    652|    if (0 == IptcParser::decode(iptcData_, pData, size)) {
  ------------------
  |  Branch (310:9): [True: 410, False: 242]
  ------------------
  311|    410|      return;
  312|    410|    }
  313|    242|#ifndef SUPPRESS_WARNINGS
  314|    242|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x83bb\n";
  ------------------
  |  |  138|    242|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 242]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    242|  LogMsg(LogMsg::warn).os()
  ------------------
  315|       |
  316|    242|#endif
  317|    242|  }
  318|       |
  319|       |  // 2nd choice if no IPTCNAA record found or failed to decode it:
  320|       |  // ImageResources
  321|    338|  pData = nullptr;
  322|    338|  size = 0;
  323|    338|  getObjData(pData, size, 0x8649, IfdId::ifd0Id, object);
  324|    338|  if (pData) {
  ------------------
  |  Branch (324:7): [True: 119, False: 219]
  ------------------
  325|    119|    const byte* record = nullptr;
  326|    119|    uint32_t sizeHdr = 0;
  327|    119|    uint32_t sizeData = 0;
  328|    119|    if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {
  ------------------
  |  Branch (328:9): [True: 97, False: 22]
  ------------------
  329|     97|      return;
  330|     97|    }
  331|     22|    if (0 == IptcParser::decode(iptcData_, record + sizeHdr, sizeData)) {
  ------------------
  |  Branch (331:9): [True: 14, False: 8]
  ------------------
  332|     14|      return;
  333|     14|    }
  334|      8|#ifndef SUPPRESS_WARNINGS
  335|      8|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x8649\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()
  ------------------
  336|       |
  337|      8|#endif
  338|      8|  }
  339|    338|}  // TiffMetadataDecoder::decodeIptc
_ZN5Exiv28Internal11TiffDecoder17decodeCanonAFInfoEPKNS0_13TiffEntryBaseE:
  347|  1.56k|void TiffDecoder::decodeCanonAFInfo(const TiffEntryBase* object) {
  348|       |  // report Exif.Canon.AFInfo as usual
  349|  1.56k|  TiffDecoder::decodeStdTiffEntry(object);
  350|  1.56k|  if (object->pValue()->count() < 3 || object->pValue()->typeId() != unsignedShort)
  ------------------
  |  Branch (350:7): [True: 431, False: 1.13k]
  |  Branch (350:40): [True: 32, False: 1.10k]
  ------------------
  351|    463|    return;  // insufficient data
  352|       |
  353|       |  // create vector of signedShorts from unsignedShorts in Exif.Canon.AFInfo
  354|  1.10k|  std::vector<int16_t> ints;
  355|  1.10k|  std::vector<uint16_t> uint;
  356|  48.0k|  for (size_t i = 0; i < object->pValue()->count(); i++) {
  ------------------
  |  Branch (356:22): [True: 46.9k, False: 1.10k]
  ------------------
  357|  46.9k|    ints.push_back(object->pValue()->toInt64(i));
  358|  46.9k|    uint.push_back(object->pValue()->toUint32(i));
  359|  46.9k|  }
  360|       |  // Check this is AFInfo2 (ints[0] = bytes in object)
  361|  1.10k|  if (ints.front() != static_cast<int16_t>(object->pValue()->count()) * 2)
  ------------------
  |  Branch (361:7): [True: 180, False: 925]
  ------------------
  362|    180|    return;
  363|       |
  364|    925|  std::string familyGroup(std::string("Exif.") + groupName(object->group()) + ".");
  365|       |
  366|    925|  const uint16_t nPoints = uint.at(2);
  367|    925|  const uint16_t nMasks = (nPoints + 15) / (sizeof(uint16_t) * 8);
  368|    925|  int nStart = 0;
  369|       |
  370|    925|  const std::tuple<uint16_t, uint16_t, bool> records[] = {
  371|    925|      {0x2600, 1, true},        // AFInfoSize
  372|    925|      {0x2601, 1, true},        // AFAreaMode
  373|    925|      {0x2602, 1, true},        // AFNumPoints
  374|    925|      {0x2603, 1, true},        // AFValidPoints
  375|    925|      {0x2604, 1, true},        // AFCanonImageWidth
  376|    925|      {0x2605, 1, true},        // AFCanonImageHeight
  377|    925|      {0x2606, 1, true},        // AFImageWidth"
  378|    925|      {0x2607, 1, true},        // AFImageHeight
  379|    925|      {0x2608, nPoints, true},  // AFAreaWidths
  380|    925|      {0x2609, nPoints, true},  // AFAreaHeights
  381|    925|      {0x260a, nPoints, true},  // AFXPositions
  382|    925|      {0x260b, nPoints, true},  // AFYPositions
  383|    925|      {0x260c, nMasks, false},  // AFPointsInFocus
  384|    925|      {0x260d, nMasks, false},  // AFPointsSelected
  385|    925|      {0x260e, nMasks, false},  // AFPointsUnusable
  386|    925|  };
  387|       |  // check we have enough data!
  388|    925|  uint16_t count = 0;
  389|  11.8k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (389:41): [True: 11.8k, False: 431]
  ------------------
  390|  11.8k|    count += size;
  391|  11.8k|    if (count > ints.size())
  ------------------
  |  Branch (391:9): [True: 494, False: 11.3k]
  ------------------
  392|    494|      return;
  393|  11.8k|  }
  394|       |
  395|  6.46k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (395:41): [True: 6.46k, False: 431]
  ------------------
  396|  6.46k|    auto pTags = ExifTags::tagList("Canon");
  397|  6.46k|    if (auto pTag = findTag(pTags, tag)) {
  ------------------
  |  Branch (397:14): [True: 6.46k, False: 0]
  ------------------
  398|  6.46k|      auto v = Exiv2::Value::create(bSigned ? Exiv2::signedShort : Exiv2::unsignedShort);
  ------------------
  |  Branch (398:37): [True: 5.17k, False: 1.29k]
  ------------------
  399|  6.46k|      std::string s;
  400|  6.46k|      if (bSigned) {
  ------------------
  |  Branch (400:11): [True: 5.17k, False: 1.29k]
  ------------------
  401|  14.2k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (401:30): [True: 9.03k, False: 5.17k]
  ------------------
  402|  9.03k|          s += stringFormat(" {}", ints.at(nStart++));
  ------------------
  |  |   18|  9.03k|#define stringFormat std::format
  ------------------
  403|  5.17k|      } else {
  404|  2.05k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (404:30): [True: 762, False: 1.29k]
  ------------------
  405|    762|          s += stringFormat(" {}", uint.at(nStart++));
  ------------------
  |  |   18|    762|#define stringFormat std::format
  ------------------
  406|  1.29k|      }
  407|       |
  408|  6.46k|      v->read(s);
  409|  6.46k|      exifData_[familyGroup + pTag->name_] = *v;
  410|  6.46k|    }
  411|  6.46k|  }
  412|    431|}
_ZN5Exiv28Internal11TiffDecoder15decodeTiffEntryEPKNS0_13TiffEntryBaseE:
  414|  2.95M|void TiffDecoder::decodeTiffEntry(const TiffEntryBase* object) {
  415|       |  // Don't decode the entry if value is not set
  416|  2.95M|  if (!object->pValue())
  ------------------
  |  Branch (416:7): [True: 1.06M, False: 1.88M]
  ------------------
  417|  1.06M|    return;
  418|       |
  419|       |  // skip decoding if decoderFct == 0
  420|  1.88M|  if (auto decoderFct = findDecoderFct_(make_, object->tag(), object->group()))
  ------------------
  |  Branch (420:12): [True: 1.88M, False: 0]
  ------------------
  421|  1.88M|    std::invoke(decoderFct, *this, object);
  422|  1.88M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder18decodeStdTiffEntryEPKNS0_13TiffEntryBaseE:
  424|  1.88M|void TiffDecoder::decodeStdTiffEntry(const TiffEntryBase* object) {
  425|  1.88M|  ExifKey key(object->tag(), groupName(object->group()));
  426|  1.88M|  key.setIdx(object->idx());
  427|  1.88M|  exifData_.add(key, object->pValue());
  428|       |
  429|  1.88M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  431|  8.62k|void TiffDecoder::visitBinaryArray(TiffBinaryArray* object) {
  432|  8.62k|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (432:7): [True: 1.46k, False: 7.16k]
  |  Branch (432:25): [True: 5.13k, False: 2.02k]
  ------------------
  433|  6.59k|    decodeTiffEntry(object);
  434|  6.59k|  }
  435|  8.62k|}
_ZN5Exiv28Internal11TiffDecoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  437|   909k|void TiffDecoder::visitBinaryElement(TiffBinaryElement* object) {
  438|   909k|  decodeTiffEntry(object);
  439|   909k|}
_ZN5Exiv28Internal11TiffEncoderC2ENS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEPNS0_13TiffComponentEbNSt3__16vectorINS_5IfdIdENSB_9allocatorISD_EEEEPKNS0_14TiffHeaderBaseEPFMS1_FvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSB_17basic_string_viewIcNSB_11char_traitsIcEEEEjSD_E:
  444|  21.4k|    exifData_(std::move(exifData)),
  445|  21.4k|    iptcData_(iptcData),
  446|  21.4k|    xmpData_(xmpData),
  447|  21.4k|    pHeader_(pHeader),
  448|  21.4k|    pRoot_(pRoot),
  449|  21.4k|    isNewImage_(isNewImage),
  450|  21.4k|    pPrimaryGroups_(std::move(pPrimaryGroups)),
  451|  21.4k|    byteOrder_(pHeader->byteOrder()),
  452|  21.4k|    origByteOrder_(byteOrder_),
  453|  21.4k|    findEncoderFct_(findEncoderFct) {
  454|  21.4k|  encodeIptc();
  455|  21.4k|  encodeXmp();
  456|       |
  457|       |  // Find camera make
  458|  21.4k|  ExifKey key("Exif.Image.Make");
  459|  21.4k|  if (auto pos = exifData_.findKey(key); pos != exifData_.end()) {
  ------------------
  |  Branch (459:42): [True: 10.3k, False: 11.0k]
  ------------------
  460|  10.3k|    make_ = pos->toString();
  461|  10.3k|  }
  462|  21.4k|  if (make_.empty() && pRoot_) {
  ------------------
  |  Branch (462:7): [True: 11.5k, False: 9.90k]
  |  Branch (462:24): [True: 11.5k, False: 0]
  ------------------
  463|  11.5k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  464|  11.5k|    pRoot_->accept(finder);
  465|  11.5k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  466|  11.5k|    if (te && te->pValue()) {
  ------------------
  |  Branch (466:9): [True: 149, False: 11.3k]
  |  Branch (466:15): [True: 116, False: 33]
  ------------------
  467|    116|      make_ = te->pValue()->toString();
  468|    116|    }
  469|  11.5k|  }
  470|  21.4k|}
_ZN5Exiv28Internal11TiffEncoder10encodeIptcEv:
  472|  21.4k|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|  21.4k|  bool del = false;
  478|  21.4k|  ExifKey iptcNaaKey("Exif.Image.IPTCNAA");
  479|  21.4k|  auto pos = exifData_.findKey(iptcNaaKey);
  480|  21.4k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (480:7): [True: 1.17k, False: 20.2k]
  ------------------
  481|  1.17k|    iptcNaaKey.setIdx(pos->idx());
  482|  1.17k|    exifData_.erase(pos);
  483|  1.17k|    del = true;
  484|  1.17k|  }
  485|  21.4k|  DataBuf rawIptc = IptcParser::encode(iptcData_);
  486|  21.4k|  ExifKey irbKey("Exif.Image.ImageResources");
  487|  21.4k|  pos = exifData_.findKey(irbKey);
  488|  21.4k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (488:7): [True: 687, False: 20.7k]
  ------------------
  489|    687|    irbKey.setIdx(pos->idx());
  490|    687|  }
  491|  21.4k|  if (!rawIptc.empty() && (del || pos == exifData_.end())) {
  ------------------
  |  Branch (491:7): [True: 656, False: 20.7k]
  |  Branch (491:7): [True: 653, False: 20.7k]
  |  Branch (491:28): [True: 653, False: 3]
  |  Branch (491:35): [True: 0, False: 3]
  ------------------
  492|    653|    auto value = Value::create(unsignedLong);
  493|    653|    DataBuf buf;
  494|    653|    if (rawIptc.size() % 4 != 0) {
  ------------------
  |  Branch (494:9): [True: 513, False: 140]
  ------------------
  495|       |      // Pad the last unsignedLong value with 0s
  496|    513|      buf.alloc(((rawIptc.size() / 4) * 4) + 4);
  497|    513|      std::move(rawIptc.begin(), rawIptc.end(), buf.begin());
  498|    513|    } else {
  499|    140|      buf = std::move(rawIptc);  // Note: This resets rawIptc
  500|    140|    }
  501|    653|    value->read(buf.data(), buf.size(), byteOrder_);
  502|    653|    Exifdatum iptcDatum(iptcNaaKey, value.get());
  503|    653|    exifData_.add(iptcDatum);
  504|    653|    pos = exifData_.findKey(irbKey);  // needed after add()
  505|    653|  }
  506|       |  // Also update IPTC IRB in Exif.Image.ImageResources if it exists,
  507|       |  // but don't create it if not.
  508|  21.4k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (508:7): [True: 687, False: 20.7k]
  ------------------
  509|    687|    DataBuf irbBuf(pos->value().size());
  510|    687|    pos->value().copy(irbBuf.data(), invalidByteOrder);
  511|    687|    irbBuf = Photoshop::setIptcIrb(irbBuf.c_data(), irbBuf.size(), iptcData_);
  512|    687|    exifData_.erase(pos);
  513|    687|    if (!irbBuf.empty()) {
  ------------------
  |  Branch (513:9): [True: 254, False: 433]
  ------------------
  514|    254|      auto value = Value::create(unsignedByte);
  515|    254|      value->read(irbBuf.data(), irbBuf.size(), invalidByteOrder);
  516|    254|      Exifdatum iptcDatum(irbKey, value.get());
  517|    254|      exifData_.add(iptcDatum);
  518|    254|    }
  519|    687|  }
  520|  21.4k|}  // TiffEncoder::encodeIptc
_ZN5Exiv28Internal11TiffEncoder9encodeXmpEv:
  522|  21.4k|void TiffEncoder::encodeXmp() {
  523|  21.4k|#ifdef EXV_HAVE_XMP_TOOLKIT
  524|  21.4k|  ExifKey xmpKey("Exif.Image.XMLPacket");
  525|       |  // Remove any existing XMP Exif tag
  526|  21.4k|  if (auto pos = exifData_.findKey(xmpKey); pos != exifData_.end()) {
  ------------------
  |  Branch (526:45): [True: 2.02k, False: 19.3k]
  ------------------
  527|  2.02k|    xmpKey.setIdx(pos->idx());
  528|  2.02k|    exifData_.erase(pos);
  529|  2.02k|  }
  530|  21.4k|  std::string xmpPacket;
  531|  21.4k|  if (xmpData_.usePacket()) {
  ------------------
  |  Branch (531:7): [True: 0, False: 21.4k]
  ------------------
  532|      0|    xmpPacket = xmpData_.xmpPacket();
  533|  21.4k|  } else {
  534|  21.4k|    if (XmpParser::encode(xmpPacket, xmpData_) > 1) {
  ------------------
  |  Branch (534:9): [True: 10, False: 21.3k]
  ------------------
  535|     10|#ifndef SUPPRESS_WARNINGS
  536|     10|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     10|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 10]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     10|  LogMsg(LogMsg::error).os()
  ------------------
  537|     10|#endif
  538|     10|    }
  539|  21.4k|  }
  540|  21.4k|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (540:7): [True: 702, False: 20.7k]
  ------------------
  541|       |    // Set the XMP Exif tag to the new value
  542|    702|    auto value = Value::create(unsignedByte);
  543|    702|    value->read(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size(), invalidByteOrder);
  544|    702|    Exifdatum xmpDatum(xmpKey, value.get());
  545|    702|    exifData_.add(xmpDatum);
  546|    702|  }
  547|  21.4k|#endif
  548|  21.4k|}  // TiffEncoder::encodeXmp
_ZN5Exiv28Internal11TiffEncoder8setDirtyEb:
  550|   973k|void TiffEncoder::setDirty(bool flag) {
  551|   973k|  dirty_ = flag;
  552|   973k|  setGo(geTraverse, !flag);
  553|   973k|}
_ZNK5Exiv28Internal11TiffEncoder5dirtyEv:
  555|  6.09k|bool TiffEncoder::dirty() const {
  556|  6.09k|  return dirty_ || !exifData_.empty();
  ------------------
  |  Branch (556:10): [True: 5.31k, False: 777]
  |  Branch (556:20): [True: 4, False: 773]
  ------------------
  557|  6.09k|}
_ZN5Exiv28Internal11TiffEncoder10visitEntryEPNS0_9TiffEntryE:
  559|  46.5k|void TiffEncoder::visitEntry(TiffEntry* object) {
  560|  46.5k|  encodeTiffComponent(object);
  561|  46.5k|}
_ZN5Exiv28Internal11TiffEncoder14visitDataEntryEPNS0_13TiffDataEntryE:
  563|  1.77k|void TiffEncoder::visitDataEntry(TiffDataEntry* object) {
  564|  1.77k|  encodeTiffComponent(object);
  565|  1.77k|}
_ZN5Exiv28Internal11TiffEncoder15visitImageEntryEPNS0_14TiffImageEntryE:
  567|  2.18k|void TiffEncoder::visitImageEntry(TiffImageEntry* object) {
  568|  2.18k|  encodeTiffComponent(object);
  569|  2.18k|}
_ZN5Exiv28Internal11TiffEncoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  571|  2.86k|void TiffEncoder::visitSizeEntry(TiffSizeEntry* object) {
  572|  2.86k|  encodeTiffComponent(object);
  573|  2.86k|}
_ZN5Exiv28Internal11TiffEncoder14visitDirectoryEPNS0_13TiffDirectoryE:
  575|  12.3k|void TiffEncoder::visitDirectory(TiffDirectory* /*object*/) {
  576|       |  // Nothing to do
  577|  12.3k|}
_ZN5Exiv28Internal11TiffEncoder18visitDirectoryNextEPNS0_13TiffDirectoryE:
  579|  5.98k|void TiffEncoder::visitDirectoryNext(TiffDirectory* object) {
  580|       |  // Update type and count in IFD entries, in case they changed
  581|  5.98k|  byte* p = object->start() + 2;
  582|  20.7k|  for (const auto& component : object->components_) {
  ------------------
  |  Branch (582:30): [True: 20.7k, False: 5.98k]
  ------------------
  583|  20.7k|    p += updateDirEntry(p, byteOrder(), component);
  584|  20.7k|  }
  585|  5.98k|}
_ZN5Exiv28Internal11TiffEncoder14updateDirEntryEPhNS_9ByteOrderERKNSt3__110shared_ptrINS0_13TiffComponentEEE:
  587|  20.7k|uint32_t TiffEncoder::updateDirEntry(byte* buf, ByteOrder byteOrder, const TiffComponent::SharedPtr& tiffComponent) {
  588|  20.7k|  auto pTiffEntry = std::dynamic_pointer_cast<TiffEntryBase>(tiffComponent);
  589|  20.7k|  if (!pTiffEntry)
  ------------------
  |  Branch (589:7): [True: 0, False: 20.7k]
  ------------------
  590|      0|    return 0;
  591|  20.7k|  us2Data(buf + 2, pTiffEntry->tiffType(), byteOrder);
  592|  20.7k|  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|  20.7k|  if (pTiffEntry->size() <= 4 && buf + 8 != pTiffEntry->pData()) {
  ------------------
  |  Branch (594:7): [True: 17.4k, False: 3.29k]
  |  Branch (594:34): [True: 4.13k, False: 13.2k]
  ------------------
  595|       |#ifdef EXIV2_DEBUG_MESSAGES
  596|       |    std::cerr << "Copying data for tag " << pTiffEntry->tag() << " to offset area.\n";
  597|       |#endif
  598|  4.13k|    memset(buf + 8, 0x0, 4);
  599|  4.13k|    if (pTiffEntry->size() > 0) {
  ------------------
  |  Branch (599:9): [True: 80, False: 4.05k]
  ------------------
  600|     80|      std::copy_n(pTiffEntry->pData(), pTiffEntry->size(), buf + 8);
  601|     80|      memset(const_cast<byte*>(pTiffEntry->pData()), 0x0, pTiffEntry->size());
  602|     80|    }
  603|  4.13k|  }
  604|  20.7k|  return 12;
  605|  20.7k|}
_ZN5Exiv28Internal11TiffEncoder11visitSubIfdEPNS0_10TiffSubIfdE:
  607|  1.98k|void TiffEncoder::visitSubIfd(TiffSubIfd* object) {
  608|  1.98k|  encodeTiffComponent(object);
  609|  1.98k|}
_ZN5Exiv28Internal11TiffEncoder12visitMnEntryEPNS0_11TiffMnEntryE:
  611|  1.33k|void TiffEncoder::visitMnEntry(TiffMnEntry* object) {
  612|       |  // Test is required here as well as in the callback encoder function
  613|  1.33k|  if (!object->mn_) {
  ------------------
  |  Branch (613:7): [True: 792, False: 547]
  ------------------
  614|    792|    encodeTiffComponent(object);
  615|    792|  } else if (del_) {
  ------------------
  |  Branch (615:14): [True: 547, False: 0]
  ------------------
  616|       |    // The makernote is made up of decoded tags, delete binary tag
  617|    547|    ExifKey key(object->tag(), groupName(object->group()));
  618|    547|    auto pos = exifData_.findKey(key);
  619|    547|    if (pos != exifData_.end())
  ------------------
  |  Branch (619:9): [True: 534, False: 13]
  ------------------
  620|    534|      exifData_.erase(pos);
  621|    547|  }
  622|  1.33k|}
_ZN5Exiv28Internal11TiffEncoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  624|    547|void TiffEncoder::visitIfdMakernote(TiffIfdMakernote* object) {
  625|    547|  auto pos = exifData_.findKey(ExifKey("Exif.MakerNote.ByteOrder"));
  626|    547|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (626:7): [True: 247, False: 300]
  ------------------
  627|       |    // Set Makernote byte order
  628|    247|    ByteOrder bo = stringToByteOrder(pos->toString());
  629|    247|    if (bo != invalidByteOrder && bo != object->byteOrder()) {
  ------------------
  |  Branch (629:9): [True: 247, False: 0]
  |  Branch (629:35): [True: 4, False: 243]
  ------------------
  630|      4|      object->setByteOrder(bo);
  631|      4|      setDirty();
  632|      4|    }
  633|    247|    if (del_)
  ------------------
  |  Branch (633:9): [True: 247, False: 0]
  ------------------
  634|    247|      exifData_.erase(pos);
  635|    247|  }
  636|    547|  if (del_) {
  ------------------
  |  Branch (636:7): [True: 547, False: 0]
  ------------------
  637|       |    // Remove remaining synthesized tags
  638|    547|    static constexpr auto synthesizedTags = std::array{
  639|    547|        "Exif.MakerNote.Offset",
  640|    547|    };
  641|    547|    for (auto synthesizedTag : synthesizedTags) {
  ------------------
  |  Branch (641:30): [True: 547, False: 547]
  ------------------
  642|    547|      pos = exifData_.findKey(ExifKey(synthesizedTag));
  643|    547|      if (pos != exifData_.end())
  ------------------
  |  Branch (643:11): [True: 247, False: 300]
  ------------------
  644|    247|        exifData_.erase(pos);
  645|    547|    }
  646|    547|  }
  647|       |  // Modify encoder for Makernote peculiarities, byte order
  648|    547|  byteOrder_ = object->byteOrder();
  649|       |
  650|    547|}  // TiffEncoder::visitIfdMakernote
_ZN5Exiv28Internal11TiffEncoder20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
  652|    384|void TiffEncoder::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
  653|       |  // Reset byte order back to that from the c'tor
  654|    384|  byteOrder_ = origByteOrder_;
  655|       |
  656|    384|}  // TiffEncoder::visitIfdMakernoteEnd
_ZN5Exiv28Internal11TiffEncoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  658|    584|void TiffEncoder::visitBinaryArray(TiffBinaryArray* object) {
  659|    584|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (659:7): [True: 119, False: 465]
  |  Branch (659:25): [True: 244, False: 221]
  ------------------
  660|    363|    encodeTiffComponent(object);
  661|    363|  }
  662|    584|}
_ZN5Exiv28Internal11TiffEncoder19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
  664|    576|void TiffEncoder::visitBinaryArrayEnd(TiffBinaryArray* object) {
  665|    576|  if (!object->cfg() || !object->decoded())
  ------------------
  |  Branch (665:7): [True: 118, False: 458]
  |  Branch (665:25): [True: 237, False: 221]
  ------------------
  666|    355|    return;
  667|    221|  size_t size = object->TiffEntryBase::doSize();
  668|    221|  if (size == 0)
  ------------------
  |  Branch (668:7): [True: 0, False: 221]
  ------------------
  669|      0|    return;
  670|    221|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (670:7): [True: 0, False: 221]
  ------------------
  671|      0|    return;
  672|       |
  673|       |  // Re-encrypt buffer if necessary
  674|    221|  CryptFct cryptFct = object->cfg()->cryptFct_;
  675|    221|  if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (675:7): [True: 20, False: 201]
  ------------------
  676|     20|    cryptFct = sonyTagEncipher;
  677|     20|  }
  678|    221|  if (cryptFct) {
  ------------------
  |  Branch (678:7): [True: 70, False: 151]
  ------------------
  679|     70|    const byte* pData = object->pData();
  680|     70|    DataBuf buf = cryptFct(object->tag(), pData, size, pRoot_);
  681|     70|    if (!buf.empty()) {
  ------------------
  |  Branch (681:9): [True: 34, False: 36]
  ------------------
  682|     34|      pData = buf.c_data();
  683|     34|      size = buf.size();
  684|     34|    }
  685|     70|    if (!object->updOrigDataBuf(pData, size)) {
  ------------------
  |  Branch (685:9): [True: 0, False: 70]
  ------------------
  686|      0|      setDirty();
  687|      0|    }
  688|     70|  }
  689|    221|}
_ZN5Exiv28Internal11TiffEncoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  691|  3.28k|void TiffEncoder::visitBinaryElement(TiffBinaryElement* object) {
  692|       |  // Temporarily overwrite byte order according to that of the binary element
  693|  3.28k|  ByteOrder boOrig = byteOrder_;
  694|  3.28k|  if (object->elByteOrder() != invalidByteOrder)
  ------------------
  |  Branch (694:7): [True: 763, False: 2.51k]
  ------------------
  695|    763|    byteOrder_ = object->elByteOrder();
  696|  3.28k|  encodeTiffComponent(object);
  697|  3.28k|  byteOrder_ = boOrig;
  698|  3.28k|}
_ZNK5Exiv28Internal11TiffEncoder10isImageTagEtNS_5IfdIdE:
  700|  5.91M|bool TiffEncoder::isImageTag(uint16_t tag, IfdId group) const {
  701|  5.91M|  return !isNewImage_ && pHeader_->isImageTag(tag, group, pPrimaryGroups_);
  ------------------
  |  Branch (701:10): [True: 2.24M, False: 3.67M]
  |  Branch (701:26): [True: 29.2k, False: 2.21M]
  ------------------
  702|  5.91M|}
_ZN5Exiv28Internal11TiffEncoder19encodeTiffComponentEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  704|  2.97M|void TiffEncoder::encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum) {
  705|  2.97M|  auto pos = exifData_.end();
  706|  2.97M|  const Exifdatum* ed = datum;
  707|  2.97M|  if (!ed) {
  ------------------
  |  Branch (707:7): [True: 59.7k, False: 2.91M]
  ------------------
  708|       |    // Non-intrusive writing: find matching tag
  709|  59.7k|    ExifKey key(object->tag(), groupName(object->group()));
  710|  59.7k|    pos = exifData_.findKey(key);
  711|  59.7k|    if (pos != exifData_.end()) {
  ------------------
  |  Branch (711:9): [True: 54.7k, False: 5.00k]
  ------------------
  712|  54.7k|      ed = &(*pos);
  713|  54.7k|      if (object->idx() != pos->idx()) {
  ------------------
  |  Branch (713:11): [True: 5.78k, False: 48.9k]
  ------------------
  714|       |        // Try to find exact match (in case of duplicate tags)
  715|  5.78k|        auto pos2 = std::find_if(exifData_.begin(), exifData_.end(), FindExifdatum2(object->group(), object->idx()));
  716|  5.78k|        if (pos2 != exifData_.end() && pos2->key() == key.key()) {
  ------------------
  |  Branch (716:13): [True: 151, False: 5.63k]
  |  Branch (716:13): [True: 42, False: 5.74k]
  |  Branch (716:40): [True: 42, False: 109]
  ------------------
  717|     42|          ed = &(*pos2);
  718|     42|          pos = pos2;  // make sure we delete the correct tag below
  719|     42|        }
  720|  5.78k|      }
  721|  54.7k|    } else {
  722|  5.00k|      setDirty();
  723|       |#ifdef EXIV2_DEBUG_MESSAGES
  724|       |      std::cerr << "DELETING          " << key << ", idx = " << object->idx() << "\n";
  725|       |#endif
  726|  5.00k|    }
  727|  2.91M|  } else {
  728|       |    // For intrusive writing, the index is used to preserve the order of
  729|       |    // duplicate tags
  730|  2.91M|    object->idx_ = ed->idx();
  731|  2.91M|  }
  732|       |  // Skip encoding image tags of existing TIFF image - they were copied earlier -
  733|       |  // but encode image tags of new images (creation)
  734|  2.97M|  if (ed && !isImageTag(object->tag(), object->group())) {
  ------------------
  |  Branch (734:7): [True: 2.96M, False: 5.00k]
  |  Branch (734:13): [True: 2.96M, False: 6.42k]
  ------------------
  735|  2.96M|    if (auto fct = findEncoderFct_(make_, object->tag(), object->group())) {
  ------------------
  |  Branch (735:14): [True: 0, False: 2.96M]
  ------------------
  736|       |      // If an encoding function is registered for the tag, use it
  737|      0|      std::invoke(fct, *this, object, ed);
  738|  2.96M|    } 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.96M|      object->encode(*this, ed);
  742|  2.96M|    }
  743|  2.96M|  }
  744|  2.97M|  if (del_ && pos != exifData_.end()) {
  ------------------
  |  Branch (744:7): [True: 59.7k, False: 2.91M]
  |  Branch (744:7): [True: 54.7k, False: 2.91M]
  |  Branch (744:15): [True: 54.7k, False: 5.00k]
  ------------------
  745|  54.7k|    exifData_.erase(pos);
  746|  54.7k|  }
  747|       |#ifdef EXIV2_DEBUG_MESSAGES
  748|       |  std::cerr << "\n";
  749|       |#endif
  750|  2.97M|}  // TiffEncoder::encodeTiffComponent
_ZN5Exiv28Internal11TiffEncoder17encodeBinaryArrayEPNS0_15TiffBinaryArrayEPKNS_9ExifdatumE:
  752|  12.5k|void TiffEncoder::encodeBinaryArray(TiffBinaryArray* object, const Exifdatum* datum) {
  753|  12.5k|  encodeOffsetEntry(object, datum);
  754|  12.5k|}  // TiffEncoder::encodeBinaryArray
_ZN5Exiv28Internal11TiffEncoder19encodeBinaryElementEPNS0_17TiffBinaryElementEPKNS_9ExifdatumE:
  756|  1.53M|void TiffEncoder::encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum) {
  757|  1.53M|  encodeTiffEntryBase(object, datum);
  758|  1.53M|}  // TiffEncoder::encodeArrayElement
_ZN5Exiv28Internal11TiffEncoder15encodeDataEntryEPNS0_13TiffDataEntryEPKNS_9ExifdatumE:
  760|  7.20k|void TiffEncoder::encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum) {
  761|  7.20k|  encodeOffsetEntry(object, datum);
  762|       |
  763|  7.20k|  if (!dirty_ && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (763:7): [True: 1.99k, False: 5.20k]
  |  Branch (763:18): [True: 1.65k, False: 344]
  ------------------
  764|  1.65k|    if (object->sizeDataArea_ < object->pValue()->sizeDataArea()) {
  ------------------
  |  Branch (764:9): [True: 0, False: 1.65k]
  ------------------
  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.65k|    } 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.65k|      DataBuf buf = object->pValue()->dataArea();
  777|  1.65k|      if (!buf.empty()) {
  ------------------
  |  Branch (777:11): [True: 516, False: 1.13k]
  ------------------
  778|    516|        std::copy(buf.begin(), buf.end(), object->pDataArea_);
  779|    516|        if (object->sizeDataArea_ > buf.size()) {
  ------------------
  |  Branch (779:13): [True: 0, False: 516]
  ------------------
  780|      0|          memset(object->pDataArea_ + buf.size(), 0x0, object->sizeDataArea_ - buf.size());
  781|      0|        }
  782|    516|      }
  783|  1.65k|    }
  784|  1.65k|  }
  785|       |
  786|  7.20k|}  // TiffEncoder::encodeDataEntry
_ZN5Exiv28Internal11TiffEncoder15encodeTiffEntryEPNS0_9TiffEntryEPKNS_9ExifdatumE:
  788|  1.34M|void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) {
  789|  1.34M|  encodeTiffEntryBase(object, datum);
  790|  1.34M|}  // TiffEncoder::encodeTiffEntry
_ZN5Exiv28Internal11TiffEncoder16encodeImageEntryEPNS0_14TiffImageEntryEPKNS_9ExifdatumE:
  792|  16.2k|void TiffEncoder::encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum) {
  793|  16.2k|  encodeOffsetEntry(object, datum);
  794|       |
  795|  16.2k|  size_t sizeDataArea = object->pValue()->sizeDataArea();
  796|       |
  797|  16.2k|  if (sizeDataArea > 0 && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (797:7): [True: 251, False: 16.0k]
  |  Branch (797:27): [True: 0, False: 251]
  ------------------
  798|       |#ifdef EXIV2_DEBUG_MESSAGES
  799|       |    std::cerr << "\t DATAAREA IS SET (NON-INTRUSIVE WRITING)";
  800|       |#endif
  801|      0|    setDirty();
  802|      0|  }
  803|       |
  804|  16.2k|  if (sizeDataArea > 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (804:7): [True: 251, False: 16.0k]
  |  Branch (804:27): [True: 251, 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|    251|    ExifKey key(object->szTag(), groupName(object->szGroup()));
  810|    251|    auto pos = exifData_.findKey(key);
  811|    251|    const byte* zero = nullptr;
  812|    251|    if (pos == exifData_.end()) {
  ------------------
  |  Branch (812:9): [True: 0, False: 251]
  ------------------
  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|    251|    } else {
  819|    251|      size_t sizeTotal = 0;
  820|    251|      object->strips_.clear();
  821|  4.56k|      for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (821:26): [True: 4.31k, False: 251]
  ------------------
  822|  4.31k|        uint32_t len = pos->toUint32(i);
  823|  4.31k|        object->strips_.emplace_back(zero, len);
  824|  4.31k|        sizeTotal += len;
  825|  4.31k|      }
  826|    251|      if (sizeTotal != sizeDataArea) {
  ------------------
  |  Branch (826:11): [True: 0, False: 251]
  ------------------
  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|    251|    }
  835|    251|  }
  836|       |
  837|  16.2k|  if (sizeDataArea == 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (837:7): [True: 16.0k, False: 251]
  |  Branch (837:28): [True: 14.8k, False: 1.18k]
  ------------------
  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.8k|    if (pSourceTree_) {
  ------------------
  |  Branch (842:9): [True: 6.14k, False: 8.67k]
  ------------------
  843|  6.14k|      TiffFinder finder(object->tag(), object->group());
  844|  6.14k|      pSourceTree_->accept(finder);
  845|  6.14k|      if (auto ti = dynamic_cast<const TiffImageEntry*>(finder.result())) {
  ------------------
  |  Branch (845:16): [True: 6.14k, False: 7]
  ------------------
  846|  6.14k|        object->strips_ = ti->strips_;
  847|  6.14k|      }
  848|  6.14k|    }
  849|  8.67k|#ifndef SUPPRESS_WARNINGS
  850|  8.67k|    else {
  851|  8.67k|      ExifKey key2(object->tag(), groupName(object->group()));
  852|  8.67k|      EXV_WARNING << "No image data to encode " << key2 << ".\n";
  ------------------
  |  |  138|  8.67k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.67k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.67k|  LogMsg(LogMsg::warn).os()
  ------------------
  853|  8.67k|    }
  854|  14.8k|#endif
  855|  14.8k|  }
  856|       |
  857|  16.2k|}  // TiffEncoder::encodeImageEntry
_ZN5Exiv28Internal11TiffEncoder13encodeMnEntryEPNS0_11TiffMnEntryEPKNS_9ExifdatumE:
  859|  13.7k|void TiffEncoder::encodeMnEntry(TiffMnEntry* object, const Exifdatum* datum) {
  860|       |  // Test is required here as well as in the visit function
  861|  13.7k|  if (!object->mn_)
  ------------------
  |  Branch (861:7): [True: 13.6k, False: 142]
  ------------------
  862|  13.6k|    encodeTiffEntryBase(object, datum);
  863|  13.7k|}  // TiffEncoder::encodeMnEntry
_ZN5Exiv28Internal11TiffEncoder15encodeSizeEntryEPNS0_13TiffSizeEntryEPKNS_9ExifdatumE:
  865|  23.8k|void TiffEncoder::encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum) {
  866|  23.8k|  encodeTiffEntryBase(object, datum);
  867|  23.8k|}  // TiffEncoder::encodeSizeEntry
_ZN5Exiv28Internal11TiffEncoder12encodeSubIfdEPNS0_10TiffSubIfdEPKNS_9ExifdatumE:
  869|  1.90k|void TiffEncoder::encodeSubIfd(TiffSubIfd* object, const Exifdatum* datum) {
  870|  1.90k|  encodeOffsetEntry(object, datum);
  871|  1.90k|}  // TiffEncoder::encodeSubIfd
_ZN5Exiv28Internal11TiffEncoder19encodeTiffEntryBaseEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  873|  2.92M|void TiffEncoder::encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum) {
  874|       |#ifdef EXIV2_DEBUG_MESSAGES
  875|       |  bool tooLarge = false;
  876|       |#endif
  877|  2.92M|  if (datum->size() > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (877:7): [True: 957k, False: 1.96M]
  ------------------
  878|   957k|    setDirty();
  879|       |#ifdef EXIV2_DEBUG_MESSAGES
  880|       |    tooLarge = true;
  881|       |#endif
  882|   957k|  }
  883|  2.92M|  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.92M|}
_ZN5Exiv28Internal11TiffEncoder17encodeOffsetEntryEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  893|  37.9k|void TiffEncoder::encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum) {
  894|  37.9k|  size_t newSize = datum->size();
  895|  37.9k|  if (newSize > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (895:7): [True: 11.0k, False: 26.8k]
  ------------------
  896|  11.0k|    setDirty();
  897|  11.0k|    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|  26.8k|  } else {
  904|  26.8k|    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|  26.8k|  }
  911|  37.9k|}
_ZN5Exiv28Internal11TiffEncoder3addEPNS0_13TiffComponentENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEEj:
  913|  15.3k|void TiffEncoder::add(TiffComponent* pRootDir, TiffComponent::UniquePtr pSourceDir, uint32_t root) {
  914|  15.3k|  writeMethod_ = wmIntrusive;
  915|  15.3k|  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|  15.3k|  del_ = false;
  920|       |
  921|  15.3k|  auto posBo = exifData_.end();
  922|  2.98M|  for (auto i = exifData_.begin(); i != exifData_.end(); ++i) {
  ------------------
  |  Branch (922:36): [True: 2.96M, False: 15.3k]
  ------------------
  923|  2.96M|    IfdId group = groupId(i->groupName());
  924|       |    // Skip synthesized info tags
  925|  2.96M|    if (group == IfdId::mnId) {
  ------------------
  |  Branch (925:9): [True: 13.8k, False: 2.95M]
  ------------------
  926|  13.8k|      if (i->tag() == 0x0002) {
  ------------------
  |  Branch (926:11): [True: 6.90k, False: 6.90k]
  ------------------
  927|  6.90k|        posBo = i;
  928|  6.90k|      }
  929|  13.8k|      continue;
  930|  13.8k|    }
  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.95M|    if (isImageTag(i->tag(), group))
  ------------------
  |  Branch (934:9): [True: 22.8k, False: 2.92M]
  ------------------
  935|  22.8k|      continue;
  936|       |
  937|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  938|  2.92M|    auto tiffPath = TiffCreator::getPath(i->tag(), group, root);
  939|  2.92M|    TiffComponent* tc = pRootDir->addPath(i->tag(), tiffPath, pRootDir);
  940|  2.92M|    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.92M|    if (object) {
  ------------------
  |  Branch (947:9): [True: 2.91M, False: 17.7k]
  ------------------
  948|  2.91M|      encodeTiffComponent(object, &(*i));
  949|  2.91M|    }
  950|  2.92M|  }
  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|  15.3k|  if (posBo == exifData_.end())
  ------------------
  |  Branch (959:7): [True: 8.40k, False: 6.90k]
  ------------------
  960|  8.40k|    return;
  961|       |
  962|  6.90k|  TiffFinder finder(0x927c, IfdId::exifId);
  963|  6.90k|  pRootDir->accept(finder);
  964|  6.90k|  if (auto te = dynamic_cast<const TiffMnEntry*>(finder.result())) {
  ------------------
  |  Branch (964:12): [True: 6.74k, False: 164]
  ------------------
  965|  6.74k|    if (const auto& mn = te->mn_) {
  ------------------
  |  Branch (965:21): [True: 6.71k, False: 27]
  ------------------
  966|       |      // Set Makernote byte order
  967|  6.71k|      ByteOrder bo = stringToByteOrder(posBo->toString());
  968|  6.71k|      if (bo != invalidByteOrder)
  ------------------
  |  Branch (968:11): [True: 6.71k, False: 0]
  ------------------
  969|  6.71k|        mn->setByteOrder(bo);
  970|  6.71k|    }
  971|  6.74k|  }
  972|       |
  973|  6.90k|}  // TiffEncoder::add
_ZN5Exiv28Internal10TiffReaderC2EPKhmPNS0_13TiffComponentENS0_11TiffRwStateE:
  976|  22.4k|    pData_(pData), size_(size), pLast_(pData + size), pRoot_(pRoot), origState_(state), mnState_(state) {
  977|  22.4k|  pState_ = &origState_;
  978|       |
  979|  22.4k|}  // TiffReader::TiffReader
_ZN5Exiv28Internal10TiffReader12setOrigStateEv:
  981|  29.7k|void TiffReader::setOrigState() {
  982|  29.7k|  pState_ = &origState_;
  983|  29.7k|}
_ZN5Exiv28Internal10TiffReader10setMnStateEPKNS0_11TiffRwStateE:
  985|  29.7k|void TiffReader::setMnState(const TiffRwState* state) {
  986|  29.7k|  if (state) {
  ------------------
  |  Branch (986:7): [True: 7.30k, False: 22.4k]
  ------------------
  987|       |    // invalidByteOrder indicates 'no change'
  988|  7.30k|    if (state->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (988:9): [True: 0, False: 7.30k]
  ------------------
  989|      0|      mnState_ = TiffRwState{origState_.byteOrder(), state->baseOffset()};
  990|  7.30k|    } else {
  991|  7.30k|      mnState_ = *state;
  992|  7.30k|    }
  993|  7.30k|  }
  994|  29.7k|  pState_ = &mnState_;
  995|  29.7k|}
_ZNK5Exiv28Internal10TiffReader9byteOrderEv:
  997|  10.6M|ByteOrder TiffReader::byteOrder() const {
  998|  10.6M|  return pState_->byteOrder();
  999|  10.6M|}
_ZNK5Exiv28Internal10TiffReader10baseOffsetEv:
 1001|  1.64M|size_t TiffReader::baseOffset() const {
 1002|  1.64M|  return pState_->baseOffset();
 1003|  1.64M|}
_ZN5Exiv28Internal10TiffReader17readDataEntryBaseEPNS0_17TiffDataEntryBaseE:
 1005|  58.9k|void TiffReader::readDataEntryBase(TiffDataEntryBase* object) {
 1006|  58.9k|  readTiffEntry(object);
 1007|  58.9k|  TiffFinder finder(object->szTag(), object->szGroup());
 1008|  58.9k|  pRoot_->accept(finder);
 1009|  58.9k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1010|  58.9k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1010:7): [True: 43.2k, False: 15.7k]
  |  Branch (1010:13): [True: 27.0k, False: 16.1k]
  ------------------
 1011|  27.0k|    object->setStrips(te->pValue(), pData_, size_, baseOffset());
 1012|  27.0k|  }
 1013|  58.9k|}
_ZN5Exiv28Internal10TiffReader10visitEntryEPNS0_9TiffEntryE:
 1015|  2.36M|void TiffReader::visitEntry(TiffEntry* object) {
 1016|  2.36M|  readTiffEntry(object);
 1017|  2.36M|}
_ZN5Exiv28Internal10TiffReader14visitDataEntryEPNS0_13TiffDataEntryE:
 1019|  11.9k|void TiffReader::visitDataEntry(TiffDataEntry* object) {
 1020|  11.9k|  readDataEntryBase(object);
 1021|  11.9k|}
_ZN5Exiv28Internal10TiffReader15visitImageEntryEPNS0_14TiffImageEntryE:
 1023|  47.0k|void TiffReader::visitImageEntry(TiffImageEntry* object) {
 1024|  47.0k|  readDataEntryBase(object);
 1025|  47.0k|}
_ZN5Exiv28Internal10TiffReader14visitSizeEntryEPNS0_13TiffSizeEntryE:
 1027|  65.0k|void TiffReader::visitSizeEntry(TiffSizeEntry* object) {
 1028|  65.0k|  readTiffEntry(object);
 1029|  65.0k|  TiffFinder finder(object->dtTag(), object->dtGroup());
 1030|  65.0k|  pRoot_->accept(finder);
 1031|  65.0k|  auto te = dynamic_cast<TiffDataEntryBase*>(finder.result());
 1032|  65.0k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1032:7): [True: 40.0k, False: 24.9k]
  |  Branch (1032:13): [True: 30.6k, False: 9.39k]
  ------------------
 1033|  30.6k|    te->setStrips(object->pValue(), pData_, size_, baseOffset());
 1034|  30.6k|  }
 1035|  65.0k|}
_ZN5Exiv28Internal10TiffReader17circularReferenceEPKhNS_5IfdIdE:
 1037|  95.7k|bool TiffReader::circularReference(const byte* start, IfdId group) {
 1038|  95.7k|  if (auto pos = dirList_.find(start); pos != dirList_.end()) {
  ------------------
  |  Branch (1038:40): [True: 13.1k, False: 82.6k]
  ------------------
 1039|  13.1k|#ifndef SUPPRESS_WARNINGS
 1040|  13.1k|    EXV_ERROR << groupName(group) << " pointer references previously read " << groupName(pos->second)
  ------------------
  |  |  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()
  ------------------
 1041|      0|              << " directory; ignored.\n";
 1042|  13.1k|#endif
 1043|  13.1k|    return true;
 1044|  13.1k|  }
 1045|  82.6k|  dirList_[start] = group;
 1046|  82.6k|  return false;
 1047|  95.7k|}
_ZN5Exiv28Internal10TiffReader7nextIdxENS_5IfdIdE:
 1049|  3.00M|int TiffReader::nextIdx(IfdId group) {
 1050|  3.00M|  return ++idxSeq_[group];
 1051|  3.00M|}
_ZN5Exiv28Internal10TiffReader11postProcessEv:
 1053|  22.4k|void TiffReader::postProcess() {
 1054|  22.4k|  setMnState();  // All components to be post-processed must be from the Makernote
 1055|  22.4k|  postProc_ = true;
 1056|  22.4k|  for (auto pos : postList_) {
  ------------------
  |  Branch (1056:17): [True: 14.8k, False: 22.4k]
  ------------------
 1057|  14.8k|    pos->accept(*this);
 1058|  14.8k|  }
 1059|  22.4k|  postProc_ = false;
 1060|  22.4k|  setOrigState();
 1061|  22.4k|}
_ZN5Exiv28Internal10TiffReader14visitDirectoryEPNS0_13TiffDirectoryE:
 1063|  95.7k|void TiffReader::visitDirectory(TiffDirectory* object) {
 1064|  95.7k|  const byte* p = object->start();
 1065|       |
 1066|  95.7k|  if (circularReference(object->start(), object->group()))
  ------------------
  |  Branch (1066:7): [True: 13.1k, False: 82.6k]
  ------------------
 1067|  13.1k|    return;
 1068|       |
 1069|  82.6k|  if (p + 2 > pLast_) {
  ------------------
  |  Branch (1069:7): [True: 130, False: 82.5k]
  ------------------
 1070|    130|#ifndef SUPPRESS_WARNINGS
 1071|    130|    EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD exceeds data buffer, cannot read entry count.\n";
  ------------------
  |  |  142|    130|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 130]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    130|  LogMsg(LogMsg::error).os()
  ------------------
 1072|    130|#endif
 1073|    130|    return;
 1074|    130|  }
 1075|  82.5k|  const uint16_t n = getUShort(p, byteOrder());
 1076|  82.5k|  p += 2;
 1077|       |  // Sanity check with an "unreasonably" large number
 1078|  82.5k|  if (n > 256) {
  ------------------
  |  Branch (1078:7): [True: 16.0k, False: 66.4k]
  ------------------
 1079|  16.0k|#ifndef SUPPRESS_WARNINGS
 1080|  16.0k|    EXV_ERROR << "Directory " << groupName(object->group()) << " with " << n
  ------------------
  |  |  142|  16.0k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 16.0k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  16.0k|  LogMsg(LogMsg::error).os()
  ------------------
 1081|      0|              << " entries considered invalid; not read.\n";
 1082|  16.0k|#endif
 1083|  16.0k|    return;
 1084|  16.0k|  }
 1085|  2.72M|  for (uint16_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (1085:24): [True: 2.70M, False: 25.0k]
  ------------------
 1086|  2.70M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1086:9): [True: 41.4k, False: 2.65M]
  ------------------
 1087|  41.4k|#ifndef SUPPRESS_WARNINGS
 1088|  41.4k|      EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD entry " << i
  ------------------
  |  |  142|  41.4k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 41.4k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  41.4k|  LogMsg(LogMsg::error).os()
  ------------------
 1089|      0|                << " lies outside of the data buffer.\n";
 1090|  41.4k|#endif
 1091|  41.4k|      return;
 1092|  41.4k|    }
 1093|  2.65M|    uint16_t tag = getUShort(p, byteOrder());
 1094|  2.65M|    if (auto tc = TiffCreator::create(tag, object->group())) {
  ------------------
  |  Branch (1094:14): [True: 2.57M, False: 85.1k]
  ------------------
 1095|  2.57M|      tc->setStart(p);
 1096|  2.57M|      object->addChild(std::move(tc));
 1097|  2.57M|    } else {
 1098|  85.1k|#ifndef SUPPRESS_WARNINGS
 1099|  85.1k|      EXV_WARNING << "Unable to handle tag " << tag << ".\n";
  ------------------
  |  |  138|  85.1k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 85.1k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  85.1k|  LogMsg(LogMsg::warn).os()
  ------------------
 1100|  85.1k|#endif
 1101|  85.1k|    }
 1102|  2.65M|    p += 12;
 1103|  2.65M|  }
 1104|       |
 1105|  25.0k|  if (object->hasNext()) {
  ------------------
  |  Branch (1105:7): [True: 24.9k, False: 51]
  ------------------
 1106|  24.9k|    if (p + 4 > pLast_) {
  ------------------
  |  Branch (1106:9): [True: 236, False: 24.7k]
  ------------------
 1107|    236|#ifndef SUPPRESS_WARNINGS
 1108|    236|      EXV_ERROR << "Directory " << groupName(object->group())
  ------------------
  |  |  142|    236|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 236]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    236|  LogMsg(LogMsg::error).os()
  ------------------
 1109|      0|                << ": IFD exceeds data buffer, cannot read next pointer.\n";
 1110|    236|#endif
 1111|    236|      return;
 1112|    236|    }
 1113|  24.7k|    TiffComponent::UniquePtr tc;
 1114|  24.7k|    uint32_t next = getULong(p, byteOrder());
 1115|  24.7k|    if (next) {
  ------------------
  |  Branch (1115:9): [True: 21.7k, False: 2.95k]
  ------------------
 1116|  21.7k|      tc = TiffCreator::create(Tag::next, object->group());
 1117|  21.7k|#ifndef SUPPRESS_WARNINGS
 1118|  21.7k|      if (!tc) {
  ------------------
  |  Branch (1118:11): [True: 16.1k, False: 5.63k]
  ------------------
 1119|  16.1k|        EXV_WARNING << "Directory " << groupName(object->group()) << " has an unexpected next pointer; ignored.\n";
  ------------------
  |  |  138|  16.1k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 16.1k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  16.1k|  LogMsg(LogMsg::warn).os()
  ------------------
 1120|  16.1k|      }
 1121|  21.7k|#endif
 1122|  21.7k|    }
 1123|  24.7k|    if (tc) {
  ------------------
  |  Branch (1123:9): [True: 5.63k, False: 19.1k]
  ------------------
 1124|  5.63k|      if (baseOffset() + next > size_) {
  ------------------
  |  Branch (1124:11): [True: 3.27k, False: 2.35k]
  ------------------
 1125|  3.27k|#ifndef SUPPRESS_WARNINGS
 1126|  3.27k|        EXV_ERROR << "Directory " << groupName(object->group()) << ": Next pointer is out of bounds; ignored.\n";
  ------------------
  |  |  142|  3.27k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.27k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.27k|  LogMsg(LogMsg::error).os()
  ------------------
 1127|  3.27k|#endif
 1128|  3.27k|        return;
 1129|  3.27k|      }
 1130|  2.35k|      tc->setStart(pData_ + baseOffset() + next);
 1131|  2.35k|      object->addNext(std::move(tc));
 1132|  2.35k|    }
 1133|  24.7k|  }  // object->hasNext()
 1134|       |
 1135|  25.0k|}  // TiffReader::visitDirectory
_ZN5Exiv28Internal10TiffReader11visitSubIfdEPNS0_10TiffSubIfdE:
 1137|  20.2k|void TiffReader::visitSubIfd(TiffSubIfd* object) {
 1138|  20.2k|  readTiffEntry(object);
 1139|  20.2k|  if ((object->tiffType() == ttUnsignedLong || object->tiffType() == ttSignedLong || object->tiffType() == ttTiffIfd) &&
  ------------------
  |  Branch (1139:8): [True: 11.5k, False: 8.70k]
  |  Branch (1139:48): [True: 3.42k, False: 5.28k]
  |  Branch (1139:86): [True: 3.38k, False: 1.89k]
  ------------------
 1140|  18.3k|      object->count() >= 1) {
  ------------------
  |  Branch (1140:7): [True: 12.5k, False: 5.81k]
  ------------------
 1141|       |    // Todo: Fix hack
 1142|  12.5k|    uint32_t maxi = 9;
 1143|  12.5k|    if (object->group() == IfdId::ifd1Id)
  ------------------
  |  Branch (1143:9): [True: 128, False: 12.4k]
  ------------------
 1144|    128|      maxi = 1;
 1145|  76.3k|    for (uint32_t i = 0; i < object->count(); ++i) {
  ------------------
  |  Branch (1145:26): [True: 74.3k, False: 1.96k]
  ------------------
 1146|  74.3k|      uint32_t offset = getULong(object->pData() + (4 * i), byteOrder());
 1147|  74.3k|      if (baseOffset() + offset > size_) {
  ------------------
  |  Branch (1147:11): [True: 10.2k, False: 64.0k]
  ------------------
 1148|  10.2k|#ifndef SUPPRESS_WARNINGS
 1149|  10.2k|        EXV_ERROR << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  142|  10.2k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 10.2k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  10.2k|  LogMsg(LogMsg::error).os()
  ------------------
 1150|      0|                  << std::hex << object->tag() << " Sub-IFD pointer " << i << " is out of bounds; ignoring it.\n";
 1151|  10.2k|#endif
 1152|  10.2k|        return;
 1153|  10.2k|      }
 1154|  64.0k|      if (i >= maxi) {
  ------------------
  |  Branch (1154:11): [True: 294, False: 63.7k]
  ------------------
 1155|    294|#ifndef SUPPRESS_WARNINGS
 1156|    294|        EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|    294|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 294]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    294|  LogMsg(LogMsg::warn).os()
  ------------------
 1157|      0|                    << std::hex << object->tag() << ": Skipping sub-IFDs beyond the first " << i << ".\n";
 1158|    294|#endif
 1159|    294|        break;
 1160|    294|      }
 1161|       |      // If there are multiple dirs, group is incremented for each
 1162|  63.7k|      auto td = std::make_unique<TiffDirectory>(object->tag(),
 1163|  63.7k|                                                static_cast<IfdId>(static_cast<uint32_t>(object->newGroup_) + i));
 1164|  63.7k|      td->setStart(pData_ + baseOffset() + offset);
 1165|  63.7k|      object->addChild(std::move(td));
 1166|  63.7k|    }
 1167|  12.5k|  }
 1168|  7.70k|#ifndef SUPPRESS_WARNINGS
 1169|  7.70k|  else {
 1170|  7.70k|    EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|  7.70k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.70k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.70k|  LogMsg(LogMsg::warn).os()
  ------------------
 1171|      0|                << std::hex << object->tag() << " doesn't look like a sub-IFD.\n";
 1172|  7.70k|  }
 1173|  20.2k|#endif
 1174|       |
 1175|  20.2k|}  // TiffReader::visitSubIfd
_ZN5Exiv28Internal10TiffReader12visitMnEntryEPNS0_11TiffMnEntryE:
 1177|  20.1k|void TiffReader::visitMnEntry(TiffMnEntry* object) {
 1178|  20.1k|  readTiffEntry(object);
 1179|       |  // Find camera make
 1180|  20.1k|  TiffFinder finder(0x010f, IfdId::ifd0Id);
 1181|  20.1k|  pRoot_->accept(finder);
 1182|  20.1k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1183|  20.1k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1183:7): [True: 19.6k, False: 540]
  |  Branch (1183:13): [True: 19.0k, False: 583]
  ------------------
 1184|  19.0k|    auto make = te->pValue()->toString();
 1185|       |    // create concrete makernote, based on make and makernote contents
 1186|  19.0k|    object->mn_ =
 1187|  19.0k|        TiffMnCreator::create(object->tag(), object->mnGroup_, make, object->pData_, object->size_, byteOrder());
 1188|  19.0k|  }
 1189|  20.1k|  if (object->mn_)
  ------------------
  |  Branch (1189:7): [True: 8.31k, False: 11.8k]
  ------------------
 1190|  8.31k|    object->mn_->setStart(object->pData());
 1191|       |
 1192|  20.1k|}  // TiffReader::visitMnEntry
_ZN5Exiv28Internal10TiffReader17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
 1194|  8.31k|void TiffReader::visitIfdMakernote(TiffIfdMakernote* object) {
 1195|  8.31k|  object->setImageByteOrder(byteOrder());  // set the byte order for the image
 1196|       |
 1197|  8.31k|  if (!object->readHeader(object->start(), pLast_ - object->start(), byteOrder())) {
  ------------------
  |  Branch (1197:7): [True: 1.00k, False: 7.30k]
  ------------------
 1198|  1.00k|#ifndef SUPPRESS_WARNINGS
 1199|  1.00k|    EXV_ERROR << "Failed to read " << groupName(object->ifd_.group()) << " IFD Makernote header.\n";
  ------------------
  |  |  142|  1.00k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.00k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.00k|  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|  1.00k|#endif  // SUPPRESS_WARNINGS
 1206|  1.00k|    setGo(geKnownMakernote, false);
 1207|  1.00k|    return;
 1208|  1.00k|  }
 1209|       |
 1210|  7.30k|  object->ifd_.setStart(object->start() + object->ifdOffset());
 1211|       |
 1212|       |  // Modify reader for Makernote peculiarities, byte order and offset
 1213|  7.30k|  object->mnOffset_ = object->start() - pData_;
 1214|  7.30k|  auto state = TiffRwState{object->byteOrder(), object->baseOffset()};
 1215|  7.30k|  setMnState(&state);
 1216|       |
 1217|  7.30k|}  // TiffReader::visitIfdMakernote
_ZN5Exiv28Internal10TiffReader20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
 1219|  7.28k|void TiffReader::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
 1220|       |  // Reset state (byte order, create function, offset) back to that for the image
 1221|  7.28k|  setOrigState();
 1222|  7.28k|}  // TiffReader::visitIfdMakernoteEnd
_ZN5Exiv28Internal10TiffReader13readTiffEntryEPNS0_13TiffEntryBaseE:
 1224|  2.53M|void TiffReader::readTiffEntry(TiffEntryBase* object) {
 1225|  2.53M|  try {
 1226|  2.53M|    byte* p = object->start();
 1227|       |
 1228|  2.53M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1228:9): [True: 2, False: 2.53M]
  ------------------
 1229|      2|#ifndef SUPPRESS_WARNINGS
 1230|      2|      EXV_ERROR << "Entry in directory " << groupName(object->group())
  ------------------
  |  |  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()
  ------------------
 1231|      0|                << "requests access to memory beyond the data buffer. " << "Skipping entry.\n";
 1232|      2|#endif
 1233|      2|      return;
 1234|      2|    }
 1235|       |    // Component already has tag
 1236|  2.53M|    p += 2;
 1237|  2.53M|    auto tiffType = static_cast<TiffType>(getUShort(p, byteOrder()));
 1238|  2.53M|    TypeId typeId = toTypeId(tiffType, object->tag(), object->group());
 1239|  2.53M|    size_t typeSize = TypeInfo::typeSize(typeId);
 1240|  2.53M|    if (0 == typeSize) {
  ------------------
  |  Branch (1240:9): [True: 2.26M, False: 272k]
  ------------------
 1241|  2.26M|#ifndef SUPPRESS_WARNINGS
 1242|  2.26M|      EXV_WARNING << stringFormat(
  ------------------
  |  |  138|  2.26M|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.26M]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.26M|  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|  2.26M|#endif
 1246|  2.26M|      typeSize = 1;
 1247|  2.26M|    }
 1248|  2.53M|    p += 2;
 1249|  2.53M|    uint32_t count = getULong(p, byteOrder());
 1250|  2.53M|    if (count >= 0x10000000) {
  ------------------
  |  Branch (1250:9): [True: 1.27M, False: 1.26M]
  ------------------
 1251|  1.27M|#ifndef SUPPRESS_WARNINGS
 1252|  1.27M|      EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |  142|  1.27M|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.27M]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.27M|  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.27M|#endif
 1255|  1.27M|      return;
 1256|  1.27M|    }
 1257|  1.26M|    p += 4;
 1258|       |
 1259|  1.26M|    if (count > std::numeric_limits<size_t>::max() / typeSize) {
  ------------------
  |  Branch (1259:9): [True: 0, False: 1.26M]
  ------------------
 1260|      0|      throw Error(ErrorCode::kerArithmeticOverflow);
 1261|      0|    }
 1262|  1.26M|    size_t size = typeSize * count;
 1263|  1.26M|    size_t offset = getULong(p, byteOrder());
 1264|  1.26M|    byte* pData = p;
 1265|  1.26M|    if (size > 4 && Safe::add<size_t>(baseOffset(), offset) >= size_) {
  ------------------
  |  Branch (1265:9): [True: 966k, False: 296k]
  |  Branch (1265:21): [True: 730k, False: 236k]
  ------------------
 1266|       |      // #1143
 1267|   730k|      if (object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1") {
  ------------------
  |  Branch (1267:11): [True: 841, False: 729k]
  |  Branch (1267:11): [True: 92, False: 730k]
  |  Branch (1267:38): [True: 92, False: 749]
  ------------------
 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|     92|        typeId = undefined;
 1280|     92|        size = 0;
 1281|   730k|      } else {
 1282|   730k|#ifndef SUPPRESS_WARNINGS
 1283|   730k|        EXV_ERROR << "Offset of directory " << groupName(object->group()) << ", entry 0x" << std::setw(4)
  ------------------
  |  |  142|   730k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 730k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   730k|  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|   730k|#endif
 1287|   730k|      }
 1288|   730k|      size = 0;
 1289|   730k|    }
 1290|  1.26M|    if (size > 4) {
  ------------------
  |  Branch (1290:9): [True: 236k, False: 1.02M]
  ------------------
 1291|       |      // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
 1292|       |      // as offset can be arbitrarily large
 1293|   236k|      if (Safe::add<size_t>(baseOffset(), offset) > static_cast<size_t>(pLast_ - pData_)) {
  ------------------
  |  Branch (1293:11): [True: 0, False: 236k]
  ------------------
 1294|      0|        throw Error(ErrorCode::kerCorruptedMetadata);
 1295|      0|      }
 1296|   236k|      pData = const_cast<byte*>(pData_) + baseOffset() + offset;
 1297|       |
 1298|       |      // check for size being invalid
 1299|   236k|      if (size > static_cast<size_t>(pLast_ - pData)) {
  ------------------
  |  Branch (1299:11): [True: 111k, False: 124k]
  ------------------
 1300|   111k|#ifndef SUPPRESS_WARNINGS
 1301|   111k|        EXV_ERROR << "Upper boundary of data for " << "directory " << groupName(object->group()) << ", entry 0x"
  ------------------
  |  |  142|   111k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 111k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   111k|  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|   111k|#endif
 1309|   111k|        size = 0;
 1310|   111k|      }
 1311|   236k|    }
 1312|  1.26M|    auto v = Value::create(typeId);
 1313|  1.26M|    enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1314|  1.26M|    v->read(pData, size, byteOrder());
 1315|       |
 1316|  1.26M|    object->setValue(std::move(v));
 1317|  1.26M|    auto d = std::make_shared<DataBuf>();
 1318|  1.26M|    object->setData(pData, size, std::move(d));
 1319|  1.26M|    object->setOffset(offset);
 1320|  1.26M|    object->setIdx(nextIdx(object->group()));
 1321|  1.26M|  } catch (std::overflow_error&) {
 1322|      0|    throw Error(ErrorCode::kerCorruptedMetadata);  // #562 don't throw std::overflow_error
 1323|      0|  }
 1324|  2.53M|}  // TiffReader::readTiffEntry
_ZN5Exiv28Internal10TiffReader16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
 1326|  29.6k|void TiffReader::visitBinaryArray(TiffBinaryArray* object) {
 1327|  29.6k|  if (!postProc_) {
  ------------------
  |  Branch (1327:7): [True: 14.8k, False: 14.8k]
  ------------------
 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|  14.8k|    readTiffEntry(object);
 1331|  14.8k|    object->iniOrigDataBuf();
 1332|  14.8k|    postList_.push_back(object);
 1333|  14.8k|    return;
 1334|  14.8k|  }
 1335|       |  // Check duplicates
 1336|  14.8k|  TiffFinder finder(object->tag(), object->group());
 1337|  14.8k|  pRoot_->accept(finder);
 1338|  14.8k|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (1338:12): [True: 13.5k, False: 1.23k]
  ------------------
 1339|  13.5k|    if (te->idx() != object->idx()) {
  ------------------
  |  Branch (1339:9): [True: 6.60k, False: 6.97k]
  ------------------
 1340|  6.60k|#ifndef SUPPRESS_WARNINGS
 1341|  6.60k|      EXV_WARNING << "Not decoding duplicate binary array tag 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  6.60k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.60k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.60k|  LogMsg(LogMsg::warn).os()
  ------------------
 1342|      0|                  << object->tag() << std::dec << ", group " << groupName(object->group()) << ", idx " << object->idx()
 1343|      0|                  << "\n";
 1344|  6.60k|#endif
 1345|  6.60k|      object->setDecoded(false);
 1346|  6.60k|      return;
 1347|  6.60k|    }
 1348|  13.5k|  }
 1349|       |
 1350|  8.20k|  if (object->TiffEntryBase::doSize() == 0)
  ------------------
  |  Branch (1350:7): [True: 4.20k, False: 4.00k]
  ------------------
 1351|  4.20k|    return;
 1352|  4.00k|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (1352:7): [True: 695, False: 3.30k]
  ------------------
 1353|    695|    return;
 1354|  3.30k|  const ArrayCfg* cfg = object->cfg();
 1355|  3.30k|  if (!cfg)
  ------------------
  |  Branch (1355:7): [True: 0, False: 3.30k]
  ------------------
 1356|      0|    return;
 1357|       |
 1358|  3.30k|  if (auto cryptFct = cfg->cryptFct_) {
  ------------------
  |  Branch (1358:12): [True: 1.02k, False: 2.28k]
  ------------------
 1359|  1.02k|    const byte* pData = object->pData();
 1360|  1.02k|    size_t size = object->TiffEntryBase::doSize();
 1361|  1.02k|    auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
 1362|  1.02k|    if (!buf->empty())
  ------------------
  |  Branch (1362:9): [True: 688, False: 333]
  ------------------
 1363|    688|      object->setData(std::move(buf));
 1364|  1.02k|  }
 1365|       |
 1366|  3.30k|  const ArrayDef* defs = object->def();
 1367|  3.30k|  const ArrayDef* defsEnd = defs + object->defSize();
 1368|  3.30k|  const ArrayDef* def = &cfg->elDefaultDef_;
 1369|  3.30k|  ArrayDef gap = *def;
 1370|       |
 1371|  1.71M|  for (size_t idx = 0; idx < object->TiffEntryBase::doSize();) {
  ------------------
  |  Branch (1371:24): [True: 1.71M, False: 3.30k]
  ------------------
 1372|  1.71M|    if (defs) {
  ------------------
  |  Branch (1372:9): [True: 1.69M, False: 19.4k]
  ------------------
 1373|  1.69M|      def = std::find(defs, defsEnd, idx);
 1374|  1.69M|      if (def == defsEnd) {
  ------------------
  |  Branch (1374:11): [True: 1.68M, False: 9.35k]
  ------------------
 1375|  1.68M|        if (cfg->concat_) {
  ------------------
  |  Branch (1375:13): [True: 941, False: 1.68M]
  ------------------
 1376|       |          // Determine gap-size
 1377|    941|          const ArrayDef* xdef = defs;
 1378|  4.25k|          for (; xdef != defsEnd && xdef->idx_ <= idx; ++xdef) {
  ------------------
  |  Branch (1378:18): [True: 4.01k, False: 243]
  |  Branch (1378:37): [True: 3.31k, False: 698]
  ------------------
 1379|  3.31k|          }
 1380|    941|          size_t gapSize = 0;
 1381|    941|          if (xdef != defsEnd && xdef->idx_ > idx) {
  ------------------
  |  Branch (1381:15): [True: 698, False: 243]
  |  Branch (1381:34): [True: 698, False: 0]
  ------------------
 1382|    698|            gapSize = xdef->idx_ - idx;
 1383|    698|          } else {
 1384|    243|            gapSize = object->TiffEntryBase::doSize() - idx;
 1385|    243|          }
 1386|    941|          gap.idx_ = idx;
 1387|    941|          gap.tiffType_ = cfg->elDefaultDef_.tiffType_;
 1388|    941|          gap.count_ = gapSize / cfg->tagStep();
 1389|    941|          if (gap.count_ * cfg->tagStep() != gapSize) {
  ------------------
  |  Branch (1389:15): [True: 11, False: 930]
  ------------------
 1390|     11|            gap.tiffType_ = ttUndefined;
 1391|     11|            gap.count_ = gapSize;
 1392|     11|          }
 1393|    941|          def = &gap;
 1394|  1.68M|        } else {
 1395|  1.68M|          def = &cfg->elDefaultDef_;
 1396|  1.68M|        }
 1397|  1.68M|      }
 1398|  1.69M|    }
 1399|  1.71M|    idx += object->addElement(idx, *def);  // idx may be different from def->idx_
 1400|  1.71M|  }
 1401|       |
 1402|  3.30k|}  // TiffReader::visitBinaryArray
_ZN5Exiv28Internal10TiffReader18visitBinaryElementEPNS0_17TiffBinaryElementE:
 1404|  1.74M|void TiffReader::visitBinaryElement(TiffBinaryElement* object) {
 1405|  1.74M|  auto pData = object->start();
 1406|  1.74M|  size_t size = object->TiffEntryBase::doSize();
 1407|  1.74M|  ByteOrder bo = object->elByteOrder();
 1408|  1.74M|  if (bo == invalidByteOrder)
  ------------------
  |  Branch (1408:7): [True: 132k, False: 1.61M]
  ------------------
 1409|   132k|    bo = byteOrder();
 1410|  1.74M|  TypeId typeId = toTypeId(object->elDef()->tiffType_, object->tag(), object->group());
 1411|  1.74M|  auto v = Value::create(typeId);
 1412|  1.74M|  enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1413|  1.74M|  v->read(pData, size, bo);
 1414|       |
 1415|  1.74M|  object->setValue(std::move(v));
 1416|  1.74M|  object->setOffset(0);
 1417|  1.74M|  object->setIdx(nextIdx(object->group()));
 1418|  1.74M|}
tiffvisitor_int.cpp:_ZN5Exiv28InternalL7findTagEPKNS_7TagInfoEt:
  341|  6.46k|static const TagInfo* findTag(const TagInfo* pList, uint16_t tag) {
  342|   452k|  while (pList->tag_ != 0xffff && pList->tag_ != tag)
  ------------------
  |  Branch (342:10): [True: 452k, False: 0]
  |  Branch (342:35): [True: 446k, False: 6.46k]
  ------------------
  343|   446k|    pList++;
  344|  6.46k|  return pList->tag_ != 0xffff ? pList : nullptr;
  ------------------
  |  Branch (344:10): [True: 6.46k, False: 0]
  ------------------
  345|  6.46k|}
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_117stringToByteOrderENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   48|  6.96k|Exiv2::ByteOrder stringToByteOrder(std::string_view val) {
   49|  6.96k|  if (val == "II")
  ------------------
  |  Branch (49:7): [True: 169, False: 6.79k]
  ------------------
   50|    169|    return Exiv2::littleEndian;
   51|  6.79k|  if (val == "MM")
  ------------------
  |  Branch (51:7): [True: 6.79k, False: 0]
  ------------------
   52|  6.79k|    return Exiv2::bigEndian;
   53|       |
   54|      0|  return Exiv2::invalidByteOrder;
   55|  6.79k|}
tiffvisitor_int.cpp:_ZNK12_GLOBAL__N_114FindExifdatum2clERKN5Exiv29ExifdatumE:
   38|   500k|  bool operator()(const Exiv2::Exifdatum& md) const {
   39|   500k|    return idx_ == md.idx() && md.groupName() == groupName_;
  ------------------
  |  Branch (39:12): [True: 3.32k, False: 497k]
  |  Branch (39:32): [True: 151, False: 3.17k]
  ------------------
   40|   500k|  }
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_114FindExifdatum2C2EN5Exiv25IfdIdEi:
   35|  5.78k|  FindExifdatum2(Exiv2::IfdId group, int idx) : groupName_(Exiv2::Internal::groupName(group)), idx_(idx) {
   36|  5.78k|  }

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  10.6M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  10.6M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 8.41M, False: 2.26M]
  ------------------
   88|  8.41M|    return tit->size_;
   89|  2.26M|  return 0;
   90|  10.6M|}
_ZN5Exiv27DataBufC2Em:
   92|  5.30M|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|  5.30M|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  59.2k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  59.2k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  30.6k|void DataBuf::alloc(size_t size) {
   99|  30.6k|  pData_.resize(size);
  100|  30.6k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   267k|void DataBuf::resize(size_t size) {
  103|   267k|  pData_.resize(size);
  104|   267k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  34.8k|void DataBuf::reset() {
  107|  34.8k|  pData_.clear();
  108|  34.8k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|  6.17M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|  6.17M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 6.17M]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|  6.17M|  return pData_[offset];
  115|  6.17M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|   519k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|   519k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 519k]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|   519k|  pData_[offset] = x;
  122|   519k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   554k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   554k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 554k]
  |  Branch (125:28): [True: 2, False: 554k]
  ------------------
  126|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      2|  }
  128|   554k|  return getUShort(&pData_[offset], byteOrder);
  129|   554k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  15.8k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  15.8k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 15.8k]
  |  Branch (132:28): [True: 0, False: 15.8k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  15.8k|  us2Data(&pData_[offset], x, byteOrder);
  136|  15.8k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  138|   383k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  139|   383k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 383k]
  |  Branch (139:28): [True: 3, False: 383k]
  ------------------
  140|      4|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      4|  }
  142|   383k|  return getULong(&pData_[offset], byteOrder);
  143|   383k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  15.8k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  15.8k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 15.8k]
  |  Branch (146:28): [True: 0, False: 15.8k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  15.8k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  15.8k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  10.9k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  10.9k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 10.9k]
  |  Branch (153:28): [True: 0, False: 10.9k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  10.9k|  return getULongLong(&pData_[offset], byteOrder);
  157|  10.9k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   371k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   371k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 371k]
  |  Branch (167:34): [True: 0, False: 371k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   371k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   371k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  8.02M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  8.02M|  return const_cast<byte*>(c_data(offset));
  175|  8.02M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  10.4M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  10.4M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 1.04M, False: 9.44M]
  |  Branch (178:25): [True: 9.91k, False: 9.43M]
  ------------------
  179|  1.05M|    return nullptr;
  180|  1.05M|  }
  181|  9.43M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 9.43M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  9.43M|  return &pData_[offset];
  185|  9.43M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  58.6k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  58.6k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  58.6k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|  4.24k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|  4.24k|  return os << r.first << "/" << r.second;
  212|  4.24k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|  2.76k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|  2.76k|  return os << r.first << "/" << r.second;
  241|  2.76k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  38.2M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  38.2M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  38.2M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  37.0M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  37.0M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 872k, False: 36.1M]
  ------------------
  253|   872k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|   872k|  }
  255|  36.1M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  37.0M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  63.3k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  63.3k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 10.5k, False: 52.7k]
  ------------------
  260|  10.5k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  10.5k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  10.5k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  10.5k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  10.5k|  }
  265|  52.7k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  52.7k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  52.7k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  52.7k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  63.3k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|   661k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|   661k|  uint32_t nominator = getULong(buf, byteOrder);
  273|   661k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|   661k|  return {nominator, denominator};
  275|   661k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|   293k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|   293k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 136k, False: 157k]
  ------------------
  279|   136k|    return buf[1] << 8 | buf[0];
  280|   136k|  }
  281|   157k|  return buf[0] << 8 | buf[1];
  282|   293k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|  1.81M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|  1.81M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 9.13k, False: 1.80M]
  ------------------
  286|  9.13k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|  9.13k|  }
  288|  1.80M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|  1.81M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|   540k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|   540k|  int32_t nominator = getLong(buf, byteOrder);
  293|   540k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|   540k|  return {nominator, denominator};
  295|   540k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  55.7k|float getFloat(const byte* buf, ByteOrder byteOrder) {
  298|       |  // This algorithm assumes that the internal representation of the float
  299|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  300|       |  // required by the C++ standard.
  301|  55.7k|#ifdef __cpp_lib_bit_cast
  302|  55.7k|  return std::bit_cast<float>(getULong(buf, byteOrder));
  303|       |#else
  304|       |  union {
  305|       |    uint32_t ul_;
  306|       |    float f_;
  307|       |  } u;
  308|       |  u.ul_ = getULong(buf, byteOrder);
  309|       |  return u.f_;
  310|       |#endif
  311|  55.7k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|   464k|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|   464k|#ifdef __cpp_lib_bit_cast
  318|   464k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 74.2k, False: 390k]
  ------------------
  319|  74.2k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  74.2k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  74.2k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  74.2k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|   390k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|   390k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|   390k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|   390k|                               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|   464k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|  5.91M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|  5.91M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 4.69M, False: 1.21M]
  ------------------
  350|  4.69M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|  4.69M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|  4.69M|  } else {
  353|  1.21M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|  1.21M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|  1.21M|  }
  356|  5.91M|  return 2;
  357|  5.91M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|  3.14M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|  3.14M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 1.94M, False: 1.19M]
  ------------------
  361|  1.94M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|  1.94M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|  1.94M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|  1.94M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|  1.94M|  } else {
  366|  1.19M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|  1.19M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|  1.19M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|  1.19M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|  1.19M|  }
  371|  3.14M|  return 4;
  372|  3.14M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|   527k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|   527k|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|   527k|  o += ul2Data(buf + o, l.second, byteOrder);
  392|   527k|  return o;
  393|   527k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|   279k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|   279k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 173k, False: 105k]
  ------------------
  397|   173k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|   173k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|   173k|  } else {
  400|   105k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|   105k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|   105k|  }
  403|   279k|  return 2;
  404|   279k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|  1.26M|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|  1.26M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 178k, False: 1.08M]
  ------------------
  408|   178k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|   178k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|   178k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|   178k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|  1.08M|  } else {
  413|  1.08M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  414|  1.08M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  415|  1.08M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  416|  1.08M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  417|  1.08M|  }
  418|  1.26M|  return 4;
  419|  1.26M|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|   309k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|   309k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|   309k|  o += l2Data(buf + o, l.second, byteOrder);
  424|   309k|  return o;
  425|   309k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|  33.3k|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|  33.3k|#ifdef __cpp_lib_bit_cast
  432|  33.3k|  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|  33.3k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|   237k|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|   237k|  union {
  448|   237k|    uint64_t ull_;
  449|   237k|    double d_;
  450|   237k|  } u;
  451|   237k|  u.d_ = d;
  452|   237k|  uint64_t m = 0xff;
  453|   237k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 122k, False: 115k]
  ------------------
  454|   122k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|   122k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|   122k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|   122k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|   122k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|   122k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|   122k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|   122k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|   122k|  } else {
  463|   115k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|   115k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|   115k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|   115k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|   115k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   115k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|   115k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|   115k|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|   115k|  }
  472|   237k|  return 8;
  473|   237k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  502|  73.5k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  503|  73.5k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (503:7): [True: 0, False: 73.5k]
  ------------------
  504|      0|    return false;
  505|  73.5k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (505:7): [True: 73.5k, False: 0]
  |  Branch (505:19): [True: 0, False: 73.5k]
  ------------------
  506|      0|    return false;
  507|       |
  508|  73.5k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  509|  73.5k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  511|     14|int exifTime(const char* buf, tm* tm) {
  512|     14|  int rc = 1;
  513|     14|  int year = 0;
  514|     14|  int mon = 0;
  515|     14|  int mday = 0;
  516|     14|  int hour = 0;
  517|     14|  int min = 0;
  518|     14|  int sec = 0;
  519|     14|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (519:7): [True: 10, False: 4]
  ------------------
  520|     10|    tm->tm_year = year - 1900;
  521|     10|    tm->tm_mon = mon - 1;
  522|     10|    tm->tm_mday = mday;
  523|     10|    tm->tm_hour = hour;
  524|     10|    tm->tm_min = min;
  525|     10|    tm->tm_sec = sec;
  526|     10|    rc = 0;
  527|     10|  }
  528|     14|  return rc;
  529|     14|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  651|    221|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|    221|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|    221|  int32_t den;
  658|    221|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 133, False: 88]
  ------------------
  659|    133|    den = 1000000;
  660|    133|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (660:14): [True: 24, False: 64]
  ------------------
  661|     24|    den = 10000;
  662|     64|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (662:14): [True: 8, False: 56]
  ------------------
  663|      8|    den = 100;
  664|     56|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (664:14): [True: 19, False: 37]
  ------------------
  665|     19|    den = 1;
  666|     37|  } else {
  667|     37|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (667:13): [True: 37, False: 0]
  ------------------
  668|     37|  }
  669|    184|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|    184|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|    184|  return {nom / g, den / g};
  673|    221|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|  84.6M|  bool operator==(Exiv2::TypeId typeId) const {
   35|  84.6M|    return typeId_ == typeId;
   36|  84.6M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  4.46M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  4.46M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  3.16M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  3.16M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 3.16M]
  ------------------
   25|  3.60k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 3.60k, False: 3.16M]
  ------------------
   26|  1.48M|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 1.48M, False: 1.68M]
  ------------------
   27|  1.48M|      return std::make_unique<DataValue>(typeId);
   28|  40.5k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 40.5k, False: 3.12M]
  ------------------
   29|  40.5k|      return std::make_unique<AsciiValue>();
   30|   262k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 262k, False: 2.90M]
  ------------------
   31|   262k|      return std::make_unique<ValueType<uint16_t>>();
   32|  45.3k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 45.3k, False: 3.12M]
  ------------------
   33|  56.2k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 10.9k, False: 3.15M]
  ------------------
   34|  56.2k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  12.6k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 12.6k, False: 3.15M]
  ------------------
   36|  12.6k|      return std::make_unique<ValueType<URational>>();
   37|  47.7k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 47.7k, False: 3.11M]
  ------------------
   38|  47.7k|      return std::make_unique<DataValue>();
   39|  22.2k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 22.2k, False: 3.14M]
  ------------------
   40|  22.2k|      return std::make_unique<ValueType<int16_t>>();
   41|  30.9k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 30.9k, False: 3.13M]
  ------------------
   42|  30.9k|      return std::make_unique<ValueType<int32_t>>();
   43|  11.6k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 11.6k, False: 3.15M]
  ------------------
   44|  11.6k|      return std::make_unique<ValueType<Rational>>();
   45|  8.42k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 8.42k, False: 3.15M]
  ------------------
   46|  8.42k|      return std::make_unique<ValueType<float>>();
   47|  11.5k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 11.5k, False: 3.15M]
  ------------------
   48|  11.5k|      return std::make_unique<ValueType<double>>();
   49|  81.8k|    case string:
  ------------------
  |  Branch (49:5): [True: 81.8k, False: 3.08M]
  ------------------
   50|  81.8k|      return std::make_unique<StringValue>();
   51|  4.17k|    case date:
  ------------------
  |  Branch (51:5): [True: 4.17k, False: 3.16M]
  ------------------
   52|  4.17k|      return std::make_unique<DateValue>();
   53|  9.39k|    case time:
  ------------------
  |  Branch (53:5): [True: 9.39k, False: 3.15M]
  ------------------
   54|  9.39k|      return std::make_unique<TimeValue>();
   55|  7.16k|    case comment:
  ------------------
  |  Branch (55:5): [True: 7.16k, False: 3.15M]
  ------------------
   56|  7.16k|      return std::make_unique<CommentValue>();
   57|  43.8k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 43.8k, False: 3.12M]
  ------------------
   58|  43.8k|      return std::make_unique<XmpTextValue>();
   59|      0|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 0, False: 3.16M]
  ------------------
   60|  4.65k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 4.65k, False: 3.16M]
  ------------------
   61|  4.65k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 3.16M]
  ------------------
   62|  4.65k|      return std::make_unique<XmpArrayValue>(typeId);
   63|      0|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 0, False: 3.16M]
  ------------------
   64|      0|      return std::make_unique<LangAltValue>();
   65|  1.02M|    default:
  ------------------
  |  Branch (65:5): [True: 1.02M, False: 2.14M]
  ------------------
   66|  1.02M|      return std::make_unique<DataValue>(typeId);
   67|  3.16M|  }
   68|  3.16M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|    841|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|    841|  return -1;
   72|    841|}
_ZNK5Exiv25Value8toStringEv:
   74|   312k|std::string Value::toString() const {
   75|   312k|  std::ostringstream os;
   76|   312k|  write(os);
   77|   312k|  ok_ = !os.fail();
   78|   312k|  return os.str();
   79|   312k|}
_ZNK5Exiv25Value8toStringEm:
   81|   206k|std::string Value::toString(size_t /*n*/) const {
   82|   206k|  return toString();
   83|   206k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  29.1k|size_t Value::sizeDataArea() const {
   86|  29.1k|  return 0;
   87|  29.1k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|  1.41k|DataBuf Value::dataArea() const {
   90|  1.41k|  return {nullptr, 0};
   91|  1.41k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|  2.55M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|  2.55M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   96|     15|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   97|     15|  read(buf, len, byteOrder);
   98|     15|}
_ZNK5Exiv29DataValue5countEv:
  100|  6.83M|size_t DataValue::count() const {
  101|  6.83M|  return size();
  102|  6.83M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|  2.55M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|  2.55M|  value_.assign(buf, buf + len);
  107|  2.55M|  return 0;
  108|  2.55M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|  3.47M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|  3.47M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|  3.47M|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  20.3M|size_t DataValue::size() const {
  128|  20.3M|  return value_.size();
  129|  20.3M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  9.88M|DataValue* DataValue::clone_() const {
  132|  9.88M|  return new DataValue(*this);
  133|  9.88M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.52k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.52k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.68k, False: 843]
  ------------------
  137|  1.68k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.68k|    os << static_cast<int>(value_.back());
  139|  1.68k|  }
  140|  2.52k|  return os;
  141|  2.52k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  53.3k|int64_t DataValue::toInt64(size_t n) const {
  149|  53.3k|  ok_ = true;
  150|  53.3k|  return value_.at(n);
  151|  53.3k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|  71.2k|uint32_t DataValue::toUint32(size_t n) const {
  154|  71.2k|  ok_ = true;
  155|  71.2k|  return value_.at(n);
  156|  71.2k|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  57.1k|int StringValueBase::read(const std::string& buf) {
  173|  57.1k|  value_ = buf;
  174|  57.1k|  return 0;
  175|  57.1k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  69.8k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  69.8k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 69.8k, False: 0]
  ------------------
  180|  69.8k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  69.8k|  return 0;
  182|  69.8k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  86.2k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  86.2k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 51.0k, False: 35.2k]
  ------------------
  186|  51.0k|    return 0;
  187|       |  // byteOrder not needed
  188|  35.2k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  86.2k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|   105k|size_t StringValueBase::count() const {
  192|   105k|  return size();
  193|   105k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|   336k|size_t StringValueBase::size() const {
  196|   336k|  return value_.size();
  197|   336k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  199|  55.5k|std::ostream& StringValueBase::write(std::ostream& os) const {
  200|  55.5k|  return os << value_;
  201|  55.5k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  4.12k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  4.12k|  ok_ = true;
  205|  4.12k|  return value_.at(n);
  206|  4.12k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  39.8k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  39.8k|  ok_ = true;
  210|  39.8k|  return value_.at(n);
  211|  39.8k|}
_ZN5Exiv211StringValueC2Ev:
  223|  81.8k|StringValue::StringValue() : StringValueBase(string) {
  224|  81.8k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|   459k|StringValue* StringValue::clone_() const {
  230|   459k|  return new StringValue(*this);
  231|   459k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  40.5k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  40.5k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  4.95k|int AsciiValue::read(const std::string& buf) {
  240|  4.95k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  4.95k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 10, False: 4.94k]
  |  Branch (242:25): [True: 4.94k, False: 0]
  ------------------
  243|  4.95k|    value_ += '\0';
  244|  4.95k|  }
  245|  4.95k|  return 0;
  246|  4.95k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|   146k|AsciiValue* AsciiValue::clone_() const {
  249|   146k|  return new AsciiValue(*this);
  250|   146k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  33.6k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  33.6k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  33.6k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 7.89k, False: 25.7k]
  ------------------
  256|  7.89k|    pos = value_.size();
  257|  33.6k|  return os << value_.substr(0, pos);
  258|  33.6k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  285|  4.88k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  286|  4.88k|  int i = 0;
  287|  16.4k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (287:10): [True: 15.3k, False: 1.13k]
  |  Branch (287:10): [True: 11.6k, False: 4.88k]
  |  Branch (287:58): [True: 11.6k, False: 3.74k]
  ------------------
  288|  11.6k|  }
  289|  4.88k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (289:10): [True: 1.13k, False: 3.74k]
  ------------------
  290|  4.88k|}
_ZN5Exiv212CommentValueC2Ev:
  292|  7.16k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|  7.16k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|  7.16k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|  7.16k|  byteOrder_ = byteOrder;
  331|  7.16k|  return StringValueBase::read(buf, len, byteOrder);
  332|  7.16k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  334|  7.13k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  335|  7.13k|  std::string c = value_;
  336|  7.13k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (336:7): [True: 1.51k, False: 5.62k]
  ------------------
  337|  1.51k|    c = value_.substr(8);
  338|  1.51k|    [[maybe_unused]] const size_t sz = c.size();
  339|  1.51k|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (339:9): [True: 93, False: 1.41k]
  |  Branch (339:39): [True: 0, False: 93]
  ------------------
  340|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  341|  1.51k|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (341:16): [True: 1.41k, False: 93]
  |  Branch (341:43): [True: 672, False: 745]
  ------------------
  342|    672|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  343|    672|    }
  344|  1.51k|    c = value_.substr(0, 8) + c;
  345|  1.51k|  }
  346|  7.13k|  if (c.empty())
  ------------------
  |  Branch (346:7): [True: 1.83k, False: 5.29k]
  ------------------
  347|  1.83k|    return 0;
  348|  5.29k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  349|  7.13k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  381|  7.13k|CommentValue::CharsetId CommentValue::charsetId() const {
  382|  7.13k|  CharsetId charsetId = undefined;
  383|  7.13k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (383:7): [True: 4.88k, False: 2.24k]
  ------------------
  384|  4.88k|    const std::string code = value_.substr(0, 8);
  385|  4.88k|    charsetId = CharsetInfo::charsetIdByCode(code);
  386|  4.88k|  }
  387|  7.13k|  return charsetId;
  388|  7.13k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|  20.0k|CommentValue* CommentValue::clone_() const {
  411|  20.0k|  return new CommentValue(*this);
  412|  20.0k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  16.4k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  16.4k|  xmpArrayType_ = xmpArrayType;
  416|  16.4k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  9.59k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  9.59k|  xmpStruct_ = xmpStruct;
  420|  9.59k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|   547k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|   547k|  return xmpArrayType_;
  424|   547k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  16.3k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  16.3k|  XmpArrayType xa = xaNone;
  428|  16.3k|  switch (typeId) {
  429|    564|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 564, False: 15.7k]
  ------------------
  430|    564|      xa = xaAlt;
  431|    564|      break;
  432|    290|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 290, False: 16.0k]
  ------------------
  433|    290|      xa = xaBag;
  434|    290|      break;
  435|  6.49k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 6.49k, False: 9.81k]
  ------------------
  436|  6.49k|      xa = xaSeq;
  437|  6.49k|      break;
  438|  8.96k|    default:
  ------------------
  |  Branch (438:5): [True: 8.96k, False: 7.34k]
  ------------------
  439|  8.96k|      break;
  440|  16.3k|  }
  441|  16.3k|  return xa;
  442|  16.3k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|   563k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|   563k|  return xmpStruct_;
  446|   563k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   169k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   169k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   998k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   998k|  std::string b = buf;
  478|   998k|  std::string type;
  479|   998k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 2.05k, False: 996k]
  ------------------
  480|  2.05k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  2.05k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  2.05k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 956, False: 1.09k]
  |  Branch (483:26): [True: 555, False: 401]
  ------------------
  484|    555|      type = type.substr(1);
  485|  2.05k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 873, False: 1.18k]
  |  Branch (485:26): [True: 361, False: 512]
  ------------------
  486|    361|      type.pop_back();
  487|  2.05k|    b.clear();
  488|  2.05k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 1.28k, False: 765]
  ------------------
  489|  1.28k|      b = buf.substr(pos + 1);
  490|  2.05k|  }
  491|   998k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 873, False: 997k]
  ------------------
  492|    873|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 118, False: 755]
  ------------------
  493|    118|      setXmpArrayType(XmpValue::xaAlt);
  494|    755|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 28, False: 727]
  ------------------
  495|     28|      setXmpArrayType(XmpValue::xaBag);
  496|    727|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 35, False: 692]
  ------------------
  497|     35|      setXmpArrayType(XmpValue::xaSeq);
  498|    692|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 251, False: 441]
  ------------------
  499|    251|      setXmpStruct();
  500|    441|    } else {
  501|    441|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    441|    }
  503|    873|  }
  504|   997k|  value_ = std::move(b);
  505|   997k|  return 0;
  506|   998k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  512|   114k|size_t XmpTextValue::size() const {
  513|   114k|  std::ostringstream os;
  514|   114k|  write(os);
  515|   114k|  return os.str().size();
  516|   114k|}
_ZNK5Exiv212XmpTextValue5countEv:
  518|   114k|size_t XmpTextValue::count() const {
  519|   114k|  return size();
  520|   114k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|   326k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|   326k|  bool del = false;
  524|   326k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 343, False: 326k]
  ------------------
  525|    343|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 343, False: 0]
  ------------------
  526|    102|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 102, False: 241]
  ------------------
  527|    102|        os << "type=\"Alt\"";
  528|    102|        break;
  529|      9|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 9, False: 334]
  ------------------
  530|      9|        os << "type=\"Bag\"";
  531|      9|        break;
  532|    232|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 232, False: 111]
  ------------------
  533|    232|        os << "type=\"Seq\"";
  534|    232|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 343]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|    343|    }
  538|    343|    del = true;
  539|   326k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 8.27k, False: 318k]
  ------------------
  540|  8.27k|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 8.27k, False: 0]
  ------------------
  541|  8.27k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 8.27k, False: 0]
  ------------------
  542|  8.27k|        os << "type=\"Struct\"";
  543|  8.27k|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 8.27k]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|  8.27k|    }
  547|  8.27k|    del = true;
  548|  8.27k|  }
  549|   326k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 8.62k, False: 318k]
  |  Branch (549:14): [True: 24, False: 8.59k]
  ------------------
  550|     24|    os << " ";
  551|   326k|  return os << value_;
  552|   326k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   387k|XmpTextValue* XmpTextValue::clone_() const {
  571|   387k|  return new XmpTextValue(*this);
  572|   387k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  6.96k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  6.96k|  setXmpArrayType(xmpArrayType(typeId));
  576|  6.96k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   441k|int XmpArrayValue::read(const std::string& buf) {
  579|   441k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 433k, False: 7.14k]
  ------------------
  580|   433k|    value_.push_back(buf);
  581|   441k|  return 0;
  582|   441k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|  65.0k|size_t XmpArrayValue::count() const {
  589|  65.0k|  return value_.size();
  590|  65.0k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    226|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    226|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 217, False: 9]
  ------------------
  594|    217|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    217|    os << value_.back();
  596|    217|  }
  597|    226|  return os;
  598|    226|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|   181k|std::string XmpArrayValue::toString(size_t n) const {
  601|   181k|  ok_ = true;
  602|   181k|  return value_.at(n);
  603|   181k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  13.9k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  13.9k|  return new XmpArrayValue(*this);
  623|  13.9k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|  1.12k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|  1.12k|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    540|size_t LangAltValue::count() const {
  680|    540|  return value_.size();
  681|    540|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|    195|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|    195|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|    195|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 195]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|    195|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 195, False: 195]
  ------------------
  694|    195|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 195, False: 0]
  ------------------
  695|    195|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 195]
  ------------------
  696|      0|        os << ", ";
  697|    195|      os << "lang=\"" << lang << "\" " << s;
  698|    195|      first = false;
  699|    195|    }
  700|    195|  }
  701|    195|  return os;
  702|    195|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    610|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    610|  return toString("x-default");
  706|    610|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    610|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    610|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 70, False: 540]
  ------------------
  710|     70|    ok_ = true;
  711|     70|    return i->second;
  712|     70|  }
  713|    540|  ok_ = false;
  714|    540|  return "";
  715|    610|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  2.28k|LangAltValue* LangAltValue::clone_() const {
  738|  2.28k|  return new LangAltValue(*this);
  739|  2.28k|}
_ZN5Exiv29DateValueC2Ev:
  741|  4.17k|DateValue::DateValue() : Value(date) {
  742|  4.17k|  date_ = {};
  743|  4.17k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  3.78k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  3.78k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  3.78k|  return read(str);
  752|  3.78k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  4.17k|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|  4.17k|  size_t monthPos = 0;
  758|  4.17k|  size_t dayPos = 0;
  759|       |
  760|  4.17k|  auto printWarning = [] {
  761|  4.17k|#ifndef SUPPRESS_WARNINGS
  762|  4.17k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  4.17k|#endif
  764|  4.17k|  };
  765|       |
  766|  4.17k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 685, False: 3.48k]
  ------------------
  767|    685|    printWarning();
  768|    685|    return 1;
  769|    685|  }
  770|       |
  771|  3.48k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 1.99k, False: 1.49k]
  |  Branch (771:28): [True: 1.05k, False: 938]
  |  Branch (771:45): [True: 579, False: 474]
  |  Branch (771:63): [True: 1.49k, False: 1.41k]
  ------------------
  772|  2.07k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 579, False: 1.49k]
  ------------------
  773|    579|      monthPos = 5;
  774|    579|      dayPos = 8;
  775|  1.49k|    } else {
  776|  1.49k|      monthPos = 4;
  777|  1.49k|      dayPos = 6;
  778|  1.49k|    }
  779|       |
  780|  2.07k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  2.07k|      for (size_t i = start; i < start + count; ++i) {
  782|  2.07k|        if (!std::isdigit(buf[i])) {
  783|  2.07k|          printWarning();
  784|  2.07k|          return 1;
  785|  2.07k|        }
  786|  2.07k|      }
  787|  2.07k|      dest = std::stoul(buf.substr(start, count));
  788|  2.07k|      return 0;
  789|  2.07k|    };
  790|       |
  791|  2.07k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 837, False: 1.23k]
  |  Branch (791:42): [True: 688, False: 547]
  |  Branch (791:83): [True: 170, False: 377]
  ------------------
  792|  1.69k|      printWarning();
  793|  1.69k|      return 1;
  794|  1.69k|    }
  795|       |
  796|    377|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 164, False: 213]
  |  Branch (796:29): [True: 73, False: 140]
  ------------------
  797|    237|      date_.month = 0;
  798|    237|      date_.day = 0;
  799|    237|      printWarning();
  800|    237|      return 1;
  801|    237|    }
  802|    140|    return 0;
  803|    377|  }
  804|  1.41k|  printWarning();
  805|  1.41k|  return 1;
  806|  3.48k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  812|    128|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|    128|  auto out = reinterpret_cast<char*>(buf);
  817|    128|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|    128|#define stringFormatTo std::format_to
  ------------------
  818|       |
  819|    128|  return it - out;
  820|    128|}
_ZNK5Exiv29DateValue4sizeEv:
  830|    256|size_t DateValue::size() const {
  831|    256|  return 8;
  832|    256|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|  1.28k|DateValue* DateValue::clone_() const {
  835|  1.28k|  return new DateValue(*this);
  836|  1.28k|}
_ZN5Exiv29TimeValueC2Ev:
  877|  9.39k|TimeValue::TimeValue() : Value(time) {
  878|  9.39k|  time_ = {};
  879|  9.39k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  9.39k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  9.39k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  9.39k|  return read(str);
  888|  9.39k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  9.39k|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|  9.39k|  auto printWarning = [] {
  896|  9.39k|#ifndef SUPPRESS_WARNINGS
  897|  9.39k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  9.39k|#endif
  899|  9.39k|    return 1;
  900|  9.39k|  };
  901|       |
  902|  9.39k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 648, False: 8.74k]
  ------------------
  903|    648|    return printWarning();
  904|       |
  905|  8.74k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 108k, False: 5.51k]
  ------------------
  906|   108k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 105k, False: 3.23k]
  |  Branch (906:21): [True: 101k, False: 3.51k]
  |  Branch (906:33): [True: 95.5k, False: 6.03k]
  |  Branch (906:45): [True: 92.6k, False: 2.92k]
  |  Branch (906:57): [True: 3.23k, False: 89.4k]
  ------------------
  907|  3.23k|      return printWarning();
  908|       |
  909|  5.51k|  size_t mpos;
  910|  5.51k|  size_t spos;
  911|  5.51k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 2.04k, False: 3.46k]
  ------------------
  912|  2.04k|    mpos = 3;
  913|  2.04k|    spos = 6;
  914|  3.46k|  } else {
  915|  3.46k|    mpos = 2;
  916|  3.46k|    spos = 4;
  917|  3.46k|  }
  918|       |
  919|  5.51k|  auto hi = std::stoi(buf.substr(0, 2));
  920|  5.51k|  if (hi < 0 || hi > 23)
  ------------------
  |  Branch (920:7): [True: 68, False: 5.44k]
  |  Branch (920:17): [True: 93, False: 5.34k]
  ------------------
  921|    149|    return printWarning();
  922|  5.36k|  time_.hour = hi;
  923|  5.36k|  if (buf.size() > 3) {
  ------------------
  |  Branch (923:7): [True: 4.06k, False: 1.29k]
  ------------------
  924|  4.06k|    auto mi = std::stoi(buf.substr(mpos, 2));
  925|  4.06k|    if (mi < 0 || mi > 59)
  ------------------
  |  Branch (925:9): [True: 202, False: 3.86k]
  |  Branch (925:19): [True: 118, False: 3.74k]
  ------------------
  926|    317|      return printWarning();
  927|  3.74k|    time_.minute = std::stoi(buf.substr(mpos, 2));
  928|  3.74k|  } else {
  929|  1.29k|    time_.minute = 0;
  930|  1.29k|  }
  931|  5.04k|  if (buf.size() > 5) {
  ------------------
  |  Branch (931:7): [True: 3.18k, False: 1.86k]
  ------------------
  932|  3.18k|    auto si = std::stoi(buf.substr(spos, 2));
  933|  3.18k|    if (si < 0 || si > 60)
  ------------------
  |  Branch (933:9): [True: 89, False: 3.09k]
  |  Branch (933:19): [True: 164, False: 2.93k]
  ------------------
  934|    249|      return printWarning();
  935|  2.93k|    time_.second = std::stoi(buf.substr(spos, 2));
  936|  2.93k|  } else {
  937|  1.86k|    time_.second = 0;
  938|  1.86k|  }
  939|       |
  940|  4.79k|  auto fpos = buf.find('+');
  941|  4.79k|  if (fpos == std::string::npos)
  ------------------
  |  Branch (941:7): [True: 2.60k, False: 2.18k]
  ------------------
  942|  2.60k|    fpos = buf.find('-');
  943|       |
  944|  4.79k|  if (fpos != std::string::npos) {
  ------------------
  |  Branch (944:7): [True: 4.36k, False: 434]
  ------------------
  945|  4.36k|    auto format = buf.substr(fpos, buf.size());
  946|  4.36k|    auto posColon = format.find(':');
  947|  4.36k|    if (posColon == std::string::npos) {
  ------------------
  |  Branch (947:9): [True: 2.58k, False: 1.78k]
  ------------------
  948|       |      // Extended format
  949|  2.58k|      auto tzhi = std::stoi(format.substr(0, 3));
  950|  2.58k|      if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (950:11): [True: 41, False: 2.54k]
  |  Branch (950:25): [True: 581, False: 1.95k]
  ------------------
  951|    620|        return printWarning();
  952|  1.96k|      time_.tzHour = tzhi;
  953|  1.96k|      if (format.size() > 3) {
  ------------------
  |  Branch (953:11): [True: 1.03k, False: 929]
  ------------------
  954|  1.03k|        int minute = std::stoi(format.substr(3));
  955|  1.03k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (955:13): [True: 96, False: 936]
  |  Branch (955:27): [True: 226, False: 710]
  ------------------
  956|    313|          return printWarning();
  957|    719|        time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (957:26): [True: 229, False: 490]
  ------------------
  958|    719|      }
  959|  1.96k|    } else {
  960|       |      // Basic format
  961|  1.78k|      auto tzhi = std::stoi(format.substr(0, posColon));
  962|  1.78k|      if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (962:11): [True: 504, False: 1.27k]
  |  Branch (962:25): [True: 182, False: 1.09k]
  ------------------
  963|    682|        return printWarning();
  964|  1.09k|      time_.tzHour = tzhi;
  965|  1.09k|      int minute = std::stoi(format.substr(posColon + 1));
  966|  1.09k|      if (minute < 0 || minute > 59)
  ------------------
  |  Branch (966:11): [True: 338, False: 760]
  |  Branch (966:25): [True: 367, False: 393]
  ------------------
  967|    684|        return printWarning();
  968|    414|      time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (968:24): [True: 154, False: 260]
  ------------------
  969|    414|    }
  970|  4.36k|  }
  971|  2.49k|  return 0;
  972|  4.79k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  979|    270|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|    270|  char plusMinus = '+';
  983|    270|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (983:7): [True: 98, False: 172]
  |  Branch (983:27): [True: 0, False: 172]
  ------------------
  984|     98|    plusMinus = '-';
  985|       |
  986|    270|  auto out = reinterpret_cast<char*>(buf);
  987|    270|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    270|#define stringFormatTo std::format_to
  ------------------
  988|    270|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
  989|       |
  990|    270|  auto wrote = static_cast<size_t>(it - out);
  991|    270|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
  992|    270|  return wrote;
  993|    270|}
_ZNK5Exiv29TimeValue4sizeEv:
 1003|    540|size_t TimeValue::size() const {
 1004|    540|  return 11;
 1005|    540|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1007|  3.77k|TimeValue* TimeValue::clone_() const {
 1008|  3.77k|  return new TimeValue(*this);
 1009|  3.77k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  5.72k|  auto printWarning = [] {
  761|  5.72k|#ifndef SUPPRESS_WARNINGS
  762|  5.72k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  5.72k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.72k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.72k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  5.72k|#endif
  764|  5.72k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  3.85k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  12.3k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 10.1k, False: 2.15k]
  ------------------
  782|  10.1k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 1.69k, False: 8.49k]
  ------------------
  783|  1.69k|          printWarning();
  784|  1.69k|          return 1;
  785|  1.69k|        }
  786|  10.1k|      }
  787|  2.15k|      dest = std::stoul(buf.substr(start, count));
  788|  2.15k|      return 0;
  789|  3.85k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  6.90k|  auto printWarning = [] {
  896|  6.90k|#ifndef SUPPRESS_WARNINGS
  897|  6.90k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  6.90k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.90k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.90k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  6.90k|#endif
  899|  6.90k|    return 1;
  900|  6.90k|  };

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

_ZN5Exiv29WebPImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
   77|    353|WebPImage::WebPImage(BasicIo::UniquePtr io) : Image(ImageType::webp, mdNone, std::move(io)) {
   78|    353|}  // WebPImage::WebPImage
_ZN5Exiv29WebPImage13writeMetadataEv:
   97|    110|void WebPImage::writeMetadata() {
   98|    110|  if (io_->open() != 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 110]
  ------------------
   99|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  100|      0|  }
  101|    110|  IoCloser closer(*io_);
  102|    110|  MemIo tempIo;
  103|       |
  104|    110|  doWriteMetadata(tempIo);  // may throw
  105|    110|  io_->close();
  106|    110|  io_->transfer(tempIo);  // may throw
  107|    110|}  // WebPImage::writeMetadata
_ZN5Exiv29WebPImage15doWriteMetadataERNS_7BasicIoE:
  109|    110|void WebPImage::doWriteMetadata(BasicIo& outIo) {
  110|    110|  if (!io_->isopen())
  ------------------
  |  Branch (110:7): [True: 0, False: 110]
  ------------------
  111|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  112|    110|  if (!outIo.isopen())
  ------------------
  |  Branch (112:7): [True: 0, False: 110]
  ------------------
  113|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  114|       |
  115|       |#ifdef EXIV2_DEBUG_MESSAGES
  116|       |  std::cout << "Writing metadata" << '\n';
  117|       |#endif
  118|       |
  119|    110|  byte data[WEBP_TAG_SIZE * 3];
  120|    110|  DataBuf chunkId(WEBP_TAG_SIZE + 1);
  121|    110|  chunkId.write_uint8(WEBP_TAG_SIZE, '\0');
  122|       |
  123|    110|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  124|    110|  uint64_t filesize = Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian);
  125|       |
  126|       |  /* Set up header */
  127|    110|  if (outIo.write(data, WEBP_TAG_SIZE * 3) != WEBP_TAG_SIZE * 3)
  ------------------
  |  Branch (127:7): [True: 0, False: 110]
  ------------------
  128|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  129|       |
  130|       |  /* Parse Chunks */
  131|    110|  bool has_size = false;
  132|    110|  bool has_xmp = false;
  133|    110|  bool has_exif = false;
  134|    110|  bool has_vp8x = false;
  135|    110|  bool has_alpha = false;
  136|    110|  bool has_icc = iccProfileDefined();
  137|       |
  138|    110|  uint32_t width = 0;
  139|    110|  uint32_t height = 0;
  140|       |
  141|    110|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  142|    110|  Blob blob;
  143|       |
  144|    110|  if (!exifData_.empty()) {
  ------------------
  |  Branch (144:7): [True: 28, False: 82]
  ------------------
  145|     28|    ExifParser::encode(blob, littleEndian, exifData_);
  146|     28|    if (!blob.empty()) {
  ------------------
  |  Branch (146:9): [True: 25, False: 3]
  ------------------
  147|     25|      has_exif = true;
  148|     25|    }
  149|     28|  }
  150|       |
  151|    110|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (151:7): [True: 4, False: 106]
  |  Branch (151:28): [True: 4, False: 0]
  ------------------
  152|      4|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  153|      4|  }
  154|    110|  has_xmp = !xmpPacket_.empty();
  155|    110|  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|  4.81k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (160:10): [True: 4.80k, False: 9]
  |  Branch (160:25): [True: 4.70k, False: 101]
  ------------------
  161|  4.70k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  162|  4.70k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  163|  4.70k|    const uint32_t size_u32 = Exiv2::getULong(size_buff.data(), littleEndian);
  164|       |
  165|       |    // Check that `size_u32` is within bounds.
  166|  4.70k|    Internal::enforce(size_u32 <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  4.70k|    DataBuf payload(size_u32);
  169|  4.70k|    if (!payload.empty()) {
  ------------------
  |  Branch (169:9): [True: 814, False: 3.89k]
  ------------------
  170|    814|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  171|    814|      if (payload.size() % 2) {
  ------------------
  |  Branch (171:11): [True: 366, False: 448]
  ------------------
  172|    366|        byte c = 0;
  173|    366|        io_->readOrThrow(&c, 1, Exiv2::ErrorCode::kerCorruptedMetadata);
  174|    366|      }
  175|    814|    }
  176|       |
  177|       |    /* Chunk with information about features
  178|       |     used in the file. */
  179|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_vp8x) {
  ------------------
  |  Branch (179:9): [True: 28, False: 4.67k]
  |  Branch (179:59): [True: 21, False: 7]
  ------------------
  180|     21|      has_vp8x = true;
  181|     21|    }
  182|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_size) {
  ------------------
  |  Branch (182:9): [True: 28, False: 4.67k]
  |  Branch (182:59): [True: 19, False: 9]
  ------------------
  183|     19|      Internal::enforce(size_u32 >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  184|     19|      has_size = true;
  185|     19|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  186|       |
  187|       |      // Fetch width - stored in 24bits
  188|     19|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  189|     19|      size_buf.back() = 0;
  190|     19|      width = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  191|       |
  192|       |      // Fetch height - stored in 24bits
  193|     19|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  194|     19|      size_buf.back() = 0;
  195|     19|      height = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  196|     19|    }
  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|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_size) {
  ------------------
  |  Branch (211:9): [True: 18, False: 4.68k]
  |  Branch (211:58): [True: 3, False: 15]
  ------------------
  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|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_alpha) {
  ------------------
  |  Branch (229:9): [True: 85, False: 4.62k]
  |  Branch (229:59): [True: 63, False: 22]
  ------------------
  230|     63|      Internal::enforce(size_u32 >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  231|     63|      if ((payload.read_uint8(4) & WEBP_VP8X_ALPHA_BIT) == WEBP_VP8X_ALPHA_BIT) {
  ------------------
  |  Branch (231:11): [True: 9, False: 54]
  ------------------
  232|      9|        has_alpha = true;
  233|      9|      }
  234|     63|    }
  235|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_size) {
  ------------------
  |  Branch (235:9): [True: 84, False: 4.62k]
  |  Branch (235:59): [True: 27, False: 57]
  ------------------
  236|     27|      Internal::enforce(size_u32 >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  237|     27|      has_size = true;
  238|     27|      std::array<byte, 2> size_buf_w;
  239|     27|      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|     27|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  248|     27|      size_buf_w.back() &= 0x3F;
  249|     27|      width = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  250|       |
  251|       |      // Fetch height - 14 bits wide
  252|     27|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  253|     27|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  254|     27|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  255|     27|      height = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  256|     27|    }
  257|       |
  258|       |    /* Chunk with animation frame. */
  259|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_alpha) {
  ------------------
  |  Branch (259:9): [True: 83, False: 4.62k]
  |  Branch (259:59): [True: 38, False: 45]
  ------------------
  260|     38|      Internal::enforce(size_u32 >= 6, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|     38|      if ((payload.read_uint8(5) & 0x2) == 0x2) {
  ------------------
  |  Branch (261:11): [True: 6, False: 32]
  ------------------
  262|      6|        has_alpha = true;
  263|      6|      }
  264|     38|    }
  265|  4.70k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_size) {
  ------------------
  |  Branch (265:9): [True: 83, False: 4.62k]
  |  Branch (265:59): [True: 10, False: 73]
  ------------------
  266|     10|      Internal::enforce(size_u32 >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  267|     10|      has_size = true;
  268|     10|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  269|       |
  270|       |      // Fetch width - stored in 24bits
  271|     10|      std::copy_n(payload.begin() + 6, 3, size_buf.begin());
  272|     10|      size_buf.back() = 0;
  273|     10|      width = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  274|       |
  275|       |      // Fetch height - stored in 24bits
  276|     10|      std::copy_n(payload.begin() + 9, 3, size_buf.begin());
  277|     10|      size_buf.back() = 0;
  278|     10|      height = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  279|     10|    }
  280|       |
  281|       |    /* Chunk with alpha data. */
  282|  4.70k|    if (equalsWebPTag(chunkId, "ALPH") && !has_alpha) {
  ------------------
  |  Branch (282:9): [True: 17, False: 4.68k]
  |  Branch (282:43): [True: 5, False: 12]
  ------------------
  283|      5|      has_alpha = true;
  284|      5|    }
  285|  4.70k|  }
  286|       |
  287|       |  /* Inject a VP8X chunk if one isn't available. */
  288|    110|  if (!has_vp8x) {
  ------------------
  |  Branch (288:7): [True: 81, False: 29]
  ------------------
  289|     81|    inject_VP8X(outIo, has_xmp, has_exif, has_alpha, has_icc, width, height);
  290|     81|  }
  291|       |
  292|    110|  io_->seek(12, BasicIo::beg);
  293|  4.36k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (293:10): [True: 4.31k, False: 55]
  |  Branch (293:25): [True: 4.25k, False: 55]
  ------------------
  294|  4.25k|    io_->readOrThrow(chunkId.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  295|  4.25k|    io_->readOrThrow(size_buff.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  296|       |
  297|  4.25k|    const uint32_t size_u32 = Exiv2::getULong(size_buff.data(), littleEndian);
  298|       |
  299|       |    // Check that `size_u32` is within bounds.
  300|  4.25k|    Internal::enforce(size_u32 <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  301|       |
  302|  4.25k|    DataBuf payload(size_u32);
  303|  4.25k|    io_->readOrThrow(payload.data(), size_u32, Exiv2::ErrorCode::kerCorruptedMetadata);
  304|  4.25k|    if (io_->tell() % 2)
  ------------------
  |  Branch (304:9): [True: 328, False: 3.92k]
  ------------------
  305|    328|      io_->seek(+1, BasicIo::cur);  // skip pad
  306|       |
  307|  4.25k|    if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X)) {
  ------------------
  |  Branch (307:9): [True: 27, False: 4.23k]
  ------------------
  308|     27|      Internal::enforce(size_u32 >= 1, Exiv2::ErrorCode::kerCorruptedMetadata);
  309|     27|      if (has_icc) {
  ------------------
  |  Branch (309:11): [True: 3, False: 24]
  ------------------
  310|      3|        const uint8_t x = payload.read_uint8(0);
  311|      3|        payload.write_uint8(0, x | WEBP_VP8X_ICC_BIT);
  312|     24|      } else {
  313|     24|        const uint8_t x = payload.read_uint8(0);
  314|     24|        payload.write_uint8(0, x & ~WEBP_VP8X_ICC_BIT);
  315|     24|      }
  316|       |
  317|     27|      if (has_xmp) {
  ------------------
  |  Branch (317:11): [True: 5, False: 22]
  ------------------
  318|      5|        const uint8_t x = payload.read_uint8(0);
  319|      5|        payload.write_uint8(0, x | WEBP_VP8X_XMP_BIT);
  320|     22|      } else {
  321|     22|        const uint8_t x = payload.read_uint8(0);
  322|     22|        payload.write_uint8(0, x & ~WEBP_VP8X_XMP_BIT);
  323|     22|      }
  324|       |
  325|     27|      if (has_exif) {
  ------------------
  |  Branch (325:11): [True: 6, False: 21]
  ------------------
  326|      6|        const uint8_t x = payload.read_uint8(0);
  327|      6|        payload.write_uint8(0, x | WEBP_VP8X_EXIF_BIT);
  328|     21|      } else {
  329|     21|        const uint8_t x = payload.read_uint8(0);
  330|     21|        payload.write_uint8(0, x & ~WEBP_VP8X_EXIF_BIT);
  331|     21|      }
  332|       |
  333|     27|      if (outIo.write(chunkId.c_data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (333:11): [True: 0, False: 27]
  ------------------
  334|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  335|     27|      if (outIo.write(size_buff.data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (335:11): [True: 0, False: 27]
  ------------------
  336|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  337|     27|      if (outIo.write(payload.c_data(), payload.size()) != payload.size())
  ------------------
  |  Branch (337:11): [True: 0, False: 27]
  ------------------
  338|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  339|     27|      if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (339:11): [True: 8, False: 19]
  |  Branch (339:31): [True: 0, False: 8]
  ------------------
  340|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  341|       |
  342|     27|      if (has_icc) {
  ------------------
  |  Branch (342:11): [True: 3, False: 24]
  ------------------
  343|      3|        if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_ICCP), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (343:13): [True: 0, False: 3]
  ------------------
  344|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  345|      3|        ul2Data(data, static_cast<uint32_t>(iccProfile_.size()), littleEndian);
  346|      3|        if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (346:13): [True: 0, False: 3]
  ------------------
  347|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  348|      3|        if (outIo.write(iccProfile_.c_data(), iccProfile_.size()) != iccProfile_.size()) {
  ------------------
  |  Branch (348:13): [True: 0, False: 3]
  ------------------
  349|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  350|      0|        }
  351|      3|        has_icc = false;
  352|      3|      }
  353|  4.23k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (353:16): [True: 52, False: 4.17k]
  ------------------
  354|       |      // Skip it altogether handle it prior to here :)
  355|  4.17k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (355:16): [True: 92, False: 4.08k]
  ------------------
  356|       |      // Skip and add new data afterwards
  357|  4.08k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (357:16): [True: 27, False: 4.05k]
  ------------------
  358|       |      // Skip and add new data afterwards
  359|  4.05k|    } else {
  360|  4.05k|      if (outIo.write(chunkId.c_data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (360:11): [True: 0, False: 4.05k]
  ------------------
  361|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  362|  4.05k|      if (outIo.write(size_buff.data(), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (362:11): [True: 0, False: 4.05k]
  ------------------
  363|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  364|  4.05k|      if (outIo.write(payload.c_data(), payload.size()) != payload.size())
  ------------------
  |  Branch (364:11): [True: 0, False: 4.05k]
  ------------------
  365|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  366|  4.05k|    }
  367|       |
  368|       |    // Encoder required to pad odd sized data with a null byte
  369|  4.25k|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (369:9): [True: 258, False: 3.99k]
  |  Branch (369:29): [True: 0, False: 258]
  ------------------
  370|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  371|  4.25k|  }
  372|       |
  373|    110|  if (has_exif) {
  ------------------
  |  Branch (373:7): [True: 8, False: 102]
  ------------------
  374|      8|    if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_EXIF), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (374:9): [True: 0, False: 8]
  ------------------
  375|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  376|      8|    us2Data(data, static_cast<uint16_t>(blob.size()) + 8, bigEndian);
  377|      8|    ul2Data(data, static_cast<uint32_t>(blob.size()), littleEndian);
  378|      8|    if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (378:9): [True: 0, False: 8]
  ------------------
  379|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  380|      8|    if (outIo.write(blob.data(), blob.size()) != blob.size()) {
  ------------------
  |  Branch (380:9): [True: 0, False: 8]
  ------------------
  381|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  382|      0|    }
  383|      8|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (383:9): [True: 0, False: 8]
  |  Branch (383:29): [True: 0, False: 0]
  ------------------
  384|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  385|      8|  }
  386|       |
  387|    110|  if (has_xmp) {
  ------------------
  |  Branch (387:7): [True: 10, False: 100]
  ------------------
  388|     10|    if (outIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_XMP), WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (388:9): [True: 0, False: 10]
  ------------------
  389|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  390|     10|    ul2Data(data, static_cast<uint32_t>(xmpPacket().size()), littleEndian);
  391|     10|    if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (391:9): [True: 0, False: 10]
  ------------------
  392|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  393|     10|    if (outIo.write(reinterpret_cast<const byte*>(xmp.data()), xmp.size()) != xmp.size()) {
  ------------------
  |  Branch (393:9): [True: 0, False: 10]
  ------------------
  394|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  395|      0|    }
  396|     10|    if (outIo.tell() % 2 && outIo.write(&WEBP_PAD_ODD, 1) != 1)
  ------------------
  |  Branch (396:9): [True: 9, False: 1]
  |  Branch (396:29): [True: 0, False: 9]
  ------------------
  397|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  398|     10|  }
  399|       |
  400|       |  // Fix File Size Payload Data
  401|    110|  outIo.seek(0, BasicIo::beg);
  402|    110|  filesize = outIo.size() - 8;
  403|    110|  outIo.seek(4, BasicIo::beg);
  404|    110|  ul2Data(data, static_cast<uint32_t>(filesize), littleEndian);
  405|    110|  if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE)
  ------------------
  |  Branch (405:7): [True: 0, False: 110]
  ------------------
  406|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  407|       |
  408|    110|}  // WebPImage::writeMetadata
_ZN5Exiv29WebPImage12readMetadataEv:
  475|    353|void WebPImage::readMetadata() {
  476|    353|  if (io_->open() != 0)
  ------------------
  |  Branch (476:7): [True: 0, False: 353]
  ------------------
  477|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  478|    353|  IoCloser closer(*io_);
  479|       |  // Ensure that this is the correct image type
  480|    353|  if (!isWebPType(*io_, true)) {
  ------------------
  |  Branch (480:7): [True: 0, False: 353]
  ------------------
  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|    353|  clearMetadata();
  486|       |
  487|    353|  byte data[12];
  488|    353|  DataBuf chunkId(5);
  489|    353|  chunkId.write_uint8(4, '\0');
  490|       |
  491|    353|  io_->readOrThrow(data, WEBP_TAG_SIZE * 3, Exiv2::ErrorCode::kerCorruptedMetadata);
  492|       |
  493|    353|  const uint32_t filesize = Safe::add(Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian), 8U);
  494|    353|  Internal::enforce(filesize <= io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  495|       |
  496|    353|  WebPImage::decodeChunks(filesize);
  497|       |
  498|    353|}  // WebPImage::readMetadata
_ZN5Exiv29WebPImage12decodeChunksEj:
  500|    325|void WebPImage::decodeChunks(uint32_t filesize) {
  501|    325|  DataBuf chunkId(5);
  502|    325|  std::array<byte, WEBP_TAG_SIZE> size_buff;
  503|    325|  bool has_canvas_data = false;
  504|       |
  505|       |#ifdef EXIV2_DEBUG_MESSAGES
  506|       |  std::cout << "Reading metadata" << '\n';
  507|       |#endif
  508|       |
  509|    325|  chunkId.write_uint8(4, '\0');
  510|  7.56k|  while (!io_->eof() && io_->tell() < filesize) {
  ------------------
  |  Branch (510:10): [True: 7.40k, False: 165]
  |  Branch (510:25): [True: 7.24k, False: 160]
  ------------------
  511|  7.24k|    io_->readOrThrow(chunkId.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  512|  7.24k|    io_->readOrThrow(size_buff.data(), WEBP_TAG_SIZE, Exiv2::ErrorCode::kerCorruptedMetadata);
  513|       |
  514|  7.24k|    const uint32_t size = Exiv2::getULong(size_buff.data(), littleEndian);
  515|       |
  516|       |    // Check that `size` is within bounds.
  517|  7.24k|    Internal::enforce(io_->tell() <= filesize, Exiv2::ErrorCode::kerCorruptedMetadata);
  518|  7.24k|    Internal::enforce(size <= (filesize - io_->tell()), Exiv2::ErrorCode::kerCorruptedMetadata);
  519|       |
  520|  7.24k|    if (DataBuf payload(size); payload.empty()) {
  ------------------
  |  Branch (520:32): [True: 5.70k, False: 1.53k]
  ------------------
  521|  5.70k|      io_->seek(size, BasicIo::cur);
  522|  5.70k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_canvas_data) {
  ------------------
  |  Branch (522:16): [True: 41, False: 1.49k]
  |  Branch (522:66): [True: 32, False: 9]
  ------------------
  523|     32|      Internal::enforce(size >= 10, Exiv2::ErrorCode::kerCorruptedMetadata);
  524|       |
  525|     32|      has_canvas_data = true;
  526|     32|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  527|       |
  528|     32|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  529|       |
  530|       |      // Fetch width
  531|     32|      std::copy_n(payload.begin() + 4, 3, size_buf.begin());
  532|     32|      size_buf.back() = 0;
  533|     32|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  534|       |
  535|       |      // Fetch height
  536|     32|      std::copy_n(payload.begin() + 7, 3, size_buf.begin());
  537|     32|      size_buf.back() = 0;
  538|     32|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  539|  1.50k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_canvas_data) {
  ------------------
  |  Branch (539:16): [True: 40, False: 1.46k]
  |  Branch (539:65): [True: 14, False: 26]
  ------------------
  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.48k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_canvas_data) {
  ------------------
  |  Branch (557:16): [True: 112, False: 1.37k]
  |  Branch (557:66): [True: 43, False: 69]
  ------------------
  558|     43|      Internal::enforce(size >= 5, Exiv2::ErrorCode::kerCorruptedMetadata);
  559|       |
  560|     43|      has_canvas_data = true;
  561|     43|      std::array<byte, 2> size_buf_w;
  562|     43|      std::array<byte, 3> size_buf_h;
  563|       |
  564|     43|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  565|       |
  566|       |      // Fetch width
  567|     43|      std::copy_n(payload.begin() + 1, 2, size_buf_w.begin());
  568|     43|      size_buf_w.back() &= 0x3F;
  569|     43|      pixelWidth_ = Exiv2::getUShort(size_buf_w.data(), littleEndian) + 1;
  570|       |
  571|       |      // Fetch height
  572|     43|      std::copy_n(payload.begin() + 2, 3, size_buf_h.begin());
  573|     43|      size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3FU) << 0x2);
  574|     43|      size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xFU) << 0x2);
  575|     43|      pixelHeight_ = Exiv2::getUShort(size_buf_h.data(), littleEndian) + 1;
  576|  1.44k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_canvas_data) {
  ------------------
  |  Branch (576:16): [True: 113, False: 1.33k]
  |  Branch (576:66): [True: 21, False: 92]
  ------------------
  577|     21|      Internal::enforce(size >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  578|       |
  579|     21|      has_canvas_data = true;
  580|     21|      std::array<byte, WEBP_TAG_SIZE> size_buf;
  581|       |
  582|     21|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  583|       |
  584|       |      // Fetch width
  585|     21|      std::copy_n(payload.begin() + 6, 3, size_buf.begin());
  586|     21|      size_buf.back() = 0;
  587|     21|      pixelWidth_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  588|       |
  589|       |      // Fetch height
  590|     21|      std::copy_n(payload.begin() + 9, 3, size_buf.begin());
  591|     21|      size_buf.back() = 0;
  592|     21|      pixelHeight_ = Exiv2::getULong(size_buf.data(), littleEndian) + 1;
  593|  1.42k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
  ------------------
  |  Branch (593:16): [True: 10, False: 1.41k]
  ------------------
  594|     10|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  595|     10|      this->setIccProfile(std::move(payload));
  596|  1.41k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
  ------------------
  |  Branch (596:16): [True: 247, False: 1.16k]
  ------------------
  597|    247|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  598|       |
  599|    247|      std::array<byte, 2> size_buff2;
  600|       |      // 4 meaningful bytes + 2 padding bytes
  601|    247|      auto exifLongHeader = std::array<byte, 6>{0xFF, 0x01, 0xFF, 0xE1, 0x00, 0x00};
  602|    247|      auto exifShortHeader = std::array<byte, 6>{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  603|    247|      const byte exifTiffLEHeader[] = {0x49, 0x49, 0x2A};        // "MM*"
  604|    247|      const byte exifTiffBEHeader[] = {0x4D, 0x4D, 0x00, 0x2A};  // "II\0*"
  605|    247|      size_t offset = 0;
  606|    247|      bool s_header = false;
  607|    247|      bool le_header = false;
  608|    247|      bool be_header = false;
  609|    247|      size_t pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 4);
  610|       |
  611|    247|      if (pos == std::string::npos) {
  ------------------
  |  Branch (611:11): [True: 243, False: 4]
  ------------------
  612|    243|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifLongHeader.data(), 6);
  613|    243|        if (pos != std::string::npos) {
  ------------------
  |  Branch (613:13): [True: 0, False: 243]
  ------------------
  614|      0|          s_header = true;
  615|      0|        }
  616|    243|      }
  617|    247|      if (pos == std::string::npos) {
  ------------------
  |  Branch (617:11): [True: 243, False: 4]
  ------------------
  618|    243|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffLEHeader, 3);
  619|    243|        if (pos != std::string::npos) {
  ------------------
  |  Branch (619:13): [True: 35, False: 208]
  ------------------
  620|     35|          le_header = true;
  621|     35|        }
  622|    243|      }
  623|    247|      if (pos == std::string::npos) {
  ------------------
  |  Branch (623:11): [True: 208, False: 39]
  ------------------
  624|    208|        pos = getHeaderOffset(payload.c_data(), payload.size(), exifTiffBEHeader, 4);
  625|    208|        if (pos != std::string::npos) {
  ------------------
  |  Branch (625:13): [True: 72, False: 136]
  ------------------
  626|     72|          be_header = true;
  627|     72|        }
  628|    208|      }
  629|       |
  630|    247|      if (s_header) {
  ------------------
  |  Branch (630:11): [True: 0, False: 247]
  ------------------
  631|      0|        offset += 6;
  632|      0|      }
  633|    247|      if (be_header || le_header) {
  ------------------
  |  Branch (633:11): [True: 72, False: 175]
  |  Branch (633:24): [True: 35, False: 140]
  ------------------
  634|    107|        offset += 12;
  635|    107|      }
  636|       |
  637|    247|      const size_t sizePayload = Safe::add(payload.size(), offset);
  638|    247|      DataBuf rawExifData(sizePayload);
  639|       |
  640|    247|      if (s_header) {
  ------------------
  |  Branch (640:11): [True: 0, False: 247]
  ------------------
  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|    247|      if (be_header || le_header) {
  ------------------
  |  Branch (646:11): [True: 72, False: 175]
  |  Branch (646:24): [True: 35, False: 140]
  ------------------
  647|    107|        us2Data(size_buff2.data(), static_cast<uint16_t>(sizePayload - 6), bigEndian);
  648|    107|        std::copy_n(exifLongHeader.begin(), 4, rawExifData.begin());
  649|    107|        std::copy(size_buff2.begin(), size_buff2.end(), rawExifData.begin() + 4);
  650|    107|        std::copy(exifShortHeader.begin(), exifShortHeader.end(), rawExifData.begin() + 6);
  651|    107|      }
  652|       |
  653|    247|      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|    247|      if (pos != std::string::npos) {
  ------------------
  |  Branch (660:11): [True: 111, False: 136]
  ------------------
  661|    111|        XmpData xmpData;
  662|    111|        ByteOrder bo = ExifParser::decode(exifData_, payload.c_data(pos), payload.size() - pos);
  663|    111|        setByteOrder(bo);
  664|    136|      } else {
  665|    136|#ifndef SUPPRESS_WARNINGS
  666|    136|        EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    136|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 136]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    136|  LogMsg(LogMsg::warn).os()
  ------------------
  667|    136|#endif
  668|    136|        exifData_.clear();
  669|    136|      }
  670|  1.16k|    } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) {
  ------------------
  |  Branch (670:16): [True: 50, False: 1.11k]
  ------------------
  671|     50|      io_->readOrThrow(payload.data(), payload.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  672|     50|      xmpPacket_.assign(payload.c_str(), payload.size());
  673|     50|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (673:11): [True: 50, False: 0]
  |  Branch (673:34): [True: 46, False: 4]
  ------------------
  674|     46|#ifndef SUPPRESS_WARNINGS
  675|     46|        EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|     46|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 46]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     46|  LogMsg(LogMsg::warn).os()
  ------------------
  676|     46|#endif
  677|     46|      } 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|      4|      }
  683|  1.11k|    } else {
  684|  1.11k|      io_->seek(size, BasicIo::cur);
  685|  1.11k|    }
  686|       |
  687|  7.24k|    if (io_->tell() % 2)
  ------------------
  |  Branch (687:9): [True: 623, False: 6.61k]
  ------------------
  688|    623|      io_->seek(+1, BasicIo::cur);
  689|  7.24k|  }
  690|    325|}
_ZN5Exiv215newWebPInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  694|    353|Image::UniquePtr newWebPInstance(BasicIo::UniquePtr io, bool /*create*/) {
  695|    353|  auto image = std::make_unique<WebPImage>(std::move(io));
  696|    353|  if (!image->good()) {
  ------------------
  |  Branch (696:7): [True: 0, False: 353]
  ------------------
  697|      0|    return nullptr;
  698|      0|  }
  699|    353|  return image;
  700|    353|}
_ZN5Exiv210isWebPTypeERNS_7BasicIoEb:
  702|  30.7k|bool isWebPType(BasicIo& iIo, bool /*advance*/) {
  703|  30.7k|  if (iIo.size() < 12) {
  ------------------
  |  Branch (703:7): [True: 189, False: 30.5k]
  ------------------
  704|    189|    return false;
  705|    189|  }
  706|  30.5k|  const int32_t len = 4;
  707|  30.5k|  constexpr std::array<byte, len> RiffImageId{'R', 'I', 'F', 'F'};
  708|  30.5k|  constexpr std::array<byte, len> WebPImageId{'W', 'E', 'B', 'P'};
  709|  30.5k|  std::array<byte, len> webp;
  710|  30.5k|  std::array<byte, len> data;
  711|  30.5k|  std::array<byte, len> riff;
  712|  30.5k|  iIo.readOrThrow(riff.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  713|  30.5k|  iIo.readOrThrow(data.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  714|  30.5k|  iIo.readOrThrow(webp.data(), len, Exiv2::ErrorCode::kerCorruptedMetadata);
  715|  30.5k|  bool matched_riff = riff == RiffImageId;
  716|  30.5k|  bool matched_webp = webp == WebPImageId;
  717|  30.5k|  iIo.seek(-12, BasicIo::cur);
  718|  30.5k|  return matched_riff && matched_webp;
  ------------------
  |  Branch (718:10): [True: 1.82k, False: 28.6k]
  |  Branch (718:26): [True: 1.05k, False: 761]
  ------------------
  719|  30.7k|}
_ZN5Exiv29WebPImage13equalsWebPTagERKNS_7DataBufEPKc:
  728|  63.5k|bool WebPImage::equalsWebPTag(const Exiv2::DataBuf& buf, const char* str) {
  729|  73.5k|  for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (729:19): [True: 72.3k, False: 1.23k]
  ------------------
  730|  72.3k|    if (toupper(buf.read_uint8(i)) != str[i])
  ------------------
  |  Branch (730:9): [True: 62.2k, False: 10.0k]
  ------------------
  731|  62.2k|      return false;
  732|  1.23k|  return true;
  733|  63.5k|}
_ZNK5Exiv29WebPImage11inject_VP8XERNS_7BasicIoEbbbbjj:
  743|     81|                            uint32_t height) const {
  744|     81|  const byte size[4] = {0x0A, 0x00, 0x00, 0x00};
  745|     81|  byte data[10] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  746|     81|  iIo.write(reinterpret_cast<const byte*>(WEBP_CHUNK_HEADER_VP8X), WEBP_TAG_SIZE);
  747|     81|  iIo.write(size, WEBP_TAG_SIZE);
  748|       |
  749|     81|  if (has_alpha) {
  ------------------
  |  Branch (749:7): [True: 12, False: 69]
  ------------------
  750|     12|    data[0] |= WEBP_VP8X_ALPHA_BIT;
  751|     12|  }
  752|       |
  753|     81|  if (has_icc) {
  ------------------
  |  Branch (753:7): [True: 1, False: 80]
  ------------------
  754|      1|    data[0] |= WEBP_VP8X_ICC_BIT;
  755|      1|  }
  756|       |
  757|     81|  if (has_xmp) {
  ------------------
  |  Branch (757:7): [True: 11, False: 70]
  ------------------
  758|     11|    data[0] |= WEBP_VP8X_XMP_BIT;
  759|     11|  }
  760|       |
  761|     81|  if (has_exif) {
  ------------------
  |  Branch (761:7): [True: 21, False: 60]
  ------------------
  762|     21|    data[0] |= WEBP_VP8X_EXIF_BIT;
  763|     21|  }
  764|       |
  765|       |  /* set width - stored in 24bits*/
  766|     81|  Internal::enforce(width > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  767|     81|  uint32_t w = width - 1;
  768|     81|  data[4] = w & 0xFF;
  769|     81|  data[5] = (w >> 8) & 0xFF;
  770|     81|  data[6] = (w >> 16) & 0xFF;
  771|       |
  772|       |  /* set height - stored in 24bits */
  773|     81|  Internal::enforce(height > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  774|     81|  uint32_t h = height - 1;
  775|     81|  data[7] = h & 0xFF;
  776|     81|  data[8] = (h >> 8) & 0xFF;
  777|     81|  data[9] = (h >> 16) & 0xFF;
  778|       |
  779|     81|  iIo.write(data, 10);
  780|       |
  781|       |  /* Handle inject an icc profile right after VP8X chunk */
  782|     81|  if (has_icc) {
  ------------------
  |  Branch (782:7): [True: 0, False: 81]
  ------------------
  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|     81|}
_ZN5Exiv29WebPImage15getHeaderOffsetEPKhmS2_m:
  796|    941|size_t WebPImage::getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size) {
  797|    941|  size_t pos = std::string::npos;  // error value
  798|    941|  if (data_size < header_size) {
  ------------------
  |  Branch (798:7): [True: 312, False: 629]
  ------------------
  799|    312|    return pos;
  800|    312|  }
  801|   478k|  for (size_t i = 0; i < data_size - header_size; i++) {
  ------------------
  |  Branch (801:22): [True: 478k, False: 518]
  ------------------
  802|   478k|    if (memcmp(header, &data[i], header_size) == 0) {
  ------------------
  |  Branch (802:9): [True: 111, False: 478k]
  ------------------
  803|    111|      pos = i;
  804|    111|      break;
  805|    111|    }
  806|   478k|  }
  807|    629|  return pos;
  808|    941|}

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   192k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   192k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 133k, False: 58.4k]
  ------------------
  253|   133k|    value_ = pValue->clone();
  254|   192k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   239k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   239k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 239k, False: 0]
  ------------------
  258|   239k|    key_ = rhs.key_->clone();  // deep copy
  259|   239k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 239k, False: 0]
  ------------------
  260|   239k|    value_ = rhs.value_->clone();  // deep copy
  261|   239k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  263|  2.40k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  264|  2.40k|  if (this == &rhs)
  ------------------
  |  Branch (264:7): [True: 0, False: 2.40k]
  ------------------
  265|      0|    return *this;
  266|  2.40k|  key_.reset();
  267|  2.40k|  if (rhs.key_)
  ------------------
  |  Branch (267:7): [True: 2.40k, False: 0]
  ------------------
  268|  2.40k|    key_ = rhs.key_->clone();  // deep copy
  269|  2.40k|  value_.reset();
  270|  2.40k|  if (rhs.value_)
  ------------------
  |  Branch (270:7): [True: 2.40k, False: 0]
  ------------------
  271|  2.40k|    value_ = rhs.value_->clone();  // deep copy
  272|  2.40k|  return *this;
  273|  2.40k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   192k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   192k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   239k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   239k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  281|  2.40k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  282|  2.40k|  if (this == &rhs)
  ------------------
  |  Branch (282:7): [True: 0, False: 2.40k]
  ------------------
  283|      0|    return *this;
  284|  2.40k|  *p_ = *rhs.p_;
  285|  2.40k|  return *this;
  286|  2.40k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   431k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  19.3M|std::string Xmpdatum::key() const {
  291|  19.3M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 19.3M, False: 0]
  ------------------
  292|  19.3M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  298|   117k|std::string Xmpdatum::groupName() const {
  299|   117k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (299:10): [True: 117k, False: 0]
  ------------------
  300|   117k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  302|   308k|std::string Xmpdatum::tagName() const {
  303|   308k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (303:10): [True: 308k, False: 0]
  ------------------
  304|   308k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|   584k|TypeId Xmpdatum::typeId() const {
  319|   584k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 584k, False: 0]
  ------------------
  320|   584k|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|   180k|size_t Xmpdatum::count() const {
  331|   180k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 180k, False: 0]
  ------------------
  332|   180k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  338|  3.37k|std::string Xmpdatum::toString() const {
  339|  3.37k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (339:10): [True: 3.37k, False: 0]
  ------------------
  340|  3.37k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  342|   389k|std::string Xmpdatum::toString(size_t n) const {
  343|   389k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 389k, False: 0]
  ------------------
  344|   389k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|   322k|const Value& Xmpdatum::value() const {
  363|   322k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 322k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|   322k|  return *p_->value_;
  366|   322k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  376|  29.0k|void Xmpdatum::setValue(const Value* pValue) {
  377|  29.0k|  p_->value_.reset();
  378|  29.0k|  if (pValue)
  ------------------
  |  Branch (378:7): [True: 29.0k, False: 0]
  ------------------
  379|  29.0k|    p_->value_ = pValue->clone();
  380|  29.0k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   882k|int Xmpdatum::setValue(const std::string& value) {
  383|   882k|  XmpProperties::XmpLock lock;
  384|   882k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 43.9k, False: 838k]
  ------------------
  385|  43.9k|    TypeId type = xmpText;
  386|  43.9k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 43.9k, False: 0]
  ------------------
  387|  43.9k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  43.9k|    }
  389|  43.9k|    p_->value_ = Value::create(type);
  390|  43.9k|  }
  391|   882k|  return p_->value_->read(value);
  392|   882k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   914k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   914k|  XmpProperties::XmpLock lock;
  396|   914k|  XmpKey xmpKey(key, lock);
  397|   914k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   914k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 58.4k, False: 855k]
  ------------------
  399|  58.4k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  58.4k|  }
  401|   855k|  return *pos;
  402|   914k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  4.60k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  4.60k|  XmpProperties::XmpLock lock;
  406|  4.60k|  return addUnlocked(key, value, lock);
  407|  4.60k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   133k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   133k|  xmpMetadata_.emplace_back(key, value);
  411|   133k|  return 0;
  412|   133k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  12.0k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  12.0k|  XmpProperties::XmpLock lock;
  426|  12.0k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  12.0k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   325k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   325k|  XmpProperties::XmpLock lock;
  431|   325k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   325k|}
_ZN5Exiv27XmpData5clearEv:
  434|  39.1k|void XmpData::clear() {
  435|  39.1k|  XmpProperties::XmpLock lock;
  436|  39.1k|  clearUnlocked(lock);
  437|  39.1k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  48.5k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  48.5k|  xmpMetadata_.clear();
  441|  48.5k|}
_ZNK5Exiv27XmpData5beginEv:
  452|  4.00k|XmpData::const_iterator XmpData::begin() const {
  453|  4.00k|  return xmpMetadata_.begin();
  454|  4.00k|}
_ZNK5Exiv27XmpData3endEv:
  456|  16.0k|XmpData::const_iterator XmpData::end() const {
  457|  16.0k|  return xmpMetadata_.end();
  458|  16.0k|}
_ZNK5Exiv27XmpData5emptyEv:
  460|  2.68k|bool XmpData::empty() const {
  461|  2.68k|  XmpProperties::XmpLock lock;
  462|  2.68k|  return emptyUnlocked(lock);
  463|  2.68k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  465|  36.2k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  466|  36.2k|  return xmpMetadata_.empty();
  467|  36.2k|}
_ZN5Exiv27XmpData5beginEv:
  478|  7.39k|XmpData::iterator XmpData::begin() {
  479|  7.39k|  return xmpMetadata_.begin();
  480|  7.39k|}
_ZN5Exiv27XmpData3endEv:
  482|   332k|XmpData::iterator XmpData::end() {
  483|   332k|  return xmpMetadata_.end();
  484|   332k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  486|  1.09k|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  487|  1.09k|  XmpProperties::XmpLock lock;
  488|  1.09k|  return xmpMetadata_.erase(pos);
  489|  1.09k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  535|   126k|void xmpToolkitEnsureInitialized() {
  536|   126k|  static XmpToolkitLifetimeManager instance;
  537|   126k|  (void)instance;
  538|   126k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  540|  83.7k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  541|  83.7k|  xmpToolkitEnsureInitialized();
  542|  83.7k|  try {
  543|  83.7k|    std::string existingPrefix;
  544|  83.7k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (544:9): [True: 82.7k, False: 971]
  ------------------
  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.3k, False: 425]
  ------------------
  549|       |        // Already registered correctly, skip overhead
  550|  82.3k|        return;
  551|  82.3k|      }
  552|  82.7k|    }
  553|       |
  554|  1.39k|    SXMPMeta::DeleteNamespace(ns.c_str());
  555|       |#ifdef EXV_ADOBE_XMPSDK
  556|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  557|       |#else
  558|  1.39k|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  559|  1.39k|#endif
  560|  1.39k|  } catch (const XMP_Error& /* e */) {
  561|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  562|      0|  }
  563|  83.7k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  660|  10.9k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  661|  10.9k|  try {
  662|  10.9k|    xmpData.setPacket(xmpPacket);
  663|  10.9k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (663:9): [True: 1.51k, False: 9.41k]
  ------------------
  664|  1.51k|      xmpData.clear();
  665|  1.51k|      return 0;
  666|  1.51k|    }
  667|       |
  668|       |    // Acquire Giant Lock
  669|  9.41k|    XmpProperties::XmpLock lock;
  670|  9.41k|    try {
  671|  9.41k|      xmpToolkitEnsureInitialized();
  672|  9.41k|    } 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|  9.41k|    xmpData.clearUnlocked(lock);
  680|       |
  681|       |    // Make sure the unterminated substring is used
  682|  9.41k|    size_t len = xmpPacket.size();
  683|  1.02M|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (683:12): [True: 1.02M, False: 434]
  |  Branch (683:23): [True: 1.01M, False: 8.98k]
  ------------------
  684|  1.01M|      --len;
  685|       |
  686|  9.41k|    XMLValidator::check(xmpPacket.data(), len);
  687|  9.41k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  688|  9.41k|    SXMPIterator iter(meta);
  689|  9.41k|    std::string schemaNs;
  690|  9.41k|    std::string propPath;
  691|  9.41k|    std::string propValue;
  692|  9.41k|    XMP_OptionBits opt = 0;
  693|   152k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (693:12): [True: 143k, False: 9.41k]
  ------------------
  694|   143k|      printNode(schemaNs, propPath, propValue, opt);
  695|   143k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (695:11): [True: 0, False: 143k]
  ------------------
  696|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  697|      0|      }
  698|   143k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (698:11): [True: 14.0k, False: 129k]
  ------------------
  699|       |        // Register unknown namespaces with Exiv2
  700|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  701|  14.0k|        if (XmpProperties::prefixUnlocked(schemaNs, lock).empty()) {
  ------------------
  |  Branch (701:13): [True: 7.01k, False: 7.03k]
  ------------------
  702|  7.01k|          std::string prefix;
  703|  7.01k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (703:15): [True: 0, False: 7.01k]
  ------------------
  704|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  705|  7.01k|          prefix.pop_back();
  706|  7.01k|          XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  707|  7.01k|        }
  708|  14.0k|        continue;
  709|  14.0k|      }
  710|   129k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  711|   129k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (711:11): [True: 1.12k, False: 128k]
  ------------------
  712|       |        // Read Lang Alt property
  713|  1.12k|        auto val = std::make_unique<LangAltValue>();
  714|  1.12k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  715|  8.34k|        while (count-- > 0) {
  ------------------
  |  Branch (715:16): [True: 7.21k, False: 1.12k]
  ------------------
  716|       |          // Get the text
  717|  7.21k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  718|  7.21k|          printNode(schemaNs, propPath, propValue, opt);
  719|  7.21k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (719:15): [True: 0, False: 7.21k]
  |  Branch (719:28): [True: 0, False: 7.21k]
  |  Branch (719:54): [True: 0, False: 7.21k]
  ------------------
  720|      0|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  721|      0|          }
  722|  7.21k|          std::string text = propValue;
  723|       |          // Get the language qualifier
  724|  7.21k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  725|  7.21k|          printNode(schemaNs, propPath, propValue, opt);
  726|  7.21k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (726:15): [True: 0, False: 7.21k]
  |  Branch (726:15): [True: 0, False: 7.21k]
  |  Branch (726:28): [True: 0, False: 7.21k]
  |  Branch (726:54): [True: 0, False: 7.21k]
  ------------------
  727|  7.21k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (727:15): [True: 0, False: 7.21k]
  ------------------
  728|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  729|      0|          }
  730|  7.21k|          val->value_[propValue] = std::move(text);
  731|  7.21k|        }
  732|  1.12k|        xmpData.addUnlocked(*key, val.get(), lock);
  733|  1.12k|        continue;
  734|  1.12k|      }
  735|   128k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (735:11): [True: 2.68k, False: 125k]
  |  Branch (735:35): [True: 2.68k, False: 0]
  |  Branch (735:66): [True: 2.68k, False: 0]
  ------------------
  736|       |        // Check if all elements are simple
  737|  2.68k|        bool simpleArray = true;
  738|  2.68k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  739|  2.68k|        std::string aSchemaNs;
  740|  2.68k|        std::string aPropPath;
  741|  2.68k|        std::string aPropValue;
  742|  2.68k|        XMP_OptionBits aOpt = 0;
  743|  72.2k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (743:16): [True: 69.9k, False: 2.30k]
  ------------------
  744|  69.9k|          if (propPath == aPropPath)
  ------------------
  |  Branch (744:15): [True: 2.68k, False: 67.2k]
  ------------------
  745|  2.68k|            continue;
  746|  67.2k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (746:15): [True: 207, False: 67.0k]
  |  Branch (746:42): [True: 175, False: 66.8k]
  |  Branch (746:73): [True: 0, False: 66.8k]
  ------------------
  747|  67.2k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (747:15): [True: 0, False: 66.8k]
  |  Branch (747:41): [True: 0, False: 66.8k]
  ------------------
  748|    382|            simpleArray = false;
  749|    382|            break;
  750|    382|          }
  751|  67.2k|        }
  752|  2.68k|        if (simpleArray) {
  ------------------
  |  Branch (752:13): [True: 2.30k, False: 382]
  ------------------
  753|       |          // Read the array into an XmpArrayValue
  754|  2.30k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  755|  2.30k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  756|  66.3k|          while (count-- > 0) {
  ------------------
  |  Branch (756:18): [True: 63.9k, False: 2.30k]
  ------------------
  757|  63.9k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  758|  63.9k|            printNode(schemaNs, propPath, propValue, opt);
  759|  63.9k|            val->read(propValue);
  760|  63.9k|          }
  761|  2.30k|          xmpData.addUnlocked(*key, val.get(), lock);
  762|  2.30k|          continue;
  763|  2.30k|        }
  764|  2.68k|      }
  765|       |
  766|   125k|      auto val = std::make_unique<XmpTextValue>();
  767|   125k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (767:11): [True: 8.96k, False: 116k]
  |  Branch (767:36): [True: 382, False: 116k]
  ------------------
  768|       |        // Create a metadatum with only XMP options
  769|  9.34k|        val->setXmpArrayType(xmpArrayType(opt));
  770|  9.34k|        val->setXmpStruct(xmpStruct(opt));
  771|  9.34k|        xmpData.addUnlocked(*key, val.get(), lock);
  772|  9.34k|        continue;
  773|  9.34k|      }
  774|   116k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (774:11): [True: 116k, False: 0]
  |  Branch (774:36): [True: 0, False: 0]
  ------------------
  775|   116k|        val->read(propValue);
  776|   116k|        xmpData.addUnlocked(*key, val.get(), lock);
  777|   116k|        continue;
  778|   116k|      }
  779|       |      // Don't let any node go by unnoticed
  780|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  781|   116k|    }  // iterate through all XMP nodes
  782|       |
  783|  9.41k|    return 0;
  784|  9.41k|  }
  785|  10.9k|#ifndef SUPPRESS_WARNINGS
  786|  10.9k|  catch (const Error& e) {
  787|     70|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (787:9): [True: 0, False: 70]
  ------------------
  788|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  789|      0|    }
  790|     70|    throw;
  791|  3.71k|  } catch (const XMP_Error& e) {
  792|  3.71k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  3.71k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.71k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.71k|  LogMsg(LogMsg::error).os()
  ------------------
  793|  3.71k|    xmpData.clear();
  794|  3.71k|    return 3;
  795|  3.71k|  }
  796|       |#else
  797|       |  catch (const XMP_Error&) {
  798|       |    xmpData.clear();
  799|       |    return 3;
  800|       |  }
  801|       |#endif  // SUPPRESS_WARNINGS
  802|  10.9k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  816|  33.6k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  817|  33.6k|  try {
  818|       |    // Acquire Giant Lock
  819|  33.6k|    XmpProperties::XmpLock lock;
  820|  33.6k|    try {
  821|  33.6k|      xmpToolkitEnsureInitialized();
  822|  33.6k|    } 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|  33.6k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (829:9): [True: 29.5k, False: 4.00k]
  ------------------
  830|  29.5k|      xmpPacket.clear();
  831|  29.5k|      return 0;
  832|  29.5k|    }  // 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.7k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (834:33): [True: 83.7k, False: 4.00k]
  ------------------
  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.7k|      registerNsImpl(xmp, uri.prefix_);
  840|  83.7k|    }
  841|       |
  842|  4.00k|    SXMPMeta meta;
  843|   117k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (843:26): [True: 117k, False: 4.00k]
  ------------------
  844|       |      // Must use Unlocked version of ns() because we hold the lock!
  845|   117k|      const std::string ns = XmpProperties::nsUnlocked(xmp.groupName(), lock);
  846|   117k|      XMP_OptionBits options = 0;
  847|       |
  848|   117k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (848:11): [True: 976, False: 116k]
  ------------------
  849|       |        // Encode Lang Alt property
  850|    976|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  851|    976|        if (!la)
  ------------------
  |  Branch (851:13): [True: 0, False: 976]
  ------------------
  852|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  853|       |
  854|    976|        int idx = 1;
  855|  3.94k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (855:40): [True: 3.94k, False: 976]
  ------------------
  856|  3.94k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (856:15): [True: 3.90k, False: 42]
  ------------------
  857|  3.90k|            printNode(ns, xmp.tagName(), specs, 0);
  858|  3.90k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  859|  3.90k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  860|  3.90k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  861|  3.90k|          }
  862|  3.94k|        }
  863|    976|        continue;
  864|    976|      }
  865|       |
  866|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  867|   116k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  868|   116k|      if (!val)
  ------------------
  |  Branch (868:11): [True: 0, False: 116k]
  ------------------
  869|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  870|   116k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  871|   116k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (871:11): [True: 223, False: 116k]
  |  Branch (871:37): [True: 1.35k, False: 115k]
  |  Branch (871:63): [True: 287, False: 114k]
  ------------------
  872|  1.86k|        printNode(ns, xmp.tagName(), "", options);
  873|  1.86k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  874|  64.8k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (874:30): [True: 62.9k, False: 1.86k]
  ------------------
  875|  62.9k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  876|  62.9k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  877|  62.9k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  878|  62.9k|        }
  879|  1.86k|        continue;
  880|  1.86k|      }
  881|   114k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (881:11): [True: 114k, False: 0]
  ------------------
  882|   114k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  883|   114k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (883:13): [True: 3.26k, False: 111k]
  |  Branch (883:33): [True: 7.92k, False: 103k]
  |  Branch (883:72): [True: 294, False: 103k]
  ------------------
  884|  11.4k|          printNode(ns, xmp.tagName(), "", options);
  885|  11.4k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  886|   103k|        } else {
  887|   103k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  888|   103k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  889|   103k|        }
  890|   114k|        continue;
  891|   114k|      }
  892|       |      // Don't let any Xmpdatum go by unnoticed
  893|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  894|   114k|    }
  895|  4.00k|    std::string tmpPacket;
  896|  4.00k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  897|  4.00k|                           padding);  // throws
  898|  4.00k|    xmpPacket = std::move(tmpPacket);
  899|       |
  900|  4.00k|    return 0;
  901|  4.00k|  }
  902|  33.6k|#ifndef SUPPRESS_WARNINGS
  903|  33.6k|  catch (const Error& /* e */) {
  904|      0|    throw;
  905|    113|  } catch (const XMP_Error& e) {
  906|    113|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    113|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 113]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    113|  LogMsg(LogMsg::error).os()
  ------------------
  907|    113|    return 3;
  908|    113|  }
  909|       |#else
  910|       |  catch (const XMP_Error&) {
  911|       |    return 3;
  912|       |  }
  913|       |#endif  // SUPPRESS_WARNINGS
  914|  33.6k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1076|   129k|                                                      const XmpProperties::XmpLock& lock) {
 1077|   129k|  std::string property;
 1078|   129k|  std::string::size_type idx = propPath.find(':');
 1079|   129k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1079:7): [True: 0, False: 129k]
  ------------------
 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|   129k|  property = propPath.substr(idx + 1);
 1084|   129k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1085|   129k|  if (prefix.empty()) {
  ------------------
  |  Branch (1085:7): [True: 0, False: 129k]
  ------------------
 1086|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1087|      0|  }
 1088|   129k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1089|   129k|}  // makeXmpKey
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  19.3M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  19.3M|    return key_ == xmpdatum.key();
  203|  19.3M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|  1.25M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|  1.25M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  9.41k|  static void check(const char* buf, size_t buflen) {
   67|  9.41k|    XMLValidator validator;
   68|  9.41k|    validator.check_internal(buf, buflen);
   69|  9.41k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  9.41k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  9.41k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 9.41k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  9.41k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  9.41k|  void check_internal(const char* buf, size_t buflen) {
  103|  9.41k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 9.41k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  9.41k|    XML_SetUserData(parser_, this);
  108|  9.41k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  9.41k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  9.41k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  9.41k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 2.26k, False: 7.15k]
  ------------------
  113|  2.26k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  2.26k|    }
  115|       |
  116|  9.41k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 2.26k, False: 7.15k]
  ------------------
  117|  2.26k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  2.26k|    }
  119|  9.41k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   169k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   169k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   169k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   169k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   169k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 467, False: 169k]
  ------------------
  123|    467|      setError("Too deeply nested");
  124|    467|    }
  125|   169k|    ++element_depth_;
  126|   169k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   154k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   154k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   154k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   154k|  void endElement(const XML_Char*) noexcept {
  129|   154k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 154k, False: 0]
  ------------------
  130|   154k|      --element_depth_;
  131|   154k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   154k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  57.0k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  57.0k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  57.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  57.0k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  57.0k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 323, False: 56.7k]
  ------------------
  138|    323|      setError("Too deeply nested");
  139|    323|    }
  140|  57.0k|    ++namespace_depth_;
  141|  57.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  46.3k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  46.3k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  46.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  46.3k|  void endNamespace(const XML_Char*) noexcept {
  144|  46.3k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 46.3k, False: 0]
  ------------------
  145|  46.3k|      --namespace_depth_;
  146|  46.3k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  46.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  181|     36|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  182|     36|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  183|     36|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  151|     36|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  152|       |    // DOCTYPE is used for XXE attacks.
  153|     36|    setError("DOCTYPE not supported");
  154|     36|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  3.08k|  void setError(const char* msg) {
   88|  3.08k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  3.08k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  3.08k|#ifndef SUPPRESS_WARNINGS
   91|  3.08k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  3.08k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 3.08k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  3.08k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  3.08k|#endif
   93|       |    // If this is the first error, then save it.
   94|  3.08k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 2.26k, False: 826]
  ------------------
   95|  2.26k|      haserror_ = true;
   96|  2.26k|      errmsg_ = msg;
   97|  2.26k|      errlinenum_ = errlinenum;
   98|  2.26k|      errcolnum_ = errcolnum;
   99|  2.26k|    }
  100|  3.08k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  9.41k|  ~XMLValidator() {
   84|  9.41k|    XML_ParserFree(parser_);
   85|  9.41k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  933|  9.34k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  934|  9.34k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  935|  9.34k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (935:7): [True: 8.96k, False: 382]
  ------------------
  936|  8.96k|    var = Exiv2::XmpValue::xsStruct;
  937|  8.96k|  }
  938|  9.34k|  return var;
  939|  9.34k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  941|   116k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  942|   116k|  XMP_OptionBits var(0);
  943|   116k|  switch (xs) {
  ------------------
  |  Branch (943:11): [True: 116k, False: 0]
  ------------------
  944|   108k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (944:5): [True: 108k, False: 7.92k]
  ------------------
  945|   108k|      break;
  946|  7.92k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (946:5): [True: 7.92k, False: 108k]
  ------------------
  947|  7.92k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  948|  7.92k|      break;
  949|   116k|  }
  950|   116k|  return var;
  951|   116k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  953|  11.6k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  954|  11.6k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  955|  11.6k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (955:7): [True: 2.68k, False: 8.96k]
  ------------------
  956|  2.68k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (956:9): [True: 564, False: 2.12k]
  ------------------
  957|    564|      typeId = Exiv2::xmpAlt;
  958|  2.12k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (958:14): [True: 1.83k, False: 290]
  ------------------
  959|  1.83k|      typeId = Exiv2::xmpSeq;
  960|    290|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (960:14): [True: 290, False: 0]
  ------------------
  961|    290|      typeId = Exiv2::xmpBag;
  962|  2.68k|  }
  963|  11.6k|  return typeId;
  964|  11.6k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  966|  9.34k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  967|  9.34k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  968|  9.34k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
  970|   116k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
  971|   116k|  XMP_OptionBits var(0);
  972|   116k|  switch (xat) {
  ------------------
  |  Branch (972:11): [True: 116k, False: 0]
  ------------------
  973|   114k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (973:5): [True: 114k, False: 2.16k]
  ------------------
  974|   114k|      break;
  975|    342|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (975:5): [True: 342, False: 116k]
  ------------------
  976|    342|      XMP_SetOption(var, kXMP_PropValueIsArray);
  977|    342|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
  978|    342|      break;
  979|  1.59k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (979:5): [True: 1.59k, False: 115k]
  ------------------
  980|  1.59k|      XMP_SetOption(var, kXMP_PropValueIsArray);
  981|  1.59k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
  982|  1.59k|      break;
  983|    230|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (983:5): [True: 230, False: 116k]
  ------------------
  984|    230|      XMP_SetOption(var, kXMP_PropValueIsArray);
  985|    230|      break;
  986|   116k|  }
  987|   116k|  return var;
  988|   116k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
  994|  3.89k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
  995|  3.89k|  XMP_OptionBits var(0);
  996|  3.89k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (996:7): [True: 1.49k, False: 2.39k]
  ------------------
  997|  1.49k|    var |= kXMP_OmitPacketWrapper;
  998|  3.89k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (998:7): [True: 0, False: 3.89k]
  ------------------
  999|      0|    var |= kXMP_ReadOnlyPacket;
 1000|  3.89k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1000:7): [True: 3.89k, False: 0]
  ------------------
 1001|  3.89k|    var |= kXMP_UseCompactFormat;
 1002|  3.89k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1002:7): [True: 0, False: 3.89k]
  ------------------
 1003|      0|    var |= kXMP_IncludeThumbnailPad;
 1004|  3.89k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1004:7): [True: 0, False: 3.89k]
  ------------------
 1005|      0|    var |= kXMP_ExactPacketLength;
 1006|  3.89k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1006:7): [True: 0, False: 3.89k]
  ------------------
 1007|      0|    var |= kXMP_WriteAliasComments;
 1008|  3.89k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1008:7): [True: 19, False: 3.87k]
  ------------------
 1009|     19|    var |= kXMP_OmitAllFormatting;
 1010|  3.89k|  return var;
 1011|  3.89k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1069|   405k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1070|   405k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   431k|  ~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|  2.59k|XmpSidecar::XmpSidecar(BasicIo::UniquePtr io, bool create) : Image(ImageType::xmp, mdXmp, std::move(io)) {
   30|  2.59k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 2.59k]
  |  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|  2.59k|}  // XmpSidecar::XmpSidecar
_ZN5Exiv210XmpSidecar12readMetadataEv:
   45|  2.59k|void XmpSidecar::readMetadata() {
   46|       |#ifdef EXIV2_DEBUG_MESSAGES
   47|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   48|       |#endif
   49|  2.59k|  if (io_->open() != 0) {
  ------------------
  |  Branch (49:7): [True: 0, False: 2.59k]
  ------------------
   50|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   51|      0|  }
   52|  2.59k|  IoCloser closer(*io_);
   53|       |  // Ensure that this is the correct image type
   54|  2.59k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (54:7): [True: 0, False: 2.59k]
  ------------------
   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|  2.59k|  std::string xmpPacket;
   61|  2.59k|  const long len = 64 * 1024;
   62|  2.59k|  auto buf = std::make_unique<byte[]>(len);
   63|  6.07k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (63:15): [True: 3.48k, False: 2.59k]
  ------------------
   64|  3.48k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   65|  3.48k|  }
   66|  2.59k|  if (io_->error())
  ------------------
  |  Branch (66:7): [True: 0, False: 2.59k]
  ------------------
   67|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   68|  2.59k|  clearMetadata();
   69|  2.59k|  xmpPacket_ = std::move(xmpPacket);
   70|  2.59k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_)) {
  ------------------
  |  Branch (70:7): [True: 2.58k, False: 1]
  |  Branch (70:30): [True: 335, False: 2.25k]
  ------------------
   71|    335|#ifndef SUPPRESS_WARNINGS
   72|    335|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    335|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 335]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    335|  LogMsg(LogMsg::warn).os()
  ------------------
   73|    335|#endif
   74|    335|  }
   75|       |
   76|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   77|  18.6k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (77:24): [True: 18.6k, False: 2.59k]
  ------------------
   78|  18.6k|    std::string key(xmp.key());
   79|  18.6k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (79:9): [True: 1.08k, False: 17.5k]
  ------------------
   80|  1.08k|      dates_[key] = xmp.value().toString();
   81|  1.08k|    }
   82|  18.6k|  }
   83|       |
   84|  2.59k|  copyXmpToIptc(xmpData_, iptcData_);
   85|  2.59k|  copyXmpToExif(xmpData_, exifData_);
   86|  2.59k|}  // XmpSidecar::readMetadata
_ZN5Exiv210XmpSidecar13writeMetadataEv:
   92|  2.46k|void XmpSidecar::writeMetadata() {
   93|  2.46k|  if (io_->open() != 0) {
  ------------------
  |  Branch (93:7): [True: 0, False: 2.46k]
  ------------------
   94|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   95|      0|  }
   96|  2.46k|  IoCloser closer(*io_);
   97|       |
   98|  2.46k|  if (!writeXmpFromPacket()) {
  ------------------
  |  Branch (98:7): [True: 2.46k, False: 0]
  ------------------
   99|       |    // #589 copy XMP tags
  100|  2.46k|    Exiv2::XmpData copy;
  101|  18.6k|    for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (101:26): [True: 18.6k, False: 2.46k]
  ------------------
  102|  18.6k|      if (!matchi(xmp.key(), "exif") && !matchi(xmp.key(), "iptc")) {
  ------------------
  |  Branch (102:11): [True: 14.6k, False: 3.94k]
  |  Branch (102:11): [True: 14.6k, False: 4.01k]
  |  Branch (102:41): [True: 14.6k, False: 70]
  ------------------
  103|  14.6k|        copy[xmp.key()] = xmp.value();
  104|  14.6k|      }
  105|  18.6k|    }
  106|       |
  107|       |    // run the converters
  108|  2.46k|    copyExifToXmp(exifData_, xmpData_);
  109|  2.46k|    copyIptcToXmp(iptcData_, xmpData_);
  110|       |
  111|       |    // #1112 - restore dates if they lost their TZ info
  112|  2.46k|    for (const auto& [sKey, value_orig] : dates_) {
  ------------------
  |  Branch (112:41): [True: 972, False: 2.46k]
  ------------------
  113|    972|      Exiv2::XmpKey key(sKey);
  114|    972|      if (xmpData_.findKey(key) != xmpData_.end()) {
  ------------------
  |  Branch (114:11): [True: 922, False: 50]
  ------------------
  115|    922|        std::string value_now(xmpData_[sKey].value().toString());
  116|       |        // std::cout << key << " -> " << value_now << " => " << value_orig << '\n';
  117|    922|        if (Internal::contains(value_orig, value_now.substr(0, 10))) {
  ------------------
  |  Branch (117:13): [True: 767, False: 155]
  ------------------
  118|    767|          xmpData_[sKey] = value_orig;
  119|    767|        }
  120|    922|      }
  121|    972|    }
  122|       |
  123|       |    // #589 - restore tags which were modified by the converters
  124|  14.4k|    for (const auto& xmp : copy) {
  ------------------
  |  Branch (124:26): [True: 14.4k, False: 2.46k]
  ------------------
  125|  14.4k|      xmpData_[xmp.key()] = xmp.value();
  126|  14.4k|    }
  127|       |
  128|  2.46k|    if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::omitPacketWrapper | XmpParser::useCompactFormat) > 1) {
  ------------------
  |  Branch (128:9): [True: 60, False: 2.40k]
  ------------------
  129|     60|#ifndef SUPPRESS_WARNINGS
  130|     60|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     60|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 60]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     60|  LogMsg(LogMsg::error).os()
  ------------------
  131|     60|#endif
  132|     60|    }
  133|  2.46k|  }
  134|  2.46k|  if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (134:7): [True: 1.55k, False: 913]
  ------------------
  135|  1.55k|    if (!xmpPacket_.starts_with("<?xml")) {
  ------------------
  |  Branch (135:9): [True: 1.55k, False: 1]
  ------------------
  136|  1.55k|      xmpPacket_ = xmlHeader + xmpPacket_ + xmlFooter;
  137|  1.55k|    }
  138|  1.55k|    MemIo tempIo;
  139|       |
  140|       |    // Write XMP packet
  141|  1.55k|    if (tempIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (141:9): [True: 0, False: 1.55k]
  ------------------
  142|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  143|  1.55k|    if (tempIo.error())
  ------------------
  |  Branch (143:9): [True: 0, False: 1.55k]
  ------------------
  144|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  145|  1.55k|    io_->close();
  146|  1.55k|    io_->transfer(tempIo);  // may throw
  147|  1.55k|  }
  148|  2.46k|}  // XmpSidecar::writeMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  152|  2.59k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, bool create) {
  153|  2.59k|  auto image = std::make_unique<XmpSidecar>(std::move(io), create);
  154|  2.59k|  if (!image->good()) {
  ------------------
  |  Branch (154:7): [True: 0, False: 2.59k]
  ------------------
  155|      0|    return nullptr;
  156|      0|  }
  157|  2.59k|  return image;
  158|  2.59k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  160|  22.3k|bool isXmpType(BasicIo& iIo, bool advance) {
  161|       |  /*
  162|       |    Check if the file starts with an optional XML declaration followed by
  163|       |    either an XMP header (<?xpacket ... ?>) or an <x:xmpmeta> element.
  164|       |
  165|       |    In addition, in order for empty XmpSidecar objects as created by
  166|       |    Exiv2 to pass the test, just an XML header is also considered ok.
  167|       |   */
  168|  22.3k|  const int32_t len = 80;
  169|  22.3k|  byte buf[len];
  170|  22.3k|  iIo.read(buf, xmlHdrCnt + 1);
  171|  22.3k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (171:7): [True: 281, False: 22.0k]
  |  Branch (171:20): [True: 3, False: 278]
  ------------------
  172|      3|    return true;
  173|      3|  }
  174|  22.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (174:7): [True: 0, False: 22.3k]
  |  Branch (174:22): [True: 278, False: 22.0k]
  ------------------
  175|    278|    return false;
  176|    278|  }
  177|  22.0k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  178|  22.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (178:7): [True: 0, False: 22.0k]
  |  Branch (178:22): [True: 91, False: 21.9k]
  ------------------
  179|     91|    return false;
  180|     91|  }
  181|       |  // Skip leading BOM
  182|  21.9k|  int32_t start = 0;
  183|  21.9k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (183:7): [True: 135, False: 21.8k]
  ------------------
  184|    135|    start = 3;
  185|    135|  }
  186|  21.9k|  bool rc = false;
  187|  21.9k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  188|  21.9k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (188:7): [True: 185, False: 21.7k]
  ------------------
  189|       |    // Forward to the next tag
  190|    185|    auto it = std::find(head.begin() + 5, head.end(), '<');
  191|    185|    if (it != head.end())
  ------------------
  |  Branch (191:9): [True: 166, False: 19]
  ------------------
  192|    166|      head = head.substr(std::distance(head.begin(), it));
  193|    185|  }
  194|  21.9k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (194:7): [True: 3.90k, False: 18.0k]
  |  Branch (194:40): [True: 3.86k, False: 14.1k]
  ------------------
  195|  7.76k|    rc = true;
  196|  7.76k|  }
  197|  21.9k|  if (!advance || !rc) {
  ------------------
  |  Branch (197:7): [True: 21.9k, False: 0]
  |  Branch (197:19): [True: 0, False: 0]
  ------------------
  198|  21.9k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  199|  21.9k|  }
  200|  21.9k|  return rc;
  201|  22.0k|}
xmpsidecar.cpp:_ZN5Exiv2L6matchiERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKc:
   88|  33.3k|static bool matchi(const std::string& key, const char* substr) {
   89|  33.3k|  return Internal::contains(Internal::lower(key), substr);
   90|  33.3k|}

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  6.58k|{
  625|  6.58k|	IgnoreParam(options);
  ------------------
  |  |  117|  6.58k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  6.58k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  6.58k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  6.58k|{
  647|       |
  648|  6.58k|	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: 6.56k]
  ------------------
  649|  6.56k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  6.56k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  6.56k|{
  664|  6.56k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  6.56k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  6.56k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  6.56k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  29.3k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 22.8k, False: 6.56k]
  ------------------
  670|  22.8k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 16.1k, False: 6.65k]
  ------------------
  671|  6.65k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  6.65k|	}
  673|       |
  674|  6.56k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  11.4k|{
  695|  11.4k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  11.4k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.88k, False: 6.57k]
  |  Branch (696:45): [True: 24, False: 4.85k]
  ------------------
  697|     24|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     24|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  11.4k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 6.65k, False: 4.77k]
  |  Branch (700:21): [True: 125, False: 6.52k]
  ------------------
  701|    125|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    125|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  11.3k|	} else {
  703|  11.3k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  11.3k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  11.3k|	}
  706|       |
  707|  11.4k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   301k|{
  265|   301k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   301k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 301k, False: 182]
  |  Branch (269:28): [True: 120k, False: 180k]
  ------------------
  270|       |
  271|   120k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 94.2k, False: 26.0k]
  ------------------
  272|  94.2k|			term = kRDFTerm_li;
  273|  94.2k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 10, False: 26.0k]
  ------------------
  274|     10|			term = kRDFTerm_parseType;
  275|  26.0k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 6.59k, False: 19.4k]
  ------------------
  276|  6.59k|			term = kRDFTerm_Description;
  277|  19.4k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.20k, False: 18.2k]
  ------------------
  278|  1.20k|			term = kRDFTerm_about;
  279|  18.2k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 77, False: 18.1k]
  ------------------
  280|     77|			term = kRDFTerm_resource;
  281|  18.1k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 19, False: 18.1k]
  ------------------
  282|     19|			term = kRDFTerm_RDF;
  283|  18.1k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 70, False: 18.1k]
  ------------------
  284|     70|			term = kRDFTerm_ID;
  285|  18.1k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 92, False: 18.0k]
  ------------------
  286|     92|			term = kRDFTerm_nodeID;
  287|  18.0k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 20, False: 17.9k]
  ------------------
  288|     20|			term = kRDFTerm_datatype;
  289|  17.9k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 12, False: 17.9k]
  ------------------
  290|     12|			term = kRDFTerm_aboutEach;
  291|  17.9k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 12, False: 17.9k]
  ------------------
  292|     12|			term = kRDFTerm_aboutEachPrefix;
  293|  17.9k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 40, False: 17.9k]
  ------------------
  294|     40|			term = kRDFTerm_bagID;
  295|     40|		}
  296|       |
  297|   120k|	}
  298|       |
  299|   301k|	return term;
  300|       |
  301|   301k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  11.3k|{
  732|  11.3k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  11.3k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  11.3k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  32.8k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 21.9k, False: 10.9k]
  ------------------
  738|       |
  739|  21.9k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  21.9k|		switch ( attrTerm ) {
  742|       |
  743|     28|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 28, False: 21.9k]
  ------------------
  744|     38|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 10, False: 21.9k]
  ------------------
  745|  1.19k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.15k, False: 20.7k]
  ------------------
  746|       |
  747|  1.19k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     11|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 11, False: 1.18k]
  ------------------
  748|  1.18k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.18k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.16k, False: 16]
  |  Branch (750:24): [True: 1.14k, 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|  1.14k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.14k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.14k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.09k, False: 45]
  ------------------
  755|  1.09k|						xmpParent->name = (*currAttr)->value;
  756|  1.09k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 45, False: 0]
  ------------------
  757|     45|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     39|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 39, False: 6]
  ------------------
  758|      6|					}
  759|  1.14k|				}
  760|       |
  761|  1.14k|				break;
  762|       |
  763|  20.6k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 20.6k, False: 1.28k]
  ------------------
  764|  20.6k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  20.6k|				break;
  766|       |
  767|     95|			default :
  ------------------
  |  Branch (767:4): [True: 95, False: 21.8k]
  ------------------
  768|     95|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     95|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  21.9k|		}
  771|       |
  772|  21.9k|	}
  773|       |
  774|  11.3k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   157k|{
  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|   157k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 243, False: 157k]
  ------------------
  371|    243|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    243|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   157k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   157k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   157k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   157k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   157k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 30.3k, False: 127k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  30.3k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  30.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  30.3k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  30.3k|#define kXMP_CreateNodes	true
  ------------------
  384|  30.3k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  30.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  17.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 17.0k, False: 13.3k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  30.3k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  30.3k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 30.3k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  30.3k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   157k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 63.3k, False: 94.0k]
  ------------------
  398|  63.3k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  63.3k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 23, False: 63.2k]
  ------------------
  399|     23|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     23|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  63.3k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   157k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   157k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 157k, False: 34]
  |  Branch (406:26): [True: 22, False: 12]
  ------------------
  407|   157k|		 xmpParent->children.push_back ( newChild );
  408|   157k|	} else {
  409|     30|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     30|	}
  411|   157k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 34, False: 157k]
  ------------------
  412|     34|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     34|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 24, False: 10]
  |  Branch (412:22): [True: 10, False: 0]
  ------------------
  413|      0|		xmpParent->options |= kRDF_HasValueElem;
  414|      0|	}
  415|       |	
  416|   157k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 94.0k, False: 63.2k]
  ------------------
  417|  94.0k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     24|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 24, False: 94.0k]
  ------------------
  418|  94.0k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  94.0k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  94.0k|	}
  423|       |	
  424|   157k|	return newChild;
  425|       |
  426|   157k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  11.4k|{
  787|  11.4k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  11.4k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   339k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 328k, False: 11.2k]
  ------------------
  791|   328k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 222k, False: 105k]
  ------------------
  792|   105k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 167, False: 105k]
  ------------------
  793|    167|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    167|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|   105k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|   105k|	}
  797|       |
  798|  11.4k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|   105k|{
  854|   105k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|   105k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     40|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 40, False: 105k]
  ------------------
  856|       |	
  857|   105k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 6.16k, False: 99.5k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  6.16k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  99.5k|	} else {
  863|       |
  864|       |		// Look through the attributes for one that isn't rdf:ID or xml:lang, it will usually tell
  865|       |		// what we should be dealing with. The called routines must verify their specific syntax!
  866|       |
  867|  99.5k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  99.5k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  99.5k|		XMP_VarString * attrName = 0;
  870|       |
  871|   111k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 18.5k, False: 93.3k]
  ------------------
  872|  18.5k|			attrName = &((*currAttr)->name);
  873|  18.5k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 6.20k, False: 12.2k]
  |  Branch (873:38): [True: 6.18k, False: 26]
  ------------------
  874|  18.5k|		}
  875|       |
  876|  99.5k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 6.18k, False: 93.3k]
  ------------------
  877|       |
  878|  6.18k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  6.18k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  6.18k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  6.18k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 47, False: 6.13k]
  ------------------
  882|     47|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  6.13k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 5.53k, False: 604]
  ------------------
  884|  5.53k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  5.53k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 6, False: 598]
  ------------------
  886|      6|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    598|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 522, False: 76]
  ------------------
  888|    522|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    522|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 10, False: 66]
  ------------------
  890|     10|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     66|			} else {
  892|     66|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     66|			}
  894|       |
  895|  93.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|  93.3k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 2.04k, False: 91.3k]
  ------------------
  901|       |
  902|  2.04k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  91.3k|			} else {
  905|       |			
  906|  91.3k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  91.3k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|   189k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 103k, False: 86.4k]
  ------------------
  910|   103k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.87k, False: 98.3k]
  ------------------
  911|   103k|				}
  912|       |				
  913|  91.3k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 86.4k, False: 4.87k]
  ------------------
  914|  86.4k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  86.4k|				} else {
  916|  4.87k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.87k|				}
  918|       |			
  919|  91.3k|			}
  920|       |
  921|  93.3k|		}
  922|       |		
  923|  99.5k|	}
  924|       |
  925|   105k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|   105k|{
  350|       |
  351|   105k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 21, False: 105k]
  |  Branch (351:42): [True: 1, False: 105k]
  ------------------
  352|   105k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|   105k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|   105k|{
  334|       |
  335|   105k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 1, False: 105k]
  |  Branch (335:39): [True: 1, False: 0]
  ------------------
  336|   105k|	return false;
  337|       |
  338|   105k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|   105k|{
  317|       |
  318|   105k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 94.2k, False: 11.5k]
  |  Branch (318:40): [True: 18, False: 94.1k]
  ------------------
  319|   105k|	return false;
  320|       |
  321|   105k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  13.7k|{
 1190|  13.7k|	bool hasPropertyAttrs = false;
 1191|  13.7k|	bool hasResourceAttr  = false;
 1192|  13.7k|	bool hasNodeIDAttr    = false;
 1193|  13.7k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  13.7k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  13.7k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     85|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 85, False: 13.6k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  13.6k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  13.6k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|  95.9k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 82.3k, False: 13.5k]
  ------------------
 1205|       |
 1206|  82.3k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  82.3k|		switch ( attrTerm ) {
 1209|       |
 1210|     21|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 21, False: 82.3k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     21|				break;
 1213|       |
 1214|     71|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 71, False: 82.2k]
  ------------------
 1215|     71|				if ( hasNodeIDAttr ) 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 (1215:10): [True: 10, False: 61]
  ------------------
 1216|     61|				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: 51]
  ------------------
 1217|     51|				hasResourceAttr = true;
 1218|     51|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 51, False: 0]
  ------------------
 1219|     51|				break;
 1220|       |
 1221|     51|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 51, False: 82.3k]
  ------------------
 1222|     51|				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: 41]
  ------------------
 1223|     41|				hasNodeIDAttr = true;
 1224|     41|				break;
 1225|       |
 1226|  82.1k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 82.1k, False: 205]
  ------------------
 1227|  82.1k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 2.01k, False: 80.1k]
  ------------------
 1228|  2.01k|					if ( hasResourceAttr ) 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 (1228:11): [True: 10, False: 2.00k]
  ------------------
 1229|  2.00k|					hasValueAttr = true;
 1230|  2.00k|					valueNode = *currAttr;
 1231|  80.1k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 79.9k, False: 159]
  ------------------
 1232|  79.9k|					hasPropertyAttrs = true;
 1233|  79.9k|				}
 1234|  82.1k|				break;
 1235|       |
 1236|  82.1k|			default :
  ------------------
  |  Branch (1236:4): [True: 62, False: 82.2k]
  ------------------
 1237|     62|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     62|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  82.3k|		}
 1241|       |
 1242|  82.3k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  13.5k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  13.5k|	bool childIsStruct = false;
 1250|       |	
 1251|  13.5k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 2.02k, False: 11.5k]
  ------------------
 1252|  2.02k|		childNode->value = valueNode->value;
 1253|  2.02k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 31, False: 1.99k]
  ------------------
 1254|  11.5k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 9.45k, False: 2.07k]
  ------------------
 1255|  9.45k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  9.45k|		childIsStruct = true;
 1257|  9.45k|	}
 1258|       |		
 1259|  13.5k|	currAttr = xmlNode.attrs.begin();
 1260|  13.5k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|  95.4k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 81.9k, False: 13.4k]
  ------------------
 1263|       |
 1264|  81.9k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 2.00k, False: 79.9k]
  ------------------
 1265|  79.9k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  79.9k|		switch ( attrTerm ) {
 1268|       |
 1269|     21|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 21, False: 79.9k]
  ------------------
 1270|     52|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 31, False: 79.9k]
  ------------------
 1271|     52|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 79.9k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  79.9k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 79.9k, False: 52]
  ------------------
 1278|  79.9k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 48.3k, False: 31.5k]
  |  Branch (1278:31): [True: 13, False: 31.5k]
  ------------------
 1279|  48.3k|					AddQualifierNode ( childNode, **currAttr );
 1280|  48.3k|				} else {
 1281|  31.5k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  31.5k|				}
 1283|  79.9k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 79.9k]
  ------------------
 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|  79.9k|		}
 1290|       |
 1291|  79.9k|	}
 1292|       |
 1293|  13.5k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  60.5k|{
  484|  60.5k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 38, False: 60.4k]
  ------------------
  485|     38|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     38|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  60.4k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  60.5k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  60.5k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  60.5k|	const bool isLang = (name == "xml:lang");
  443|  60.5k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  60.5k|	XMP_Node * newQual = 0;
  446|       |
  447|  60.5k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  60.5k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 48.1k, False: 12.4k]
  ------------------
  450|  48.1k|			xmpParent->qualifiers.push_back ( newQual );
  451|  48.1k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 12.2k, False: 132]
  ------------------
  452|  12.2k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 12.2k, False: 22]
  ------------------
  453|  12.2k|				xmpParent->qualifiers.push_back ( newQual );
  454|  12.2k|			} else {
  455|     22|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     22|			}
  457|  12.2k|			xmpParent->options |= kXMP_PropHasLang;
  458|  12.2k|		} else {
  459|    132|			XMP_Assert ( isType );
  ------------------
  |  |  142|    132|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    132|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 65, False: 67]
  ------------------
  461|     65|				xmpParent->qualifiers.push_back ( newQual );
  462|     67|			} else {
  463|     67|				size_t offset = 0;
  464|     67|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 35, False: 32]
  ------------------
  465|     67|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|     67|			}
  467|    132|			xmpParent->options |= kXMP_PropHasType;
  468|    132|		}
  469|       |
  470|  60.5k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  60.5k|	return newQual;
  473|       |
  474|  60.5k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  86.4k|{
 1015|  86.4k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  86.4k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  86.4k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  98.6k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 12.2k, False: 86.4k]
  ------------------
 1021|  12.2k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  12.2k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 12.1k, False: 97]
  ------------------
 1023|  12.1k|			AddQualifierNode ( newChild, **currAttr );
 1024|  12.1k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 13, False: 84]
  |  Branch (1024:41): [True: 47, False: 37]
  ------------------
 1025|     60|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     60|		} else {
 1027|     37|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     37|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  12.2k|	}
 1030|       |	
 1031|  86.4k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  86.4k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  86.4k|	size_t      textSize  = 0;
 1034|       |
 1035|   174k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 88.2k, False: 86.4k]
  ------------------
 1036|  88.2k|		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: 88.2k]
  ------------------
 1037|  88.2k|		textSize += (*currChild)->value.size();
 1038|  88.2k|	}
 1039|       |	
 1040|  86.4k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|   174k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 88.2k, False: 86.4k]
  ------------------
 1043|  88.2k|		newChild->value += (*currChild)->value;
 1044|  88.2k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  86.4k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|      6|{
 1065|      6|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
 1066|       |	
 1067|      6|	XMP_Throw ( "ParseTypeLiteral property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1068|       |
 1069|      0|}	// RDF_ParseTypeLiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    522|{
 1087|       |
 1088|    522|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    522|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    522|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    522|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|  1.04k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 522, False: 522]
  ------------------
 1095|    522|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    522|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 522, False: 0]
  ------------------
 1097|    522|			continue;	// ! The caller ensured the value is "Resource".
 1098|    522|		} 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|    522|	}
 1106|       |
 1107|    522|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    522|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 522]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    522|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL38RDF_ParseTypeCollectionPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1127|     10|{
 1128|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1129|       |
 1130|     10|	XMP_Throw ( "ParseTypeCollection property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1131|       |
 1132|      0|}	// RDF_ParseTypeCollectionPropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|     66|{
 1147|     66|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     66|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     66|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     66|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     66|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     66|#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.87k|{
  943|  4.87k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.73k, False: 136]
  |  Branch (943:21): [True: 0, False: 4.73k]
  ------------------
  944|       |	
  945|  4.87k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.87k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.87k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.90k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 33, False: 4.87k]
  ------------------
  951|     33|		XMP_VarString & attrName = (*currAttr)->name;
  952|     33|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 30, False: 3]
  ------------------
  953|     30|			AddQualifierNode ( newCompound, **currAttr );
  954|     30|		} 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|     33|	}
  960|       |	
  961|  4.87k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.87k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  14.9k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 14.9k, False: 1]
  ------------------
  965|  14.9k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.87k, False: 10.0k]
  ------------------
  966|  14.9k|	}
  967|  4.87k|	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.87k]
  ------------------
  968|  4.87k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     59|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 59, False: 4.81k]
  ------------------
  969|       |
  970|  4.81k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 192, False: 4.62k]
  ------------------
  971|    192|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.62k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.30k, False: 2.31k]
  ------------------
  973|  2.30k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.31k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 2.18k, False: 134]
  ------------------
  975|  2.18k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  2.18k|	} else {
  977|    134|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    134|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 87, False: 47]
  ------------------
  979|     87|			XMP_VarString typeName ( (*currChild)->ns );
  980|     87|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|     87|			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: 77]
  ------------------
  982|     77|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|     77|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|     77|		}
  985|    134|	}
  986|       |
  987|  4.80k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.80k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 0, False: 4.80k]
  ------------------
  989|      0|		FixupQualifiedNode ( newCompound );
  990|  4.80k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.91k, False: 2.88k]
  ------------------
  991|  1.91k|		DetectAltText ( newCompound );
  992|  1.91k|	}
  993|       |
  994|  13.8k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 9.11k, False: 4.75k]
  ------------------
  995|  9.11k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     44|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 44, False: 9.06k]
  ------------------
  996|  9.06k|	}
  997|       |
  998|  4.80k|}	// RDF_ResourcePropertyElement

_Z28InitializeUnicodeConversionsv:
  147|      1|{
  148|      1|	UC_Assert ( (sizeof(UTF8Unit) == 1) && (sizeof(UTF16Unit) == 2) && (sizeof(UTF32Unit) == 4) ); 
  149|       |
  150|      1|	UTF16Unit u16  = 0x00FF;
  151|      1|	bool bigEndian = (*((UTF8Unit*)&u16) == 0);
  152|       |
  153|      1|	UTF8_to_UTF16Native = UTF8_to_UTF16Nat;
  154|      1|	UTF8_to_UTF32Native = UTF8_to_UTF32Nat;
  155|      1|	UTF16Native_to_UTF8 = UTF16Nat_to_UTF8;
  156|      1|	UTF32Native_to_UTF8 = UTF32Nat_to_UTF8;
  157|       |	
  158|      1|	if ( bigEndian ) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|       |	
  160|      0|		swap32to16Offset = 0;
  161|       |
  162|      0|		CodePoint_to_UTF16BE = CodePoint_to_UTF16Nat;
  163|      0|		CodePoint_to_UTF16LE = CodePoint_to_UTF16Swp;
  164|       |
  165|      0|		CodePoint_from_UTF16BE = CodePoint_from_UTF16Nat;
  166|      0|		CodePoint_from_UTF16LE = CodePoint_from_UTF16Swp;
  167|       |
  168|      0|		UTF8_to_UTF16BE = UTF8_to_UTF16Nat;
  169|      0|		UTF8_to_UTF16LE = UTF8_to_UTF16Swp;
  170|      0|		UTF8_to_UTF32BE = UTF8_to_UTF32Nat;
  171|      0|		UTF8_to_UTF32LE = UTF8_to_UTF32Swp;
  172|       |
  173|      0|		UTF16BE_to_UTF8 = UTF16Nat_to_UTF8;
  174|      0|		UTF16LE_to_UTF8 = UTF16Swp_to_UTF8;
  175|      0|		UTF32BE_to_UTF8 = UTF32Nat_to_UTF8;
  176|      0|		UTF32LE_to_UTF8 = UTF32Swp_to_UTF8;
  177|       |
  178|      0|		UTF16BE_to_UTF32BE = UTF16Nat_to_UTF32Nat;
  179|      0|		UTF16BE_to_UTF32LE = UTF16Nat_to_UTF32Swp;
  180|      0|		UTF16LE_to_UTF32BE = UTF16Swp_to_UTF32Nat;
  181|      0|		UTF16LE_to_UTF32LE = UTF16Swp_to_UTF32Swp;
  182|       |
  183|      0|		UTF32BE_to_UTF16BE = UTF32Nat_to_UTF16Nat;
  184|      0|		UTF32BE_to_UTF16LE = UTF32Nat_to_UTF16Swp;
  185|      0|		UTF32LE_to_UTF16BE = UTF32Swp_to_UTF16Nat;
  186|      0|		UTF32LE_to_UTF16LE = UTF32Swp_to_UTF16Swp;
  187|       |
  188|      1|	} else {
  189|       |	
  190|      1|		swap32to16Offset = 1;	// ! Offset in UTF16 units!
  191|       |
  192|      1|		CodePoint_to_UTF16BE = CodePoint_to_UTF16Swp;
  193|      1|		CodePoint_to_UTF16LE = CodePoint_to_UTF16Nat;
  194|       |
  195|      1|		CodePoint_from_UTF16BE = CodePoint_from_UTF16Swp;
  196|      1|		CodePoint_from_UTF16LE = CodePoint_from_UTF16Nat;
  197|       |
  198|      1|		UTF8_to_UTF16BE = UTF8_to_UTF16Swp;
  199|      1|		UTF8_to_UTF16LE = UTF8_to_UTF16Nat;
  200|      1|		UTF8_to_UTF32BE = UTF8_to_UTF32Swp;
  201|      1|		UTF8_to_UTF32LE = UTF8_to_UTF32Nat;
  202|       |
  203|      1|		UTF16BE_to_UTF8 = UTF16Swp_to_UTF8;
  204|      1|		UTF16LE_to_UTF8 = UTF16Nat_to_UTF8;
  205|      1|		UTF32BE_to_UTF8 = UTF32Swp_to_UTF8;
  206|      1|		UTF32LE_to_UTF8 = UTF32Nat_to_UTF8;
  207|       |
  208|      1|		UTF16BE_to_UTF32BE = UTF16Swp_to_UTF32Swp;
  209|      1|		UTF16BE_to_UTF32LE = UTF16Swp_to_UTF32Nat;
  210|      1|		UTF16LE_to_UTF32BE = UTF16Nat_to_UTF32Swp;
  211|      1|		UTF16LE_to_UTF32LE = UTF16Nat_to_UTF32Nat;
  212|       |
  213|      1|		UTF32BE_to_UTF16BE = UTF32Swp_to_UTF16Swp;
  214|      1|		UTF32BE_to_UTF16LE = UTF32Swp_to_UTF16Nat;
  215|      1|		UTF32LE_to_UTF16BE = UTF32Nat_to_UTF16Swp;
  216|      1|		UTF32LE_to_UTF16LE = UTF32Nat_to_UTF16Nat;
  217|       |
  218|      1|	}
  219|       |
  220|      1|}	// InitializeUnicodeConversions
_Z19CodePoint_from_UTF8PKhmPjPm:
  567|  35.0k|{
  568|  35.0k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  35.0k|	size_t unitCount = 0;
  570|       |
  571|  35.0k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  35.0k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 35.0k]
  ------------------
  573|  35.0k|	inUnit = *utf8In;
  574|  35.0k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 35.0k, 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|  35.0k|MultiByte:
  584|  35.0k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  35.0k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  35.0k|{
  517|  35.0k|	UTF8Unit  inUnit = *utf8In;
  518|  35.0k|	size_t    unitCount = 0;
  519|  35.0k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  35.0k|	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|  35.0k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|   107k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 72.9k, False: 35.0k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  35.0k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     23|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 15, False: 35.0k]
  |  Branch (538:28): [True: 8, False: 35.0k]
  ------------------
  539|  35.0k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 35.0k]
  ------------------
  540|  35.0k|	unitCount = bytesNeeded;
  541|       |	
  542|  35.0k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  35.0k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|  72.8k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 37.7k, False: 35.0k]
  ------------------
  546|  37.7k|		inUnit = *utf8Pos;
  547|  37.7k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     15|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 15, False: 37.7k]
  ------------------
  548|  37.7k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  37.7k|	}
  550|       |	
  551|  35.0k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 989, False: 34.0k]
  ------------------
  552|    989|		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: 989, False: 0]
  |  Branch (552:26): [True: 1, False: 988]
  ------------------
  553|    988|		if ( cp > 0x10FFFF ) UC_Throw ( "Bad UTF-8 - out of range", kXMPErr_BadParam );
  ------------------
  |  |   18|      2|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (553:8): [True: 2, False: 986]
  ------------------
  554|    988|	}
  555|       |	
  556|  35.0k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  35.0k|Done:	
  559|  35.0k|	*utf8Read = unitCount;
  560|  35.0k|	return;
  561|       |	
  562|  35.0k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  1.11M|{
   88|       |
   89|  1.11M|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  1.11M|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  1.11M|	const XMP_Uns8 * namePos   = nameStart;
   92|  1.11M|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  1.11M|	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: 1.11M]
  ------------------
   97|       |
   98|  1.11M|	cp = *namePos;
   99|  1.11M|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 1.11M, False: 337]
  ------------------
  100|  1.11M|		++namePos;
  101|  1.11M|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 1.11M]
  ------------------
  102|  1.11M|	} else {
  103|    337|		cp = GetCodePoint ( &namePos );
  104|    337|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 337]
  ------------------
  105|    337|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  65.4M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 64.3M, False: 1.11M]
  ------------------
  110|  64.3M|		cp = *namePos;
  111|  64.3M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 64.2M, False: 16.8k]
  ------------------
  112|  64.2M|			++namePos;
  113|  64.2M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 389k, False: 63.9M]
  |  Branch (113:38): [True: 0, False: 389k]
  ------------------
  114|  64.2M|		} else {
  115|  16.8k|			cp = GetCodePoint ( &namePos );
  116|  16.8k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 8.43k, False: 8.43k]
  |  Branch (116:41): [True: 0, False: 8.43k]
  ------------------
  117|  16.8k|		}
  118|  64.3M|	}
  119|       |
  120|  1.11M|	return;
  121|       |
  122|  1.11M|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|  65.4M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  65.4M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 38.4M, False: 26.9M]
  |  Branch (33:23): [True: 38.4M, False: 0]
  |  Branch (33:40): [True: 26.5M, False: 389k]
  |  Branch (33:55): [True: 26.5M, False: 53.9k]
  |  Branch (33:71): [True: 53.9k, False: 389k]
  ------------------
   34|   389k|	return false;
   35|  65.4M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  17.2k|{
   20|  17.2k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  17.2k|	XMP_Uns32 cp;
   22|  17.2k|	size_t u8Len;
   23|  17.2k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  17.2k|	*utf8Str_io = u8Ptr + u8Len;
   25|  17.2k|	return cp;
   26|  17.2k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  17.2k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  17.2k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 10.8k, False: 6.38k]
  |  Branch (43:24): [True: 510, False: 10.3k]
  |  Branch (43:43): [True: 10.3k, False: 6.38k]
  |  Branch (43:59): [True: 3.36k, False: 6.94k]
  ------------------
   44|  13.3k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 6.94k, False: 6.38k]
  |  Branch (44:24): [True: 3.19k, False: 3.74k]
  |  Branch (44:43): [True: 1.69k, False: 8.43k]
  |  Branch (44:60): [True: 0, False: 1.69k]
  ------------------
   45|       |
   46|  10.1k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.69k, False: 8.43k]
  |  Branch (46:25): [True: 1.21k, False: 484]
  |  Branch (46:46): [True: 484, False: 8.43k]
  |  Branch (46:64): [True: 0, False: 484]
  ------------------
   47|  8.91k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 484, False: 8.43k]
  |  Branch (47:26): [True: 0, False: 484]
  |  Branch (47:46): [True: 484, False: 8.43k]
  |  Branch (47:64): [True: 0, False: 484]
  ------------------
   48|  8.91k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 484, False: 8.43k]
  |  Branch (48:26): [True: 484, False: 0]
  |  Branch (48:46): [True: 0, False: 8.43k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  8.43k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 8.43k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 8.43k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  8.43k|	return false;
   52|       |
   53|  8.43k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   389k|{
   59|       |	// ASCII following characters for an XML name.
   60|   389k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 299k, False: 90.3k]
  |  Branch (60:23): [True: 299k, False: 0]
  |  Branch (60:39): [True: 32.4k, False: 57.9k]
  |  Branch (60:54): [True: 57.9k, False: 0]
  ------------------
   61|      0|	return false;
   62|   389k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  8.43k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  8.43k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 6.38k, False: 2.04k]
  |  Branch (69:24): [True: 2.04k, False: 0]
  |  Branch (69:41): [True: 2.04k, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  8.43k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  7.80k|{
   20|  7.80k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  7.80k|	XMP_Uns32 cp;
   22|  7.80k|	size_t u8Len;
   23|  7.80k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  7.80k|	*utf8Str_io = u8Ptr + u8Len;
   25|  7.80k|	return cp;
   26|  7.80k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  47.2k|{
   88|       |
   89|  47.2k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  47.2k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  47.2k|	const XMP_Uns8 * namePos   = nameStart;
   92|  47.2k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  47.2k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 47.2k]
  ------------------
   97|       |
   98|  47.2k|	cp = *namePos;
   99|  47.2k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 46.7k, False: 426]
  ------------------
  100|  46.7k|		++namePos;
  101|  46.7k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 46.7k]
  ------------------
  102|  46.7k|	} else {
  103|    426|		cp = GetCodePoint ( &namePos );
  104|    426|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 426]
  ------------------
  105|    426|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  7.93M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 7.88M, False: 47.2k]
  ------------------
  110|  7.88M|		cp = *namePos;
  111|  7.88M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 7.87M, False: 9.64k]
  ------------------
  112|  7.87M|			++namePos;
  113|  7.87M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 52.0k, False: 7.82M]
  |  Branch (113:38): [True: 0, False: 52.0k]
  ------------------
  114|  7.87M|		} else {
  115|  9.64k|			cp = GetCodePoint ( &namePos );
  116|  9.64k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 5.94k, False: 3.69k]
  |  Branch (116:41): [True: 0, False: 5.94k]
  ------------------
  117|  9.64k|		}
  118|  7.88M|	}
  119|       |
  120|  47.2k|	return;
  121|       |
  122|  47.2k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  7.92M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  7.92M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 7.64M, False: 277k]
  |  Branch (33:23): [True: 7.64M, False: 0]
  |  Branch (33:40): [True: 225k, False: 52.0k]
  |  Branch (33:55): [True: 217k, False: 8.41k]
  |  Branch (33:71): [True: 8.41k, False: 52.0k]
  ------------------
   34|  52.0k|	return false;
   35|  7.92M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  10.0k|{
   20|  10.0k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  10.0k|	XMP_Uns32 cp;
   22|  10.0k|	size_t u8Len;
   23|  10.0k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  10.0k|	*utf8Str_io = u8Ptr + u8Len;
   25|  10.0k|	return cp;
   26|  10.0k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  10.0k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  10.0k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 4.44k, False: 5.62k]
  |  Branch (43:24): [True: 368, False: 4.07k]
  |  Branch (43:43): [True: 4.07k, False: 5.62k]
  |  Branch (43:59): [True: 456, False: 3.62k]
  ------------------
   44|  9.24k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 3.62k, False: 5.62k]
  |  Branch (44:24): [True: 2.63k, False: 987]
  |  Branch (44:43): [True: 664, False: 5.94k]
  |  Branch (44:60): [True: 0, False: 664]
  ------------------
   45|       |
   46|  6.61k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 664, False: 5.94k]
  |  Branch (46:25): [True: 350, False: 314]
  |  Branch (46:46): [True: 314, False: 5.94k]
  |  Branch (46:64): [True: 0, False: 314]
  ------------------
   47|  6.26k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 314, False: 5.94k]
  |  Branch (47:26): [True: 0, False: 314]
  |  Branch (47:46): [True: 314, False: 5.94k]
  |  Branch (47:64): [True: 0, False: 314]
  ------------------
   48|  6.26k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 314, False: 5.94k]
  |  Branch (48:26): [True: 314, False: 0]
  |  Branch (48:46): [True: 0, False: 5.94k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  5.94k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 5.94k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 5.94k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  5.94k|	return false;
   52|       |
   53|  5.94k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  52.0k|{
   59|       |	// ASCII following characters for an XML name.
   60|  52.0k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 19.6k, False: 32.4k]
  |  Branch (60:23): [True: 19.6k, False: 0]
  |  Branch (60:39): [True: 12.4k, False: 20.0k]
  |  Branch (60:54): [True: 20.0k, False: 0]
  ------------------
   61|      0|	return false;
   62|  52.0k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  5.94k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  5.94k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 5.62k, False: 323]
  |  Branch (69:24): [True: 323, False: 0]
  |  Branch (69:41): [True: 323, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  5.94k|}

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

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

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

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   375k|{
   40|   375k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 117k, False: 258k]
  ------------------
   41|       |
   42|  1.04M|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 784k, False: 257k]
  ------------------
   43|   784k|		unsigned char ch = this->value[i];
   44|   784k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   784k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 653k, False: 130k]
  |  |  |  Branch (45:49): [True: 633, False: 129k]
  |  |  |  Branch (45:67): [True: 129k, False: 406]
  |  |  |  Branch (45:85): [True: 11, False: 395]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|    395|		return false;	// All the checks failed, this isn't whitespace.
   47|   784k|	}
   48|       |
   49|   257k|	return true;
   50|       |
   51|   258k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   692k|{
  428|       |
  429|   815k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 122k, False: 692k]
  ------------------
  430|   692k|	this->attrs.clear();
  431|       |
  432|   692k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   692k|{
  440|       |
  441|  1.25M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 562k, False: 692k]
  ------------------
  442|   692k|	this->content.clear();
  443|       |
  444|   692k|}	// 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|   634k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   634k|		int err = pthread_mutex_lock ( &mutex );
  125|   634k|		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: 634k]
  ------------------
  126|   634k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   634k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   634k|		int err = pthread_mutex_unlock ( &mutex );
  130|   634k|		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: 634k]
  ------------------
  131|   634k|	}
_Z16VerifySetOptionsjPKc:
  563|   191k|{
  564|       |
  565|   191k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 73, False: 191k]
  ------------------
  566|   191k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 4.32k, False: 187k]
  ------------------
  567|   191k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 5.96k, False: 185k]
  ------------------
  568|       |	
  569|   191k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 191k]
  ------------------
  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|   191k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 7.92k, False: 183k]
  |  Branch (573:45): [True: 0, False: 7.92k]
  ------------------
  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|   191k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 191k]
  |  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|   191k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 174k, False: 17.5k]
  |  Branch (581:27): [True: 0, False: 174k]
  ------------------
  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|   191k|	return options;
  586|       |
  587|   191k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   483k|{
  663|   483k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   483k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   483k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   483k|	XMP_StringPtr	qualName, nameEnd;
  667|   483k|	XMP_VarString	currStep;
  668|       |		
  669|   483k|	qualName = nameEnd = NULL;
  670|   483k|	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.1M, False: 483k]
  ------------------
  672|  68.1M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 174k, False: 68.0M]
  |  Branch (672:29): [True: 416k, False: 67.5M]
  ------------------
  673|  68.1M|	}
  674|       |	
  675|   483k|	expandedXPath->clear();
  676|   483k|	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|   483k|	stepBegin = propPath;
  683|   483k|	stepEnd = stepBegin;
  684|  53.4M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 53.3M, False: 60.6k]
  |  Branch (684:29): [True: 53.3M, False: 6.68k]
  |  Branch (684:50): [True: 52.9M, False: 415k]
  |  Branch (684:71): [True: 52.9M, False: 0]
  ------------------
  685|   483k|	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: 483k]
  ------------------
  686|   483k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   483k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   483k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   483k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 483k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   483k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|  1.07M|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 590k, False: 483k]
  ------------------
  700|       |
  701|   590k|		stepBegin = stepEnd;
  702|   590k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 174k, False: 416k]
  ------------------
  703|   590k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 590k]
  ------------------
  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|   590k|		stepEnd = stepBegin;
  708|       |
  709|   590k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 174k, False: 416k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|   174k|			qualName = stepBegin;
  713|  13.2M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 13.0M, False: 173k]
  |  Branch (713:31): [True: 13.0M, False: 326]
  |  Branch (713:52): [True: 13.0M, False: 499]
  |  Branch (713:73): [True: 13.0M, False: 0]
  ------------------
  714|   174k|			nameEnd = stepEnd;
  715|   174k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   416k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   416k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   416k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 416k, False: 0]
  |  Branch (723:30): [True: 416k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|  1.56M|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 1.56M, False: 0]
  |  Branch (726:32): [True: 1.56M, False: 0]
  |  Branch (726:53): [True: 1.14M, False: 416k]
  ------------------
  727|   416k|				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: 416k]
  ------------------
  728|   416k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   416k|			} 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|   416k|			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: 416k]
  ------------------
  774|   416k|			++stepEnd;
  775|       |			
  776|   416k|		}
  777|       |
  778|   590k|		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: 590k]
  ------------------
  779|   590k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   590k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   590k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 174k, False: 416k]
  ------------------
  782|       |
  783|   174k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 174k]
  ------------------
  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|   174k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 114k, False: 59.3k]
  ------------------
  788|   114k|				++qualName;
  789|   114k|				stepFlags = kXMP_QualifierStep;
  790|   114k|			}
  791|   174k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   416k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   416k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 416k]
  ------------------
  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|   590k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   590k|	}
  812|       |
  813|   483k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   567k|{
  829|   567k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   567k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   567k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|  1.54M|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 1.47M, False: 73.7k]
  ------------------
  834|  1.47M|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|  1.47M|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|  1.47M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|  1.47M|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 494k, False: 977k]
  ------------------
  837|   494k|			schemaNode = currSchema;
  838|   494k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 464k, False: 29.6k]
  ------------------
  839|   494k|			break;
  840|   494k|		}
  841|  1.47M|	}
  842|       |	
  843|   567k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 73.7k, False: 494k]
  |  Branch (843:28): [True: 28.3k, False: 45.4k]
  ------------------
  844|       |
  845|  28.3k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  28.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  28.3k|		XMP_StringPtr prefixPtr;
  847|  28.3k|		XMP_StringLen prefixLen;
  848|  28.3k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  28.3k|		XMP_Assert ( found );
  ------------------
  |  |  142|  28.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  28.3k|		UNUSED(found);
  851|       |
  852|  28.3k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  28.3k|		xmpTree->children.push_back ( schemaNode );
  854|  28.3k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 11.2k, False: 17.0k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  28.3k|	}
  861|       |	
  862|   567k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   567k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   567k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   567k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   567k|	return schemaNode;
  865|       |	
  866|   567k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   600k|{
  882|   600k|	XMP_Node * childNode = 0;
  883|       |
  884|   600k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 18, False: 600k]
  ------------------
  885|     18|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     18|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 18, False: 0]
  ------------------
  886|     18|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     18|#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.13M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 2.02M, False: 113k]
  ------------------
  898|  2.02M|		XMP_Node * currChild = parent->children[childNum];
  899|  2.02M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  2.02M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  2.02M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 486k, False: 1.53M]
  ------------------
  901|   486k|			childNode = currChild;
  902|   486k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 486k, False: 364]
  ------------------
  903|   486k|			break;
  904|   486k|		}
  905|  2.02M|	}
  906|       |	
  907|   600k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 113k, False: 486k]
  |  Branch (907:27): [True: 48.0k, False: 65.2k]
  ------------------
  908|  48.0k|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  48.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|  48.0k|		parent->children.push_back ( childNode );
  910|  48.0k|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 48.0k, False: 0]
  ------------------
  911|  48.0k|	}
  912|       |	
  913|   600k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   600k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   600k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   600k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   600k|	return childNode;
  916|       |	
  917|   600k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|   114k|{
  935|   114k|	XMP_Node * qualNode = 0;
  936|       |	
  937|   114k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|   114k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  1.50M|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 1.45M, False: 54.3k]
  ------------------
  940|  1.45M|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  1.45M|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  1.45M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  1.45M|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 60.5k, False: 1.39M]
  ------------------
  943|  60.5k|			qualNode = currQual;
  944|  60.5k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 60.5k, False: 0]
  ------------------
  945|  60.5k|			break;
  946|  60.5k|		}
  947|  1.45M|	}
  948|       |	
  949|   114k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 54.3k, False: 60.5k]
  |  Branch (949:26): [True: 54.3k, False: 0]
  ------------------
  950|       |
  951|  54.3k|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|  54.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|  54.3k|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|  54.3k|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|  54.3k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|  54.3k|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|  54.3k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|  54.3k|		const bool isSpecial = isLang | isType;
  957|       |
  958|  54.3k|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 8.42k, False: 45.9k]
  ------------------
  959|  8.42k|			parent->options |= kXMP_PropHasLang;
  960|  45.9k|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 40, False: 45.8k]
  ------------------
  961|     40|			parent->options |= kXMP_PropHasType;
  962|     40|		}
  963|       |		
  964|  54.3k|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 10.2k, False: 44.1k]
  |  Branch (964:38): [True: 44.0k, False: 14]
  ------------------
  965|  54.3k|			parent->qualifiers.push_back ( qualNode );
  966|  54.3k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 54.3k, False: 0]
  ------------------
  967|  54.3k|		} else {
  968|     14|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|     14|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 14, False: 0]
  |  Branch (969:19): [True: 14, False: 0]
  ------------------
  970|     14|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|     14|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 14, False: 0]
  ------------------
  972|     14|		}
  973|       |
  974|  54.3k|	}
  975|       |	
  976|   114k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|   114k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|   114k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   114k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|   114k|	return qualNode;
  979|       |	
  980|   114k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   476k|{
 1063|   476k|	XMP_Node *     currNode = 0;
 1064|   476k|	XMP_NodePtrPos currPos;
 1065|   476k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   476k|	bool           leafIsNew = false;
 1067|       |	
 1068|   476k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   476k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   476k|	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: 476k]
  ------------------
 1071|       |	
 1072|   476k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   476k|	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|   476k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 476k, False: 0]
  ------------------
 1082|       |		
 1083|   476k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   476k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 414, False: 475k]
  ------------------
 1085|       |
 1086|   475k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   475k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 11.2k, False: 464k]
  ------------------
 1087|  11.2k|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  11.2k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|  11.2k|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 11.2k, False: 0]
  ------------------
 1089|  11.2k|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|  11.2k|		}
 1091|       |
 1092|   475k|	} 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|   475k|	try {
 1138|  1.53M|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 1.06M, False: 475k]
  ------------------
 1139|  1.06M|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|  1.06M|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 536, False: 1.06M]
  ------------------
 1141|  1.06M|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|  1.06M|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 184k, False: 877k]
  ------------------
 1142|   184k|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|   184k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|   184k|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|   184k|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 173k, False: 11.2k]
  ------------------
 1145|   184k|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|   184k|			}
 1147|  1.06M|		}
 1148|   475k|	} catch ( ... ) {
 1149|     22|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 22, False: 0]
  ------------------
 1150|     22|		throw;
 1151|     22|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   475k|EXIT:
 1156|       |
 1157|   475k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   475k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   475k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   475k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   475k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 184k, False: 291k]
  ------------------
 1161|   184k|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 184k, False: 0]
  ------------------
 1162|   184k|			currNode->options |= leafOptions;
 1163|   184k|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|   184k|	}
 1167|       |
 1168|   475k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 475k, False: 536]
  |  Branch (1168:26): [True: 0, False: 475k]
  ------------------
 1169|   475k|	return currNode;
 1170|       |	
 1171|   475k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  21.2k|{
 1344|  21.2k|	char * tagStart;
 1345|  21.2k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  21.2k|	tagStart = (char*) value->c_str();
 1350|  1.45M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 1.44M, False: 7.44k]
  |  Branch (1350:45): [True: 1.43M, False: 13.7k]
  ------------------
 1351|  1.43M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 1.39M, False: 33.1k]
  |  Branch (1351:28): [True: 11.1k, False: 1.38M]
  ------------------
 1352|  1.43M|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  21.2k|	tagStart = tagEnd;
 1357|  21.2k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 13.7k, False: 7.44k]
  ------------------
 1358|  2.05M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 2.03M, False: 19.4k]
  |  Branch (1358:45): [True: 2.03M, False: 1.76k]
  ------------------
 1359|  2.03M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.90M, False: 131k]
  |  Branch (1359:28): [True: 16.8k, False: 1.88M]
  ------------------
 1360|  2.03M|	}
 1361|  21.2k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 1.76k, False: 19.4k]
  ------------------
 1362|  1.76k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 146, False: 1.62k]
  |  Branch (1362:30): [True: 143, False: 3]
  ------------------
 1363|  1.76k|		++tagStart;
 1364|  1.76k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 1.75k, False: 14]
  |  Branch (1364:30): [True: 771, False: 981]
  ------------------
 1365|  1.76k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  24.5k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 24.5k, Folded]
  ------------------
 1370|  24.5k|		tagStart = tagEnd;
 1371|  24.5k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 3.51k, False: 21.0k]
  ------------------
 1372|  24.5k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 21.2k, False: 3.38k]
  ------------------
 1373|  10.0M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 10.0M, False: 1.63k]
  |  Branch (1373:46): [True: 10.0M, False: 1.75k]
  ------------------
 1374|  10.0M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 9.95M, False: 56.4k]
  |  Branch (1374:29): [True: 34.5k, False: 9.92M]
  ------------------
 1375|  10.0M|		}
 1376|  3.38k|	}
 1377|       |	
 1378|  21.2k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    970|{
 1391|    970|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    970|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    970|	size_t itemNum;
 1394|    970|	size_t itemLim = array->children.size();
 1395|    970|	bool   hasDefault = false;
 1396|       |	
 1397|  6.69k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 5.83k, False: 856]
  ------------------
 1398|       |	
 1399|  5.83k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 5.83k]
  ------------------
 1400|  5.83k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 5.83k]
  ------------------
 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.83k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 114, False: 5.72k]
  ------------------
 1405|    114|			hasDefault = true;
 1406|    114|			break;
 1407|    114|		}
 1408|       |
 1409|  5.83k|	}
 1410|       |
 1411|    970|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 114, False: 856]
  ------------------
 1412|       |
 1413|    114|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 46, False: 68]
  ------------------
 1414|     46|			XMP_Node * temp = array->children[0];
 1415|     46|			array->children[0] = array->children[itemNum];
 1416|     46|			array->children[itemNum] = temp;
 1417|     46|		}
 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|    114|	}
 1423|       |	
 1424|    970|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.91k|{
 1435|  1.91k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.91k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.91k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  8.31k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 7.28k, False: 1.03k]
  ------------------
 1440|  7.28k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  7.28k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 113, False: 7.17k]
  |  Branch (1441:50): [True: 768, False: 6.40k]
  ------------------
 1442|  7.28k|	}
 1443|       |	
 1444|  1.91k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.85k, False: 63]
  |  Branch (1444:25): [True: 970, False: 881]
  ------------------
 1445|    970|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    970|		NormalizeLangArray ( xmpParent );
 1447|    970|	}
 1448|       |
 1449|  1.91k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   483k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   483k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   483k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   483k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   483k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   483k|	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: 483k]
  ------------------
  161|       |
  162|   483k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 483k]
  |  Branch (162:29): [True: 0, False: 483k]
  ------------------
  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|  53.4M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 52.9M, False: 483k]
  ------------------
  166|  52.9M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 52.9M]
  |  Branch (166:24): [True: 0, False: 52.9M]
  ------------------
  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|  52.9M|	}
  170|       |
  171|   483k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   483k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 483k]
  ------------------
  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|   483k|	XMP_StringPtr colonPos = propName;
  177|  38.0M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 37.8M, False: 199k]
  |  Branch (177:30): [True: 37.5M, False: 283k]
  ------------------
  178|   483k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   483k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 199k, False: 283k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|   199k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|   199k|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|   199k|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   283k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   283k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   283k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   283k|		XMP_VarString prefix ( propName, prefixLen );
  198|   283k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   283k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 283k]
  ------------------
  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|   283k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 72, False: 283k]
  ------------------
  203|     72|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     72|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   283k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   283k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   283k|	}
  210|       |
  211|   483k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|   174k|{
  220|   174k|	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: 174k]
  ------------------
  221|       |
  222|   174k|	XMP_StringPtr colonPos = qualName;
  223|  8.45M|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 8.45M, False: 0]
  |  Branch (223:34): [True: 8.27M, False: 174k]
  ------------------
  224|   174k|	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: 174k]
  |  Branch (224:33): [True: 0, False: 174k]
  ------------------
  225|       |
  226|   174k|	VerifySimpleXMLName ( qualName, colonPos );
  227|   174k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|   174k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|   174k|	XMP_VarString prefix ( qualName, prefixLen );
  231|   174k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|   174k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 50, False: 174k]
  ------------------
  233|     50|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|     50|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|   174k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|  1.06M|{
  395|  1.06M|	XMP_Node * nextNode = 0;
  396|  1.06M|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|  1.06M|	XMP_Index      index    = 0;
  398|  1.06M|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|  1.06M|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|  1.06M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|  1.06M|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 535k, False: 527k]
  ------------------
  403|       |
  404|   535k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   535k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 114k, False: 412k]
  ------------------
  407|       |	
  408|   114k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|   114k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|   114k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|   114k|		++qualStep;
  411|   114k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   412k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   412k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 22, False: 412k]
  ------------------
  418|     22|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   412k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 412k, False: 0]
  ------------------
  422|   412k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   412k|		} 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|   412k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 412k, False: 0]
  |  Branch (437:24): [True: 412k, False: 0]
  ------------------
  438|       |
  439|   412k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 412k]
  |  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|   412k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 412k, False: 0]
  |  Branch (464:27): [True: 412k, False: 0]
  ------------------
  465|       |	
  466|   412k|	}
  467|       |
  468|  1.06M|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|  1.06M|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 1.06M, False: 536]
  |  Branch (468:26): [True: 184k, False: 877k]
  ------------------
  469|   184k|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|   184k|	}
  471|       |	
  472|  1.06M|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|  1.06M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|  1.06M|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  1.06M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|  1.06M|	return nextNode;
  475|       |	
  476|  1.06M|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   412k|{
  249|   412k|	XMP_Index index = 0;
  250|   412k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   412k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   412k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|  1.55M|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 1.14M, False: 412k]
  ------------------
  255|  1.14M|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|  1.14M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|  1.14M|		index = (index * 10) + (indexStep[chNum] - '0');
  257|  1.14M|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 1.14M]
  ------------------
  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|  1.14M|	}
  261|       |
  262|   412k|	--index;	// Change to a C-style, zero based index.
  263|   412k|	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: 412k]
  ------------------
  264|       |
  265|   412k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 82.1k, False: 330k]
  |  Branch (265:59): [True: 82.1k, False: 0]
  ------------------
  266|  82.1k|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|  82.1k|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  82.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|  82.1k|		arrayNode->children.push_back ( newItem );
  268|  82.1k|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   412k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 412k]
  ------------------
  272|   412k|	return index;
  273|       |	
  274|   412k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|   184k|{
  488|       |
  489|   184k|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 24, False: 184k]
  ------------------
  490|     24|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 24, False: 0]
  ------------------
  491|     24|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|     24|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 2, False: 22]
  ------------------
  492|       |
  493|      2|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      2|	}
  496|       |
  497|   184k|}	// CheckImplicitStruct
XMPCore_Impl.cpp:_ZL13DeleteSubtreeNSt3__111__wrap_iterIPP8XMP_NodeEE:
  507|     22|{
  508|     22|	XMP_Node * rootNode   = *rootNodePos;
  509|     22|	XMP_Node * rootParent = rootNode->parent;
  510|       |
  511|     22|	if ( ! (rootNode->options & kXMP_PropIsQualifier) ) {
  ------------------
  |  Branch (511:7): [True: 22, False: 0]
  ------------------
  512|       |
  513|     22|		rootParent->children.erase ( rootNodePos );
  514|       |
  515|     22|	} 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|     22|	delete rootNode;
  533|       |
  534|     22|}	// DeleteSubtree

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

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

_ZN7XMPMeta11SetPropertyEPKcS1_S1_j:
  454|   183k|{
  455|   183k|	XMP_Assert ( (schemaNS != 0) && (propName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|   183k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  456|       |
  457|   183k|	options = VerifySetOptions ( options, propValue );
  458|       |
  459|   183k|	XMP_ExpandedXPath expPath;
  460|   183k|	ExpandXPath ( schemaNS, propName, &expPath );
  461|       |
  462|   183k|	XMP_Node * propNode = FindNode ( &tree, expPath, kXMP_CreateNodes, options );
  ------------------
  |  |  295|   183k|#define kXMP_CreateNodes	true
  ------------------
  463|   183k|	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: 183k]
  ------------------
  464|       |	
  465|   183k|	SetNode ( propNode, propValue, options );
  466|       |	
  467|   183k|}	// SetProperty
_ZN7XMPMeta15AppendArrayItemEPKcS1_jS1_j:
  503|  3.90k|{
  504|  3.90k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.90k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  505|       |
  506|  3.90k|	arrayOptions = VerifySetOptions ( arrayOptions, 0 );
  507|  3.90k|	if ( (arrayOptions & ~kXMP_PropArrayFormMask) != 0 ) {
  ------------------
  |  Branch (507:7): [True: 0, False: 3.90k]
  ------------------
  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.90k|	XMP_ExpandedXPath arrayPath;
  515|  3.90k|	ExpandXPath ( schemaNS, arrayName, &arrayPath );
  516|  3.90k|	XMP_Node * arrayNode = FindNode ( &tree, arrayPath, kXMP_ExistingOnly );	// Just lookup, don't try to create.
  ------------------
  |  |  296|  3.90k|#define kXMP_ExistingOnly	false
  ------------------
  517|       |	
  518|  3.90k|	if ( arrayNode != 0 ) {
  ------------------
  |  Branch (518:7): [True: 2.95k, False: 950]
  ------------------
  519|       |		// The array exists, make sure the form is compatible. Zero arrayForm means take what exists.
  520|  2.95k|		if ( ! (arrayNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 2.95k]
  ------------------
  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.95k|	} else {
  530|       |		// The array does not exist, try to create it.
  531|    950|		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: 950]
  ------------------
  532|    950|		arrayNode = FindNode ( &tree, arrayPath, kXMP_CreateNodes, arrayOptions );
  ------------------
  |  |  295|    950|#define kXMP_CreateNodes	true
  ------------------
  533|    950|		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: 950]
  ------------------
  534|    950|	}
  535|       |	
  536|  3.90k|	DoSetArrayItem ( arrayNode, kXMP_ArrayLastItem, itemValue, (options | kXMP_InsertAfterItem) );
  537|       |	
  538|  3.90k|}	// AppendArrayItem
_ZN7XMPMeta12SetQualifierEPKcS1_S1_S1_S1_j:
  575|  3.90k|{
  576|  3.90k|	XMP_Assert ( (schemaNS != 0) && (propName != 0) && (qualNS != 0) && (qualName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.90k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  577|       |
  578|  3.90k|	XMP_StringPtr	qualPath;
  579|  3.90k|	XMP_StringLen	pathLen;
  580|       |
  581|  3.90k|	XMP_ExpandedXPath expPath;
  582|  3.90k|	ExpandXPath ( schemaNS, propName, &expPath );
  583|  3.90k|	XMP_Node * propNode = FindNode ( &tree, expPath, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.90k|#define kXMP_ExistingOnly	false
  ------------------
  584|  3.90k|	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.90k]
  ------------------
  585|       |
  586|  3.90k|	XMPUtils::ComposeQualifierPath ( schemaNS, propName, qualNS, qualName, &qualPath, &pathLen );
  587|  3.90k|	SetProperty ( schemaNS, qualPath, qualValue, options );
  588|       |
  589|  3.90k|}	// SetQualifier
XMPMeta-GetSet.cpp:_ZL7SetNodeP8XMP_NodePKcj:
  117|   187k|{
  118|   187k|	if ( options & kXMP_DeleteExisting ) {
  ------------------
  |  Branch (118:7): [True: 0, False: 187k]
  ------------------
  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|   187k|	node->options |= options;	// Keep options set by FindNode when creating a new node.
  127|       |
  128|   187k|	if ( value != 0 ) {
  ------------------
  |  Branch (128:7): [True: 174k, False: 13.3k]
  ------------------
  129|       |	
  130|       |		// This is setting the value of a leaf node.
  131|   174k|		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: 174k]
  ------------------
  132|   174k|		XMP_Assert ( node->children.empty() );
  ------------------
  |  |  142|   174k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  133|   174k|		SetNodeValue ( node, value );
  134|       |	
  135|   174k|	} else {
  136|       |	
  137|       |		// This is setting up an array or struct.
  138|  13.3k|		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: 13.3k]
  ------------------
  139|  13.3k|		if ( node->options & kXMP_PropCompositeMask ) {	// Can't change an array to a struct, or vice versa.
  ------------------
  |  Branch (139:8): [True: 10.0k, False: 3.26k]
  ------------------
  140|  10.0k|			if ( (options & kXMP_PropCompositeMask) != (node->options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (140:9): [True: 0, False: 10.0k]
  ------------------
  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|  10.0k|		}
  144|  13.3k|		node->RemoveChildren();
  145|       |	
  146|  13.3k|	}
  147|       |	
  148|   187k|}	// SetNode
XMPMeta-GetSet.cpp:_ZL14DoSetArrayItemP8XMP_NodeiPKcj:
  160|  3.90k|{
  161|  3.90k|	XMP_OptionBits itemLoc = options & kXMP_PropArrayLocationMask;
  162|  3.90k|	XMP_Index      arraySize = arrayNode->children.size();
  163|       |	
  164|  3.90k|	options &= ~kXMP_PropArrayLocationMask;
  165|  3.90k|	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.90k|	XMP_Node * itemNode = 0;
  173|       |	
  174|  3.90k|	if ( itemIndex == kXMP_ArrayLastItem ) itemIndex = arraySize;
  ------------------
  |  Branch (174:7): [True: 3.90k, False: 0]
  ------------------
  175|  3.90k|	if ( (itemIndex == 0) && (itemLoc == kXMP_InsertAfterItem) ) {
  ------------------
  |  Branch (175:7): [True: 950, False: 2.95k]
  |  Branch (175:27): [True: 950, False: 0]
  ------------------
  176|    950|		itemIndex = 1;
  177|    950|		itemLoc = kXMP_InsertBeforeItem;
  178|    950|	}
  179|  3.90k|	if ( (itemIndex == arraySize) && (itemLoc == kXMP_InsertAfterItem) ) {
  ------------------
  |  Branch (179:7): [True: 2.95k, False: 950]
  |  Branch (179:35): [True: 2.95k, False: 0]
  ------------------
  180|  2.95k|		itemIndex += 1;
  181|  2.95k|		itemLoc = 0;
  182|  2.95k|	}
  183|  3.90k|	if ( (itemIndex == arraySize+1) && (itemLoc == kXMP_InsertBeforeItem) ) itemLoc = 0;
  ------------------
  |  Branch (183:7): [True: 3.90k, False: 0]
  |  Branch (183:37): [True: 950, False: 2.95k]
  ------------------
  184|       |	
  185|  3.90k|	if ( itemIndex == arraySize+1 ) {
  ------------------
  |  Branch (185:7): [True: 3.90k, False: 0]
  ------------------
  186|       |
  187|  3.90k|		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.90k]
  ------------------
  188|  3.90k|		itemNode = new XMP_Node ( arrayNode, kXMP_ArrayItemName, 0 );
  ------------------
  |  |  293|  3.90k|#define kXMP_ArrayItemName	"[]"
  ------------------
  189|  3.90k|		arrayNode->children.push_back ( itemNode );
  190|       |
  191|  3.90k|	} 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.90k|	SetNode ( itemNode, itemValue, options );
  207|       |	
  208|  3.90k|}	// DoSetArrayItem
XMPMeta-GetSet.cpp:_ZL12SetNodeValueP8XMP_NodePKc:
   76|   174k|{
   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|   174k|	node->value = value;
   85|       |	
   86|   174k|	XMP_Uns8* chPtr = (XMP_Uns8*) node->value.c_str();	// Check for valid UTF-8, replace ASCII controls with a space.
   87|   355k|	while ( *chPtr != 0 ) {
  ------------------
  |  Branch (87:10): [True: 181k, False: 174k]
  ------------------
   88|  15.8M|		while ( (*chPtr != 0) && (*chPtr < 0x80) ) {
  ------------------
  |  Branch (88:11): [True: 15.6M, False: 173k]
  |  Branch (88:28): [True: 15.6M, False: 7.80k]
  ------------------
   89|  15.6M|			if ( *chPtr < 0x20 ) {
  ------------------
  |  Branch (89:9): [True: 4.03k, False: 15.6M]
  ------------------
   90|  4.03k|				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  100|  4.03k|#define kTab ((char)0x09)
  ------------------
              				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  101|  2.17k|#define kLF ((char)0x0A)
  ------------------
              				if ( (*chPtr != kTab) && (*chPtr != kLF) && (*chPtr != kCR) ) *chPtr = 0x20;
  ------------------
  |  |  102|    819|#define kCR ((char)0x0D)
  ------------------
  |  Branch (90:10): [True: 2.17k, False: 1.85k]
  |  Branch (90:30): [True: 819, False: 1.35k]
  |  Branch (90:49): [True: 531, False: 288]
  ------------------
   91|  15.6M|			} else if (*chPtr == 0x7F ) {
  ------------------
  |  Branch (91:15): [True: 306, False: 15.6M]
  ------------------
   92|    306|				*chPtr = 0x20;
   93|    306|			}
   94|  15.6M|			++chPtr;
   95|  15.6M|		}
   96|   181k|		XMP_Assert ( (*chPtr == 0) || (*chPtr >= 0x80) );
  ------------------
  |  |  142|   181k|	#define XMP_Assert(c)	((void) 0)
  ------------------
   97|   181k|		if ( *chPtr != 0 ) (void) GetCodePoint ( (const XMP_Uns8 **) &chPtr );	// Throws for bad UTF-8.
  ------------------
  |  Branch (97:8): [True: 7.80k, False: 173k]
  ------------------
   98|   181k|	}
   99|       |
  100|   174k|	if ( XMP_PropIsQualifier(node->options) && (node->name == "xml:lang") ) NormalizeLangValue ( &node->value );
  ------------------
  |  Branch (100:7): [True: 54.0k, False: 120k]
  |  Branch (100:45): [True: 8.15k, False: 45.8k]
  ------------------
  101|       |
  102|       |	#if 0	// *** XMP_DebugBuild
  103|       |		node->_valuePtr = node->value.c_str();
  104|       |	#endif
  105|       |	
  106|   174k|}	// SetNodeValue

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  7.15k|{
 1097|  7.15k|	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: 7.15k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  7.15k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 7.15k]
  ------------------
 1099|       |	
 1100|  7.15k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  7.15k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  7.15k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 7.15k, False: 0]
  ------------------
 1105|  7.15k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 7.15k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  7.15k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  7.15k|	}
 1108|       |	
 1109|  7.15k|	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|  7.15k|	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|  7.15k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 7.15k, False: 0]
  ------------------
 1127|       |
 1128|  7.15k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 7.15k, False: 0]
  |  Branch (1128:39): [True: 7.10k, False: 48]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  7.10k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  7.10k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     48|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     48|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 48, False: 0]
  ------------------
 1139|       |
 1140|     48|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     48|				buffer += pendingOverlap;
 1142|     48|				xmpSize -= pendingOverlap;
 1143|     48|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     48|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 48]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     48|				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|     48|			}
 1153|       |
 1154|  7.15k|		}
 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|  7.15k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  7.15k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  7.15k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 7.15k]
  ------------------
 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|  7.15k|		} 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|  7.20k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 48, False: 7.15k]
  ------------------
 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|     48|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     48|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 48, False: 0]
  ------------------
 1190|       |				
 1191|     48|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     48|				parser.pendingCount += pendingOverlap;
 1193|     48|				buffer += pendingOverlap;
 1194|     48|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     48|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 48]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     48|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     48|				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|     48|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 48, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     48|					parser.pendingCount = 0;
 1208|       |
 1209|     48|				} 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|     48|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  7.15k|			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|  7.15k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 7.15k]
  ------------------
 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|  7.15k|		}
 1258|       |		
 1259|  7.15k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 7.10k, False: 48]
  ------------------
 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|  7.10k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  7.10k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 6.58k, False: 520]
  ------------------
 1269|       |
 1270|  6.58k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  6.58k|				NormalizeDCArrays ( &this->tree );
 1272|  6.58k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 6.58k]
  ------------------
 1273|  6.58k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  6.58k|				size_t schemaNum = 0;
 1277|  20.7k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 14.1k, False: 6.58k]
  ------------------
 1278|  14.1k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  14.1k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 14.1k, False: 0]
  ------------------
 1280|  14.1k|						++schemaNum;
 1281|  14.1k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  14.1k|				}
 1286|       |				
 1287|  6.58k|			}
 1288|       |
 1289|  7.10k|			delete this->xmlParser;
 1290|  7.10k|			this->xmlParser = 0;
 1291|       |
 1292|  7.10k|		}
 1293|       |		
 1294|  7.15k|	} catch ( ... ) {
 1295|       |
 1296|  1.37k|		delete this->xmlParser;
 1297|  1.37k|		this->xmlParser = 0;
 1298|  1.37k|		prevTkVer = 0;
 1299|  1.37k|		this->tree.ClearNode();
 1300|  1.37k|		throw;
 1301|       |
 1302|  1.37k|	}
 1303|       |	
 1304|  7.15k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  7.15k|{
  811|  7.15k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 7.15k]
  ------------------
  812|       |	
  813|  7.15k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  7.15k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 7.15k]
  ------------------
  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|  7.15k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 7.13k, False: 20]
  ------------------
  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|  7.13k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 7.13k, 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|     20|	} 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|     20|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 20, 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|  7.15k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  7.20k|{
  977|  7.20k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  7.20k|	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|  7.20k|	std::string copy;
  992|       |		
  993|  79.3M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 79.3M, False: 7.20k]
  ------------------
  994|       |
  995|  79.3M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 79.0M, False: 309k]
  |  Branch (995:30): [True: 78.9M, False: 76.9k]
  |  Branch (995:52): [True: 78.0M, False: 875k]
  ------------------
  996|  78.0M|			copy.push_back(*spanEnd);
  997|  78.0M|			continue;	// A regular ASCII character.
  998|  78.0M|		}
  999|       |
 1000|  1.26M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 42.8k, False: 1.21M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  42.8k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  42.8k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 42.8k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  42.8k|				copy.append((const char*)spanEnd, uniLen);
 1010|  42.8k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  42.8k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|  1.21M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 309k, False: 909k]
  |  Branch (1026:36): [True: 34.1k, False: 875k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   344k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   344k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   334k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|  38.3k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 9.98k, False: 334k]
  |  Branch (1030:31): [True: 295k, False: 38.3k]
  |  Branch (1030:52): [True: 4.18k, False: 34.1k]
  ------------------
 1031|   309k|				copy.push_back(*spanEnd);
 1032|   309k|				continue;
 1033|   309k|			}
 1034|       |
 1035|  34.1k|			copy.push_back(' ');
 1036|       |		
 1037|   875k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   875k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   875k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   875k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   875k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 8, False: 875k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|      8|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 8, False: 0]
  ------------------
 1048|      8|					copy.push_back('&');
 1049|      8|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|      8|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   875k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 75.2k, False: 800k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  75.2k|				copy.push_back(' ');
 1058|  75.2k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   800k|			} else {
 1061|   800k|				copy.push_back('&');
 1062|   800k|			}
 1063|       |
 1064|   875k|		}
 1065|       |		
 1066|  1.26M|	}
 1067|       |	
 1068|  7.20k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  7.20k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  7.20k|	copy.push_back(' ');
 1070|  7.20k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  7.20k|	return length;
 1072|       |
 1073|  7.20k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  42.8k|{
  868|  42.8k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  42.8k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  42.8k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 42.8k]
  ------------------
  870|  42.8k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 42.8k]
  ------------------
  871|       |	
  872|  42.8k|	int byteCount = 2;
  873|  42.8k|	XMP_Uns8 firstByte = *charStart;
  874|  62.9k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 20.1k, False: 42.8k]
  ------------------
  875|       |	
  876|  42.8k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 42.8k]
  ------------------
  877|       |
  878|   105k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 62.9k, False: 42.8k]
  ------------------
  879|  62.9k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 62.9k]
  ------------------
  880|  62.9k|	}
  881|       |	
  882|  42.8k|	return byteCount;
  883|       |	
  884|  42.8k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   875k|{
  898|   875k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   875k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   875k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 875k]
  ------------------
  900|   875k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   875k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   875k|	size_t tailLen = bufEnd - escStart;
  903|   875k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 8, False: 875k]
  ------------------
  904|       |	
  905|   875k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 389k, False: 485k]
  ------------------
  906|       |	
  907|   485k|	XMP_Uns8 escValue = 0;
  908|   485k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   485k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 483k, False: 2.60k]
  |  Branch (910:27): [True: 384k, False: 99.0k]
  ------------------
  911|   384k|		escValue = *escPos - '0';
  912|   384k|		++escPos;
  913|   384k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 90.1k, False: 11.5k]
  |  Branch (913:34): [True: 23.5k, False: 66.5k]
  ------------------
  914|  23.5k|		escValue = *escPos - 'A' + 10;
  915|  23.5k|		++escPos;
  916|  78.0k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 65.9k, False: 12.1k]
  |  Branch (916:34): [True: 49.4k, False: 16.4k]
  ------------------
  917|  49.4k|		escValue = *escPos - 'a' + 10;
  918|  49.4k|		++escPos;
  919|  49.4k|	}
  920|       |	
  921|   485k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 438k, False: 47.3k]
  |  Branch (921:27): [True: 150k, False: 287k]
  ------------------
  922|   150k|		escValue = (escValue << 4) + (*escPos - '0');
  923|   150k|		++escPos;
  924|   334k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 84.4k, False: 250k]
  |  Branch (924:34): [True: 22.6k, False: 61.8k]
  ------------------
  925|  22.6k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  22.6k|		++escPos;
  927|   312k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 56.8k, False: 255k]
  |  Branch (927:34): [True: 15.3k, False: 41.4k]
  ------------------
  928|  15.3k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|  15.3k|		++escPos;
  930|  15.3k|	}
  931|       |	
  932|   485k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 485k]
  ------------------
  933|   485k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 272k, False: 213k]
  ------------------
  934|       |	
  935|   213k|	size_t escLen = escPos - escStart + 1;
  936|   213k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 7.23k, False: 206k]
  ------------------
  937|       |	
  938|   206k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|   206k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  76.8k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  76.1k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 129k, False: 76.8k]
  |  Branch (938:29): [True: 702, False: 76.1k]
  |  Branch (938:50): [True: 920, False: 75.2k]
  ------------------
  939|       |	
  940|  75.2k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|   206k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  7.10k|{
  152|  7.10k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  7.10k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 151, False: 6.95k]
  ------------------
  155|  7.10k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 520, False: 6.58k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  6.58k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  6.58k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  6.58k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  6.58k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 6.58k]
  ------------------
  164|      0|		     ((rootNode->parent == 0) ||
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|		      ((rootNode->parent->name != "x:xmpmeta") && (rootNode->parent->name != "x:xapmeta"))) ) return 0;
  ------------------
  |  Branch (165:10): [True: 0, False: 0]
  |  Branch (165:53): [True: 0, False: 0]
  ------------------
  166|       |
  167|  7.07k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.75k, False: 5.31k]
  ------------------
  168|  1.75k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.75k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 1.24k, False: 513]
  |  Branch (169:42): [True: 26, False: 487]
  ------------------
  170|  1.27k|				verStr = currAttr->value.c_str();
  171|  1.27k|				break;
  172|  1.27k|			}
  173|  1.75k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  6.58k|	unsigned long part;
  178|  39.9k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 34.6k, False: 5.35k]
  |  Branch (178:29): [True: 2.89k, False: 31.7k]
  |  Branch (178:48): [True: 30.4k, False: 1.23k]
  ------------------
  179|       |	
  180|  6.58k|	part = 0;
  181|  10.0k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 4.67k, False: 5.36k]
  |  Branch (181:28): [True: 3.67k, False: 1.00k]
  |  Branch (181:48): [True: 3.45k, False: 216]
  ------------------
  182|  3.45k|		part = (part * 10) + (*verStr - '0');
  183|  3.45k|		++verStr;
  184|  3.45k|	}
  185|  6.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 155, False: 6.42k]
  ------------------
  186|  6.58k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  6.58k|	part = 0;
  189|  6.58k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 683, False: 5.90k]
  ------------------
  190|  8.16k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 2.79k, False: 5.37k]
  |  Branch (190:28): [True: 1.80k, False: 990]
  |  Branch (190:48): [True: 1.58k, False: 224]
  ------------------
  191|  1.58k|		part = (part * 10) + (*verStr - '0');
  192|  1.58k|		++verStr;
  193|  1.58k|	}
  194|  6.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 131, False: 6.45k]
  ------------------
  195|  6.58k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  6.58k|	part = 0;
  198|  6.58k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 135, False: 6.44k]
  ------------------
  199|  7.80k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 2.43k, False: 5.37k]
  |  Branch (199:28): [True: 1.50k, False: 928]
  |  Branch (199:48): [True: 1.22k, False: 282]
  ------------------
  200|  1.22k|		part = (part * 10) + (*verStr - '0');
  201|  1.22k|		++verStr;
  202|  1.22k|	}
  203|  6.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 56, False: 6.52k]
  ------------------
  204|  6.58k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  6.58k|	part = 0;
  207|  6.58k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 594, False: 5.99k]
  ------------------
  208|  8.65k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 3.27k, False: 5.38k]
  |  Branch (208:28): [True: 2.86k, False: 411]
  |  Branch (208:48): [True: 2.06k, False: 793]
  ------------------
  209|  2.06k|		part = (part * 10) + (*verStr - '0');
  210|  2.06k|		++verStr;
  211|  2.06k|	}
  212|  6.58k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 57, False: 6.52k]
  ------------------
  213|  6.58k|	thiz->prevTkVer += part;
  214|       |	
  215|  6.58k|	return rootNode;
  216|       |	
  217|  6.58k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  1.48k|{
  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.85k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 5.54k, False: 1.31k]
  ------------------
  116|  5.54k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  5.54k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 3.03k, False: 2.51k]
  ------------------
  118|  2.51k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 177, False: 2.33k]
  |  Branch (118:44): [True: 0, False: 2.33k]
  ------------------
  119|  2.51k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  1.31k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 1.31k, False: 0]
  ------------------
  122|  5.33k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 4.16k, False: 1.17k]
  ------------------
  123|  4.16k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  4.16k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 2.22k, False: 1.94k]
  ------------------
  125|  1.94k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 139, False: 1.80k]
  ------------------
  126|  1.94k|		}
  127|  1.31k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  2.32k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 1.16k, False: 1.16k]
  ------------------
  131|  1.16k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  1.16k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 4, False: 1.15k]
  ------------------
  133|  1.16k|	}
  134|       |	
  135|  1.16k|	return 0;
  136|       |
  137|  1.17k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  5.25k|{
  232|  5.25k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.25k|#define kXMP_ExistingOnly	false
  ------------------
  233|  5.25k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 4.82k, False: 431]
  ------------------
  234|       |	
  235|  1.70k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 1.27k, False: 431]
  ------------------
  236|  1.27k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  1.27k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  1.27k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 240, False: 1.03k]
  ------------------
  240|       |		
  241|  1.03k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 50, False: 981]
  ------------------
  242|    981|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 6, False: 975]
  ------------------
  243|     56|			arrayForm = kXMP_PropArrayIsOrdered;
  244|    975|		} else if (
  245|    975|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 6, False: 969]
  ------------------
  246|    969|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 12, False: 957]
  ------------------
  247|    957|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 55, False: 902]
  ------------------
  248|     73|			arrayForm = kXMP_PropArrayIsAltText;
  249|    902|		} else if (
  250|    902|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 22, False: 880]
  ------------------
  251|    880|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 23, False: 857]
  ------------------
  252|    857|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 10, False: 847]
  ------------------
  253|    847|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 16, False: 831]
  ------------------
  254|    831|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 43, False: 788]
  ------------------
  255|    788|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 0, False: 788]
  ------------------
  256|    114|			arrayForm = kXMP_PropValueIsArray;
  257|    114|		}
  258|  1.03k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 788, False: 243]
  ------------------
  259|       |		
  260|    243|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    243|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    243|		dcSchema->children[propNum] = newArray;
  263|    243|		newArray->children.push_back ( currProp );
  264|    243|		currProp->parent = newArray;
  265|    243|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    243|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    243|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 73, False: 170]
  |  Branch (267:44): [True: 34, False: 39]
  ------------------
  268|     34|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|     34|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|     34|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 34, False: 0]
  ------------------
  271|     34|				currProp->qualifiers.push_back ( newLang );
  272|     34|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|     34|		}
  276|       |
  277|    243|	}
  278|       |	
  279|    431|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  5.25k|{
  666|  5.25k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  5.25k|	XMP_Node * currSchema = 0;
  671|       |
  672|  5.25k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.25k|#define kXMP_ExistingOnly	false
  ------------------
  673|  5.25k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 20, False: 5.23k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     20|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     20|#define kXMP_ExistingOnly	false
  ------------------
  677|     20|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 20]
  ------------------
  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|     20|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     20|#define kXMP_ExistingOnly	false
  ------------------
  682|     20|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 20]
  |  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|     20|	}
  697|       |
  698|  5.25k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.25k|#define kXMP_ExistingOnly	false
  ------------------
  699|  5.25k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 5.25k]
  ------------------
  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|  5.25k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.25k|#define kXMP_ExistingOnly	false
  ------------------
  707|  5.25k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 431, False: 4.82k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    431|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    431|#define kXMP_ExistingOnly	false
  ------------------
  710|    431|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 45, False: 386]
  ------------------
  711|     45|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     45|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     45|		}
  714|    431|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  5.25k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  5.25k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  5.25k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  5.25k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  5.25k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  5.25k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 316, False: 4.93k]
  ------------------
  732|       |
  733|    316|		bool nameIsUUID = false;
  734|    316|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    316|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    316|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 28, False: 288]
  |  |  ------------------
  ------------------
  737|       |
  738|     28|			nameIsUUID = true;
  739|       |
  740|    288|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 166, False: 122]
  ------------------
  741|       |
  742|    166|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  3.48k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 3.45k, False: 27]
  ------------------
  744|  3.45k|				char ch = nameStr[i];
  745|  3.45k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 201, False: 3.25k]
  ------------------
  746|    201|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 74, False: 127]
  |  Branch (746:23): [True: 42, False: 85]
  |  Branch (746:36): [True: 14, False: 71]
  |  Branch (746:49): [True: 34, False: 37]
  ------------------
  747|     37|					nameIsUUID = false;
  748|     37|					break;
  749|  3.25k|				} else {
  750|  3.25k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 3.22k, False: 32]
  |  Branch (750:27): [True: 1.83k, False: 1.38k]
  |  Branch (750:44): [True: 1.34k, False: 78]
  |  Branch (750:59): [True: 1.31k, False: 24]
  ------------------
  751|    102|					nameIsUUID = false;
  752|    102|					break;
  753|  3.25k|				}
  754|  3.45k|			}
  755|       |
  756|    166|		}
  757|       |		
  758|    316|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 55, False: 261]
  ------------------
  759|       |
  760|     55|			XMP_ExpandedXPath expPath;
  761|     55|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     55|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     55|#define kXMP_CreateNodes	true
  ------------------
  763|     55|			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: 55]
  ------------------
  764|       |
  765|     55|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     55|			idNode->value = tree.name;
  767|     55|			idNode->RemoveChildren();
  768|     55|			idNode->RemoveQualifiers();
  769|       |
  770|     55|			tree.name.erase();
  771|       |
  772|     55|		}
  773|       |
  774|    316|	}
  775|       |
  776|  5.25k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  26.2k|{
  610|  26.2k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  26.2k|#define kXMP_ExistingOnly	false
  ------------------
  611|  26.2k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 24.8k, False: 1.37k]
  ------------------
  612|       |	
  613|  1.37k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.37k|#define kXMP_ExistingOnly	false
  ------------------
  614|  1.37k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.07k, False: 296]
  |  Branch (614:27): [True: 153, False: 143]
  ------------------
  615|       |	
  616|    143|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 10, False: 133]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|    133|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  1.46k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 1.32k, False: 133]
  ------------------
  622|       |
  623|  1.32k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  1.32k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 84, False: 1.24k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     84|			delete ( currChild );
  629|     84|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  1.24k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.02k, False: 216]
  ------------------
  632|       |		
  633|  1.02k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 24, False: 1.00k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     24|				delete ( currChild );
  637|     24|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  1.00k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  1.00k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  1.00k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 1.00k, False: 0]
  ------------------
  644|  1.00k|					currChild->qualifiers.push_back ( repairLang );
  645|  1.00k|				} else {
  646|      0|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|      0|				}
  648|  1.00k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  1.00k|			}
  651|       |
  652|  1.02k|		}
  653|       |
  654|  1.32k|	}
  655|       |
  656|    133|}	// RepairAltText

_ZNK7XMPMeta17SerializeToBufferEPPKcPjjjS1_S1_i:
 1165|  3.89k|{
 1166|  3.89k|	XMP_Assert ( (rdfString != 0) && (rdfSize != 0) && (newline != 0) && (indentStr != 0) );
  ------------------
  |  |  142|  3.89k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1167|       |
 1168|       |	// Fix up some default parameters.
 1169|       |	
 1170|  3.89k|	enum { kDefaultPad = 2048 };
 1171|  3.89k|	size_t unicodeUnitSize = 1;
 1172|  3.89k|	XMP_OptionBits charEncoding = options & kXMP_EncodingMask;
 1173|       |
 1174|  3.89k|	if ( charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1174:7): [True: 0, False: 3.89k]
  ------------------
 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.89k|	if ( options & kXMP_OmitAllFormatting ) {
  ------------------
  |  Branch (1185:7): [True: 19, False: 3.87k]
  ------------------
 1186|     19|		newline = " ";	// ! Yes, a space for "newline". This ensures token separation.
 1187|     19|		indentStr = "";
 1188|  3.87k|	} else {
 1189|  3.87k|		if ( *newline == 0 ) newline = "\xA";	// Linefeed
  ------------------
  |  Branch (1189:8): [True: 3.87k, False: 0]
  ------------------
 1190|  3.87k|		if ( *indentStr == 0 ) {
  ------------------
  |  Branch (1190:8): [True: 3.87k, False: 0]
  ------------------
 1191|  3.87k|			indentStr = " ";
 1192|  3.87k|			if ( ! (options & kXMP_UseCompactFormat) ) indentStr  = "   ";
  ------------------
  |  Branch (1192:9): [True: 0, False: 3.87k]
  ------------------
 1193|  3.87k|		}
 1194|  3.87k|	}
 1195|       |	
 1196|  3.89k|	if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1196:7): [True: 0, False: 3.89k]
  ------------------
 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.89k|	} else if ( options & kXMP_ReadOnlyPacket ) {
  ------------------
  |  Branch (1203:14): [True: 0, False: 3.89k]
  ------------------
 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.89k|	} else if ( options & kXMP_OmitPacketWrapper ) {
  ------------------
  |  Branch (1208:14): [True: 1.49k, False: 2.39k]
  ------------------
 1209|  1.49k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1209:8): [True: 0, False: 1.49k]
  ------------------
 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.49k|		padding = 0;
 1213|  2.39k|	} else {
 1214|  2.39k|		if ( padding == 0 ) padding = kDefaultPad * unicodeUnitSize;
  ------------------
  |  Branch (1214:8): [True: 2.39k, False: 0]
  ------------------
 1215|  2.39k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1215:8): [True: 0, False: 2.39k]
  ------------------
 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.39k|	}
 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.89k|	std::string tailStr;
 1223|       |
 1224|  3.89k|	SerializeAsRDF ( *this, *sOutputStr, tailStr, options, newline, indentStr, baseIndent );
 1225|  3.89k|	if ( charEncoding == kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1225:7): [True: 3.89k, False: 0]
  ------------------
 1226|       |
 1227|  3.89k|		if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1227:8): [True: 0, False: 3.89k]
  ------------------
 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.89k|		size_t newlineLen = strlen ( newline );
 1234|       |	
 1235|  3.89k|		if ( padding < newlineLen ) {
  ------------------
  |  Branch (1235:8): [True: 1.49k, False: 2.39k]
  ------------------
 1236|  1.49k|			sOutputStr->append ( padding, ' ' );
 1237|  2.39k|		} else {
 1238|  2.39k|			padding -= newlineLen;	// Write this newline last.
 1239|  50.3k|			while ( padding >= (100 + newlineLen) ) {
  ------------------
  |  Branch (1239:12): [True: 47.9k, False: 2.39k]
  ------------------
 1240|  47.9k|				sOutputStr->append ( 100, ' ' );
 1241|  47.9k|				*sOutputStr += newline;
 1242|  47.9k|				padding -= (100 + newlineLen);
 1243|  47.9k|			}
 1244|  2.39k|			sOutputStr->append ( padding, ' ' );
 1245|  2.39k|			*sOutputStr += newline;
 1246|  2.39k|		}
 1247|       |
 1248|  3.89k|		*sOutputStr += tailStr;
 1249|       |	
 1250|  3.89k|	} 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.89k|	*rdfString = sOutputStr->c_str();
 1338|  3.89k|	*rdfSize   = sOutputStr->size();
 1339|       |
 1340|  3.89k|}	// SerializeToBuffer
XMPMeta-Serialize.cpp:_ZL14SerializeAsRDFRK7XMPMetaRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_jPKcSB_i:
 1058|  3.89k|{
 1059|  3.89k|	const size_t treeNameLen = xmpObj.tree.name.size();
 1060|  3.89k|	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.89k|	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.0k, False: 3.89k]
  ------------------
 1073|  11.0k|		const XMP_Node * currSchema = xmpObj.tree.children[schemaNum];
 1074|  11.0k|		outputLen += 2*(baseIndent+2)*indentLen + strlen(kRDF_SchemaStart) + treeNameLen + strlen(kRDF_SchemaEnd) + 2;
 1075|  11.0k|		outputLen += EstimateRDFSize ( currSchema, baseIndent+2, indentLen );
 1076|  11.0k|	}
 1077|       |	
 1078|  3.89k|	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.89k|	XMP_Index level;
 1083|       |	
 1084|  3.89k|	headStr.erase();
 1085|  3.89k|	headStr.reserve ( outputLen );
 1086|       |	
 1087|       |	// Write the packet header PI.
 1088|  3.89k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1088:7): [True: 2.39k, False: 1.49k]
  ------------------
 1089|  2.39k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1089:29): [True: 0, False: 2.39k]
  ------------------
 1090|  2.39k|		headStr += kPacketHeader;
 1091|  2.39k|		headStr += newline;
 1092|  2.39k|	}
 1093|       |
 1094|       |	// Write the xmpmeta element's start tag.
 1095|  3.89k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1095:7): [True: 3.89k, False: 0]
  ------------------
 1096|  3.89k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1096:29): [True: 0, False: 3.89k]
  ------------------
 1097|  3.89k|		headStr += kRDF_XMPMetaStart;
 1098|  3.89k|		headStr += kXMPCore_VersionMessage "\">";
  ------------------
  |  |  134|  3.89k|	#define kXMPCore_VersionMessage	kXMPCoreName " " XMP_API_VERSION_STRING
  |  |  ------------------
  |  |  |  |  133|  3.89k|	#define kXMPCoreName "XMP Core"
  |  |  ------------------
  ------------------
 1099|  3.89k|		headStr += newline;
 1100|  3.89k|	}
 1101|       |
 1102|       |	// Write the rdf:RDF start tag.
 1103|  7.79k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1103:30): [True: 3.89k, False: 3.89k]
  ------------------
 1104|  3.89k|	headStr += kRDF_RDFStart;
 1105|  3.89k|	headStr += newline;
 1106|       |	
 1107|       |	// Write all of the properties.
 1108|  3.89k|	if ( options & kXMP_UseCompactFormat ) {
  ------------------
  |  Branch (1108:7): [True: 3.89k, False: 0]
  ------------------
 1109|  3.89k|		SerializeCompactRDFSchemas ( xmpObj.tree, headStr, newline, indentStr, baseIndent );
 1110|  3.89k|	} 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.79k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1127:30): [True: 3.89k, False: 3.89k]
  ------------------
 1128|  3.89k|	headStr += kRDF_RDFEnd;
 1129|  3.89k|	headStr += newline;
 1130|       |
 1131|       |	// Write the xmpmeta end tag.
 1132|  3.89k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1132:7): [True: 3.89k, False: 0]
  ------------------
 1133|  3.89k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1133:29): [True: 0, False: 3.89k]
  ------------------
 1134|  3.89k|		headStr += kRDF_XMPMetaEnd;
 1135|  3.89k|		headStr += newline;
 1136|  3.89k|	}
 1137|       |	
 1138|       |	// Write the packet trailer PI into the tail string as UTF-8.
 1139|  3.89k|	tailStr.erase();
 1140|  3.89k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1140:7): [True: 2.39k, False: 1.49k]
  ------------------
 1141|  2.39k|		tailStr.reserve ( strlen(kPacketTrailer) + (strlen(indentStr) * baseIndent) );
 1142|  2.39k|		for ( level = baseIndent; level > 0; --level ) tailStr += indentStr;
  ------------------
  |  Branch (1142:29): [True: 0, False: 2.39k]
  ------------------
 1143|  2.39k|		tailStr += kPacketTrailer;
 1144|  2.39k|		if ( options & kXMP_ReadOnlyPacket ) tailStr[tailStr.size()-4] = 'r';
  ------------------
  |  Branch (1144:8): [True: 0, False: 2.39k]
  ------------------
 1145|  2.39k|	}
 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.89k|}	// SerializeAsRDF
XMPMeta-Serialize.cpp:_ZL15EstimateRDFSizePK8XMP_Nodeim:
   83|   197k|{
   84|   197k|	size_t outputLen = 2 * (indent*indentLen + currNode->name.size() + 4);	// The property element tags.
   85|       |	
   86|   197k|	if ( ! currNode->qualifiers.empty() ) {
  ------------------
  |  Branch (86:7): [True: 10.1k, False: 187k]
  ------------------
   87|       |		// This node has qualifiers, assume it is written using rdf:value and estimate the qualifiers.
   88|       |
   89|  10.1k|		indent += 2;	// Everything else is indented inside the rdf:Description element.
   90|  10.1k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
   91|  10.1k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_ValueStart) + 2);		// The rdf:value tags.
   92|       |
   93|  63.8k|		for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (93:68): [True: 53.6k, False: 10.1k]
  ------------------
   94|  53.6k|			const XMP_Node * currQual = currNode->qualifiers[qualNum];
   95|  53.6k|			outputLen += EstimateRDFSize ( currQual, indent, indentLen );
   96|  53.6k|		}
   97|       |
   98|  10.1k|	}
   99|       |	
  100|   197k|	if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (100:7): [True: 7.81k, False: 189k]
  ------------------
  101|  7.81k|		indent += 1;
  102|  7.81k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
  103|   189k|	} else if ( currNode->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (103:14): [True: 3.03k, False: 186k]
  ------------------
  104|  3.03k|		indent += 2;
  105|  3.03k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_BagStart) + 2);		// The rdf:Bag/Seq/Alt tags.
  106|  3.03k|		outputLen += 2 * currNode->children.size() * (strlen(kRDF_ItemStart) + 2);	// The rdf:li tags, indent counted in children.
  107|   186k|	} else if ( ! (currNode->options & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (107:14): [True: 175k, False: 11.0k]
  ------------------
  108|   175k|		outputLen += currNode->value.size();	// This is a leaf value node.
  109|   175k|	}
  110|       |
  111|   330k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (111:67): [True: 132k, False: 197k]
  ------------------
  112|   132k|		const XMP_Node * currChild = currNode->children[childNum];
  113|   132k|		outputLen += EstimateRDFSize ( currChild, indent+1, indentLen );
  114|   132k|	}
  115|       |
  116|   197k|	return outputLen;
  117|       |	
  118|   197k|}	// EstimateRDFSize
XMPMeta-Serialize.cpp:_ZL26SerializeCompactRDFSchemasRK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  973|  3.89k|{
  974|  3.89k|	XMP_Index level;
  975|  3.89k|	size_t schema, schemaLim;
  976|       |	
  977|       |	// Begin the rdf:Description start tag.
  978|  11.6k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (978:30): [True: 7.79k, False: 3.89k]
  ------------------
  979|  3.89k|	outputStr += kRDF_SchemaStart;
  980|  3.89k|	outputStr += '"';
  981|  3.89k|	outputStr += xmpTree.name;
  982|  3.89k|	outputStr += '"';
  983|       |	
  984|       |	// Write all necessary xmlns attributes.
  985|       |	
  986|  3.89k|	size_t totalLen = 8;	// Start at 8 for "xml:rdf:".
  987|  3.89k|	XMP_cStringMapPos currPos = sNamespacePrefixToURIMap->begin();
  988|  3.89k|	XMP_cStringMapPos endPos  = sNamespacePrefixToURIMap->end();
  989|  1.14M|	for ( ; currPos != endPos; ++currPos ) totalLen += currPos->first.size();
  ------------------
  |  Branch (989:10): [True: 1.13M, False: 3.89k]
  ------------------
  990|       |
  991|  3.89k|	XMP_VarString usedNS;
  992|  3.89k|	usedNS.reserve ( totalLen );
  993|  3.89k|	usedNS = "xml:rdf:";
  994|       |
  995|  14.9k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (995:57): [True: 11.0k, False: 3.89k]
  ------------------
  996|  11.0k|		const XMP_Node * currSchema = xmpTree.children[schema];
  997|  11.0k|		DeclareUsedNamespaces ( currSchema, usedNS, outputStr, newline, indentStr, baseIndent+4 );
  998|  11.0k|	}
  999|       |	
 1000|       |	// Write the top level "attrProps" and close the rdf:Description start tag.
 1001|  3.89k|	bool allAreAttrs = true;
 1002|  14.9k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1002:57): [True: 11.0k, False: 3.89k]
  ------------------
 1003|  11.0k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1004|  11.0k|		allAreAttrs &= SerializeCompactRDFAttrProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1005|  11.0k|	}
 1006|  3.89k|	if ( ! allAreAttrs ) {
  ------------------
  |  Branch (1006:7): [True: 1.72k, False: 2.16k]
  ------------------
 1007|  1.72k|		outputStr += ">";
 1008|  1.72k|		outputStr += newline;
 1009|  2.16k|	} else {
 1010|  2.16k|		outputStr += "/>";
 1011|  2.16k|		outputStr += newline;
 1012|  2.16k|		return;	// ! Done if all properties in all schema are written as attributes.
 1013|  2.16k|	}
 1014|       |
 1015|       |	// Write the remaining properties for each schema.
 1016|  7.03k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1016:57): [True: 5.30k, False: 1.72k]
  ------------------
 1017|  5.30k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1018|  5.30k|		SerializeCompactRDFElemProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1019|  5.30k|	}
 1020|       |	
 1021|       |	// Write the rdf:Description end tag.
 1022|       |	// *** Elide the end tag if everything (all props in all schema) is an attr.
 1023|  5.18k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (1023:30): [True: 3.45k, False: 1.72k]
  ------------------
 1024|  1.72k|	outputStr += kRDF_SchemaEnd;
 1025|  1.72k|	outputStr += newline;
 1026|       |
 1027|  1.72k|}	// SerializeCompactRDFSchemas
XMPMeta-Serialize.cpp:_ZL21DeclareUsedNamespacesPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_PKcSB_i:
  191|   197k|{
  192|       |
  193|   197k|	if ( currNode->options & kXMP_SchemaNode ) {
  ------------------
  |  Branch (193:7): [True: 11.0k, False: 186k]
  ------------------
  194|       |		// The schema node name is the URI, the value is the prefix.
  195|  11.0k|		DeclareOneNamespace ( currNode->value, currNode->name, usedNS, outputStr, newline, indentStr, indent );
  196|   186k|	} else if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (196:14): [True: 7.81k, False: 178k]
  ------------------
  197|  35.5k|		for ( size_t fieldNum = 0, fieldLim = currNode->children.size(); fieldNum < fieldLim; ++fieldNum ) {
  ------------------
  |  Branch (197:68): [True: 27.6k, False: 7.81k]
  ------------------
  198|  27.6k|			const XMP_Node * currField = currNode->children[fieldNum];
  199|  27.6k|			DeclareElemNamespace ( currField->name, usedNS, outputStr, newline, indentStr, indent );
  200|  27.6k|		}
  201|  7.81k|	}
  202|       |
  203|   330k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (203:67): [True: 132k, False: 197k]
  ------------------
  204|   132k|		const XMP_Node * currChild = currNode->children[childNum];
  205|   132k|		DeclareUsedNamespaces ( currChild, usedNS, outputStr, newline, indentStr, indent );
  206|   132k|	}
  207|       |
  208|   251k|	for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (208:67): [True: 53.6k, False: 197k]
  ------------------
  209|  53.6k|		const XMP_Node * currQual = currNode->qualifiers[qualNum];
  210|  53.6k|		DeclareElemNamespace ( currQual->name, usedNS, outputStr, newline, indentStr, indent );
  211|  53.6k|		DeclareUsedNamespaces ( currQual, usedNS, outputStr, newline, indentStr, indent );
  212|  53.6k|	}
  213|       |	
  214|   197k|}	// DeclareUsedNamespaces
XMPMeta-Serialize.cpp:_ZL19DeclareOneNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_RS5_S8_PKcSA_i:
  133|  92.3k|{
  134|  92.3k|	size_t nsPos = usedNS.find ( nsPrefix );
  135|       |
  136|  92.3k|	if ( nsPos == XMP_VarString::npos ) {
  ------------------
  |  Branch (136:7): [True: 8.49k, False: 83.8k]
  ------------------
  137|       |		
  138|  8.49k|		outputStr += newline;
  139|  42.4k|		for ( ; indent > 0; --indent ) outputStr += indentStr;
  ------------------
  |  Branch (139:11): [True: 33.9k, False: 8.49k]
  ------------------
  140|  8.49k|		outputStr += "xmlns:";
  141|  8.49k|		outputStr += nsPrefix;
  142|  8.49k|		outputStr[outputStr.size()-1] = '=';	// Change the colon to =.
  143|  8.49k|		outputStr += '"';
  144|  8.49k|		outputStr += nsURI;
  145|  8.49k|		outputStr += '"';
  146|       |
  147|  8.49k|		usedNS += nsPrefix;
  148|       |
  149|  8.49k|	}
  150|       |
  151|  92.3k|}	// DeclareOneNamespace
XMPMeta-Serialize.cpp:_ZL20DeclareElemNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_S8_PKcSA_i:
  165|  81.3k|{
  166|  81.3k|	size_t colonPos = elemName.find ( ':' );
  167|       |
  168|  81.3k|	if ( colonPos != XMP_VarString::npos ) {
  ------------------
  |  Branch (168:7): [True: 81.3k, False: 0]
  ------------------
  169|  81.3k|		XMP_VarString nsPrefix ( elemName.substr ( 0, colonPos+1 ) );
  170|  81.3k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( nsPrefix );
  171|  81.3k|		XMP_Enforce ( prefixPos != sNamespacePrefixToURIMap->end() );
  ------------------
  |  |  148|  81.3k|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 81.3k]
  |  |  ------------------
  |  |  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|  81.3k|		DeclareOneNamespace ( nsPrefix, prefixPos->second, usedNS, outputStr, newline, indentStr, indent );
  173|  81.3k|	}
  174|       |
  175|  81.3k|}	// DeclareElemNamespace
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFAttrPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  682|  18.8k|{
  683|  18.8k|	size_t prop, propLim;
  684|  18.8k|	bool allAreAttrs = true;
  685|       |
  686|  66.0k|	for ( prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (686:57): [True: 47.2k, False: 18.8k]
  ------------------
  687|       |
  688|  47.2k|		const XMP_Node * currProp = parentNode->children[prop];
  689|  47.2k|		if ( ! CanBeRDFAttrProp ( currProp ) ) {
  ------------------
  |  Branch (689:8): [True: 4.71k, False: 42.5k]
  ------------------
  690|  4.71k|			allAreAttrs = false;
  691|  4.71k|			continue;
  692|  4.71k|		}
  693|       |		
  694|  42.5k|		outputStr += newline;
  695|   249k|		for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (695:35): [True: 206k, False: 42.5k]
  ------------------
  696|  42.5k|		outputStr += currProp->name;
  697|  42.5k|		outputStr += "=\"";
  698|  42.5k|		AppendNodeValue ( outputStr, currProp->value, kForAttribute );
  699|  42.5k|		outputStr += '"';
  700|       |
  701|  42.5k|	}
  702|       |	
  703|  18.8k|	return allAreAttrs;
  704|       |
  705|  18.8k|}	// SerializeCompactRDFAttrProps
XMPMeta-Serialize.cpp:_ZL16CanBeRDFAttrPropPK8XMP_Node:
  341|   173k|{
  342|       |	
  343|   173k|	if ( propNode->name[0] == '[' ) return false;
  ------------------
  |  Branch (343:7): [True: 85.5k, False: 88.0k]
  ------------------
  344|  88.0k|	if ( ! propNode->qualifiers.empty() ) return false;
  ------------------
  |  Branch (344:7): [True: 274, False: 87.7k]
  ------------------
  345|  87.7k|	if ( propNode->options & kXMP_PropValueIsURI ) return false;
  ------------------
  |  Branch (345:7): [True: 0, False: 87.7k]
  ------------------
  346|  87.7k|	if ( propNode->options & kXMP_PropCompositeMask ) return false;
  ------------------
  |  Branch (346:7): [True: 9.17k, False: 78.5k]
  ------------------
  347|       |	
  348|  78.5k|	return true;
  349|       |	
  350|  87.7k|}	// CanBeRDFAttrProp
XMPMeta-Serialize.cpp:_ZL15AppendNodeValueRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_b:
  281|   175k|{
  282|       |
  283|   175k|	unsigned char * runStart = (unsigned char *) value.c_str();
  284|   175k|	unsigned char * runLimit  = runStart + value.size();
  285|   175k|	unsigned char * runEnd;
  286|   175k|	unsigned char   ch=0;
  287|       |	
  288|  2.75M|	while ( runStart < runLimit ) {
  ------------------
  |  Branch (288:10): [True: 2.57M, False: 175k]
  ------------------
  289|       |	
  290|  15.8M|		for ( runEnd = runStart; runEnd < runLimit; ++runEnd ) {
  ------------------
  |  Branch (290:28): [True: 15.6M, False: 170k]
  ------------------
  291|  15.6M|			ch = *runEnd;
  292|  15.6M|			if ( forAttribute && (ch == '"') ) break;
  ------------------
  |  Branch (292:9): [True: 8.77M, False: 6.86M]
  |  Branch (292:25): [True: 2.04k, False: 8.77M]
  ------------------
  293|  15.6M|			if ( (ch < 0x20) || (ch == '&') || (ch == '<') || (ch == '>') ) break;
  ------------------
  |  Branch (293:9): [True: 3.40k, False: 15.6M]
  |  Branch (293:24): [True: 625, False: 15.6M]
  |  Branch (293:39): [True: 349, False: 15.6M]
  |  Branch (293:54): [True: 2.40M, False: 13.2M]
  ------------------
  294|  15.6M|		}
  295|       |		
  296|  2.57M|		outputStr.append ( (char *) runStart, (runEnd - runStart) );
  297|       |		
  298|  2.57M|		if ( runEnd < runLimit ) {
  ------------------
  |  Branch (298:8): [True: 2.40M, False: 170k]
  ------------------
  299|       |
  300|  2.40M|			if ( ch < 0x20 ) {
  ------------------
  |  Branch (300:9): [True: 3.40k, False: 2.40M]
  ------------------
  301|       |			
  302|  3.40k|				XMP_Assert ( (ch == kTab) || (ch == kLF) || (ch == kCR) );
  ------------------
  |  |  142|  3.40k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  303|       |
  304|  3.40k|				char hexBuf[16];
  305|  3.40k|				memcpy ( hexBuf, "&#xn;", 5 );
  306|  3.40k|				hexBuf[3] = kHexDigits[ch&0xF];
  ------------------
  |  |   94|  3.40k|#define kHexDigits "0123456789ABCDEF"
  ------------------
  307|  3.40k|				outputStr.append ( hexBuf, 5 );
  308|       |
  309|  2.40M|			} else {
  310|       |
  311|  2.40M|				if ( ch == '"' ) {
  ------------------
  |  Branch (311:10): [True: 2.04k, False: 2.40M]
  ------------------
  312|  2.04k|					outputStr += "&quot;";
  313|  2.40M|				} else if ( ch == '<' ) {
  ------------------
  |  Branch (313:17): [True: 349, False: 2.40M]
  ------------------
  314|    349|					outputStr += "&lt;";
  315|  2.40M|				} else if ( ch == '>' ) {
  ------------------
  |  Branch (315:17): [True: 2.40M, False: 625]
  ------------------
  316|  2.40M|					outputStr += "&gt;";
  317|  2.40M|				} else {
  318|    625|					XMP_Assert ( ch == '&' );
  ------------------
  |  |  142|    625|	#define XMP_Assert(c)	((void) 0)
  ------------------
  319|    625|					outputStr += "&amp;";
  320|    625|				}
  321|       |
  322|  2.40M|			}
  323|       |
  324|  2.40M|			++runEnd;
  325|       |
  326|  2.40M|		}
  327|       |		
  328|  2.57M|		runStart = runEnd;
  329|       |	
  330|  2.57M|	}
  331|       |
  332|   175k|}	// AppendNodeValue
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFElemPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  753|  8.35k|{
  754|  8.35k|	XMP_Index level;
  755|       |
  756|   106k|	for ( size_t prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (756:64): [True: 98.6k, False: 8.35k]
  ------------------
  757|       |
  758|  98.6k|		const XMP_Node * propNode = parentNode->children[prop];
  759|  98.6k|		if ( CanBeRDFAttrProp ( propNode ) ) continue;
  ------------------
  |  Branch (759:8): [True: 8.39k, False: 90.2k]
  ------------------
  760|       |
  761|  90.2k|		bool emitEndTag = true;
  762|  90.2k|		bool indentEndTag = true;
  763|       |
  764|  90.2k|		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|  90.2k|		XMP_StringPtr elemName = propNode->name.c_str();
  772|  90.2k|		if ( *elemName == '[' ) elemName = "rdf:li";
  ------------------
  |  Branch (772:8): [True: 85.5k, False: 4.71k]
  ------------------
  773|       |
  774|   532k|		for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (774:25): [True: 441k, False: 90.2k]
  ------------------
  775|  90.2k|		outputStr += '<';
  776|  90.2k|		outputStr += elemName;
  777|       |
  778|  90.2k|		#define isCompact	false
  779|  90.2k|		bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  778|  90.2k|		#define isCompact	false
  ------------------
  780|  90.2k|		bool hasRDFResourceQual   = false;
  781|       |
  782|   143k|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (782:68): [True: 53.6k, False: 90.2k]
  ------------------
  783|  53.6k|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  784|  53.6k|			if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (784:9): [True: 45.2k, False: 8.38k]
  ------------------
  785|  45.2k|				hasGeneralQualifiers = true;
  786|  45.2k|			} else {
  787|  8.38k|				if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (787:10): [True: 0, False: 8.38k]
  ------------------
  788|  8.38k|				outputStr += ' ';
  789|  8.38k|				outputStr += currQual->name;
  790|  8.38k|				outputStr += "=\"";
  791|  8.38k|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  792|  8.38k|				outputStr += '"';
  793|  8.38k|			}
  794|  53.6k|		}
  795|       |		
  796|       |		// --------------------------------------------------------
  797|       |		// Process the property according to the standard patterns.
  798|       |	
  799|  90.2k|		if ( hasGeneralQualifiers ) {
  ------------------
  |  Branch (799:8): [True: 1.81k, False: 88.4k]
  ------------------
  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.81k|			outputStr += " rdf:parseType=\"Resource\">";
  810|  1.81k|			outputStr += newline;
  811|       |
  812|  1.81k|			SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  813|       |		
  814|  1.81k|			size_t qualNum = 0;
  815|  1.81k|			size_t qualLim = propNode->qualifiers.size();
  816|  1.81k|			if ( propNode->options & kXMP_PropHasLang ) ++qualNum;
  ------------------
  |  Branch (816:9): [True: 32, False: 1.78k]
  ------------------
  817|       |			
  818|  47.0k|			for ( ; qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (818:12): [True: 45.2k, False: 1.81k]
  ------------------
  819|  45.2k|				const XMP_Node * currQual = propNode->qualifiers[qualNum];
  820|  45.2k|				SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  821|  45.2k|			}
  822|       |			
  823|  88.4k|		} else {
  824|       |
  825|       |			// --------------------------------------------------------------------
  826|       |			// This node has only attribute qualifiers. Emit as a property element.
  827|       |			
  828|  88.4k|			if ( propForm == 0 ) {
  ------------------
  |  Branch (828:9): [True: 77.5k, False: 10.8k]
  ------------------
  829|       |			
  830|       |				// --------------------------
  831|       |				// This is a simple property.
  832|       |				
  833|  77.5k|				if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (833:10): [True: 0, False: 77.5k]
  ------------------
  834|      0|					outputStr += " rdf:resource=\"";
  835|      0|					AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  836|      0|					outputStr += "\"/>";
  837|      0|					outputStr += newline;
  838|      0|					emitEndTag = false;
  839|  77.5k|				} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (839:17): [True: 51, False: 77.5k]
  ------------------
  840|     51|					outputStr += "/>";
  841|     51|					outputStr += newline;
  842|     51|					emitEndTag = false;
  843|  77.5k|				} else {
  844|  77.5k|					outputStr += '>';
  845|  77.5k|					AppendNodeValue ( outputStr, propNode->value, kForElement );
  846|  77.5k|					indentEndTag = false;
  847|  77.5k|				}
  848|       |				
  849|  77.5k|			} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (849:16): [True: 3.03k, False: 7.81k]
  ------------------
  850|       |
  851|       |				// -----------------
  852|       |				// This is an array.
  853|       |				
  854|  3.03k|				outputStr += '>';
  855|  3.03k|				outputStr += newline;
  856|  3.03k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  857|       |			
  858|  3.03k|				if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (858:10): [True: 0, False: 3.03k]
  ------------------
  859|  3.03k|				SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+2 );
  860|       |
  861|  3.03k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  862|       |
  863|  7.81k|			} else {
  864|       |
  865|       |				// ----------------------
  866|       |				// This must be a struct.
  867|       |				
  868|  7.81k|				XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|  7.81k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|       |
  870|  7.81k|				bool hasAttrFields = false;
  871|  7.81k|				bool hasElemFields = false;
  872|       |			
  873|  7.81k|				size_t field, fieldLim;
  874|  35.4k|				for ( field = 0, fieldLim = propNode->children.size(); field != fieldLim; ++field ) {
  ------------------
  |  Branch (874:60): [True: 27.6k, False: 7.80k]
  ------------------
  875|  27.6k|					XMP_Node * currField = propNode->children[field];
  876|  27.6k|					if ( CanBeRDFAttrProp ( currField ) ) {
  ------------------
  |  Branch (876:11): [True: 27.6k, False: 11]
  ------------------
  877|  27.6k|						hasAttrFields = true;
  878|  27.6k|						if ( hasElemFields ) break;	// No sense looking further.
  ------------------
  |  Branch (878:12): [True: 0, False: 27.6k]
  ------------------
  879|  27.6k|					} else {
  880|     11|						hasElemFields = true;
  881|     11|						if ( hasAttrFields ) break;	// No sense looking further.
  ------------------
  |  Branch (881:12): [True: 11, False: 0]
  ------------------
  882|     11|					}
  883|  27.6k|				}
  884|       |				
  885|  7.81k|				if ( hasRDFResourceQual && hasElemFields ) {
  ------------------
  |  Branch (885:10): [True: 0, False: 7.81k]
  |  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|  7.81k|				if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (889:10): [True: 18, False: 7.79k]
  ------------------
  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|     18|					outputStr += " rdf:parseType=\"Resource\"/>";
  894|     18|					outputStr += newline;
  895|     18|					emitEndTag = false;
  896|       |				
  897|  7.79k|				} else if ( ! hasElemFields ) {
  ------------------
  |  Branch (897:17): [True: 7.78k, False: 11]
  ------------------
  898|       |
  899|       |					// All fields can be attributes, use the emptyPropertyElt form.
  900|  7.78k|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+1 );
  901|  7.78k|					outputStr += "/>";
  902|  7.78k|					outputStr += newline;
  903|  7.78k|					emitEndTag = false;
  904|       |
  905|  7.78k|				} else if ( ! hasAttrFields ) {
  ------------------
  |  Branch (905:17): [True: 0, False: 11]
  ------------------
  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|     11|				} else {
  913|       |				
  914|       |					// Have a mix of attributes and elements, use an inner rdf:Description.
  915|     11|					outputStr += '>';
  916|     11|					outputStr += newline;
  917|     71|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (917:30): [True: 60, False: 11]
  ------------------
  918|     11|					outputStr += "<rdf:Description";
  919|     11|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+2 );
  920|     11|					outputStr += ">";
  921|     11|					outputStr += newline;
  922|     11|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  923|     71|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (923:30): [True: 60, False: 11]
  ------------------
  924|     11|					outputStr += kRDF_StructEnd;
  925|     11|					outputStr += newline;
  926|       |
  927|     11|				}
  928|       |
  929|  7.81k|			}
  930|       |
  931|  88.4k|		}
  932|       |		
  933|       |		// ----------------------------------
  934|       |		// Emit the property element end tag.
  935|       |		
  936|  90.2k|		if ( emitEndTag ) {
  ------------------
  |  Branch (936:8): [True: 82.3k, False: 7.85k]
  ------------------
  937|  82.3k|			if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (937:9): [True: 4.86k, False: 77.5k]
  |  Branch (937:46): [True: 18.0k, False: 4.86k]
  ------------------
  938|  82.3k|			outputStr += "</";
  939|  82.3k|			outputStr += elemName;
  940|  82.3k|			outputStr += '>';
  941|  82.3k|			outputStr += newline;
  942|  82.3k|		}
  943|       |
  944|  90.2k|	}
  945|       |	
  946|  8.35k|}	// SerializeCompactRDFElemProps
XMPMeta-Serialize.cpp:_ZL18IsRDFAttrQualifierNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  361|  98.9k|{
  362|       |
  363|   551k|	for ( size_t i = 0; *sAttrQualifiers[i] != 0; ++i ) {
  ------------------
  |  Branch (363:22): [True: 460k, False: 90.4k]
  ------------------
  364|   460k|		if ( qualName == sAttrQualifiers[i] ) return true;
  ------------------
  |  Branch (364:8): [True: 8.41k, False: 452k]
  ------------------
  365|   460k|	}
  366|       |
  367|  90.4k|	return false;
  368|       |	
  369|  98.9k|}	// IsRDFAttrQualifier
XMPMeta-Serialize.cpp:_ZL26SerializePrettyRDFPropertyPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_ib:
  410|  47.0k|{
  411|  47.0k|	XMP_Index level;
  412|  47.0k|	bool emitEndTag   = true;
  413|  47.0k|	bool indentEndTag = true;
  414|       |
  415|  47.0k|	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|  47.0k|	XMP_StringPtr elemName = propNode->name.c_str();
  421|  47.0k|	if ( emitAsRDFValue ) {
  ------------------
  |  Branch (421:7): [True: 1.81k, False: 45.2k]
  ------------------
  422|  1.81k|		elemName= "rdf:value";
  423|  45.2k|	} else if ( *elemName == '[' ) {
  ------------------
  |  Branch (423:14): [True: 0, False: 45.2k]
  ------------------
  424|      0|		elemName = "rdf:li";
  425|      0|	}
  426|       |
  427|   328k|	for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (427:24): [True: 281k, False: 47.0k]
  ------------------
  428|  47.0k|	outputStr += '<';
  429|  47.0k|	outputStr += elemName;
  430|       |	
  431|  47.0k|	#define isCompact	false
  432|  47.0k|	bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  431|  47.0k|	#define isCompact	false
  ------------------
  433|  47.0k|	bool hasRDFResourceQual   = false;
  434|       |	
  435|  92.3k|	for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (435:67): [True: 45.2k, False: 47.0k]
  ------------------
  436|  45.2k|		const XMP_Node * currQual = propNode->qualifiers[qualNum];
  437|  45.2k|		if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (437:8): [True: 45.2k, False: 32]
  ------------------
  438|  45.2k|			hasGeneralQualifiers = true;
  439|  45.2k|		} else {
  440|     32|			if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (440:9): [True: 0, False: 32]
  ------------------
  441|     32|			if ( ! emitAsRDFValue ) {
  ------------------
  |  Branch (441:9): [True: 0, False: 32]
  ------------------
  442|      0|				outputStr += ' ';
  443|      0|				outputStr += currQual->name;
  444|      0|				outputStr += "=\"";
  445|      0|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  446|      0|				outputStr += '"';
  447|      0|			}
  448|     32|		}
  449|  45.2k|	}
  450|       |	
  451|       |	// --------------------------------------------------------
  452|       |	// Process the property according to the standard patterns.
  453|       |	
  454|  47.0k|	if ( hasGeneralQualifiers && (! emitAsRDFValue) ) {
  ------------------
  |  Branch (454:7): [True: 1.81k, False: 45.2k]
  |  Branch (454:31): [True: 0, False: 1.81k]
  ------------------
  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|  47.0k|	} else {
  476|       |
  477|       |		// --------------------------------------------------------------------
  478|       |		// This node has no general qualifiers. Emit using an unqualified form.
  479|       |		
  480|  47.0k|		if ( propForm == 0 ) {
  ------------------
  |  Branch (480:8): [True: 47.0k, False: 2]
  ------------------
  481|       |		
  482|       |			// --------------------------
  483|       |			// This is a simple property.
  484|       |			
  485|  47.0k|			if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (485:9): [True: 0, False: 47.0k]
  ------------------
  486|      0|				outputStr += " rdf:resource=\"";
  487|      0|				AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  488|      0|				outputStr += "\"/>";
  489|      0|				outputStr += newline;
  490|      0|				emitEndTag = false;
  491|  47.0k|			} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (491:16): [True: 104, False: 46.9k]
  ------------------
  492|    104|				outputStr += "/>";
  493|    104|				outputStr += newline;
  494|    104|				emitEndTag = false;
  495|  46.9k|			} else {
  496|  46.9k|				outputStr += '>';
  497|  46.9k|				AppendNodeValue ( outputStr, propNode->value, kForElement );
  498|  46.9k|				indentEndTag = false;
  499|  46.9k|			}
  500|       |			
  501|  47.0k|		} 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|  47.0k|	}
  556|       |	
  557|       |	// ----------------------------------
  558|       |	// Emit the property element end tag.
  559|       |	
  560|  47.0k|	if ( emitEndTag ) {
  ------------------
  |  Branch (560:7): [True: 46.9k, False: 106]
  ------------------
  561|  46.9k|		if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (561:8): [True: 0, False: 46.9k]
  |  Branch (561:45): [True: 0, False: 0]
  ------------------
  562|  46.9k|		outputStr += "</";
  563|  46.9k|		outputStr += elemName;
  564|  46.9k|		outputStr += '>';
  565|  46.9k|		outputStr += newline;
  566|  46.9k|	}
  567|       |	
  568|  47.0k|}	// SerializePrettyRDFProperty
XMPMeta-Serialize.cpp:_ZL15EmitRDFArrayTagjRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKcS8_iib:
  235|  6.07k|{
  236|  6.07k|	if ( (! isStartTag) && (arraySize == 0) ) return;
  ------------------
  |  Branch (236:7): [True: 3.03k, False: 3.03k]
  |  Branch (236:25): [True: 38, False: 2.99k]
  ------------------
  237|       |	
  238|  30.2k|	for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (238:34): [True: 24.2k, False: 6.03k]
  ------------------
  239|  6.03k|	if ( isStartTag ) {
  ------------------
  |  Branch (239:7): [True: 3.03k, False: 2.99k]
  ------------------
  240|  3.03k|		outputStr += "<rdf:";
  241|  3.03k|	} else {
  242|  2.99k|		outputStr += "</rdf:";
  243|  2.99k|	}
  244|       |
  245|  6.03k|	if ( arrayForm & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (245:7): [True: 2.54k, False: 3.48k]
  ------------------
  246|  2.54k|		outputStr += "Alt";
  247|  3.48k|	} else if ( arrayForm & kXMP_PropArrayIsOrdered ) {
  ------------------
  |  Branch (247:14): [True: 3.02k, False: 457]
  ------------------
  248|  3.02k|		outputStr += "Seq";
  249|  3.02k|	} else {
  250|    457|		outputStr += "Bag";
  251|    457|	}
  252|       |	
  253|  6.03k|	if ( isStartTag && (arraySize == 0) ) outputStr += '/';
  ------------------
  |  Branch (253:7): [True: 3.03k, False: 2.99k]
  |  Branch (253:21): [True: 38, False: 2.99k]
  ------------------
  254|  6.03k|	outputStr += '>';
  255|  6.03k|	outputStr += newline;
  256|       |
  257|  6.03k|}	// EmitRDFArrayTag

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

