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

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

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

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

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|    747|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    747|    setMsg(1);
  245|    747|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|    747|std::basic_string<charT> toBasicString(const T& arg) {
  154|    747|  std::basic_ostringstream<charT> os;
  155|    747|  os << arg;
  156|    747|  return os.str();
  157|    747|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  3.41k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  3.41k|  std::basic_ostringstream<charT> os;
  155|  3.41k|  os << arg;
  156|  3.41k|  return os.str();
  157|  3.41k|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|    260|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    260|    setMsg(1);
  245|    260|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    260|std::basic_string<charT> toBasicString(const T& arg) {
  154|    260|  std::basic_ostringstream<charT> os;
  155|    260|  os << arg;
  156|    260|  return os.str();
  157|    260|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|  1.64k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.64k|    setMsg(1);
  245|  1.64k|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  1.64k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.64k|  std::basic_ostringstream<charT> os;
  155|  1.64k|  os << arg;
  156|  1.64k|  return os.str();
  157|  1.64k|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|  3.41k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  3.41k|    setMsg(1);
  245|  3.41k|  }
_ZN5Exiv25ErrorC2IA13_cEENS_9ErrorCodeERKT_:
  243|      1|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|      1|    setMsg(1);
  245|      1|  }
_ZN5Exiv213toBasicStringIcA13_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|      1|std::basic_string<charT> toBasicString(const T& arg) {
  154|      1|  std::basic_ostringstream<charT> os;
  155|      1|  os << arg;
  156|      1|  return os.str();
  157|      1|}
_ZN5Exiv213toBasicStringIcPKcEENSt3__112basic_stringIT_NS3_11char_traitsIS5_EENS3_9allocatorIS5_EEEERKT0_:
  153|     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|   106k|  iterator begin() {
  438|   106k|    return exifMetadata_.begin();
  439|   106k|  }
_ZN5Exiv28ExifData3endEv:
  441|  7.48M|  iterator end() {
  442|  7.48M|    return exifMetadata_.end();
  443|  7.48M|  }
_ZNK5Exiv28ExifData5beginEv:
  454|  3.23k|  [[nodiscard]] const_iterator begin() const {
  455|  3.23k|    return exifMetadata_.begin();
  456|  3.23k|  }
_ZNK5Exiv28ExifData3endEv:
  458|   339k|  [[nodiscard]] const_iterator end() const {
  459|   339k|    return exifMetadata_.end();
  460|   339k|  }
_ZNK5Exiv28ExifData5emptyEv:
  467|  11.3k|  [[nodiscard]] bool empty() const {
  468|  11.3k|    return exifMetadata_.empty();
  469|  11.3k|  }
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ByteOrderERNS_8ExifDataE:
  562|  5.44k|  static void encode(Blob& blob, ByteOrder byteOrder, ExifData& exifData) {
  563|  5.44k|    encode(blob, nullptr, 0, byteOrder, exifData);
  564|  5.44k|  }

_ZNK5Exiv215ImageCtorParams6createEv:
   53|  13.2k|  bool create() const {
   54|  13.2k|    return create_;
   55|  13.2k|  }
_ZNK5Exiv215ImageCtorParams19max_recursion_depthEv:
   57|  8.29k|  size_t max_recursion_depth() const {
   58|  8.29k|    return max_recursion_depth_;
   59|  8.29k|  }
_ZNK5Exiv25Image17iccProfileDefinedEv:
  240|  7.76k|  [[nodiscard]] virtual bool iccProfileDefined() const {
  241|  7.76k|    return !iccProfile_.empty();
  242|  7.76k|  }
_ZN5Exiv25Image16setTypeSupportedENS_9ImageTypeEt:
  481|    108|  void setTypeSupported(ImageType imageType, uint16_t supportedMetadata) {
  482|    108|    imageType_ = imageType;
  483|    108|    supportedMetadata_ = supportedMetadata;
  484|    108|  }

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

_ZN5Exiv28Internal11MatroskaTagC2EmNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS0_16matroskaTypeEnumENS0_19matroskaProcessEnumE:
   69|    396|      _id(id), _label(std::move(label)), _type(type), _process(process) {
   70|    396|  }
_ZN5Exiv28Internal11MatroskaTagC2EmNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   73|    152|      _id(id),
   74|    152|      _label(std::move(label)),
   75|    152|      _type(matroskaTypeEnum::UndefinedType),
   76|    152|      _process(matroskaProcessEnum::Undefined) {
   77|    152|  }
_ZNK5Exiv28Internal11MatroskaTageqEm:
   79|  4.20M|  bool operator==(uint64_t id) const {
   80|  4.20M|    return id == _id;
   81|  4.20M|  }
_ZNK5Exiv28Internal11MatroskaTag9isSkippedEv:
   83|   107k|  [[nodiscard]] bool isSkipped() const {
   84|   107k|    return _process == Skip;
   85|   107k|  }
_ZNK5Exiv28Internal11MatroskaTag11isCompositeEv:
   86|  73.8k|  [[nodiscard]] bool isComposite() const {
   87|  73.8k|    return _process == Composite;
   88|  73.8k|  }

_ZN5Exiv29MetadatumC2Ev:
  261|  10.8M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  15.6M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   485k|  Key(const Key&) = default;

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  4.97M|  [[nodiscard]] auto begin() noexcept {
  151|  4.97M|    return pData_.begin();
  152|  4.97M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  53.0k|  [[nodiscard]] auto end() noexcept {
  155|  53.0k|    return pData_.end();
  156|  53.0k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  21.9k|  [[nodiscard]] auto begin() const noexcept {
  159|  21.9k|    return pData_.begin();
  160|  21.9k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  21.7k|  [[nodiscard]] auto end() const noexcept {
  163|  21.7k|    return pData_.end();
  164|  21.7k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  12.8M|  [[nodiscard]] size_t size() const {
  167|  12.8M|    return pData_.size();
  168|  12.8M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  68.7k|  [[nodiscard]] bool empty() const {
  195|  68.7k|    return pData_.empty();
  196|  68.7k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.64M|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  45.2k|const T* find(T (&src)[N], const K& key) {
  448|  45.2k|  static_assert(N > 0, "Passed zero length find");
  449|  45.2k|  auto rc = std::find(src, src + N, key);
  450|  45.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 45.2k]
  ------------------
  451|  45.2k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  99.4k|std::string toString(const T& arg) {
  467|  99.4k|  return toStringHelper(arg, std::is_integral<T>());
  468|  99.4k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  99.4k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  99.4k|  return std::to_string(arg);
  457|  99.4k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  66.7M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  66.7M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 794k, False: 65.9M]
  ------------------
  229|   794k|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|   794k|  }
  231|  65.9M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  66.7M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|   610k|const T* find(T (&src)[N], const K& key) {
  448|   610k|  static_assert(N > 0, "Passed zero length find");
  449|   610k|  auto rc = std::find(src, src + N, key);
  450|   610k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 605k, False: 4.94k]
  ------------------
  451|   610k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  11.8M|const T* find(T (&src)[N], const K& key) {
  448|  11.8M|  static_assert(N > 0, "Passed zero length find");
  449|  11.8M|  auto rc = std::find(src, src + N, key);
  450|  11.8M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.83M, False: 9.01M]
  ------------------
  451|  11.8M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     16|T stringTo(const std::string& s, bool& ok) {
  483|     16|  std::istringstream is(s);
  484|     16|  T tmp = T();
  485|     16|  ok = static_cast<bool>(is >> tmp);
  486|     16|  std::string rest;
  487|     16|  is >> std::skipws >> rest;
  488|     16|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 0, False: 16]
  ------------------
  489|      0|    ok = false;
  490|     16|  return tmp;
  491|     16|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  21.2k|std::string toString(const T& arg) {
  467|  21.2k|  return toStringHelper(arg, std::is_integral<T>());
  468|  21.2k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  21.2k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  21.2k|  return std::to_string(arg);
  457|  21.2k|}
_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|   177k|std::string toString(const T& arg) {
  467|   177k|  return toStringHelper(arg, std::is_integral<T>());
  468|   177k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   177k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   177k|  return std::to_string(arg);
  457|   177k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  5.38k|std::string toString(const T& arg) {
  467|  5.38k|  return toStringHelper(arg, std::is_integral<T>());
  468|  5.38k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  5.38k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  5.38k|  std::ostringstream os;
  462|  5.38k|  os << arg;
  463|  5.38k|  return os.str();
  464|  5.38k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   163k|std::string toString(const T& arg) {
  467|   163k|  return toStringHelper(arg, std::is_integral<T>());
  468|   163k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|   163k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   163k|  std::ostringstream os;
  462|   163k|  os << arg;
  463|   163k|  return os.str();
  464|   163k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  75.5k|std::string toString(const T& arg) {
  467|  75.5k|  return toStringHelper(arg, std::is_integral<T>());
  468|  75.5k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  75.5k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  75.5k|  return std::to_string(arg);
  457|  75.5k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|  1.27k|const T* find(T (&src)[N], const K& key) {
  448|  1.27k|  static_assert(N > 0, "Passed zero length find");
  449|  1.27k|  auto rc = std::find(src, src + N, key);
  450|  1.27k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 716, False: 554]
  ------------------
  451|  1.27k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|    986|const T* find(T (&src)[N], const K& key) {
  448|    986|  static_assert(N > 0, "Passed zero length find");
  449|    986|  auto rc = std::find(src, src + N, key);
  450|    986|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 358, False: 628]
  ------------------
  451|    986|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    715|const T* find(T (&src)[N], const K& key) {
  448|    715|  static_assert(N > 0, "Passed zero length find");
  449|    715|  auto rc = std::find(src, src + N, key);
  450|    715|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 607, False: 108]
  ------------------
  451|    715|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|  75.8k|const T* find(T (&src)[N], const K& key) {
  448|  75.8k|  static_assert(N > 0, "Passed zero length find");
  449|  75.8k|  auto rc = std::find(src, src + N, key);
  450|  75.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.81k, False: 74.0k]
  ------------------
  451|  75.8k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  4.18k|const T* find(T (&src)[N], const K& key) {
  448|  4.18k|  static_assert(N > 0, "Passed zero length find");
  449|  4.18k|  auto rc = std::find(src, src + N, key);
  450|  4.18k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.38k, False: 1.80k]
  ------------------
  451|  4.18k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  5.81k|const T* find(T (&src)[N], const K& key) {
  448|  5.81k|  static_assert(N > 0, "Passed zero length find");
  449|  5.81k|  auto rc = std::find(src, src + N, key);
  450|  5.81k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.42k, False: 2.39k]
  ------------------
  451|  5.81k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  3.99k|const T* find(T (&src)[N], const K& key) {
  448|  3.99k|  static_assert(N > 0, "Passed zero length find");
  449|  3.99k|  auto rc = std::find(src, src + N, key);
  450|  3.99k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.93k, False: 1.06k]
  ------------------
  451|  3.99k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  2.36k|std::string toString(const T& arg) {
  467|  2.36k|  return toStringHelper(arg, std::is_integral<T>());
  468|  2.36k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  2.36k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  2.36k|  std::ostringstream os;
  462|  2.36k|  os << arg;
  463|  2.36k|  return os.str();
  464|  2.36k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.28k|std::string toString(const T& arg) {
  467|  1.28k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.28k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.28k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.28k|  return std::to_string(arg);
  457|  1.28k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|   486k|std::string toString(const T& arg) {
  467|   486k|  return toStringHelper(arg, std::is_integral<T>());
  468|   486k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|   486k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   486k|  std::ostringstream os;
  462|   486k|  os << arg;
  463|   486k|  return os.str();
  464|   486k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|  1.46k|const T* find(T (&src)[N], const K& key) {
  448|  1.46k|  static_assert(N > 0, "Passed zero length find");
  449|  1.46k|  auto rc = std::find(src, src + N, key);
  450|  1.46k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.15k, False: 309]
  ------------------
  451|  1.46k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|  9.36k|const T* find(T (&src)[N], const K& key) {
  448|  9.36k|  static_assert(N > 0, "Passed zero length find");
  449|  9.36k|  auto rc = std::find(src, src + N, key);
  450|  9.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.20k, False: 5.16k]
  ------------------
  451|  9.36k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|  9.36k|const T* find(T (&src)[N], const K& key) {
  448|  9.36k|  static_assert(N > 0, "Passed zero length find");
  449|  9.36k|  auto rc = std::find(src, src + N, key);
  450|  9.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 8.75k, False: 613]
  ------------------
  451|  9.36k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  4.60k|const T* find(T (&src)[N], const K& key) {
  448|  4.60k|  static_assert(N > 0, "Passed zero length find");
  449|  4.60k|  auto rc = std::find(src, src + N, key);
  450|  4.60k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.38k, False: 1.21k]
  ------------------
  451|  4.60k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|   112k|const T* find(T (&src)[N], const K& key) {
  448|   112k|  static_assert(N > 0, "Passed zero length find");
  449|   112k|  auto rc = std::find(src, src + N, key);
  450|   112k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 98.7k, False: 14.1k]
  ------------------
  451|   112k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  31.4k|const T* find(T (&src)[N], const K& key) {
  448|  31.4k|  static_assert(N > 0, "Passed zero length find");
  449|  31.4k|  auto rc = std::find(src, src + N, key);
  450|  31.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 13.5k, False: 17.9k]
  ------------------
  451|  31.4k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  5.10k|const T* find(T (&src)[N], const K& key) {
  448|  5.10k|  static_assert(N > 0, "Passed zero length find");
  449|  5.10k|  auto rc = std::find(src, src + N, key);
  450|  5.10k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.94k, False: 1.15k]
  ------------------
  451|  5.10k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  5.09k|const T* find(T (&src)[N], const K& key) {
  448|  5.09k|  static_assert(N > 0, "Passed zero length find");
  449|  5.09k|  auto rc = std::find(src, src + N, key);
  450|  5.09k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.27k, False: 1.81k]
  ------------------
  451|  5.09k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|    581|const T* find(T (&src)[N], const K& key) {
  448|    581|  static_assert(N > 0, "Passed zero length find");
  449|    581|  auto rc = std::find(src, src + N, key);
  450|    581|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 196, False: 385]
  ------------------
  451|    581|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   139k|const T* find(T (&src)[N], const K& key) {
  448|   139k|  static_assert(N > 0, "Passed zero length find");
  449|   139k|  auto rc = std::find(src, src + N, key);
  450|   139k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 124k, False: 15.6k]
  ------------------
  451|   139k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|  96.9k|const T* find(T (&src)[N], const K& key) {
  448|  96.9k|  static_assert(N > 0, "Passed zero length find");
  449|  96.9k|  auto rc = std::find(src, src + N, key);
  450|  96.9k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 93.3k, False: 3.60k]
  ------------------
  451|  96.9k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  3.32k|const T* find(T (&src)[N], const K& key) {
  448|  3.32k|  static_assert(N > 0, "Passed zero length find");
  449|  3.32k|  auto rc = std::find(src, src + N, key);
  450|  3.32k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 469, False: 2.85k]
  ------------------
  451|  3.32k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  4.52k|const T* find(T (&src)[N], const K& key) {
  448|  4.52k|  static_assert(N > 0, "Passed zero length find");
  449|  4.52k|  auto rc = std::find(src, src + N, key);
  450|  4.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.21k, False: 3.31k]
  ------------------
  451|  4.52k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  9.24M|const T* find(T (&src)[N], const K& key) {
  448|  9.24M|  static_assert(N > 0, "Passed zero length find");
  449|  9.24M|  auto rc = std::find(src, src + N, key);
  450|  9.24M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 9.24M]
  ------------------
  451|  9.24M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  6.97M|const T* find(T (&src)[N], const K& key) {
  448|  6.97M|  static_assert(N > 0, "Passed zero length find");
  449|  6.97M|  auto rc = std::find(src, src + N, key);
  450|  6.97M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 6.97M]
  ------------------
  451|  6.97M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  5.78M|const T* find(T (&src)[N], const K& key) {
  448|  5.78M|  static_assert(N > 0, "Passed zero length find");
  449|  5.78M|  auto rc = std::find(src, src + N, key);
  450|  5.78M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 5.77M, False: 13.2k]
  ------------------
  451|  5.78M|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|   119k|const T* find(T (&src)[N], const K& key) {
  448|   119k|  static_assert(N > 0, "Passed zero length find");
  449|   119k|  auto rc = std::find(src, src + N, key);
  450|   119k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 44.3k, False: 74.9k]
  ------------------
  451|   119k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|  1.29M|const T* find(T (&src)[N], const K& key) {
  448|  1.29M|  static_assert(N > 0, "Passed zero length find");
  449|  1.29M|  auto rc = std::find(src, src + N, key);
  450|  1.29M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 82, False: 1.29M]
  ------------------
  451|  1.29M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  18.8k|const T* find(T (&src)[N], const K& key) {
  448|  18.8k|  static_assert(N > 0, "Passed zero length find");
  449|  18.8k|  auto rc = std::find(src, src + N, key);
  450|  18.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 6.15k, False: 12.7k]
  ------------------
  451|  18.8k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  447|  9.45k|const T* find(T (&src)[N], const K& key) {
  448|  9.45k|  static_assert(N > 0, "Passed zero length find");
  449|  9.45k|  auto rc = std::find(src, src + N, key);
  450|  9.45k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 9.45k]
  ------------------
  451|  9.45k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|  1.70k|const T* find(T (&src)[N], const K& key) {
  448|  1.70k|  static_assert(N > 0, "Passed zero length find");
  449|  1.70k|  auto rc = std::find(src, src + N, key);
  450|  1.70k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 328, False: 1.37k]
  ------------------
  451|  1.70k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|    259|T stringTo(const std::string& s, bool& ok) {
  483|    259|  std::istringstream is(s);
  484|    259|  T tmp = T();
  485|    259|  ok = static_cast<bool>(is >> tmp);
  486|    259|  std::string rest;
  487|    259|  is >> std::skipws >> rest;
  488|    259|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 84, False: 175]
  ------------------
  489|     84|    ok = false;
  490|    259|  return tmp;
  491|    259|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|    114|const T* find(T (&src)[N], const K& key) {
  448|    114|  static_assert(N > 0, "Passed zero length find");
  449|    114|  auto rc = std::find(src, src + N, key);
  450|    114|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 114, False: 0]
  ------------------
  451|    114|}

_ZNK5Exiv25Value6typeIdEv:
   85|  10.9M|  TypeId typeId() const {
   86|  10.9M|    return type_;
   87|  10.9M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  14.0M|  UniquePtr clone() const {
   94|  14.0M|    return UniquePtr(clone_());
   95|  14.0M|  }
_ZNK5Exiv25Value2okEv:
  181|   115k|  bool ok() const {
  182|   115k|    return ok_;
  183|   115k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  28.1k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  28.1k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 15.7k, False: 12.4k]
  ------------------
  797|  15.7k|      return str1.size() > str2.size();
  798|       |
  799|  12.4k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  12.4k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  28.1k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   417k|inline TypeId getType<uint16_t>() {
 1084|   417k|  return unsignedShort;
 1085|   417k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  4.56k|inline TypeId getType<uint32_t>() {
 1089|  4.56k|  return unsignedLong;
 1090|  4.56k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  13.8k|inline TypeId getType<URational>() {
 1094|  13.8k|  return unsignedRational;
 1095|  13.8k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  28.3k|inline TypeId getType<int16_t>() {
 1099|  28.3k|  return signedShort;
 1100|  28.3k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  34.6k|inline TypeId getType<int32_t>() {
 1104|  34.6k|  return signedLong;
 1105|  34.6k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  11.5k|inline TypeId getType<Rational>() {
 1109|  11.5k|  return signedRational;
 1110|  11.5k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  7.14k|inline TypeId getType<float>() {
 1114|  7.14k|  return tiffFloat;
 1115|  7.14k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  12.9k|inline TypeId getType<double>() {
 1119|  12.9k|  return tiffDouble;
 1120|  12.9k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.01M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.01M|  return getUShort(buf, byteOrder);
 1316|  1.01M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  3.00M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  3.00M|  return getULong(buf, byteOrder);
 1321|  3.00M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   555k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   555k|  return getURational(buf, byteOrder);
 1326|   555k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|  1.32M|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|  1.32M|  return getShort(buf, byteOrder);
 1331|  1.32M|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|  1.21M|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|  1.21M|  return getLong(buf, byteOrder);
 1336|  1.21M|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   218k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   218k|  return getRational(buf, byteOrder);
 1341|   218k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  34.9k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  34.9k|  return getFloat(buf, byteOrder);
 1346|  34.9k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   595k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   595k|  return getDouble(buf, byteOrder);
 1351|   595k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   564k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   564k|  return us2Data(buf, t, byteOrder);
 1374|   564k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  1.49M|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  1.49M|  return ul2Data(buf, t, byteOrder);
 1382|  1.49M|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   362k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   362k|  return ur2Data(buf, t, byteOrder);
 1390|   362k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  1.00M|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  1.00M|  return s2Data(buf, t, byteOrder);
 1398|  1.00M|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   988k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   988k|  return l2Data(buf, t, byteOrder);
 1406|   988k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   207k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   207k|  return r2Data(buf, t, byteOrder);
 1414|   207k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|   103k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|   103k|  return f2Data(buf, t, byteOrder);
 1422|   103k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   356k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   356k|  return d2Data(buf, t, byteOrder);
 1430|   356k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  2.75k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  2.75k|  return float_to_integer_helper<int64_t>(n);
 1550|  2.75k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  7.09k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  7.09k|  return float_to_integer_helper<uint32_t>(n);
 1555|  7.09k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  7.23k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  7.23k|  return float_to_integer_helper<int64_t>(n);
 1560|  7.23k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  8.14k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  8.14k|  return float_to_integer_helper<uint32_t>(n);
 1564|  8.14k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  4.56k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  4.56k|  return rational_to_integer_helper<int64_t>(n);
 1569|  4.56k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  7.04k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  7.04k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  7.04k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  7.48k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  7.48k|  return rational_to_integer_helper<int64_t>(n);
 1578|  7.48k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  11.6k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  11.6k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  11.6k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  2.75k|  I float_to_integer_helper(size_t n) const {
 1213|  2.75k|    const auto v = value_.at(n);
 1214|  2.75k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 2.42k, False: 328]
  ------------------
 1215|  2.42k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 1.95k, False: 468]
  ------------------
 1216|  1.95k|      return static_cast<I>(std::lround(v));
 1217|  1.95k|    }
 1218|    796|    return 0;
 1219|  2.75k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  7.09k|  I float_to_integer_helper(size_t n) const {
 1213|  7.09k|    const auto v = value_.at(n);
 1214|  7.09k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.04k, False: 1.05k]
  ------------------
 1215|  6.04k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 5.27k, False: 764]
  ------------------
 1216|  5.27k|      return static_cast<I>(std::lround(v));
 1217|  5.27k|    }
 1218|  1.81k|    return 0;
 1219|  7.09k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  7.23k|  I float_to_integer_helper(size_t n) const {
 1213|  7.23k|    const auto v = value_.at(n);
 1214|  7.23k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 6.04k, False: 1.19k]
  ------------------
 1215|  6.04k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 4.68k, False: 1.36k]
  ------------------
 1216|  4.68k|      return static_cast<I>(std::lround(v));
 1217|  4.68k|    }
 1218|  2.55k|    return 0;
 1219|  7.23k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  8.14k|  I float_to_integer_helper(size_t n) const {
 1213|  8.14k|    const auto v = value_.at(n);
 1214|  8.14k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.99k, False: 2.15k]
  ------------------
 1215|  5.99k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 5.16k, False: 825]
  ------------------
 1216|  5.16k|      return static_cast<I>(std::lround(v));
 1217|  5.16k|    }
 1218|  2.97k|    return 0;
 1219|  8.14k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  4.56k|  I rational_to_integer_helper(size_t n) const {
 1224|  4.56k|    auto a = value_.at(n).first;
 1225|  4.56k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  4.56k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.60k, False: 2.95k]
  ------------------
 1229|  1.60k|      return 0;
 1230|  1.60k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  2.95k|#ifdef __cpp_if_constexpr
 1234|  2.95k|    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|  2.95k|      const auto imin = std::numeric_limits<I>::min();
 1240|  2.95k|      const auto imax = std::numeric_limits<I>::max();
 1241|  2.95k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 2.95k]
  |  Branch (1241:23): [True: 0, False: 2.95k]
  |  Branch (1241:35): [True: 0, False: 2.95k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  2.95k|#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|  2.95k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  4.56k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  7.04k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.04k|    auto a = value_.at(n).first;
 1225|  7.04k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.04k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.99k, False: 5.04k]
  ------------------
 1229|  1.99k|      return 0;
 1230|  1.99k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  5.04k|#ifdef __cpp_if_constexpr
 1234|       |    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|       |      const auto imin = std::numeric_limits<I>::min();
 1240|       |      const auto imax = std::numeric_limits<I>::max();
 1241|       |      if (imax < b || a < imin || imax < a) {
 1242|       |        return 0;
 1243|       |      }
 1244|       |#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|  5.04k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  5.04k|      const auto imax = std::numeric_limits<I>::max();
 1257|  5.04k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 677, False: 4.37k]
  ------------------
 1258|    677|        return 0;
 1259|    677|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  4.37k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  4.37k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  4.37k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 4.37k]
  |  Branch (1263:25): [True: 0, False: 4.37k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  4.37k|    }
 1267|       |
 1268|  4.37k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.04k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  7.48k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.48k|    auto a = value_.at(n).first;
 1225|  7.48k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.48k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 882, False: 6.60k]
  ------------------
 1229|    882|      return 0;
 1230|    882|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.60k|#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.60k|    } 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.60k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  6.60k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 6.60k]
  |  Branch (1251:23): [True: 0, False: 6.60k]
  ------------------
 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.60k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.48k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  11.6k|  I rational_to_integer_helper(size_t n) const {
 1224|  11.6k|    auto a = value_.at(n).first;
 1225|  11.6k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  11.6k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.21k, False: 10.4k]
  ------------------
 1229|  1.21k|      return 0;
 1230|  1.21k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  10.4k|#ifdef __cpp_if_constexpr
 1234|  10.4k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  10.4k|      const auto imin = std::numeric_limits<I>::min();
 1240|  10.4k|      const auto imax = std::numeric_limits<I>::max();
 1241|  10.4k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 10.4k]
  |  Branch (1241:23): [True: 0, False: 10.4k]
  |  Branch (1241:35): [True: 0, False: 10.4k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  10.4k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  10.4k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  11.6k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   417k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   417k|}
_ZN5Exiv25ValueD2Ev:
   43|  18.2M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   415k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   415k|  value_.clear();
 1469|   415k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   415k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 415k, False: 0]
  |  Branch (1470:17): [True: 502, False: 415k]
  ------------------
 1471|    502|    len = (len / ts) * ts;
 1472|  1.42M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.01M, False: 415k]
  ------------------
 1473|  1.01M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.01M|  }
 1475|   415k|  return 0;
 1476|   415k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.50k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.50k|  std::istringstream is(buf);
 1481|  1.50k|  T tmp;
 1482|  1.50k|  ValueList val;
 1483|  3.05k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 1.55k, False: 1.50k]
  ------------------
 1484|  1.55k|    val.push_back(tmp);
 1485|  1.50k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 6, False: 1.49k]
  ------------------
 1486|      6|    return 1;
 1487|  1.49k|  value_ = std::move(val);
 1488|  1.49k|  return 0;
 1489|  1.50k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.69k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.69k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.31k, False: 383]
  ------------------
 1651|  1.31k|    pDataArea_ = Blob(buf, buf + len);
 1652|    383|  else
 1653|    383|    pDataArea_.clear();
 1654|  1.69k|  return 0;
 1655|  1.69k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  68.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  68.3k|  size_t offset = 0;
 1494|   564k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 564k, False: 68.3k]
  ------------------
 1495|   564k|    offset += toData(buf + offset, val, byteOrder);
 1496|   564k|  }
 1497|  68.3k|  return offset;
 1498|  68.3k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   589k|size_t ValueType<T>::count() const {
 1502|   589k|  return value_.size();
 1503|   589k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   411k|size_t ValueType<T>::size() const {
 1507|   411k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   411k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  1.00k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  1.00k|  auto end = value_.end();
 1518|  1.00k|  auto i = value_.begin();
 1519|  1.89k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 890, False: 1.00k]
  ------------------
 1520|    890|    os << std::setprecision(15) << *i;
 1521|    890|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 559, False: 331]
  ------------------
 1522|    559|      os << " ";
 1523|    890|  }
 1524|  1.00k|  return os;
 1525|  1.00k|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  68.9k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  68.9k|  ok_ = true;
 1537|  68.9k|  return static_cast<int64_t>(value_.at(n));
 1538|  68.9k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|  88.8k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  88.8k|  ok_ = true;
 1542|  88.8k|  return static_cast<uint32_t>(value_.at(n));
 1543|  88.8k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  3.96k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.96k|  return pDataArea_.size();
 1641|  3.96k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|  1.08k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.08k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.08k|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   880k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   880k|  return new ValueType<T>(*this);
 1513|   880k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   880k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   880k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.25k, False: 876k]
  ------------------
 1449|  3.25k|    pDataArea_ = rhs.pDataArea_;
 1450|   880k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  12.6M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  65.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  65.9k|  value_.clear();
 1469|  65.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  65.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 65.9k, False: 0]
  |  Branch (1470:17): [True: 66, False: 65.9k]
  ------------------
 1471|     66|    len = (len / ts) * ts;
 1472|  3.06M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 3.00M, False: 65.9k]
  ------------------
 1473|  3.00M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  3.00M|  }
 1475|  65.9k|  return 0;
 1476|  65.9k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    407|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    407|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 279, False: 128]
  ------------------
 1651|    279|    pDataArea_ = Blob(buf, buf + len);
 1652|    128|  else
 1653|    128|    pDataArea_.clear();
 1654|    407|  return 0;
 1655|    407|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  41.9k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  41.9k|  size_t offset = 0;
 1494|  1.49M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.49M, False: 41.9k]
  ------------------
 1495|  1.49M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.49M|  }
 1497|  41.9k|  return offset;
 1498|  41.9k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   193k|size_t ValueType<T>::count() const {
 1502|   193k|  return value_.size();
 1503|   193k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   183k|size_t ValueType<T>::size() const {
 1507|   183k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   183k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  3.95k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  3.95k|  auto end = value_.end();
 1518|  3.95k|  auto i = value_.begin();
 1519|   898k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 894k, False: 3.95k]
  ------------------
 1520|   894k|    os << std::setprecision(15) << *i;
 1521|   894k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 891k, False: 3.56k]
  ------------------
 1522|   891k|      os << " ";
 1523|   894k|  }
 1524|  3.95k|  return os;
 1525|  3.95k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  7.49k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  7.49k|  ok_ = true;
 1537|  7.49k|  return static_cast<int64_t>(value_.at(n));
 1538|  7.49k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  81.2k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  81.2k|  ok_ = true;
 1542|  81.2k|  return static_cast<uint32_t>(value_.at(n));
 1543|  81.2k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  14.8k|size_t ValueType<T>::sizeDataArea() const {
 1640|  14.8k|  return pDataArea_.size();
 1641|  14.8k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|  1.73k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.73k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.73k|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   217k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   217k|  return new ValueType<T>(*this);
 1513|   217k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   217k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   217k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 390, False: 217k]
  ------------------
 1449|    390|    pDataArea_ = rhs.pDataArea_;
 1450|   217k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  13.8k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  13.8k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  13.2k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  13.2k|  value_.clear();
 1469|  13.2k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  13.2k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 13.2k, False: 0]
  |  Branch (1470:17): [True: 0, False: 13.2k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   568k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 555k, False: 13.2k]
  ------------------
 1473|   555k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   555k|  }
 1475|  13.2k|  return 0;
 1476|  13.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    754|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    754|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 399, False: 355]
  ------------------
 1651|    399|    pDataArea_ = Blob(buf, buf + len);
 1652|    355|  else
 1653|    355|    pDataArea_.clear();
 1654|    754|  return 0;
 1655|    754|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  10.6k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  10.6k|  size_t offset = 0;
 1494|   362k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 362k, False: 10.6k]
  ------------------
 1495|   362k|    offset += toData(buf + offset, val, byteOrder);
 1496|   362k|  }
 1497|  10.6k|  return offset;
 1498|  10.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  33.1k|size_t ValueType<T>::count() const {
 1502|  33.1k|  return value_.size();
 1503|  33.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  27.9k|size_t ValueType<T>::size() const {
 1507|  27.9k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  27.9k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    653|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    653|  auto end = value_.end();
 1518|    653|  auto i = value_.begin();
 1519|  16.1k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 15.5k, False: 653]
  ------------------
 1520|  15.5k|    os << std::setprecision(15) << *i;
 1521|  15.5k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 15.1k, False: 378]
  ------------------
 1522|  15.1k|      os << " ";
 1523|  15.5k|  }
 1524|    653|  return os;
 1525|    653|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  3.42k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.42k|  return pDataArea_.size();
 1641|  3.42k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    426|DataBuf ValueType<T>::dataArea() const {
 1645|    426|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    426|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  41.0k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  41.0k|  return new ValueType<T>(*this);
 1513|  41.0k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  41.0k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  41.0k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 806, False: 40.2k]
  ------------------
 1449|    806|    pDataArea_ = rhs.pDataArea_;
 1450|  41.0k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  28.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  28.3k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  22.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  22.3k|  value_.clear();
 1469|  22.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  22.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 22.3k, False: 0]
  |  Branch (1470:17): [True: 33, False: 22.3k]
  ------------------
 1471|     33|    len = (len / ts) * ts;
 1472|  1.34M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.32M, False: 22.3k]
  ------------------
 1473|  1.32M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.32M|  }
 1475|  22.3k|  return 0;
 1476|  22.3k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  5.97k|int ValueType<T>::read(const std::string& buf) {
 1480|  5.97k|  std::istringstream is(buf);
 1481|  5.97k|  T tmp;
 1482|  5.97k|  ValueList val;
 1483|  24.8k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 18.8k, False: 5.97k]
  ------------------
 1484|  18.8k|    val.push_back(tmp);
 1485|  5.97k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 5.97k]
  ------------------
 1486|      0|    return 1;
 1487|  5.97k|  value_ = std::move(val);
 1488|  5.97k|  return 0;
 1489|  5.97k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    632|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    632|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 409, False: 223]
  ------------------
 1651|    409|    pDataArea_ = Blob(buf, buf + len);
 1652|    223|  else
 1653|    223|    pDataArea_.clear();
 1654|    632|  return 0;
 1655|    632|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  6.88k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.88k|  size_t offset = 0;
 1494|  1.00M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.00M, False: 6.88k]
  ------------------
 1495|  1.00M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.00M|  }
 1497|  6.88k|  return offset;
 1498|  6.88k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  82.4k|size_t ValueType<T>::count() const {
 1502|  82.4k|  return value_.size();
 1503|  82.4k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  25.2k|size_t ValueType<T>::size() const {
 1507|  25.2k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  25.2k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    693|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    693|  auto end = value_.end();
 1518|    693|  auto i = value_.begin();
 1519|  51.0k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 50.3k, False: 693]
  ------------------
 1520|  50.3k|    os << std::setprecision(15) << *i;
 1521|  50.3k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 49.8k, False: 483]
  ------------------
 1522|  49.8k|      os << " ";
 1523|  50.3k|  }
 1524|    693|  return os;
 1525|    693|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  30.1k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  30.1k|  ok_ = true;
 1537|  30.1k|  return static_cast<int64_t>(value_.at(n));
 1538|  30.1k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   103k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   103k|  ok_ = true;
 1542|   103k|  return static_cast<uint32_t>(value_.at(n));
 1543|   103k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.63k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.63k|  return pDataArea_.size();
 1641|  1.63k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    370|DataBuf ValueType<T>::dataArea() const {
 1645|    370|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    370|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  63.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  63.3k|  return new ValueType<T>(*this);
 1513|  63.3k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  63.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  63.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 805, False: 62.5k]
  ------------------
 1449|    805|    pDataArea_ = rhs.pDataArea_;
 1450|  63.3k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  34.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  34.6k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  34.6k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  34.6k|  value_.clear();
 1469|  34.6k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  34.6k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 34.6k, False: 0]
  |  Branch (1470:17): [True: 117, False: 34.5k]
  ------------------
 1471|    117|    len = (len / ts) * ts;
 1472|  1.25M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.21M, False: 34.6k]
  ------------------
 1473|  1.21M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.21M|  }
 1475|  34.6k|  return 0;
 1476|  34.6k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    963|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    963|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 754, False: 209]
  ------------------
 1651|    754|    pDataArea_ = Blob(buf, buf + len);
 1652|    209|  else
 1653|    209|    pDataArea_.clear();
 1654|    963|  return 0;
 1655|    963|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  83.0k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  83.0k|  size_t offset = 0;
 1494|   988k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 988k, False: 83.0k]
  ------------------
 1495|   988k|    offset += toData(buf + offset, val, byteOrder);
 1496|   988k|  }
 1497|  83.0k|  return offset;
 1498|  83.0k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   165k|size_t ValueType<T>::count() const {
 1502|   165k|  return value_.size();
 1503|   165k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   708k|size_t ValueType<T>::size() const {
 1507|   708k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   708k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    610|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    610|  auto end = value_.end();
 1518|    610|  auto i = value_.begin();
 1519|  36.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 36.1k, False: 610]
  ------------------
 1520|  36.1k|    os << std::setprecision(15) << *i;
 1521|  36.1k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 35.7k, False: 398]
  ------------------
 1522|  35.7k|      os << " ";
 1523|  36.1k|  }
 1524|    610|  return os;
 1525|    610|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  9.74k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  9.74k|  ok_ = true;
 1537|  9.74k|  return static_cast<int64_t>(value_.at(n));
 1538|  9.74k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  17.8k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  17.8k|  ok_ = true;
 1542|  17.8k|  return static_cast<uint32_t>(value_.at(n));
 1543|  17.8k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  5.77k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.77k|  return pDataArea_.size();
 1641|  5.77k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    507|DataBuf ValueType<T>::dataArea() const {
 1645|    507|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    507|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   159k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   159k|  return new ValueType<T>(*this);
 1513|   159k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   159k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   159k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.55k, False: 158k]
  ------------------
 1449|  1.55k|    pDataArea_ = rhs.pDataArea_;
 1450|   159k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  11.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_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|   229k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 218k, False: 11.5k]
  ------------------
 1473|   218k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   218k|  }
 1475|  11.5k|  return 0;
 1476|  11.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    966|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    966|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 538, False: 428]
  ------------------
 1651|    538|    pDataArea_ = Blob(buf, buf + len);
 1652|    428|  else
 1653|    428|    pDataArea_.clear();
 1654|    966|  return 0;
 1655|    966|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  6.77k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.77k|  size_t offset = 0;
 1494|   207k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 207k, False: 6.77k]
  ------------------
 1495|   207k|    offset += toData(buf + offset, val, byteOrder);
 1496|   207k|  }
 1497|  6.77k|  return offset;
 1498|  6.77k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  26.9k|size_t ValueType<T>::count() const {
 1502|  26.9k|  return value_.size();
 1503|  26.9k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  18.8k|size_t ValueType<T>::size() const {
 1507|  18.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  18.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    761|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    761|  auto end = value_.end();
 1518|    761|  auto i = value_.begin();
 1519|   743k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 742k, False: 761]
  ------------------
 1520|   742k|    os << std::setprecision(15) << *i;
 1521|   742k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 741k, False: 532]
  ------------------
 1522|   741k|      os << " ";
 1523|   742k|  }
 1524|    761|  return os;
 1525|    761|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  1.46k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.46k|  return pDataArea_.size();
 1641|  1.46k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     99|DataBuf ValueType<T>::dataArea() const {
 1645|     99|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     99|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  31.9k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  31.9k|  return new ValueType<T>(*this);
 1513|  31.9k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  31.9k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  31.9k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 752, False: 31.2k]
  ------------------
 1449|    752|    pDataArea_ = rhs.pDataArea_;
 1450|  31.9k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  7.14k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.14k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  7.14k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  7.14k|  value_.clear();
 1469|  7.14k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  7.14k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 7.14k, False: 0]
  |  Branch (1470:17): [True: 0, False: 7.14k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  42.1k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 34.9k, False: 7.14k]
  ------------------
 1473|  34.9k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  34.9k|  }
 1475|  7.14k|  return 0;
 1476|  7.14k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    972|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    972|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 790, False: 182]
  ------------------
 1651|    790|    pDataArea_ = Blob(buf, buf + len);
 1652|    182|  else
 1653|    182|    pDataArea_.clear();
 1654|    972|  return 0;
 1655|    972|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  6.51k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.51k|  size_t offset = 0;
 1494|   103k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 103k, False: 6.51k]
  ------------------
 1495|   103k|    offset += toData(buf + offset, val, byteOrder);
 1496|   103k|  }
 1497|  6.51k|  return offset;
 1498|  6.51k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  34.2k|size_t ValueType<T>::count() const {
 1502|  34.2k|  return value_.size();
 1503|  34.2k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  18.0k|size_t ValueType<T>::size() const {
 1507|  18.0k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  18.0k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    638|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    638|  auto end = value_.end();
 1518|    638|  auto i = value_.begin();
 1519|   132k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 131k, False: 638]
  ------------------
 1520|   131k|    os << std::setprecision(15) << *i;
 1521|   131k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 131k, False: 426]
  ------------------
 1522|   131k|      os << " ";
 1523|   131k|  }
 1524|    638|  return os;
 1525|    638|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  5.71k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.71k|  return pDataArea_.size();
 1641|  5.71k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    263|DataBuf ValueType<T>::dataArea() const {
 1645|    263|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    263|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  28.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  28.3k|  return new ValueType<T>(*this);
 1513|  28.3k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  28.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  28.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.23k, False: 27.0k]
  ------------------
 1449|  1.23k|    pDataArea_ = rhs.pDataArea_;
 1450|  28.3k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  12.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  12.9k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  12.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.9k|  value_.clear();
 1469|  12.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.9k, False: 0]
  |  Branch (1470:17): [True: 0, False: 12.9k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   608k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 595k, False: 12.9k]
  ------------------
 1473|   595k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   595k|  }
 1475|  12.9k|  return 0;
 1476|  12.9k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    703|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    703|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 387, False: 316]
  ------------------
 1651|    387|    pDataArea_ = Blob(buf, buf + len);
 1652|    316|  else
 1653|    316|    pDataArea_.clear();
 1654|    703|  return 0;
 1655|    703|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  5.13k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.13k|  size_t offset = 0;
 1494|   356k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 356k, False: 5.13k]
  ------------------
 1495|   356k|    offset += toData(buf + offset, val, byteOrder);
 1496|   356k|  }
 1497|  5.13k|  return offset;
 1498|  5.13k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  30.5k|size_t ValueType<T>::count() const {
 1502|  30.5k|  return value_.size();
 1503|  30.5k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  15.8k|size_t ValueType<T>::size() const {
 1507|  15.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  15.8k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    778|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    778|  auto end = value_.end();
 1518|    778|  auto i = value_.begin();
 1519|  56.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 55.9k, False: 778]
  ------------------
 1520|  55.9k|    os << std::setprecision(15) << *i;
 1521|  55.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 55.3k, False: 547]
  ------------------
 1522|  55.3k|      os << " ";
 1523|  55.9k|  }
 1524|    778|  return os;
 1525|    778|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  6.50k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.50k|  return pDataArea_.size();
 1641|  6.50k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    387|DataBuf ValueType<T>::dataArea() const {
 1645|    387|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    387|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  35.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  35.8k|  return new ValueType<T>(*this);
 1513|  35.8k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  35.8k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  35.8k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 799, False: 35.0k]
  ------------------
 1449|    799|    pDataArea_ = rhs.pDataArea_;
 1450|  35.8k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   300k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  4.56k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.56k|}

_ZNK5Exiv27XmpData9usePacketEv:
  216|  21.6k|  [[nodiscard]] bool usePacket() const {
  217|  21.6k|    return usePacket_;
  218|  21.6k|  }
_ZN5Exiv27XmpData9usePacketEb:
  221|  53.3k|  bool usePacket(bool b) {
  222|  53.3k|    bool r = usePacket_;
  223|  53.3k|    usePacket_ = b;
  224|  53.3k|    return r;
  225|  53.3k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  227|  46.7k|  void setPacket(std::string xmpPacket) {
  228|  46.7k|    xmpPacket_ = std::move(xmpPacket);
  229|  46.7k|    usePacket(false);
  230|  46.7k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  260|   102k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  261|   102k|    return nsBindings_;
  262|   102k|  }
_ZN5Exiv27XmpDataC2Ev:
  140|  55.5k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  395|  27.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|  27.6k|    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  27.6k|  return *this;
  405|  27.6k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  395|  89.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  89.6k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  89.6k|  return *this;
  405|  89.6k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  395|   163k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   163k|    setValue(Exiv2::toString(value));
  404|   163k|  return *this;
  405|   163k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  395|  12.7k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  12.7k|    setValue(Exiv2::toString(value));
  404|  12.7k|  return *this;
  405|  12.7k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  395|  21.2k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  21.2k|    setValue(Exiv2::toString(value));
  404|  21.2k|  return *this;
  405|  21.2k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  395|  2.36k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  2.36k|    setValue(Exiv2::toString(value));
  404|  2.36k|  return *this;
  405|  2.36k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  395|  1.91k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  1.91k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  1.91k|  return *this;
  405|  1.91k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  395|  1.28k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  1.28k|    setValue(Exiv2::toString(value));
  404|  1.28k|  return *this;
  405|  1.28k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  395|  5.38k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  5.38k|    setValue(Exiv2::toString(value));
  404|  5.38k|  return *this;
  405|  5.38k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  395|    737|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|    737|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    737|  return *this;
  405|    737|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  395|  99.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  99.4k|    setValue(Exiv2::toString(value));
  404|  99.4k|  return *this;
  405|  99.4k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  395|  2.13k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  2.13k|    setValue(Exiv2::toString(value));
  404|  2.13k|  return *this;
  405|  2.13k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  395|   165k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   165k|    setValue(Exiv2::toString(value));
  404|   165k|  return *this;
  405|   165k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  395|  32.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  32.4k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  32.4k|  return *this;
  405|  32.4k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  395|   174k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|   174k|    setValue(Exiv2::toString(value));
  404|   174k|  return *this;
  405|   174k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  395|     31|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|     31|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|     31|  return *this;
  405|     31|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  12.2k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  12.2k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 4.35k, False: 7.92k]
  |  Branch (43:36): [True: 4.30k, False: 50]
  |  Branch (43:62): [True: 4.26k, False: 45]
  |  Branch (43:88): [True: 4.25k, False: 10]
  ------------------
   44|  12.2k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  19.5k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  19.5k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  19.5k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  19.5k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  19.5k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  19.5k|}
_ZNK5Exiv28AsfVideo7GUIDTag9to_stringEv:
   53|    571|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|    571|  return stringFormat("{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}", data1_, data2_, data3_,
  ------------------
  |  |   18|    571|#define stringFormat std::format
  ------------------
   58|    571|                      data4_[0], data4_[1], data4_[2], data4_[3], data4_[4], data4_[5], data4_[6], data4_[7]);
   59|    571|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  46.5k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  46.5k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 34.2k, False: 12.2k]
  ------------------
   63|  34.2k|    return data1_ < other.data1_;
   64|  12.2k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 295, False: 11.9k]
  ------------------
   65|    295|    return data2_ < other.data2_;
   66|  11.9k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 539, False: 11.4k]
  ------------------
   67|    539|    return data3_ < other.data3_;
   68|  11.4k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  11.9k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  183|  1.41k|    Image(ImageType::asf, mdNone, std::move(io), params), max_recursion_depth_(params.max_recursion_depth()) {
  184|  1.41k|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  186|  1.41k|std::string AsfVideo::mimeType() const {
  187|  1.41k|  return "video/asf";
  188|  1.41k|}
_ZN5Exiv28AsfVideo13writeMetadataEv:
  190|      5|void AsfVideo::writeMetadata() {
  191|      5|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  193|  1.41k|void AsfVideo::readMetadata() {
  194|  1.41k|  if (io_->open() != 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 1.41k]
  ------------------
  195|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  196|       |
  197|       |  // Ensure that this is the correct image type
  198|  1.41k|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1.41k]
  ------------------
  199|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (199:9): [True: 0, False: 0]
  |  Branch (199:25): [True: 0, False: 0]
  ------------------
  200|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  201|      0|    throw Error(ErrorCode::kerNotAnImage, "ASF");
  202|      0|  }
  203|       |
  204|  1.41k|  IoCloser closer(*io_);
  205|  1.41k|  clearMetadata();
  206|  1.41k|  io_->seek(0, BasicIo::beg);
  207|  1.41k|  height_ = width_ = 1;
  208|       |
  209|  1.41k|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  210|  1.41k|  xmpData()["Xmp.video.MimeType"] = mimeType();
  211|       |
  212|  1.41k|  decodeBlock(0);
  213|       |
  214|  1.41k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  215|  1.41k|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  217|  6.28k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  218|  6.28k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (218:7): [True: 6.28k, False: 0]
  ------------------
  219|  6.28k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  220|       |
  221|  6.28k|    size_ = readQWORDTag(io);
  222|  6.28k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (222:9): [True: 3.92k, False: 2.36k]
  ------------------
  223|  3.92k|      remaining_size_ = size_ - GUID - QWORD;
  224|  6.28k|  }
  225|  6.28k|}
_ZN5Exiv28AsfVideo11decodeBlockEm:
  227|  6.33k|void AsfVideo::decodeBlock(size_t depth) {
  228|  6.33k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  229|  6.33k|  HeaderReader objectHeader(io_);
  230|       |#ifdef EXIV2_DEBUG_MESSAGES
  231|       |  EXV_INFO << "decodeBlock = " << GUIDTag(objectHeader.getId().data()).to_string()
  232|       |           << "\tsize= " << objectHeader.getSize() << "\t " << io_->tell() << "/" << io_->size() << '\n';
  233|       |#endif
  234|  6.33k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  235|  6.33k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  236|       |
  237|  6.33k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (237:7): [True: 4.76k, False: 1.56k]
  ------------------
  238|  4.76k|    if (tag->second == "Header")
  ------------------
  |  Branch (238:9): [True: 1.59k, False: 3.17k]
  ------------------
  239|  1.59k|      decodeHeader(depth + 1);
  240|  3.17k|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (240:14): [True: 577, False: 2.59k]
  ------------------
  241|    577|      fileProperties();
  242|  2.59k|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (242:14): [True: 717, False: 1.88k]
  ------------------
  243|    717|      streamProperties();
  244|  1.88k|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (244:14): [True: 244, False: 1.63k]
  ------------------
  245|    244|      headerExtension();
  246|  1.63k|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (246:14): [True: 266, False: 1.37k]
  ------------------
  247|    266|      codecList();
  248|  1.37k|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (248:14): [True: 592, False: 778]
  ------------------
  249|    592|      extendedContentDescription();
  250|    778|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (250:14): [True: 415, False: 363]
  ------------------
  251|    415|      contentDescription();
  252|    363|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (252:14): [True: 160, False: 203]
  ------------------
  253|    160|      extendedStreamProperties();
  254|    203|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (254:14): [True: 0, False: 203]
  ------------------
  255|      0|      DegradableJPEGMedia();
  256|    203|    else {  // tag found but not processed
  257|       |      // Make sure that the remaining size is non-zero, so that we won't
  258|       |      // keep revisiting the same location in the file.
  259|    203|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  260|    203|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|    203|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  262|    203|    }
  263|  4.76k|  } else {  // tag not found
  264|       |    // Make sure that the remaining size is non-zero, so that we won't keep
  265|       |    // revisiting the same location in the file.
  266|  1.56k|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  267|  1.56k|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  268|  1.56k|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  269|  1.56k|  }
  270|       |
  271|  6.33k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEm:
  273|  1.59k|void AsfVideo::decodeHeader(size_t depth) {
  274|  1.59k|  Internal::enforce(depth <= max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|  1.59k|  DataBuf nbHeadersBuf(DWORD + 1);
  276|  1.59k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  277|       |
  278|  1.59k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  279|  1.59k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  1.59k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  281|  1.59k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  282|  6.50k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (282:24): [True: 4.91k, False: 1.59k]
  ------------------
  283|  4.91k|    decodeBlock(depth);
  284|  4.91k|  }
  285|  1.59k|}
_ZN5Exiv28AsfVideo24extendedStreamPropertiesEv:
  287|    160|void AsfVideo::extendedStreamProperties() {
  288|    160|  xmpData()["Xmp.video.StartTimecode"] = readQWORDTag(io_);  // Start Time
  289|    160|  xmpData()["Xmp.video.EndTimecode"] = readWORDTag(io_);     // End Time
  290|       |
  291|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Data Bitrate
  292|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Buffer Size
  293|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Initial Buffer Fullness
  294|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Data Bitrate
  295|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Buffer Size
  296|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Initial Buffer Fullness
  297|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Maximum Object Size
  298|    160|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Flags Buffer Size
  299|    160|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Flags Stream Number
  300|    160|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Stream Language ID Index
  301|       |
  302|    160|  xmpData()["Xmp.video.FrameRate"] = readWORDTag(io_);  // Average Time Per Frame
  303|    160|  uint16_t stream_name_count = readWORDTag(io_);
  304|    160|  uint16_t payload_ext_sys_count = readWORDTag(io_);
  305|       |
  306|    825|  for (uint16_t i = 0; i < stream_name_count; i++) {
  ------------------
  |  Branch (306:24): [True: 665, False: 160]
  ------------------
  307|    665|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Language ID Index
  308|    665|    uint16_t stream_length = readWORDTag(io_);
  309|    665|    if (stream_length)
  ------------------
  |  Branch (309:9): [True: 369, False: 296]
  ------------------
  310|    369|      io_->seek(io_->tell() + stream_length, BasicIo::beg);  // ignore Stream name
  311|    665|  }
  312|       |
  313|    731|  for (uint16_t i = 0; i < payload_ext_sys_count; i++) {
  ------------------
  |  Branch (313:24): [True: 571, False: 160]
  ------------------
  314|    571|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Extension System ID
  315|    571|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Extension Data Size
  316|    571|    uint16_t ext_sys_info_length = readWORDTag(io_);
  317|    571|    if (ext_sys_info_length)
  ------------------
  |  Branch (317:9): [True: 300, False: 271]
  ------------------
  318|    300|      io_->seek(io_->tell() + ext_sys_info_length, BasicIo::beg);  // ignore Extension System Info
  319|    571|  }
  320|    160|}  // AsfVideo::extendedStreamProperties
_ZN5Exiv28AsfVideo16streamPropertiesEv:
  337|    717|void AsfVideo::streamProperties() {
  338|    717|  DataBuf streamTypedBuf(GUID);
  339|    717|  io_->readOrThrow(streamTypedBuf.data(), streamTypedBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  340|       |
  341|    717|  enum class streamTypeInfo { Audio = 1, Video = 2 };
  342|    717|  auto stream = streamTypeInfo{0};
  343|       |
  344|    717|  auto tag_stream_type = GUIDReferenceTags.find(GUIDTag(streamTypedBuf.data()));
  345|    717|  if (tag_stream_type != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (345:7): [True: 292, False: 425]
  ------------------
  346|    292|    if (tag_stream_type->second == "Audio_Media")
  ------------------
  |  Branch (346:9): [True: 1, False: 291]
  ------------------
  347|      1|      stream = streamTypeInfo::Audio;
  348|    291|    else if (tag_stream_type->second == "Video_Media")
  ------------------
  |  Branch (348:14): [True: 23, False: 268]
  ------------------
  349|     23|      stream = streamTypeInfo::Video;
  350|       |
  351|    292|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Error Correction Type
  352|       |
  353|    292|    uint64_t time_offset = readQWORDTag(io_);
  354|    292|    if (stream == streamTypeInfo::Video)
  ------------------
  |  Branch (354:9): [True: 23, False: 269]
  ------------------
  355|     23|      xmpData()["Xmp.video.TimeOffset"] = time_offset;
  356|    269|    else if (stream == streamTypeInfo::Audio)
  ------------------
  |  Branch (356:14): [True: 1, False: 268]
  ------------------
  357|      1|      xmpData()["Xmp.audio.TimeOffset"] = time_offset;
  358|       |
  359|    292|    auto specific_data_length = readDWORDTag(io_);
  360|    292|    auto correction_data_length = readDWORDTag(io_);
  361|       |
  362|    292|    io_->seek(io_->tell() + WORD /*Flags*/ + DWORD /*Reserved*/ + specific_data_length + correction_data_length,
  363|    292|              BasicIo::beg);
  364|    292|  }
  365|       |
  366|    717|}  // AsfVideo::streamProperties
_ZN5Exiv28AsfVideo9codecListEv:
  368|    266|void AsfVideo::codecList() {
  369|    266|  io_->seek(io_->tell() + GUID /*reserved*/, BasicIo::beg);
  370|    266|  auto entries_count = readDWORDTag(io_);
  371|  1.35k|  for (uint32_t i = 0; i < entries_count; i++) {
  ------------------
  |  Branch (371:24): [True: 1.08k, False: 266]
  ------------------
  372|  1.08k|    uint16_t codec_type = readWORDTag(io_) * 2;
  373|  1.08k|    std::string codec = (codec_type == 1) ? "Xmp.video" : "Xmp.audio";
  ------------------
  |  Branch (373:25): [True: 0, False: 1.08k]
  ------------------
  374|       |
  375|  1.08k|    if (uint16_t codec_name_length = readWORDTag(io_) * 2)
  ------------------
  |  Branch (375:18): [True: 906, False: 178]
  ------------------
  376|    906|      xmpData()[codec + std::string(".CodecName")] = readStringWcharTag(io_, codec_name_length);
  377|       |
  378|  1.08k|    if (uint16_t codec_desc_length = readWORDTag(io_))
  ------------------
  |  Branch (378:18): [True: 820, False: 264]
  ------------------
  379|    820|      xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
  380|       |
  381|  1.08k|    uint16_t codec_info_length = readWORDTag(io_);
  382|  1.08k|    Internal::enforce(codec_info_length && codec_info_length < io_->size() - io_->tell(),
  ------------------
  |  Branch (382:23): [True: 901, False: 183]
  |  Branch (382:44): [True: 857, False: 44]
  ------------------
  383|  1.08k|                      Exiv2::ErrorCode::kerCorruptedMetadata);
  384|  1.08k|    xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
  385|  1.08k|  }
  386|    266|}  // AsfVideo::codecList
_ZNK5Exiv28AsfVideo15headerExtensionEv:
  388|    244|void AsfVideo::headerExtension() const {
  389|    244|  io_->seek(io_->tell() + GUID /*reserved1*/ + WORD /*Reserved2*/, BasicIo::beg);
  390|    244|  auto header_ext_data_length = readDWORDTag(io_);
  391|    244|  io_->seek(io_->tell() + header_ext_data_length, BasicIo::beg);
  392|    244|}  // AsfVideo::headerExtension
_ZN5Exiv28AsfVideo26extendedContentDescriptionEv:
  394|    592|void AsfVideo::extendedContentDescription() {
  395|    592|  uint16_t content_descriptor_count = readWORDTag(io_);
  396|    592|  std::string value;
  397|       |
  398|  52.1k|  for (uint16_t i = 0; i < content_descriptor_count; i++) {
  ------------------
  |  Branch (398:24): [True: 51.6k, False: 514]
  ------------------
  399|  51.6k|    if (uint16_t descriptor_name_length = readWORDTag(io_))
  ------------------
  |  Branch (399:18): [True: 6.89k, False: 44.7k]
  ------------------
  400|  6.89k|      value += readStringWcharTag(io_, descriptor_name_length);  // Descriptor Name
  401|       |
  402|  51.6k|    uint16_t descriptor_value_data_type = readWORDTag(io_);
  403|  51.6k|    if (uint16_t descriptor_value_length = readWORDTag(io_)) {
  ------------------
  |  Branch (403:18): [True: 7.44k, False: 44.1k]
  ------------------
  404|       |      // Descriptor Value
  405|  7.44k|      switch (descriptor_value_data_type) {
  ------------------
  |  Branch (405:15): [True: 3.43k, False: 4.01k]
  ------------------
  406|  1.74k|        case 0 /*Unicode string */:
  ------------------
  |  Branch (406:9): [True: 1.74k, False: 5.69k]
  ------------------
  407|  1.74k|          value += std::string(": ") + readStringWcharTag(io_, descriptor_value_length);
  408|  1.74k|          break;
  409|    100|        case 1 /*BYTE array  */:
  ------------------
  |  Branch (409:9): [True: 100, False: 7.34k]
  ------------------
  410|    100|          value += std::string(": ") + readStringTag(io_, descriptor_value_length);
  411|    100|          break;
  412|    309|        case 2 /*BOOL*/:
  ------------------
  |  Branch (412:9): [True: 309, False: 7.13k]
  ------------------
  413|    309|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  414|    309|          break;
  415|    324|        case 3 /*DWORD */:
  ------------------
  |  Branch (415:9): [True: 324, False: 7.12k]
  ------------------
  416|    324|          value += std::string(": ") + std::to_string(readDWORDTag(io_));
  417|    324|          break;
  418|    422|        case 4 /*QWORD */:
  ------------------
  |  Branch (418:9): [True: 422, False: 7.02k]
  ------------------
  419|    422|          value += std::string(": ") + std::to_string(readQWORDTag(io_));
  420|    422|          break;
  421|    531|        case 5 /*WORD*/:
  ------------------
  |  Branch (421:9): [True: 531, False: 6.91k]
  ------------------
  422|    531|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  423|    531|          break;
  424|  7.44k|      }
  425|  7.44k|    }
  426|  51.5k|    value += std::string(", ");
  427|  51.5k|  }
  428|       |
  429|    514|  xmpData()["Xmp.video.ExtendedContentDescription"] = value;
  430|    514|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  432|    415|void AsfVideo::contentDescription() {
  433|    415|  uint16_t title_length = readWORDTag(io_);
  434|    415|  uint16_t author_length = readWORDTag(io_);
  435|    415|  uint16_t copyright_length = readWORDTag(io_);
  436|    415|  uint16_t desc_length = readWORDTag(io_);
  437|    415|  uint16_t rating_length = readWORDTag(io_);
  438|       |
  439|    415|  if (title_length)
  ------------------
  |  Branch (439:7): [True: 330, False: 85]
  ------------------
  440|    330|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  441|       |
  442|    415|  if (author_length)
  ------------------
  |  Branch (442:7): [True: 142, False: 273]
  ------------------
  443|    142|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  444|       |
  445|    415|  if (copyright_length)
  ------------------
  |  Branch (445:7): [True: 93, False: 322]
  ------------------
  446|     93|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  447|       |
  448|    415|  if (desc_length)
  ------------------
  |  Branch (448:7): [True: 120, False: 295]
  ------------------
  449|    120|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  450|       |
  451|    415|  if (rating_length)
  ------------------
  |  Branch (451:7): [True: 82, False: 333]
  ------------------
  452|     82|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  453|       |
  454|    415|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo14filePropertiesEv:
  456|    577|void AsfVideo::fileProperties() {
  457|    577|  DataBuf FileIddBuf(GUID);
  458|    577|  io_->readOrThrow(FileIddBuf.data(), FileIddBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  459|    577|  xmpData()["Xmp.video.FileID"] = GUIDTag(FileIddBuf.data()).to_string();
  460|    577|  xmpData()["Xmp.video.FileLength"] = readQWORDTag(io_);
  461|    577|  xmpData()["Xmp.video.CreationDate"] = readQWORDTag(io_);
  462|    577|  xmpData()["Xmp.video.DataPackets"] = readQWORDTag(io_);
  463|    577|  xmpData()["Xmp.video.duration"] = readQWORDTag(io_);
  464|    577|  xmpData()["Xmp.video.SendDuration"] = readQWORDTag(io_);
  465|    577|  xmpData()["Xmp.video.Preroll"] = readQWORDTag(io_);
  466|       |
  467|    577|  io_->seek(io_->tell() + DWORD + DWORD + DWORD,
  468|    577|            BasicIo::beg);  // ignore Flags, Minimum Data Packet Size and Maximum Data Packet Size
  469|    577|  xmpData()["Xmp.video.MaxBitRate"] = readDWORDTag(io_);
  470|    577|}  // AsfVideo::fileProperties
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  472|  1.41k|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  473|  1.41k|  auto image = std::make_unique<AsfVideo>(std::move(io), params);
  474|  1.41k|  if (!image->good()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 1.41k]
  ------------------
  475|      0|    return nullptr;
  476|      0|  }
  477|  1.41k|  return image;
  478|  1.41k|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  480|  12.7k|bool isAsfType(BasicIo& iIo, bool advance) {
  481|  12.7k|  byte buf[GUID];
  482|  12.7k|  iIo.read(buf, GUID);
  483|       |
  484|  12.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (484:7): [True: 0, False: 12.7k]
  |  Branch (484:22): [True: 460, False: 12.2k]
  ------------------
  485|    460|    return false;
  486|    460|  }
  487|       |
  488|  12.2k|  bool matched = isASFType(buf);
  489|  12.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (489:7): [True: 12.2k, False: 0]
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|  12.2k|    iIo.seek(0, BasicIo::beg);
  491|  12.2k|  }
  492|       |
  493|  12.2k|  return matched;
  494|  12.7k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  12.2k|static bool isASFType(const byte buf[]) {
  179|  12.2k|  return Header == AsfVideo::GUIDTag(buf);
  180|  12.2k|}

_ZN5Exiv27BasicIoD2Ev:
   60|  86.1k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   62|  3.25M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   63|  3.25M|  const size_t nread = read(buf, rcount);
   64|  3.25M|  Internal::enforce(nread == rcount, err);
   65|  3.25M|  Internal::enforce(!error(), err);
   66|  3.25M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   68|  35.4k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   69|  35.4k|  const int r = seek(offset, pos);
   70|  35.4k|  Internal::enforce(r == 0, err);
   71|  35.4k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  624|  46.0k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  625|  46.0k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  678|  7.11M|void MemIo::Impl::reserve(size_t wcount) {
  679|  7.11M|  const size_t need = wcount + idx_;
  680|  7.11M|  size_t blockSize = 32 * 1024;  // 32768
  681|  7.11M|  const size_t maxBlockSize = 4 * 1024 * 1024;
  682|       |
  683|  7.11M|  if (!isMalloced_) {
  ------------------
  |  Branch (683:7): [True: 29.4k, False: 7.08M]
  ------------------
  684|       |    // Minimum size for 1st block
  685|  29.4k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  686|  29.4k|    auto data = static_cast<byte*>(std::malloc(size));
  687|  29.4k|    if (!data) {
  ------------------
  |  Branch (687:9): [True: 0, False: 29.4k]
  ------------------
  688|      0|      throw Error(ErrorCode::kerMallocFailed);
  689|      0|    }
  690|  29.4k|    if (data_) {
  ------------------
  |  Branch (690:9): [True: 0, False: 29.4k]
  ------------------
  691|      0|      std::memcpy(data, data_, size_);
  692|      0|    }
  693|  29.4k|    data_ = data;
  694|  29.4k|    sizeAlloced_ = size;
  695|  29.4k|    isMalloced_ = true;
  696|  29.4k|  }
  697|       |
  698|  7.11M|  if (need > size_) {
  ------------------
  |  Branch (698:7): [True: 5.87M, False: 1.24M]
  ------------------
  699|  5.87M|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (699:9): [True: 18.2k, False: 5.85M]
  ------------------
  700|  18.2k|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  701|       |      // Allocate in blocks
  702|  18.2k|      size_t want = blockSize * (1 + need / blockSize);
  703|  18.2k|      data_ = static_cast<byte*>(std::realloc(data_, want));
  704|  18.2k|      if (!data_) {
  ------------------
  |  Branch (704:11): [True: 0, False: 18.2k]
  ------------------
  705|      0|        throw Error(ErrorCode::kerMallocFailed);
  706|      0|      }
  707|  18.2k|      sizeAlloced_ = want;
  708|  18.2k|    }
  709|  5.87M|    size_ = need;
  710|  5.87M|  }
  711|  7.11M|}
_ZN5Exiv25MemIoC2Ev:
  713|  40.1k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  714|  40.1k|}
_ZN5Exiv25MemIoC2EPKhm:
  716|  46.0k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  717|  46.0k|}
_ZN5Exiv25MemIoD2Ev:
  719|  86.1k|MemIo::~MemIo() {
  720|  86.1k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (720:7): [True: 28.9k, False: 57.1k]
  ------------------
  721|  28.9k|    std::free(p_->data_);
  722|  28.9k|  }
  723|  86.1k|}
_ZN5Exiv25MemIo5writeEPKhm:
  725|  7.06M|size_t MemIo::write(const byte* data, size_t wcount) {
  726|  7.06M|  p_->reserve(wcount);
  727|  7.06M|  if (data) {
  ------------------
  |  Branch (727:7): [True: 5.82M, False: 1.24M]
  ------------------
  728|  5.82M|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  729|  5.82M|  }
  730|  7.06M|  p_->idx_ += wcount;
  731|  7.06M|  return wcount;
  732|  7.06M|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  734|  19.6k|void MemIo::transfer(BasicIo& src) {
  735|  19.6k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (735:12): [True: 19.6k, False: 0]
  ------------------
  736|       |    // Optimization if src is another instance of MemIo
  737|  19.6k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (737:9): [True: 437, False: 19.2k]
  ------------------
  738|    437|      std::free(p_->data_);
  739|    437|    }
  740|  19.6k|    p_->idx_ = 0;
  741|  19.6k|    p_->data_ = memIo->p_->data_;
  742|  19.6k|    p_->size_ = memIo->p_->size_;
  743|  19.6k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  744|  19.6k|    memIo->p_->idx_ = 0;
  745|  19.6k|    memIo->p_->data_ = nullptr;
  746|  19.6k|    memIo->p_->size_ = 0;
  747|  19.6k|    memIo->p_->isMalloced_ = false;
  748|  19.6k|  } else {
  749|       |    // Generic reopen to reset position to start
  750|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (750:9): [True: 0, False: 0]
  ------------------
  751|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  752|      0|    }
  753|      0|    p_->idx_ = 0;
  754|      0|    write(src);
  755|      0|    src.close();
  756|      0|  }
  757|  19.6k|  if (error() || src.error())
  ------------------
  |  Branch (757:7): [True: 0, False: 19.6k]
  |  Branch (757:18): [True: 0, False: 19.6k]
  ------------------
  758|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  759|  19.6k|}
_ZN5Exiv25MemIo4putbEh:
  779|  42.8k|int MemIo::putb(byte data) {
  780|  42.8k|  p_->reserve(1);
  781|  42.8k|  p_->data_[p_->idx_++] = data;
  782|  42.8k|  return data;
  783|  42.8k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  785|  1.36M|int MemIo::seek(int64_t offset, Position pos) {
  786|  1.36M|  int64_t newIdx = 0;
  787|       |
  788|  1.36M|  switch (pos) {
  ------------------
  |  Branch (788:11): [True: 1.36M, False: 0]
  ------------------
  789|   944k|    case BasicIo::cur:
  ------------------
  |  Branch (789:5): [True: 944k, False: 420k]
  ------------------
  790|   944k|      newIdx = p_->idx_ + offset;
  791|   944k|      break;
  792|   420k|    case BasicIo::beg:
  ------------------
  |  Branch (792:5): [True: 420k, False: 944k]
  ------------------
  793|   420k|      newIdx = offset;
  794|   420k|      break;
  795|    295|    case BasicIo::end:
  ------------------
  |  Branch (795:5): [True: 295, False: 1.36M]
  ------------------
  796|    295|      newIdx = p_->size_ + offset;
  797|    295|      break;
  798|  1.36M|  }
  799|       |
  800|  1.36M|  if (newIdx < 0)
  ------------------
  |  Branch (800:7): [True: 0, False: 1.36M]
  ------------------
  801|      0|    return 1;
  802|       |
  803|  1.36M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (803:7): [True: 8.41k, False: 1.35M]
  ------------------
  804|  8.41k|    p_->eof_ = true;
  805|  8.41k|    return 1;
  806|  8.41k|  }
  807|       |
  808|  1.35M|  p_->idx_ = static_cast<size_t>(newIdx);
  809|  1.35M|  p_->eof_ = false;
  810|  1.35M|  return 0;
  811|  1.36M|}
_ZN5Exiv25MemIo4mmapEb:
  813|  71.1k|byte* MemIo::mmap(bool /*isWriteable*/) {
  814|  71.1k|  return p_->data_;
  815|  71.1k|}
_ZNK5Exiv25MemIo4tellEv:
  821|  1.06M|size_t MemIo::tell() const {
  822|  1.06M|  return p_->idx_;
  823|  1.06M|}
_ZNK5Exiv25MemIo4sizeEv:
  825|   743k|size_t MemIo::size() const {
  826|   743k|  return p_->size_;
  827|   743k|}
_ZN5Exiv25MemIo4openEv:
  829|   175k|int MemIo::open() {
  830|   175k|  p_->idx_ = 0;
  831|   175k|  p_->eof_ = false;
  832|   175k|  return 0;
  833|   175k|}
_ZNK5Exiv25MemIo6isopenEv:
  835|   136k|bool MemIo::isopen() const {
  836|   136k|  return true;
  837|   136k|}
_ZN5Exiv25MemIo5closeEv:
  839|   133k|int MemIo::close() {
  840|   133k|  return 0;
  841|   133k|}
_ZN5Exiv25MemIo4readEm:
  843|   256k|DataBuf MemIo::read(size_t rcount) {
  844|   256k|  DataBuf buf(rcount);
  845|   256k|  size_t readCount = read(buf.data(), buf.size());
  846|   256k|  buf.resize(readCount);
  847|   256k|  return buf;
  848|   256k|}
_ZN5Exiv25MemIo4readEPhm:
  850|  4.80M|size_t MemIo::read(byte* buf, size_t rcount) {
  851|  4.80M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  852|  4.80M|  const auto allow = std::min<size_t>(rcount, avail);
  853|  4.80M|  if (allow > 0) {
  ------------------
  |  Branch (853:7): [True: 4.62M, False: 178k]
  ------------------
  854|  4.62M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  855|  4.62M|  }
  856|  4.80M|  p_->idx_ += allow;
  857|  4.80M|  if (rcount > avail) {
  ------------------
  |  Branch (857:7): [True: 19.5k, False: 4.78M]
  ------------------
  858|  19.5k|    p_->eof_ = true;
  859|  19.5k|  }
  860|  4.80M|  return allow;
  861|  4.80M|}
_ZN5Exiv25MemIo4getbEv:
  863|  12.7M|int MemIo::getb() {
  864|  12.7M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (864:7): [True: 1.27k, False: 12.7M]
  ------------------
  865|  1.27k|    p_->eof_ = true;
  866|  1.27k|    return EOF;
  867|  1.27k|  }
  868|  12.7M|  return p_->data_[p_->idx_++];
  869|  12.7M|}
_ZNK5Exiv25MemIo5errorEv:
  871|  5.53M|int MemIo::error() const {
  872|  5.53M|  return 0;
  873|  5.53M|}
_ZNK5Exiv25MemIo3eofEv:
  875|  1.16M|bool MemIo::eof() const {
  876|  1.16M|  return p_->eof_;
  877|  1.16M|}
_ZNK5Exiv25MemIo4pathEv:
  879|  15.4k|const std::string& MemIo::path() const noexcept {
  880|  15.4k|  static std::string _path{"MemIo"};
  881|  15.4k|  return _path;
  882|  15.4k|}
_ZN5Exiv25MemIo16populateFakeDataEv:
  884|    310|void MemIo::populateFakeData() {
  885|    310|}
_ZN5Exiv25MemIo4ImplC2Ev:
  604|  40.1k|  Impl() = default;                     //!< Default constructor

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

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

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

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

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

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

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  45.6k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  45.6k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  45.6k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  45.6k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 45.6k]
  |  Branch (18:17): [True: 0, False: 45.6k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  45.6k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 2.94k, False: 42.7k]
  |  Branch (22:26): [True: 2.88k, False: 57]
  ------------------
   23|  2.88k|    setByteOrder(littleEndian);
   24|  42.7k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 15.9k, False: 26.8k]
  |  Branch (24:33): [True: 15.8k, False: 96]
  ------------------
   25|  15.8k|    setByteOrder(bigEndian);
   26|  26.9k|  } else {
   27|  26.9k|    return false;
   28|  26.9k|  }
   29|  18.7k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 9.15k, False: 9.60k]
  ------------------
   30|  9.15k|    return false;
   31|  9.60k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  9.60k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 7.54k, False: 2.05k]
  ------------------
   33|  7.54k|    return false;
   34|  2.05k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  2.05k|  return true;
   37|  9.60k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    140|DataBuf Cr2Header::write() const {
   40|    140|  DataBuf buf(16);
   41|    140|  switch (byteOrder()) {
   42|     98|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 98, False: 42]
  ------------------
   43|     98|      buf.write_uint8(0, 'I');
   44|     98|      break;
   45|     42|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 42, False: 98]
  ------------------
   46|     42|      buf.write_uint8(0, 'M');
   47|     42|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 140]
  ------------------
   49|      0|      break;
   50|    140|  }
   51|    140|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    140|  buf.write_uint16(2, tag(), byteOrder());
   54|    140|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    140|  std::copy(cr2sig_, cr2sig_ + 4, 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|    140|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    140|  return buf;
   59|    140|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  29.5k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  29.5k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 442, False: 29.1k]
  |  Branch (63:33): [True: 336, False: 28.7k]
  ------------------
   64|    778|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  28.7k|  return isTiffImageTag(tag, group);
   67|  29.5k|}

_ZN5Exiv28Internal9Cr2Header11offset2addrEv:
   52|    180|  static uint32_t offset2addr() {
   53|    180|    return 12;
   54|    180|  }

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

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

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

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  9.40k|  [[nodiscard]] const byte* pData() const {
  214|  9.40k|    return pData_;
  215|  9.40k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  8.43k|  [[nodiscard]] size_t size() const {
  204|  8.43k|    return size_;
  205|  8.43k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  19.1k|  static auto signature() {
  419|  19.1k|    return signature_;
  420|  19.1k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  18.1k|  void setDir(uint16_t dir) {
  147|  18.1k|    dir_ = dir;
  148|  18.1k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  6.55k|  [[nodiscard]] uint16_t dir() const {
  184|  6.55k|    return dir_;
  185|  6.55k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|  73.0k|  [[nodiscard]] uint16_t tag() const {
  189|  73.0k|    return tag_;
  190|  73.0k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  4.59k|  [[nodiscard]] size_t offset() const {
  209|  4.59k|    return offset_;
  210|  4.59k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  26.0k|  [[nodiscard]] uint16_t tagId() const {
  219|  26.0k|    return tag_ & 0x3fff;
  220|  26.0k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  2.46k|  [[nodiscard]] TypeId typeId() const {
  224|  2.46k|    return typeId(tag_);
  225|  2.46k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  32.6k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  32.6k|    return dataLocation(tag_);
  230|  32.6k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.56k|  void setSize(size_t size) {
  254|  1.56k|    size_ = size;
  255|  1.56k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.56k|  void setOffset(size_t offset) {
  258|  1.56k|    offset_ = offset;
  259|  1.56k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.28k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.28k|    return byteOrder_;
  446|  1.28k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  18.9k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  19.4k|  virtual ~CiffComponent() = default;

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   327k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   327k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 281k, False: 45.7k]
  |  Branch (378:31): [True: 33.2k, False: 248k]
  ------------------
  379|  33.2k|    return -1;
  380|   293k|  const DataSet* dataSet = records_[recordId];
  381|   293k|  int idx;
  382|  7.69M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 7.40M, False: 284k]
  ------------------
  383|  7.40M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 9.89k, False: 7.39M]
  ------------------
  384|  9.89k|      return -1;
  385|  7.40M|  }
  386|   284k|  return idx;
  387|   293k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|   107k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|   107k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 103k, False: 3.32k]
  |  Branch (390:31): [True: 0, False: 103k]
  ------------------
  391|      0|    return -1;
  392|   107k|  const DataSet* dataSet = records_[recordId];
  393|   107k|  int idx;
  394|  3.18M|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 3.07M, False: 107k]
  ------------------
  395|  3.07M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 3.07M]
  ------------------
  396|      0|      return -1;
  397|  3.07M|  }
  398|   107k|  return idx;
  399|   107k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  93.1k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  93.1k|  int idx = dataSetIdx(number, recordId);
  403|  93.1k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 14.3k, False: 78.7k]
  ------------------
  404|  14.3k|    return unknownDataSet.type_;
  405|  78.7k|  return records_[recordId][idx].type_;
  406|  93.1k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|   142k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|   142k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 128k, False: 14.3k]
  ------------------
  410|   128k|    return records_[recordId][idx].name_;
  411|       |
  412|  14.3k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  14.3k|#define stringFormat std::format
  ------------------
  413|   142k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  91.5k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  91.5k|  int idx = dataSetIdx(number, recordId);
  438|  91.5k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 14.3k, False: 77.2k]
  ------------------
  439|  14.3k|    return unknownDataSet.repeatable_;
  440|  77.2k|  return records_[recordId][idx].repeatable_;
  441|  91.5k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|   107k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|   107k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 107k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|   107k|    return records_[recordId][idx].number_;
  447|   107k|  }
  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|   142k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|   142k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 17.2k, False: 125k]
  |  Branch (454:31): [True: 114k, False: 11.0k]
  ------------------
  455|   131k|    return recordInfo_[recordId].name_;
  456|   131k|  }
  457|       |
  458|  11.0k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  11.0k|#define stringFormat std::format
  ------------------
  459|   142k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|   107k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|   107k|  uint16_t i;
  470|   110k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 110k, False: 0]
  ------------------
  471|   110k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 107k, False: 3.32k]
  ------------------
  472|   107k|      break;
  473|   110k|  }
  474|   107k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 107k]
  ------------------
  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|   107k|  return i;
  480|   107k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|   107k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|   107k|  decomposeKey();
  492|   107k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  35.4k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  35.4k|  makeKey();
  496|  35.4k|}
_ZNK5Exiv27IptcKey3keyEv:
  498|   108k|std::string IptcKey::key() const {
  499|   108k|  return key_;
  500|   108k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|  1.53M|uint16_t IptcKey::tag() const {
  523|  1.53M|  return tag_;
  524|  1.53M|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   553k|uint16_t IptcKey::record() const {
  531|   553k|  return record_;
  532|   553k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   485k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   485k|  return UniquePtr(clone_());
  536|   485k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   485k|IptcKey* IptcKey::clone_() const {
  539|   485k|  return new IptcKey(*this);
  540|   485k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|   107k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|   107k|  auto posDot1 = key_.find('.');
  545|   107k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|   107k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 107k]
  |  Branch (547:39): [True: 0, False: 107k]
  ------------------
  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|   107k|  const std::string familyName = key_.substr(0, posDot1);
  553|   107k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 107k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|   107k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|   107k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|   107k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|   107k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|   107k|  recordName = IptcDataSets::recordName(recId);
  565|   107k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|   107k|  tag_ = dataSet;
  568|   107k|  record_ = recId;
  569|   107k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|   107k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  35.4k|void IptcKey::makeKey() {
  573|  35.4k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  35.4k|         IptcDataSets::dataSetName(tag_, record_);
  575|  35.4k|}

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

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

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

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

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

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

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

_ZN5Exiv215ImageCtorParamsC2Ebm:
  141|  44.9k|    create_(create), max_recursion_depth_(max_recursion_depth) {
  142|  44.9k|}
_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsE:
  145|  44.9k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  146|  44.9k|}
_ZN5Exiv25ImageD2Ev:
  148|  44.9k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  186|    943|bool Image::isBigEndianPlatform() {
  187|    943|  return std::endian::native == std::endian::big;
  188|    943|}
_ZN5Exiv25Image8byteSwapEjb:
  210|  4.51k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  211|       |#ifdef __cpp_lib_byteswap
  212|       |  return bSwap ? std::byteswap(value) : value;
  213|       |#elif defined(_MSC_VER)
  214|       |  return bSwap ? _byteswap_ulong(value) : value;
  215|       |#else
  216|  4.51k|  uint32_t result = 0;
  217|  4.51k|  result |= (value & 0x000000FFU) << 24;
  218|  4.51k|  result |= (value & 0x0000FF00U) << 8;
  219|  4.51k|  result |= (value & 0x00FF0000U) >> 8;
  220|  4.51k|  result |= (value & 0xFF000000U) >> 24;
  221|  4.51k|  return bSwap ? result : value;
  ------------------
  |  Branch (221:10): [True: 0, False: 4.51k]
  ------------------
  222|  4.51k|#endif
  223|  4.51k|}
_ZN5Exiv25Image13clearMetadataEv:
  542|  38.1k|void Image::clearMetadata() {
  543|  38.1k|  clearExifData();
  544|  38.1k|  clearIptcData();
  545|  38.1k|  clearXmpPacket();
  546|  38.1k|  clearXmpData();
  547|  38.1k|  clearComment();
  548|  38.1k|  clearIccProfile();
  549|  38.1k|}
_ZN5Exiv25Image8exifDataEv:
  551|  14.3k|ExifData& Image::exifData() {
  552|  14.3k|  return exifData_;
  553|  14.3k|}
_ZN5Exiv25Image8iptcDataEv:
  555|  4.78k|IptcData& Image::iptcData() {
  556|  4.78k|  return iptcData_;
  557|  4.78k|}
_ZN5Exiv25Image7xmpDataEv:
  559|  23.1k|XmpData& Image::xmpData() {
  560|  23.1k|  return xmpData_;
  561|  23.1k|}
_ZN5Exiv25Image9xmpPacketEv:
  563|    385|std::string& Image::xmpPacket() {
  564|       |  // Serialize the current XMP
  565|    385|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (565:7): [True: 0, False: 385]
  |  Branch (565:28): [True: 0, False: 0]
  ------------------
  566|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  567|      0|  }
  568|    385|  return xmpPacket_;
  569|    385|}
_ZN5Exiv25Image13clearExifDataEv:
  591|  38.1k|void Image::clearExifData() {
  592|  38.1k|  exifData_.clear();
  593|  38.1k|}
_ZN5Exiv25Image11setExifDataERKNS_8ExifDataE:
  595|    439|void Image::setExifData(const ExifData& exifData) {
  596|    439|  exifData_ = exifData;
  597|    439|}
_ZN5Exiv25Image13clearIptcDataEv:
  599|  38.2k|void Image::clearIptcData() {
  600|  38.2k|  iptcData_.clear();
  601|  38.2k|}
_ZN5Exiv25Image11setIptcDataERKNS_8IptcDataE:
  603|    439|void Image::setIptcData(const IptcData& iptcData) {
  604|    439|  iptcData_ = iptcData;
  605|    439|}
_ZN5Exiv25Image14clearXmpPacketEv:
  607|  38.1k|void Image::clearXmpPacket() {
  608|  38.1k|  xmpPacket_.clear();
  609|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  610|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  611|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  612|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  613|  38.1k|  xmpData_.setPacket(std::string());
  614|  38.1k|  writeXmpFromPacket(true);
  615|  38.1k|}
_ZN5Exiv25Image12clearXmpDataEv:
  624|  38.1k|void Image::clearXmpData() {
  625|  38.1k|  xmpData_.clear();
  626|  38.1k|  writeXmpFromPacket(false);
  627|  38.1k|}
_ZN5Exiv25Image10setXmpDataERKNS_7XmpDataE:
  629|    439|void Image::setXmpData(const XmpData& xmpData) {
  630|    439|  xmpData_ = xmpData;
  631|    439|  writeXmpFromPacket(false);
  632|    439|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  635|  76.7k|void Image::writeXmpFromPacket(bool flag) {
  636|  76.7k|  writeXmpFromPacket_ = flag;
  637|  76.7k|}
_ZN5Exiv25Image12clearCommentEv:
  643|  38.1k|void Image::clearComment() {
  644|  38.1k|  comment_.erase();
  645|  38.1k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  647|    137|void Image::setComment(const std::string& comment) {
  648|    137|  comment_ = comment;
  649|    137|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  651|    556|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  652|    556|  iccProfile_ = std::move(iccProfile);
  653|    556|  if (bTestValid) {
  ------------------
  |  Branch (653:7): [True: 556, False: 0]
  ------------------
  654|    556|    checkIccProfile();
  655|    556|  }
  656|    556|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  658|  7.28k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  659|  7.28k|  if (size == 0) {
  ------------------
  |  Branch (659:7): [True: 360, False: 6.92k]
  ------------------
  660|    360|    return;
  661|    360|  }
  662|  6.92k|  const size_t start = iccProfile_.size();
  663|  6.92k|  iccProfile_.resize(Safe::add(start, size));
  664|  6.92k|  memcpy(iccProfile_.data(start), bytes, size);
  665|  6.92k|  if (bTestValid) {
  ------------------
  |  Branch (665:7): [True: 62, False: 6.86k]
  ------------------
  666|     62|    checkIccProfile();
  667|     62|  }
  668|  6.92k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  670|    618|void Image::checkIccProfile() const {
  671|    618|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (671:7): [True: 17, False: 601]
  ------------------
  672|     17|    throw Error(ErrorCode::kerInvalidIccProfile);
  673|     17|  }
  674|    601|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  675|    601|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (675:7): [True: 54, False: 547]
  ------------------
  676|     54|    throw Error(ErrorCode::kerInvalidIccProfile);
  677|     54|  }
  678|    601|}
_ZN5Exiv25Image15clearIccProfileEv:
  680|  38.1k|void Image::clearIccProfile() {
  681|  38.1k|  iccProfile_.reset();
  682|  38.1k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  684|  23.3k|void Image::setByteOrder(ByteOrder byteOrder) {
  685|  23.3k|  byteOrder_ = byteOrder;
  686|  23.3k|}
_ZNK5Exiv25Image9byteOrderEv:
  688|  6.22k|ByteOrder Image::byteOrder() const {
  689|  6.22k|  return byteOrder_;
  690|  6.22k|}
_ZNK5Exiv25Image10pixelWidthEv:
  692|  2.31k|uint32_t Image::pixelWidth() const {
  693|  2.31k|  return pixelWidth_;
  694|  2.31k|}
_ZNK5Exiv25Image11pixelHeightEv:
  696|  2.31k|uint32_t Image::pixelHeight() const {
  697|  2.31k|  return pixelHeight_;
  698|  2.31k|}
_ZNK5Exiv25Image8exifDataEv:
  700|   333k|const ExifData& Image::exifData() const {
  701|   333k|  return exifData_;
  702|   333k|}
_ZNK5Exiv25Image7xmpDataEv:
  708|  8.06k|const XmpData& Image::xmpData() const {
  709|  8.06k|  return xmpData_;
  710|  8.06k|}
_ZNK5Exiv25Image7commentEv:
  712|  1.13k|std::string Image::comment() const {
  713|  1.13k|  return comment_;
  714|  1.13k|}
_ZNK5Exiv25Image2ioEv:
  720|  45.1k|BasicIo& Image::io() const {
  721|  45.1k|  return *io_;
  722|  45.1k|}
_ZNK5Exiv25Image18writeXmpFromPacketEv:
  724|  18.5k|bool Image::writeXmpFromPacket() const {
  725|  18.5k|  return writeXmpFromPacket_;
  726|  18.5k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  728|  32.6k|const NativePreviewList& Image::nativePreviews() const {
  729|  32.6k|  return nativePreviews_;
  730|  32.6k|}
_ZNK5Exiv25Image4goodEv:
  732|  44.7k|bool Image::good() const {
  733|  44.7k|  if (io_->open() != 0)
  ------------------
  |  Branch (733:7): [True: 0, False: 44.7k]
  ------------------
  734|      0|    return false;
  735|  44.7k|  IoCloser closer(*io_);
  736|  44.7k|  return ImageFactory::checkType(imageType_, *io_, false);
  737|  44.7k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  787|  44.7k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  788|  44.7k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (788:12): [True: 44.7k, False: 0]
  ------------------
  789|  44.7k|    return r->isThisType_(io, advance);
  790|      0|  return false;
  791|  44.7k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  873|  45.8k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  874|  45.8k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  875|  45.8k|  if (!image)
  ------------------
  |  Branch (875:7): [True: 1.35k, False: 44.5k]
  ------------------
  876|  1.35k|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  877|  44.5k|  return image;
  878|  45.8k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  880|  45.8k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  881|  45.8k|  if (io->open() != 0) {
  ------------------
  |  Branch (881:7): [True: 0, False: 45.8k]
  ------------------
  882|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  883|      0|  }
  884|   792k|  for (const auto& r : registry) {
  ------------------
  |  Branch (884:22): [True: 792k, False: 1.53k]
  ------------------
  885|   792k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (885:9): [True: 44.3k, False: 748k]
  ------------------
  886|  44.3k|      return r.newInstance_(std::move(io), ImageCtorParams(false, 1000));
  887|  44.3k|    }
  888|   792k|  }
  889|  1.53k|  return nullptr;
  890|  45.8k|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeE:
  909|    439|Image::UniquePtr ImageFactory::create(ImageType type) {
  910|    439|  auto image = create(type, std::make_unique<MemIo>());
  911|    439|  if (!image)
  ------------------
  |  Branch (911:7): [True: 0, False: 439]
  ------------------
  912|      0|    throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
  913|    439|  return image;
  914|    439|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  916|    439|Image::UniquePtr ImageFactory::create(ImageType type, BasicIo::UniquePtr io) {
  917|       |  // BasicIo instance does not need to be open
  918|    439|  if (type == ImageType::none)
  ------------------
  |  Branch (918:7): [True: 0, False: 439]
  ------------------
  919|      0|    return {};
  920|    439|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (920:12): [True: 439, False: 0]
  ------------------
  921|    439|    return r->newInstance_(std::move(io), ImageCtorParams(true, 1000));
  922|      0|  return {};
  923|    439|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  928|  90.5k|void append(Blob& blob, const byte* buf, size_t len) {
  929|  90.5k|  if (len != 0) {
  ------------------
  |  Branch (929:7): [True: 87.3k, False: 3.20k]
  ------------------
  930|  87.3k|    Blob::size_type size = blob.size();
  931|  87.3k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (931:9): [True: 6.83k, False: 80.4k]
  ------------------
  932|  6.83k|      blob.reserve(size + 65536);
  933|  6.83k|    }
  934|  87.3k|    blob.resize(size + len);
  935|  87.3k|    std::copy_n(buf, len, blob.begin() + size);
  936|  87.3k|  }
  937|  90.5k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   764k|  bool operator==(const ImageType& imageType) const {
   67|   764k|    return imageType == imageType_;
   68|   764k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  93.1k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  93.1k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 35.4k, False: 57.6k]
  ------------------
   58|  35.4k|    value_ = pValue->clone();
   59|  93.1k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   301k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   301k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 301k, False: 0]
  ------------------
   63|   301k|    key_ = rhs.key_->clone();  // deep copy
   64|   301k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 301k, False: 0]
  ------------------
   65|   301k|    value_ = rhs.value_->clone();  // deep copy
   66|   301k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   394k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|   108k|std::string Iptcdatum::key() const {
   79|   108k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 108k, False: 0]
  ------------------
   80|   108k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   503k|uint16_t Iptcdatum::record() const {
   87|   503k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 503k, False: 0]
  ------------------
   88|   503k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|  1.48M|uint16_t Iptcdatum::tag() const {
  111|  1.48M|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 1.48M, False: 0]
  ------------------
  112|  1.48M|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|  60.9k|size_t Iptcdatum::size() const {
  131|  60.9k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 60.9k, False: 0]
  ------------------
  132|  60.9k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  55.9k|std::string Iptcdatum::toString() const {
  135|  55.9k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 55.9k, False: 0]
  ------------------
  136|  55.9k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  86.4k|const Value& Iptcdatum::value() const {
  159|  86.4k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 86.4k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  86.4k|  return *value_;
  162|  86.4k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|  91.3k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|  91.3k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 91.3k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|  91.3k|  key_.reset();
  169|  91.3k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 91.3k, False: 0]
  ------------------
  170|  91.3k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|  91.3k|  value_.reset();
  173|  91.3k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 91.3k, False: 0]
  ------------------
  174|  91.3k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|  91.3k|  return *this;
  177|  91.3k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.79k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.79k|  setValue(value);
  188|  1.79k|  return *this;
  189|  1.79k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  57.9k|int Iptcdatum::setValue(const std::string& value) {
  203|  57.9k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 57.6k, False: 284]
  ------------------
  204|  57.6k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  57.6k|    value_ = Value::create(type);
  206|  57.6k|  }
  207|  57.9k|  return value_->read(value);
  208|  57.9k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.79k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.79k|  IptcKey iptcKey(key);
  212|  1.79k|  auto pos = findKey(iptcKey);
  213|  1.79k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.51k, False: 284]
  ------------------
  214|  1.51k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.51k|  }
  216|    284|  return *pos;
  217|  1.79k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|  1.35k|size_t IptcData::size() const {
  220|  1.35k|  size_t newSize = 0;
  221|  30.4k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 30.4k, False: 1.35k]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  30.4k|    newSize += 5;
  224|  30.4k|    size_t dataSize = iptc.size();
  225|  30.4k|    newSize += dataSize;
  226|  30.4k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 30.4k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  30.4k|  }
  231|  1.35k|  return newSize;
  232|  1.35k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  35.4k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  35.4k|  return add(Iptcdatum(key, value));
  236|  35.4k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  91.5k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  91.5k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 22.1k, False: 69.4k]
  |  Branch (239:7): [True: 18.3k, False: 73.1k]
  ------------------
  240|  22.1k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 18.3k, False: 3.74k]
  ------------------
  241|  18.3k|    return 6;
  242|  18.3k|  }
  243|       |  // allow duplicates
  244|  73.1k|  iptcMetadata_.push_back(iptcDatum);
  245|  73.1k|  return 0;
  246|  91.5k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  2.28k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  2.28k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  2.28k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  48.5k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  48.5k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  48.5k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  22.1k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  22.1k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  22.1k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  2.28k|const char* IptcData::detectCharset() const {
  305|  2.28k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  2.28k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 702, False: 1.58k]
  ------------------
  307|    702|    const std::string value = pos->toString();
  308|    702|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 702, False: 0]
  |  Branch (308:30): [True: 702, False: 0]
  ------------------
  309|    702|      return "UTF-8";
  310|    702|  }
  311|       |
  312|  1.58k|  bool ascii = true;
  313|  1.58k|  bool utf8 = true;
  314|       |
  315|  1.58k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 1.58k]
  ------------------
  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.58k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 1.58k, False: 0]
  ------------------
  356|  1.58k|    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.39k|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.39k|  auto pRead = pData;
  367|  2.39k|  const auto pEnd = pData + size;
  368|  2.39k|  iptcData.clear();
  369|       |
  370|  2.39k|  uint16_t record = 0;
  371|  2.39k|  uint16_t dataSet = 0;
  372|  2.39k|  uint32_t sizeData = 0;
  373|  2.39k|  byte extTest = 0;
  374|       |
  375|  1.23M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.23M, False: 1.52k]
  ------------------
  376|       |    // First byte should be a marker. If it isn't, scan forward and skip
  377|       |    // the chunk bytes present in some images. This deviates from the
  378|       |    // standard, which advises to treat such cases as errors.
  379|  1.23M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.20M, False: 36.2k]
  ------------------
  380|  1.20M|      continue;
  381|  36.2k|    record = *pRead++;
  382|  36.2k|    dataSet = *pRead++;
  383|       |
  384|  36.2k|    extTest = *pRead;
  385|  36.2k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 1.32k, False: 34.9k]
  ------------------
  386|       |      // extended dataset
  387|  1.32k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  1.32k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 235, False: 1.09k]
  ------------------
  389|    235|        return 5;
  390|  1.09k|      pRead += 2;
  391|  1.09k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 6, False: 1.08k]
  ------------------
  392|      6|        return 6;
  393|  1.08k|      sizeData = 0;
  394|  2.75k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 1.66k, False: 1.08k]
  ------------------
  395|  1.66k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  1.66k|      }
  397|  34.9k|    } else {
  398|       |      // standard dataset
  399|  34.9k|      sizeData = getUShort(pRead, bigEndian);
  400|  34.9k|      pRead += 2;
  401|  34.9k|    }
  402|  36.0k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 35.4k, False: 626]
  ------------------
  403|  35.4k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  35.4k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 35.4k]
  ------------------
  405|      0|#ifndef SUPPRESS_WARNINGS
  406|      0|        EXV_WARNING << "Failed to read IPTC dataset " << IptcKey(dataSet, record) << " (rc = " << rc << "); skipped.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  407|      0|#endif
  408|      0|      }
  409|  35.4k|    } else {
  410|    626|#ifndef SUPPRESS_WARNINGS
  411|    626|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    626|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 626]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    626|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    626|#endif
  413|    626|      return 7;
  414|    626|    }
  415|  35.4k|    pRead += sizeData;
  416|  35.4k|  }
  417|       |
  418|  1.52k|  return 0;
  419|  2.39k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  22.5k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  22.5k|  DataBuf buf;
  423|  22.5k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 21.1k, False: 1.35k]
  ------------------
  424|  21.1k|    return buf;
  425|       |
  426|  1.35k|  buf = DataBuf(iptcData.size());
  427|  1.35k|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|  1.35k|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|  1.35k|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|  1.35k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  30.4k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 30.4k, False: 1.35k]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  30.4k|    *pWrite++ = marker_;
  437|  30.4k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  30.4k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  30.4k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 30.4k]
  ------------------
  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|  30.4k|    } else {
  449|  30.4k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  30.4k|      pWrite += 2;
  451|  30.4k|    }
  452|  30.4k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  30.4k|  }
  454|       |
  455|  1.35k|  return buf;
  456|  22.5k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|  1.28M|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|  1.28M|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 25.8k, False: 1.25M]
  |  Branch (42:43): [True: 19.9k, False: 5.93k]
  ------------------
   43|  1.28M|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  72.9k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  72.9k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  35.4k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  35.4k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  35.4k|  auto value = Exiv2::Value::create(type);
  466|  35.4k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  35.4k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 21.4k, False: 13.9k]
  ------------------
  468|  21.4k|    Exiv2::IptcKey key(dataSet, record);
  469|  21.4k|    iptcData.add(key, value.get());
  470|  21.4k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 13.9k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  13.9k|    value = Exiv2::Value::create(Exiv2::string);
  473|  13.9k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  13.9k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 13.9k, False: 0]
  ------------------
  475|  13.9k|      Exiv2::IptcKey key(dataSet, record);
  476|  13.9k|      iptcData.add(key, value.get());
  477|  13.9k|    }
  478|  13.9k|  }
  479|  35.4k|  return rc;
  480|  35.4k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|   137k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    214|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|    214|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 21, False: 193]
  |  Branch (15:29): [True: 21, False: 172]
  ------------------
   16|     42|    return false;
   17|     42|  }
   18|       |
   19|    172|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    172|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    172|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    172|  bool clWithRightBrand = false;
   24|  2.74k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 2.60k, False: 142]
  ------------------
   25|  2.60k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  2.60k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 506, False: 2.09k]
  |  Branch (26:31): [True: 17, False: 489]
  |  Branch (26:66): [True: 374, False: 2.21k]
  |  Branch (26:87): [True: 13, False: 361]
  ------------------
   27|     30|      clWithRightBrand = true;
   28|     30|      break;
   29|     30|    }
   30|  2.60k|  }
   31|    172|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 32, False: 140]
  |  Branch (31:32): [True: 14, False: 18]
  ------------------
   32|    214|}

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

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.31k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.31k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  3.31k|std::string MatroskaVideo::mimeType() const {
  604|  3.31k|  return "video/matroska";
  605|  3.31k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  607|  1.89k|void MatroskaVideo::writeMetadata() {
  608|  1.89k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.31k|void MatroskaVideo::readMetadata() {
  611|  3.31k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.31k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.31k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.31k]
  ------------------
  616|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  618|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  619|      0|  }
  620|       |
  621|  3.31k|  IoCloser closer(*io_);
  622|  3.31k|  clearMetadata();
  623|  3.31k|  continueTraversing_ = true;
  624|  3.31k|  height_ = width_ = 1;
  625|       |
  626|  3.31k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.31k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|  80.0k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 76.7k, False: 3.31k]
  ------------------
  630|  76.7k|    decodeBlock();
  631|       |
  632|  3.31k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.31k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|  76.7k|void MatroskaVideo::decodeBlock() {
  636|  76.7k|  byte buf[8];
  637|  76.7k|  io_->read(buf, 1);
  638|       |
  639|  76.7k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 364, False: 76.3k]
  ------------------
  640|    364|    continueTraversing_ = false;
  641|    364|    return;
  642|    364|  }
  643|       |
  644|  76.3k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|  76.3k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 75.8k, False: 513]
  ------------------
  646|  75.8k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|  76.3k|  auto tag_id = returnTagValue(buf, block_size);
  649|  76.3k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|  76.3k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.81k, False: 74.5k]
  ------------------
  652|  1.81k|    continueTraversing_ = false;
  653|  1.81k|    return;
  654|  1.81k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|  74.5k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 574, False: 74.0k]
  |  Branch (658:27): [True: 1, False: 74.0k]
  ------------------
  659|      2|    continueTraversing_ = false;
  660|      2|    return;
  661|      2|  }
  662|       |
  663|  74.5k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|  74.5k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|  74.5k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 73.8k, False: 697]
  ------------------
  667|  73.8k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|  74.5k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|  74.5k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 39.7k, False: 34.7k]
  |  Branch (670:29): [True: 39.7k, False: 0]
  ------------------
  671|  39.7k|    return;
  672|       |
  673|  34.7k|  const size_t bufMaxSize = 200;
  674|       |
  675|  34.7k|#ifndef SUPPRESS_WARNINGS
  676|  34.7k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 32.8k, False: 1.96k]
  |  Branch (676:28): [True: 133, False: 32.7k]
  ------------------
  677|    133|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    133|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 133]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    133|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    133|  }
  680|  34.7k|#endif
  681|  34.7k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 1.96k, False: 32.8k]
  |  Branch (681:27): [True: 133, False: 32.7k]
  ------------------
  682|  1.39k|    io_->seek(size, BasicIo::cur);
  683|  1.39k|    return;
  684|  1.39k|  }
  685|       |
  686|  33.4k|  DataBuf buf2(bufMaxSize + 1);
  687|  33.4k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  33.4k|  switch (tag->_type) {
  689|  7.99k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 7.99k, False: 25.4k]
  ------------------
  690|  7.99k|      decodeInternalTags(tag, buf2.data());
  691|  7.99k|      break;
  692|  3.14k|    case String:
  ------------------
  |  Branch (692:5): [True: 3.14k, False: 30.2k]
  ------------------
  693|  3.14k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 33.4k]
  ------------------
  694|  3.14k|      decodeStringTags(tag, buf2.data());
  695|  3.14k|      break;
  696|  5.47k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 5.47k, False: 27.9k]
  ------------------
  697|  7.16k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 1.69k, False: 31.7k]
  ------------------
  698|  7.16k|      decodeIntegerTags(tag, buf2.data());
  699|  7.16k|      break;
  700|  8.94k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 8.94k, False: 24.4k]
  ------------------
  701|  8.94k|      decodeBooleanTags(tag, buf2.data());
  702|  8.94k|      break;
  703|  1.60k|    case Date:
  ------------------
  |  Branch (703:5): [True: 1.60k, False: 31.8k]
  ------------------
  704|  1.60k|      decodeDateTags(tag, buf2.data(), size);
  705|  1.60k|      break;
  706|  3.70k|    case Float:
  ------------------
  |  Branch (706:5): [True: 3.70k, False: 29.7k]
  ------------------
  707|  3.70k|      decodeFloatTags(tag, buf2.data());
  708|  3.70k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 33.4k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 33.4k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 33.4k]
  ------------------
  714|      0|      break;
  715|  33.4k|  }
  716|  33.4k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  7.99k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  7.99k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  7.99k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 92, False: 7.90k]
  ------------------
  721|     92|    return;
  722|       |
  723|  7.90k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  7.90k|    switch (tag->_id) {
  725|  7.90k|      case Xmp_video_VideoScanTpye:
  726|  7.90k|        return Exiv2::find(videoScanType, key);
  727|  7.90k|      case Xmp_audio_ChannelType:
  728|  7.90k|        return Exiv2::find(audioChannels, key);
  729|  7.90k|      case Xmp_video_ContentCompressAlgo:
  730|  7.90k|        return Exiv2::find(compressionAlgorithm, key);
  731|  7.90k|      case Xmp_video_ContentEncryptAlgo:
  732|  7.90k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  7.90k|      case Xmp_video_ContentSignAlgo_1:
  734|  7.90k|      case Xmp_video_ContentSignAlgo_2:
  735|  7.90k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  7.90k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  7.90k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  7.90k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  7.90k|      case Xmp_video_ContentEncodingType:
  740|  7.90k|        return Exiv2::find(encodingType, key);
  741|  7.90k|      case Xmp_video_DisplayUnit:
  742|  7.90k|        return Exiv2::find(displayUnit, key);
  743|  7.90k|      case Xmp_video_AspectRatioType:
  744|  7.90k|        return Exiv2::find(aspectRatioType, key);
  745|  7.90k|      case Xmp_video_PhysicalEquivalent:
  746|  7.90k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  7.90k|      case Xmp_video_TranslateCodec:
  748|  7.90k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  7.90k|      case Video_Audio_CodecID:
  750|  7.90k|        return Exiv2::find(trackCodec, key);
  751|  7.90k|      case Video_Audio_CodecName:
  752|  7.90k|        return Exiv2::find(codecInfo, key);
  753|  7.90k|      case CodecDownloadURL:
  754|  7.90k|      case CodecInfoURL:
  755|  7.90k|        return Exiv2::find(codecDownloadUrl, key);
  756|  7.90k|    }
  757|  7.90k|    return nullptr;
  758|  7.90k|  }();
  759|  7.90k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 2.88k, False: 5.01k]
  ------------------
  760|  2.88k|    xmpData_[tag->_label] = internalMt->_label;
  761|  5.01k|  } else {
  762|  5.01k|    xmpData_[tag->_label] = key;
  763|  5.01k|  }
  764|  7.90k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  3.14k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  3.14k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 775, False: 2.36k]
  ------------------
  768|    775|    track_count_++;
  769|    775|    xmpData_[tag->_label] = track_count_;
  770|  2.36k|  } else {
  771|  2.36k|    xmpData_[tag->_label] = buf;
  772|  2.36k|  }
  773|  3.14k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  7.16k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  7.16k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  7.16k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 5.35k, False: 1.80k]
  ------------------
  778|  5.35k|    return;
  779|       |
  780|  1.80k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 768, False: 1.04k]
  |  Branch (780:40): [True: 234, False: 807]
  ------------------
  781|  1.00k|    width_ = value;
  782|  1.80k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 409, False: 1.40k]
  |  Branch (782:41): [True: 296, False: 1.10k]
  ------------------
  783|    705|    height_ = value;
  784|  1.80k|  xmpData_[tag->_label] = value;
  785|  1.80k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  8.94k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  8.94k|  const MatroskaTag* internalMt = nullptr;
  789|  8.94k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  8.94k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 1.77k, False: 7.16k]
  ------------------
  791|  1.77k|    return;
  792|       |
  793|  7.16k|  switch (tag->_id) {
  794|  2.90k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 2.90k, False: 4.26k]
  ------------------
  795|  2.90k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 585, False: 2.32k]
  ------------------
  796|    585|        stream_ = f->_id;
  797|    585|      }
  798|  2.90k|      break;
  799|    436|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 436, False: 6.72k]
  ------------------
  800|    436|      internalMt = Exiv2::find(trackEnable, key);
  801|    436|      break;
  802|  1.04k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 1.04k, False: 6.12k]
  ------------------
  803|  1.04k|      internalMt = Exiv2::find(defaultOn, key);
  804|  1.04k|      break;
  805|    895|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 895, False: 6.27k]
  ------------------
  806|    895|      internalMt = Exiv2::find(trackForced, key);
  807|    895|      break;
  808|    543|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 543, False: 6.62k]
  ------------------
  809|    543|      internalMt = Exiv2::find(trackLacing, key);
  810|    543|      break;
  811|    777|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 777, False: 6.38k]
  ------------------
  812|    777|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|    777|      break;
  814|    558|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 558, False: 6.60k]
  ------------------
  815|    558|      internalMt = Exiv2::find(codecSettings, key);
  816|    558|      break;
  817|     10|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 10, False: 7.15k]
  ------------------
  818|     10|      internalMt = tag;
  819|     10|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 7.16k]
  ------------------
  821|      0|      break;
  822|  7.16k|  }
  823|       |
  824|  7.16k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.89k, False: 5.27k]
  ------------------
  825|  1.89k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.89k|  }
  827|  7.16k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  1.60k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  1.60k|  int64_t duration_in_ms = 0;
  831|  1.60k|  uint64_t value;
  832|  1.60k|  switch (tag->_id) {
  833|    845|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 845, False: 760]
  ------------------
  834|    845|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 288, False: 557]
  ------------------
  835|    288|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    557|      } else {
  837|    557|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    557|      }
  839|    845|      xmpData_[tag->_label] = duration_in_ms;
  840|    845|      break;
  841|     88|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 88, False: 1.51k]
  ------------------
  842|     88|      value = getULongLong(buf, bigEndian);
  843|     88|      if (!value)
  ------------------
  |  Branch (843:11): [True: 18, False: 70]
  ------------------
  844|     18|        return;
  845|     70|      duration_in_ms = value / 1000000000;
  846|     70|      xmpData_[tag->_label] = duration_in_ms;
  847|     70|      break;
  848|       |
  849|    672|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 672, False: 933]
  ------------------
  850|    672|      value = getULongLong(buf, bigEndian);
  851|    672|      if (!value)
  ------------------
  |  Branch (851:11): [True: 471, False: 201]
  ------------------
  852|    471|        return;
  853|    201|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    201|      xmpData_[tag->_label] = time_code_scale_;
  855|    201|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 1.60k]
  ------------------
  857|      0|      break;
  858|  1.60k|  }
  859|  1.60k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  3.70k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  3.70k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  3.70k|  switch (tag->_id) {
  865|  1.31k|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 1.31k, False: 2.38k]
  ------------------
  866|  1.67k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 359, False: 3.34k]
  ------------------
  867|  1.67k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|  1.67k|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 3.70k]
  ------------------
  870|  2.03k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 2.03k, False: 1.67k]
  ------------------
  871|  2.03k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  2.03k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 115, False: 1.91k]
  ------------------
  873|    115|        return;
  874|  1.91k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 1.19k, False: 716]
  ------------------
  875|  1.19k|        double frame_rate = 0;
  876|  1.19k|        switch (stream_) {
  877|    737|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 737, False: 462]
  ------------------
  878|    737|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|    737|            break;
  880|     71|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 71, False: 1.12k]
  ------------------
  881|     71|            frame_rate = static_cast<double>(key) / 1000;
  882|     71|            break;
  883|    391|          default:
  ------------------
  |  Branch (883:11): [True: 391, False: 808]
  ------------------
  884|    391|            break;
  885|  1.19k|        }
  886|  1.19k|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 808, False: 391]
  ------------------
  887|    808|          xmpData_[internalMt->_label] = frame_rate;
  888|  1.19k|      } else
  889|    716|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|  1.91k|    } break;
  891|  1.91k|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 3.70k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  3.70k|  }
  895|  3.70k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   150k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   150k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 121k, False: 29.0k]
  ------------------
  899|   121k|    return 1;
  900|  29.0k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 14.1k, False: 14.8k]
  ------------------
  901|  14.1k|    return 2;
  902|  14.8k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 3.39k, False: 11.4k]
  ------------------
  903|  3.39k|    return 3;
  904|  11.4k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 6.04k, False: 5.40k]
  ------------------
  905|  6.04k|    return 4;
  906|  5.40k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 1.03k, False: 4.37k]
  ------------------
  907|  1.03k|    return 5;
  908|  4.37k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 459, False: 3.91k]
  ------------------
  909|    459|    return 6;
  910|  3.91k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 409, False: 3.50k]
  ------------------
  911|    409|    return 7;
  912|  3.50k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.89k, False: 610]
  ------------------
  913|  2.89k|    return 8;
  914|    610|  return 0;
  915|  3.50k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.31k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.31k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.31k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.31k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.31k|  return image;
  923|  3.31k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  14.3k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  14.3k|  bool result = true;
  927|  14.3k|  byte tmpBuf[4];
  928|  14.3k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  14.3k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 14.3k]
  |  Branch (930:22): [True: 460, False: 13.8k]
  ------------------
  931|    460|    return false;
  932|       |
  933|  13.8k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 3.78k, False: 10.0k]
  |  Branch (933:28): [True: 36, False: 10.0k]
  |  Branch (933:49): [True: 43, False: 9.98k]
  |  Branch (933:70): [True: 39, False: 9.94k]
  ------------------
  934|  3.90k|    result = false;
  935|  3.90k|  }
  936|       |
  937|  13.8k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 13.8k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  13.8k|    iIo.seek(0, BasicIo::beg);
  939|  13.8k|  return result;
  940|  14.3k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   150k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   150k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 149k, False: 610]
  |  Branch (583:23): [True: 149k, False: 0]
  ------------------
  584|       |
  585|   150k|  size_t b0 = buf[0] & (0xff >> size);
  586|   150k|  size_t tag = b0 << ((size - 1) * 8);
  587|   218k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 67.9k, False: 150k]
  ------------------
  588|  67.9k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  67.9k|  }
  590|       |
  591|   150k|  return tag;
  592|   150k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  7.90k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  7.90k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 7.90k, False: 0]
  ------------------
  725|    640|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 640, False: 7.26k]
  ------------------
  726|    640|        return Exiv2::find(videoScanType, key);
  727|    870|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 870, False: 7.03k]
  ------------------
  728|    870|        return Exiv2::find(audioChannels, key);
  729|    400|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 400, False: 7.50k]
  ------------------
  730|    400|        return Exiv2::find(compressionAlgorithm, key);
  731|    986|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 986, False: 6.91k]
  ------------------
  732|    986|        return Exiv2::find(encryptionAlgorithm, key);
  733|    222|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 222, False: 7.67k]
  ------------------
  734|    667|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 445, False: 7.45k]
  ------------------
  735|    667|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    140|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 140, False: 7.76k]
  ------------------
  737|  1.11k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 976, False: 6.92k]
  ------------------
  738|  1.11k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    361|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 361, False: 7.53k]
  ------------------
  740|    361|        return Exiv2::find(encodingType, key);
  741|    715|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 715, False: 7.18k]
  ------------------
  742|    715|        return Exiv2::find(displayUnit, key);
  743|    211|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 211, False: 7.68k]
  ------------------
  744|    211|        return Exiv2::find(aspectRatioType, key);
  745|  1.09k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 1.09k, False: 6.80k]
  ------------------
  746|  1.09k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    601|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 601, False: 7.29k]
  ------------------
  748|    601|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 7.90k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    108|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 108, False: 7.79k]
  ------------------
  752|    108|        return Exiv2::find(codecInfo, key);
  753|     10|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 10, False: 7.89k]
  ------------------
  754|    132|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 122, False: 7.77k]
  ------------------
  755|    132|        return Exiv2::find(codecDownloadUrl, key);
  756|  7.90k|    }
  757|      0|    return nullptr;
  758|  7.90k|  }();

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

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

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

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

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

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

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

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

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

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

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  58.0M|bool Photoshop::isIrb(const byte* pPsData) {
   28|  58.0M|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 58.0M]
  ------------------
   29|      0|    return false;
   30|       |
   31|  58.0M|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 232M, False: 4.58k]
  ------------------
   32|   232M|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 58.0M, False: 174M]
  ------------------
   33|  58.0M|      return true;
   34|       |
   35|  4.58k|  return false;
   36|  58.0M|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  44.0k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  44.0k|  const byte* record = nullptr;
   40|  44.0k|  uint32_t sizeIptc = 0;
   41|  44.0k|  uint32_t sizeHdr = 0;
   42|  44.0k|  const byte* pCur = pPsData;
   43|  44.0k|  const byte* pEnd = pPsData + sizePsData;
   44|  44.0k|  int ret = 0;
   45|  29.0M|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 29.0M, False: 45]
  |  Branch (45:25): [True: 29.0M, False: 44.0k]
  ------------------
   46|  29.0M|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  29.0M|  }
   48|  44.0k|  return ret >= 0;
   49|  44.0k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  29.1M|                         uint32_t& sizeData) {
   56|  29.1M|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 1.44k, False: 29.1M]
  ------------------
   57|  1.44k|    return 3;
   58|  1.44k|  }
   59|       |
   60|       |  // Used for error checking
   61|  29.1M|  size_t position = 0;
   62|       |#ifdef EXIV2_DEBUG_MESSAGES
   63|       |  std::cerr << "Photoshop::locateIrb: ";
   64|       |#endif
   65|       |  // Data should follow Photoshop format, if not exit
   66|  58.0M|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 58.0M, False: 296]
  |  Branch (66:43): [True: 58.0M, False: 4.15k]
  ------------------
   67|  58.0M|    const byte* hrd = pPsData + position;
   68|  58.0M|    position += 4;
   69|  58.0M|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  58.0M|    position += 2;
   71|       |#ifdef EXIV2_DEBUG_MESSAGES
   72|       |    std::cerr << "0x" << std::hex << type << std::dec << " ";
   73|       |#endif
   74|       |    // Pascal string is padded to have an even size (including size byte)
   75|  58.0M|    byte psSize = pPsData[position] + 1;
   76|  58.0M|    psSize += (psSize & 1);
   77|  58.0M|    position += psSize;
   78|  58.0M|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 34.9k, False: 58.0M]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|  34.9k|      return -2;
   84|  34.9k|    }
   85|  58.0M|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  58.0M|    position += 4;
   87|  58.0M|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 4.80k, False: 58.0M]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|  4.80k|      return -2;
   93|  4.80k|    }
   94|       |#ifdef EXIV2_DEBUG_MESSAGES
   95|       |    if ((dataSize & 1) && position + dataSize == sizePsData) {
   96|       |      std::cerr << "Warning: "
   97|       |                << "Photoshop IRB data is not padded to even size\n";
   98|       |    }
   99|       |#endif
  100|  58.0M|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 29.0M, False: 28.9M]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  29.0M|      sizeData = dataSize;
  105|  29.0M|      sizeHdr = psSize + 10;
  106|  29.0M|      *record = hrd;
  107|  29.0M|      return 0;
  108|  29.0M|    }
  109|       |    // Data size is also padded to be even
  110|  28.9M|    position += dataSize + (dataSize & 1);
  111|  28.9M|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  4.45k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 4.40k, False: 54]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  4.40k|    return -2;
  121|  4.40k|  }
  122|     54|  return 3;
  123|  4.45k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  29.1M|                             uint32_t& sizeData) {
  127|  29.1M|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  29.1M|}
_ZN5Exiv29Photoshop10setIptcIrbEPKhmRKNS_8IptcDataE:
  135|    592|DataBuf Photoshop::setIptcIrb(const byte* pPsData, size_t sizePsData, const IptcData& iptcData) {
  136|       |#ifdef EXIV2_DEBUG_MESSAGES
  137|       |  std::cerr << "IRB block at the beginning of Photoshop::setIptcIrb\n";
  138|       |  if (sizePsData == 0)
  139|       |    std::cerr << "  None.\n";
  140|       |  else
  141|       |    hexdump(std::cerr, pPsData, sizePsData);
  142|       |#endif
  143|    592|  const byte* record = pPsData;
  144|    592|  uint32_t sizeIptc = 0;
  145|    592|  uint32_t sizeHdr = 0;
  146|    592|  DataBuf rc;
  147|    592|  if (0 > Photoshop::locateIptcIrb(pPsData, sizePsData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (147:7): [True: 99, False: 493]
  ------------------
  148|     99|    return rc;
  149|     99|  }
  150|       |
  151|    493|  Blob psBlob;
  152|    493|  const auto sizeFront = static_cast<size_t>(record - pPsData);
  153|       |  // Write data before old record.
  154|    493|  if (sizePsData > 0 && sizeFront > 0) {
  ------------------
  |  Branch (154:7): [True: 201, False: 292]
  |  Branch (154:25): [True: 7, False: 194]
  ------------------
  155|      7|    append(psBlob, pPsData, sizeFront);
  156|      7|  }
  157|       |
  158|       |  // Write new iptc record if we have it
  159|    493|  if (DataBuf rawIptc = IptcParser::encode(iptcData); !rawIptc.empty()) {
  ------------------
  |  Branch (159:55): [True: 206, False: 287]
  ------------------
  160|    206|    std::array<byte, 12> tmpBuf;
  161|    206|    std::copy_n(Photoshop::irbId_[0], 4, tmpBuf.begin());
  162|    206|    us2Data(tmpBuf.data() + 4, iptc_, bigEndian);
  163|    206|    tmpBuf[6] = 0;
  164|    206|    tmpBuf[7] = 0;
  165|    206|    ul2Data(tmpBuf.data() + 8, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  166|    206|    append(psBlob, tmpBuf.data(), 12);
  167|    206|    append(psBlob, rawIptc.c_data(), rawIptc.size());
  168|       |    // Data is padded to be even (but not included in size)
  169|    206|    if (rawIptc.size() & 1)
  ------------------
  |  Branch (169:9): [True: 109, False: 97]
  ------------------
  170|    109|      psBlob.push_back(0x00);
  171|    206|  }
  172|       |
  173|       |  // Write existing stuff after record, skip the current and all remaining IPTC blocks
  174|    493|  size_t pos = sizeFront;
  175|    493|  auto nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  176|    493|  Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  177|  17.7k|  while (0 == Photoshop::locateIptcIrb(pPsData + pos, nextSizeData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (177:10): [True: 17.2k, False: 493]
  ------------------
  178|  17.2k|    const auto newPos = static_cast<size_t>(record - pPsData);
  179|  17.2k|    if (newPos > pos) {  // Copy data up to the IPTC IRB
  ------------------
  |  Branch (179:9): [True: 16.6k, False: 563]
  ------------------
  180|  16.6k|      append(psBlob, pPsData + pos, newPos - pos);
  181|  16.6k|    }
  182|  17.2k|    pos = newPos + sizeHdr + sizeIptc + (sizeIptc & 1);  // Skip the IPTC IRB
  183|  17.2k|    nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  184|  17.2k|    Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  185|  17.2k|  }
  186|    493|  if (pos < sizePsData) {
  ------------------
  |  Branch (186:7): [True: 189, False: 304]
  ------------------
  187|    189|    append(psBlob, pPsData + pos, sizePsData - pos);
  188|    189|  }
  189|       |
  190|       |  // Data is rounded to be even
  191|    493|  if (!psBlob.empty())
  ------------------
  |  Branch (191:7): [True: 384, False: 109]
  ------------------
  192|    384|    rc = DataBuf(psBlob.data(), psBlob.size());
  193|       |#ifdef EXIV2_DEBUG_MESSAGES
  194|       |  std::cerr << "IRB block at the end of Photoshop::setIptcIrb\n";
  195|       |  if (rc.empty())
  196|       |    std::cerr << "  None.\n";
  197|       |  else
  198|       |    hexdump(std::cerr, rc.c_data(), rc.size());
  199|       |#endif
  200|    493|  return rc;
  201|    592|}

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|    106|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|    106|  *outWidth = data.read_uint32(0, bigEndian);
   48|    106|  *outHeight = data.read_uint32(4, bigEndian);
   49|    106|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeE:
   51|  8.05k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type) {
   52|  8.05k|  DataBuf key = keyTXTChunk(data);
   53|  8.05k|  DataBuf arr = parseTXTChunk(data, key.size(), type);
   54|       |
   55|       |#ifdef EXIV2_DEBUG_MESSAGES
   56|       |  std::cout << "Exiv2::PngChunk::decodeTXTChunk: TXT chunk data: " << std::string(arr.c_str(), arr.size()) << '\n';
   57|       |#endif
   58|  8.05k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 7.18k, False: 870]
  ------------------
   59|  7.18k|    parseChunkContent(pImage, key.c_data(), key.size(), arr);
   60|  8.05k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  10.8k|DataBuf PngChunk::keyTXTChunk(const DataBuf& data, bool stripHeader) {
   72|       |  // From a tEXt, zTXt, or iTXt chunk, we get the keyword which is null terminated.
   73|  10.8k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 2.83k, False: 8.05k]
  ------------------
   74|  10.8k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 18, False: 10.8k]
  ------------------
   75|     18|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  10.8k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  10.8k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 37, False: 10.8k]
  ------------------
   79|     37|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  10.8k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  10.8k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  7.99k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  7.99k|  DataBuf arr;
   86|       |
   87|  7.99k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 431, False: 7.56k]
  ------------------
   88|    431|    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|    431|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 24, False: 407]
  ------------------
   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|     24|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     24|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    407|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    407|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 70, False: 337]
  ------------------
  104|     70|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|     70|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|     70|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|     70|    }
  109|  7.56k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 3.52k, False: 4.04k]
  ------------------
  110|  3.52k|    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|  3.52k|    size_t textsize = data.size() - keysize - 1;
  115|  3.52k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 2.39k, False: 1.13k]
  ------------------
  116|  2.39k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  2.39k|      arr = DataBuf(text, textsize);
  119|  2.39k|    }
  120|  4.04k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 4.04k, False: 0]
  ------------------
  121|  4.04k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  4.04k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  4.04k|    enforce(nullCount >= nullSeparators, ErrorCode::kerCorruptedMetadata);
  124|       |
  125|       |    // Extract a deflate compressed or uncompressed UTF-8 text chunk
  126|       |
  127|       |    // we get the compression flag after the key
  128|  4.04k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  4.04k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  4.04k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 3.83k, False: 207]
  |  Branch (132:40): [True: 149, False: 58]
  ------------------
  133|  4.04k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 149, False: 3.89k]
  ------------------
  134|    149|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  4.04k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  4.04k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  4.04k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  4.04k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  4.04k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  4.04k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  4.04k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  4.04k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  4.04k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  4.04k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  4.04k|    const auto textsize =
  152|  4.04k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  4.04k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 3.83k, False: 205]
  ------------------
  154|  3.83k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  3.83k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 3.72k, False: 111]
  ------------------
  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|  3.72k|        arr = DataBuf(text, textsize);
  162|  3.72k|      } 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|    111|        zlibUncompress(text, textsize, arr);
  170|    111|      }
  171|  3.83k|    }
  172|  4.04k|  } else {
  173|       |#ifdef DEBUG
  174|       |    std::cerr << "Exiv2::PngChunk::parseTXTChunk: We found a field, not expected though\n";
  175|       |#endif
  176|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  177|      0|  }
  178|       |
  179|  7.97k|  return arr;
  180|  7.99k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufE:
  182|  7.18k|void PngChunk::parseChunkContent(Image* pImage, const byte* key, size_t keySize, const DataBuf& arr) {
  183|       |  // We look if an ImageMagick EXIF raw profile exist.
  184|       |
  185|  7.18k|  if (keySize >= 21 &&
  ------------------
  |  Branch (185:7): [True: 3.24k, False: 3.94k]
  ------------------
  186|  3.24k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (186:8): [True: 40, False: 3.20k]
  |  Branch (186:57): [True: 748, False: 2.45k]
  ------------------
  187|    788|      pImage->exifData().empty()) {
  ------------------
  |  Branch (187:7): [True: 788, False: 0]
  ------------------
  188|    788|    DataBuf exifData = readRawProfile(arr, false);
  189|    788|    size_t length = exifData.size();
  190|       |
  191|    788|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (191:9): [True: 234, False: 554]
  ------------------
  192|       |      // Find the position of TIFF header in bytes array.
  193|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  194|    234|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  195|    234|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  196|    234|      size_t pos = std::numeric_limits<size_t>::max();
  197|       |
  198|       |      /// \todo Find substring inside an string
  199|    470|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (199:26): [True: 236, False: 234]
  ------------------
  200|    236|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (200:13): [True: 0, False: 236]
  ------------------
  201|    236|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (201:13): [True: 0, False: 236]
  ------------------
  202|      0|          pos = i;
  203|      0|          break;
  204|      0|        }
  205|    236|      }
  206|       |
  207|       |      // If found it, store only these data at from this place.
  208|       |
  209|    234|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 234]
  ------------------
  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|    234|      } else {
  217|    234|#ifndef SUPPRESS_WARNINGS
  218|    234|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|    234|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 234]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    234|  LogMsg(LogMsg::warn).os()
  ------------------
  219|    234|#endif
  220|    234|        pImage->exifData().clear();
  221|    234|      }
  222|    234|    }
  223|    788|  }
  224|       |
  225|       |  // We look if an ImageMagick IPTC raw profile exist.
  226|       |
  227|  7.18k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (227:7): [True: 3.20k, False: 3.97k]
  |  Branch (227:24): [True: 938, False: 2.26k]
  |  Branch (227:73): [True: 901, False: 37]
  ------------------
  228|    901|    DataBuf psData = readRawProfile(arr, false);
  229|    901|    if (!psData.empty()) {
  ------------------
  |  Branch (229:9): [True: 145, False: 756]
  ------------------
  230|    145|      Blob iptcBlob;
  231|    145|      const byte* record = nullptr;
  232|    145|      uint32_t sizeIptc = 0;
  233|    145|      uint32_t sizeHdr = 0;
  234|       |
  235|    145|      const byte* pEnd = psData.c_data(psData.size() - 1);
  236|    145|      const byte* pCur = psData.c_data();
  237|    145|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (237:14): [True: 138, False: 7]
  |  Branch (237:29): [True: 0, False: 138]
  ------------------
  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|    145|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (247:11): [True: 0, False: 145]
  |  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|    145|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (254:11): [True: 145, False: 0]
  |  Branch (254:31): [True: 105, False: 40]
  ------------------
  255|    105|#ifndef SUPPRESS_WARNINGS
  256|    105|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|    105|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 105]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    105|  LogMsg(LogMsg::warn).os()
  ------------------
  257|    105|#endif
  258|    105|        pImage->clearIptcData();
  259|    105|      }
  260|    145|    }  // if (psData.size() > 0)
  261|    901|  }
  262|       |
  263|       |  // We look if an ImageMagick XMP raw profile exist.
  264|       |
  265|  7.18k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (265:7): [True: 3.22k, False: 3.96k]
  |  Branch (265:24): [True: 327, False: 2.89k]
  |  Branch (265:72): [True: 326, False: 1]
  ------------------
  266|    326|    DataBuf xmpBuf = readRawProfile(arr, false);
  267|    326|    size_t length = xmpBuf.size();
  268|       |
  269|    326|    if (length > 0) {
  ------------------
  |  Branch (269:9): [True: 33, False: 293]
  ------------------
  270|     33|      std::string& xmpPacket = pImage->xmpPacket();
  271|     33|      xmpPacket.assign(xmpBuf.c_str(), length);
  272|     33|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (272:52): [True: 23, False: 10]
  |  Branch (272:80): [True: 22, False: 1]
  ------------------
  273|     22|#ifndef SUPPRESS_WARNINGS
  274|     22|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     22|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 22]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     22|  LogMsg(LogMsg::warn).os()
  ------------------
  275|     22|#endif
  276|     22|        xmpPacket = xmpPacket.substr(idx);
  277|     22|      }
  278|     33|      if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (278:11): [True: 33, False: 0]
  ------------------
  279|     33|#ifndef SUPPRESS_WARNINGS
  280|     33|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     33|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 33]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     33|  LogMsg(LogMsg::warn).os()
  ------------------
  281|     33|#endif
  282|     33|      }
  283|     33|    }
  284|    326|  }
  285|       |
  286|       |  // We look if an Adobe XMP string exist.
  287|       |
  288|  7.18k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (288:7): [True: 5.32k, False: 1.85k]
  |  Branch (288:24): [True: 828, False: 4.49k]
  |  Branch (288:69): [True: 791, False: 37]
  |  Branch (288:98): [True: 339, False: 452]
  ------------------
  289|    339|    std::string& xmpPacket = pImage->xmpPacket();
  290|    339|    xmpPacket.assign(arr.c_str(), arr.size());
  291|    339|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (291:50): [True: 168, False: 171]
  |  Branch (291:78): [True: 162, False: 6]
  ------------------
  292|    162|#ifndef SUPPRESS_WARNINGS
  293|    162|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    162|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 162]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    162|  LogMsg(LogMsg::warn).os()
  ------------------
  294|      0|                  << "from the beginning of the XMP packet\n";
  295|    162|#endif
  296|    162|      xmpPacket = xmpPacket.substr(idx);
  297|    162|    }
  298|    339|    if (XmpParser::decode(pImage->xmpData(), xmpPacket)) {
  ------------------
  |  Branch (298:9): [True: 318, False: 21]
  ------------------
  299|    318|#ifndef SUPPRESS_WARNINGS
  300|    318|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    318|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 318]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    318|  LogMsg(LogMsg::warn).os()
  ------------------
  301|    318|#endif
  302|    318|    }
  303|    339|  }
  304|       |
  305|       |  // We look if a comments string exist. Note than we use only 'Description' keyword which
  306|       |  // is dedicated to store long comments. 'Comment' keyword is ignored.
  307|       |
  308|  7.18k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (308:7): [True: 5.61k, False: 1.56k]
  |  Branch (308:7): [True: 118, False: 7.06k]
  |  Branch (308:24): [True: 869, False: 4.74k]
  |  Branch (308:63): [True: 118, False: 751]
  ------------------
  309|    118|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  310|    118|  }
  311|       |
  312|  7.18k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk17makeMetadataChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_10MetadataIdE:
  314|    980|std::string PngChunk::makeMetadataChunk(std::string_view metadata, MetadataId type) {
  315|    980|  std::string rawProfile;
  316|       |
  317|    980|  switch (type) {
  ------------------
  |  Branch (317:11): [True: 980, False: 0]
  ------------------
  318|    293|    case mdComment:
  ------------------
  |  Branch (318:5): [True: 293, False: 687]
  ------------------
  319|    293|      return makeUtf8TxtChunk("Description", metadata, true);
  320|     79|    case mdIptc:
  ------------------
  |  Branch (320:5): [True: 79, False: 901]
  ------------------
  321|     79|      rawProfile = writeRawProfile(metadata, "iptc");
  322|     79|      return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
  323|    608|    case mdXmp:
  ------------------
  |  Branch (323:5): [True: 608, False: 372]
  ------------------
  324|    608|      return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
  325|      0|    case mdExif:
  ------------------
  |  Branch (325:5): [True: 0, False: 980]
  ------------------
  326|      0|    case mdIccProfile:
  ------------------
  |  Branch (326:5): [True: 0, False: 980]
  ------------------
  327|      0|    case mdNone:
  ------------------
  |  Branch (327:5): [True: 0, False: 980]
  ------------------
  328|      0|      return {};
  329|    980|  }
  330|       |
  331|      0|  return {};
  332|       |
  333|    980|}  // PngChunk::makeMetadataChunk
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  335|    181|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  336|    181|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  337|    181|  int zlibResult = Z_BUF_ERROR;
  338|    181|  int dos = 0;
  339|       |
  340|    281|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (340:10): [True: 233, False: 48]
  ------------------
  341|    233|    arr.alloc(uncompressedLen);
  342|    233|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  343|    233|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (343:9): [True: 48, False: 185]
  ------------------
  344|     48|      arr.resize(uncompressedLen);
  345|    185|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (345:16): [True: 52, False: 133]
  ------------------
  346|       |      // the uncompressedArray needs to be larger
  347|     52|      uncompressedLen *= 2;
  348|       |      // DoS protection. can't be bigger than 64k
  349|     52|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (349:11): [True: 0, False: 52]
  ------------------
  350|      0|        if (++dos > 1)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|          break;
  352|      0|        uncompressedLen = 131072;
  353|      0|      }
  354|    133|    } else {
  355|       |      // something bad happened
  356|    133|      throw Error(ErrorCode::kerFailedToReadImageData);
  357|    133|    }
  358|    233|  }
  359|       |
  360|     48|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (360:7): [True: 0, False: 48]
  ------------------
  361|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  362|      0|  }
  363|     48|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk12zlibCompressENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  365|    372|std::string PngChunk::zlibCompress(std::string_view text) {
  366|    372|  auto compressedLen = static_cast<uLongf>(text.size() * 2);  // just a starting point
  367|    372|  int zlibResult = Z_BUF_ERROR;
  368|       |
  369|    372|  DataBuf arr;
  370|    837|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (370:10): [True: 465, False: 372]
  ------------------
  371|    465|    arr.resize(compressedLen);
  372|    465|    zlibResult = compress2(arr.data(), &compressedLen, reinterpret_cast<const Bytef*>(text.data()),
  373|    465|                           static_cast<uLong>(text.size()), Z_BEST_COMPRESSION);
  374|       |
  375|    465|    switch (zlibResult) {
  376|    372|      case Z_OK:
  ------------------
  |  Branch (376:7): [True: 372, False: 93]
  ------------------
  377|    372|        arr.resize(compressedLen);
  378|    372|        break;
  379|     93|      case Z_BUF_ERROR:
  ------------------
  |  Branch (379:7): [True: 93, False: 372]
  ------------------
  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|     93|        compressedLen *= 2;
  385|       |        // DoS protection. Cap max compressed size
  386|     93|        if (compressedLen > 131072)
  ------------------
  |  Branch (386:13): [True: 0, False: 93]
  ------------------
  387|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  388|     93|        break;
  389|     93|      default:
  ------------------
  |  Branch (389:7): [True: 0, False: 465]
  ------------------
  390|       |        // Something bad happened
  391|      0|        throw Error(ErrorCode::kerFailedToReadImageData);
  392|    465|    }
  393|    465|  }
  394|       |
  395|    372|  return {arr.c_str(), arr.size()};
  396|       |
  397|    372|}  // PngChunk::zlibCompress
_ZN5Exiv28Internal8PngChunk17makeAsciiTxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  399|     79|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|     79|  auto chunkData = std::string(keyword) + '\0';
  412|     79|  std::string chunkType;
  413|     79|  if (compress) {
  ------------------
  |  Branch (413:7): [True: 79, False: 0]
  ------------------
  414|     79|    chunkData += '\0' + zlibCompress(text);
  415|     79|    chunkType = "zTXt";
  416|     79|  } else {
  417|      0|    chunkData += text;
  418|      0|    chunkType = "tEXt";
  419|      0|  }
  420|       |  // Determine length of the chunk data
  421|     79|  byte length[4];
  422|     79|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  423|       |  // Calculate CRC on chunk type and chunk data
  424|     79|  std::string crcData = chunkType + chunkData;
  425|     79|  uLong tmp = crc32(0L, Z_NULL, 0);
  426|     79|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  427|     79|  byte crc[4];
  428|     79|  ul2Data(crc, tmp, bigEndian);
  429|       |  // Assemble the chunk
  430|     79|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  431|     79|         std::string(reinterpret_cast<const char*>(crc), 4);
  432|       |
  433|     79|}  // PngChunk::makeAsciiTxtChunk
_ZN5Exiv28Internal8PngChunk16makeUtf8TxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  435|    901|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|    901|  auto chunkData = std::string(keyword);
  446|    901|  if (compress) {
  ------------------
  |  Branch (446:7): [True: 293, False: 608]
  ------------------
  447|    293|    static const char flags[] = {0x00, 0x01, 0x00, 0x00, 0x00};
  448|    293|    chunkData += std::string(flags, 5) + zlibCompress(text);
  449|    608|  } else {
  450|    608|    static const char flags[] = {0x00, 0x00, 0x00, 0x00, 0x00};
  451|    608|    chunkData += std::string(flags, 5) + text.data();
  452|    608|  }
  453|       |  // Determine length of the chunk data
  454|    901|  byte length[4];
  455|    901|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  456|       |  // Calculate CRC on chunk type and chunk data
  457|    901|  std::string chunkType = "iTXt";
  458|    901|  std::string crcData = chunkType + chunkData;
  459|    901|  uLong tmp = crc32(0L, Z_NULL, 0);
  460|    901|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  461|    901|  byte crc[4];
  462|    901|  ul2Data(crc, tmp, bigEndian);
  463|       |  // Assemble the chunk
  464|    901|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  465|    901|         std::string(reinterpret_cast<const char*>(crc), 4);
  466|       |
  467|    901|}  // PngChunk::makeUtf8TxtChunk
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  469|  2.01k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  470|  2.01k|  DataBuf info;
  471|  2.01k|  if (text.size() <= 1) {
  ------------------
  |  Branch (471:7): [True: 200, False: 1.81k]
  ------------------
  472|    200|    return info;
  473|    200|  }
  474|       |
  475|  1.81k|  const unsigned char unhex[103] = {
  476|  1.81k|      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.81k|      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.81k|      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.81k|  };
  480|       |
  481|  1.81k|  if (iTXt) {
  ------------------
  |  Branch (481:7): [True: 0, False: 1.81k]
  ------------------
  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.81k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  488|  1.81k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  489|       |
  490|  1.81k|  if (sp >= eot) {
  ------------------
  |  Branch (490:7): [True: 431, False: 1.38k]
  ------------------
  491|    431|    return info;
  492|    431|  }
  493|       |
  494|       |  // Look for newline
  495|  17.5k|  while (*sp != '\n') {
  ------------------
  |  Branch (495:10): [True: 16.4k, False: 1.10k]
  ------------------
  496|  16.4k|    sp++;
  497|  16.4k|    if (sp == eot) {
  ------------------
  |  Branch (497:9): [True: 284, False: 16.1k]
  ------------------
  498|    284|      return info;
  499|    284|    }
  500|  16.4k|  }
  501|  1.10k|  sp++;  // step over '\n'
  502|  1.10k|  if (sp == eot) {
  ------------------
  |  Branch (502:7): [True: 67, False: 1.03k]
  ------------------
  503|     67|    return info;
  504|     67|  }
  505|       |
  506|       |  // Look for length
  507|  4.69k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (507:10): [True: 1.42k, False: 3.26k]
  |  Branch (507:25): [True: 1.00k, False: 2.25k]
  |  Branch (507:39): [True: 1.24k, False: 1.00k]
  ------------------
  508|  3.68k|    sp++;
  509|  3.68k|    if (sp == eot) {
  ------------------
  |  Branch (509:9): [True: 24, False: 3.66k]
  ------------------
  510|     24|      return info;
  511|     24|    }
  512|  3.68k|  }
  513|       |
  514|       |  // Parse the length.
  515|  1.00k|  size_t length = 0;
  516|  3.05k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (516:10): [True: 2.51k, False: 542]
  |  Branch (516:24): [True: 2.05k, False: 456]
  ------------------
  517|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  518|  2.05k|    const size_t newlength = (10 * length) + (*sp - '0');
  519|  2.05k|    length = newlength;
  520|  2.05k|    sp++;
  521|  2.05k|    if (sp == eot) {
  ------------------
  |  Branch (521:9): [True: 11, False: 2.04k]
  ------------------
  522|     11|      return info;
  523|     11|    }
  524|  2.05k|  }
  525|    998|  sp++;  // step over '\n'
  526|    998|  if (sp == eot) {
  ------------------
  |  Branch (526:7): [True: 291, False: 707]
  ------------------
  527|    291|    return info;
  528|    291|  }
  529|       |
  530|    707|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  531|       |
  532|       |  // Allocate space
  533|    707|  if (length == 0) {
  ------------------
  |  Branch (533:7): [True: 77, False: 630]
  ------------------
  534|       |#ifdef EXIV2_DEBUG_MESSAGES
  535|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  536|       |#endif
  537|     77|  }
  538|    707|  info.alloc(length);
  539|    707|  if (info.size() != length) {
  ------------------
  |  Branch (539:7): [True: 0, False: 707]
  ------------------
  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|    707|  if (info.empty())  // Early return
  ------------------
  |  Branch (546:7): [True: 77, False: 630]
  ------------------
  547|     77|    return info;
  548|       |
  549|       |  // Copy profile, skipping white space and column 1 "=" signs
  550|    630|  unsigned char* dp = info.data();  // decode pointer
  551|    630|  size_t nibbles = length * 2;
  552|       |
  553|  8.11k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (553:22): [True: 7.56k, False: 548]
  ------------------
  554|  7.56k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  555|  19.4k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (555:12): [True: 5.96k, False: 13.4k]
  |  Branch (555:26): [True: 8.81k, False: 4.67k]
  |  Branch (555:39): [True: 2.15k, False: 6.65k]
  |  Branch (555:53): [True: 3.87k, False: 7.45k]
  ------------------
  556|  11.9k|      if (*sp == '\0') {
  ------------------
  |  Branch (556:11): [True: 82, False: 11.8k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  559|       |#endif
  560|     82|        return {};
  561|     82|      }
  562|       |
  563|  11.8k|      sp++;
  564|  11.8k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  565|  11.8k|    }
  566|       |
  567|  7.48k|    if (i % 2 == 0)
  ------------------
  |  Branch (567:9): [True: 3.77k, False: 3.71k]
  ------------------
  568|  3.77k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  569|  3.71k|    else
  570|  3.71k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  571|  7.48k|  }
  572|       |
  573|    548|  return info;
  574|       |
  575|    630|}  // PngChunk::readRawProfile
_ZN5Exiv28Internal8PngChunk15writeRawProfileENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKc:
  577|     79|std::string PngChunk::writeRawProfile(std::string_view profileData, const char* profileType) {
  578|     79|  static const byte hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  579|       |
  580|     79|  auto ss = stringFormat("\n{}\n{:08}", profileType, profileData.size());
  ------------------
  |  |   18|     79|#define stringFormat std::format
  ------------------
  581|     79|  auto sp = reinterpret_cast<const byte*>(profileData.data());
  582|   479k|  for (std::string::size_type i = 0; i < profileData.size(); ++i) {
  ------------------
  |  Branch (582:38): [True: 479k, False: 79]
  ------------------
  583|   479k|    if (i % 36 == 0)
  ------------------
  |  Branch (583:9): [True: 13.3k, False: 465k]
  ------------------
  584|  13.3k|      ss += '\n';
  585|   479k|    ss += hex[*sp >> 4 & 0x0fU];
  586|   479k|    ss += hex[*sp++ & 0x0fU];
  587|   479k|  }
  588|     79|  ss += '\n';
  589|     79|  return ss;
  590|       |
  591|     79|}  // PngChunk::writeRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  1.80k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  1.80k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 439, False: 1.36k]
  |  Branch (57:26): [True: 439, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    439|    IoCloser closer(*io_);
   62|    439|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 439]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    439|  }
   68|  1.80k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.36k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.36k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.36k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.36k|  IoCloser closer(*io_);
  400|  1.36k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.36k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.36k|  clearMetadata();
  404|       |
  405|  1.36k|  const size_t imgSize = io_->size();
  406|  1.36k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  22.0k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 21.2k, False: 718]
  ------------------
  409|  21.2k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  21.2k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  21.2k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 275, False: 21.0k]
  ------------------
  414|    275|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    275|    }
  416|       |
  417|  21.0k|    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|  21.0k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 288, False: 20.7k]
  |  Branch (424:32): [True: 2.15k, False: 18.5k]
  |  Branch (424:55): [True: 3.53k, False: 15.0k]
  |  Branch (424:78): [True: 441, False: 14.5k]
  ------------------
  425|  14.5k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 120, False: 14.4k]
  |  Branch (425:32): [True: 4.07k, False: 10.3k]
  |  Branch (425:55): [True: 550, False: 9.84k]
  ------------------
  426|  11.0k|      DataBuf chunkData(chunkLength);
  427|  11.0k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 8.77k, False: 2.29k]
  ------------------
  428|  8.77k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  8.77k|      }
  430|       |
  431|  11.0k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 191, False: 10.8k]
  ------------------
  432|    191|        return;  // Last chunk found: we stop parsing.
  433|    191|      }
  434|  10.8k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 2.15k, False: 8.72k]
  |  Branch (434:34): [True: 106, False: 2.05k]
  ------------------
  435|    106|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  10.7k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 3.53k, False: 7.24k]
  ------------------
  437|  3.53k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  7.24k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 441, False: 6.79k]
  ------------------
  439|    441|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  6.79k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 4.07k, False: 2.72k]
  ------------------
  441|  4.07k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  4.07k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 120, False: 2.60k]
  ------------------
  443|    120|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    120|        setByteOrder(bo);
  445|  2.60k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 550, False: 2.05k]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    550|        uint32_t iccOffset = 0;
  448|  5.42k|        do {
  449|  5.42k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 5.41k, False: 10]
  |  Branch (449:37): [True: 5.41k, False: 4]
  ------------------
  450|  5.42k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 4.87k, False: 550]
  ------------------
  451|       |
  452|    550|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    550|        ++iccOffset;  // +1 = 'compressed' flag
  454|    550|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    550|        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|    550|      }
  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|  10.8k|      chunkLength = 0;
  466|  10.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|  20.8k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  20.8k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 718, False: 20.1k]
  |  Branch (473:25): [True: 183, False: 19.9k]
  ------------------
  474|    183|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    183|    }
  476|  20.8k|  }
  477|  1.36k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  479|    621|void PngImage::writeMetadata() {
  480|    621|  if (io_->open() != 0) {
  ------------------
  |  Branch (480:7): [True: 0, False: 621]
  ------------------
  481|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  482|      0|  }
  483|    621|  IoCloser closer(*io_);
  484|    621|  MemIo tempIo;
  485|       |
  486|    621|  doWriteMetadata(tempIo);  // may throw
  487|    621|  io_->close();
  488|    621|  io_->transfer(tempIo);  // may throw
  489|       |
  490|    621|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  492|    621|void PngImage::doWriteMetadata(BasicIo& outIo) {
  493|    621|  if (!io_->isopen())
  ------------------
  |  Branch (493:7): [True: 0, False: 621]
  ------------------
  494|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  495|    621|  if (!outIo.isopen())
  ------------------
  |  Branch (495:7): [True: 0, False: 621]
  ------------------
  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|    621|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (503:7): [True: 0, False: 621]
  ------------------
  504|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  505|      0|  }
  506|       |
  507|       |  // Write PNG Signature.
  508|    621|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (508:7): [True: 0, False: 621]
  ------------------
  509|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  510|       |
  511|    621|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  512|       |
  513|  9.68k|  while (!io_->eof()) {
  ------------------
  |  Branch (513:10): [True: 9.68k, False: 2]
  ------------------
  514|       |    // Read chunk header.
  515|  9.68k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  516|  9.68k|    if (io_->error())
  ------------------
  |  Branch (516:9): [True: 0, False: 9.68k]
  ------------------
  517|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  518|  9.68k|    if (bufRead != 8)
  ------------------
  |  Branch (518:9): [True: 0, False: 9.68k]
  ------------------
  519|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  520|       |
  521|       |    // Decode chunk data length.
  522|       |
  523|  9.68k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  524|  9.68k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (524:9): [True: 0, False: 9.68k]
  ------------------
  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|  9.68k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  530|  9.68k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  531|  9.68k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  532|  9.68k|    if (io_->error())
  ------------------
  |  Branch (532:9): [True: 0, False: 9.68k]
  ------------------
  533|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  534|  9.68k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (534:9): [True: 67, False: 9.61k]
  ------------------
  535|     67|      throw Error(ErrorCode::kerInputDataReadFailed);
  536|       |
  537|  9.61k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  538|       |
  539|  9.61k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (539:9): [True: 552, False: 9.06k]
  ------------------
  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|    552|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (544:11): [True: 0, False: 552]
  ------------------
  545|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  546|    552|      return;
  547|    552|    }
  548|  9.06k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (548:9): [True: 75, False: 8.98k]
  |  Branch (548:30): [True: 105, False: 8.88k]
  ------------------
  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|  8.88k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (555:16): [True: 1.51k, False: 7.36k]
  ------------------
  556|       |#ifdef EXIV2_DEBUG_MESSAGES
  557|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  558|       |#endif
  559|  1.51k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (559:11): [True: 0, False: 1.51k]
  ------------------
  560|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  561|       |
  562|       |      // Write all updated metadata here, just after IHDR.
  563|  1.51k|      if (!comment_.empty()) {
  ------------------
  |  Branch (563:11): [True: 293, False: 1.22k]
  ------------------
  564|       |        // Update Comment data to a new PNG chunk
  565|    293|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  566|    293|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (566:13): [True: 0, False: 293]
  ------------------
  567|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  568|      0|        }
  569|    293|      }
  570|       |
  571|  1.51k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (571:11): [True: 266, False: 1.25k]
  ------------------
  572|       |        // Update Exif data to a new PNG chunk
  573|    266|        Blob blob;
  574|    266|        ExifParser::encode(blob, littleEndian, exifData_);
  575|    266|        if (!blob.empty()) {
  ------------------
  |  Branch (575:13): [True: 245, False: 21]
  ------------------
  576|    245|          byte length[4];
  577|    245|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  578|       |
  579|       |          // calculate CRC
  580|    245|          uLong tmp = crc32(0L, Z_NULL, 0);
  581|    245|          tmp = crc32(tmp, typeExif, 4);
  582|    245|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  583|    245|          byte crc[4];
  584|    245|          ul2Data(crc, tmp, bigEndian);
  585|       |
  586|    245|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (586:15): [True: 0, False: 245]
  |  Branch (586:46): [True: 0, False: 245]
  ------------------
  587|    245|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (587:15): [True: 0, False: 245]
  |  Branch (587:71): [True: 0, False: 245]
  ------------------
  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|    245|        }
  595|    266|      }
  596|       |
  597|  1.51k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (597:11): [True: 79, False: 1.43k]
  ------------------
  598|       |        // Update IPTC data to a new PNG chunk
  599|     79|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  600|     79|        if (!newPsData.empty()) {
  ------------------
  |  Branch (600:13): [True: 79, False: 0]
  ------------------
  601|     79|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  602|     79|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  603|     79|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (603:15): [True: 0, False: 79]
  ------------------
  604|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  605|      0|          }
  606|     79|        }
  607|     79|      }
  608|       |
  609|  1.51k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (609:11): [True: 195, False: 1.32k]
  ------------------
  610|    195|        DataBuf compressed;
  611|    195|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  612|    195|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (612:13): [True: 195, False: 0]
  ------------------
  613|    195|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  614|    195|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  615|    195|          byte length[4];
  616|    195|          ul2Data(length, chunkLength, bigEndian);
  617|       |
  618|       |          // calculate CRC
  619|    195|          uLong tmp = crc32(0L, Z_NULL, 0);
  620|    195|          tmp = crc32(tmp, typeICCP, 4);
  621|    195|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  622|    195|          tmp = crc32(tmp, nullComp, 2);
  623|    195|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  624|    195|          byte crc[4];
  625|    195|          ul2Data(crc, tmp, bigEndian);
  626|       |
  627|    195|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (627:15): [True: 0, False: 195]
  |  Branch (627:46): [True: 0, False: 195]
  ------------------
  628|    195|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (628:15): [True: 0, False: 195]
  ------------------
  629|    195|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (629:15): [True: 0, False: 195]
  ------------------
  630|    195|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (630:15): [True: 0, False: 195]
  |  Branch (630:91): [True: 0, False: 195]
  ------------------
  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|    195|        }
  638|    195|      }
  639|       |
  640|  1.51k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (640:11): [True: 1.51k, False: 2]
  |  Branch (640:36): [True: 41, False: 1.47k]
  ------------------
  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|  1.51k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (645:11): [True: 608, False: 910]
  ------------------
  646|       |        // Update XMP data to a new PNG chunk
  647|    608|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  648|    608|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (648:13): [True: 0, False: 608]
  ------------------
  649|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  650|      0|        }
  651|    608|      }
  652|  7.36k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (652:16): [True: 2.11k, False: 5.24k]
  |  Branch (652:37): [True: 100, False: 5.14k]
  |  Branch (652:58): [True: 619, False: 4.52k]
  ------------------
  653|  2.83k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  654|  2.83k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (654:11): [True: 2.65k, False: 184]
  |  Branch (654:28): [True: 21, False: 2.63k]
  |  Branch (654:69): [True: 327, False: 2.30k]
  ------------------
  655|  2.30k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (655:28): [True: 293, False: 2.01k]
  |  Branch (655:69): [True: 51, False: 1.96k]
  ------------------
  656|  1.96k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (656:28): [True: 423, False: 1.53k]
  |  Branch (656:65): [True: 326, False: 1.21k]
  ------------------
  657|       |#ifdef EXIV2_DEBUG_MESSAGES
  658|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  659|       |                  << '\n';
  660|       |#endif
  661|  1.44k|      } else {
  662|       |#ifdef EXIV2_DEBUG_MESSAGES
  663|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  664|       |                  << '\n';
  665|       |#endif
  666|  1.39k|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (666:13): [True: 0, False: 1.39k]
  ------------------
  667|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  668|  1.39k|      }
  669|  4.52k|    } 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|  4.52k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (675:11): [True: 0, False: 4.52k]
  ------------------
  676|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  677|  4.52k|    }
  678|  9.06k|  }
  679|       |
  680|    621|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  684|  1.80k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  685|  1.80k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  686|  1.80k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.80k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.80k|  return image;
  690|  1.80k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  30.1k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  30.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 30.1k]
  |  Branch (693:22): [True: 233, False: 29.9k]
  ------------------
  694|    233|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    233|  }
  696|  29.9k|  const int32_t len = 8;
  697|  29.9k|  std::array<byte, len> buf;
  698|  29.9k|  iIo.read(buf.data(), len);
  699|  29.9k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 29.9k]
  |  Branch (699:22): [True: 0, False: 29.9k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  29.9k|  bool rc = buf == pngSignature;
  703|  29.9k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 27.9k, False: 1.98k]
  |  Branch (703:19): [True: 0, False: 1.98k]
  ------------------
  704|  27.9k|    iIo.seek(-len, BasicIo::cur);
  705|  27.9k|  }
  706|       |
  707|  29.9k|  return rc;
  708|  29.9k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    531|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    531|  uLongf uncompressedLen = length;  // just a starting point
   76|    531|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.28k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 756, False: 531]
  ------------------
   79|    756|    result.alloc(uncompressedLen);
   80|    756|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    756|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 23, False: 733]
  |  Branch (82:31): [True: 10, False: 13]
  ------------------
   83|     10|      result.reset();
   84|       |
   85|     10|      result.alloc(uncompressedLen);
   86|     10|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|     10|    }
   88|    756|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 225, False: 531]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    225|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    225|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 225]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    225|      else
   96|    225|        uncompressedLen *= 2;
   97|    225|    }
   98|    756|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    531|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  30.0k|static void readChunk(DataBuf& buffer, BasicIo& io) {
  380|       |#ifdef EXIV2_DEBUG_MESSAGES
  381|       |  std::cout << "Exiv2::PngImage::readMetadata: Position: " << io.tell() << '\n';
  382|       |#endif
  383|  30.0k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  30.0k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 30.0k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  30.0k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 97, False: 29.9k]
  ------------------
  388|     97|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     97|  }
  390|  30.0k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    195|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    195|  uLongf compressedLen = length;  // just a starting point
  105|    195|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|  1.03k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 843, False: 195]
  ------------------
  108|    843|    result.alloc(compressedLen);
  109|    843|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    843|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 648, False: 195]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|    648|      result.reset();
  113|    648|      compressedLen *= 2;
  114|    648|    } else {
  115|    195|      result.reset();
  116|    195|      result.alloc(compressedLen);
  117|    195|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    195|    }
  119|    843|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    195|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  13.1k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  13.1k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  13.1k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  13.1k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|  1.78k|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|  1.78k|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|  1.78k|const byte* PreviewImage::pData() const {
 1018|  1.78k|  return preview_.c_data();
 1019|  1.78k|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|  1.78k|uint32_t PreviewImage::size() const {
 1022|  1.78k|  return static_cast<uint32_t>(preview_.size());
 1023|  1.78k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  8.17k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  8.17k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  8.17k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  8.17k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   284k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 276k, False: 8.17k]
  ------------------
 1052|   276k|    auto loader = Loader::create(id, image_);
 1053|   276k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 17.4k, False: 258k]
  |  Branch (1053:19): [True: 9.78k, False: 7.64k]
  ------------------
 1054|  9.78k|      PreviewProperties props = loader->getProperties();
 1055|  9.78k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  9.78k|      props.size_ = buf.size();         //     update the size
 1057|  9.78k|      list.push_back(std::move(props));
 1058|  9.78k|    }
 1059|   276k|  }
 1060|  8.17k|  std::sort(list.begin(), list.end(),
 1061|  8.17k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  8.17k|  return list;
 1064|  8.17k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|  1.78k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|  1.78k|  auto loader = Loader::create(properties.id_, image_);
 1068|  1.78k|  DataBuf buf;
 1069|  1.78k|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 1.78k, False: 0]
  ------------------
 1070|  1.78k|    buf = loader->getData();
 1071|  1.78k|  }
 1072|       |
 1073|  1.78k|  return {properties, std::move(buf)};
 1074|  1.78k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|   562k|PreviewId Loader::getNumLoaders() {
  351|   562k|  return PreviewId{std::size(loaderList_)};
  352|   562k|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  32.6k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  32.6k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  32.6k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  32.6k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  32.6k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 32.6k]
  |  Branch (355:21): [True: 32.6k, False: 0]
  ------------------
  356|  32.6k|    return;
  357|      0|  nativePreview_ = image.nativePreviews()[parIdx];
  358|      0|  width_ = nativePreview_.width_;
  359|      0|  height_ = nativePreview_.height_;
  360|      0|  valid_ = true;
  361|      0|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (361:7): [True: 0, False: 0]
  ------------------
  362|      0|    size_ = nativePreview_.size_;
  363|      0|  } else {
  364|      0|    size_ = getData().size();
  365|      0|  }
  366|      0|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  343|   261k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   261k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  9.78k|PreviewProperties Loader::getProperties() const {
  347|  9.78k|  return {"", "", size_, width_, height_, id_};
  348|  9.78k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  2.11k|  virtual bool readDimensions() {
   78|  2.11k|    return true;
   79|  2.11k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   261k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   286k|  [[nodiscard]] virtual bool valid() const {
   67|   286k|    return valid_;
   68|   286k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|  98.1k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|  98.1k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|  98.1k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|  98.1k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|  98.1k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 277, False: 97.8k]
  ------------------
  557|    277|    size_ = pos->sizeDataArea();  // indirect data
  558|    277|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 277, False: 0]
  |  Branch (558:23): [True: 205, False: 72]
  ------------------
  559|    205|      size_ = pos->size();  // direct data
  560|    277|  }
  561|       |
  562|  98.1k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 97.9k, False: 204]
  ------------------
  563|  97.9k|    return;
  564|       |
  565|    204|  valid_ = true;
  566|    204|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|     80|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|     80|  PreviewProperties prop = Loader::getProperties();
  574|     80|  prop.mimeType_ = "image/jpeg";
  575|     80|  prop.extension_ = ".jpg";
  576|     80|  return prop;
  577|     80|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|    284|DataBuf LoaderExifDataJpeg::getData() const {
  580|    284|  DataBuf buf;
  581|       |
  582|    284|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 284]
  ------------------
  583|      0|    return buf;
  584|       |
  585|    284|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 284, False: 0]
  ------------------
  586|    284|    buf = pos->dataArea();  // indirect data
  587|       |
  588|    284|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 284, False: 0]
  ------------------
  589|    284|      buf = DataBuf(pos->size());
  590|    284|      pos->copy(buf.data(), invalidByteOrder);
  591|    284|    }
  592|       |
  593|    284|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|    284|    return buf;
  595|    284|  }
  596|       |
  597|      0|  return buf;
  598|    284|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  600|    130|bool LoaderExifDataJpeg::readDimensions() {
  601|    130|  if (!valid())
  ------------------
  |  Branch (601:7): [True: 0, False: 130]
  ------------------
  602|      0|    return false;
  603|       |
  604|    130|  DataBuf buf = getData();
  605|    130|  if (buf.empty())
  ------------------
  |  Branch (605:7): [True: 0, False: 130]
  ------------------
  606|      0|    return false;
  607|       |
  608|    130|  try {
  609|    130|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  610|    130|    if (!image)
  ------------------
  |  Branch (610:9): [True: 0, False: 130]
  ------------------
  611|      0|      return false;
  612|    130|    image->readMetadata();
  613|       |
  614|    130|    width_ = image->pixelWidth();
  615|    130|    height_ = image->pixelHeight();
  616|    130|  } catch (const Error& /* error */) {
  617|     50|    return false;
  618|     50|  }
  619|       |
  620|     80|  return true;
  621|    130|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|  56.9k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|  56.9k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|  56.9k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|  56.9k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|  56.9k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|  56.9k|  size_t offsetCount = 0;
  628|  56.9k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|  56.9k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 48.8k, False: 8.07k]
  ------------------
  632|  48.8k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|  48.8k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 45.5k, False: 3.37k]
  ------------------
  634|  45.5k|      return;
  635|  3.37k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 3.37k, False: 0]
  |  Branch (635:9): [True: 480, False: 2.89k]
  |  Branch (635:39): [True: 480, False: 2.89k]
  ------------------
  636|    480|      return;
  637|  3.37k|  }
  638|       |
  639|  10.9k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  10.9k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 2.68k, False: 8.27k]
  ------------------
  641|  2.68k|    offsetTag_ = "StripOffsets";
  642|  2.68k|    sizeTag_ = "StripByteCounts";
  643|  2.68k|    offsetCount = pos->value().count();
  644|  8.27k|  } else {
  645|  8.27k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  8.27k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 8.14k, False: 135]
  ------------------
  647|  8.14k|      return;
  648|    135|    offsetTag_ = "TileOffsets";
  649|    135|    sizeTag_ = "TileByteCounts";
  650|    135|    offsetCount = pos->value().count();
  651|    135|  }
  652|       |
  653|  2.82k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  2.82k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 94, False: 2.73k]
  ------------------
  655|     94|    return;
  656|  2.73k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 38, False: 2.69k]
  ------------------
  657|     38|    return;
  658|  16.1k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 13.4k, False: 2.69k]
  ------------------
  659|  13.4k|    size_ += pos->toUint32(i);
  660|  13.4k|  }
  661|       |
  662|  2.69k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 73, False: 2.61k]
  ------------------
  663|     73|    return;
  664|       |
  665|  2.61k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  2.61k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 2.56k, False: 56]
  |  Branch (666:7): [True: 2.39k, False: 223]
  |  Branch (666:32): [True: 2.39k, False: 167]
  ------------------
  667|  2.39k|    width_ = pos->toUint32();
  668|  2.39k|  }
  669|       |
  670|  2.61k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  2.61k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 2.50k, False: 116]
  |  Branch (671:7): [True: 2.40k, False: 212]
  |  Branch (671:32): [True: 2.40k, False: 96]
  ------------------
  672|  2.40k|    height_ = pos->toUint32();
  673|  2.40k|  }
  674|       |
  675|  2.61k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 234, False: 2.38k]
  |  Branch (675:22): [True: 154, False: 2.23k]
  ------------------
  676|    388|    return;
  677|       |
  678|  2.23k|  valid_ = true;
  679|  2.23k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  2.11k|PreviewProperties LoaderTiff::getProperties() const {
  686|  2.11k|  PreviewProperties prop = Loader::getProperties();
  687|  2.11k|  prop.mimeType_ = "image/tiff";
  688|  2.11k|  prop.extension_ = ".tif";
  689|  2.11k|  return prop;
  690|  2.11k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  2.23k|DataBuf LoaderTiff::getData() const {
  693|  2.23k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  2.23k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   388k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 388k, False: 2.23k]
  ------------------
  699|   388k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 90.6k, False: 298k]
  ------------------
  700|       |      /*
  701|       |         Write only the necessary TIFF image tags
  702|       |         tags that especially could cause problems are:
  703|       |         "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
  704|       |         "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
  705|       |                         consistent result for all previews, including JPEG
  706|       |      */
  707|  90.6k|      uint16_t tag = pos.tag();
  708|  90.6k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 88.2k, False: 2.38k]
  |  Branch (708:28): [True: 87.5k, False: 700]
  |  Branch (708:45): [True: 33.5k, False: 54.0k]
  ------------------
  709|  33.5k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|  33.5k|      }
  711|  90.6k|    }
  712|   388k|  }
  713|       |
  714|  2.23k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  2.23k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 2.23k, False: 0]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  2.23k|    BasicIo& io = image_.io();
  719|       |
  720|  2.23k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 2.23k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  2.23k|    IoCloser closer(io);
  724|       |
  725|  2.23k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  2.23k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  2.23k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 2.23k, False: 0]
  ------------------
  730|  2.23k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 1.98k, False: 243]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  1.98k|        uint32_t offset = dataValue.toUint32(0);
  733|  1.98k|        uint32_t size = sizes.toUint32(0);
  734|  1.98k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 343, False: 1.64k]
  ------------------
  735|    343|          dataValue.setDataArea(base + offset, size);
  736|  1.98k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    243|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    243|        DataBuf buf(size_);
  740|    243|        uint32_t idxBuf = 0;
  741|  5.49k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 5.25k, False: 243]
  ------------------
  742|  5.25k|          uint32_t offset = dataValue.toUint32(i);
  743|  5.25k|          uint32_t size = sizes.toUint32(i);
  744|       |
  745|       |          // the size_ parameter is originally computed by summing all values inside sizes
  746|       |          // see the constructor of LoaderTiff
  747|       |          // But e.g in malicious files some of these values could be negative
  748|       |          // That's why we check again for each step here to really make sure we don't overstep
  749|  5.25k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  5.25k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 2.29k, False: 2.95k]
  |  Branch (750:28): [True: 959, False: 1.33k]
  ------------------
  751|    959|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|    959|          }
  753|       |
  754|  5.25k|          idxBuf += size;
  755|  5.25k|        }
  756|    243|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    243|      }
  758|  2.23k|    }
  759|  2.23k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  2.23k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 0, False: 2.23k]
  |  Branch (762:7): [True: 0, False: 2.23k]
  |  Branch (762:40): [True: 0, False: 0]
  ------------------
  763|      0|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  764|      0|  }
  765|       |
  766|       |  // write new image
  767|  2.23k|  MemIo mio;
  768|  2.23k|  IptcData emptyIptc;
  769|  2.23k|  XmpData emptyXmp;
  770|  2.23k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  2.23k|  return {mio.mmap(), mio.size()};
  772|  2.23k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|  66.1k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|  66.1k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|  66.1k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|  66.1k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|  66.1k|  const ExifData& exifData = image_.exifData();
  469|  66.1k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|  66.1k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 18.0k, False: 48.0k]
  |  Branch (470:7): [True: 17.4k, False: 48.6k]
  |  Branch (470:32): [True: 17.4k, False: 590]
  ------------------
  471|  17.4k|    offset_ = pos->toUint32();
  472|  17.4k|  }
  473|       |
  474|  66.1k|  size_ = 0;
  475|  66.1k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|  66.1k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 18.5k, False: 47.6k]
  |  Branch (476:7): [True: 17.3k, False: 48.7k]
  |  Branch (476:32): [True: 17.3k, False: 1.16k]
  ------------------
  477|  17.3k|    size_ = pos->toUint32();
  478|  17.3k|  }
  479|       |
  480|  66.1k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 48.7k, False: 17.4k]
  |  Branch (480:23): [True: 388, False: 17.0k]
  ------------------
  481|  49.1k|    return;
  482|       |
  483|  17.0k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 0, False: 17.0k]
  ------------------
  484|      0|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  485|      0|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (485:9): [True: 0, False: 0]
  |  Branch (485:9): [True: 0, False: 0]
  |  Branch (485:34): [True: 0, False: 0]
  ------------------
  486|      0|      offset_ += pos->toUint32();
  487|      0|    }
  488|      0|  }
  489|       |
  490|  17.0k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 233, False: 16.7k]
  ------------------
  491|    233|    return;
  492|       |
  493|  16.7k|  valid_ = true;
  494|  16.7k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  7.58k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  7.58k|  PreviewProperties prop = Loader::getProperties();
  502|  7.58k|  prop.mimeType_ = "image/jpeg";
  503|  7.58k|  prop.extension_ = ".jpg";
  504|  7.58k|  return prop;
  505|  7.58k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  9.18k|DataBuf LoaderExifJpeg::getData() const {
  508|  9.18k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 9.18k]
  ------------------
  509|      0|    return {};
  510|  9.18k|  BasicIo& io = image_.io();
  511|       |
  512|  9.18k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 9.18k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  9.18k|  IoCloser closer(io);
  516|       |
  517|  9.18k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  9.18k|  return {base + offset_, size_};
  520|  9.18k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  15.1k|bool LoaderExifJpeg::readDimensions() {
  523|  15.1k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 15.1k]
  ------------------
  524|      0|    return false;
  525|  15.1k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 15.1k]
  |  Branch (525:17): [True: 0, False: 15.1k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  15.1k|  BasicIo& io = image_.io();
  529|       |
  530|  15.1k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 15.1k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  15.1k|  IoCloser closer(io);
  534|  15.1k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  15.1k|  try {
  537|  15.1k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  15.1k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 15.1k]
  ------------------
  539|      0|      return false;
  540|  15.1k|    image->readMetadata();
  541|       |
  542|  15.1k|    width_ = image->pixelWidth();
  543|  15.1k|    height_ = image->pixelHeight();
  544|  15.1k|  } catch (const Error& /* error */) {
  545|  7.58k|#ifndef SUPPRESS_WARNINGS
  546|  7.58k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  7.58k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.58k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.58k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  7.58k|#endif
  548|  7.58k|    return false;
  549|  7.58k|  }
  550|       |
  551|  7.58k|  return true;
  552|  15.1k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  8.06k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  8.06k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  8.06k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  8.06k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  8.06k|  (void)parIdx;
  776|       |
  777|  8.06k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  8.06k|  std::string prefix = "xmpGImg";
  780|  8.06k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 0, False: 8.06k]
  ------------------
  781|      0|    prefix = "xapGImg";
  782|      0|  }
  783|       |
  784|  8.06k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  8.06k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 8.06k, False: 0]
  ------------------
  786|  8.06k|    return;
  787|      0|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  788|      0|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (788:7): [True: 0, False: 0]
  ------------------
  789|      0|    return;
  790|      0|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  791|      0|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (791:7): [True: 0, False: 0]
  ------------------
  792|      0|    return;
  793|      0|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  794|      0|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (794:7): [True: 0, False: 0]
  ------------------
  795|      0|    return;
  796|       |
  797|      0|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (797:7): [True: 0, False: 0]
  ------------------
  798|      0|    return;
  799|       |
  800|      0|  width_ = widthDatum->toUint32();
  801|      0|  height_ = heightDatum->toUint32();
  802|      0|  preview_ = decodeBase64(imageDatum->toString());
  803|      0|  size_ = preview_.size();
  804|      0|  valid_ = true;
  805|      0|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  328|   278k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   278k|  Loader::UniquePtr loader;
  330|   278k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 278k]
  |  Branch (330:17): [True: 0, False: 278k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   278k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 24.3k, False: 253k]
  |  Branch (333:7): [True: 16.1k, False: 261k]
  |  Branch (333:41): [True: 16.1k, False: 8.24k]
  ------------------
  334|  16.1k|    return loader;
  335|       |
  336|   261k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   261k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 242k, False: 19.2k]
  ------------------
  338|   242k|    loader = nullptr;
  339|       |
  340|   261k|  return loader;
  341|   278k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  7.64k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  2.55M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  2.55M|  return ns_ == ns.ns_;
 4941|  2.55M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  88.9M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  88.9M|  return prefix_ == prefix.prefix_;
 4945|  88.9M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.34M|std::mutex& XmpProperties::getMutex() {
 4953|  2.34M|  static std::mutex m;
 4954|  2.34M|  return m;
 4955|  2.34M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.55M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  58.3M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 58.3M, False: 2.52M]
  ------------------
 4965|  58.3M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 21.4k, False: 58.3M]
  ------------------
 4966|  21.4k|      return &p;
 4967|  58.3M|  }
 4968|  2.52M|  return nullptr;
 4969|  2.55M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     30|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     30|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 30]
  ------------------
 4978|      0|    return;
 4979|     30|  std::string ns2 = ns;
 4980|     30|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 8, False: 22]
  |  Branch (4980:28): [True: 8, False: 0]
  ------------------
 4981|      8|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     30|  auto it = nsRegistry_.find(ns2);
 4985|     30|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 30]
  |  Branch (4985:7): [True: 0, False: 30]
  |  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|     30|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 30]
  ------------------
 4991|      0|#ifndef SUPPRESS_WARNINGS
 4992|      0|    if (ns2 != xnp->ns_)
  ------------------
  |  Branch (4992:9): [True: 0, False: 0]
  ------------------
 4993|      0|      EXV_WARNING << "Updating namespace URI for " << prefix << " from " << xnp->ns_ << " to " << ns2 << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 4994|      0|#endif
 4995|      0|    unregisterNsUnlocked(xnp->ns_, lock);
 4996|      0|  }
 4997|       |
 4998|       |  // 3. Ensure the URI is unregistered if it's currently used with a different prefix
 4999|       |  // (This handles the case where prefix changed for the same URI, preventing memory leak)
 5000|     30|  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|     30|  XmpNsInfo xn;
 5005|     30|  auto c = new char[ns2.size() + 1];
 5006|     30|  std::strcpy(c, ns2.c_str());
 5007|     30|  xn.ns_ = c;
 5008|     30|  c = new char[prefix.size() + 1];
 5009|     30|  std::strcpy(c, prefix.c_str());
 5010|     30|  xn.prefix_ = c;
 5011|     30|  xn.xmpPropertyInfo_ = nullptr;
 5012|     30|  xn.desc_ = "";
 5013|     30|  nsRegistry_[ns2] = xn;
 5014|     30|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     30|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     30|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     30|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     60|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     60|  auto i = nsRegistry_.find(ns);
 5027|     60|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 30, False: 30]
  ------------------
 5028|     30|    delete[] i->second.prefix_;
 5029|     30|    delete[] i->second.ns_;
 5030|     30|    nsRegistry_.erase(i);
 5031|     30|  }
 5032|     60|}
_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|     31|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 30, False: 1]
  ------------------
 5046|     30|    auto kill = i++;
 5047|     30|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     30|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   122k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   122k|  std::string ns2 = ns;
 5058|   122k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 23.7k, False: 98.6k]
  |  Branch (5058:28): [True: 15.6k, False: 8.10k]
  ------------------
 5059|  15.6k|    ns2 += '/';
 5060|       |
 5061|   122k|  auto i = nsRegistry_.find(ns2);
 5062|   122k|  std::string p;
 5063|   122k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 3.07k, False: 119k]
  ------------------
 5064|  3.07k|    p = i->second.prefix_;
 5065|   119k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 74.9k, False: 44.3k]
  ------------------
 5066|  74.9k|    p = std::string(xn->prefix_);
 5067|   122k|  return p;
 5068|   122k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.25M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.25M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 17.5k, False: 1.23M]
  ------------------
 5077|  17.5k|    return xn->ns_;
 5078|  1.23M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.25M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  8.18k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  8.18k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  8.18k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 3.84k, False: 4.34k]
  |  Branch (5083:59): [True: 4.31k, False: 30]
  ------------------
 5084|  8.18k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  46.8k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  46.8k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  46.8k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 45.3k, False: 1.50k]
  ------------------
 5114|  46.8k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  46.8k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  46.8k|  std::string prefix = key.groupName();
 5123|  46.8k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  46.8k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 46.8k]
  ------------------
 5126|      0|    i = std::distance(property.begin(), std::find_if(property.begin() + i, property.end(), isalpha));
 5127|      0|    property = property.substr(i);
 5128|      0|    i = property.find_first_of(':');
 5129|      0|    if (i != std::string::npos) {
  ------------------
  |  Branch (5129:9): [True: 0, False: 0]
  ------------------
 5130|      0|      prefix = property.substr(0, i);
 5131|      0|      property = property.substr(i + 1);
 5132|      0|    }
 5133|       |#ifdef EXIV2_DEBUG_MESSAGES
 5134|       |    std::cout << "Nested key: " << key.key() << ", prefix: " << prefix << ", property: " << property << "\n";
 5135|       |#endif
 5136|      0|  }
 5137|  46.8k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 46.8k, False: 0]
  ------------------
 5138|  6.04M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 6.04M, False: 1.50k]
  ------------------
 5139|  6.04M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 45.3k, False: 5.99M]
  ------------------
 5140|  45.3k|        return pl + j;
 5141|  45.3k|      }
 5142|  6.04M|    }
 5143|  46.8k|  }
 5144|  1.50k|  return nullptr;
 5145|  46.8k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  46.8k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  46.8k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  46.8k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.28M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.28M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.28M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.28M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.28M, False: 0]
  ------------------
 5175|  1.28M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.28M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 52, False: 1.28M]
  ------------------
 5177|     52|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.28M|  return xn;
 5179|  1.28M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   112k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   112k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 112k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   112k|  property_ = property;
 5256|   112k|  prefix_ = prefix;
 5257|   112k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   340k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   340k|  p_->decomposeKey(key);
 5261|   340k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   803k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   803k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   803k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   112k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   112k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.65M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   399k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   399k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   399k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   399k|  return UniquePtr(clone_());
 5288|   399k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   399k|XmpKey* XmpKey::clone_() const {
 5291|   399k|  return new XmpKey(*this);
 5292|   399k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  14.0M|std::string XmpKey::key() const {
 5295|  14.0M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  14.0M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|   149k|std::string XmpKey::groupName() const {
 5303|   149k|  return p_->prefix_;
 5304|   149k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|   322k|std::string XmpKey::tagName() const {
 5307|   322k|  return p_->property_;
 5308|   322k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5336|   340k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5337|   340k|  XmpProperties::XmpLock lock;
 5338|   340k|  decomposeKeyUnlocked(key, lock);
 5339|   340k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5341|  1.14M|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5342|       |  // Get the family name, prefix and property name parts of the key
 5343|  1.14M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5343:7): [True: 240, False: 1.14M]
  ------------------
 5344|    240|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|  1.14M|  std::string::size_type pos1 = key.find('.');
 5346|  1.14M|  std::string::size_type pos0 = pos1 + 1;
 5347|  1.14M|  pos1 = key.find('.', pos0);
 5348|  1.14M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5348:7): [True: 0, False: 1.14M]
  ------------------
 5349|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5350|  1.14M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5351|  1.14M|  if (prefix.empty())
  ------------------
  |  Branch (5351:7): [True: 0, False: 1.14M]
  ------------------
 5352|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5353|  1.14M|  std::string property = key.substr(pos1 + 1);
 5354|  1.14M|  if (property.empty())
  ------------------
  |  Branch (5354:7): [True: 0, False: 1.14M]
  ------------------
 5355|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5356|       |
 5357|       |  // Validate prefix unlocked (must hold lock)
 5358|  1.14M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5358:7): [True: 0, False: 1.14M]
  ------------------
 5359|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5360|       |
 5361|  1.14M|  property_ = std::move(property);
 5362|  1.14M|  prefix_ = std::move(prefix);
 5363|  1.14M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|  1.14M|  Impl() = default;                                                                             //!< Default constructor

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  3.80k|    Image(ImageType::qtime, mdNone, std::move(io), params),
  541|  3.80k|    mvhdTimeScale_(1),
  542|  3.80k|    mdhdTimeScale_(1),
  543|  3.80k|    currentStream_(Null),
  544|  3.80k|    max_recursion_depth_(params.max_recursion_depth()) {
  545|  3.80k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  3.79k|std::string QuickTimeVideo::mimeType() const {
  548|  3.79k|  return "video/quicktime";
  549|  3.79k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  551|    246|void QuickTimeVideo::writeMetadata() {
  552|    246|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  3.79k|void QuickTimeVideo::readMetadata() {
  555|  3.79k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.79k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  3.79k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 3.79k]
  ------------------
  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.79k|  IoCloser closer(*io_);
  566|  3.79k|  clearMetadata();
  567|  3.79k|  continueTraversing_ = true;
  568|  3.79k|  height_ = width_ = 1;
  569|       |
  570|  3.79k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  3.79k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  54.0k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 50.2k, False: 3.79k]
  ------------------
  574|  50.2k|    decodeBlock(0);
  575|       |
  576|  3.79k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  3.79k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  58.0k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|  58.0k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|  58.0k|  const long bufMinSize = 4;
  583|  58.0k|  DataBuf buf(bufMinSize + 1);
  584|  58.0k|  uint64_t size = 0;
  585|  58.0k|  buf.data()[4] = '\0';
  586|       |
  587|  58.0k|  io_->read(buf.data(), 4);
  588|  58.0k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 394, False: 57.6k]
  ------------------
  589|    394|    continueTraversing_ = false;
  590|    394|    return;
  591|    394|  }
  592|       |
  593|  57.6k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|  57.6k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|  57.6k|  size_t hdrsize = 8;
  599|       |
  600|  57.6k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 121, False: 57.4k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    121|    DataBuf data(8);
  603|    121|    hdrsize += 8;
  604|    121|    io_->readOrThrow(data.data(), data.size());
  605|    121|    size = data.read_uint64(0, bigEndian);
  606|  57.4k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 2.96k, False: 54.5k]
  |  Branch (606:27): [True: 2.82k, False: 138]
  ------------------
  607|  2.82k|    size = buf.read_uint32(0, bigEndian);
  608|  2.82k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  2.82k|  }
  610|       |
  611|  57.6k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|  57.6k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|  57.6k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|  57.6k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|  57.6k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 6.56k, False: 51.0k]
  ------------------
  618|  6.56k|    discard(newsize);
  619|  6.56k|    return;
  620|  6.56k|  }
  621|  51.0k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 37.5k, False: 13.4k]
  ------------------
  622|  37.5k|    buf.resize(newsize);
  623|  37.5k|  }
  624|  51.0k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|  51.0k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  51.9k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  51.9k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  51.9k|  assert(buf.size() > 4);
  638|       |
  639|  51.9k|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 51.9k]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  51.9k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 5.96k, False: 46.0k]
  ------------------
  643|  5.96k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|  46.0k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 4.83k, False: 41.1k]
  ------------------
  645|  4.83k|    fileTypeDecoder(size);
  646|       |
  647|  41.1k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 2.85k, False: 38.3k]
  ------------------
  648|  2.85k|    setMediaStream(size);
  649|       |
  650|  38.3k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 88, False: 38.2k]
  ------------------
  651|     88|    movieHeaderDecoder(size);
  652|       |
  653|  38.2k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 948, False: 37.2k]
  ------------------
  654|    948|    trackHeaderDecoder(size);
  655|       |
  656|  37.2k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 895, False: 36.3k]
  ------------------
  657|    895|    mediaHeaderDecoder(size);
  658|       |
  659|  36.3k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 4.52k, False: 31.8k]
  ------------------
  660|  4.52k|    handlerDecoder(size);
  661|       |
  662|  31.8k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 3.60k, False: 28.2k]
  ------------------
  663|  3.60k|    videoHeaderDecoder(size);
  664|       |
  665|  28.2k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 9.16k, False: 19.0k]
  ------------------
  666|  9.16k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  19.0k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 1.56k, False: 17.5k]
  ------------------
  669|  1.56k|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  17.5k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 1.39k, False: 16.1k]
  ------------------
  672|  1.39k|    sampleDesc(size);
  673|       |
  674|  16.1k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 1.57k, False: 14.5k]
  ------------------
  675|  1.57k|    timeToSampleDecoder();
  676|       |
  677|  14.5k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 1.29k, False: 13.2k]
  ------------------
  678|  1.29k|    previewTagDecoder(size);
  679|       |
  680|  13.2k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 575, False: 12.6k]
  ------------------
  681|    575|    trackApertureTagDecoder(size);
  682|       |
  683|  12.6k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 265, False: 12.4k]
  ------------------
  684|    265|    keysTagDecoder(size);
  685|       |
  686|  12.4k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 781, False: 11.6k]
  ------------------
  687|    781|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 228, False: 553]
  ------------------
  688|    228|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    553|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 339, False: 214]
  ------------------
  690|    339|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|    214|    else
  692|    214|      discard(size);
  693|    781|  }
  694|       |
  695|  11.6k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 1.61k, False: 10.0k]
  ------------------
  696|  1.61k|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 1.10k, False: 513]
  ------------------
  697|  1.10k|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    513|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 373, False: 140]
  ------------------
  699|    373|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|    140|    else
  701|    140|      discard(size);
  702|  1.61k|  }
  703|       |
  704|  10.0k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 103, False: 9.90k]
  ------------------
  705|    103|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|    103|  }
  707|       |
  708|  9.90k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 149, False: 9.75k]
  ------------------
  709|    149|    io_->readOrThrow(buf.data(), 4);
  710|    149|    io_->readOrThrow(buf.data(), 4);
  711|    149|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|    149|  }
  713|       |
  714|  9.75k|  else {
  715|  9.75k|    discard(size);
  716|  9.75k|  }
  717|  51.9k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  16.6k|void QuickTimeVideo::discard(size_t size) {
  720|  16.6k|  size_t cur_pos = io_->tell();
  721|  16.6k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  16.6k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|  1.29k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|  1.29k|  DataBuf buf(4);
  726|  1.29k|  size_t cur_pos = io_->tell();
  727|  1.29k|  io_->readOrThrow(buf.data(), 4);
  728|  1.29k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|  1.29k|  io_->readOrThrow(buf.data(), 2);
  730|  1.29k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|  1.29k|  io_->readOrThrow(buf.data(), 4);
  733|  1.29k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 3, False: 1.29k]
  ------------------
  734|      3|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|  1.29k|  else
  736|  1.29k|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|  1.29k|  io_->seek(cur_pos + size, BasicIo::beg);
  739|  1.29k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|    265|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|    265|  DataBuf buf(4);
  743|    265|  size_t cur_pos = io_->tell();
  744|    265|  io_->readOrThrow(buf.data(), 4);
  745|    265|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|    265|  io_->readOrThrow(buf.data(), 2);
  747|    265|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|    265|  io_->readOrThrow(buf.data(), 4);
  750|    265|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 18, False: 247]
  ------------------
  751|     18|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    247|  else
  753|    247|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|    265|  io_->seek(cur_pos + size, BasicIo::beg);
  756|    265|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|    575|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|    575|  DataBuf buf(4);
  760|    575|  DataBuf buf2(2);
  761|    575|  size_t cur_pos = io_->tell();
  762|    575|  byte n = 3;
  763|       |
  764|  2.29k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 1.71k, False: 575]
  ------------------
  765|  1.71k|    io_->seek(4L, BasicIo::cur);
  766|  1.71k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  1.71k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 124, False: 1.59k]
  ------------------
  769|    124|      io_->seek(4L, BasicIo::cur);
  770|    124|      io_->readOrThrow(buf.data(), 2);
  771|    124|      io_->readOrThrow(buf2.data(), 2);
  772|    124|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|    124|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    124|#define stringFormat std::format
  ------------------
  774|    124|      io_->readOrThrow(buf.data(), 2);
  775|    124|      io_->readOrThrow(buf2.data(), 2);
  776|    124|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|    124|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    124|#define stringFormat std::format
  ------------------
  778|    124|    }
  779|       |
  780|  1.59k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 118, False: 1.47k]
  ------------------
  781|    118|      io_->seek(4L, BasicIo::cur);
  782|    118|      io_->readOrThrow(buf.data(), 2);
  783|    118|      io_->readOrThrow(buf2.data(), 2);
  784|    118|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|    118|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    118|#define stringFormat std::format
  ------------------
  786|    118|      io_->readOrThrow(buf.data(), 2);
  787|    118|      io_->readOrThrow(buf2.data(), 2);
  788|    118|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|    118|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    118|#define stringFormat std::format
  ------------------
  790|    118|    }
  791|       |
  792|  1.47k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 23, False: 1.45k]
  ------------------
  793|     23|      io_->seek(4L, BasicIo::cur);
  794|     23|      io_->readOrThrow(buf.data(), 2);
  795|     23|      io_->readOrThrow(buf2.data(), 2);
  796|     23|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|     23|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     23|#define stringFormat std::format
  ------------------
  798|     23|      io_->readOrThrow(buf.data(), 2);
  799|     23|      io_->readOrThrow(buf2.data(), 2);
  800|     23|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|     23|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     23|#define stringFormat std::format
  ------------------
  802|     23|    }
  803|  1.71k|  }
  804|    575|  io_->seek(cur_pos + size, BasicIo::beg);
  805|    575|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|  1.95k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|  1.95k|  size_t cur_pos = io_->tell();
  809|  1.95k|  DataBuf buf(50);
  810|  1.95k|  DataBuf buf2(4);
  811|       |
  812|  1.95k|  io_->readOrThrow(buf.data(), 4);
  813|  1.95k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 1.48k, False: 467]
  ------------------
  814|  1.48k|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|  1.48k|    io_->readOrThrow(buf.data(), 24);
  817|  1.48k|    xmpData_["Xmp.video.Make"] = buf.data();
  818|  1.48k|    io_->readOrThrow(buf.data(), 14);
  819|  1.48k|    xmpData_["Xmp.video.Model"] = buf.data();
  820|  1.48k|    io_->readOrThrow(buf.data(), 4);
  821|  1.48k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.48k|#define stringFormat std::format
  ------------------
  822|  1.48k|    io_->readOrThrow(buf.data(), 4);
  823|  1.48k|    io_->readOrThrow(buf2.data(), 4);
  824|  1.48k|    xmpData_["Xmp.video.FNumber"] =
  825|  1.48k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|  1.48k|    io_->readOrThrow(buf.data(), 4);
  827|  1.48k|    io_->readOrThrow(buf2.data(), 4);
  828|  1.48k|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|  1.48k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|  1.48k|    io_->readOrThrow(buf.data(), 10);
  831|  1.48k|    io_->readOrThrow(buf.data(), 4);
  832|  1.48k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 309, False: 1.18k]
  ------------------
  833|    309|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    309|#define _(String) (String)
  ------------------
  834|  1.48k|    io_->readOrThrow(buf.data(), 4);
  835|  1.48k|    io_->readOrThrow(buf2.data(), 4);
  836|  1.48k|    xmpData_["Xmp.video.FocalLength"] =
  837|  1.48k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|  1.48k|    io_->seek(95L, BasicIo::cur);
  839|  1.48k|    io_->readOrThrow(buf.data(), 48);
  840|  1.48k|    buf.write_uint8(48, 0);
  841|  1.48k|    xmpData_["Xmp.video.Software"] = buf.data();
  842|  1.48k|    io_->readOrThrow(buf.data(), 4);
  843|  1.48k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|  1.48k|  }
  845|       |
  846|  1.95k|  io_->seek(cur_pos + size, BasicIo::beg);
  847|  1.95k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|  9.47k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|  9.47k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|  9.47k|  const size_t start_pos = io_->tell();
  852|  9.47k|  const TagVocabulary* td;
  853|  9.47k|  const TagVocabulary* tv;
  854|  9.47k|  const TagVocabulary* tv_internal;
  855|       |
  856|  9.47k|  const long bufMinSize = 100;
  857|  9.47k|  DataBuf buf(bufMinSize);
  858|  9.47k|  size_t size_internal = outer_size;
  859|  9.47k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  18.2k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 12.5k, False: 5.68k]
  |  Branch (861:38): [True: 12.5k, False: 0]
  ------------------
  862|  12.5k|    const size_t loop_start_pos = io_->tell();
  863|  12.5k|    buf.data()[4] = '\0';
  864|  12.5k|    io_->readOrThrow(buf.data(), 4);
  865|  12.5k|    const size_t size = buf.read_uint32(0, bigEndian);
  866|  12.5k|    if (size > size_internal)
  ------------------
  |  Branch (866:9): [True: 3.16k, False: 9.36k]
  ------------------
  867|  3.16k|      break;
  868|  9.36k|    size_internal -= size;
  869|  9.36k|    io_->readOrThrow(buf.data(), 4);
  870|       |
  871|  9.36k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (871:9): [True: 67, False: 9.29k]
  ------------------
  872|     67|      buf.data()[0] = ' ';
  873|  9.36k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  874|       |
  875|  9.36k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  876|       |
  877|  9.36k|    if (size <= 12)
  ------------------
  |  Branch (877:9): [True: 619, False: 8.74k]
  ------------------
  878|    619|      break;
  879|       |
  880|  8.74k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (880:9): [True: 86, False: 8.66k]
  |  Branch (880:40): [True: 218, False: 8.44k]
  ------------------
  881|    304|      userDataDecoder(size - 8, recursion_depth + 1);
  882|       |
  883|  8.44k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (883:14): [True: 1.65k, False: 6.78k]
  ------------------
  884|  1.65k|      NikonTagsDecoder(size - 8);
  885|       |
  886|  6.78k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (886:14): [True: 1.95k, False: 4.82k]
  ------------------
  887|  1.95k|      CameraTagsDecoder(size - 8);
  888|       |
  889|  4.82k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (889:14): [True: 10, False: 4.81k]
  |  Branch (889:45): [True: 20, False: 4.79k]
  |  Branch (889:76): [True: 19, False: 4.77k]
  ------------------
  890|  4.77k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (890:14): [True: 210, False: 4.56k]
  |  Branch (890:45): [True: 133, False: 4.43k]
  ------------------
  891|    392|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  892|    392|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    392|#define _(String) (String)
  ------------------
  893|    392|    }
  894|       |
  895|  4.43k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (895:14): [True: 79, False: 4.35k]
  |  Branch (895:45): [True: 0, False: 4.35k]
  ------------------
  896|     79|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  897|     79|      io_->readOrThrow(buf.data(), 2);
  898|     79|      buf.data()[2] = '\0';
  899|     79|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  900|       |
  901|     79|      if (tv_internal)
  ------------------
  |  Branch (901:11): [True: 21, False: 58]
  ------------------
  902|     21|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     21|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     21|#define _(String) (String)
  ------------------
  903|     58|      else
  904|     58|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     58|#define _(String) (String)
  ------------------
  905|     79|    }
  906|       |
  907|  4.35k|    else if (tv) {
  ------------------
  |  Branch (907:14): [True: 147, False: 4.20k]
  ------------------
  908|    147|      io_->readOrThrow(buf.data(), 4);
  909|    147|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    147|#define _(String) (String)
  ------------------
  910|    147|    }
  911|       |
  912|  4.20k|    else if (td)
  ------------------
  |  Branch (912:14): [True: 2.80k, False: 1.40k]
  ------------------
  913|  2.80k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  914|       |
  915|  8.74k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  916|  8.74k|  }
  917|       |
  918|  9.47k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  919|  9.47k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  921|  1.65k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  922|  1.65k|  size_t cur_pos = io_->tell();
  923|  1.65k|  DataBuf buf(201);
  924|  1.65k|  DataBuf buf2(4 + 1);
  925|  1.65k|  uint32_t TagID = 0;
  926|  1.65k|  uint16_t dataLength = 0;
  927|  1.65k|  uint16_t dataType = 2;
  928|  1.65k|  const TagDetails* td;
  929|  1.65k|  const TagDetails* td2;
  930|       |
  931|   114k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (931:19): [True: 113k, False: 1.65k]
  ------------------
  932|   113k|    io_->readOrThrow(buf.data(), 4);
  933|   113k|    TagID = buf.read_uint32(0, bigEndian);
  934|   113k|    td = Exiv2::find(NikonNCTGTags, TagID);
  935|       |
  936|   113k|    io_->readOrThrow(buf.data(), 2);
  937|   113k|    dataType = buf.read_uint16(0, bigEndian);
  938|       |
  939|   113k|    std::memset(buf.data(), 0x0, buf.size());
  940|   113k|    io_->readOrThrow(buf.data(), 2);
  941|       |
  942|   113k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (942:9): [True: 5.23k, False: 107k]
  ------------------
  943|  5.23k|      size_t local_pos = io_->tell();
  944|  5.23k|      dataLength = buf.read_uint16(0, bigEndian);
  945|  5.23k|      std::memset(buf.data(), 0x0, buf.size());
  946|       |
  947|  5.23k|      io_->readOrThrow(buf.data(), 4);
  948|  5.23k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  949|  5.23k|      io_->readOrThrow(buf.data(), 20);
  950|  5.23k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  951|  5.23k|      io_->readOrThrow(buf.data(), 20);
  952|  5.23k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  953|  5.23k|      io_->readOrThrow(buf.data(), 4);
  954|  5.23k|      std::memset(buf.data(), 0x0, buf.size());
  955|       |
  956|  5.23k|      io_->readOrThrow(buf.data(), 1);
  957|  5.23k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  958|  5.23k|      if (td2)
  ------------------
  |  Branch (958:11): [True: 2.94k, False: 2.29k]
  ------------------
  959|  2.94k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.94k|#define _(String) (String)
  ------------------
  960|  2.29k|      else
  961|  2.29k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  962|       |
  963|  5.23k|      io_->readOrThrow(buf.data(), 1);
  964|  5.23k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  965|  5.23k|      if (td2)
  ------------------
  |  Branch (965:11): [True: 3.03k, False: 2.19k]
  ------------------
  966|  3.03k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.03k|#define _(String) (String)
  ------------------
  967|       |
  968|  5.23k|      io_->readOrThrow(buf.data(), 1);
  969|  5.23k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  970|  5.23k|      if (td2)
  ------------------
  |  Branch (970:11): [True: 3.17k, False: 2.06k]
  ------------------
  971|  3.17k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  3.17k|#define _(String) (String)
  ------------------
  972|  2.06k|      else
  973|  2.06k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  974|       |
  975|  5.23k|      io_->readOrThrow(buf.data(), 1);
  976|  5.23k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  977|  5.23k|      if (td2)
  ------------------
  |  Branch (977:11): [True: 2.41k, False: 2.82k]
  ------------------
  978|  2.41k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  2.41k|#define _(String) (String)
  ------------------
  979|  2.82k|      else
  980|  2.82k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  981|       |
  982|  5.23k|      io_->readOrThrow(buf.data(), 1);
  983|  5.23k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  984|  5.23k|      if (td2)
  ------------------
  |  Branch (984:11): [True: 3.25k, False: 1.97k]
  ------------------
  985|  3.25k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  3.25k|#define _(String) (String)
  ------------------
  986|  1.97k|      else
  987|  1.97k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  988|       |
  989|  5.23k|      io_->readOrThrow(buf.data(), 1);
  990|  5.23k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  991|  5.23k|      if (td2)
  ------------------
  |  Branch (991:11): [True: 2.85k, False: 2.38k]
  ------------------
  992|  2.85k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  2.85k|#define _(String) (String)
  ------------------
  993|  2.38k|      else
  994|  2.38k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  5.23k|      io_->readOrThrow(buf.data(), 1);
  997|  5.23k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  998|       |
  999|  5.23k|      io_->readOrThrow(buf.data(), 1);
 1000|  5.23k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
 1001|  5.23k|      if (td2)
  ------------------
  |  Branch (1001:11): [True: 1.15k, False: 4.08k]
  ------------------
 1002|  1.15k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.15k|#define _(String) (String)
  ------------------
 1003|  4.08k|      else
 1004|  4.08k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1005|       |
 1006|  5.23k|      io_->readOrThrow(buf.data(), 1);
 1007|  5.23k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1008|  5.23k|      if (td2)
  ------------------
  |  Branch (1008:11): [True: 1.81k, False: 3.42k]
  ------------------
 1009|  1.81k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.81k|#define _(String) (String)
  ------------------
 1010|  3.42k|      else
 1011|  3.42k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  5.23k|      io_->readOrThrow(buf.data(), 1);
 1014|  5.23k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1015|       |
 1016|  5.23k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1017|  5.23k|    }
 1018|       |
 1019|   107k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1019:14): [True: 584, False: 107k]
  ------------------
 1020|    584|      size_t local_pos = io_->tell();
 1021|    584|      dataLength = buf.read_uint16(0, bigEndian);
 1022|    584|      std::memset(buf.data(), 0x0, buf.size());
 1023|       |
 1024|    584|      io_->readOrThrow(buf.data(), 2);
 1025|    584|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1026|    584|      io_->readOrThrow(buf.data(), 1);
 1027|    584|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1028|    584|      if (td2)
  ------------------
  |  Branch (1028:11): [True: 385, False: 199]
  ------------------
 1029|    385|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    385|#define _(String) (String)
  ------------------
 1030|       |
 1031|    584|      io_->readOrThrow(buf.data(), 1);
 1032|    584|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1033|    584|      if (td2)
  ------------------
  |  Branch (1033:11): [True: 264, False: 320]
  ------------------
 1034|    264|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    264|#define _(String) (String)
  ------------------
 1035|       |
 1036|    584|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1037|    584|    }
 1038|       |
 1039|   107k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1039:14): [True: 2.15k, False: 105k]
  |  Branch (1039:31): [True: 308, False: 104k]
  ------------------
 1040|  1.87k|      dataLength = buf.read_uint16(0, bigEndian);
 1041|  1.87k|      std::memset(buf.data(), 0x0, buf.size());
 1042|       |
 1043|       |      // Sanity check with an "unreasonably" large number
 1044|  1.87k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1044:11): [True: 902, False: 971]
  ------------------
 1045|    902|#ifndef SUPPRESS_WARNINGS
 1046|    902|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    902|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 902]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    902|  LogMsg(LogMsg::error).os()
  ------------------
 1047|      0|                  << " Entries considered invalid. Not Processed.\n";
 1048|    902|#endif
 1049|    902|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1050|    902|        buf.data()[0] = '\0';
 1051|    971|      } else {
 1052|    971|        io_->readOrThrow(buf.data(), dataLength);
 1053|    971|        buf.data()[dataLength] = '\0';
 1054|    971|      }
 1055|       |
 1056|  1.87k|      if (td) {
  ------------------
  |  Branch (1056:11): [True: 675, False: 1.19k]
  ------------------
 1057|    675|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    675|#define _(String) (String)
  ------------------
 1058|    675|      }
 1059|   105k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1059:16): [True: 1.25k, False: 104k]
  ------------------
 1060|  1.25k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1061|  1.25k|      std::memset(buf.data(), 0x0, buf.size());
 1062|  1.25k|      io_->readOrThrow(buf.data(), 4);
 1063|  1.25k|      if (td)
  ------------------
  |  Branch (1063:11): [True: 736, False: 518]
  ------------------
 1064|    736|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    736|#define _(String) (String)
  ------------------
 1065|       |
 1066|       |      // Sanity check with an "unreasonably" large number
 1067|  1.25k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1067:11): [True: 678, False: 576]
  |  Branch (1067:31): [True: 299, False: 277]
  ------------------
 1068|    976|#ifndef SUPPRESS_WARNINGS
 1069|    976|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    976|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 976]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    976|  LogMsg(LogMsg::error).os()
  ------------------
 1070|      0|                  << " Entries considered invalid. Not Processed.\n";
 1071|    976|#endif
 1072|    976|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1073|    976|      } else
 1074|    278|        io_->readOrThrow(buf.data(), dataLength - 4);
 1075|   104k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1075:16): [True: 3.35k, False: 100k]
  ------------------
 1076|  3.35k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1077|  3.35k|      std::memset(buf.data(), 0x0, buf.size());
 1078|  3.35k|      io_->readOrThrow(buf.data(), 2);
 1079|  3.35k|      if (td)
  ------------------
  |  Branch (1079:11): [True: 1.31k, False: 2.03k]
  ------------------
 1080|  1.31k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.31k|#define _(String) (String)
  ------------------
 1081|       |
 1082|       |      // Sanity check with an "unreasonably" large number
 1083|  3.35k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1083:11): [True: 2.51k, False: 839]
  |  Branch (1083:31): [True: 431, False: 408]
  ------------------
 1084|  2.94k|#ifndef SUPPRESS_WARNINGS
 1085|  2.94k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.94k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.94k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.94k|  LogMsg(LogMsg::error).os()
  ------------------
 1086|      0|                  << " Entries considered invalid. Not Processed.\n";
 1087|  2.94k|#endif
 1088|  2.94k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1089|  2.94k|      } else
 1090|    409|        io_->readOrThrow(buf.data(), dataLength - 2);
 1091|   100k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1091:16): [True: 738, False: 100k]
  ------------------
 1092|    738|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1093|    738|      std::memset(buf.data(), 0x0, buf.size());
 1094|    738|      io_->readOrThrow(buf.data(), 4);
 1095|    738|      io_->readOrThrow(buf2.data(), 4);
 1096|    738|      if (td)
  ------------------
  |  Branch (1096:11): [True: 346, False: 392]
  ------------------
 1097|    346|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    346|#define _(String) (String)
  ------------------
 1098|    346|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1099|       |
 1100|       |      // Sanity check with an "unreasonably" large number
 1101|    738|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1101:11): [True: 371, False: 367]
  |  Branch (1101:31): [True: 161, False: 206]
  ------------------
 1102|    531|#ifndef SUPPRESS_WARNINGS
 1103|    531|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    531|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 531]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    531|  LogMsg(LogMsg::error).os()
  ------------------
 1104|      0|                  << " Entries considered invalid. Not Processed.\n";
 1105|    531|#endif
 1106|    531|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1107|    531|      } else
 1108|    207|        io_->readOrThrow(buf.data(), dataLength - 8);
 1109|   100k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1109:16): [True: 1.65k, False: 98.5k]
  ------------------
 1110|  1.65k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1111|  1.65k|      std::memset(buf.data(), 0x0, buf.size());
 1112|  1.65k|      io_->readOrThrow(buf.data(), 2);
 1113|  1.65k|      io_->readOrThrow(buf2.data(), 2);
 1114|  1.65k|      if (td)
  ------------------
  |  Branch (1114:11): [True: 603, False: 1.04k]
  ------------------
 1115|    603|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    603|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    603|#define stringFormat std::format
  ------------------
 1116|       |
 1117|       |      // Sanity check with an "unreasonably" large number
 1118|  1.65k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1118:11): [True: 803, False: 847]
  |  Branch (1118:31): [True: 212, False: 635]
  ------------------
 1119|  1.01k|#ifndef SUPPRESS_WARNINGS
 1120|  1.01k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.01k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.01k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.01k|  LogMsg(LogMsg::error).os()
  ------------------
 1121|      0|                  << " Entries considered invalid. Not Processed.\n";
 1122|  1.01k|#endif
 1123|  1.01k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1124|  1.01k|      } else
 1125|    639|        io_->readOrThrow(buf.data(), dataLength - 4);
 1126|  1.65k|    }
 1127|   113k|  }
 1128|       |
 1129|  1.65k|  io_->seek(cur_pos + size, BasicIo::beg);
 1130|  1.65k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1132|  2.85k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1133|  2.85k|  size_t current_position = io_->tell();
 1134|  2.85k|  size_t search_end = Safe::add(current_position, atom_size);
 1135|  2.85k|  if (search_end > io_->size())
  ------------------
  |  Branch (1135:7): [True: 0, False: 2.85k]
  ------------------
 1136|      0|    search_end = io_->size();
 1137|  2.85k|  DataBuf buf(4 + 1);
 1138|       |
 1139|  44.0k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1139:10): [True: 44.0k, False: 0]
  |  Branch (1139:25): [True: 43.3k, False: 662]
  ------------------
 1140|  43.3k|    io_->readOrThrow(buf.data(), 4);
 1141|  43.3k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1141:9): [True: 2.19k, False: 41.2k]
  ------------------
 1142|  2.19k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1142:11): [True: 67, False: 2.13k]
  ------------------
 1143|     67|        break;
 1144|  2.13k|      io_->readOrThrow(buf.data(), 4);
 1145|  2.13k|      io_->readOrThrow(buf.data(), 4);
 1146|  2.13k|      io_->readOrThrow(buf.data(), 4);
 1147|       |
 1148|  2.13k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1148:11): [True: 90, False: 2.04k]
  ------------------
 1149|     90|        currentStream_ = Video;
 1150|  2.04k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1150:16): [True: 813, False: 1.22k]
  ------------------
 1151|    813|        currentStream_ = Audio;
 1152|  1.22k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1152:16): [True: 98, False: 1.12k]
  ------------------
 1153|     98|        currentStream_ = Hint;
 1154|  1.12k|      else
 1155|  1.12k|        currentStream_ = GenMediaHeader;
 1156|  2.13k|      break;
 1157|  2.19k|    }
 1158|  43.3k|  }
 1159|       |
 1160|  2.85k|  io_->seek(current_position, BasicIo::beg);
 1161|  2.85k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1163|  1.57k|void QuickTimeVideo::timeToSampleDecoder() {
 1164|  1.57k|  DataBuf buf(4 + 1);
 1165|  1.57k|  io_->readOrThrow(buf.data(), 4);
 1166|  1.57k|  io_->readOrThrow(buf.data(), 4);
 1167|  1.57k|  uint64_t totalframes = 0;
 1168|  1.57k|  uint64_t timeOfFrames = 0;
 1169|  1.57k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1170|       |
 1171|  5.24k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1171:24): [True: 3.67k, False: 1.57k]
  ------------------
 1172|  3.67k|    io_->readOrThrow(buf.data(), 4);
 1173|  3.67k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1174|  3.67k|    totalframes = Safe::add(totalframes, temp);
 1175|  3.67k|    io_->readOrThrow(buf.data(), 4);
 1176|  3.67k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1177|  3.67k|  }
 1178|  1.57k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1178:7): [True: 887, False: 686]
  ------------------
 1179|    887|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1179:9): [True: 455, False: 432]
  ------------------
 1180|    455|      timeOfFrames = 1;
 1181|    887|    xmpData_["Xmp.video.FrameRate"] =
 1182|    887|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1183|    887|  }
 1184|  1.57k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1186|  1.39k|void QuickTimeVideo::sampleDesc(size_t size) {
 1187|  1.39k|  DataBuf buf(100);
 1188|  1.39k|  size_t cur_pos = io_->tell();
 1189|  1.39k|  io_->readOrThrow(buf.data(), 4);
 1190|  1.39k|  io_->readOrThrow(buf.data(), 4);
 1191|  1.39k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1192|       |
 1193|  93.8k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1193:24): [True: 92.8k, False: 1.09k]
  ------------------
 1194|  92.8k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1194:9): [True: 53.4k, False: 39.3k]
  ------------------
 1195|  53.4k|      imageDescDecoder();
 1196|  39.3k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1196:14): [True: 39.0k, False: 297]
  ------------------
 1197|  39.0k|      audioDescDecoder();
 1198|    297|    else
 1199|    297|      break;
 1200|  92.8k|  }
 1201|  1.39k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1202|  1.39k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1204|  39.0k|void QuickTimeVideo::audioDescDecoder() {
 1205|  39.0k|  DataBuf buf(40);
 1206|  39.0k|  std::memset(buf.data(), 0x0, buf.size());
 1207|  39.0k|  buf.data()[4] = '\0';
 1208|  39.0k|  io_->readOrThrow(buf.data(), 4);
 1209|  39.0k|  size_t size = 82;
 1210|       |
 1211|  39.0k|  const TagVocabulary* td;
 1212|       |
 1213|   819k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1213:19): [True: 780k, False: 38.9k]
  ------------------
 1214|   780k|    io_->readOrThrow(buf.data(), 4);
 1215|   780k|    switch (i) {
 1216|  39.0k|      case AudioFormat:
  ------------------
  |  Branch (1216:7): [True: 39.0k, False: 741k]
  ------------------
 1217|  39.0k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1218|  39.0k|        if (td)
  ------------------
  |  Branch (1218:13): [True: 536, False: 38.5k]
  ------------------
 1219|    536|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    536|#define _(String) (String)
  ------------------
 1220|  38.5k|        else
 1221|  38.5k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1222|  39.0k|        break;
 1223|  39.0k|      case AudioVendorID:
  ------------------
  |  Branch (1223:7): [True: 39.0k, False: 741k]
  ------------------
 1224|  39.0k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1225|  39.0k|        if (td)
  ------------------
  |  Branch (1225:13): [True: 995, False: 38.0k]
  ------------------
 1226|    995|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    995|#define _(String) (String)
  ------------------
 1227|  39.0k|        break;
 1228|  39.0k|      case AudioChannels:
  ------------------
  |  Branch (1228:7): [True: 39.0k, False: 741k]
  ------------------
 1229|  39.0k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1230|  39.0k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1231|  39.0k|        break;
 1232|  39.0k|      case AudioSampleRate:
  ------------------
  |  Branch (1232:7): [True: 39.0k, False: 741k]
  ------------------
 1233|  39.0k|        xmpData_["Xmp.audio.SampleRate"] =
 1234|  39.0k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1235|  39.0k|        break;
 1236|   624k|      default:
  ------------------
  |  Branch (1236:7): [True: 624k, False: 156k]
  ------------------
 1237|   624k|        break;
 1238|   780k|    }
 1239|   780k|  }
 1240|  38.9k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1241|  38.9k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1243|  53.4k|void QuickTimeVideo::imageDescDecoder() {
 1244|  53.4k|  DataBuf buf(40);
 1245|  53.4k|  std::memset(buf.data(), 0x0, buf.size());
 1246|  53.4k|  buf.data()[4] = '\0';
 1247|  53.4k|  io_->readOrThrow(buf.data(), 4);
 1248|  53.4k|  size_t size = 82;
 1249|       |
 1250|  53.4k|  const TagVocabulary* td;
 1251|       |
 1252|   640k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1252:19): [True: 587k, False: 53.3k]
  ------------------
 1253|   587k|    io_->readOrThrow(buf.data(), 4);
 1254|       |
 1255|   587k|    switch (i) {
 1256|  53.3k|      case codec:
  ------------------
  |  Branch (1256:7): [True: 53.3k, False: 533k]
  ------------------
 1257|  53.3k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1258|  53.3k|        if (td)
  ------------------
  |  Branch (1258:13): [True: 656, False: 52.7k]
  ------------------
 1259|    656|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    656|#define _(String) (String)
  ------------------
 1260|  52.7k|        else
 1261|  52.7k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1262|  53.3k|        break;
 1263|  53.3k|      case VendorID:
  ------------------
  |  Branch (1263:7): [True: 53.3k, False: 533k]
  ------------------
 1264|  53.3k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1265|  53.3k|        if (td)
  ------------------
  |  Branch (1265:13): [True: 1.47k, False: 51.9k]
  ------------------
 1266|  1.47k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.47k|#define _(String) (String)
  ------------------
 1267|  53.3k|        break;
 1268|  53.3k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1268:7): [True: 53.3k, False: 533k]
  ------------------
 1269|  53.3k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1270|  53.3k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1271|  53.3k|        break;
 1272|  53.3k|      case XResolution:
  ------------------
  |  Branch (1272:7): [True: 53.3k, False: 533k]
  ------------------
 1273|  53.3k|        xmpData_["Xmp.video.XResolution"] =
 1274|  53.3k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1275|  53.3k|        break;
 1276|  53.3k|      case YResolution:
  ------------------
  |  Branch (1276:7): [True: 53.3k, False: 533k]
  ------------------
 1277|  53.3k|        xmpData_["Xmp.video.YResolution"] =
 1278|  53.3k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1279|  53.3k|        io_->readOrThrow(buf.data(), 3);
 1280|  53.3k|        size -= 3;
 1281|  53.3k|        break;
 1282|  53.3k|      case CompressorName:
  ------------------
  |  Branch (1282:7): [True: 53.3k, False: 533k]
  ------------------
 1283|  53.3k|        io_->readOrThrow(buf.data(), 32);
 1284|  53.3k|        size -= 32;
 1285|  53.3k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1286|  53.3k|        break;
 1287|   266k|      default:
  ------------------
  |  Branch (1287:7): [True: 266k, False: 320k]
  ------------------
 1288|   266k|        break;
 1289|   587k|    }
 1290|   587k|  }
 1291|  53.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1292|  53.3k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1293|  53.3k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1295|  1.56k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1296|  1.56k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1297|  1.56k|  DataBuf buf(4 + 1);
 1298|  1.56k|  io_->readOrThrow(buf.data(), 4);
 1299|  1.56k|  io_->readOrThrow(buf.data(), 4);
 1300|  1.56k|  uint32_t noOfEntries;
 1301|       |
 1302|  1.56k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1303|       |
 1304|  3.36k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1304:24): [True: 1.90k, False: 1.45k]
  |  Branch (1304:43): [True: 1.79k, False: 112]
  ------------------
 1305|  1.79k|    decodeBlock(recursion_depth + 1);
 1306|  1.79k|  }
 1307|  1.56k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1309|  3.60k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1310|  3.60k|  DataBuf buf(3);
 1311|  3.60k|  std::memset(buf.data(), 0x0, buf.size());
 1312|  3.60k|  buf.data()[2] = '\0';
 1313|  3.60k|  currentStream_ = Video;
 1314|       |
 1315|  3.60k|  const TagDetails* td;
 1316|       |
 1317|  23.2k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1317:19): [True: 19.6k, False: 3.60k]
  ------------------
 1318|  19.6k|    io_->readOrThrow(buf.data(), 2);
 1319|       |
 1320|  19.6k|    switch (i) {
 1321|  3.32k|      case GraphicsMode:
  ------------------
  |  Branch (1321:7): [True: 3.32k, False: 16.3k]
  ------------------
 1322|  3.32k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1323|  3.32k|        if (td)
  ------------------
  |  Branch (1323:13): [True: 2.85k, False: 469]
  ------------------
 1324|  2.85k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.85k|#define _(String) (String)
  ------------------
 1325|  3.32k|        break;
 1326|  3.32k|      case OpColor:
  ------------------
  |  Branch (1326:7): [True: 3.32k, False: 16.3k]
  ------------------
 1327|  3.32k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1328|  3.32k|        break;
 1329|  13.0k|      default:
  ------------------
  |  Branch (1329:7): [True: 13.0k, False: 6.65k]
  ------------------
 1330|  13.0k|        break;
 1331|  19.6k|    }
 1332|  19.6k|  }
 1333|  3.60k|  io_->readOrThrow(buf.data(), size % 2);
 1334|  3.60k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1336|  4.52k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1337|  4.52k|  size_t cur_pos = io_->tell();
 1338|  4.52k|  DataBuf buf(100);
 1339|  4.52k|  std::memset(buf.data(), 0x0, buf.size());
 1340|  4.52k|  buf.data()[4] = '\0';
 1341|       |
 1342|  4.52k|  const TagVocabulary* tv;
 1343|       |
 1344|  27.1k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1344:19): [True: 22.6k, False: 4.52k]
  ------------------
 1345|  22.6k|    io_->readOrThrow(buf.data(), 4);
 1346|       |
 1347|  22.6k|    switch (i) {
  ------------------
  |  Branch (1347:13): [True: 13.5k, False: 9.05k]
  ------------------
 1348|  4.52k|      case HandlerClass:
  ------------------
  |  Branch (1348:7): [True: 4.52k, False: 18.1k]
  ------------------
 1349|  4.52k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1350|  4.52k|        if (tv) {
  ------------------
  |  Branch (1350:13): [True: 1.19k, False: 3.32k]
  ------------------
 1351|  1.19k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1351:15): [True: 104, False: 1.09k]
  ------------------
 1352|    104|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    104|#define _(String) (String)
  ------------------
 1353|  1.09k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1353:20): [True: 477, False: 617]
  ------------------
 1354|    477|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    477|#define _(String) (String)
  ------------------
 1355|  1.19k|        }
 1356|  4.52k|        break;
 1357|  4.52k|      case HandlerType:
  ------------------
  |  Branch (1357:7): [True: 4.52k, False: 18.1k]
  ------------------
 1358|  4.52k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1359|  4.52k|        if (tv) {
  ------------------
  |  Branch (1359:13): [True: 3.31k, False: 1.21k]
  ------------------
 1360|  3.31k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1360:15): [True: 745, False: 2.56k]
  ------------------
 1361|    745|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    745|#define _(String) (String)
  ------------------
 1362|  2.56k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1362:20): [True: 867, False: 1.70k]
  ------------------
 1363|    867|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    867|#define _(String) (String)
  ------------------
 1364|  3.31k|        }
 1365|  4.52k|        break;
 1366|  4.52k|      case HandlerVendorID:
  ------------------
  |  Branch (1366:7): [True: 4.52k, False: 18.1k]
  ------------------
 1367|  4.52k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1368|  4.52k|        if (tv) {
  ------------------
  |  Branch (1368:13): [True: 1.13k, False: 3.38k]
  ------------------
 1369|  1.13k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1369:15): [True: 139, False: 997]
  ------------------
 1370|    139|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    139|#define _(String) (String)
  ------------------
 1371|    997|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1371:20): [True: 253, False: 744]
  ------------------
 1372|    253|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    253|#define _(String) (String)
  ------------------
 1373|  1.13k|        }
 1374|  4.52k|        break;
 1375|  22.6k|    }
 1376|  22.6k|  }
 1377|  4.52k|  io_->seek(cur_pos + size, BasicIo::beg);
 1378|  4.52k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1380|  4.83k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1381|  4.83k|  DataBuf buf(5);
 1382|  4.83k|  std::memset(buf.data(), 0x0, buf.size());
 1383|  4.83k|  buf.data()[4] = '\0';
 1384|  4.83k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1385|  4.83k|  const TagVocabulary* td;
 1386|       |
 1387|  37.7k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1387:19): [True: 32.9k, False: 4.83k]
  ------------------
 1388|  32.9k|    io_->readOrThrow(buf.data(), 4);
 1389|  32.9k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1390|       |
 1391|  32.9k|    switch (i) {
 1392|  4.79k|      case 0:
  ------------------
  |  Branch (1392:7): [True: 4.79k, False: 28.1k]
  ------------------
 1393|  4.79k|        if (td)
  ------------------
  |  Branch (1393:13): [True: 1.71k, False: 3.08k]
  ------------------
 1394|  1.71k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  1.71k|#define _(String) (String)
  ------------------
 1395|  4.79k|        break;
 1396|  1.69k|      case 1:
  ------------------
  |  Branch (1396:7): [True: 1.69k, False: 31.2k]
  ------------------
 1397|  1.69k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1398|  1.69k|        break;
 1399|  26.4k|      default:
  ------------------
  |  Branch (1399:7): [True: 26.4k, False: 6.49k]
  ------------------
 1400|  26.4k|        if (td)
  ------------------
  |  Branch (1400:13): [True: 1.32k, False: 25.1k]
  ------------------
 1401|  1.32k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.32k|#define _(String) (String)
  ------------------
 1402|  25.1k|        else
 1403|  25.1k|          v->read(Exiv2::toString(buf.data()));
 1404|  26.4k|        break;
 1405|  32.9k|    }
 1406|  32.9k|  }
 1407|  4.83k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1408|  4.83k|  io_->readOrThrow(buf.data(), size % 4);
 1409|  4.83k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1411|    895|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1412|    895|  DataBuf buf(5);
 1413|    895|  std::memset(buf.data(), 0x0, buf.size());
 1414|    895|  buf.data()[4] = '\0';
 1415|    895|  int64_t time_scale = 1;
 1416|       |
 1417|  4.62k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1417:19): [True: 3.72k, False: 895]
  ------------------
 1418|  3.72k|    io_->readOrThrow(buf.data(), 4);
 1419|       |
 1420|  3.72k|    switch (i) {
 1421|    588|      case MediaHeaderVersion:
  ------------------
  |  Branch (1421:7): [True: 588, False: 3.13k]
  ------------------
 1422|    588|        if (currentStream_ == Video)
  ------------------
  |  Branch (1422:13): [True: 67, False: 521]
  ------------------
 1423|     67|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    521|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1424:18): [True: 132, False: 389]
  ------------------
 1425|    132|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1426|    588|        break;
 1427|    583|      case MediaCreateDate:
  ------------------
  |  Branch (1427:7): [True: 583, False: 3.14k]
  ------------------
 1428|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1429|    583|        if (currentStream_ == Video)
  ------------------
  |  Branch (1429:13): [True: 62, False: 521]
  ------------------
 1430|     62|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    521|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1431:18): [True: 132, False: 389]
  ------------------
 1432|    132|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1433|    583|        break;
 1434|    574|      case MediaModifyDate:
  ------------------
  |  Branch (1434:7): [True: 574, False: 3.15k]
  ------------------
 1435|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1436|    574|        if (currentStream_ == Video)
  ------------------
  |  Branch (1436:13): [True: 54, False: 520]
  ------------------
 1437|     54|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    520|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1438:18): [True: 132, False: 388]
  ------------------
 1439|    132|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1440|    574|        break;
 1441|    573|      case MediaTimeScale:
  ------------------
  |  Branch (1441:7): [True: 573, False: 3.15k]
  ------------------
 1442|    573|        if (currentStream_ == Video)
  ------------------
  |  Branch (1442:13): [True: 53, False: 520]
  ------------------
 1443|     53|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    520|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1444:18): [True: 132, False: 388]
  ------------------
 1445|    132|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1446|    573|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1447|    573|        mdhdTimeScale_ = time_scale;
 1448|    573|        break;
 1449|    571|      case MediaDuration:
  ------------------
  |  Branch (1449:7): [True: 571, False: 3.15k]
  ------------------
 1450|    571|        if (currentStream_ == Video)
  ------------------
  |  Branch (1450:13): [True: 53, False: 518]
  ------------------
 1451|     53|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 53, False: 0]
  ------------------
 1452|    518|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1452:18): [True: 132, False: 386]
  ------------------
 1453|    132|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1453:49): [True: 132, False: 0]
  ------------------
 1454|    571|        break;
 1455|    571|      case MediaLanguageCode:
  ------------------
  |  Branch (1455:7): [True: 571, False: 3.15k]
  ------------------
 1456|    571|        if (currentStream_ == Video)
  ------------------
  |  Branch (1456:13): [True: 53, False: 518]
  ------------------
 1457|     53|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    518|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1458:18): [True: 132, False: 386]
  ------------------
 1459|    132|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1460|    571|        break;
 1461|       |
 1462|    265|      default:
  ------------------
  |  Branch (1462:7): [True: 265, False: 3.46k]
  ------------------
 1463|    265|        break;
 1464|  3.72k|    }
 1465|  3.72k|  }
 1466|    895|  io_->readOrThrow(buf.data(), size % 4);
 1467|    895|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1469|    948|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1470|    948|  DataBuf buf(5);
 1471|    948|  std::memset(buf.data(), 0x0, buf.size());
 1472|    948|  buf.data()[4] = '\0';
 1473|    948|  int64_t temp = 0;
 1474|       |
 1475|  15.7k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1475:19): [True: 14.7k, False: 948]
  ------------------
 1476|  14.7k|    io_->readOrThrow(buf.data(), 4);
 1477|       |
 1478|  14.7k|    switch (i) {
 1479|    758|      case TrackHeaderVersion:
  ------------------
  |  Branch (1479:7): [True: 758, False: 14.0k]
  ------------------
 1480|    758|        if (currentStream_ == Video)
  ------------------
  |  Branch (1480:13): [True: 148, False: 610]
  ------------------
 1481|    148|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    610|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1482:18): [True: 232, False: 378]
  ------------------
 1483|    232|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1484|    758|        break;
 1485|    757|      case TrackCreateDate:
  ------------------
  |  Branch (1485:7): [True: 757, False: 14.0k]
  ------------------
 1486|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1487|    757|        if (currentStream_ == Video)
  ------------------
  |  Branch (1487:13): [True: 148, False: 609]
  ------------------
 1488|    148|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    609|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1489:18): [True: 232, False: 377]
  ------------------
 1490|    232|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1491|    757|        break;
 1492|    756|      case TrackModifyDate:
  ------------------
  |  Branch (1492:7): [True: 756, False: 14.0k]
  ------------------
 1493|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1494|    756|        if (currentStream_ == Video)
  ------------------
  |  Branch (1494:13): [True: 148, False: 608]
  ------------------
 1495|    148|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    608|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1496:18): [True: 232, False: 376]
  ------------------
 1497|    232|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1498|    756|        break;
 1499|    755|      case TrackID:
  ------------------
  |  Branch (1499:7): [True: 755, False: 14.0k]
  ------------------
 1500|    755|        if (currentStream_ == Video)
  ------------------
  |  Branch (1500:13): [True: 148, False: 607]
  ------------------
 1501|    148|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    607|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1502:18): [True: 232, False: 375]
  ------------------
 1503|    232|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1504|    755|        break;
 1505|    749|      case TrackDuration:
  ------------------
  |  Branch (1505:7): [True: 749, False: 14.0k]
  ------------------
 1506|    749|        if (currentStream_ == Video)
  ------------------
  |  Branch (1506:13): [True: 143, False: 606]
  ------------------
 1507|    143|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 143, False: 0]
  ------------------
 1508|    606|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1508:18): [True: 232, False: 374]
  ------------------
 1509|    232|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1509:49): [True: 232, False: 0]
  ------------------
 1510|    749|        break;
 1511|    653|      case TrackLayer:
  ------------------
  |  Branch (1511:7): [True: 653, False: 14.1k]
  ------------------
 1512|    653|        if (currentStream_ == Video)
  ------------------
  |  Branch (1512:13): [True: 93, False: 560]
  ------------------
 1513|     93|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    560|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1514:18): [True: 232, False: 328]
  ------------------
 1515|    232|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1516|    653|        break;
 1517|    653|      case TrackVolume:
  ------------------
  |  Branch (1517:7): [True: 653, False: 14.1k]
  ------------------
 1518|    653|        if (currentStream_ == Video)
  ------------------
  |  Branch (1518:13): [True: 93, False: 560]
  ------------------
 1519|     93|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    560|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1520:18): [True: 232, False: 328]
  ------------------
 1521|    232|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1522|    653|        break;
 1523|    646|      case ImageWidth:
  ------------------
  |  Branch (1523:7): [True: 646, False: 14.1k]
  ------------------
 1524|    646|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1524:13): [True: 90, False: 556]
  ------------------
 1525|     90|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1526|     90|          xmpData_["Xmp.video.Width"] = temp;
 1527|     90|          width_ = temp;
 1528|     90|        }
 1529|    646|        break;
 1530|    646|      case ImageHeight:
  ------------------
  |  Branch (1530:7): [True: 646, False: 14.1k]
  ------------------
 1531|    646|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1531:13): [True: 90, False: 556]
  ------------------
 1532|     90|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1533|     90|          xmpData_["Xmp.video.Height"] = temp;
 1534|     90|          height_ = temp;
 1535|     90|        }
 1536|    646|        break;
 1537|  8.38k|      default:
  ------------------
  |  Branch (1537:7): [True: 8.38k, False: 6.37k]
  ------------------
 1538|  8.38k|        break;
 1539|  14.7k|    }
 1540|  14.7k|  }
 1541|    948|  io_->readOrThrow(buf.data(), size % 4);
 1542|    948|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1544|     88|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1545|     88|  DataBuf buf(5);
 1546|     88|  std::memset(buf.data(), 0x0, buf.size());
 1547|     88|  buf.data()[4] = '\0';
 1548|       |
 1549|  1.48k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1549:19): [True: 1.39k, False: 88]
  ------------------
 1550|  1.39k|    io_->readOrThrow(buf.data(), 4);
 1551|       |
 1552|  1.39k|    switch (i) {
 1553|     78|      case MovieHeaderVersion:
  ------------------
  |  Branch (1553:7): [True: 78, False: 1.31k]
  ------------------
 1554|     78|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1555|     78|        break;
 1556|     77|      case CreateDate:
  ------------------
  |  Branch (1556:7): [True: 77, False: 1.31k]
  ------------------
 1557|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1558|     77|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1559|     77|        break;
 1560|     75|      case ModifyDate:
  ------------------
  |  Branch (1560:7): [True: 75, False: 1.31k]
  ------------------
 1561|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1562|     75|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1563|     75|        break;
 1564|     74|      case TimeScale:
  ------------------
  |  Branch (1564:7): [True: 74, False: 1.31k]
  ------------------
 1565|     74|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1566|     74|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1567|     74|        break;
 1568|     73|      case Duration:
  ------------------
  |  Branch (1568:7): [True: 73, False: 1.32k]
  ------------------
 1569|     73|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1569:13): [True: 73, False: 0]
  ------------------
 1570|     73|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1571|     73|        }
 1572|     73|        break;
 1573|     73|      case PreferredRate:
  ------------------
  |  Branch (1573:7): [True: 73, False: 1.32k]
  ------------------
 1574|     73|        xmpData_["Xmp.video.PreferredRate"] =
 1575|     73|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1576|     73|        break;
 1577|     73|      case PreferredVolume:
  ------------------
  |  Branch (1577:7): [True: 73, False: 1.32k]
  ------------------
 1578|     73|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1579|     73|        break;
 1580|     30|      case PreviewTime:
  ------------------
  |  Branch (1580:7): [True: 30, False: 1.36k]
  ------------------
 1581|     30|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1582|     30|        break;
 1583|     30|      case PreviewDuration:
  ------------------
  |  Branch (1583:7): [True: 30, False: 1.36k]
  ------------------
 1584|     30|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1585|     30|        break;
 1586|     30|      case PosterTime:
  ------------------
  |  Branch (1586:7): [True: 30, False: 1.36k]
  ------------------
 1587|     30|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1588|     30|        break;
 1589|     30|      case SelectionTime:
  ------------------
  |  Branch (1589:7): [True: 30, False: 1.36k]
  ------------------
 1590|     30|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1591|     30|        break;
 1592|     30|      case SelectionDuration:
  ------------------
  |  Branch (1592:7): [True: 30, False: 1.36k]
  ------------------
 1593|     30|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1594|     30|        break;
 1595|     29|      case CurrentTime:
  ------------------
  |  Branch (1595:7): [True: 29, False: 1.36k]
  ------------------
 1596|     29|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1597|     29|        break;
 1598|     29|      case NextTrackID:
  ------------------
  |  Branch (1598:7): [True: 29, False: 1.36k]
  ------------------
 1599|     29|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1600|     29|        break;
 1601|    662|      default:
  ------------------
  |  Branch (1601:7): [True: 662, False: 731]
  ------------------
 1602|    662|        break;
 1603|  1.39k|    }
 1604|  1.39k|  }
 1605|     88|  io_->readOrThrow(buf.data(), size % 4);
 1606|     88|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1608|  3.80k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1609|  3.80k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1610|  3.80k|  if (!image->good()) {
  ------------------
  |  Branch (1610:7): [True: 13, False: 3.79k]
  ------------------
 1611|     13|    return nullptr;
 1612|     13|  }
 1613|  3.79k|  return image;
 1614|  3.80k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1616|  21.2k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1617|  21.2k|  auto buf = DataBuf(12);
 1618|  21.2k|  iIo.read(buf.data(), 12);
 1619|       |
 1620|  21.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1620:7): [True: 0, False: 21.2k]
  |  Branch (1620:22): [True: 460, False: 20.8k]
  ------------------
 1621|    460|    return false;
 1622|    460|  }
 1623|  20.8k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1624|       |
 1625|  20.8k|  bool matched = false;
 1626|       |
 1627|   148k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1627:24): [True: 148k, False: 6.32k]
  ------------------
 1628|   148k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1629|   148k|    if (tmp == 0) {
  ------------------
  |  Branch (1629:9): [True: 14.5k, False: 134k]
  ------------------
 1630|       |      // we only match if we actually know the video type. This is done
 1631|       |      // to avoid matching just on ftyp because bmffimage also has that
 1632|       |      // header.
 1633|  14.5k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1633:11): [True: 11.3k, False: 3.13k]
  ------------------
 1634|  11.3k|        matched = true;
 1635|  11.3k|      }
 1636|  14.5k|      break;
 1637|  14.5k|    }
 1638|   148k|  }
 1639|       |
 1640|  20.8k|  if (!advance || !matched) {
  ------------------
  |  Branch (1640:7): [True: 20.8k, False: 0]
  |  Branch (1640:19): [True: 0, False: 0]
  ------------------
 1641|  20.8k|    iIo.seek(0L, BasicIo::beg);
 1642|  20.8k|  }
 1643|       |
 1644|  20.8k|  return matched;
 1645|  21.2k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   107k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   107k|  const char ignoreList[13][5] = {
  505|   107k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   107k|  };
  507|       |
  508|   107k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.35M, False: 101k]
  ------------------
  509|  1.35M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 6.56k, False: 1.35M]
  ------------------
  510|  6.56k|      return true;
  511|       |
  512|   101k|  return false;
  513|   107k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  51.9k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  51.9k|  const char ignoreList[8][5] = {
  524|  51.9k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  51.9k|  };
  526|       |
  527|  51.9k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 403k, False: 46.0k]
  ------------------
  528|   403k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 5.96k, False: 397k]
  ------------------
  529|  5.96k|      return true;
  530|       |
  531|  46.0k|  return false;
  532|  51.9k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.31M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.31M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.31M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.31M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.71M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  2.68k|static std::string readString(BasicIo& io, size_t size) {
  628|  2.68k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  2.68k|  Exiv2::DataBuf str(size + 1);
  630|  2.68k|  io.readOrThrow(str.data(), size);
  631|  2.68k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  2.68k|  return Exiv2::toString(str.data());
  633|  2.68k|}

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

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

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

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

_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: 20, False: 10.4k]
  ------------------
  140|     20|    throw std::overflow_error("Overflow in addition");
  141|     20|  }
  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|  2.06M|T add(T summand_1, T summand_2) {
  138|  2.06M|  T res = 0;
  139|  2.06M|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 6, False: 2.06M]
  ------------------
  140|      6|    throw std::overflow_error("Overflow in addition");
  141|      6|  }
  142|  2.06M|  return res;
  143|  2.06M|}
_ZN4Safe8Internal20builtin_add_overflowImEEbT_S2_RS2_:
   96|  2.06M|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|  2.06M|#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|  2.06M|    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|  2.06M|}
_ZN4Safe3addIlEET_S1_S1_:
  137|   110k|T add(T summand_1, T summand_2) {
  138|   110k|  T res = 0;
  139|   110k|  if (Internal::builtin_add_overflow(summand_1, summand_2, res)) {
  ------------------
  |  Branch (139:7): [True: 1, False: 110k]
  ------------------
  140|      1|    throw std::overflow_error("Overflow in addition");
  141|      1|  }
  142|   110k|  return res;
  143|   110k|}
_ZN4Safe8Internal20builtin_add_overflowIlEEbT_S2_RS2_:
   96|   110k|bool builtin_add_overflow(T summand_1, T summand_2, T& result) {
   97|   110k|#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|   110k|    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|   110k|}

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

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

_ZN5Exiv28Internal15sonyTagDecipherEtPKhmPNS0_13TiffComponentE:
 2333|    669|DataBuf sonyTagDecipher(uint16_t tag, const byte* bytes, size_t size, TiffComponent* object) {
 2334|    669|  return sonyTagCipher(tag, bytes, size, object, true);
 2335|    669|}
_ZN5Exiv28Internal15sonyTagEncipherEtPKhmPNS0_13TiffComponentE:
 2336|    159|DataBuf sonyTagEncipher(uint16_t tag, const byte* bytes, size_t size, TiffComponent* object) {
 2337|    159|  return sonyTagCipher(tag, bytes, size, object, false);
 2338|    159|}
sonymn_int.cpp:_ZN5Exiv28InternalL13sonyTagCipherEtPKhmPKNS0_13TiffComponentEb:
 2309|    828|                             bool bDecipher) {
 2310|    828|  DataBuf b(bytes, size);  // copy the data
 2311|       |
 2312|       |  // initialize the code table
 2313|    828|  byte code[256];
 2314|   207k|  for (uint32_t i = 0; i < 249; i++) {
  ------------------
  |  Branch (2314:24): [True: 206k, False: 828]
  ------------------
 2315|   206k|    if (bDecipher) {
  ------------------
  |  Branch (2315:9): [True: 166k, False: 39.5k]
  ------------------
 2316|   166k|      code[(i * i * i) % 249] = static_cast<byte>(i);
 2317|   166k|    } else {
 2318|  39.5k|      code[i] = (i * i * i) % 249;
 2319|  39.5k|    }
 2320|   206k|  }
 2321|  6.62k|  for (uint32_t i = 249; i < 256; i++) {
  ------------------
  |  Branch (2321:26): [True: 5.79k, False: 828]
  ------------------
 2322|  5.79k|    code[i] = static_cast<byte>(i);
 2323|  5.79k|  }
 2324|       |
 2325|       |  // code byte-by-byte
 2326|   678k|  for (uint32_t i = 0; i < size; i++) {
  ------------------
  |  Branch (2326:24): [True: 677k, False: 828]
  ------------------
 2327|   677k|    b.write_uint8(i, code[bytes[i]]);
 2328|   677k|  }
 2329|       |
 2330|    828|  return b;
 2331|    828|}

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

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  2.09M|const TagInfo* ifdTagList() {
 1779|  2.09M|  return ifdTagInfo;
 1780|  2.09M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   320k|const TagInfo* exifTagList() {
 2217|   320k|  return exifTagInfo;
 2218|   320k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   172k|const TagInfo* gpsTagList() {
 2433|   172k|  return gpsTagInfo;
 2434|   172k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  76.0k|const TagInfo* iopTagList() {
 2508|  76.0k|  return iopTagInfo;
 2509|  76.0k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  17.7k|const TagInfo* mnTagList() {
 2524|  17.7k|  return mnTagInfo;
 2525|  17.7k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.75M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.75M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.75M, False: 0]
  ------------------
 2529|  1.75M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.75M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  3.76M|bool isExifIfd(IfdId ifdId) {
 2534|  3.76M|  switch (ifdId) {
 2535|   495k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 495k, False: 3.26M]
  ------------------
 2536|   662k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 167k, False: 3.59M]
  ------------------
 2537|   765k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 102k, False: 3.66M]
  ------------------
 2538|   837k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 71.9k, False: 3.69M]
  ------------------
 2539|   890k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 53.7k, False: 3.71M]
  ------------------
 2540|   908k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 17.9k, False: 3.74M]
  ------------------
 2541|   909k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 540, False: 3.76M]
  ------------------
 2542|   909k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 3.76M]
  ------------------
 2543|  1.24M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 331k, False: 3.43M]
  ------------------
 2544|  1.46M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 224k, False: 3.53M]
  ------------------
 2545|  1.61M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 151k, False: 3.61M]
  ------------------
 2546|  1.74M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 124k, False: 3.63M]
  ------------------
 2547|  1.75M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 16.6k, False: 3.74M]
  ------------------
 2548|  1.76M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 11.0k, False: 3.75M]
  ------------------
 2549|  1.78M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 17.0k, False: 3.74M]
  ------------------
 2550|  1.79M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 6.51k, False: 3.75M]
  ------------------
 2551|  1.80M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 8.73k, False: 3.75M]
  ------------------
 2552|  1.82M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 25.1k, False: 3.73M]
  ------------------
 2553|  2.01M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 186k, False: 3.57M]
  ------------------
 2554|  2.01M|      return true;
 2555|  1.75M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.75M, False: 2.01M]
  ------------------
 2556|  1.75M|      return false;
 2557|  3.76M|  }
 2558|  3.76M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  4.82M|const TagInfo* tagList(IfdId ifdId) {
 2569|  4.82M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 4.82M, False: 0]
  ------------------
 2570|  4.82M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 4.82M, False: 0]
  ------------------
 2571|  4.82M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  4.82M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  3.76M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  3.76M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 3.76M, False: 0]
  ------------------
 2577|  3.76M|    int idx = 0;
 2578|   277M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 274M, False: 2.42M]
  ------------------
 2579|   274M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.33M, False: 273M]
  ------------------
 2580|  1.33M|        break;
 2581|   274M|    }
 2582|  3.76M|    return ti + idx;
 2583|  3.76M|  }
 2584|      0|  return nullptr;
 2585|  3.76M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|  1.05M|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|  1.05M|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 1.05M]
  ------------------
 2589|      0|    return nullptr;
 2590|  1.05M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 1.05M, False: 0]
  ------------------
 2591|  63.0M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 62.9M, False: 95.0k]
  ------------------
 2592|  62.9M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 964k, False: 62.0M]
  ------------------
 2593|   964k|        return ti + idx;
 2594|   964k|      }
 2595|  62.9M|    }
 2596|  1.05M|  }
 2597|  95.0k|  return nullptr;
 2598|  1.05M|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  6.96M|IfdId groupId(const std::string& groupName) {
 2601|  6.96M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 6.96M, False: 0]
  ------------------
 2602|  6.96M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  6.96M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  2.67M|const char* groupName(IfdId ifdId) {
 2613|  2.67M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 2.67M, False: 0]
  ------------------
 2614|  2.67M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  2.67M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    298|float fnumber(float apertureValue) {
 2648|    298|  float result = std::exp2(apertureValue / 2.F);
 2649|    298|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 10, False: 288]
  ------------------
 2650|     10|    result = 3.5F;
 2651|     10|  }
 2652|    298|  return result;
 2653|    298|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    298|URational exposureTime(float shutterSpeedValue) {
 2656|    298|  URational ur(1, 1);
 2657|    298|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    298|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 135, False: 163]
  ------------------
 2659|    135|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    135|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 64, False: 71]
  ------------------
 2662|     64|      ur.second = static_cast<uint32_t>(x);
 2663|     64|    }
 2664|    163|  } else {
 2665|    163|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    163|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 163, False: 0]
  |  Branch (2667:19): [True: 163, False: 0]
  ------------------
 2668|    163|      ur.first = static_cast<uint32_t>(x);
 2669|    163|    }
 2670|    163|  }
 2671|    298|  return ur;
 2672|    298|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|  1.05M|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|  1.05M|  auto ti = tagInfo(tagName, ifdId);
 2676|  1.05M|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 964k, False: 95.0k]
  |  Branch (2676:13): [True: 964k, False: 0]
  ------------------
 2677|   964k|    return ti->tag_;
 2678|  95.0k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 95.0k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  95.0k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  95.0k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  7.47k|const TagInfo* tagList(const std::string& groupName) {
 3295|  7.47k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  7.47k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 7.47k]
  |  Branch (3296:14): [True: 0, False: 7.47k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  7.47k|  return ii->tagList_();
 3300|  7.47k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  28.8M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  28.8M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 28.8M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 5.78M, False: 23.1M]
  |  Branch (42:86): [True: 21.5k, False: 23.0M]
  ------------------
   43|  5.80M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 13.2k, False: 5.79M]
  ------------------
   44|  28.8M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  23.4k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  23.4k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 7.83k, False: 15.5k]
  |  Branch (48:20): [True: 0, False: 15.5k]
  ------------------
   49|  7.83k|    wroteHeader_ = true;
   50|  23.4k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  4.46M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  4.46M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 15.4k, False: 4.45M]
  |  Branch (53:24): [True: 15.4k, False: 0]
  ------------------
   54|  15.4k|    io_.write(pHeader_, size_);
   55|  15.4k|    wroteHeader_ = true;
   56|  15.4k|  }
   57|  4.46M|  return io_.write(pData, wcount);
   58|  4.46M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  42.3k|int IoWrapper::putb(byte data) {
   61|  42.3k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 42.3k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  42.3k|  return io_.putb(data);
   66|  42.3k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     42|void IoWrapper::setTarget(int id, size_t target) {
   69|     42|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 42]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     42|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 14, False: 28]
  ------------------
   73|     14|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     42|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   151k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   151k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  52.5k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  52.5k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  17.3k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  17.3k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  17.3k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  33.0k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  33.0k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  8.26k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  8.26k|    cfgSelFct_(cfgSelFct),
   99|  8.26k|    arraySet_(arraySet),
  100|  8.26k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  8.26k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  8.66M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  8.66M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  8.70M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  40.9k|    TiffComponent(rhs),
  125|  40.9k|    tiffType_(rhs.tiffType_),
  126|  40.9k|    count_(rhs.count_),
  127|  40.9k|    offset_(rhs.offset_),
  128|  40.9k|    size_(rhs.size_),
  129|  40.9k|    pData_(rhs.pData_),
  130|  40.9k|    idx_(rhs.idx_),
  131|  40.9k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 21.5k, False: 19.3k]
  ------------------
  132|  40.9k|    storage_(rhs.storage_) {
  133|  40.9k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    399|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    399|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  90.2k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  90.2k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  92.7k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  92.7k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  40.9k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  40.9k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  40.9k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  40.9k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  40.9k|  return UniquePtr(doClone());
  159|  40.9k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  32.8k|TiffEntry* TiffEntry::doClone() const {
  162|  32.8k|  return new TiffEntry(*this);
  163|  32.8k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    525|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    525|  return new TiffDataEntry(*this);
  167|    525|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  3.17k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  3.17k|  return new TiffImageEntry(*this);
  171|  3.17k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  3.98k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  3.98k|  return new TiffSizeEntry(*this);
  175|  3.98k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    399|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    399|  return new TiffSubIfd(*this);
  183|    399|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  18.0M|int TiffEntryBase::idx() const {
  206|  18.0M|  return idx_;
  207|  18.0M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|  1.12M|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|  1.12M|  storage_ = std::move(buf);
  211|  1.12M|  pData_ = storage_->data();
  212|  1.12M|  size_ = storage_->size();
  213|  1.12M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  3.80M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  3.80M|  pData_ = pData;
  217|  3.80M|  size_ = size;
  218|  3.80M|  storage_ = std::move(storage);
  219|  3.80M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 3.80M]
  ------------------
  220|      0|    size_ = 0;
  221|  3.80M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  3.15M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  3.15M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 3.15M]
  ------------------
  225|      0|    return;
  226|  3.15M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 1.11M, False: 2.03M]
  ------------------
  227|  1.11M|    auto d = std::make_shared<DataBuf>(newSize);
  228|  1.11M|    setData(std::move(d));
  229|  1.11M|  }
  230|  3.15M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 1.15M, False: 1.99M]
  ------------------
  231|  1.15M|    memset(pData_, 0x0, size_);
  232|  1.15M|  }
  233|  3.15M|  size_ = value->copy(pData_, byteOrder);
  234|  3.15M|  setValue(std::move(value));
  235|  3.15M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  7.02M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  7.02M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 7.02M]
  ------------------
  239|      0|    return;
  240|  7.02M|  tiffType_ = toTiffType(value->typeId());
  241|  7.02M|  count_ = value->count();
  242|  7.02M|  pValue_ = std::move(value);
  243|  7.02M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  13.1k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  13.1k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 627, False: 12.5k]
  |  Branch (246:20): [True: 435, False: 12.1k]
  ------------------
  247|  1.06k|#ifndef SUPPRESS_WARNINGS
  248|  1.06k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.06k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.06k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.06k|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|  1.06k|#endif
  251|  1.06k|    return;
  252|  1.06k|  }
  253|  12.1k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 2.24k, False: 9.88k]
  ------------------
  254|  2.24k|#ifndef SUPPRESS_WARNINGS
  255|  2.24k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.24k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.24k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.24k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  2.24k|#endif
  258|  2.24k|    return;
  259|  2.24k|  }
  260|  9.88k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.38k, False: 8.49k]
  ------------------
  261|  1.38k|#ifndef SUPPRESS_WARNINGS
  262|  1.38k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.38k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.38k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.38k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.38k|#endif
  266|  1.38k|    return;
  267|  1.38k|  }
  268|  8.49k|  size_t size = 0;
  269|   304k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 295k, False: 8.49k]
  ------------------
  270|   295k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|   295k|  }
  272|  8.49k|  const size_t offset = pValue()->toUint32(0);
  273|  8.49k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 288, False: 8.20k]
  |  Branch (273:26): [True: 669, False: 7.54k]
  |  Branch (273:54): [True: 43, False: 7.49k]
  ------------------
  274|  1.00k|#ifndef SUPPRESS_WARNINGS
  275|  1.00k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.00k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.00k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.00k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.00k|#endif
  278|  1.00k|    return;
  279|  1.00k|  }
  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.49k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 282, False: 7.21k]
  ------------------
  283|    282|#ifndef SUPPRESS_WARNINGS
  284|    282|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    282|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 282]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    282|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    282|#endif
  287|    282|    return;
  288|    282|  }
  289|  7.21k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  7.21k|  sizeDataArea_ = size;
  291|  7.21k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  7.21k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  50.7k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  50.7k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 2.14k, False: 48.5k]
  |  Branch (295:20): [True: 2.31k, False: 46.2k]
  ------------------
  296|  4.45k|#ifndef SUPPRESS_WARNINGS
  297|  4.45k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  4.45k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.45k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.45k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  4.45k|#endif
  300|  4.45k|    return;
  301|  4.45k|  }
  302|  46.2k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 13.5k, False: 32.7k]
  ------------------
  303|  13.5k|#ifndef SUPPRESS_WARNINGS
  304|  13.5k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  13.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 13.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  13.5k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  13.5k|#endif
  308|  13.5k|    return;
  309|  13.5k|  }
  310|  3.87M|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 3.83M, False: 32.7k]
  ------------------
  311|  3.83M|    const size_t offset = pValue()->toUint32(i);
  312|  3.83M|    const size_t size = pSize->toUint32(i);
  313|       |
  314|  3.83M|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 29.4k, False: 3.80M]
  |  Branch (314:28): [True: 54.1k, False: 3.75M]
  |  Branch (314:56): [True: 280, False: 3.75M]
  ------------------
  315|  83.8k|#ifndef SUPPRESS_WARNINGS
  316|  83.8k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  83.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 83.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  83.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  83.8k|#endif
  319|  3.75M|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 3.30M, False: 446k]
  ------------------
  320|  3.30M|      const byte* pStrip = pData + baseOffset + offset;
  321|  3.30M|      strips_.emplace_back(pStrip, size);
  322|  3.30M|    }
  323|  3.83M|  }
  324|  32.7k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  6.74k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  6.74k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 2.62k, False: 4.12k]
  ------------------
  328|  2.62k|    return 0;
  329|  4.12k|  return pHeader_->ifdOffset();
  330|  6.74k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  30.2k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  30.2k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 6.59k, False: 23.6k]
  |  Branch (333:20): [True: 20.6k, False: 2.97k]
  ------------------
  334|  27.2k|    return imageByteOrder_;
  335|  27.2k|  }
  336|  2.97k|  return pHeader_->byteOrder();
  337|  30.2k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  4.06k|size_t TiffIfdMakernote::mnOffset() const {
  340|  4.06k|  return mnOffset_;
  341|  4.06k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  16.1k|size_t TiffIfdMakernote::baseOffset() const {
  344|  16.1k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.63k, False: 12.5k]
  ------------------
  345|  3.63k|    return 0;
  346|  12.5k|  return pHeader_->baseOffset(mnOffset_);
  347|  16.1k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  7.84k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  7.84k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 2.62k, False: 5.22k]
  ------------------
  351|  2.62k|    return true;
  352|  5.22k|  return pHeader_->read(pData, size, byteOrder);
  353|  7.84k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  7.52k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  7.52k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 6.52k, False: 1.00k]
  ------------------
  357|  6.52k|    pHeader_->setByteOrder(byteOrder);
  358|  7.52k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  77.4k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  77.4k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 9.39k, False: 68.0k]
  ------------------
  362|  9.39k|    return 0;
  363|  68.0k|  return pHeader_->size();
  364|  77.4k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  9.38k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  9.38k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 1.01k, False: 8.37k]
  ------------------
  368|  1.01k|    return 0;
  369|  8.37k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  9.38k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  6.69M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  6.69M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  6.69M|  return count_ * TypeInfo::typeSize(typeId);
  375|  6.69M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.71M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.71M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.71M, False: 430]
  ------------------
  379|  1.71M|    return true;  // Not a complex array or already initialized
  380|       |
  381|  1.07k|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 1.07k, False: 0]
  ------------------
  382|  1.07k|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 430, False: 649]
  ------------------
  383|    430|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    430|      arrayDef_ = arraySet_[idx].def_;
  385|    430|      defSize_ = arraySet_[idx].defSize_;
  386|    430|      return true;
  387|    430|    }
  388|  1.07k|  }
  389|      0|  return false;
  390|    430|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  4.55k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  4.55k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.41k, False: 2.13k]
  ------------------
  394|  2.41k|    return true;  // Not a complex array
  395|       |
  396|  2.13k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  2.13k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.41k, False: 717]
  ------------------
  398|  1.41k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.41k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.41k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.41k|  }
  402|  2.13k|  return idx > -1;
  403|  4.55k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  14.0k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  14.0k|  origData_ = const_cast<byte*>(pData());
  407|  14.0k|  origSize_ = TiffEntryBase::doSize();
  408|  14.0k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     77|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     77|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 77]
  ------------------
  412|      0|    return false;
  413|     77|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 45, False: 32]
  ------------------
  414|     45|    return true;
  415|     32|  std::memcpy(origData_, pData, origSize_);
  416|     32|  return true;
  417|     77|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  2.29M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  2.29M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  2.29M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  2.29M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  2.29M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  2.29M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 2.29M]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|  2.29M|  tp->setStart(pData() + idx);
  429|  2.29M|  auto s = storage();
  430|  2.29M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  2.29M|  tp->setElDef(def);
  432|  2.29M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  2.29M|  addChild(std::move(tc));
  434|  2.29M|  return sz;
  435|  2.29M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  20.1M|                                      TiffComponent::UniquePtr object) {
  439|  20.1M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  20.1M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  3.15M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  3.15M|  return this;
  445|  3.15M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  8.03M|                                        TiffComponent::UniquePtr object) {
  449|  8.03M|  tiffPath.pop();
  450|  8.03M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  8.03M|  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|  8.03M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 6.55M, False: 1.48M]
  |  Branch (457:31): [True: 1.13k, False: 1.48M]
  |  Branch (457:62): [True: 900, False: 238]
  ------------------
  458|  6.55M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 27.3k, False: 6.52M]
  ------------------
  459|  27.3k|      tc = pNext_.get();
  460|  6.52M|    } else {
  461|  46.6M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 46.6M, False: 25.7k]
  ------------------
  462|  46.6M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 6.50M, False: 40.1M]
  |  Branch (462:46): [True: 6.49M, False: 1.81k]
  ------------------
  463|  6.49M|          tc = component.get();
  464|  6.49M|          break;
  465|  6.49M|        }
  466|  46.6M|      }
  467|  6.52M|    }
  468|  6.55M|  }
  469|       |
  470|  8.03M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 6.52M, False: 1.51M]
  ------------------
  471|  6.52M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.51M|  auto atc = [&] {
  474|  1.51M|    if (tiffPath.size() == 1 && object) {
  475|  1.51M|      return std::move(object);
  476|  1.51M|    }
  477|  1.51M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.51M|  }();
  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.51M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.48M, False: 26.4k]
  |  Branch (482:31): [True: 20.6k, False: 1.46M]
  ------------------
  483|  20.6k|    return nullptr;
  484|       |
  485|  1.49M|  tc = [&] {
  486|  1.49M|    if (tpi.extendedTag() == Tag::next)
  487|  1.49M|      return this->addNext(std::move(atc));
  488|  1.49M|    return this->addChild(std::move(atc));
  489|  1.49M|  }();
  490|  1.49M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.51M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  2.45M|                                     TiffComponent::UniquePtr object) {
  495|  2.45M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  2.45M|  tiffPath.pop();
  497|  2.45M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.45M]
  ------------------
  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.45M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  2.45M|  tiffPath.push(tpi1);
  504|  2.45M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.65M, False: 13.6k]
  ------------------
  505|  2.65M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 2.43M, False: 216k]
  ------------------
  506|  2.43M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  13.6k|  auto tc = [&] {
  509|  13.6k|    if (tiffPath.size() == 1 && object) {
  510|  13.6k|      return addChild(std::move(object));
  511|  13.6k|    }
  512|  13.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  13.6k|  }();
  514|  13.6k|  setCount(ifds_.size());
  515|  13.6k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  2.45M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  2.36M|                                      TiffComponent::UniquePtr object) {
  520|  2.36M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  2.36M|  tiffPath.pop();
  522|  2.36M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 14.0k, False: 2.35M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  14.0k|    return this;
  525|  14.0k|  }
  526|  2.35M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  2.35M|  tiffPath.push(tpi1);
  528|  2.35M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 9.45k, False: 2.34M]
  ------------------
  529|  9.45k|    mnGroup_ = tpi2.group();
  530|  9.45k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  9.45k|  }
  532|  2.35M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  2.36M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  2.35M|                                           TiffComponent::UniquePtr object) {
  537|  2.35M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  2.35M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.73M|                                          TiffComponent::UniquePtr object) {
  542|  1.73M|  pRoot_ = pRoot;
  543|  1.73M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 19.4k, False: 1.71M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  19.4k|    return this;
  546|  19.4k|  }
  547|  1.71M|  tiffPath.pop();
  548|  1.71M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.71M|  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.71M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.71M]
  ------------------
  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.71M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.71M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.71M]
  ------------------
  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.71M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.71M|  setCount(elements_.size());
  568|  1.71M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.71M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  8.77M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  8.77M|  return doAddChild(std::move(tiffComponent));
  573|  8.77M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  4.67M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  4.67M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  4.67M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  87.9k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  87.9k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  87.9k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 87.9k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  87.9k|  return ifds_.emplace_back(std::move(d)).get();
  589|  87.9k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  4.00M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  4.00M|  setDecoded(true);
  604|  4.00M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  4.00M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  3.16k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  3.16k|  return doAddNext(std::move(tiffComponent));
  609|  3.16k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  3.16k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  3.16k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 3.16k, False: 0]
  ------------------
  617|  3.16k|    pNext_ = std::move(tiffComponent);
  618|  3.16k|    return pNext_.get();
  619|  3.16k|  }
  620|      0|  return nullptr;
  621|  3.16k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  62.6M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  62.6M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 62.6M, False: 11.9k]
  ------------------
  636|  62.6M|    doAccept(visitor);  // one for NVI :)
  637|  62.6M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  31.5M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  31.5M|  visitor.visitEntry(this);
  641|  31.5M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   306k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   306k|  visitor.visitDataEntry(this);
  645|   306k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  1.91M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  1.91M|  visitor.visitImageEntry(this);
  649|  1.91M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.59M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.59M|  visitor.visitSizeEntry(this);
  653|  2.59M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  1.56M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  1.56M|  visitor.visitDirectory(this);
  657|  37.6M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 37.6M, False: 1.31M]
  ------------------
  658|  37.6M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 249k, False: 37.3M]
  ------------------
  659|   249k|      break;
  660|  37.3M|    component->accept(visitor);
  661|  37.3M|  }
  662|  1.56M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.29M, False: 264k]
  ------------------
  663|  1.29M|    visitor.visitDirectoryNext(this);
  664|  1.56M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 48.7k, False: 1.51M]
  ------------------
  665|  48.7k|    pNext_->accept(visitor);
  666|  1.56M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.27M, False: 281k]
  ------------------
  667|  1.27M|    visitor.visitDirectoryEnd(this);
  668|  1.56M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   291k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   291k|  visitor.visitSubIfd(this);
  672|  1.14M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 1.14M, False: 236k]
  ------------------
  673|  1.14M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 55.6k, False: 1.09M]
  ------------------
  674|  55.6k|      break;
  675|  1.09M|    ifd->accept(visitor);
  676|  1.09M|  }
  677|   291k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   219k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   219k|  visitor.visitMnEntry(this);
  681|   219k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 84.0k, False: 135k]
  ------------------
  682|  84.0k|    mn_->accept(visitor);
  683|   219k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.70k, False: 218k]
  ------------------
  684|  1.70k|    mn_ = nullptr;
  685|  1.70k|  }
  686|       |
  687|   219k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  76.4k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  76.4k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 76.4k, False: 0]
  ------------------
  691|  76.4k|    visitor.visitIfdMakernote(this);
  692|  76.4k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 75.3k, False: 1.13k]
  ------------------
  693|  75.3k|    ifd_.accept(visitor);
  694|  76.4k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 75.3k, False: 1.13k]
  |  Branch (694:52): [True: 57.7k, False: 17.5k]
  ------------------
  695|  57.7k|    visitor.visitIfdMakernoteEnd(this);
  696|  76.4k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   169k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   169k|  visitor.visitBinaryArray(this);
  700|  23.5M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 23.5M, False: 169k]
  ------------------
  701|  23.5M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 837, False: 23.5M]
  ------------------
  702|    837|      break;
  703|  23.5M|    element->accept(visitor);
  704|  23.5M|  }
  705|   169k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 156k, False: 13.0k]
  ------------------
  706|   156k|    visitor.visitBinaryArrayEnd(this);
  707|   169k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  23.8M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  23.8M|  visitor.visitBinaryElement(this);
  711|  23.8M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  3.18M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  3.18M|  doEncode(encoder, datum);
  715|  3.18M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.72M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.72M|  encoder.encodeBinaryElement(this, datum);
  719|  1.72M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  19.8k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  19.8k|  encoder.encodeBinaryArray(this, datum);
  723|  19.8k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  8.73k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  8.73k|  encoder.encodeDataEntry(this, datum);
  727|  8.73k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.38M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.38M|  encoder.encodeTiffEntry(this, datum);
  731|  1.38M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  17.3k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  17.3k|  encoder.encodeImageEntry(this, datum);
  735|  17.3k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  14.4k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  14.4k|  encoder.encodeMnEntry(this, datum);
  739|  14.4k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  23.4k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  23.4k|  encoder.encodeSizeEntry(this, datum);
  743|  23.4k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  1.81k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  1.81k|  encoder.encodeSubIfd(this, datum);
  747|  1.81k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  1.79M|size_t TiffComponent::count() const {
  750|  1.79M|  return doCount();
  751|  1.79M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   181k|size_t TiffDirectory::doCount() const {
  754|   181k|  return components_.size();
  755|   181k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.59M|size_t TiffEntryBase::doCount() const {
  758|  1.59M|  return count_;
  759|  1.59M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  20.9k|size_t TiffMnEntry::doCount() const {
  762|  20.9k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 11.4k, False: 9.53k]
  ------------------
  763|  11.4k|    return TiffEntryBase::doCount();
  764|  11.4k|  }
  765|  9.53k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  9.53k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 2.08k, False: 7.44k]
  |  Branch (768:36): [True: 1.96k, False: 120]
  |  Branch (768:68): [True: 1.92k, False: 38]
  ------------------
  769|  1.92k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  1.92k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.92k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.92k|  LogMsg(LogMsg::error).os()
  ------------------
                  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.92k|  }
  773|  9.53k|#endif
  774|  9.53k|  return mn_->size();
  775|  20.9k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  27.3k|size_t TiffBinaryArray::doCount() const {
  782|  27.3k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 4.10k, False: 23.2k]
  |  Branch (782:17): [True: 15.3k, False: 7.92k]
  ------------------
  783|  19.4k|    return TiffEntryBase::doCount();
  784|       |
  785|  7.92k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 7.92k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  7.92k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  7.92k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  7.92k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 66, False: 7.85k]
  ------------------
  791|     66|#ifndef SUPPRESS_WARNINGS
  792|     66|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\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()
  ------------------
                  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|     66|#endif
  795|     66|    typeSize = 1;
  796|     66|  }
  797|       |
  798|  7.92k|  return size() / typeSize;
  799|  7.92k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|  1.08k|size_t TiffBinaryElement::doCount() const {
  802|  1.08k|  return elDef_.count_;
  803|  1.08k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  3.24M|                            size_t& imageIdx) {
  807|  3.24M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  3.24M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  39.2k|                              size_t& imageIdx) {
  812|  39.2k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  39.2k|  const size_t compCount = count();
  816|  39.2k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 39.2k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  39.2k|  size_t sizeNext = 0;
  821|  39.2k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 842, False: 38.3k]
  ------------------
  822|    842|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  39.2k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 563, False: 38.6k]
  |  Branch (825:25): [True: 189, False: 374]
  ------------------
  826|    189|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  39.0k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 42, False: 38.9k]
  ------------------
  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|     42|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     42|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  39.0k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 38.8k, False: 208]
  ------------------
  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|  39.0k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 28.5k, False: 10.4k]
  ------------------
  842|  28.5k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  28.5k|  }
  844|       |  // Size of IFD values and additional data
  845|  39.0k|  size_t sizeValue = 0;
  846|  39.0k|  size_t sizeData = 0;
  847|  1.48M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.48M, False: 39.0k]
  ------------------
  848|  1.48M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 94.1k, False: 1.38M]
  ------------------
  849|  94.1k|      sv += sv & 1;  // Align value to word boundary
  850|  94.1k|      sizeValue += sv;
  851|  94.1k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.48M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 708k, False: 774k]
  ------------------
  854|   708k|      auto sd = component->sizeData();
  855|   708k|      sd += sd & 1;  // Align data to word boundary
  856|   708k|      sizeData += sd;
  857|   708k|    }
  858|  1.48M|  }
  859|       |
  860|  39.0k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  39.0k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  39.0k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  39.0k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 15.4k, False: 23.5k]
  ------------------
  864|  15.4k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  15.4k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  15.4k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  39.0k|  byte buf[4];
  870|  39.0k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  39.0k|  ioWrapper.write(buf, 2);
  872|  39.0k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.47M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.47M, False: 39.0k]
  ------------------
  875|  1.47M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.47M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 93.4k, False: 1.38M]
  ------------------
  877|  93.4k|      sv += sv & 1;  // Align value to word boundary
  878|  93.4k|      valueIdx += sv;
  879|  93.4k|    }
  880|  1.47M|    auto sd = component->sizeData();
  881|  1.47M|    sd += sd & 1;  // Align data to word boundary
  882|  1.47M|    dataIdx += sd;
  883|  1.47M|  }
  884|       |  // c) Pointer to the next IFD
  885|  39.0k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 38.6k, False: 359]
  ------------------
  886|  38.6k|    memset(buf, 0x0, 4);
  887|  38.6k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 842, False: 37.8k]
  |  Branch (887:19): [True: 841, False: 1]
  ------------------
  888|    841|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|    841|    }
  890|  38.6k|    ioWrapper.write(buf, 4);
  891|  38.6k|    idx += 4;
  892|  38.6k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  39.0k|  valueIdx = sizeDir;
  896|  39.0k|  dataIdx = sizeDir + sizeValue;
  897|  1.46M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.46M, False: 39.0k]
  ------------------
  898|  1.46M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 92.1k, False: 1.37M]
  ------------------
  899|  92.1k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  92.1k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  92.1k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 18.7k, False: 73.4k]
  ------------------
  902|  18.7k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  18.7k|        sv += 1;
  904|  18.7k|      }
  905|  92.1k|      idx += sv;
  906|  92.1k|      valueIdx += sv;
  907|  92.1k|    }
  908|  1.46M|    auto sd = component->sizeData();
  909|  1.46M|    sd += sd & 1;  // Align data to word boundary
  910|  1.46M|    dataIdx += sd;
  911|  1.46M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  39.0k|  dataIdx = sizeDir + sizeValue;
  915|  39.0k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  39.0k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 828, False: 38.1k]
  |  Branch (918:17): [True: 827, False: 1]
  ------------------
  919|    827|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|    827|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  39.0k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 14.9k, False: 24.0k]
  ------------------
  924|  14.9k|    idx += writeImage(ioWrapper, byteOrder);
  925|  14.9k|  }
  926|       |
  927|  39.0k|  return idx;
  928|  39.2k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.47M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.47M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.47M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.47M]
  ------------------
  934|      0|    return 0;
  935|  1.47M|  byte buf[8];
  936|  1.47M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.47M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.47M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.47M|  ioWrapper.write(buf, 8);
  940|  1.47M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 93.4k, False: 1.38M]
  ------------------
  941|  93.4k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  93.4k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  93.4k|    ioWrapper.write(buf, 4);
  944|  1.38M|  } else {
  945|  1.38M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.38M|#ifndef SUPPRESS_WARNINGS
  947|  1.38M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 110, False: 1.38M]
  ------------------
  948|    110|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|    110|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 110]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    110|  LogMsg(LogMsg::error).os()
  ------------------
  949|    110|    }
  950|  1.38M|#endif
  951|  1.38M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.36M, False: 22.0k]
  ------------------
  952|  1.36M|      memset(buf, 0x0, 4);
  953|  1.36M|      ioWrapper.write(buf, 4 - len);
  954|  1.36M|    }
  955|  1.38M|  }
  956|  1.47M|  return 12;
  957|  1.47M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.42M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.42M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 18.0k, False: 1.40M]
  |  Branch (961:19): [True: 1.30M, False: 107k]
  ------------------
  962|  1.31M|    return 0;
  963|       |
  964|   107k|  DataBuf buf(pValue_->size());
  965|   107k|  pValue_->copy(buf.data(), byteOrder);
  966|   107k|  ioWrapper.write(buf.c_data(), buf.size());
  967|   107k|  return buf.size();
  968|  1.42M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  63.8k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  63.8k|  size_t rc = 0;
  972|  63.8k|  switch (tiffType) {
  973|  1.89k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 1.89k, False: 61.9k]
  ------------------
  974|  5.58k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 3.68k, False: 60.1k]
  ------------------
  975|  5.58k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 16, False: 5.56k]
  ------------------
  976|     16|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  5.56k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  5.56k|      break;
  979|  55.1k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 55.1k, False: 8.68k]
  ------------------
  980|  57.9k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 2.76k, False: 61.1k]
  ------------------
  981|  57.9k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  57.9k|      break;
  983|    342|    default:
  ------------------
  |  Branch (983:5): [True: 342, False: 63.5k]
  ------------------
  984|    342|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  63.8k|  }
  986|  63.5k|  return rc;
  987|  63.8k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  990|  6.25k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  991|  6.25k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (991:7): [True: 207, False: 6.05k]
  |  Branch (991:20): [True: 4.28k, False: 1.76k]
  ------------------
  992|  4.49k|    return 0;
  993|       |
  994|  1.76k|  DataBuf buf(pValue()->size());
  995|  1.76k|  size_t idx = 0;
  996|  1.76k|  const size_t prevOffset = pValue()->toUint32(0);
  997|  5.88k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (997:22): [True: 4.12k, False: 1.76k]
  ------------------
  998|  4.12k|    const size_t iOffset = pValue()->toUint32(i);
  999|  4.12k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1000|  4.12k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1001|  4.12k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1002|  4.12k|  }
 1003|  1.76k|  ioWrapper.write(buf.c_data(), buf.size());
 1004|  1.76k|  return buf.size();
 1005|  6.25k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  18.2k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  18.2k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  18.2k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 392, False: 17.8k]
  ------------------
 1012|    392|    o2 = Safe::add<size_t>(offset, dataIdx);
 1013|       |#ifdef EXIV2_DEBUG_MESSAGES
 1014|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1015|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1016|       |#endif
 1017|  18.2k|  DataBuf buf(strips_.size() * 4);
 1018|  18.2k|  size_t idx = 0;
 1019|  46.2k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 46.2k, False: 18.2k]
  ------------------
 1020|  46.2k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  46.2k|    const auto sz = Safe::add(off, off & 1);
 1023|  46.2k|    o2 = Safe::add(o2, sz);
 1024|  46.2k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 45.6k, False: 608]
  ------------------
 1025|  45.6k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  46.2k|  }
 1027|  18.2k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  18.2k|  return buf.size();
 1029|  18.2k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1032|  10.2k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1033|  10.2k|  DataBuf buf(ifds_.size() * 4);
 1034|  10.2k|  size_t idx = 0;
 1035|       |  // Sort IFDs by group, needed if image data tags were copied first
 1036|  10.2k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1037|  13.5k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1037:19): [True: 13.5k, False: 10.2k]
  ------------------
 1038|  13.5k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1039|  13.5k|    dataIdx += ifd->size();
 1040|  13.5k|  }
 1041|  10.2k|  ioWrapper.write(buf.c_data(), buf.size());
 1042|  10.2k|  return buf.size();
 1043|  10.2k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1046|  20.6k|                            size_t& imageIdx) {
 1047|  20.6k|  if (!mn_) {
  ------------------
  |  Branch (1047:7): [True: 11.2k, False: 9.38k]
  ------------------
 1048|  11.2k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1049|  11.2k|  }
 1050|  9.38k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1051|  20.6k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1054|  9.38k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1055|  9.38k|  mnOffset_ = offset;
 1056|  9.38k|  setImageByteOrder(byteOrder);
 1057|  9.38k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1058|  9.38k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1059|  9.38k|                    imageIdx);
 1060|  9.38k|  return len;
 1061|  9.38k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1064|  27.1k|                                size_t dataIdx, size_t& imageIdx) {
 1065|  27.1k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1065:7): [True: 4.04k, False: 23.0k]
  |  Branch (1065:17): [True: 15.2k, False: 7.83k]
  ------------------
 1066|  19.3k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1067|  7.83k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1067:7): [True: 1.27k, False: 6.56k]
  ------------------
 1068|  1.27k|    byteOrder = cfg()->byteOrder_;
 1069|       |  // Tags must be sorted in ascending order
 1070|  7.83k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1071|  7.83k|  size_t idx = 0;
 1072|  7.83k|  MemIo mio;  // memory stream in which to store data
 1073|  7.83k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1074|       |  // Some array entries need to have the size in the first element
 1075|  7.83k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1075:7): [True: 658, False: 7.18k]
  ------------------
 1076|    658|    byte buf[4];
 1077|    658|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1078|    658|    switch (elSize) {
 1079|     77|      case 2:
  ------------------
  |  Branch (1079:7): [True: 77, False: 581]
  ------------------
 1080|     77|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1081|     77|        break;
 1082|    581|      case 4:
  ------------------
  |  Branch (1082:7): [True: 581, False: 77]
  ------------------
 1083|    581|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1084|    581|        break;
 1085|      0|      default:
  ------------------
  |  Branch (1085:7): [True: 0, False: 658]
  ------------------
 1086|      0|        break;
 1087|    658|    }
 1088|    658|    mioWrapper.write(buf, elSize);
 1089|    658|  }
 1090|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1091|  1.71M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1091:23): [True: 1.71M, False: 7.83k]
  ------------------
 1092|       |    // Skip the manufactured tag, if it exists
 1093|  1.71M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1093:9): [True: 38.8k, False: 1.67M]
  |  Branch (1093:28): [True: 658, False: 38.2k]
  ------------------
 1094|    658|      continue;
 1095|  1.71M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1096|  1.71M|    idx += fillGap(mioWrapper, idx, newIdx);
 1097|  1.71M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1098|  1.71M|  }
 1099|  7.83k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1099:7): [True: 5.91k, False: 1.92k]
  |  Branch (1099:29): [True: 5.91k, False: 0]
  ------------------
 1100|  5.91k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1101|  5.91k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1102|  5.91k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1103|  5.91k|  }
 1104|       |
 1105|  7.83k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1105:7): [True: 359, False: 7.47k]
  ------------------
 1106|       |    // Select sonyTagEncipher
 1107|    359|    CryptFct cryptFct = cfg()->cryptFct_;
 1108|    359|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1108:9): [True: 138, False: 221]
  ------------------
 1109|    138|      cryptFct = sonyTagEncipher;
 1110|    138|    }
 1111|    359|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1112|    359|    if (!buf.empty()) {
  ------------------
  |  Branch (1112:9): [True: 176, False: 183]
  ------------------
 1113|    176|      mio.seek(0, Exiv2::BasicIo::beg);
 1114|    176|      mio.write(buf.c_data(), buf.size());
 1115|    176|    }
 1116|    359|  }
 1117|  7.83k|  ioWrapper.write(mio.mmap(), mio.size());
 1118|       |
 1119|  7.83k|  return idx;
 1120|  7.83k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1123|  1.71M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1124|  1.71M|  auto pv = pValue();
 1125|  1.71M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1125:7): [True: 0, False: 1.71M]
  |  Branch (1125:14): [True: 717k, False: 999k]
  ------------------
 1126|   717k|    return 0;
 1127|   999k|  DataBuf buf(pv->size());
 1128|   999k|  pv->copy(buf.data(), byteOrder);
 1129|   999k|  ioWrapper.write(buf.c_data(), buf.size());
 1130|   999k|  return buf.size();
 1131|  1.71M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|  1.50M|                                size_t& imageIdx) const {
 1135|  1.50M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|  1.50M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  38.4k|                                  size_t& imageIdx) const {
 1140|  38.4k|  size_t len = 0;
 1141|  1.46M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 1.46M, False: 38.4k]
  ------------------
 1142|  1.46M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|  1.46M|  }
 1144|  38.4k|  return len;
 1145|  38.4k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|  1.43M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|  1.43M|  return 0;
 1150|  1.43M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  17.9k|                                   size_t& /*imageIdx*/) const {
 1154|  17.9k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  17.9k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 370, False: 17.5k]
  ------------------
 1157|    370|    len = writeImage(ioWrapper, byteOrder);
 1158|    370|  }
 1159|  17.9k|  return len;
 1160|  17.9k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1163|  5.68k|                                  size_t& /*imageIdx*/) const {
 1164|  5.68k|  if (!pValue())
  ------------------
  |  Branch (1164:7): [True: 205, False: 5.48k]
  ------------------
 1165|    205|    return 0;
 1166|       |
 1167|  5.48k|  DataBuf buf = pValue()->dataArea();
 1168|  5.48k|  if (!buf.empty())
  ------------------
  |  Branch (1168:7): [True: 804, False: 4.67k]
  ------------------
 1169|    804|    ioWrapper.write(buf.c_data(), buf.size());
 1170|       |  // Align data to word boundary
 1171|  5.48k|  size_t align = (buf.size() & 1);
 1172|  5.48k|  if (align)
  ------------------
  |  Branch (1172:7): [True: 622, False: 4.86k]
  ------------------
 1173|    622|    ioWrapper.putb(0x0);
 1174|       |
 1175|  5.48k|  return buf.size() + align;
 1176|  5.68k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1179|  10.1k|                               size_t& imageIdx) const {
 1180|  10.1k|  size_t len = 0;
 1181|  13.3k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1181:19): [True: 13.3k, False: 10.1k]
  ------------------
 1182|  13.3k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1183|  13.3k|  }
 1184|       |  // Align data to word boundary
 1185|  10.1k|  size_t align = (len & 1);
 1186|  10.1k|  if (align)
  ------------------
  |  Branch (1186:7): [True: 0, False: 10.1k]
  ------------------
 1187|      0|    ioWrapper.putb(0x0);
 1188|       |
 1189|  10.1k|  return len + align;
 1190|  10.1k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   861k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   861k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   861k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  27.4k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  27.4k|  size_t len = 0;
 1203|  27.4k|  const TiffComponent* pSubIfd = nullptr;
 1204|   833k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 833k, False: 27.4k]
  ------------------
 1205|   833k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 1.43k, False: 832k]
  ------------------
 1206|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1207|  1.43k|#ifndef SUPPRESS_WARNINGS
 1208|  1.43k|      if (pSubIfd) {
  ------------------
  |  Branch (1208:11): [True: 311, False: 1.12k]
  ------------------
 1209|    311|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    311|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 311]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    311|  LogMsg(LogMsg::error).os()
  ------------------
 1210|    311|      }
 1211|  1.43k|#endif
 1212|  1.43k|      pSubIfd = component.get();
 1213|  1.43k|      continue;
 1214|  1.43k|    }
 1215|   832k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   832k|  }
 1217|  27.4k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 1.10k, False: 26.3k]
  ------------------
 1218|  1.10k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|  1.10k|  }
 1220|  27.4k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 639, False: 26.8k]
  ------------------
 1221|    639|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|    639|  }
 1223|  27.4k|  return len;
 1224|  27.4k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   809k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   809k|  return 0;
 1228|   809k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1230|  8.85k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1231|  8.85k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1232|  8.85k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1233|  8.85k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  15.4k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  15.4k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 177, False: 15.2k]
  ------------------
 1245|    177|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  15.2k|  size_t len = pValue()->sizeDataArea();
 1248|  15.2k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 214, False: 15.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|    214|    DataBuf buf = pValue()->dataArea();
 1254|    214|    ioWrapper.write(buf.c_data(), buf.size());
 1255|    214|    size_t align = len & 1;  // Align image data to word boundary
 1256|    214|    if (align)
  ------------------
  |  Branch (1256:9): [True: 112, False: 102]
  ------------------
 1257|    112|      ioWrapper.putb(0x0);
 1258|    214|    len += align;
 1259|  15.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|  15.0k|    len = 0;
 1265|  39.5k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 39.5k, False: 15.0k]
  ------------------
 1266|  39.5k|      ioWrapper.write(f, s);
 1267|  39.5k|      len += s;
 1268|  39.5k|      size_t align = s & 1;  // Align strip data to word boundary
 1269|  39.5k|      if (align)
  ------------------
  |  Branch (1269:11): [True: 22.9k, False: 16.6k]
  ------------------
 1270|  22.9k|        ioWrapper.putb(0x0);
 1271|  39.5k|      len += align;
 1272|  39.5k|    }
 1273|  15.0k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  15.2k|  return len;
 1278|  15.4k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|  17.7M|size_t TiffComponent::size() const {
 1281|  17.7M|  return doSize();
 1282|  17.7M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1284|   142k|size_t TiffDirectory::doSize() const {
 1285|   142k|  size_t compCount = count();
 1286|       |  // Size of the directory, without values and additional data
 1287|   142k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1287:40): [True: 140k, False: 1.87k]
  ------------------
 1288|       |  // Size of IFD values and data
 1289|  6.03M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1289:25): [True: 6.03M, False: 142k]
  ------------------
 1290|  6.03M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1290:40): [True: 314k, False: 5.71M]
  ------------------
 1291|   314k|      sv += sv & 1;  // Align value to word boundary
 1292|   314k|      len += sv;
 1293|   314k|    }
 1294|  6.03M|    auto sd = component->sizeData();
 1295|  6.03M|    sd += sd & 1;  // Align data to word boundary
 1296|  6.03M|    len += sd;
 1297|  6.03M|  }
 1298|       |  // Size of next-IFD, if any
 1299|   142k|  size_t sizeNext = 0;
 1300|   142k|  if (pNext_) {
  ------------------
  |  Branch (1300:7): [True: 221, False: 141k]
  ------------------
 1301|    221|    sizeNext = pNext_->size();
 1302|    221|    len += sizeNext;
 1303|    221|  }
 1304|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1305|   142k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1305:7): [True: 785, False: 141k]
  |  Branch (1305:25): [True: 676, False: 109]
  ------------------
 1306|    676|    len = 0;
 1307|   142k|  return len;
 1308|   142k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  18.5M|size_t TiffEntryBase::doSize() const {
 1311|  18.5M|  return size_;
 1312|  18.5M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|   109k|size_t TiffImageEntry::doSize() const {
 1315|   109k|  return strips_.size() * 4;
 1316|   109k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1318|  52.4k|size_t TiffSubIfd::doSize() const {
 1319|  52.4k|  return ifds_.size() * 4;
 1320|  52.4k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1322|   113k|size_t TiffMnEntry::doSize() const {
 1323|   113k|  if (!mn_) {
  ------------------
  |  Branch (1323:7): [True: 45.5k, False: 67.8k]
  ------------------
 1324|  45.5k|    return TiffEntryBase::doSize();
 1325|  45.5k|  }
 1326|  67.8k|  return mn_->size();
 1327|   113k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1329|  77.4k|size_t TiffIfdMakernote::doSize() const {
 1330|  77.4k|  return sizeHeader() + ifd_.size();
 1331|  77.4k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1333|   362k|size_t TiffBinaryArray::doSize() const {
 1334|   362k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1334:7): [True: 52.7k, False: 310k]
  |  Branch (1334:17): [True: 199k, False: 110k]
  ------------------
 1335|   252k|    return TiffEntryBase::doSize();
 1336|       |
 1337|   110k|  if (elements_.empty())
  ------------------
  |  Branch (1337:7): [True: 0, False: 110k]
  ------------------
 1338|      0|    return 0;
 1339|       |
 1340|       |  // Remaining assumptions:
 1341|       |  // - array elements don't "overlap"
 1342|       |  // - no duplicate tags in the array
 1343|   110k|  size_t idx = 0;
 1344|   110k|  size_t sz = cfg()->tagStep();
 1345|  24.0M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1345:23): [True: 24.0M, False: 110k]
  ------------------
 1346|  24.0M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1346:9): [True: 5.58M, False: 18.5M]
  ------------------
 1347|  5.58M|      idx = element->tag();
 1348|  5.58M|      sz = element->size();
 1349|  5.58M|    }
 1350|  24.0M|  }
 1351|   110k|  idx *= cfg()->tagStep();
 1352|   110k|  idx += sz;
 1353|       |
 1354|   110k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1354:7): [True: 83.1k, False: 27.7k]
  |  Branch (1354:29): [True: 83.1k, False: 0]
  ------------------
 1355|  83.1k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1356|  83.1k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1357|  83.1k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1358|  83.1k|  }
 1359|   110k|  return idx;
 1360|       |
 1361|   110k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1363|  5.59M|size_t TiffBinaryElement::doSize() const {
 1364|  5.59M|  if (!pValue())
  ------------------
  |  Branch (1364:7): [True: 0, False: 5.59M]
  ------------------
 1365|      0|    return 0;
 1366|  5.59M|  return pValue()->size();
 1367|  5.59M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|  9.69M|size_t TiffComponent::sizeData() const {
 1370|  9.69M|  return doSizeData();
 1371|  9.69M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|  9.52M|size_t TiffEntryBase::doSizeData() const {
 1378|  9.52M|  return 0;
 1379|  9.52M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  82.1k|size_t TiffImageEntry::doSizeData() const {
 1382|  82.1k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  82.1k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 8.30k, False: 73.8k]
  ------------------
 1385|  8.30k|    len = sizeImage();
 1386|  8.30k|  }
 1387|  82.1k|  return len;
 1388|  82.1k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1390|  40.4k|size_t TiffDataEntry::doSizeData() const {
 1391|  40.4k|  if (!pValue())
  ------------------
  |  Branch (1391:7): [True: 621, False: 39.8k]
  ------------------
 1392|    621|    return 0;
 1393|  39.8k|  return pValue()->sizeDataArea();
 1394|  40.4k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1396|  40.2k|size_t TiffSubIfd::doSizeData() const {
 1397|  40.2k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1398|  40.2k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1404|  8.30k|size_t TiffComponent::sizeImage() const {
 1405|  8.30k|  return doSizeImage();
 1406|  8.30k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1426|  8.30k|size_t TiffImageEntry::doSizeImage() const {
 1427|  8.30k|  if (!pValue())
  ------------------
  |  Branch (1427:7): [True: 0, False: 8.30k]
  ------------------
 1428|      0|    return 0;
 1429|  8.30k|  auto len = pValue()->sizeDataArea();
 1430|  8.30k|  if (len != 0)
  ------------------
  |  Branch (1430:7): [True: 0, False: 8.30k]
  ------------------
 1431|      0|    return len;
 1432|       |
 1433|  8.30k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1434|  8.30k|                               [](const auto& s) { return s.second; });
 1435|  8.30k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  12.1M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  12.1M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  12.1M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 10.0k, False: 12.1M]
  ------------------
 1456|  10.0k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 7.01k, False: 3.06k]
  ------------------
 1457|  7.01k|      ti = comment;
 1458|  7.01k|    }
 1459|  10.0k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  12.1M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 6.69M, False: 5.48M]
  ------------------
 1463|  6.69M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 5.82k, False: 6.69M]
  |  Branch (1463:26): [True: 1.89k, False: 3.93k]
  |  Branch (1463:58): [True: 2.95k, False: 6.69M]
  |  Branch (1463:75): [True: 11, False: 2.94k]
  ------------------
 1464|  1.90k|    ti = Exiv2::signedByte;
 1465|  1.90k|  }
 1466|  12.1M|  return ti;
 1467|  12.1M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  7.02M|TiffType toTiffType(TypeId typeId) {
 1470|  7.02M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 7.02M]
  ------------------
 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|  7.02M|  return static_cast<TiffType>(typeId);
 1478|  7.02M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  34.8M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  34.8M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 27.1M, False: 7.68M]
  ------------------
 1482|  27.1M|    return lhs->tag() < rhs->tag();
 1483|  7.68M|  return lhs->idx() < rhs->idx();
 1484|  34.8M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|  4.29M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|  4.29M|  return std::make_unique<TiffEntry>(tag, group);
 1488|  4.29M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  40.9k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  40.9k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  40.9k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|  4.05M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|  4.05M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|  4.05M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.51M|  auto atc = [&] {
  474|  1.51M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.48M, False: 26.4k]
  |  Branch (474:33): [True: 40.0k, False: 1.44M]
  ------------------
  475|  40.0k|      return std::move(object);
  476|  40.0k|    }
  477|  1.47M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.51M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.49M|  tc = [&] {
  486|  1.49M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 842, False: 1.49M]
  ------------------
  487|    842|      return this->addNext(std::move(atc));
  488|  1.49M|    return this->addChild(std::move(atc));
  489|  1.49M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  13.6k|  auto tc = [&] {
  509|  13.6k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 13.6k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  13.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  13.6k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1036|  3.80k|  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.8k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1434|  72.0k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  64.9k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  64.9k|  const TagInfo* tags = [=] {
 1439|  64.9k|    if (group == IfdId::gpsId)
 1440|  64.9k|      return Internal::gpsTagList();
 1441|  64.9k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  64.9k|  }();
 1443|  64.9k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 10.6k, False: 54.3k]
  ------------------
 1444|   332k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 331k, False: 571]
  ------------------
 1445|   331k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 10.0k, False: 321k]
  ------------------
 1446|  10.0k|        return tags + idx;
 1447|  54.8k|  return nullptr;
 1448|  64.9k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  64.9k|  const TagInfo* tags = [=] {
 1439|  64.9k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 6.96k, False: 57.9k]
  ------------------
 1440|  6.96k|      return Internal::gpsTagList();
 1441|  57.9k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 3.69k, False: 54.3k]
  ------------------
 1442|  64.9k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1503|  1.72M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1504|  1.72M|  if (curr < tobe) {
  ------------------
  |  Branch (1504:7): [True: 258k, False: 1.46M]
  ------------------
 1505|   258k|    Exiv2::DataBuf buf(tobe - curr);
 1506|   258k|    ioWrapper.write(buf.c_data(), buf.size());
 1507|   258k|    return tobe - curr;
 1508|   258k|  }
 1509|  1.46M|  return 0;
 1510|  1.72M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  12.9M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  12.9M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  46.7M|  [[nodiscard]] uint16_t tag() const {
   82|  46.7M|    return static_cast<uint16_t>(extendedTag_);
   83|  46.7M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  12.7M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  12.7M|    return extendedTag_;
   87|  12.7M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  14.0M|  [[nodiscard]] IfdId group() const {
   90|  14.0M|    return group_;
   91|  14.0M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  8.83M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  8.83M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  5.59M|  void setStart(const byte* pStart) {
  217|  5.59M|    pStart_ = const_cast<byte*>(pStart);
  218|  5.59M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   275M|  [[nodiscard]] uint16_t tag() const {
  241|   275M|    return tag_;
  242|   275M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  36.0M|  [[nodiscard]] IfdId group() const {
  245|  36.0M|    return group_;
  246|  36.0M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  5.72M|  [[nodiscard]] byte* start() const {
  249|  5.72M|    return pStart_;
  250|  5.72M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  3.93M|  void setOffset(size_t offset) {
  417|  3.93M|    offset_ = offset;
  418|  3.93M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.61M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.61M|    return tiffType_;
  460|  1.61M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  93.4k|  [[nodiscard]] size_t offset() const {
  466|  93.4k|    return offset_;
  467|  93.4k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  4.71M|  [[nodiscard]] const byte* pData() const {
  477|  4.71M|    return pData_;
  478|  4.71M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  27.9M|  [[nodiscard]] const Value* pValue() const {
  481|  27.9M|    return pValue_.get();
  482|  27.9M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.73M|  void setCount(size_t count) {
  498|  1.73M|    count_ = count;
  499|  1.73M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  3.84M|  void setIdx(int idx) {
  502|  3.84M|    idx_ = idx;
  503|  3.84M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  2.29M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  2.29M|    return storage_;
  542|  2.29M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  66.9k|  [[nodiscard]] uint16_t szTag() const {
  624|  66.9k|    return szTag_;
  625|  66.9k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  66.9k|  [[nodiscard]] IfdId szGroup() const {
  628|  66.9k|    return szGroup_;
  629|  66.9k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  71.1k|  [[nodiscard]] uint16_t dtTag() const {
  790|  71.1k|    return dtTag_;
  791|  71.1k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  71.1k|  [[nodiscard]] IfdId dtGroup() const {
  794|  71.1k|    return dtGroup_;
  795|  71.1k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  30.4k|  [[nodiscard]] bool hasNext() const {
  843|  30.4k|    return hasNext_;
  844|  30.4k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  17.2k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  17.2k|    imageByteOrder_ = byteOrder;
 1108|  17.2k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  9.30M|  bool operator==(size_t idx) const {
 1218|  9.30M|    return idx_ == idx;
 1219|  9.30M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  4.31M|  [[nodiscard]] size_t tagStep() const {
 1235|  4.31M|    return elDefaultDef_.size(0, group_);
 1236|  4.31M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  4.01M|  void setDecoded(bool decoded) {
 1311|  4.01M|    decoded_ = decoded;
 1312|  4.01M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  13.5M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  13.5M|    return arrayCfg_;
 1320|  13.5M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   181k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   181k|    return arrayDef_;
 1324|   181k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  92.6k|  [[nodiscard]] size_t defSize() const {
 1327|  92.6k|    return defSize_;
 1328|  92.6k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   364k|  [[nodiscard]] bool decoded() const {
 1331|   364k|    return decoded_;
 1332|   364k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  2.29M|  void setElDef(const ArrayDef& def) {
 1405|  2.29M|    elDef_ = def;
 1406|  2.29M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  2.29M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  2.29M|    elByteOrder_ = byteOrder;
 1412|  2.29M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  2.33M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  2.33M|    return &elDef_;
 1422|  2.33M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  2.33M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  2.33M|    return elByteOrder_;
 1428|  2.33M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  31.8k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  31.8k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  31.8k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|      9|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|      9|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|      9|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    209|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    209|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    209|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     39|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     39|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     39|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    337|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    337|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    337|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     41|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     41|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     41|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  12.3k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  12.3k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  12.3k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  8.90k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  8.90k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  8.90k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.27k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.27k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.27k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.25k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.25k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.25k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    623|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    623|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    623|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.77k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.77k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.77k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.3k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.3k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.3k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  11.8k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  11.8k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  11.8k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.13k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.13k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.13k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.43k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.43k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.43k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.17k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.17k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.17k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.38k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.38k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.38k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    289|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    289|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    289|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    749|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    749|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    749|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  11.6k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  11.6k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  11.6k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.19k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.19k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.19k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.50k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.50k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.50k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    630|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    630|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    630|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.36k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.36k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.36k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  9.01k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  9.01k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  9.01k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  11.3k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  11.3k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  11.3k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.15k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.15k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.15k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.63k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.63k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.63k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    563|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    563|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    563|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.02k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.02k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.02k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  8.77k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  8.77k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  8.77k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.31k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.31k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.31k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    820|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    820|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    820|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.08k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.08k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.08k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    343|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    343|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    343|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    632|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    632|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    632|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.34k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.34k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.34k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.68k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.68k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.68k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    243|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    243|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    243|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    368|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    368|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    368|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    678|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    678|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    678|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    326|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    326|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    326|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.50k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.50k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.50k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.87k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.87k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.87k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    305|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    305|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    305|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    492|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    492|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    492|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    524|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    524|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    524|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    474|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    474|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    474|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.37k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.37k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.37k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.31k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.31k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.31k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    417|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    417|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    417|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    672|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    672|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    672|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    549|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    549|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    549|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.01k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.01k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.01k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.71k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.71k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.71k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.63k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.63k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.63k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    247|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    247|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    247|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    228|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    228|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    228|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    555|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    555|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    555|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    712|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    712|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    712|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.59k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.59k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.59k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    254|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    254|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    254|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    248|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    248|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    248|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    399|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    399|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    399|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    322|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    322|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    322|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    305|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    305|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    305|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    792|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    792|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    792|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    296|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    296|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    296|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    322|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    322|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    322|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    357|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    357|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    357|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    224|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    224|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    224|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    249|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    249|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    249|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.96k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.96k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.96k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  14.4k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  14.4k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  14.4k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  8.35k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  8.35k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  8.35k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    471|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    471|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    471|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     79|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     79|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     79|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    229|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    229|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    229|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     73|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     73|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     73|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    248|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    248|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    248|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    323|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    323|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    323|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    496|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    496|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    496|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     81|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     81|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     81|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    205|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    205|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    205|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    292|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    292|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    292|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    252|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    252|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    252|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    169|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    169|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    169|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    102|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    102|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    102|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    204|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    204|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    204|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     81|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     81|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     81|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    265|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    265|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    265|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  13.1k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  13.1k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  13.1k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  2.38k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  2.38k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  2.38k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    256|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    256|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    256|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.07k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.07k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.07k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    241|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    241|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    241|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    148|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    148|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    148|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    259|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    259|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    259|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    307|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    307|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    307|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    452|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    452|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    452|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    380|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    380|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    380|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    848|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    848|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    848|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    118|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    118|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    118|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.08k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.08k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.08k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    419|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    419|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    419|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    778|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    778|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    778|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.25k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.25k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.25k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.45k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.45k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.45k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.09k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.09k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.09k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.87k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.87k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.87k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    318|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    318|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    318|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.32k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.32k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.32k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.32k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.32k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.32k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.32k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    438|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    438|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    438|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    488|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    488|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    488|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    144|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    144|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    144|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    348|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    348|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    348|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    136|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    136|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    136|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    136|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    103|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    103|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    103|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    618|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    618|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    618|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    101|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    101|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    101|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    289|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    289|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    289|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     80|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     80|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     80|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     80|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    291|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    291|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    291|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    101|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    101|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    101|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     53|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     53|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     53|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    431|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    431|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    431|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    135|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    135|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    135|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    449|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    449|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    449|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    190|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    190|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    190|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    190|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    104|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    104|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    104|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    104|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__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_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    187|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    187|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    187|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    187|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    491|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    491|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    491|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    491|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    439|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    439|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    439|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    439|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    389|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    389|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    389|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    389|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    456|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    456|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    456|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    456|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  4.23k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  4.23k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  4.23k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  4.23k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    112|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    112|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    112|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    112|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    235|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    235|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    235|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    235|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    285|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    285|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    285|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    285|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    257|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    257|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    257|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    257|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    294|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    294|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    294|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    424|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    424|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    424|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    653|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    653|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    653|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.49k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.49k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.49k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    631|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    631|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    631|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.43k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.43k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.43k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  5.64k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  5.64k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  5.64k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  5.64k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    969|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    969|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    969|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    801|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    801|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    801|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    544|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    544|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    544|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    184|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    184|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    184|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    184|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    274|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    274|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    274|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    274|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    851|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    851|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    851|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    851|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    130|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    130|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    130|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    130|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.81k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.81k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.81k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.81k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    252|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    252|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    252|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    252|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    140|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    140|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    140|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    310|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    310|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    310|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    310|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    193|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    193|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    193|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    111|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    111|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    111|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    537|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    537|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    537|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    537|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     89|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     89|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     89|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     63|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     63|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     63|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     76|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     76|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     76|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     76|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    625|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    625|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    625|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    625|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    554|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    554|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    554|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     39|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     39|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     39|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    107|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    107|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    107|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    107|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  8.17k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  8.17k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  8.17k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  8.87M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   151k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  52.9k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  41.3k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  15.4M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  15.4M|  return ifdId_ == md.ifdId();
   31|  15.4M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  2.59M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  2.59M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  2.59M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 7.78k, False: 2.58M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  7.78k|    decoderFct = td->decoderFct_;
 1996|  7.78k|  }
 1997|  2.59M|  return decoderFct;
 1998|  2.59M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  3.18M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  3.18M|  EncoderFct encoderFct = nullptr;
 2002|  3.18M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 5.43k, False: 3.18M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  5.43k|    encoderFct = td->encoderFct_;
 2005|  5.43k|  }
 2006|  3.18M|  return encoderFct;
 2007|  3.18M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  8.91M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  8.91M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  8.91M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  8.91M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 8.53M, False: 384k]
  ------------------
 2014|  8.53M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  8.53M|  }
 2016|  8.91M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 8.73M, False: 180k]
  |  Branch (2016:7): [True: 8.71M, False: 200k]
  |  Branch (2016:37): [True: 8.71M, False: 19.7k]
  ------------------
 2017|  8.71M|    return i->second(tag, group);
 2018|  8.71M|  }
 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|   200k|  return nullptr;
 2028|  8.91M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  3.20M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  3.20M|  TiffPath ret;
 2032|  12.9M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 12.9M, Folded]
  ------------------
 2033|  12.9M|    ret.emplace(extendedTag, group);
 2034|  12.9M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  12.9M|    assert(ts != tiffTreeTable_.end());
 2036|  12.9M|    extendedTag = ts->second.second;
 2037|  12.9M|    group = ts->second.first;
 2038|  12.9M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 3.20M, False: 9.75M]
  ------------------
 2039|  3.20M|      break;
 2040|  3.20M|    }
 2041|  12.9M|  }
 2042|  3.20M|  return ret;
 2043|  3.20M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  19.3k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  19.3k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  19.3k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 10.6k, False: 8.70k]
  ------------------
 2050|  10.6k|    ph = std::make_unique<TiffHeader>();
 2051|  10.6k|    pHeader = ph.get();
 2052|  10.6k|  }
 2053|       |
 2054|  19.3k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 18.7k, False: 562]
  ------------------
 2055|  18.7k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  18.7k|    rootDir->accept(decoder);
 2057|  18.7k|  }
 2058|  19.3k|  return pHeader->byteOrder();
 2059|       |
 2060|  19.3k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  16.3k|                                     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.3k|  WriteMethod writeMethod = wmIntrusive;
 2074|  16.3k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  16.3k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  16.3k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 6.05k, False: 10.3k]
  ------------------
 2077|       |    // Attempt to update existing TIFF components based on metadata entries
 2078|  6.05k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2079|  6.05k|    parsedTree->accept(encoder);
 2080|  6.05k|    if (!encoder.dirty())
  ------------------
  |  Branch (2080:9): [True: 772, False: 5.28k]
  ------------------
 2081|    772|      writeMethod = wmNonIntrusive;
 2082|  6.05k|  }
 2083|  16.3k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 15.5k, False: 777]
  ------------------
 2084|  15.5k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  15.5k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 5.27k, False: 10.3k]
  ------------------
 2086|       |      // Copy image tags from the original image to the composite
 2087|  5.27k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2088|  5.27k|      parsedTree->accept(copier);
 2089|  5.27k|    }
 2090|       |    // Add entries from metadata to composite
 2091|  15.5k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  15.5k|                        findEncoderFct);
 2093|  15.5k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  15.5k|    DataBuf header = pHeader->write();
 2096|  15.5k|    auto tempIo = MemIo();
 2097|  15.5k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  15.5k|    auto imageIdx(std::string::npos);
 2099|  15.5k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  15.5k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 131, False: 15.4k]
  ------------------
 2101|    131|      pOffsetWriter->writeOffsets(tempIo);
 2102|  15.5k|    io.transfer(tempIo);  // may throw
 2103|  15.5k|#ifndef SUPPRESS_WARNINGS
 2104|  15.5k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  15.5k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 15.5k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  15.5k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  15.5k|#endif
 2106|  15.5k|  }
 2107|    777|#ifndef SUPPRESS_WARNINGS
 2108|    777|  else {
 2109|    777|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    777|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 777]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    777|  LogMsg(LogMsg::info).os()
  ------------------
 2110|    777|  }
 2111|  16.3k|#endif
 2112|  16.3k|  return writeMethod;
 2113|  16.3k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  35.7k|                                                 TiffHeaderBase* pHeader) {
 2117|  35.7k|  TiffComponent::UniquePtr rootDir;
 2118|  35.7k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 10.4k, False: 25.2k]
  |  Branch (2118:17): [True: 0, False: 25.2k]
  ------------------
 2119|  10.4k|    return rootDir;
 2120|  25.2k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 200, False: 25.0k]
  |  Branch (2120:38): [True: 205, False: 24.8k]
  ------------------
 2121|    405|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    405|  }
 2123|  24.8k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  24.8k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 24.8k, False: 0]
  ------------------
 2125|  24.8k|    rootDir->setStart(pData + pHeader->offset());
 2126|  24.8k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  24.8k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  24.8k|    rootDir->accept(reader);
 2129|  24.8k|    reader.postProcess();
 2130|  24.8k|  }
 2131|  24.8k|  return rootDir;
 2132|       |
 2133|  25.2k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  16.3k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  16.3k|  PrimaryGroups ret;
 2137|  16.3k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 10.3k, False: 6.05k]
  ------------------
 2138|  10.3k|    return ret;
 2139|       |
 2140|  6.05k|  static constexpr auto imageGroups = std::array{
 2141|  6.05k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2142|  6.05k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2143|  6.05k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2144|  6.05k|  };
 2145|       |
 2146|  78.6k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2146:24): [True: 78.6k, False: 6.05k]
  ------------------
 2147|  78.6k|    TiffFinder finder(0x00fe, imageGroup);
 2148|  78.6k|    pSourceDir->accept(finder);
 2149|  78.6k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2150|  78.6k|    if (!te)
  ------------------
  |  Branch (2150:9): [True: 77.2k, False: 1.39k]
  ------------------
 2151|  77.2k|      continue;
 2152|  1.39k|    const Value* pV = te->pValue();
 2153|  1.39k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2153:9): [True: 1.21k, False: 177]
  |  Branch (2153:15): [True: 1.03k, False: 179]
  |  Branch (2153:47): [True: 947, False: 91]
  |  Branch (2153:67): [True: 848, False: 99]
  ------------------
 2154|    848|      ret.push_back(te->group());
 2155|    848|    }
 2156|  1.39k|  }
 2157|  6.05k|  return ret;
 2158|  16.3k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   417k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   417k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   337k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   337k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 337k]
  |  Branch (2165:17): [True: 58, False: 336k]
  ------------------
 2166|     58|    return false;
 2167|       |
 2168|   336k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 8.27k, False: 328k]
  |  Branch (2168:26): [True: 7.84k, False: 431]
  ------------------
 2169|  7.84k|    byteOrder_ = littleEndian;
 2170|   329k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 120k, False: 208k]
  |  Branch (2170:33): [True: 120k, False: 765]
  ------------------
 2171|   120k|    byteOrder_ = bigEndian;
 2172|   208k|  } else {
 2173|   208k|    return false;
 2174|   208k|  }
 2175|   128k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|   128k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 127k, False: 18]
  |  Branch (2176:19): [True: 127k, False: 41]
  |  Branch (2176:33): [True: 43.1k, False: 84.8k]
  ------------------
 2177|  43.1k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  84.8k|  tag_ = t;
 2179|  84.8k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  84.8k|  return true;
 2182|   128k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  15.9k|DataBuf TiffHeaderBase::write() const {
 2185|  15.9k|  DataBuf buf(8);
 2186|  15.9k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 15.9k, False: 0]
  ------------------
 2187|  11.1k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 11.1k, False: 4.79k]
  ------------------
 2188|  11.1k|      buf.write_uint8(0, 'I');
 2189|  11.1k|      break;
 2190|  4.79k|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 4.79k, False: 11.1k]
  ------------------
 2191|  4.79k|      buf.write_uint8(0, 'M');
 2192|  4.79k|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 15.9k]
  ------------------
 2194|      0|      break;
 2195|  15.9k|  }
 2196|  15.9k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  15.9k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  15.9k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  15.9k|  return buf;
 2200|  15.9k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|   114k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|   114k|  return byteOrder_;
 2220|   114k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  19.4k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  19.4k|  byteOrder_ = byteOrder;
 2224|  19.4k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  50.7k|uint32_t TiffHeaderBase::offset() const {
 2227|  50.7k|  return offset_;
 2228|  50.7k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  10.1k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  10.1k|  offset_ = offset;
 2232|  10.1k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  20.4k|uint16_t TiffHeaderBase::tag() const {
 2239|  20.4k|  return tag_;
 2240|  20.4k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2242|  2.31k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2243|  2.31k|  return false;
 2244|  2.31k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|  3.92M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|  3.92M|  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.92M|  return result;
 2335|  3.92M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   286k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   286k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2341|  3.91M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2342|  3.91M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2342:7): [True: 49.8k, False: 3.86M]
  ------------------
 2343|       |#ifdef EXIV2_DEBUG_MESSAGES
 2344|       |    std::cerr << "No image tags in this image\n";
 2345|       |#endif
 2346|  49.8k|    return false;
 2347|  49.8k|  }
 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.86M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2352:7): [True: 61.5k, False: 3.80M]
  |  Branch (2352:7): [True: 24.7k, False: 3.83M]
  ------------------
 2353|  61.5k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2353:7): [True: 24.7k, False: 36.7k]
  ------------------
 2354|       |#ifdef EXIV2_DEBUG_MESSAGES
 2355|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2356|       |#endif
 2357|  24.7k|    return false;
 2358|  24.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.83M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2361:7): [True: 36.7k, False: 3.80M]
  |  Branch (2361:34): [True: 35.5k, False: 1.22k]
  ------------------
 2362|       |#ifdef EXIV2_DEBUG_MESSAGES
 2363|       |    ExifKey key(tag, groupName(group));
 2364|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2365|       |#endif
 2366|  35.5k|    return true;
 2367|  35.5k|  }
 2368|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2369|  3.80M|  return isTiffImageTag(tag, group);
 2370|  3.83M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2372|    180|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2373|    180|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2374|    180|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2376|     14|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2377|     14|  auto it = offsetList_.find(id);
 2378|     14|  if (it != offsetList_.end())
  ------------------
  |  Branch (2378:7): [True: 14, False: 0]
  ------------------
 2379|     14|    it->second.target_ = target;
 2380|     14|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2382|    131|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2383|    131|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2383:29): [True: 131, False: 131]
  ------------------
 2384|    131|    io.seek(off.origin_, BasicIo::beg);
 2385|    131|    byte buf[4] = {0, 0, 0, 0};
 2386|    131|    l2Data(buf, off.target_, off.byteOrder_);
 2387|    131|    io.write(buf, 4);
 2388|    131|  }
 2389|    131|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|  3.92M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|  3.92M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 3.44M, False: 480k]
  ------------------
 2248|  3.44M|    return false;
 2249|  3.44M|  }
 2250|       |  //! List of TIFF image tags
 2251|   480k|  switch (tag) {
 2252|    673|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 673, False: 479k]
  ------------------
 2253|  1.99k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 1.31k, False: 479k]
  ------------------
 2254|  13.7k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 11.7k, False: 468k]
  ------------------
 2255|  21.2k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 7.44k, False: 472k]
  ------------------
 2256|  27.4k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 6.22k, False: 474k]
  ------------------
 2257|  28.0k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 599, False: 479k]
  ------------------
 2258|  28.4k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 369, False: 479k]
  ------------------
 2259|  28.8k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 435, False: 479k]
  ------------------
 2260|  31.8k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 2.95k, False: 477k]
  ------------------
 2261|  32.1k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 313, False: 480k]
  ------------------
 2262|  32.4k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 368, False: 479k]
  ------------------
 2263|  35.4k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 2.92k, False: 477k]
  ------------------
 2264|  35.8k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 428, False: 479k]
  ------------------
 2265|  36.3k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 533, False: 479k]
  ------------------
 2266|  36.7k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 374, False: 479k]
  ------------------
 2267|  36.7k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 44, False: 480k]
  ------------------
 2268|  37.0k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 241, False: 480k]
  ------------------
 2269|  37.2k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 246, False: 480k]
  ------------------
 2270|  37.7k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 501, False: 479k]
  ------------------
 2271|  38.1k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 376, False: 479k]
  ------------------
 2272|  38.2k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 77, False: 480k]
  ------------------
 2273|  38.3k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 110, False: 480k]
  ------------------
 2274|  38.4k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 122, False: 480k]
  ------------------
 2275|  38.6k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 218, False: 480k]
  ------------------
 2276|  38.8k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 214, False: 480k]
  ------------------
 2277|  39.2k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 365, False: 480k]
  ------------------
 2278|  39.4k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 164, False: 480k]
  ------------------
 2279|  39.6k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 202, False: 480k]
  ------------------
 2280|  39.6k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 73, False: 480k]
  ------------------
 2281|  39.9k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 246, False: 480k]
  ------------------
 2282|  41.2k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 1.28k, False: 479k]
  ------------------
 2283|  41.3k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 76, False: 480k]
  ------------------
 2284|  41.3k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 86, False: 480k]
  ------------------
 2285|  41.4k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 46, False: 480k]
  ------------------
 2286|  41.5k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 136, False: 480k]
  ------------------
 2287|  41.6k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 102, False: 480k]
  ------------------
 2288|  41.7k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 92, False: 480k]
  ------------------
 2289|  42.0k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 247, False: 480k]
  ------------------
 2290|  42.1k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 97, False: 480k]
  ------------------
 2291|  42.2k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 157, False: 480k]
  ------------------
 2292|  42.3k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 90, False: 480k]
  ------------------
 2293|  42.5k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 214, False: 480k]
  ------------------
 2294|  42.8k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 252, False: 480k]
  ------------------
 2295|  43.1k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 312, False: 480k]
  ------------------
 2296|  43.2k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 85, False: 480k]
  ------------------
 2297|  43.3k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 105, False: 480k]
  ------------------
 2298|  44.9k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 1.64k, False: 478k]
  ------------------
 2299|  54.8k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 9.92k, False: 470k]
  ------------------
 2300|  63.1k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 8.30k, False: 472k]
  ------------------
 2301|  63.5k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 355, False: 480k]
  ------------------
 2302|  63.6k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 91, False: 480k]
  ------------------
 2303|  63.7k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 102, False: 480k]
  ------------------
 2304|  63.7k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 47, False: 480k]
  ------------------
 2305|  64.0k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 296, False: 480k]
  ------------------
 2306|  64.2k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 151, False: 480k]
  ------------------
 2307|  64.4k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 251, False: 480k]
  ------------------
 2308|  64.5k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 100, False: 480k]
  ------------------
 2309|  64.6k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 74, False: 480k]
  ------------------
 2310|  64.9k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 285, False: 480k]
  ------------------
 2311|  64.9k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 37, False: 480k]
  ------------------
 2312|  65.0k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 75, False: 480k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|  65.1k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 92, False: 480k]
  ------------------
 2315|  65.1k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 36, False: 480k]
  ------------------
 2316|  65.3k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 155, False: 480k]
  ------------------
 2317|  65.4k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 96, False: 480k]
  ------------------
 2318|  65.4k|      return true;
 2319|   414k|    default:
  ------------------
  |  Branch (2319:5): [True: 414k, False: 65.4k]
  ------------------
 2320|   414k|      return false;
 2321|   480k|  }
 2322|   480k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   86|  11.8M|size_t TypeInfo::typeSize(TypeId typeId) {
   87|  11.8M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (87:12): [True: 9.01M, False: 2.83M]
  ------------------
   88|  9.01M|    return tit->size_;
   89|  2.83M|  return 0;
   90|  11.8M|}
_ZN5Exiv27DataBufC2Em:
   92|  7.16M|DataBuf::DataBuf(size_t size) : pData_(size) {
   93|  7.16M|}
_ZN5Exiv27DataBufC2EPKhm:
   95|  66.8k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
   96|  66.8k|}
_ZN5Exiv27DataBuf5allocEm:
   98|  30.4k|void DataBuf::alloc(size_t size) {
   99|  30.4k|  pData_.resize(size);
  100|  30.4k|}
_ZN5Exiv27DataBuf6resizeEm:
  102|   302k|void DataBuf::resize(size_t size) {
  103|   302k|  pData_.resize(size);
  104|   302k|}
_ZN5Exiv27DataBuf5resetEv:
  106|  39.2k|void DataBuf::reset() {
  107|  39.2k|  pData_.clear();
  108|  39.2k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  110|  10.8M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  111|  10.8M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 10.8M]
  ------------------
  112|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  113|      0|  }
  114|  10.8M|  return pData_[offset];
  115|  10.8M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  117|   733k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  118|   733k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 733k]
  ------------------
  119|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  120|      0|  }
  121|   733k|  pData_[offset] = x;
  122|   733k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  124|   566k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  125|   566k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (125:7): [True: 0, False: 566k]
  |  Branch (125:28): [True: 1, False: 566k]
  ------------------
  126|      1|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  127|      1|  }
  128|   566k|  return getUShort(&pData_[offset], byteOrder);
  129|   566k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  131|  16.2k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  132|  16.2k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 16.2k]
  |  Branch (132:28): [True: 0, False: 16.2k]
  ------------------
  133|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  134|      0|  }
  135|  16.2k|  us2Data(&pData_[offset], x, byteOrder);
  136|  16.2k|}
_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: 1, False: 383k]
  ------------------
  140|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  141|      2|  }
  142|   383k|  return getULong(&pData_[offset], byteOrder);
  143|   383k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  145|  16.2k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  146|  16.2k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (146:7): [True: 0, False: 16.2k]
  |  Branch (146:28): [True: 0, False: 16.2k]
  ------------------
  147|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  148|      0|  }
  149|  16.2k|  ul2Data(&pData_[offset], x, byteOrder);
  150|  16.2k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  152|  11.3k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  153|  11.3k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (153:7): [True: 0, False: 11.3k]
  |  Branch (153:28): [True: 0, False: 11.3k]
  ------------------
  154|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  155|      0|  }
  156|  11.3k|  return getULongLong(&pData_[offset], byteOrder);
  157|  11.3k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  166|   455k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  167|   455k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (167:7): [True: 0, False: 455k]
  |  Branch (167:34): [True: 0, False: 455k]
  ------------------
  168|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  169|      0|  }
  170|   455k|  return memcmp(&pData_[offset], buf, bufsize);
  171|   455k|}
_ZN5Exiv27DataBuf4dataEm:
  173|  6.98M|byte* Exiv2::DataBuf::data(size_t offset) {
  174|  6.98M|  return const_cast<byte*>(c_data(offset));
  175|  6.98M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  177|  9.87M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  178|  9.87M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (178:7): [True: 1.25M, False: 8.61M]
  |  Branch (178:25): [True: 10.0k, False: 8.60M]
  ------------------
  179|  1.26M|    return nullptr;
  180|  1.26M|  }
  181|  8.60M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (181:7): [True: 0, False: 8.60M]
  ------------------
  182|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  183|      0|  }
  184|  8.60M|  return &pData_[offset];
  185|  8.60M|}
_ZNK5Exiv27DataBuf5c_strEm:
  187|  53.4k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  188|  53.4k|  return reinterpret_cast<const char*>(c_data(offset));
  189|  53.4k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  210|   742k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  211|   742k|  return os << r.first << "/" << r.second;
  212|   742k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  239|  15.5k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  240|  15.5k|  return os << r.first << "/" << r.second;
  241|  15.5k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  247|  66.7M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  248|  66.7M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  249|  66.7M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  251|  67.9M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  252|  67.9M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (252:7): [True: 725k, False: 67.1M]
  ------------------
  253|   725k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  254|   725k|  }
  255|  67.1M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  256|  67.9M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  258|  38.1k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  259|  38.1k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (259:7): [True: 11.0k, False: 27.1k]
  ------------------
  260|  11.0k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  261|  11.0k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  262|  11.0k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  263|  11.0k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  264|  11.0k|  }
  265|  27.1k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  266|  27.1k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  267|  27.1k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  268|  27.1k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  269|  38.1k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  271|   555k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  272|   555k|  uint32_t nominator = getULong(buf, byteOrder);
  273|   555k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  274|   555k|  return {nominator, denominator};
  275|   555k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  277|  1.32M|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  278|  1.32M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (278:7): [True: 2.69k, False: 1.32M]
  ------------------
  279|  2.69k|    return buf[1] << 8 | buf[0];
  280|  2.69k|  }
  281|  1.32M|  return buf[0] << 8 | buf[1];
  282|  1.32M|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  284|  1.65M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  285|  1.65M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (285:7): [True: 8.79k, False: 1.64M]
  ------------------
  286|  8.79k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  287|  8.79k|  }
  288|  1.64M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  289|  1.65M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  291|   218k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  292|   218k|  int32_t nominator = getLong(buf, byteOrder);
  293|   218k|  int32_t denominator = getLong(buf + 4, byteOrder);
  294|   218k|  return {nominator, denominator};
  295|   218k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  297|  40.6k|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|  40.6k|#ifdef __cpp_lib_bit_cast
  302|  40.6k|  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|  40.6k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  313|   595k|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|   595k|#ifdef __cpp_lib_bit_cast
  318|   595k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (318:7): [True: 94.6k, False: 501k]
  ------------------
  319|  94.6k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  320|  94.6k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  321|  94.6k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  322|  94.6k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  323|   501k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  324|   501k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  325|   501k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  326|   501k|                               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|   595k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  348|  3.64M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  349|  3.64M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (349:7): [True: 2.58M, False: 1.05M]
  ------------------
  350|  2.58M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  351|  2.58M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  352|  2.58M|  } else {
  353|  1.05M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  354|  1.05M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  355|  1.05M|  }
  356|  3.64M|  return 2;
  357|  3.64M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  359|  3.95M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  360|  3.95M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (360:7): [True: 1.87M, False: 2.08M]
  ------------------
  361|  1.87M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  362|  1.87M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  363|  1.87M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  364|  1.87M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  365|  2.08M|  } else {
  366|  2.08M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  367|  2.08M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  368|  2.08M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  369|  2.08M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  370|  2.08M|  }
  371|  3.95M|  return 4;
  372|  3.95M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  389|   362k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  390|   362k|  size_t o = ul2Data(buf, l.first, byteOrder);
  391|   362k|  o += ul2Data(buf + o, l.second, byteOrder);
  392|   362k|  return o;
  393|   362k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  395|  1.00M|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  396|  1.00M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (396:7): [True: 94.3k, False: 908k]
  ------------------
  397|  94.3k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  398|  94.3k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  399|   908k|  } else {
  400|   908k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  401|   908k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  402|   908k|  }
  403|  1.00M|  return 2;
  404|  1.00M|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  406|  1.46M|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  407|  1.46M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (407:7): [True: 168k, False: 1.29M]
  ------------------
  408|   168k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  409|   168k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  410|   168k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  411|   168k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  412|  1.29M|  } else {
  413|  1.29M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  414|  1.29M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  415|  1.29M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  416|  1.29M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  417|  1.29M|  }
  418|  1.46M|  return 4;
  419|  1.46M|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  421|   207k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  422|   207k|  size_t o = l2Data(buf, l.first, byteOrder);
  423|   207k|  o += l2Data(buf + o, l.second, byteOrder);
  424|   207k|  return o;
  425|   207k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  427|   103k|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|   103k|#ifdef __cpp_lib_bit_cast
  432|   103k|  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|   103k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  443|   356k|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|   356k|  union {
  448|   356k|    uint64_t ull_;
  449|   356k|    double d_;
  450|   356k|  } u;
  451|   356k|  u.d_ = d;
  452|   356k|  uint64_t m = 0xff;
  453|   356k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (453:7): [True: 148k, False: 207k]
  ------------------
  454|   148k|    buf[0] = static_cast<byte>(u.ull_ & m);
  455|   148k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  456|   148k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  457|   148k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  458|   148k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  459|   148k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  460|   148k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  461|   148k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  462|   207k|  } else {
  463|   207k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  464|   207k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  465|   207k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  466|   207k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  467|   207k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   207k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  469|   207k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  470|   207k|    buf[7] = static_cast<byte>(u.ull_ & m);
  471|   207k|  }
  472|   356k|  return 8;
  473|   356k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  502|  95.0k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  503|  95.0k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (503:7): [True: 0, False: 95.0k]
  ------------------
  504|      0|    return false;
  505|  95.0k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (505:7): [True: 95.0k, False: 0]
  |  Branch (505:19): [True: 0, False: 95.0k]
  ------------------
  506|      0|    return false;
  507|       |
  508|  95.0k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  509|  95.0k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  511|      9|int exifTime(const char* buf, tm* tm) {
  512|      9|  int rc = 1;
  513|      9|  int year = 0;
  514|      9|  int mon = 0;
  515|      9|  int mday = 0;
  516|      9|  int hour = 0;
  517|      9|  int min = 0;
  518|      9|  int sec = 0;
  519|      9|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (519:7): [True: 5, False: 4]
  ------------------
  520|      5|    tm->tm_year = year - 1900;
  521|      5|    tm->tm_mon = mon - 1;
  522|      5|    tm->tm_mday = mday;
  523|      5|    tm->tm_hour = hour;
  524|      5|    tm->tm_min = min;
  525|      5|    tm->tm_sec = sec;
  526|      5|    rc = 0;
  527|      5|  }
  528|      9|  return rc;
  529|      9|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  651|    298|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|    298|  const double d = f;
  656|       |  // Beware: primitive conversion algorithm
  657|    298|  int32_t den;
  658|    298|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (658:7): [True: 210, False: 88]
  ------------------
  659|    210|    den = 1000000;
  660|    210|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (660:14): [True: 14, False: 74]
  ------------------
  661|     14|    den = 10000;
  662|     74|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (662:14): [True: 10, False: 64]
  ------------------
  663|     10|    den = 100;
  664|     64|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (664:14): [True: 25, False: 39]
  ------------------
  665|     25|    den = 1;
  666|     39|  } else {
  667|     39|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (667:13): [True: 39, False: 0]
  ------------------
  668|     39|  }
  669|    259|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  670|    259|  const int32_t g = std::gcd(nom, den);
  671|       |
  672|    259|  return {nom / g, den / g};
  673|    298|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   34|   101M|  bool operator==(Exiv2::TypeId typeId) const {
   35|   101M|    return typeId_ == typeId;
   36|   101M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  5.59M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  5.59M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  4.01M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  4.01M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 4.01M]
  ------------------
   25|  3.63k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 3.63k, False: 4.00M]
  ------------------
   26|  1.91M|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 1.91M, False: 2.09M]
  ------------------
   27|  1.91M|      return std::make_unique<DataValue>(typeId);
   28|  43.7k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 43.7k, False: 3.96M]
  ------------------
   29|  43.7k|      return std::make_unique<AsciiValue>();
   30|   411k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 411k, False: 3.60M]
  ------------------
   31|   411k|      return std::make_unique<ValueType<uint16_t>>();
   32|  50.4k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 50.4k, False: 3.96M]
  ------------------
   33|  65.9k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 15.5k, False: 3.99M]
  ------------------
   34|  65.9k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  13.2k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 13.2k, False: 4.00M]
  ------------------
   36|  13.2k|      return std::make_unique<ValueType<URational>>();
   37|  53.9k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 53.9k, False: 3.95M]
  ------------------
   38|  53.9k|      return std::make_unique<DataValue>();
   39|  28.3k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 28.3k, False: 3.98M]
  ------------------
   40|  28.3k|      return std::make_unique<ValueType<int16_t>>();
   41|  34.6k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 34.6k, False: 3.97M]
  ------------------
   42|  34.6k|      return std::make_unique<ValueType<int32_t>>();
   43|  11.5k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 11.5k, False: 4.00M]
  ------------------
   44|  11.5k|      return std::make_unique<ValueType<Rational>>();
   45|  7.14k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 7.14k, False: 4.00M]
  ------------------
   46|  7.14k|      return std::make_unique<ValueType<float>>();
   47|  12.9k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 12.9k, False: 4.00M]
  ------------------
   48|  12.9k|      return std::make_unique<ValueType<double>>();
   49|  87.4k|    case string:
  ------------------
  |  Branch (49:5): [True: 87.4k, False: 3.92M]
  ------------------
   50|  87.4k|      return std::make_unique<StringValue>();
   51|  5.17k|    case date:
  ------------------
  |  Branch (51:5): [True: 5.17k, False: 4.00M]
  ------------------
   52|  5.17k|      return std::make_unique<DateValue>();
   53|  12.1k|    case time:
  ------------------
  |  Branch (53:5): [True: 12.1k, False: 4.00M]
  ------------------
   54|  12.1k|      return std::make_unique<TimeValue>();
   55|  6.65k|    case comment:
  ------------------
  |  Branch (55:5): [True: 6.65k, False: 4.00M]
  ------------------
   56|  6.65k|      return std::make_unique<CommentValue>();
   57|  45.7k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 45.7k, False: 3.96M]
  ------------------
   58|  45.7k|      return std::make_unique<XmpTextValue>();
   59|      9|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 9, False: 4.01M]
  ------------------
   60|  5.27k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 5.26k, False: 4.00M]
  ------------------
   61|  5.27k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 4.01M]
  ------------------
   62|  5.27k|      return std::make_unique<XmpArrayValue>(typeId);
   63|    663|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 663, False: 4.01M]
  ------------------
   64|    663|      return std::make_unique<LangAltValue>();
   65|  1.24M|    default:
  ------------------
  |  Branch (65:5): [True: 1.24M, False: 2.76M]
  ------------------
   66|  1.24M|      return std::make_unique<DataValue>(typeId);
   67|  4.01M|  }
   68|  4.01M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|    733|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|    733|  return -1;
   72|    733|}
_ZNK5Exiv25Value8toStringEv:
   74|   285k|std::string Value::toString() const {
   75|   285k|  std::ostringstream os;
   76|   285k|  write(os);
   77|   285k|  ok_ = !os.fail();
   78|   285k|  return os.str();
   79|   285k|}
_ZNK5Exiv25Value8toStringEm:
   81|   178k|std::string Value::toString(size_t /*n*/) const {
   82|   178k|  return toString();
   83|   178k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  41.1k|size_t Value::sizeDataArea() const {
   86|  41.1k|  return 0;
   87|  41.1k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|  2.53k|DataBuf Value::dataArea() const {
   90|  2.53k|  return {nullptr, 0};
   91|  2.53k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|  3.22M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|  3.22M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   96|     13|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   97|     13|  read(buf, len, byteOrder);
   98|     13|}
_ZNK5Exiv29DataValue5countEv:
  100|  12.0M|size_t DataValue::count() const {
  101|  12.0M|  return size();
  102|  12.0M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|  3.22M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|  3.22M|  value_.assign(buf, buf + len);
  107|  3.22M|  return 0;
  108|  3.22M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|  3.97M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|  3.97M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|  3.97M|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  26.6M|size_t DataValue::size() const {
  128|  26.6M|  return value_.size();
  129|  26.6M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  11.6M|DataValue* DataValue::clone_() const {
  132|  11.6M|  return new DataValue(*this);
  133|  11.6M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  2.27k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  2.27k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.61k, False: 663]
  ------------------
  137|  1.61k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|  1.61k|    os << static_cast<int>(value_.back());
  139|  1.61k|  }
  140|  2.27k|  return os;
  141|  2.27k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  70.1k|int64_t DataValue::toInt64(size_t n) const {
  149|  70.1k|  ok_ = true;
  150|  70.1k|  return value_.at(n);
  151|  70.1k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|  7.73M|uint32_t DataValue::toUint32(size_t n) const {
  154|  7.73M|  ok_ = true;
  155|  7.73M|  return value_.at(n);
  156|  7.73M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  57.5k|int StringValueBase::read(const std::string& buf) {
  173|  57.5k|  value_ = buf;
  174|  57.5k|  return 0;
  175|  57.5k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  77.6k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  77.6k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 77.6k, False: 0]
  ------------------
  180|  77.6k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  77.6k|  return 0;
  182|  77.6k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  88.1k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  88.1k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 49.8k, False: 38.2k]
  ------------------
  186|  49.8k|    return 0;
  187|       |  // byteOrder not needed
  188|  38.2k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  88.1k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|   107k|size_t StringValueBase::count() const {
  192|   107k|  return size();
  193|   107k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|   352k|size_t StringValueBase::size() const {
  196|   352k|  return value_.size();
  197|   352k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  199|  55.9k|std::ostream& StringValueBase::write(std::ostream& os) const {
  200|  55.9k|  return os << value_;
  201|  55.9k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  3.80k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  3.80k|  ok_ = true;
  205|  3.80k|  return value_.at(n);
  206|  3.80k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  14.6k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  14.6k|  ok_ = true;
  210|  14.6k|  return value_.at(n);
  211|  14.6k|}
_ZN5Exiv211StringValueC2Ev:
  223|  87.4k|StringValue::StringValue() : StringValueBase(string) {
  224|  87.4k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|   416k|StringValue* StringValue::clone_() const {
  230|   416k|  return new StringValue(*this);
  231|   416k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  43.7k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  43.7k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  4.75k|int AsciiValue::read(const std::string& buf) {
  240|  4.75k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  4.75k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 15, False: 4.74k]
  |  Branch (242:25): [True: 4.74k, False: 0]
  ------------------
  243|  4.75k|    value_ += '\0';
  244|  4.75k|  }
  245|  4.75k|  return 0;
  246|  4.75k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|   169k|AsciiValue* AsciiValue::clone_() const {
  249|   169k|  return new AsciiValue(*this);
  250|   169k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  35.0k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  35.0k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  35.0k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 7.50k, False: 27.5k]
  ------------------
  256|  7.50k|    pos = value_.size();
  257|  35.0k|  return os << value_.substr(0, pos);
  258|  35.0k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  285|  4.08k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  286|  4.08k|  int i = 0;
  287|  19.7k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (287:10): [True: 17.1k, False: 2.62k]
  |  Branch (287:10): [True: 15.6k, False: 4.08k]
  |  Branch (287:58): [True: 15.6k, False: 1.46k]
  ------------------
  288|  15.6k|  }
  289|  4.08k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (289:10): [True: 2.62k, False: 1.46k]
  ------------------
  290|  4.08k|}
_ZN5Exiv212CommentValueC2Ev:
  292|  6.65k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|  6.65k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|  6.65k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|  6.65k|  byteOrder_ = byteOrder;
  331|  6.65k|  return StringValueBase::read(buf, len, byteOrder);
  332|  6.65k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  334|  6.13k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  335|  6.13k|  std::string c = value_;
  336|  6.13k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (336:7): [True: 616, False: 5.52k]
  ------------------
  337|    616|    c = value_.substr(8);
  338|    616|    [[maybe_unused]] const size_t sz = c.size();
  339|    616|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (339:9): [True: 11, False: 605]
  |  Branch (339:39): [True: 0, False: 11]
  ------------------
  340|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  341|    616|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (341:16): [True: 605, False: 11]
  |  Branch (341:43): [True: 40, False: 565]
  ------------------
  342|     40|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  343|     40|    }
  344|    616|    c = value_.substr(0, 8) + c;
  345|    616|  }
  346|  6.13k|  if (c.empty())
  ------------------
  |  Branch (346:7): [True: 1.60k, False: 4.53k]
  ------------------
  347|  1.60k|    return 0;
  348|  4.53k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  349|  6.13k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  381|  6.13k|CommentValue::CharsetId CommentValue::charsetId() const {
  382|  6.13k|  CharsetId charsetId = undefined;
  383|  6.13k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (383:7): [True: 4.08k, False: 2.05k]
  ------------------
  384|  4.08k|    const std::string code = value_.substr(0, 8);
  385|  4.08k|    charsetId = CharsetInfo::charsetIdByCode(code);
  386|  4.08k|  }
  387|  6.13k|  return charsetId;
  388|  6.13k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|  17.4k|CommentValue* CommentValue::clone_() const {
  411|  17.4k|  return new CommentValue(*this);
  412|  17.4k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  17.3k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  17.3k|  xmpArrayType_ = xmpArrayType;
  416|  17.3k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  9.95k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  9.95k|  xmpStruct_ = xmpStruct;
  420|  9.95k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|   474k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|   474k|  return xmpArrayType_;
  424|   474k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  17.2k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  17.2k|  XmpArrayType xa = xaNone;
  428|  17.2k|  switch (typeId) {
  429|    571|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 571, False: 16.6k]
  ------------------
  430|    571|      xa = xaAlt;
  431|    571|      break;
  432|    351|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 351, False: 16.9k]
  ------------------
  433|    351|      xa = xaBag;
  434|    351|      break;
  435|  6.94k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 6.94k, False: 10.3k]
  ------------------
  436|  6.94k|      xa = xaSeq;
  437|  6.94k|      break;
  438|  9.38k|    default:
  ------------------
  |  Branch (438:5): [True: 9.38k, False: 7.86k]
  ------------------
  439|  9.38k|      break;
  440|  17.2k|  }
  441|  17.2k|  return xa;
  442|  17.2k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|   489k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|   489k|  return xmpStruct_;
  446|   489k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   154k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   154k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   815k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   815k|  std::string b = buf;
  478|   815k|  std::string type;
  479|   815k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 1.21k, False: 814k]
  ------------------
  480|  1.21k|    std::string::size_type pos = buf.find_first_of(' ');
  481|  1.21k|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|  1.21k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 704, False: 515]
  |  Branch (483:26): [True: 342, False: 362]
  ------------------
  484|    342|      type = type.substr(1);
  485|  1.21k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 665, False: 554]
  |  Branch (485:26): [True: 197, False: 468]
  ------------------
  486|    197|      type.pop_back();
  487|  1.21k|    b.clear();
  488|  1.21k|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 700, False: 519]
  ------------------
  489|    700|      b = buf.substr(pos + 1);
  490|  1.21k|  }
  491|   815k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 665, False: 815k]
  ------------------
  492|    665|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 36, False: 629]
  ------------------
  493|     36|      setXmpArrayType(XmpValue::xaAlt);
  494|    629|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 26, False: 603]
  ------------------
  495|     26|      setXmpArrayType(XmpValue::xaBag);
  496|    603|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 21, False: 582]
  ------------------
  497|     21|      setXmpArrayType(XmpValue::xaSeq);
  498|    582|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 191, False: 391]
  ------------------
  499|    191|      setXmpStruct();
  500|    391|    } else {
  501|    391|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    391|    }
  503|    665|  }
  504|   815k|  value_ = std::move(b);
  505|   815k|  return 0;
  506|   815k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  512|   100k|size_t XmpTextValue::size() const {
  513|   100k|  std::ostringstream os;
  514|   100k|  write(os);
  515|   100k|  return os.str().size();
  516|   100k|}
_ZNK5Exiv212XmpTextValue5countEv:
  518|   100k|size_t XmpTextValue::count() const {
  519|   100k|  return size();
  520|   100k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  522|   282k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  523|   282k|  bool del = false;
  524|   282k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (524:7): [True: 364, False: 282k]
  ------------------
  525|    364|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 364, False: 0]
  ------------------
  526|    135|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 135, False: 229]
  ------------------
  527|    135|        os << "type=\"Alt\"";
  528|    135|        break;
  529|      7|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 7, False: 357]
  ------------------
  530|      7|        os << "type=\"Bag\"";
  531|      7|        break;
  532|    222|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 222, False: 142]
  ------------------
  533|    222|        os << "type=\"Seq\"";
  534|    222|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 364]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|    364|    }
  538|    364|    del = true;
  539|   282k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 7.96k, False: 274k]
  ------------------
  540|  7.96k|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 7.96k, False: 0]
  ------------------
  541|  7.96k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 7.96k, False: 0]
  ------------------
  542|  7.96k|        os << "type=\"Struct\"";
  543|  7.96k|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 7.96k]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|  7.96k|    }
  547|  7.96k|    del = true;
  548|  7.96k|  }
  549|   282k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 8.33k, False: 274k]
  |  Branch (549:14): [True: 22, False: 8.30k]
  ------------------
  550|     22|    os << " ";
  551|   282k|  return os << value_;
  552|   282k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   348k|XmpTextValue* XmpTextValue::clone_() const {
  571|   348k|  return new XmpTextValue(*this);
  572|   348k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  7.49k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  7.49k|  setXmpArrayType(xmpArrayType(typeId));
  576|  7.49k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   143k|int XmpArrayValue::read(const std::string& buf) {
  579|   143k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 137k, False: 5.86k]
  ------------------
  580|   137k|    value_.push_back(buf);
  581|   143k|  return 0;
  582|   143k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|  64.6k|size_t XmpArrayValue::count() const {
  589|  64.6k|  return value_.size();
  590|  64.6k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    277|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    277|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 265, False: 12]
  ------------------
  594|    265|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    265|    os << value_.back();
  596|    265|  }
  597|    277|  return os;
  598|    277|}
_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|  14.7k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  14.7k|  return new XmpArrayValue(*this);
  623|  14.7k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|  1.82k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|  1.82k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  632|    663|int LangAltValue::read(const std::string& buf) {
  633|    663|  std::string b = buf;
  634|    663|  std::string lang = "x-default";
  635|    663|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (635:7): [True: 148, False: 515]
  ------------------
  636|    148|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  637|       |
  638|    148|    const std::string::size_type pos = buf.find_first_of(' ');
  639|    148|    if (pos == std::string::npos) {
  ------------------
  |  Branch (639:9): [True: 28, False: 120]
  ------------------
  640|     28|      lang = buf.substr(5);
  641|    120|    } else {
  642|    120|      lang = buf.substr(5, pos - 5);
  643|    120|    }
  644|    148|    if (lang.empty())
  ------------------
  |  Branch (644:9): [True: 3, False: 145]
  ------------------
  645|      3|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  646|       |    // Strip quotes (so you can also specify the language without quotes)
  647|    145|    if (lang.front() == '"') {
  ------------------
  |  Branch (647:9): [True: 59, False: 86]
  ------------------
  648|     59|      lang = lang.substr(1);
  649|       |
  650|     59|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (650:11): [True: 2, False: 57]
  |  Branch (650:27): [True: 28, False: 29]
  ------------------
  651|     30|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  652|       |
  653|     29|      lang.pop_back();
  654|     29|    }
  655|       |
  656|    115|    if (lang.empty())
  ------------------
  |  Branch (656:9): [True: 1, False: 114]
  ------------------
  657|      1|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  658|       |
  659|       |    // Check language is in the correct format (see https://www.ietf.org/rfc/rfc3066.txt)
  660|    114|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (660:55): [True: 54, False: 60]
  ------------------
  661|     54|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  662|     54|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (662:11): [True: 20, False: 34]
  |  Branch (662:38): [True: 10, False: 24]
  ------------------
  663|     30|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  664|     54|    }
  665|       |
  666|     84|    b.clear();
  667|     84|    if (pos != std::string::npos)
  ------------------
  |  Branch (667:9): [True: 67, False: 17]
  ------------------
  668|     67|      b = buf.substr(pos + 1);
  669|     84|  }
  670|       |
  671|    599|  value_[lang] = std::move(b);
  672|    599|  return 0;
  673|    663|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    520|size_t LangAltValue::count() const {
  680|    520|  return value_.size();
  681|    520|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|    179|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|    179|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|    179|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 179]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|    179|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 179, False: 179]
  ------------------
  694|    179|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 179, False: 0]
  ------------------
  695|    179|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 179]
  ------------------
  696|      0|        os << ", ";
  697|    179|      os << "lang=\"" << lang << "\" " << s;
  698|    179|      first = false;
  699|    179|    }
  700|    179|  }
  701|    179|  return os;
  702|    179|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    572|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    572|  return toString("x-default");
  706|    572|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    572|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    572|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 52, False: 520]
  ------------------
  710|     52|    ok_ = true;
  711|     52|    return i->second;
  712|     52|  }
  713|    520|  ok_ = false;
  714|    520|  return "";
  715|    572|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  2.61k|LangAltValue* LangAltValue::clone_() const {
  738|  2.61k|  return new LangAltValue(*this);
  739|  2.61k|}
_ZN5Exiv29DateValueC2Ev:
  741|  5.17k|DateValue::DateValue() : Value(date) {
  742|  5.17k|  date_ = {};
  743|  5.17k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  4.78k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  4.78k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  4.78k|  return read(str);
  752|  4.78k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  5.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|  5.17k|  size_t monthPos = 0;
  758|  5.17k|  size_t dayPos = 0;
  759|       |
  760|  5.17k|  auto printWarning = [] {
  761|  5.17k|#ifndef SUPPRESS_WARNINGS
  762|  5.17k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  5.17k|#endif
  764|  5.17k|  };
  765|       |
  766|  5.17k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 830, False: 4.34k]
  ------------------
  767|    830|    printWarning();
  768|    830|    return 1;
  769|    830|  }
  770|       |
  771|  4.34k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 2.73k, False: 1.61k]
  |  Branch (771:28): [True: 1.38k, False: 1.35k]
  |  Branch (771:45): [True: 228, False: 1.15k]
  |  Branch (771:63): [True: 1.60k, False: 2.51k]
  ------------------
  772|  1.83k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 228, False: 1.60k]
  ------------------
  773|    228|      monthPos = 5;
  774|    228|      dayPos = 8;
  775|  1.60k|    } else {
  776|  1.60k|      monthPos = 4;
  777|  1.60k|      dayPos = 6;
  778|  1.60k|    }
  779|       |
  780|  1.83k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  1.83k|      for (size_t i = start; i < start + count; ++i) {
  782|  1.83k|        if (!std::isdigit(buf[i])) {
  783|  1.83k|          printWarning();
  784|  1.83k|          return 1;
  785|  1.83k|        }
  786|  1.83k|      }
  787|  1.83k|      dest = std::stoul(buf.substr(start, count));
  788|  1.83k|      return 0;
  789|  1.83k|    };
  790|       |
  791|  1.83k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 796, False: 1.04k]
  |  Branch (791:42): [True: 416, False: 624]
  |  Branch (791:83): [True: 150, False: 474]
  ------------------
  792|  1.36k|      printWarning();
  793|  1.36k|      return 1;
  794|  1.36k|    }
  795|       |
  796|    474|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 250, False: 224]
  |  Branch (796:29): [True: 68, False: 156]
  ------------------
  797|    318|      date_.month = 0;
  798|    318|      date_.day = 0;
  799|    318|      printWarning();
  800|    318|      return 1;
  801|    318|    }
  802|    156|    return 0;
  803|    474|  }
  804|  2.51k|  printWarning();
  805|  2.51k|  return 1;
  806|  4.34k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  812|     72|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|     72|  auto out = reinterpret_cast<char*>(buf);
  817|     72|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|     72|#define stringFormatTo std::format_to
  ------------------
  818|       |
  819|     72|  return it - out;
  820|     72|}
_ZNK5Exiv29DateValue4sizeEv:
  830|    144|size_t DateValue::size() const {
  831|    144|  return 8;
  832|    144|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|  1.07k|DateValue* DateValue::clone_() const {
  835|  1.07k|  return new DateValue(*this);
  836|  1.07k|}
_ZN5Exiv29TimeValueC2Ev:
  877|  12.1k|TimeValue::TimeValue() : Value(time) {
  878|  12.1k|  time_ = {};
  879|  12.1k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  12.1k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  12.1k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  12.1k|  return read(str);
  888|  12.1k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  12.1k|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|  12.1k|  auto printWarning = [] {
  896|  12.1k|#ifndef SUPPRESS_WARNINGS
  897|  12.1k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  12.1k|#endif
  899|  12.1k|    return 1;
  900|  12.1k|  };
  901|       |
  902|  12.1k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 1.44k, False: 10.7k]
  ------------------
  903|  1.44k|    return printWarning();
  904|       |
  905|  10.7k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 103k, False: 6.83k]
  ------------------
  906|   103k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 99.3k, False: 4.42k]
  |  Branch (906:21): [True: 93.6k, False: 5.61k]
  |  Branch (906:33): [True: 87.8k, False: 5.81k]
  |  Branch (906:45): [True: 85.5k, False: 2.32k]
  |  Branch (906:57): [True: 3.87k, False: 81.6k]
  ------------------
  907|  3.87k|      return printWarning();
  908|       |
  909|  6.83k|  size_t mpos;
  910|  6.83k|  size_t spos;
  911|  6.83k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 2.80k, False: 4.02k]
  ------------------
  912|  2.80k|    mpos = 3;
  913|  2.80k|    spos = 6;
  914|  4.02k|  } else {
  915|  4.02k|    mpos = 2;
  916|  4.02k|    spos = 4;
  917|  4.02k|  }
  918|       |
  919|  6.83k|  try {
  920|  6.83k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  6.83k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 264, False: 6.57k]
  |  Branch (921:19): [True: 98, False: 6.47k]
  ------------------
  922|    188|      return printWarning();
  923|  6.64k|    time_.hour = hi;
  924|  6.64k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 5.04k, False: 1.60k]
  ------------------
  925|  5.04k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  5.04k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 363, False: 4.67k]
  |  Branch (926:21): [True: 77, False: 4.60k]
  ------------------
  927|    378|        return printWarning();
  928|  4.66k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  4.66k|    } else {
  930|  1.60k|      time_.minute = 0;
  931|  1.60k|    }
  932|  6.27k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 3.08k, False: 3.19k]
  ------------------
  933|  3.08k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  3.08k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 196, False: 2.88k]
  |  Branch (934:21): [True: 188, False: 2.69k]
  ------------------
  935|    310|        return printWarning();
  936|  2.77k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  3.19k|    } else {
  938|  3.19k|      time_.second = 0;
  939|  3.19k|    }
  940|       |
  941|  5.96k|    auto fpos = buf.find('+');
  942|  5.96k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 2.14k, False: 3.81k]
  ------------------
  943|  2.14k|      fpos = buf.find('-');
  944|       |
  945|  5.96k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 5.19k, False: 763]
  ------------------
  946|  5.19k|      auto format = buf.substr(fpos, buf.size());
  947|       |      // Use the sign of the raw offset string rather than of the parsed
  948|       |      // tzHour: when the hour magnitude is 0 (e.g. "-00:30"), std::stoi
  949|       |      // returns 0, which loses the '-' sign that std::stoi("-00") cannot
  950|       |      // preserve. format always starts with '+' or '-' (see fpos above).
  951|  5.19k|      const bool negative = format.at(0) == '-';
  952|  5.19k|      auto posColon = format.find(':');
  953|  5.19k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (953:11): [True: 2.84k, False: 2.35k]
  ------------------
  954|       |        // Extended format
  955|  2.84k|        auto tzhi = std::stoi(format.substr(0, 3));
  956|  2.84k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (956:13): [True: 169, False: 2.67k]
  |  Branch (956:27): [True: 925, False: 1.74k]
  ------------------
  957|  1.04k|          return printWarning();
  958|  1.79k|        time_.tzHour = tzhi;
  959|  1.79k|        if (format.size() > 3) {
  ------------------
  |  Branch (959:13): [True: 885, False: 910]
  ------------------
  960|    885|          int minute = std::stoi(format.substr(3));
  961|    885|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (961:15): [True: 237, False: 648]
  |  Branch (961:29): [True: 228, False: 420]
  ------------------
  962|    286|            return printWarning();
  963|    599|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (963:28): [True: 279, False: 320]
  ------------------
  964|    599|        }
  965|  2.35k|      } else {
  966|       |        // Basic format
  967|  2.35k|        auto tzhi = std::stoi(format.substr(0, posColon));
  968|  2.35k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (968:13): [True: 397, False: 1.95k]
  |  Branch (968:27): [True: 246, False: 1.71k]
  ------------------
  969|    574|          return printWarning();
  970|  1.78k|        time_.tzHour = tzhi;
  971|  1.78k|        int minute = std::stoi(format.substr(posColon + 1));
  972|  1.78k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (972:13): [True: 391, False: 1.39k]
  |  Branch (972:27): [True: 341, False: 1.04k]
  ------------------
  973|    565|          return printWarning();
  974|  1.21k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (974:26): [True: 204, False: 1.01k]
  ------------------
  975|  1.21k|      }
  976|  5.19k|    }
  977|  5.96k|  } catch (std::exception&) {
  978|       |    // std::stoi might throw an exception if the syntax is invalid.
  979|    703|    return printWarning();
  980|    703|  }
  981|  2.78k|  return 0;
  982|  6.83k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  989|    402|size_t TimeValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  990|       |  // NOTE: Here the time is copied in the Basic format HHMMSS:HHMM, as the IPTC key
  991|       |  // Iptc.Application2.TimeCreated wants it. Check https://exiv2.org/iptc.html
  992|    402|  char plusMinus = '+';
  993|    402|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (993:7): [True: 120, False: 282]
  |  Branch (993:27): [True: 15, False: 267]
  ------------------
  994|    135|    plusMinus = '-';
  995|       |
  996|    402|  auto out = reinterpret_cast<char*>(buf);
  997|    402|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    402|#define stringFormatTo std::format_to
  ------------------
  998|    402|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
  999|       |
 1000|    402|  auto wrote = static_cast<size_t>(it - out);
 1001|    402|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
 1002|    402|  return wrote;
 1003|    402|}
_ZNK5Exiv29TimeValue4sizeEv:
 1013|    804|size_t TimeValue::size() const {
 1014|    804|  return 11;
 1015|    804|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1017|  4.61k|TimeValue* TimeValue::clone_() const {
 1018|  4.61k|  return new TimeValue(*this);
 1019|  4.61k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  6.38k|  auto printWarning = [] {
  761|  6.38k|#ifndef SUPPRESS_WARNINGS
  762|  6.38k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  6.38k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.38k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.38k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  6.38k|#endif
  764|  6.38k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  3.50k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  11.5k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 9.43k, False: 2.13k]
  ------------------
  782|  9.43k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 1.36k, False: 8.07k]
  ------------------
  783|  1.36k|          printWarning();
  784|  1.36k|          return 1;
  785|  1.36k|        }
  786|  9.43k|      }
  787|  2.13k|      dest = std::stoul(buf.substr(start, count));
  788|  2.13k|      return 0;
  789|  3.50k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  9.36k|  auto printWarning = [] {
  896|  9.36k|#ifndef SUPPRESS_WARNINGS
  897|  9.36k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  9.36k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9.36k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  9.36k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  9.36k|#endif
  899|  9.36k|    return 1;
  900|  9.36k|  };

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

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   178k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   178k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 117k, False: 60.7k]
  ------------------
  253|   117k|    value_ = pValue->clone();
  254|   178k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   217k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   217k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 217k, False: 0]
  ------------------
  258|   217k|    key_ = rhs.key_->clone();  // deep copy
  259|   217k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 217k, False: 0]
  ------------------
  260|   217k|    value_ = rhs.value_->clone();  // deep copy
  261|   217k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  263|  3.40k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  264|  3.40k|  if (this == &rhs)
  ------------------
  |  Branch (264:7): [True: 0, False: 3.40k]
  ------------------
  265|      0|    return *this;
  266|  3.40k|  key_.reset();
  267|  3.40k|  if (rhs.key_)
  ------------------
  |  Branch (267:7): [True: 3.40k, False: 0]
  ------------------
  268|  3.40k|    key_ = rhs.key_->clone();  // deep copy
  269|  3.40k|  value_.reset();
  270|  3.40k|  if (rhs.value_)
  ------------------
  |  Branch (270:7): [True: 3.40k, False: 0]
  ------------------
  271|  3.40k|    value_ = rhs.value_->clone();  // deep copy
  272|  3.40k|  return *this;
  273|  3.40k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   178k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   178k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   217k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   217k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  281|  3.40k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  282|  3.40k|  if (this == &rhs)
  ------------------
  |  Branch (282:7): [True: 0, False: 3.40k]
  ------------------
  283|      0|    return *this;
  284|  3.40k|  *p_ = *rhs.p_;
  285|  3.40k|  return *this;
  286|  3.40k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   395k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  12.9M|std::string Xmpdatum::key() const {
  291|  12.9M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 12.9M, False: 0]
  ------------------
  292|  12.9M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  298|   102k|std::string Xmpdatum::groupName() const {
  299|   102k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (299:10): [True: 102k, False: 0]
  ------------------
  300|   102k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  302|   275k|std::string Xmpdatum::tagName() const {
  303|   275k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (303:10): [True: 275k, False: 0]
  ------------------
  304|   275k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|   509k|TypeId Xmpdatum::typeId() const {
  319|   509k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 509k, False: 0]
  ------------------
  320|   509k|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|   165k|size_t Xmpdatum::count() const {
  331|   165k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 165k, False: 0]
  ------------------
  332|   165k|}
_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|   360k|std::string Xmpdatum::toString(size_t n) const {
  343|   360k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 360k, False: 0]
  ------------------
  344|   360k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|   290k|const Value& Xmpdatum::value() const {
  363|   290k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 290k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|   290k|  return *p_->value_;
  366|   290k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  376|  27.6k|void Xmpdatum::setValue(const Value* pValue) {
  377|  27.6k|  p_->value_.reset();
  378|  27.6k|  if (pValue)
  ------------------
  |  Branch (378:7): [True: 27.6k, False: 0]
  ------------------
  379|  27.6k|    p_->value_ = pValue->clone();
  380|  27.6k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   772k|int Xmpdatum::setValue(const std::string& value) {
  383|   772k|  XmpProperties::XmpLock lock;
  384|   772k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 46.8k, False: 725k]
  ------------------
  385|  46.8k|    TypeId type = xmpText;
  386|  46.8k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 46.8k, False: 0]
  ------------------
  387|  46.8k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  46.8k|    }
  389|  46.8k|    p_->value_ = Value::create(type);
  390|  46.8k|  }
  391|   772k|  return p_->value_->read(value);
  392|   772k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   803k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   803k|  XmpProperties::XmpLock lock;
  396|   803k|  XmpKey xmpKey(key, lock);
  397|   803k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   803k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 60.7k, False: 742k]
  ------------------
  399|  60.7k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  60.7k|  }
  401|   742k|  return *pos;
  402|   803k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  4.83k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  4.83k|  XmpProperties::XmpLock lock;
  406|  4.83k|  return addUnlocked(key, value, lock);
  407|  4.83k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   117k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   117k|  xmpMetadata_.emplace_back(key, value);
  411|   117k|  return 0;
  412|   117k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  16.1k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  16.1k|  XmpProperties::XmpLock lock;
  426|  16.1k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  16.1k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   319k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   319k|  XmpProperties::XmpLock lock;
  431|   319k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   319k|}
_ZN5Exiv27XmpData5clearEv:
  434|  42.2k|void XmpData::clear() {
  435|  42.2k|  XmpProperties::XmpLock lock;
  436|  42.2k|  clearUnlocked(lock);
  437|  42.2k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  50.0k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  50.0k|  xmpMetadata_.clear();
  441|  50.0k|  nsBindings_.clear();
  442|  50.0k|}
_ZNK5Exiv27XmpData5beginEv:
  453|  2.90k|XmpData::const_iterator XmpData::begin() const {
  454|  2.90k|  return xmpMetadata_.begin();
  455|  2.90k|}
_ZNK5Exiv27XmpData3endEv:
  457|  19.0k|XmpData::const_iterator XmpData::end() const {
  458|  19.0k|  return xmpMetadata_.end();
  459|  19.0k|}
_ZNK5Exiv27XmpData5emptyEv:
  461|  2.25k|bool XmpData::empty() const {
  462|  2.25k|  XmpProperties::XmpLock lock;
  463|  2.25k|  return emptyUnlocked(lock);
  464|  2.25k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  466|  35.1k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  467|  35.1k|  return xmpMetadata_.empty();
  468|  35.1k|}
_ZN5Exiv27XmpData5beginEv:
  479|  7.18k|XmpData::iterator XmpData::begin() {
  480|  7.18k|  return xmpMetadata_.begin();
  481|  7.18k|}
_ZN5Exiv27XmpData3endEv:
  483|   326k|XmpData::iterator XmpData::end() {
  484|   326k|  return xmpMetadata_.end();
  485|   326k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  487|  1.20k|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  488|  1.20k|  XmpProperties::XmpLock lock;
  489|  1.20k|  return xmpMetadata_.erase(pos);
  490|  1.20k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  536|  97.5k|void xmpToolkitEnsureInitialized() {
  537|  97.5k|  static XmpToolkitLifetimeManager instance;
  538|  97.5k|  (void)instance;
  539|  97.5k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  541|  56.9k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  542|  56.9k|  xmpToolkitEnsureInitialized();
  543|  56.9k|  try {
  544|  56.9k|    std::string existingPrefix;
  545|  56.9k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (545:9): [True: 56.9k, False: 8]
  ------------------
  546|  56.9k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (546:11): [True: 56.9k, False: 0]
  |  Branch (546:38): [True: 56.9k, False: 0]
  ------------------
  547|  56.9k|        existingPrefix.pop_back();
  548|  56.9k|      }
  549|  56.9k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (549:11): [True: 56.4k, False: 495]
  ------------------
  550|       |        // Already registered correctly, skip overhead
  551|  56.4k|        return;
  552|  56.4k|      }
  553|  56.9k|    }
  554|       |
  555|    503|    SXMPMeta::DeleteNamespace(ns.c_str());
  556|       |#ifdef EXV_ADOBE_XMPSDK
  557|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  558|       |#else
  559|    503|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  560|    503|#endif
  561|    503|  } catch (const XMP_Error& /* e */) {
  562|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  563|      0|  }
  564|  56.9k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  661|  8.60k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  662|  8.60k|  try {
  663|  8.60k|    xmpData.setPacket(xmpPacket);
  664|  8.60k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (664:9): [True: 830, False: 7.77k]
  ------------------
  665|    830|      xmpData.clear();
  666|    830|      return 0;
  667|    830|    }
  668|       |
  669|       |    // Acquire Giant Lock
  670|  7.77k|    XmpProperties::XmpLock lock;
  671|  7.77k|    try {
  672|  7.77k|      xmpToolkitEnsureInitialized();
  673|  7.77k|    } catch (const Error&) {
  674|      0|#ifndef SUPPRESS_WARNINGS
  675|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  676|      0|#endif
  677|      0|      return 2;
  678|      0|    }
  679|       |
  680|  7.77k|    xmpData.clearUnlocked(lock);
  681|       |
  682|       |    // Make sure the unterminated substring is used
  683|  7.77k|    size_t len = xmpPacket.size();
  684|  1.06M|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (684:12): [True: 1.06M, False: 191]
  |  Branch (684:23): [True: 1.05M, False: 7.58k]
  ------------------
  685|  1.05M|      --len;
  686|       |
  687|  7.77k|    XMLValidator::check(xmpPacket.data(), len);
  688|  7.77k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  689|  7.77k|    SXMPIterator iter(meta);
  690|  7.77k|    std::string schemaNs;
  691|  7.77k|    std::string propPath;
  692|  7.77k|    std::string propValue;
  693|  7.77k|    XMP_OptionBits opt = 0;
  694|   130k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (694:12): [True: 122k, False: 7.77k]
  ------------------
  695|   122k|      printNode(schemaNs, propPath, propValue, opt);
  696|   122k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (696:11): [True: 0, False: 122k]
  ------------------
  697|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  698|      0|      }
  699|   122k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (699:11): [True: 9.79k, False: 112k]
  ------------------
  700|       |        // Register unknown namespaces with Exiv2
  701|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  702|  9.79k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  703|  9.79k|        if (prefix.empty()) {
  ------------------
  |  Branch (703:13): [True: 8.18k, False: 1.60k]
  ------------------
  704|  8.18k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (704:15): [True: 0, False: 8.18k]
  ------------------
  705|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  706|  8.18k|          prefix.pop_back();
  707|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  708|       |          // already globally bound -- a built-in standard prefix, or one a prior
  709|       |          // explicit registerNs() established -- to a different URI.  Letting it
  710|       |          // would poison every later write and lookup in this process (the
  711|       |          // namespace-leak bug).  The packet's own binding is still captured
  712|       |          // per-instance below, so this object round-trips faithfully; we just
  713|       |          // don't pollute the global registry on a read.
  714|  8.18k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (714:15): [True: 30, False: 8.15k]
  ------------------
  715|     30|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  716|  8.18k|        }
  717|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  718|       |        // encode() can resolve each property's URI from the data it came from,
  719|       |        // rather than from the process-global registry which another image may
  720|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  721|  9.79k|        xmpData.nsBindings_[prefix] = schemaNs;
  722|  9.79k|        continue;
  723|  9.79k|      }
  724|   112k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  725|   112k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (725:11): [True: 1.16k, False: 111k]
  ------------------
  726|       |        // Read Lang Alt property
  727|  1.16k|        auto val = std::make_unique<LangAltValue>();
  728|  1.16k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  729|  7.93k|        while (count-- > 0) {
  ------------------
  |  Branch (729:16): [True: 6.76k, False: 1.16k]
  ------------------
  730|       |          // Get the text
  731|  6.76k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  732|  6.76k|          printNode(schemaNs, propPath, propValue, opt);
  733|  6.76k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (733:15): [True: 0, False: 6.76k]
  |  Branch (733:28): [True: 0, False: 6.76k]
  |  Branch (733:54): [True: 0, False: 6.76k]
  ------------------
  734|      0|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  735|      0|          }
  736|  6.76k|          std::string text = propValue;
  737|       |          // Get the language qualifier
  738|  6.76k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  739|  6.76k|          printNode(schemaNs, propPath, propValue, opt);
  740|  6.76k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (740:15): [True: 0, False: 6.76k]
  |  Branch (740:15): [True: 0, False: 6.76k]
  |  Branch (740:28): [True: 0, False: 6.76k]
  |  Branch (740:54): [True: 0, False: 6.76k]
  ------------------
  741|  6.76k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (741:15): [True: 0, False: 6.76k]
  ------------------
  742|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  743|      0|          }
  744|  6.76k|          val->value_[propValue] = std::move(text);
  745|  6.76k|        }
  746|  1.16k|        xmpData.addUnlocked(*key, val.get(), lock);
  747|  1.16k|        continue;
  748|  1.16k|      }
  749|   111k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (749:11): [True: 2.58k, False: 108k]
  |  Branch (749:35): [True: 2.58k, False: 0]
  |  Branch (749:66): [True: 2.58k, False: 0]
  ------------------
  750|       |        // Check if all elements are simple
  751|  2.58k|        bool simpleArray = true;
  752|  2.58k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  753|  2.58k|        std::string aSchemaNs;
  754|  2.58k|        std::string aPropPath;
  755|  2.58k|        std::string aPropValue;
  756|  2.58k|        XMP_OptionBits aOpt = 0;
  757|  68.1k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (757:16): [True: 65.9k, False: 2.21k]
  ------------------
  758|  65.9k|          if (propPath == aPropPath)
  ------------------
  |  Branch (758:15): [True: 2.58k, False: 63.3k]
  ------------------
  759|  2.58k|            continue;
  760|  63.3k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (760:15): [True: 180, False: 63.1k]
  |  Branch (760:42): [True: 193, False: 62.9k]
  |  Branch (760:73): [True: 0, False: 62.9k]
  ------------------
  761|  63.3k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (761:15): [True: 0, False: 62.9k]
  |  Branch (761:41): [True: 0, False: 62.9k]
  ------------------
  762|    373|            simpleArray = false;
  763|    373|            break;
  764|    373|          }
  765|  63.3k|        }
  766|  2.58k|        if (simpleArray) {
  ------------------
  |  Branch (766:13): [True: 2.21k, False: 373]
  ------------------
  767|       |          // Read the array into an XmpArrayValue
  768|  2.21k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  769|  2.21k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  770|  63.8k|          while (count-- > 0) {
  ------------------
  |  Branch (770:18): [True: 61.6k, False: 2.21k]
  ------------------
  771|  61.6k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  772|  61.6k|            printNode(schemaNs, propPath, propValue, opt);
  773|  61.6k|            val->read(propValue);
  774|  61.6k|          }
  775|  2.21k|          xmpData.addUnlocked(*key, val.get(), lock);
  776|  2.21k|          continue;
  777|  2.21k|        }
  778|  2.58k|      }
  779|       |
  780|   109k|      auto val = std::make_unique<XmpTextValue>();
  781|   109k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (781:11): [True: 9.38k, False: 99.8k]
  |  Branch (781:36): [True: 373, False: 99.4k]
  ------------------
  782|       |        // Create a metadatum with only XMP options
  783|  9.76k|        val->setXmpArrayType(xmpArrayType(opt));
  784|  9.76k|        val->setXmpStruct(xmpStruct(opt));
  785|  9.76k|        xmpData.addUnlocked(*key, val.get(), lock);
  786|  9.76k|        continue;
  787|  9.76k|      }
  788|  99.4k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (788:11): [True: 99.4k, False: 0]
  |  Branch (788:36): [True: 0, False: 0]
  ------------------
  789|  99.4k|        val->read(propValue);
  790|  99.4k|        xmpData.addUnlocked(*key, val.get(), lock);
  791|  99.4k|        continue;
  792|  99.4k|      }
  793|       |      // Don't let any node go by unnoticed
  794|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  795|  99.4k|    }  // iterate through all XMP nodes
  796|       |
  797|  7.77k|    return 0;
  798|  7.77k|  }
  799|  8.60k|#ifndef SUPPRESS_WARNINGS
  800|  8.60k|  catch (const Error& e) {
  801|     72|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (801:9): [True: 0, False: 72]
  ------------------
  802|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  803|      0|    }
  804|     72|    throw;
  805|  3.28k|  } catch (const XMP_Error& e) {
  806|  3.28k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  3.28k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.28k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.28k|  LogMsg(LogMsg::error).os()
  ------------------
  807|  3.28k|    xmpData.clear();
  808|  3.28k|    return 3;
  809|  3.28k|  }
  810|       |#else
  811|       |  catch (const XMP_Error&) {
  812|       |    xmpData.clear();
  813|       |    return 3;
  814|       |  }
  815|       |#endif  // SUPPRESS_WARNINGS
  816|  8.60k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  830|  32.8k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  831|  32.8k|  try {
  832|       |    // Acquire Giant Lock
  833|  32.8k|    XmpProperties::XmpLock lock;
  834|  32.8k|    try {
  835|  32.8k|      xmpToolkitEnsureInitialized();
  836|  32.8k|    } catch (const Error&) {
  837|      0|#ifndef SUPPRESS_WARNINGS
  838|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  839|      0|#endif
  840|      0|      return 2;
  841|      0|    }
  842|       |
  843|  32.8k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (843:9): [True: 29.9k, False: 2.90k]
  ------------------
  844|  29.9k|      xmpPacket.clear();
  845|  29.9k|      return 0;
  846|  29.9k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  847|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  848|  56.9k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (848:33): [True: 56.9k, False: 2.90k]
  ------------------
  849|       |#ifdef EXIV2_DEBUG_MESSAGES
  850|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  851|       |#endif
  852|       |      // registerNsImpl is safe since we hold the lock
  853|  56.9k|      registerNsImpl(xmp, uri.prefix_);
  854|  56.9k|    }
  855|       |
  856|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  857|       |    // the toolkit here.  Every URI they contain was already registered while its
  858|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  859|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  860|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  861|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  862|       |    // serialization of struct fields that still carry the file's prefix.
  863|  2.90k|    SXMPMeta meta;
  864|   102k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (864:26): [True: 102k, False: 2.90k]
  ------------------
  865|   102k|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  866|   102k|      XMP_OptionBits options = 0;
  867|       |
  868|   102k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (868:11): [True: 872, False: 101k]
  ------------------
  869|       |        // Encode Lang Alt property
  870|    872|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  871|    872|        if (!la)
  ------------------
  |  Branch (871:13): [True: 0, False: 872]
  ------------------
  872|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  873|       |
  874|    872|        int idx = 1;
  875|  3.17k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (875:40): [True: 3.17k, False: 872]
  ------------------
  876|  3.17k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (876:15): [True: 3.14k, False: 34]
  ------------------
  877|  3.14k|            printNode(ns, xmp.tagName(), specs, 0);
  878|  3.14k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  879|  3.14k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  880|  3.14k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  881|  3.14k|          }
  882|  3.17k|        }
  883|    872|        continue;
  884|    872|      }
  885|       |
  886|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  887|   101k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  888|   101k|      if (!val)
  ------------------
  |  Branch (888:11): [True: 0, False: 101k]
  ------------------
  889|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  890|   101k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  891|   101k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (891:11): [True: 194, False: 101k]
  |  Branch (891:37): [True: 1.20k, False: 100k]
  |  Branch (891:63): [True: 240, False: 100k]
  ------------------
  892|  1.63k|        printNode(ns, xmp.tagName(), "", options);
  893|  1.63k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  894|  64.4k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (894:30): [True: 62.7k, False: 1.63k]
  ------------------
  895|  62.7k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  896|  62.7k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  897|  62.7k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  898|  62.7k|        }
  899|  1.63k|        continue;
  900|  1.63k|      }
  901|   100k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (901:11): [True: 100k, False: 0]
  ------------------
  902|   100k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  903|   100k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (903:13): [True: 2.86k, False: 97.1k]
  |  Branch (903:33): [True: 7.75k, False: 89.3k]
  |  Branch (903:72): [True: 281, False: 89.1k]
  ------------------
  904|  10.8k|          printNode(ns, xmp.tagName(), "", options);
  905|  10.8k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  906|  89.1k|        } else {
  907|  89.1k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  908|  89.1k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  909|  89.1k|        }
  910|   100k|        continue;
  911|   100k|      }
  912|       |      // Don't let any Xmpdatum go by unnoticed
  913|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  914|   100k|    }
  915|  2.90k|    std::string tmpPacket;
  916|  2.90k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  917|  2.90k|                           padding);  // throws
  918|  2.90k|    xmpPacket = std::move(tmpPacket);
  919|       |
  920|  2.90k|    return 0;
  921|  2.90k|  }
  922|  32.8k|#ifndef SUPPRESS_WARNINGS
  923|  32.8k|  catch (const Error& /* e */) {
  924|      0|    throw;
  925|    171|  } catch (const XMP_Error& e) {
  926|    171|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    171|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 171]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    171|  LogMsg(LogMsg::error).os()
  ------------------
  927|    171|    return 3;
  928|    171|  }
  929|       |#else
  930|       |  catch (const XMP_Error&) {
  931|       |    return 3;
  932|       |  }
  933|       |#endif  // SUPPRESS_WARNINGS
  934|  32.8k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1096|   112k|                                                      const XmpProperties::XmpLock& lock) {
 1097|   112k|  std::string property;
 1098|   112k|  std::string::size_type idx = propPath.find(':');
 1099|   112k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 112k]
  ------------------
 1100|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1101|      0|  }
 1102|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1103|   112k|  property = propPath.substr(idx + 1);
 1104|   112k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1105|   112k|  if (prefix.empty()) {
  ------------------
  |  Branch (1105:7): [True: 36.1k, False: 76.4k]
  ------------------
 1106|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1107|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1108|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1109|       |    // the property still gets a key; its URI is preserved per-instance.
 1110|  36.1k|    std::string toolkitPrefix;
 1111|  36.1k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1111:9): [True: 36.1k, False: 0]
  ------------------
 1112|  36.1k|      toolkitPrefix.pop_back();
 1113|  36.1k|      prefix = std::move(toolkitPrefix);
 1114|  36.1k|    }
 1115|  36.1k|  }
 1116|   112k|  if (prefix.empty()) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 112k]
  ------------------
 1117|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1118|      0|  }
 1119|   112k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1120|   112k|}  // makeXmpKey
_ZN5Exiv29XmpParser16resolveNamespaceERKNS_7XmpDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 1123|   102k|                                               const XmpProperties::XmpLock& lock) {
 1124|   102k|  const auto& nsBindings = xmpData.nsBindings();
 1125|   102k|  const auto binding = nsBindings.find(prefix);
 1126|   102k|  return binding != nsBindings.end() ? binding->second : XmpProperties::nsUnlocked(prefix, lock);
  ------------------
  |  Branch (1126:10): [True: 101k, False: 728]
  ------------------
 1127|   102k|}  // resolveNamespace
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  12.8M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  12.8M|    return key_ == xmpdatum.key();
  203|  12.8M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|  1.13M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|  1.13M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  7.77k|  static void check(const char* buf, size_t buflen) {
   67|  7.77k|    XMLValidator validator;
   68|  7.77k|    validator.check_internal(buf, buflen);
   69|  7.77k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  7.77k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  7.77k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 7.77k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  7.77k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  7.77k|  void check_internal(const char* buf, size_t buflen) {
  103|  7.77k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 7.77k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  7.77k|    XML_SetUserData(parser_, this);
  108|  7.77k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  7.77k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  7.77k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  7.77k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 1.79k, False: 5.97k]
  ------------------
  113|  1.79k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  1.79k|    }
  115|       |
  116|  7.77k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 1.79k, False: 5.97k]
  ------------------
  117|  1.79k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  1.79k|    }
  119|  7.77k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   152k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   152k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   152k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   152k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   152k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 496, False: 152k]
  ------------------
  123|    496|      setError("Too deeply nested");
  124|    496|    }
  125|   152k|    ++element_depth_;
  126|   152k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   135k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   135k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   135k|  void endElement(const XML_Char*) noexcept {
  129|   135k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 135k, False: 0]
  ------------------
  130|   135k|      --element_depth_;
  131|   135k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  52.1k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  52.1k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  52.1k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  52.1k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  52.1k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 286, False: 51.8k]
  ------------------
  138|    286|      setError("Too deeply nested");
  139|    286|    }
  140|  52.1k|    ++namespace_depth_;
  141|  52.1k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  42.9k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  42.9k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  42.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  42.9k|  void endNamespace(const XML_Char*) noexcept {
  144|  42.9k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 42.9k, False: 0]
  ------------------
  145|  42.9k|      --namespace_depth_;
  146|  42.9k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  42.9k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  181|     18|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  182|     18|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  183|     18|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  151|     18|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  152|       |    // DOCTYPE is used for XXE attacks.
  153|     18|    setError("DOCTYPE not supported");
  154|     18|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  2.59k|  void setError(const char* msg) {
   88|  2.59k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  2.59k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  2.59k|#ifndef SUPPRESS_WARNINGS
   91|  2.59k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  2.59k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 2.59k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  2.59k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  2.59k|#endif
   93|       |    // If this is the first error, then save it.
   94|  2.59k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 1.79k, False: 800]
  ------------------
   95|  1.79k|      haserror_ = true;
   96|  1.79k|      errmsg_ = msg;
   97|  1.79k|      errlinenum_ = errlinenum;
   98|  1.79k|      errcolnum_ = errcolnum;
   99|  1.79k|    }
  100|  2.59k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  7.77k|  ~XMLValidator() {
   84|  7.77k|    XML_ParserFree(parser_);
   85|  7.77k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  953|  9.76k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  954|  9.76k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  955|  9.76k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (955:7): [True: 9.38k, False: 373]
  ------------------
  956|  9.38k|    var = Exiv2::XmpValue::xsStruct;
  957|  9.38k|  }
  958|  9.76k|  return var;
  959|  9.76k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  961|   101k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  962|   101k|  XMP_OptionBits var(0);
  963|   101k|  switch (xs) {
  ------------------
  |  Branch (963:11): [True: 101k, False: 0]
  ------------------
  964|  93.8k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (964:5): [True: 93.8k, False: 7.75k]
  ------------------
  965|  93.8k|      break;
  966|  7.75k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (966:5): [True: 7.75k, False: 93.8k]
  ------------------
  967|  7.75k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  968|  7.75k|      break;
  969|   101k|  }
  970|   101k|  return var;
  971|   101k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  973|  11.9k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  974|  11.9k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  975|  11.9k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (975:7): [True: 2.58k, False: 9.38k]
  ------------------
  976|  2.58k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (976:9): [True: 571, False: 2.01k]
  ------------------
  977|    571|      typeId = Exiv2::xmpAlt;
  978|  2.01k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (978:14): [True: 1.67k, False: 342]
  ------------------
  979|  1.67k|      typeId = Exiv2::xmpSeq;
  980|    342|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (980:14): [True: 342, False: 0]
  ------------------
  981|    342|      typeId = Exiv2::xmpBag;
  982|  2.58k|  }
  983|  11.9k|  return typeId;
  984|  11.9k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  986|  9.76k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  987|  9.76k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  988|  9.76k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
  990|   101k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
  991|   101k|  XMP_OptionBits var(0);
  992|   101k|  switch (xat) {
  ------------------
  |  Branch (992:11): [True: 101k, False: 0]
  ------------------
  993|  99.7k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (993:5): [True: 99.7k, False: 1.91k]
  ------------------
  994|  99.7k|      break;
  995|    294|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (995:5): [True: 294, False: 101k]
  ------------------
  996|    294|      XMP_SetOption(var, kXMP_PropValueIsArray);
  997|    294|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
  998|    294|      break;
  999|  1.42k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (999:5): [True: 1.42k, False: 100k]
  ------------------
 1000|  1.42k|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1001|  1.42k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
 1002|  1.42k|      break;
 1003|    201|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (1003:5): [True: 201, False: 101k]
  ------------------
 1004|    201|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1005|    201|      break;
 1006|   101k|  }
 1007|   101k|  return var;
 1008|   101k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
 1014|  2.73k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
 1015|  2.73k|  XMP_OptionBits var(0);
 1016|  2.73k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (1016:7): [True: 1.33k, False: 1.39k]
  ------------------
 1017|  1.33k|    var |= kXMP_OmitPacketWrapper;
 1018|  2.73k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (1018:7): [True: 0, False: 2.73k]
  ------------------
 1019|      0|    var |= kXMP_ReadOnlyPacket;
 1020|  2.73k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1020:7): [True: 2.73k, False: 0]
  ------------------
 1021|  2.73k|    var |= kXMP_UseCompactFormat;
 1022|  2.73k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1022:7): [True: 0, False: 2.73k]
  ------------------
 1023|      0|    var |= kXMP_IncludeThumbnailPad;
 1024|  2.73k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1024:7): [True: 0, False: 2.73k]
  ------------------
 1025|      0|    var |= kXMP_ExactPacketLength;
 1026|  2.73k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1026:7): [True: 0, False: 2.73k]
  ------------------
 1027|      0|    var |= kXMP_WriteAliasComments;
 1028|  2.73k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1028:7): [True: 14, False: 2.72k]
  ------------------
 1029|     14|    var |= kXMP_OmitAllFormatting;
 1030|  2.73k|  return var;
 1031|  2.73k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1089|   365k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1090|   365k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   395k|  ~Impl() = default;

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

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

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  5.34k|{
  625|  5.34k|	IgnoreParam(options);
  ------------------
  |  |  117|  5.34k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  5.34k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  5.34k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  5.34k|{
  647|       |
  648|  5.34k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 21, False: 5.32k]
  ------------------
  649|  5.32k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  5.32k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  5.32k|{
  664|  5.32k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  5.32k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  5.32k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  5.32k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  24.9k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 19.6k, False: 5.32k]
  ------------------
  670|  19.6k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 14.2k, False: 5.41k]
  ------------------
  671|  5.41k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  5.41k|	}
  673|       |
  674|  5.32k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  10.0k|{
  695|  10.0k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  10.0k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.74k, False: 5.35k]
  |  Branch (696:45): [True: 22, False: 4.72k]
  ------------------
  697|     22|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  10.0k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 5.41k, False: 4.66k]
  |  Branch (700:21): [True: 116, False: 5.29k]
  ------------------
  701|    116|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    116|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  9.95k|	} else {
  703|  9.95k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  9.95k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  9.95k|	}
  706|       |
  707|  10.0k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   276k|{
  265|   276k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   276k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 276k, False: 275]
  |  Branch (269:28): [True: 110k, False: 166k]
  ------------------
  270|       |
  271|   110k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 86.2k, False: 23.8k]
  ------------------
  272|  86.2k|			term = kRDFTerm_li;
  273|  86.2k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 25, False: 23.8k]
  ------------------
  274|     25|			term = kRDFTerm_parseType;
  275|  23.8k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 5.36k, False: 18.4k]
  ------------------
  276|  5.36k|			term = kRDFTerm_Description;
  277|  18.4k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.05k, False: 17.4k]
  ------------------
  278|  1.05k|			term = kRDFTerm_about;
  279|  17.4k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 51, False: 17.3k]
  ------------------
  280|     51|			term = kRDFTerm_resource;
  281|  17.3k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 27, False: 17.3k]
  ------------------
  282|     27|			term = kRDFTerm_RDF;
  283|  17.3k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 107, False: 17.2k]
  ------------------
  284|    107|			term = kRDFTerm_ID;
  285|  17.2k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 78, False: 17.1k]
  ------------------
  286|     78|			term = kRDFTerm_nodeID;
  287|  17.1k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 10, False: 17.1k]
  ------------------
  288|     10|			term = kRDFTerm_datatype;
  289|  17.1k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 10, False: 17.1k]
  ------------------
  290|     10|			term = kRDFTerm_aboutEach;
  291|  17.1k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 20, False: 17.1k]
  ------------------
  292|     20|			term = kRDFTerm_aboutEachPrefix;
  293|  17.1k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 34, False: 17.0k]
  ------------------
  294|     34|			term = kRDFTerm_bagID;
  295|     34|		}
  296|       |
  297|   110k|	}
  298|       |
  299|   276k|	return term;
  300|       |
  301|   276k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  9.95k|{
  732|  9.95k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  9.95k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  9.95k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  28.6k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 19.0k, False: 9.57k]
  ------------------
  738|       |
  739|  19.0k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  19.0k|		switch ( attrTerm ) {
  742|       |
  743|     55|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 55, False: 18.9k]
  ------------------
  744|     73|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 18, False: 19.0k]
  ------------------
  745|  1.12k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.05k, False: 17.9k]
  ------------------
  746|       |
  747|  1.12k|				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.11k]
  ------------------
  748|  1.11k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.11k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.09k, False: 21]
  |  Branch (750:24): [True: 1.04k, False: 48]
  ------------------
  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.04k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.04k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.04k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 958, False: 91]
  ------------------
  755|    958|						xmpParent->name = (*currAttr)->value;
  756|    958|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 81, False: 10]
  ------------------
  757|     81|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     65|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 65, False: 16]
  ------------------
  758|     16|					}
  759|  1.04k|				}
  760|       |
  761|  1.05k|				break;
  762|       |
  763|  17.8k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 17.8k, False: 1.20k]
  ------------------
  764|  17.8k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  17.8k|				break;
  766|       |
  767|     80|			default :
  ------------------
  |  Branch (767:4): [True: 80, False: 18.9k]
  ------------------
  768|     80|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     80|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  19.0k|		}
  771|       |
  772|  19.0k|	}
  773|       |
  774|  9.95k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   145k|{
  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|   145k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 311, False: 144k]
  ------------------
  371|    311|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    311|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   144k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   144k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   144k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   144k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   144k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 26.4k, False: 118k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  26.4k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  26.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  26.4k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  26.4k|#define kXMP_CreateNodes	true
  ------------------
  384|  26.4k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  26.4k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  13.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 13.0k, False: 13.3k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  26.4k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  26.4k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 26.4k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  26.4k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   144k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 58.6k, False: 86.0k]
  ------------------
  398|  58.6k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  58.6k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 57, False: 58.5k]
  ------------------
  399|     57|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     57|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  58.6k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   144k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   144k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 144k, False: 49]
  |  Branch (406:26): [True: 21, False: 28]
  ------------------
  407|   144k|		 xmpParent->children.push_back ( newChild );
  408|   144k|	} else {
  409|     37|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     37|	}
  411|   144k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 49, False: 144k]
  ------------------
  412|     49|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     44|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 34, False: 15]
  |  Branch (412:22): [True: 10, False: 5]
  ------------------
  413|      5|		xmpParent->options |= kRDF_HasValueElem;
  414|      5|	}
  415|       |	
  416|   144k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 86.0k, False: 58.5k]
  ------------------
  417|  86.0k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     13|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 13, False: 86.0k]
  ------------------
  418|  86.0k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  86.0k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  86.0k|	}
  423|       |	
  424|   144k|	return newChild;
  425|       |
  426|   144k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  9.87k|{
  787|  9.87k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  9.87k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   309k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 299k, False: 9.75k]
  ------------------
  791|   299k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 203k, False: 96.4k]
  ------------------
  792|  96.4k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 120, False: 96.3k]
  ------------------
  793|    120|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    120|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  96.3k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  96.3k|	}
  797|       |
  798|  9.87k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  96.3k|{
  854|  96.3k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  96.3k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 35, False: 96.3k]
  ------------------
  856|       |	
  857|  96.3k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 5.80k, False: 90.5k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  5.80k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  90.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|  90.5k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  90.5k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  90.5k|		XMP_VarString * attrName = 0;
  870|       |
  871|   102k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 18.3k, False: 83.8k]
  ------------------
  872|  18.3k|			attrName = &((*currAttr)->name);
  873|  18.3k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 6.71k, False: 11.6k]
  |  Branch (873:38): [True: 6.69k, False: 26]
  ------------------
  874|  18.3k|		}
  875|       |
  876|  90.5k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 6.69k, False: 83.8k]
  ------------------
  877|       |
  878|  6.69k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  6.69k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  6.69k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  6.69k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 81, False: 6.61k]
  ------------------
  882|     81|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  6.61k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 6.22k, False: 390]
  ------------------
  884|  6.22k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  6.22k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 10, False: 380]
  ------------------
  886|     10|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    380|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 307, False: 73]
  ------------------
  888|    307|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    307|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 73]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     73|			} else {
  892|     73|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     73|			}
  894|       |
  895|  83.8k|		} 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|  83.8k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 558, False: 83.2k]
  ------------------
  901|       |
  902|    558|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  83.2k|			} else {
  905|       |			
  906|  83.2k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  83.2k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|   192k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 114k, False: 78.4k]
  ------------------
  910|   114k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 4.76k, False: 109k]
  ------------------
  911|   114k|				}
  912|       |				
  913|  83.2k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 78.4k, False: 4.76k]
  ------------------
  914|  78.4k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  78.4k|				} else {
  916|  4.76k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  4.76k|				}
  918|       |			
  919|  83.2k|			}
  920|       |
  921|  83.8k|		}
  922|       |		
  923|  90.5k|	}
  924|       |
  925|  96.3k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  96.3k|{
  350|       |
  351|  96.3k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 10, False: 96.3k]
  |  Branch (351:42): [True: 0, False: 96.3k]
  ------------------
  352|  96.3k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  96.3k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  96.3k|{
  334|       |
  335|  96.3k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 96.3k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  96.3k|	return false;
  337|       |
  338|  96.3k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  96.3k|{
  317|       |
  318|  96.3k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 86.2k, False: 10.1k]
  |  Branch (318:40): [True: 25, False: 86.1k]
  ------------------
  319|  96.3k|	return false;
  320|       |
  321|  96.3k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  12.5k|{
 1190|  12.5k|	bool hasPropertyAttrs = false;
 1191|  12.5k|	bool hasResourceAttr  = false;
 1192|  12.5k|	bool hasNodeIDAttr    = false;
 1193|  12.5k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  12.5k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  12.5k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    108|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 108, False: 12.4k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  12.4k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  12.4k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|  89.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 76.7k, False: 12.4k]
  ------------------
 1205|       |
 1206|  76.7k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  76.7k|		switch ( attrTerm ) {
 1209|       |
 1210|     26|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 26, False: 76.7k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     26|				break;
 1213|       |
 1214|     51|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 51, False: 76.7k]
  ------------------
 1215|     51|				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: 41]
  ------------------
 1216|     41|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 6, False: 35]
  ------------------
 1217|     35|				hasResourceAttr = true;
 1218|     35|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 35, False: 0]
  ------------------
 1219|     35|				break;
 1220|       |
 1221|     40|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 40, False: 76.7k]
  ------------------
 1222|     40|				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: 30]
  ------------------
 1223|     30|				hasNodeIDAttr = true;
 1224|     30|				break;
 1225|       |
 1226|  76.6k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 76.6k, False: 143]
  ------------------
 1227|  76.6k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 1.83k, False: 74.8k]
  ------------------
 1228|  1.83k|					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: 1.82k]
  ------------------
 1229|  1.82k|					hasValueAttr = true;
 1230|  1.82k|					valueNode = *currAttr;
 1231|  74.8k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 74.6k, False: 122]
  ------------------
 1232|  74.6k|					hasPropertyAttrs = true;
 1233|  74.6k|				}
 1234|  76.6k|				break;
 1235|       |
 1236|  76.6k|			default :
  ------------------
  |  Branch (1236:4): [True: 26, False: 76.7k]
  ------------------
 1237|     26|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     26|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  76.7k|		}
 1241|       |
 1242|  76.7k|	}
 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|  12.4k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  12.4k|	bool childIsStruct = false;
 1250|       |	
 1251|  12.4k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 1.83k, False: 10.5k]
  ------------------
 1252|  1.83k|		childNode->value = valueNode->value;
 1253|  1.83k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 15, False: 1.82k]
  ------------------
 1254|  10.5k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 9.95k, False: 623]
  ------------------
 1255|  9.95k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  9.95k|		childIsStruct = true;
 1257|  9.95k|	}
 1258|       |		
 1259|  12.4k|	currAttr = xmlNode.attrs.begin();
 1260|  12.4k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|  88.5k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 76.3k, False: 12.2k]
  ------------------
 1263|       |
 1264|  76.3k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 1.82k, False: 74.5k]
  ------------------
 1265|  74.5k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  74.5k|		switch ( attrTerm ) {
 1268|       |
 1269|     26|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 26, False: 74.4k]
  ------------------
 1270|     46|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 20, False: 74.4k]
  ------------------
 1271|     46|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 74.5k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  74.4k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 74.4k, False: 46]
  ------------------
 1278|  74.4k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 43.3k, False: 31.1k]
  |  Branch (1278:31): [True: 13, False: 31.1k]
  ------------------
 1279|  43.3k|					AddQualifierNode ( childNode, **currAttr );
 1280|  43.3k|				} else {
 1281|  31.1k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  31.1k|				}
 1283|  74.4k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 74.5k]
  ------------------
 1286|      0|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1287|      0|				break;
 1288|       |
 1289|  74.5k|		}
 1290|       |
 1291|  74.5k|	}
 1292|       |
 1293|  12.4k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  54.8k|{
  484|  54.8k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 28, False: 54.8k]
  ------------------
  485|     28|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     28|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  54.8k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  54.8k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  54.9k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  54.9k|	const bool isLang = (name == "xml:lang");
  443|  54.9k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  54.9k|	XMP_Node * newQual = 0;
  446|       |
  447|  54.9k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  54.9k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 43.1k, False: 11.7k]
  ------------------
  450|  43.1k|			xmpParent->qualifiers.push_back ( newQual );
  451|  43.1k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 11.6k, False: 128]
  ------------------
  452|  11.6k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 11.6k, False: 19]
  ------------------
  453|  11.6k|				xmpParent->qualifiers.push_back ( newQual );
  454|  11.6k|			} else {
  455|     19|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     19|			}
  457|  11.6k|			xmpParent->options |= kXMP_PropHasLang;
  458|  11.6k|		} else {
  459|    128|			XMP_Assert ( isType );
  ------------------
  |  |  142|    128|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    128|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 99, False: 29]
  ------------------
  461|     99|				xmpParent->qualifiers.push_back ( newQual );
  462|     99|			} else {
  463|     29|				size_t offset = 0;
  464|     29|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 15, False: 14]
  ------------------
  465|     29|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|     29|			}
  467|    128|			xmpParent->options |= kXMP_PropHasType;
  468|    128|		}
  469|       |
  470|  54.9k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  54.9k|	return newQual;
  473|       |
  474|  54.9k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  78.5k|{
 1015|  78.5k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  78.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  78.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  90.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 11.6k, False: 78.5k]
  ------------------
 1021|  11.6k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  11.6k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 11.5k, False: 142]
  ------------------
 1023|  11.5k|			AddQualifierNode ( newChild, **currAttr );
 1024|  11.5k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 10, False: 132]
  |  Branch (1024:41): [True: 81, False: 51]
  ------------------
 1025|     91|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     91|		} else {
 1027|     51|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     51|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  11.6k|	}
 1030|       |	
 1031|  78.5k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  78.5k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  78.5k|	size_t      textSize  = 0;
 1034|       |
 1035|   178k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 99.6k, False: 78.5k]
  ------------------
 1036|  99.6k|		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: 99.5k]
  ------------------
 1037|  99.5k|		textSize += (*currChild)->value.size();
 1038|  99.5k|	}
 1039|       |	
 1040|  78.5k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|   178k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 99.5k, False: 78.5k]
  ------------------
 1043|  99.5k|		newChild->value += (*currChild)->value;
 1044|  99.5k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  78.5k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|     10|{
 1065|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1066|       |	
 1067|     10|	XMP_Throw ( "ParseTypeLiteral property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1068|       |
 1069|      0|}	// RDF_ParseTypeLiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    307|{
 1087|       |
 1088|    307|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    307|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    307|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    307|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    614|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 307, False: 307]
  ------------------
 1095|    307|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    307|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 307, False: 0]
  ------------------
 1097|    307|			continue;	// ! The caller ensured the value is "Resource".
 1098|    307|		} 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|    307|	}
 1106|       |
 1107|    307|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    307|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 307]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    307|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL18FixupQualifiedNodeP8XMP_Node:
  504|      5|{
  505|      5|	size_t qualNum, qualLim;
  506|      5|	size_t childNum, childLim;
  507|       |
  508|      5|	XMP_Enforce ( (xmpParent->options & kXMP_PropValueIsStruct) && (! xmpParent->children.empty()) );
  ------------------
  |  |  148|     10|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:11): [True: 5, False: 0]
  |  |  |  Branch (148:11): [True: 5, False: 0]
  |  |  ------------------
  |  |  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|		}
  ------------------
  509|       |
  510|      5|	XMP_Node * valueNode = xmpParent->children[0];
  511|      5|	XMP_Enforce ( valueNode->name == "rdf:value" );
  ------------------
  |  |  148|      5|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 5]
  |  |  ------------------
  |  |  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|		}
  ------------------
  512|       |	
  513|      5|	xmpParent->qualifiers.reserve ( xmpParent->qualifiers.size() + xmpParent->children.size() + valueNode->qualifiers.size() );
  514|       |	
  515|       |	// Move the qualifiers on the value node to the parent. Make sure an xml:lang qualifier stays at
  516|       |	// the front. Check for duplicate names between the value node's qualifiers and the parent's
  517|       |	// children. The parent's children are about to become qualifiers. Check here, between the
  518|       |	// groups. Intra-group duplicates are caught by AddChildNode.
  519|       |	
  520|      5|	qualNum = 0;
  521|      5|	qualLim = valueNode->qualifiers.size();
  522|       |	
  523|      5|	if ( valueNode->options & kXMP_PropHasLang ) {
  ------------------
  |  Branch (523:7): [True: 0, False: 5]
  ------------------
  524|       |
  525|      0|		if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Redundant xml:lang for rdf:value element", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (525:8): [True: 0, False: 0]
  ------------------
  526|       |
  527|      0|		XMP_Node * langQual = valueNode->qualifiers[0];
  528|       |		
  529|      0|		XMP_Assert ( langQual->name == "xml:lang" );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  530|      0|		langQual->parent = xmpParent;
  531|      0|		xmpParent->options |= kXMP_PropHasLang;
  532|       |
  533|      0|		if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (533:8): [True: 0, False: 0]
  ------------------
  534|      0|			xmpParent->qualifiers.push_back ( langQual );	// *** Should use utilities to add qual & set parent.
  535|      0|		} else {
  536|      0|			xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), langQual );
  537|      0|		}
  538|      0|		valueNode->qualifiers[0] = 0;	// We just moved it to the parent.
  539|       |
  540|      0|		qualNum = 1;	// Start the remaining copy after the xml:lang qualifier.
  541|       |
  542|      0|	}
  543|       |	
  544|      5|	for ( ; qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (544:10): [True: 0, False: 5]
  ------------------
  545|       |
  546|      0|		XMP_Node * currQual = valueNode->qualifiers[qualNum];
  547|      0|		if ( FindChildNode ( xmpParent, currQual->name.c_str(), kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|      0|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (547:8): [True: 0, False: 0]
  ------------------
  548|      0|			XMP_Throw ( "Duplicate qualifier node", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  549|      0|		}
  550|       |
  551|      0|		currQual->parent = xmpParent;
  552|      0|		xmpParent->qualifiers.push_back ( currQual );
  553|      0|		valueNode->qualifiers[qualNum] = 0;	// We just moved it to the parent.
  554|       |
  555|      0|	}
  556|       |	
  557|      5|	valueNode->qualifiers.clear();	// ! There should be nothing but null pointers.
  558|       |	
  559|       |	// Change the parent's other children into qualifiers. This loop starts at 1, child 0 is the
  560|       |	// rdf:value node. Put xml:lang at the front, append all others.
  561|       |	
  562|     48|	for ( childNum = 1, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (562:61): [True: 43, False: 5]
  ------------------
  563|       |
  564|     43|		XMP_Node * currQual = xmpParent->children[childNum];
  565|       |	
  566|     43|			bool isLang = (currQual->name == "xml:lang");
  567|       |			
  568|     43|			currQual->options |= kXMP_PropIsQualifier;
  569|     43|			currQual->parent = xmpParent;
  570|       |
  571|     43|			if ( isLang ) {
  ------------------
  |  Branch (571:9): [True: 0, False: 43]
  ------------------
  572|      0|				if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Duplicate xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (572:10): [True: 0, False: 0]
  ------------------
  573|      0|				xmpParent->options |= kXMP_PropHasLang;
  574|     43|			} else if ( currQual->name == "rdf:type" ) {
  ------------------
  |  Branch (574:16): [True: 0, False: 43]
  ------------------
  575|      0|				xmpParent->options |= kXMP_PropHasType;
  576|      0|			}
  577|       |
  578|     43|			if ( (! isLang) || xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (578:9): [True: 43, False: 0]
  |  Branch (578:23): [True: 0, False: 0]
  ------------------
  579|     43|				xmpParent->qualifiers.push_back ( currQual );
  580|     43|			} else {
  581|      0|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), currQual );
  582|      0|			}
  583|     43|			xmpParent->children[childNum] = 0;	// We just moved it to the qualifers.
  584|       |		
  585|     43|	}
  586|       |	
  587|      5|	if ( ! xmpParent->qualifiers.empty() ) xmpParent->options |= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (587:7): [True: 5, False: 0]
  ------------------
  588|       |	
  589|       |	// Move the options and value last, other checks need the parent's original options. Move the
  590|       |	// value node's children to be the parent's children. Delete the now useless value node.
  591|       |	
  592|      5|	XMP_Assert ( xmpParent->options & (kXMP_PropValueIsStruct | kRDF_HasValueElem) );
  ------------------
  |  |  142|      5|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|      5|	xmpParent->options &= ~ (static_cast<unsigned long>(kXMP_PropValueIsStruct) | static_cast<unsigned long>(kRDF_HasValueElem));
  594|      5|	xmpParent->options |= valueNode->options;
  595|       |	
  596|      5|	xmpParent->value.swap ( valueNode->value );
  597|       |	#if 0	// *** XMP_DebugBuild
  598|       |		xmpParent->_valuePtr = xmpParent->value.c_str();
  599|       |	#endif
  600|       |
  601|      5|	xmpParent->children[0] = 0;	// ! Remove the value node itself before the swap.
  602|      5|	xmpParent->children.swap ( valueNode->children );
  603|       |	
  604|      5|	for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (604:68): [True: 0, False: 5]
  ------------------
  605|      0|		XMP_Node * currChild = xmpParent->children[childNum];
  606|      0|		currChild->parent = xmpParent;
  607|      0|	}
  608|       |
  609|      5|	delete valueNode;
  610|       |	
  611|      5|}	// FixupQualifiedNode
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|     73|{
 1147|     73|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     73|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     73|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     73|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     73|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     73|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  4.76k|{
  943|  4.76k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.59k, False: 173]
  |  Branch (943:21): [True: 0, False: 4.59k]
  ------------------
  944|       |	
  945|  4.76k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  4.76k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  4.76k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  4.79k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 33, False: 4.76k]
  ------------------
  951|     33|		XMP_VarString & attrName = (*currAttr)->name;
  952|     33|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 27, False: 6]
  ------------------
  953|     27|			AddQualifierNode ( newCompound, **currAttr );
  954|     27|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 6, False: 0]
  ------------------
  955|      6|			continue;	// Ignore all rdf:ID attributes.
  956|      6|		} 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.76k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  4.76k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  14.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 14.6k, False: 0]
  ------------------
  965|  14.6k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 4.76k, False: 9.85k]
  ------------------
  966|  14.6k|	}
  967|  4.76k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 4.76k]
  ------------------
  968|  4.76k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     74|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 74, False: 4.69k]
  ------------------
  969|       |
  970|  4.69k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 151, False: 4.54k]
  ------------------
  971|    151|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.54k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.12k, False: 2.41k]
  ------------------
  973|  2.12k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.41k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 2.24k, False: 173]
  ------------------
  975|  2.24k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  2.24k|	} else {
  977|    173|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    173|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 116, False: 57]
  ------------------
  979|    116|			XMP_VarString typeName ( (*currChild)->ns );
  980|    116|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    116|			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: 106]
  ------------------
  982|    106|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    106|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    106|		}
  985|    173|	}
  986|       |
  987|  4.68k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.68k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 5, False: 4.67k]
  ------------------
  989|      5|		FixupQualifiedNode ( newCompound );
  990|  4.67k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.97k, False: 2.70k]
  ------------------
  991|  1.97k|		DetectAltText ( newCompound );
  992|  1.97k|	}
  993|       |
  994|  13.5k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 8.96k, False: 4.62k]
  ------------------
  995|  8.96k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     60|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 60, False: 8.90k]
  ------------------
  996|  8.90k|	}
  997|       |
  998|  4.68k|}	// 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|  69.8k|{
  568|  69.8k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  69.8k|	size_t unitCount = 0;
  570|       |
  571|  69.8k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  69.8k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 69.8k]
  ------------------
  573|  69.8k|	inUnit = *utf8In;
  574|  69.8k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 69.8k, 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|  69.8k|MultiByte:
  584|  69.8k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  69.8k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  69.8k|{
  517|  69.8k|	UTF8Unit  inUnit = *utf8In;
  518|  69.8k|	size_t    unitCount = 0;
  519|  69.8k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  69.8k|	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|  69.8k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|   211k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 141k, False: 69.8k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  69.8k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     21|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 13, False: 69.8k]
  |  Branch (538:28): [True: 8, False: 69.8k]
  ------------------
  539|  69.8k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 69.8k]
  ------------------
  540|  69.8k|	unitCount = bytesNeeded;
  541|       |	
  542|  69.8k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  69.8k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|   141k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 71.6k, False: 69.8k]
  ------------------
  546|  71.6k|		inUnit = *utf8Pos;
  547|  71.6k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     16|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 16, False: 71.6k]
  ------------------
  548|  71.6k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  71.6k|	}
  550|       |	
  551|  69.8k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 590, False: 69.2k]
  ------------------
  552|    590|		if ( (0xD800 <= cp) && (cp <= 0xDFFF) ) UC_Throw ( "Bad UTF-8 - surrogate code point", kXMPErr_BadParam );
  ------------------
  |  |   18|      2|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (552:8): [True: 590, False: 0]
  |  Branch (552:26): [True: 2, False: 588]
  ------------------
  553|    588|		if ( cp > 0x10FFFF ) UC_Throw ( "Bad UTF-8 - out of range", kXMPErr_BadParam );
  ------------------
  |  |   18|      1|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (553:8): [True: 1, False: 587]
  ------------------
  554|    588|	}
  555|       |	
  556|  69.8k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  69.8k|Done:	
  559|  69.8k|	*utf8Read = unitCount;
  560|  69.8k|	return;
  561|       |	
  562|  69.8k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  1.02M|{
   88|       |
   89|  1.02M|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  1.02M|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  1.02M|	const XMP_Uns8 * namePos   = nameStart;
   92|  1.02M|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  1.02M|	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.02M]
  ------------------
   97|       |
   98|  1.02M|	cp = *namePos;
   99|  1.02M|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 1.02M, False: 296]
  ------------------
  100|  1.02M|		++namePos;
  101|  1.02M|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 1.02M]
  ------------------
  102|  1.02M|	} else {
  103|    296|		cp = GetCodePoint ( &namePos );
  104|    296|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 296]
  ------------------
  105|    296|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  73.8M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 72.8M, False: 1.02M]
  ------------------
  110|  72.8M|		cp = *namePos;
  111|  72.8M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 72.8M, False: 34.8k]
  ------------------
  112|  72.8M|			++namePos;
  113|  72.8M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 431k, False: 72.4M]
  |  Branch (113:38): [True: 0, False: 431k]
  ------------------
  114|  72.8M|		} else {
  115|  34.8k|			cp = GetCodePoint ( &namePos );
  116|  34.8k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 22.7k, False: 12.0k]
  |  Branch (116:41): [True: 0, False: 22.7k]
  ------------------
  117|  34.8k|		}
  118|  72.8M|	}
  119|       |
  120|  1.02M|	return;
  121|       |
  122|  1.02M|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|  73.8M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  73.8M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 36.7M, False: 37.0M]
  |  Branch (33:23): [True: 36.7M, False: 0]
  |  Branch (33:40): [True: 36.6M, False: 431k]
  |  Branch (33:55): [True: 36.6M, False: 48.7k]
  |  Branch (33:71): [True: 48.7k, False: 431k]
  ------------------
   34|   431k|	return false;
   35|  73.8M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  35.1k|{
   20|  35.1k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  35.1k|	XMP_Uns32 cp;
   22|  35.1k|	size_t u8Len;
   23|  35.1k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  35.1k|	*utf8Str_io = u8Ptr + u8Len;
   25|  35.1k|	return cp;
   26|  35.1k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  35.1k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  35.1k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 13.0k, False: 22.1k]
  |  Branch (43:24): [True: 454, False: 12.5k]
  |  Branch (43:43): [True: 12.5k, False: 22.1k]
  |  Branch (43:59): [True: 4.49k, False: 8.08k]
  ------------------
   44|  30.2k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 8.08k, False: 22.1k]
  |  Branch (44:24): [True: 4.60k, False: 3.48k]
  |  Branch (44:43): [True: 2.82k, False: 22.7k]
  |  Branch (44:60): [True: 0, False: 2.82k]
  ------------------
   45|       |
   46|  25.6k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 2.82k, False: 22.7k]
  |  Branch (46:25): [True: 2.66k, False: 160]
  |  Branch (46:46): [True: 160, False: 22.7k]
  |  Branch (46:64): [True: 0, False: 160]
  ------------------
   47|  22.9k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 160, False: 22.7k]
  |  Branch (47:26): [True: 0, False: 160]
  |  Branch (47:46): [True: 160, False: 22.7k]
  |  Branch (47:64): [True: 0, False: 160]
  ------------------
   48|  22.9k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 160, False: 22.7k]
  |  Branch (48:26): [True: 160, False: 0]
  |  Branch (48:46): [True: 0, False: 22.7k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  22.7k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 22.7k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 22.7k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  22.7k|	return false;
   52|       |
   53|  22.7k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   431k|{
   59|       |	// ASCII following characters for an XML name.
   60|   431k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 308k, False: 123k]
  |  Branch (60:23): [True: 308k, False: 0]
  |  Branch (60:39): [True: 66.2k, False: 57.4k]
  |  Branch (60:54): [True: 57.4k, False: 0]
  ------------------
   61|      0|	return false;
   62|   431k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  22.7k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  22.7k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 22.1k, False: 660]
  |  Branch (69:24): [True: 660, False: 0]
  |  Branch (69:41): [True: 660, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  22.7k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  6.30k|{
   20|  6.30k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  6.30k|	XMP_Uns32 cp;
   22|  6.30k|	size_t u8Len;
   23|  6.30k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  6.30k|	*utf8Str_io = u8Ptr + u8Len;
   25|  6.30k|	return cp;
   26|  6.30k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  42.5k|{
   88|       |
   89|  42.5k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  42.5k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  42.5k|	const XMP_Uns8 * namePos   = nameStart;
   92|  42.5k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  42.5k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 42.5k]
  ------------------
   97|       |
   98|  42.5k|	cp = *namePos;
   99|  42.5k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 42.0k, False: 453]
  ------------------
  100|  42.0k|		++namePos;
  101|  42.0k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 42.0k]
  ------------------
  102|  42.0k|	} else {
  103|    453|		cp = GetCodePoint ( &namePos );
  104|    453|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 453]
  ------------------
  105|    453|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  7.19M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 7.15M, False: 42.5k]
  ------------------
  110|  7.15M|		cp = *namePos;
  111|  7.15M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 7.12M, False: 27.9k]
  ------------------
  112|  7.12M|			++namePos;
  113|  7.12M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 130k, False: 6.99M]
  |  Branch (113:38): [True: 0, False: 130k]
  ------------------
  114|  7.12M|		} else {
  115|  27.9k|			cp = GetCodePoint ( &namePos );
  116|  27.9k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 22.0k, False: 5.89k]
  |  Branch (116:41): [True: 0, False: 22.0k]
  ------------------
  117|  27.9k|		}
  118|  7.15M|	}
  119|       |
  120|  42.5k|	return;
  121|       |
  122|  42.5k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  7.16M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  7.16M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 6.21M, False: 950k]
  |  Branch (33:23): [True: 6.21M, False: 0]
  |  Branch (33:40): [True: 820k, False: 130k]
  |  Branch (33:55): [True: 803k, False: 16.4k]
  |  Branch (33:71): [True: 16.4k, False: 130k]
  ------------------
   34|   130k|	return false;
   35|  7.16M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  28.4k|{
   20|  28.4k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  28.4k|	XMP_Uns32 cp;
   22|  28.4k|	size_t u8Len;
   23|  28.4k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  28.4k|	*utf8Str_io = u8Ptr + u8Len;
   25|  28.4k|	return cp;
   26|  28.4k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  28.4k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  28.4k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 6.51k, False: 21.8k]
  |  Branch (43:24): [True: 301, False: 6.21k]
  |  Branch (43:43): [True: 6.21k, False: 21.8k]
  |  Branch (43:59): [True: 146, False: 6.07k]
  ------------------
   44|  27.9k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 6.07k, False: 21.8k]
  |  Branch (44:24): [True: 3.79k, False: 2.27k]
  |  Branch (44:43): [True: 2.11k, False: 22.0k]
  |  Branch (44:60): [True: 0, False: 2.11k]
  ------------------
   45|       |
   46|  24.1k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 2.11k, False: 22.0k]
  |  Branch (46:25): [True: 1.83k, False: 271]
  |  Branch (46:46): [True: 271, False: 22.0k]
  |  Branch (46:64): [True: 0, False: 271]
  ------------------
   47|  22.3k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 271, False: 22.0k]
  |  Branch (47:26): [True: 0, False: 271]
  |  Branch (47:46): [True: 271, False: 22.0k]
  |  Branch (47:64): [True: 0, False: 271]
  ------------------
   48|  22.3k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 271, False: 22.0k]
  |  Branch (48:26): [True: 271, False: 0]
  |  Branch (48:46): [True: 0, False: 22.0k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  22.0k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 22.0k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 22.0k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  22.0k|	return false;
   52|       |
   53|  22.0k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   130k|{
   59|       |	// ASCII following characters for an XML name.
   60|   130k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 61.6k, False: 69.1k]
  |  Branch (60:23): [True: 61.6k, False: 0]
  |  Branch (60:39): [True: 47.4k, False: 21.6k]
  |  Branch (60:54): [True: 21.6k, False: 0]
  ------------------
   61|      0|	return false;
   62|   130k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  22.0k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  22.0k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 21.8k, False: 168]
  |  Branch (69:24): [True: 168, False: 0]
  |  Branch (69:41): [True: 168, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  22.0k|}

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

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

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

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   343k|{
   40|   343k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 106k, False: 236k]
  ------------------
   41|       |
   42|   921k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 684k, False: 236k]
  ------------------
   43|   684k|		unsigned char ch = this->value[i];
   44|   684k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   684k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 565k, False: 119k]
  |  |  |  Branch (45:49): [True: 795, False: 118k]
  |  |  |  Branch (45:67): [True: 117k, False: 392]
  |  |  |  Branch (45:85): [True: 22, False: 370]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|    370|		return false;	// All the checks failed, this isn't whitespace.
   47|   684k|	}
   48|       |
   49|   236k|	return true;
   50|       |
   51|   236k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   671k|{
  428|       |
  429|   788k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 116k, False: 671k]
  ------------------
  430|   671k|	this->attrs.clear();
  431|       |
  432|   671k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   671k|{
  440|       |
  441|  1.22M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 548k, False: 671k]
  ------------------
  442|   671k|	this->content.clear();
  443|       |
  444|   671k|}	// 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|   587k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   587k|		int err = pthread_mutex_lock ( &mutex );
  125|   587k|		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: 587k]
  ------------------
  126|   587k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   587k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   587k|		int err = pthread_mutex_unlock ( &mutex );
  130|   587k|		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: 587k]
  ------------------
  131|   587k|	}
_Z16VerifySetOptionsjPKc:
  563|   174k|{
  564|       |
  565|   174k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 112, False: 174k]
  ------------------
  566|   174k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 3.54k, False: 170k]
  ------------------
  567|   174k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 5.02k, False: 169k]
  ------------------
  568|       |	
  569|   174k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 174k]
  ------------------
  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|   174k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 7.75k, False: 166k]
  |  Branch (573:45): [True: 0, False: 7.75k]
  ------------------
  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|   174k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 174k]
  |  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|   174k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 158k, False: 16.0k]
  |  Branch (581:27): [True: 0, False: 158k]
  ------------------
  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|   174k|	return options;
  586|       |
  587|   174k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   439k|{
  663|   439k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   439k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   439k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   439k|	XMP_StringPtr	qualName, nameEnd;
  667|   439k|	XMP_VarString	currStep;
  668|       |		
  669|   439k|	qualName = nameEnd = NULL;
  670|   439k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  76.8M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 76.4M, False: 439k]
  ------------------
  672|  76.4M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 160k, False: 76.2M]
  |  Branch (672:29): [True: 383k, False: 75.8M]
  ------------------
  673|  76.4M|	}
  674|       |	
  675|   439k|	expandedXPath->clear();
  676|   439k|	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|   439k|	stepBegin = propPath;
  683|   439k|	stepEnd = stepBegin;
  684|  53.9M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 53.8M, False: 50.1k]
  |  Branch (684:29): [True: 53.8M, False: 7.01k]
  |  Branch (684:50): [True: 53.4M, False: 382k]
  |  Branch (684:71): [True: 53.4M, False: 0]
  ------------------
  685|   439k|	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: 439k]
  ------------------
  686|   439k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   439k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   439k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   439k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 439k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   439k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   984k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 544k, False: 439k]
  ------------------
  700|       |
  701|   544k|		stepBegin = stepEnd;
  702|   544k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 160k, False: 383k]
  ------------------
  703|   544k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 544k]
  ------------------
  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|   544k|		stepEnd = stepBegin;
  708|       |
  709|   544k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 160k, False: 383k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|   160k|			qualName = stepBegin;
  713|  21.1M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 20.9M, False: 158k]
  |  Branch (713:31): [True: 20.9M, False: 742]
  |  Branch (713:52): [True: 20.9M, False: 905]
  |  Branch (713:73): [True: 20.9M, False: 0]
  ------------------
  714|   160k|			nameEnd = stepEnd;
  715|   160k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   383k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   383k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   383k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 383k, False: 0]
  |  Branch (723:30): [True: 383k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|  1.44M|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 1.44M, False: 0]
  |  Branch (726:32): [True: 1.44M, False: 0]
  |  Branch (726:53): [True: 1.06M, False: 383k]
  ------------------
  727|   383k|				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: 383k]
  ------------------
  728|   383k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   383k|			} 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|   383k|			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: 383k]
  ------------------
  774|   383k|			++stepEnd;
  775|       |			
  776|   383k|		}
  777|       |
  778|   544k|		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: 544k]
  ------------------
  779|   544k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   544k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   544k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 160k, False: 383k]
  ------------------
  782|       |
  783|   160k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 160k]
  ------------------
  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|   160k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 101k, False: 59.3k]
  ------------------
  788|   101k|				++qualName;
  789|   101k|				stepFlags = kXMP_QualifierStep;
  790|   101k|			}
  791|   160k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   383k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   383k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 383k]
  ------------------
  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|   544k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   544k|	}
  812|       |
  813|   439k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   506k|{
  829|   506k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   506k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   506k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|  1.34M|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 1.29M, False: 53.6k]
  ------------------
  834|  1.29M|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|  1.29M|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|  1.29M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|  1.29M|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 452k, False: 842k]
  ------------------
  837|   452k|			schemaNode = currSchema;
  838|   452k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 426k, False: 25.9k]
  ------------------
  839|   452k|			break;
  840|   452k|		}
  841|  1.29M|	}
  842|       |	
  843|   506k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 53.6k, False: 452k]
  |  Branch (843:28): [True: 20.4k, False: 33.1k]
  ------------------
  844|       |
  845|  20.4k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  20.4k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  20.4k|		XMP_StringPtr prefixPtr;
  847|  20.4k|		XMP_StringLen prefixLen;
  848|  20.4k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  20.4k|		XMP_Assert ( found );
  ------------------
  |  |  142|  20.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  20.4k|		UNUSED(found);
  851|       |
  852|  20.4k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  20.4k|		xmpTree->children.push_back ( schemaNode );
  854|  20.4k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 7.41k, False: 13.0k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  20.4k|	}
  861|       |	
  862|   506k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   506k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   506k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   506k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   506k|	return schemaNode;
  865|       |	
  866|   506k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   554k|{
  882|   554k|	XMP_Node * childNode = 0;
  883|       |
  884|   554k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 10, False: 554k]
  ------------------
  885|     10|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     10|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 10, False: 0]
  ------------------
  886|     10|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|		}
  888|      0|		if ( parent->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|      0|			XMP_Throw ( "Named children not allowed for arrays", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  890|      0|		}
  891|      0|		if ( ! createNodes ) {	// *** Should be assert? If !createNodes, why is the parent a new implicit node?
  ------------------
  |  Branch (891:8): [True: 0, False: 0]
  ------------------
  892|      0|			XMP_Throw ( "Parent is new implicit node, but createNodes is false", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  893|      0|		}
  894|      0|		parent->options |= kXMP_PropValueIsStruct;
  895|      0|	}
  896|       |	
  897|  2.31M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 2.20M, False: 104k]
  ------------------
  898|  2.20M|		XMP_Node * currChild = parent->children[childNum];
  899|  2.20M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  2.20M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  2.20M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 449k, False: 1.75M]
  ------------------
  901|   449k|			childNode = currChild;
  902|   449k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 449k, False: 445]
  ------------------
  903|   449k|			break;
  904|   449k|		}
  905|  2.20M|	}
  906|       |	
  907|   554k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 104k, False: 449k]
  |  Branch (907:27): [True: 43.3k, False: 60.9k]
  ------------------
  908|  43.3k|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  43.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|  43.3k|		parent->children.push_back ( childNode );
  910|  43.3k|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 43.3k, False: 0]
  ------------------
  911|  43.3k|	}
  912|       |	
  913|   554k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   554k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   554k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   554k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   554k|	return childNode;
  916|       |	
  917|   554k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|   101k|{
  935|   101k|	XMP_Node * qualNode = 0;
  936|       |	
  937|   101k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|   101k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  1.31M|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 1.26M, False: 48.0k]
  ------------------
  940|  1.26M|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  1.26M|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  1.26M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  1.26M|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 53.2k, False: 1.21M]
  ------------------
  943|  53.2k|			qualNode = currQual;
  944|  53.2k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 53.2k, False: 0]
  ------------------
  945|  53.2k|			break;
  946|  53.2k|		}
  947|  1.26M|	}
  948|       |	
  949|   101k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 48.0k, False: 53.2k]
  |  Branch (949:26): [True: 48.0k, False: 0]
  ------------------
  950|       |
  951|  48.0k|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|  48.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|  48.0k|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|  48.0k|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|  48.0k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|  48.0k|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|  48.0k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|  48.0k|		const bool isSpecial = isLang | isType;
  957|       |
  958|  48.0k|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 7.39k, False: 40.6k]
  ------------------
  959|  7.39k|			parent->options |= kXMP_PropHasLang;
  960|  40.6k|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 53, False: 40.5k]
  ------------------
  961|     53|			parent->options |= kXMP_PropHasType;
  962|     53|		}
  963|       |		
  964|  48.0k|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 9.08k, False: 38.9k]
  |  Branch (964:38): [True: 38.9k, False: 7]
  ------------------
  965|  47.9k|			parent->qualifiers.push_back ( qualNode );
  966|  47.9k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 47.9k, False: 0]
  ------------------
  967|  47.9k|		} else {
  968|      7|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      7|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 7, False: 0]
  |  Branch (969:19): [True: 7, False: 0]
  ------------------
  970|      7|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      7|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 7, False: 0]
  ------------------
  972|      7|		}
  973|       |
  974|  48.0k|	}
  975|       |	
  976|   101k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|   101k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|   101k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   101k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|   101k|	return qualNode;
  979|       |	
  980|   101k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   434k|{
 1063|   434k|	XMP_Node *     currNode = 0;
 1064|   434k|	XMP_NodePtrPos currPos;
 1065|   434k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   434k|	bool           leafIsNew = false;
 1067|       |	
 1068|   434k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   434k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   434k|	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: 434k]
  ------------------
 1071|       |	
 1072|   434k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   434k|	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|   434k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 434k, False: 0]
  ------------------
 1082|       |		
 1083|   434k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   434k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 345, False: 433k]
  ------------------
 1085|       |
 1086|   433k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   433k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 7.41k, False: 426k]
  ------------------
 1087|  7.41k|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  7.41k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|  7.41k|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 7.41k, False: 0]
  ------------------
 1089|  7.41k|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|  7.41k|		}
 1091|       |
 1092|   433k|	} 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|   433k|	try {
 1138|  1.40M|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 975k, False: 433k]
  ------------------
 1139|   975k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   975k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 507, False: 974k]
  ------------------
 1141|   974k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   974k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 168k, False: 806k]
  ------------------
 1142|   168k|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|   168k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|   168k|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|   168k|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 160k, False: 7.43k]
  ------------------
 1145|   168k|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|   168k|			}
 1147|   974k|		}
 1148|   433k|	} catch ( ... ) {
 1149|     42|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 41, False: 1]
  ------------------
 1150|     42|		throw;
 1151|     42|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   433k|EXIT:
 1156|       |
 1157|   433k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   433k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   433k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   433k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   433k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 168k, False: 265k]
  ------------------
 1161|   168k|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 168k, False: 0]
  ------------------
 1162|   168k|			currNode->options |= leafOptions;
 1163|   168k|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|   168k|	}
 1167|       |
 1168|   433k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 433k, False: 507]
  |  Branch (1168:26): [True: 0, False: 433k]
  ------------------
 1169|   433k|	return currNode;
 1170|       |	
 1171|   433k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  18.9k|{
 1344|  18.9k|	char * tagStart;
 1345|  18.9k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  18.9k|	tagStart = (char*) value->c_str();
 1350|  1.98M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 1.97M, False: 7.04k]
  |  Branch (1350:45): [True: 1.96M, False: 11.9k]
  ------------------
 1351|  1.96M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 1.92M, False: 37.3k]
  |  Branch (1351:28): [True: 13.6k, False: 1.91M]
  ------------------
 1352|  1.96M|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  18.9k|	tagStart = tagEnd;
 1357|  18.9k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 11.9k, False: 7.04k]
  ------------------
 1358|  1.26M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 1.24M, False: 16.7k]
  |  Branch (1358:45): [True: 1.24M, False: 2.23k]
  ------------------
 1359|  1.24M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.19M, False: 45.4k]
  |  Branch (1359:28): [True: 12.1k, False: 1.18M]
  ------------------
 1360|  1.24M|	}
 1361|  18.9k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 2.59k, False: 16.3k]
  ------------------
 1362|  2.59k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 844, False: 1.75k]
  |  Branch (1362:30): [True: 843, False: 1]
  ------------------
 1363|  2.59k|		++tagStart;
 1364|  2.59k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 1.86k, False: 730]
  |  Branch (1364:30): [True: 967, False: 900]
  ------------------
 1365|  2.59k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  22.7k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 22.7k, Folded]
  ------------------
 1370|  22.7k|		tagStart = tagEnd;
 1371|  22.7k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 3.79k, False: 18.9k]
  ------------------
 1372|  22.7k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 18.9k, False: 3.75k]
  ------------------
 1373|  10.0M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 10.0M, False: 2.19k]
  |  Branch (1373:46): [True: 10.0M, False: 1.56k]
  ------------------
 1374|  10.0M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 10.0M, False: 47.4k]
  |  Branch (1374:29): [True: 55.7k, False: 9.98M]
  ------------------
 1375|  10.0M|		}
 1376|  3.75k|	}
 1377|       |	
 1378|  18.9k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    937|{
 1391|    937|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    937|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    937|	size_t itemNum;
 1394|    937|	size_t itemLim = array->children.size();
 1395|    937|	bool   hasDefault = false;
 1396|       |	
 1397|  6.13k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 5.30k, False: 838]
  ------------------
 1398|       |	
 1399|  5.30k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 5.30k]
  ------------------
 1400|  5.30k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 5.30k]
  ------------------
 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.30k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 99, False: 5.20k]
  ------------------
 1405|     99|			hasDefault = true;
 1406|     99|			break;
 1407|     99|		}
 1408|       |
 1409|  5.30k|	}
 1410|       |
 1411|    937|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 99, False: 838]
  ------------------
 1412|       |
 1413|     99|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 36, False: 63]
  ------------------
 1414|     36|			XMP_Node * temp = array->children[0];
 1415|     36|			array->children[0] = array->children[itemNum];
 1416|     36|			array->children[itemNum] = temp;
 1417|     36|		}
 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|     99|	}
 1423|       |	
 1424|    937|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.97k|{
 1435|  1.97k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.97k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.97k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  7.80k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 6.79k, False: 1.01k]
  ------------------
 1440|  6.79k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  6.79k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 67, False: 6.72k]
  |  Branch (1441:50): [True: 888, False: 5.83k]
  ------------------
 1442|  6.79k|	}
 1443|       |	
 1444|  1.97k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.89k, False: 79]
  |  Branch (1444:25): [True: 937, False: 955]
  ------------------
 1445|    937|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    937|		NormalizeLangArray ( xmpParent );
 1447|    937|	}
 1448|       |
 1449|  1.97k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   439k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   439k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   439k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   439k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   439k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   439k|	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: 439k]
  ------------------
  161|       |
  162|   439k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 439k]
  |  Branch (162:29): [True: 0, False: 439k]
  ------------------
  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.9M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 53.4M, False: 439k]
  ------------------
  166|  53.4M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 53.4M]
  |  Branch (166:24): [True: 0, False: 53.4M]
  ------------------
  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|  53.4M|	}
  170|       |
  171|   439k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   439k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 439k]
  ------------------
  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|   439k|	XMP_StringPtr colonPos = propName;
  177|  36.0M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 35.8M, False: 180k]
  |  Branch (177:30): [True: 35.6M, False: 259k]
  ------------------
  178|   439k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   439k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 180k, False: 259k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|   180k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|   180k|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|   180k|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   259k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   259k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   259k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   259k|		XMP_VarString prefix ( propName, prefixLen );
  198|   259k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   259k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 259k]
  ------------------
  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|   259k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 61, False: 259k]
  ------------------
  203|     61|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     61|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   259k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   259k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   259k|	}
  210|       |
  211|   439k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|   160k|{
  220|   160k|	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: 160k]
  ------------------
  221|       |
  222|   160k|	XMP_StringPtr colonPos = qualName;
  223|  12.4M|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 12.4M, False: 0]
  |  Branch (223:34): [True: 12.2M, False: 160k]
  ------------------
  224|   160k|	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: 160k]
  |  Branch (224:33): [True: 0, False: 160k]
  ------------------
  225|       |
  226|   160k|	VerifySimpleXMLName ( qualName, colonPos );
  227|   160k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|   160k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|   160k|	XMP_VarString prefix ( qualName, prefixLen );
  231|   160k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|   160k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 85, False: 160k]
  ------------------
  233|     85|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|     85|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|   160k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   975k|{
  395|   975k|	XMP_Node * nextNode = 0;
  396|   975k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   975k|	XMP_Index      index    = 0;
  398|   975k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   975k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   975k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   975k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 493k, False: 481k]
  ------------------
  403|       |
  404|   493k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   493k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 101k, False: 380k]
  ------------------
  407|       |	
  408|   101k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|   101k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|   101k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|   101k|		++qualStep;
  411|   101k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   380k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   380k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 41, False: 380k]
  ------------------
  418|     41|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|     41|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   380k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 380k, False: 0]
  ------------------
  422|   380k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   380k|		} 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|   380k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 380k, False: 4]
  |  Branch (437:24): [True: 380k, False: 0]
  ------------------
  438|       |
  439|   380k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 4, False: 380k]
  |  Branch (439:25): [True: 4, False: 0]
  |  Branch (439:40): [True: 0, False: 4]
  |  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|   380k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 380k, False: 4]
  |  Branch (464:27): [True: 380k, False: 0]
  ------------------
  465|       |	
  466|   380k|	}
  467|       |
  468|   975k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   974k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 974k, False: 508]
  |  Branch (468:26): [True: 168k, False: 806k]
  ------------------
  469|   168k|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|   168k|	}
  471|       |	
  472|   975k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   975k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   975k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   975k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   975k|	return nextNode;
  475|       |	
  476|   975k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   380k|{
  249|   380k|	XMP_Index index = 0;
  250|   380k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   380k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   380k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|  1.44M|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 1.05M, False: 380k]
  ------------------
  255|  1.05M|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|  1.05M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|  1.05M|		index = (index * 10) + (indexStep[chNum] - '0');
  257|  1.05M|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 1.05M]
  ------------------
  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.05M|	}
  261|       |
  262|   380k|	--index;	// Change to a C-style, zero based index.
  263|   380k|	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: 380k]
  ------------------
  264|       |
  265|   380k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 77.0k, False: 303k]
  |  Branch (265:59): [True: 77.0k, False: 0]
  ------------------
  266|  77.0k|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|  77.0k|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  77.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|  77.0k|		arrayNode->children.push_back ( newItem );
  268|  77.0k|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   380k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 4, False: 380k]
  ------------------
  272|   380k|	return index;
  273|       |	
  274|   380k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|   168k|{
  488|       |
  489|   168k|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 57, False: 168k]
  ------------------
  490|     57|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 57, False: 0]
  ------------------
  491|     57|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|     57|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 1, False: 56]
  ------------------
  492|       |
  493|      1|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      1|	}
  496|       |
  497|   168k|}	// CheckImplicitStruct
XMPCore_Impl.cpp:_ZL13DeleteSubtreeNSt3__111__wrap_iterIPP8XMP_NodeEE:
  507|     41|{
  508|     41|	XMP_Node * rootNode   = *rootNodePos;
  509|     41|	XMP_Node * rootParent = rootNode->parent;
  510|       |
  511|     41|	if ( ! (rootNode->options & kXMP_PropIsQualifier) ) {
  ------------------
  |  Branch (511:7): [True: 41, False: 0]
  ------------------
  512|       |
  513|     41|		rootParent->children.erase ( rootNodePos );
  514|       |
  515|     41|	} 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|     41|	delete rootNode;
  533|       |
  534|     41|}	// DeleteSubtree

_ZN13XMP_AutoMutexC2Ev:
  222|   587k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   587k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   587k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|   219k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 219k, False: 367k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   367k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   699k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   724k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|   201k|		: options(_options), name(_name), parent(_parent)
  435|   201k|	{
  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|   201k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   145k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   145k|	{
  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|   145k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  54.9k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  54.9k|	{
  469|       |		#if XMP_DebugBuild
  470|       |			XMP_Assert ( (name.find ( ':' ) != XMP_VarString::npos) || (name == kXMP_ArrayItemName) ||
  471|       |			             (options & kXMP_SchemaNode) || (parent == 0) );
  472|       |			// *** _namePtr  = name.c_str();
  473|       |			// *** _valuePtr = value.c_str();
  474|       |		#endif
  475|  54.9k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   421k|	{
  479|   710k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 288k, False: 421k]
  ------------------
  480|   288k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 288k, False: 48]
  ------------------
  481|   288k|		}
  482|   421k|		children.clear();
  483|   421k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   409k|	{
  487|   513k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 104k, False: 409k]
  ------------------
  488|   104k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 104k, False: 0]
  ------------------
  489|   104k|		}
  490|   409k|		qualifiers.clear();
  491|   409k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  7.41k|	{
  495|  7.41k|		options = 0;
  496|  7.41k|		name.erase();
  497|  7.41k|		value.erase();
  498|  7.41k|		this->RemoveChildren();
  499|  7.41k|		this->RemoveQualifiers();
  500|  7.41k|	}
_ZN8XMP_NodeD2Ev:
  502|   402k|	virtual ~XMP_Node() { RemoveChildren(); RemoveQualifiers(); };

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

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  5.97k|{
 1097|  5.97k|	if ( (buffer == 0) && (xmpSize != 0) ) XMP_Throw ( "Null parse buffer", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1097:7): [True: 0, False: 5.97k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  5.97k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 5.97k]
  ------------------
 1099|       |	
 1100|  5.97k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  5.97k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  5.97k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 5.97k, False: 0]
  ------------------
 1105|  5.97k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 5.97k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  5.97k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  5.97k|	}
 1108|       |	
 1109|  5.97k|	XMLParserAdapter& parser = *this->xmlParser;
 1110|       |	
 1111|       |	#if 0	// XMP_DebugBuild
 1112|       |		if ( parser.parseLog != 0 ) {
 1113|       |			char message [200];	// AUDIT: Using sizeof(message) below for snprintf length is safe.
 1114|       |			snprintf ( message, sizeof(message), "<!-- ParseFromBuffer, length = %d, options = %X%s -->",	// AUDIT: See above.
 1115|       |					   xmpSize, options, (lastClientCall ? " (last)" : "") );
 1116|       |			fwrite ( message, 1, strlen(message), parser.parseLog );
 1117|       |			fflush ( parser.parseLog );
 1118|       |		}
 1119|       |	#endif
 1120|       |		
 1121|  5.97k|	try {	// Cleanup the tree and xmlParser if anything fails.
 1122|       |	
 1123|       |		// Determine the character encoding before doing any real parsing. This is needed to do the
 1124|       |		// 8-bit special processing.
 1125|       |		
 1126|  5.97k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 5.97k, False: 0]
  ------------------
 1127|       |
 1128|  5.97k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 5.97k, False: 0]
  |  Branch (1128:39): [True: 5.93k, False: 41]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  5.93k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  5.93k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     41|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     41|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 41, False: 0]
  ------------------
 1139|       |
 1140|     41|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     41|				buffer += pendingOverlap;
 1142|     41|				xmpSize -= pendingOverlap;
 1143|     41|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     41|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 41]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     41|				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|     41|			}
 1153|       |
 1154|  5.97k|		}
 1155|       |		
 1156|       |		// We have the character encoding. Process UTF-16 and UTF-32 as is. UTF-8 needs special
 1157|       |		// handling to take care of things like ISO Latin-1 or unescaped ASCII controls.
 1158|       |
 1159|  5.97k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  5.97k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  5.97k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 5.97k]
  ------------------
 1162|       |		
 1163|      0|			if ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|       |				// Might have pendingInput from the above portion to determine the character encoding.
 1165|      0|				parser.ParseBuffer ( parser.pendingInput, parser.pendingCount, false );
 1166|      0|			}
 1167|      0|			parser.ParseBuffer ( buffer, xmpSize, lastClientCall );
 1168|       |			
 1169|  5.97k|		} else {
 1170|       |
 1171|       |			#if Trace_ParsingHackery
 1172|       |				fprintf ( stderr, "Parsing %d bytes @ %.8X, %s, %d pending, context: %.8s\n",
 1173|       |						  xmpSize, buffer, (lastClientCall ? "last" : "not last"), parser.pendingCount, buffer );
 1174|       |			#endif
 1175|       |
 1176|       |			// The UTF-8 processing is a bit complex due to the need to tolerate ISO Latin-1 input.
 1177|       |			// This is done by scanning the input for byte sequences that are not valid UTF-8,
 1178|       |			// assuming they are Latin-1 characters in the range 0x80..0xFF. This requires saving a
 1179|       |			// pending input buffer to handle partial UTF-8 sequences at the end of a buffer.
 1180|       |			
 1181|  6.02k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 41, False: 5.97k]
  ------------------
 1182|       |			
 1183|       |				// We've got some leftover input, process it first then continue with the current
 1184|       |				// buffer. Try to fill the pendingInput buffer before parsing further. We use a loop
 1185|       |				// for weird edge cases like a 2 byte input buffer, using 1 byte for pendingInput,
 1186|       |				// then having a partial UTF-8 end and need to absorb more.
 1187|       |				
 1188|     41|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     41|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 41, False: 0]
  ------------------
 1190|       |				
 1191|     41|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     41|				parser.pendingCount += pendingOverlap;
 1193|     41|				buffer += pendingOverlap;
 1194|     41|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     41|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 41]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     41|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     41|				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|     41|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 41, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     41|					parser.pendingCount = 0;
 1208|       |
 1209|     41|				} 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|     41|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  5.97k|			size_t bytesDone = ProcessUTF8Portion ( &parser, (XMP_Uns8*)buffer, xmpSize, lastClientCall );
 1240|       |
 1241|       |			#if Trace_ParsingHackery
 1242|       |				fprintf ( stderr, "   ProcessUTF8Portion handled %d additional bytes\n", bytesDone );
 1243|       |			#endif
 1244|       |			
 1245|  5.97k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 5.97k]
  ------------------
 1246|       |
 1247|      0|				XMP_Assert ( ! lastClientCall );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1248|      0|				size_t bytesLeft = xmpSize - bytesDone;
 1249|      0|				if ( bytesLeft > kXMLPendingInputMax ) XMP_Throw ( "Parser bytesLeft too large", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1249:10): [True: 0, False: 0]
  ------------------
 1250|       |
 1251|      0|				memcpy ( parser.pendingInput, &buffer[bytesDone], bytesLeft );	// AUDIT: Count is safe.
 1252|      0|				parser.pendingCount = bytesLeft;
 1253|      0|				return;	// Wait for the next buffer.
 1254|       |
 1255|      0|			}
 1256|       |
 1257|  5.97k|		}
 1258|       |		
 1259|  5.97k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 5.93k, False: 41]
  ------------------
 1260|       |		
 1261|       |			#if XMP_DebugBuild && DumpXMLParseTree
 1262|       |				if ( parser.parseLog == 0 ) parser.parseLog = stdout;
 1263|       |				DumpXMLTree ( parser.parseLog, parser.tree, 0 );
 1264|       |			#endif
 1265|       |
 1266|  5.93k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  5.93k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 5.34k, False: 593]
  ------------------
 1269|       |
 1270|  5.34k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  5.34k|				NormalizeDCArrays ( &this->tree );
 1272|  5.34k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 5.34k]
  ------------------
 1273|  5.34k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  5.34k|				size_t schemaNum = 0;
 1277|  15.2k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 9.88k, False: 5.34k]
  ------------------
 1278|  9.88k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  9.88k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 9.88k, False: 0]
  ------------------
 1280|  9.88k|						++schemaNum;
 1281|  9.88k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  9.88k|				}
 1286|       |				
 1287|  5.34k|			}
 1288|       |
 1289|  5.93k|			delete this->xmlParser;
 1290|  5.93k|			this->xmlParser = 0;
 1291|       |
 1292|  5.93k|		}
 1293|       |		
 1294|  5.97k|	} catch ( ... ) {
 1295|       |
 1296|  1.43k|		delete this->xmlParser;
 1297|  1.43k|		this->xmlParser = 0;
 1298|  1.43k|		prevTkVer = 0;
 1299|  1.43k|		this->tree.ClearNode();
 1300|  1.43k|		throw;
 1301|       |
 1302|  1.43k|	}
 1303|       |	
 1304|  5.97k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  5.97k|{
  811|  5.97k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 5.97k]
  ------------------
  812|       |	
  813|  5.97k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  5.97k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 5.97k]
  ------------------
  816|       |	
  817|       |		// These cases are:
  818|       |		//   00 nn -- -- - Big endian UTF-16
  819|       |		//   00 00 00 nn - Big endian UTF-32
  820|       |		//   00 00 FE FF - Big endian UTF 32
  821|       |
  822|      0|		if ( (length < 4) || (uniChar[1] != 0) ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (822:8): [True: 0, False: 0]
  |  Branch (822:24): [True: 0, False: 0]
  ------------------
  823|      0|		return kXMP_EncodeUTF32Big;
  824|       |		
  825|  5.97k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 5.96k, False: 13]
  ------------------
  826|       |	
  827|       |		// These cases are:
  828|       |		//   nn mm -- -- - UTF-8, includes EF BB BF case
  829|       |		//   nn 00 00 00 - Little endian UTF-32
  830|       |		//   nn 00 -- -- - Little endian UTF-16
  831|       |
  832|  5.96k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 5.96k, 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|     13|	} 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|     13|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 13, False: 0]
  ------------------
  845|      0|		if ( uniChar[0] == 0xFE ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (845:8): [True: 0, False: 0]
  ------------------
  846|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (846:8): [True: 0, False: 0]
  |  Branch (846:24): [True: 0, False: 0]
  ------------------
  847|      0|		return kXMP_EncodeUTF32Little;
  848|       |
  849|      0|	}
  850|       |		
  851|  5.97k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  6.02k|{
  977|  6.02k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  6.02k|	const XMP_Uns8 * spanEnd;
  980|       |
  981|       |	// `buffer` is copied into this std::string. If `buffer` only
  982|       |	// contains valid UTF-8 and no escape characters, then the copy
  983|       |	// will be identical to the original, but invalid characters are
  984|       |	// replaced - usually with a space character.  This std::string was
  985|       |	// added as a performance fix for:
  986|       |	// https://github.com/Exiv2/exiv2/security/advisories/GHSA-w8mv-g8qq-36mj
  987|       |	// Previously, the code was repeatedly calling
  988|       |	// `xmlParser->ParseBuffer()`, which turned out to have quadratic
  989|       |	// complexity, because expat kept reparsing the entire string from
  990|       |	// the beginning.
  991|  6.02k|	std::string copy;
  992|       |		
  993|  73.1M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 73.1M, False: 6.02k]
  ------------------
  994|       |
  995|  73.1M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 72.8M, False: 323k]
  |  Branch (995:30): [True: 72.7M, False: 70.4k]
  |  Branch (995:52): [True: 72.1M, False: 559k]
  ------------------
  996|  72.1M|			copy.push_back(*spanEnd);
  997|  72.1M|			continue;	// A regular ASCII character.
  998|  72.1M|		}
  999|       |
 1000|   953k|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 45.5k, False: 908k]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  45.5k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  45.5k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 45.5k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  45.5k|				copy.append((const char*)spanEnd, uniLen);
 1010|  45.5k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  45.5k|			} 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|   908k|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 323k, False: 584k]
  |  Branch (1026:36): [True: 24.9k, False: 559k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   348k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   348k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   339k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|  31.8k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 9.32k, False: 339k]
  |  Branch (1030:31): [True: 307k, False: 31.8k]
  |  Branch (1030:52): [True: 6.93k, False: 24.9k]
  ------------------
 1031|   323k|				copy.push_back(*spanEnd);
 1032|   323k|				continue;
 1033|   323k|			}
 1034|       |
 1035|  24.9k|			copy.push_back(' ');
 1036|       |		
 1037|   559k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   559k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   559k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   559k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   559k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 5, False: 559k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|      5|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 5, False: 0]
  ------------------
 1048|      5|					copy.push_back('&');
 1049|      5|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|      5|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   559k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 16.3k, False: 543k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  16.3k|				copy.push_back(' ');
 1058|  16.3k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   543k|			} else {
 1061|   543k|				copy.push_back('&');
 1062|   543k|			}
 1063|       |
 1064|   559k|		}
 1065|       |		
 1066|   953k|	}
 1067|       |	
 1068|  6.02k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  6.02k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  6.02k|	copy.push_back(' ');
 1070|  6.02k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  6.02k|	return length;
 1072|       |
 1073|  6.02k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  45.5k|{
  868|  45.5k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  45.5k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  45.5k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 45.5k]
  ------------------
  870|  45.5k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 45.5k]
  ------------------
  871|       |	
  872|  45.5k|	int byteCount = 2;
  873|  45.5k|	XMP_Uns8 firstByte = *charStart;
  874|  51.8k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 6.36k, False: 45.5k]
  ------------------
  875|       |	
  876|  45.5k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 45.5k]
  ------------------
  877|       |
  878|  97.3k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 51.8k, False: 45.5k]
  ------------------
  879|  51.8k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 51.8k]
  ------------------
  880|  51.8k|	}
  881|       |	
  882|  45.5k|	return byteCount;
  883|       |	
  884|  45.5k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   559k|{
  898|   559k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   559k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   559k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 559k]
  ------------------
  900|   559k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   559k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   559k|	size_t tailLen = bufEnd - escStart;
  903|   559k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 5, False: 559k]
  ------------------
  904|       |	
  905|   559k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 274k, False: 284k]
  ------------------
  906|       |	
  907|   284k|	XMP_Uns8 escValue = 0;
  908|   284k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   284k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 283k, False: 1.11k]
  |  Branch (910:27): [True: 253k, False: 30.2k]
  ------------------
  911|   253k|		escValue = *escPos - '0';
  912|   253k|		++escPos;
  913|   253k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 27.8k, False: 3.51k]
  |  Branch (913:34): [True: 14.3k, False: 13.4k]
  ------------------
  914|  14.3k|		escValue = *escPos - 'A' + 10;
  915|  14.3k|		++escPos;
  916|  16.9k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 12.8k, False: 4.11k]
  |  Branch (916:34): [True: 2.35k, False: 10.4k]
  ------------------
  917|  2.35k|		escValue = *escPos - 'a' + 10;
  918|  2.35k|		++escPos;
  919|  2.35k|	}
  920|       |	
  921|   284k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 250k, False: 34.5k]
  |  Branch (921:27): [True: 85.9k, False: 164k]
  ------------------
  922|  85.9k|		escValue = (escValue << 4) + (*escPos - '0');
  923|  85.9k|		++escPos;
  924|   198k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 44.7k, False: 154k]
  |  Branch (924:34): [True: 13.7k, False: 30.9k]
  ------------------
  925|  13.7k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  13.7k|		++escPos;
  927|   185k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 26.4k, False: 158k]
  |  Branch (927:34): [True: 238, False: 26.1k]
  ------------------
  928|    238|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|    238|		++escPos;
  930|    238|	}
  931|       |	
  932|   284k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 284k]
  ------------------
  933|   284k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 165k, False: 119k]
  ------------------
  934|       |	
  935|   119k|	size_t escLen = escPos - escStart + 1;
  936|   119k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 2.32k, False: 116k]
  ------------------
  937|       |	
  938|   116k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|   116k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  16.6k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  16.4k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 100k, False: 16.6k]
  |  Branch (938:29): [True: 210, False: 16.4k]
  |  Branch (938:50): [True: 169, False: 16.3k]
  ------------------
  939|       |	
  940|  16.3k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|   116k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  5.93k|{
  152|  5.93k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  5.93k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 135, False: 5.80k]
  ------------------
  155|  5.93k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 593, False: 5.34k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  5.34k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  5.34k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  5.34k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  5.34k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 5.34k]
  ------------------
  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|  5.74k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.43k, False: 4.30k]
  ------------------
  168|  1.43k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.43k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 1.00k, False: 427]
  |  Branch (169:42): [True: 32, False: 395]
  ------------------
  170|  1.04k|				verStr = currAttr->value.c_str();
  171|  1.04k|				break;
  172|  1.04k|			}
  173|  1.43k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  5.34k|	unsigned long part;
  178|  36.6k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 32.2k, False: 4.35k]
  |  Branch (178:29): [True: 2.98k, False: 29.2k]
  |  Branch (178:48): [True: 28.2k, False: 990]
  ------------------
  179|       |	
  180|  5.34k|	part = 0;
  181|  9.81k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 5.44k, False: 4.37k]
  |  Branch (181:28): [True: 4.68k, False: 754]
  |  Branch (181:48): [True: 4.47k, False: 216]
  ------------------
  182|  4.47k|		part = (part * 10) + (*verStr - '0');
  183|  4.47k|		++verStr;
  184|  4.47k|	}
  185|  5.34k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 159, False: 5.18k]
  ------------------
  186|  5.34k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  5.34k|	part = 0;
  189|  5.34k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 515, False: 4.83k]
  ------------------
  190|  9.63k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 5.25k, False: 4.38k]
  |  Branch (190:28): [True: 4.55k, False: 709]
  |  Branch (190:48): [True: 4.29k, False: 256]
  ------------------
  191|  4.29k|		part = (part * 10) + (*verStr - '0');
  192|  4.29k|		++verStr;
  193|  4.29k|	}
  194|  5.34k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 116, False: 5.22k]
  ------------------
  195|  5.34k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  5.34k|	part = 0;
  198|  5.34k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 85, False: 5.26k]
  ------------------
  199|  6.17k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 1.78k, False: 4.38k]
  |  Branch (199:28): [True: 1.09k, False: 695]
  |  Branch (199:48): [True: 829, False: 263]
  ------------------
  200|    829|		part = (part * 10) + (*verStr - '0');
  201|    829|		++verStr;
  202|    829|	}
  203|  5.34k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 26, False: 5.31k]
  ------------------
  204|  5.34k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  5.34k|	part = 0;
  207|  5.34k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 392, False: 4.95k]
  ------------------
  208|  7.30k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 2.90k, False: 4.40k]
  |  Branch (208:28): [True: 2.56k, False: 337]
  |  Branch (208:48): [True: 1.96k, False: 605]
  ------------------
  209|  1.96k|		part = (part * 10) + (*verStr - '0');
  210|  1.96k|		++verStr;
  211|  1.96k|	}
  212|  5.34k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 68, False: 5.27k]
  ------------------
  213|  5.34k|	thiz->prevTkVer += part;
  214|       |	
  215|  5.34k|	return rootNode;
  216|       |	
  217|  5.34k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  11.7k|{
  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|  26.2k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 14.6k, False: 11.6k]
  ------------------
  116|  14.6k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  14.6k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 12.7k, False: 1.83k]
  ------------------
  118|  1.83k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 159, False: 1.67k]
  |  Branch (118:44): [True: 1, False: 1.67k]
  ------------------
  119|  1.83k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  11.6k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 11.6k, False: 0]
  ------------------
  122|  24.7k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 13.1k, False: 11.5k]
  ------------------
  123|  13.1k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  13.1k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 11.8k, False: 1.38k]
  ------------------
  125|  1.38k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 116, False: 1.27k]
  ------------------
  126|  1.38k|		}
  127|  11.6k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  23.0k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 11.4k, False: 11.5k]
  ------------------
  131|  11.4k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  11.4k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 0, False: 11.4k]
  ------------------
  133|  11.4k|	}
  134|       |	
  135|  11.5k|	return 0;
  136|       |
  137|  11.5k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  3.95k|{
  232|  3.95k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.95k|#define kXMP_ExistingOnly	false
  ------------------
  233|  3.95k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 3.40k, False: 547]
  ------------------
  234|       |	
  235|  2.20k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 1.65k, False: 547]
  ------------------
  236|  1.65k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  1.65k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  1.65k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 500, False: 1.15k]
  ------------------
  240|       |		
  241|  1.15k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 56, False: 1.10k]
  ------------------
  242|  1.10k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 0, False: 1.10k]
  ------------------
  243|     56|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  1.10k|		} else if (
  245|  1.10k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 6, False: 1.09k]
  ------------------
  246|  1.09k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 46, False: 1.05k]
  ------------------
  247|  1.05k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 60, False: 991]
  ------------------
  248|    112|			arrayForm = kXMP_PropArrayIsAltText;
  249|    991|		} else if (
  250|    991|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 13, False: 978]
  ------------------
  251|    978|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 29, False: 949]
  ------------------
  252|    949|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 10, False: 939]
  ------------------
  253|    939|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 85, False: 854]
  ------------------
  254|    854|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 48, False: 806]
  ------------------
  255|    806|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 18, False: 788]
  ------------------
  256|    203|			arrayForm = kXMP_PropValueIsArray;
  257|    203|		}
  258|  1.15k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 788, False: 371]
  ------------------
  259|       |		
  260|    371|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    371|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    371|		dcSchema->children[propNum] = newArray;
  263|    371|		newArray->children.push_back ( currProp );
  264|    371|		currProp->parent = newArray;
  265|    371|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    371|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    371|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 112, False: 259]
  |  Branch (267:44): [True: 69, False: 43]
  ------------------
  268|     69|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|     69|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|     69|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 69, False: 0]
  ------------------
  271|     69|				currProp->qualifiers.push_back ( newLang );
  272|     69|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|     69|		}
  276|       |
  277|    371|	}
  278|       |	
  279|    547|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  3.95k|{
  666|  3.95k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  3.95k|	XMP_Node * currSchema = 0;
  671|       |
  672|  3.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.95k|#define kXMP_ExistingOnly	false
  ------------------
  673|  3.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 10, False: 3.94k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     10|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     10|#define kXMP_ExistingOnly	false
  ------------------
  677|     10|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 10]
  ------------------
  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|     10|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     10|#define kXMP_ExistingOnly	false
  ------------------
  682|     10|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 10]
  |  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|     10|	}
  697|       |
  698|  3.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.95k|#define kXMP_ExistingOnly	false
  ------------------
  699|  3.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 3.95k]
  ------------------
  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|  3.95k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  3.95k|#define kXMP_ExistingOnly	false
  ------------------
  707|  3.95k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 547, False: 3.40k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    547|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    547|#define kXMP_ExistingOnly	false
  ------------------
  710|    547|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 51, False: 496]
  ------------------
  711|     51|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     51|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     51|		}
  714|    547|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  3.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  3.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  3.95k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  3.95k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  3.95k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  3.95k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 223, False: 3.73k]
  ------------------
  732|       |
  733|    223|		bool nameIsUUID = false;
  734|    223|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    223|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    223|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 16, False: 207]
  |  |  ------------------
  ------------------
  737|       |
  738|     16|			nameIsUUID = true;
  739|       |
  740|    207|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 108, False: 99]
  ------------------
  741|       |
  742|    108|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  1.85k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 1.84k, False: 12]
  ------------------
  744|  1.84k|				char ch = nameStr[i];
  745|  1.84k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 95, False: 1.74k]
  ------------------
  746|     95|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 32, False: 63]
  |  Branch (746:23): [True: 11, False: 52]
  |  Branch (746:36): [True: 11, False: 41]
  |  Branch (746:49): [True: 23, False: 18]
  ------------------
  747|     18|					nameIsUUID = false;
  748|     18|					break;
  749|  1.74k|				} else {
  750|  1.74k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 1.71k, False: 39]
  |  Branch (750:27): [True: 409, False: 1.30k]
  |  Branch (750:44): [True: 1.27k, False: 65]
  |  Branch (750:59): [True: 1.26k, False: 13]
  ------------------
  751|     78|					nameIsUUID = false;
  752|     78|					break;
  753|  1.74k|				}
  754|  1.84k|			}
  755|       |
  756|    108|		}
  757|       |		
  758|    223|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 28, False: 195]
  ------------------
  759|       |
  760|     28|			XMP_ExpandedXPath expPath;
  761|     28|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     28|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     28|#define kXMP_CreateNodes	true
  ------------------
  763|     28|			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: 28]
  ------------------
  764|       |
  765|     28|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     28|			idNode->value = tree.name;
  767|     28|			idNode->RemoveChildren();
  768|     28|			idNode->RemoveQualifiers();
  769|       |
  770|     28|			tree.name.erase();
  771|       |
  772|     28|		}
  773|       |
  774|    223|	}
  775|       |
  776|  3.95k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  19.7k|{
  610|  19.7k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  19.7k|#define kXMP_ExistingOnly	false
  ------------------
  611|  19.7k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 18.0k, False: 1.69k]
  ------------------
  612|       |	
  613|  1.69k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.69k|#define kXMP_ExistingOnly	false
  ------------------
  614|  1.69k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.35k, False: 337]
  |  Branch (614:27): [True: 198, False: 139]
  ------------------
  615|       |	
  616|    139|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 0, False: 139]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|    139|	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: 139]
  ------------------
  622|       |
  623|  1.32k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  1.32k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 86, False: 1.24k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     86|			delete ( currChild );
  629|     86|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  1.24k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.16k, False: 78]
  ------------------
  632|       |		
  633|  1.16k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 23, False: 1.14k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     23|				delete ( currChild );
  637|     23|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  1.14k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  1.14k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  1.14k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 1.12k, False: 18]
  ------------------
  644|  1.12k|					currChild->qualifiers.push_back ( repairLang );
  645|  1.12k|				} else {
  646|     18|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     18|				}
  648|  1.14k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  1.14k|			}
  651|       |
  652|  1.16k|		}
  653|       |
  654|  1.32k|	}
  655|       |
  656|    139|}	// RepairAltText

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

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

