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

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

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

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

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

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  6.09M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  8.98M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   369k|  Key(const Key&) = default;

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  150|  5.28M|  [[nodiscard]] auto begin() noexcept {
  151|  5.28M|    return pData_.begin();
  152|  5.28M|  }
_ZN5Exiv27DataBuf3endEv:
  154|  37.7k|  [[nodiscard]] auto end() noexcept {
  155|  37.7k|    return pData_.end();
  156|  37.7k|  }
_ZNK5Exiv27DataBuf5beginEv:
  158|  16.4k|  [[nodiscard]] auto begin() const noexcept {
  159|  16.4k|    return pData_.begin();
  160|  16.4k|  }
_ZNK5Exiv27DataBuf3endEv:
  162|  16.2k|  [[nodiscard]] auto end() const noexcept {
  163|  16.2k|    return pData_.end();
  164|  16.2k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  166|  6.12M|  [[nodiscard]] size_t size() const {
  167|  6.12M|    return pData_.size();
  168|  6.12M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  194|  45.9k|  [[nodiscard]] bool empty() const {
  195|  45.9k|    return pData_.empty();
  196|  45.9k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.02M|  DataBuf() = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  447|  28.2k|const T* find(T (&src)[N], const K& key) {
  448|  28.2k|  static_assert(N > 0, "Passed zero length find");
  449|  28.2k|  auto rc = std::find(src, src + N, key);
  450|  28.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 28.2k]
  ------------------
  451|  28.2k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   108k|std::string toString(const T& arg) {
  467|   108k|  return toStringHelper(arg, std::is_integral<T>());
  468|   108k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   108k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   108k|  return std::to_string(arg);
  457|   108k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  227|  44.3M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  228|  44.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (228:7): [True: 1.13M, False: 43.2M]
  ------------------
  229|  1.13M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  230|  1.13M|  }
  231|  43.2M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  232|  44.3M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  447|   289k|const T* find(T (&src)[N], const K& key) {
  448|   289k|  static_assert(N > 0, "Passed zero length find");
  449|   289k|  auto rc = std::find(src, src + N, key);
  450|   289k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 287k, False: 1.89k]
  ------------------
  451|   289k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  447|  6.58M|const T* find(T (&src)[N], const K& key) {
  448|  6.58M|  static_assert(N > 0, "Passed zero length find");
  449|  6.58M|  auto rc = std::find(src, src + N, key);
  450|  6.58M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.59M, False: 4.98M]
  ------------------
  451|  6.58M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|     11|T stringTo(const std::string& s, bool& ok) {
  483|     11|  std::istringstream is(s);
  484|     11|  T tmp = T();
  485|     11|  ok = static_cast<bool>(is >> tmp);
  486|     11|  std::string rest;
  487|     11|  is >> std::skipws >> rest;
  488|     11|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 0, False: 11]
  ------------------
  489|      0|    ok = false;
  490|     11|  return tmp;
  491|     11|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  21.7k|std::string toString(const T& arg) {
  467|  21.7k|  return toStringHelper(arg, std::is_integral<T>());
  468|  21.7k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  21.7k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  21.7k|  return std::to_string(arg);
  457|  21.7k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.54k|std::string toString(const T& arg) {
  467|  1.54k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.54k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.54k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.54k|  return std::to_string(arg);
  457|  1.54k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   155k|std::string toString(const T& arg) {
  467|   155k|  return toStringHelper(arg, std::is_integral<T>());
  468|   155k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|   155k|std::string toStringHelper(const T& arg, std::true_type) {
  456|   155k|  return std::to_string(arg);
  457|   155k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  3.29k|std::string toString(const T& arg) {
  467|  3.29k|  return toStringHelper(arg, std::is_integral<T>());
  468|  3.29k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|  3.29k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  3.29k|  std::ostringstream os;
  462|  3.29k|  os << arg;
  463|  3.29k|  return os.str();
  464|  3.29k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|   147k|std::string toString(const T& arg) {
  467|   147k|  return toStringHelper(arg, std::is_integral<T>());
  468|   147k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  460|   147k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   147k|  std::ostringstream os;
  462|   147k|  os << arg;
  463|   147k|  return os.str();
  464|   147k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  70.1k|std::string toString(const T& arg) {
  467|  70.1k|  return toStringHelper(arg, std::is_integral<T>());
  468|  70.1k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  70.1k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  70.1k|  return std::to_string(arg);
  457|  70.1k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  447|    513|const T* find(T (&src)[N], const K& key) {
  448|    513|  static_assert(N > 0, "Passed zero length find");
  449|    513|  auto rc = std::find(src, src + N, key);
  450|    513|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 220, False: 293]
  ------------------
  451|    513|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  447|    510|const T* find(T (&src)[N], const K& key) {
  448|    510|  static_assert(N > 0, "Passed zero length find");
  449|    510|  auto rc = std::find(src, src + N, key);
  450|    510|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 141, False: 369]
  ------------------
  451|    510|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  447|    527|const T* find(T (&src)[N], const K& key) {
  448|    527|  static_assert(N > 0, "Passed zero length find");
  449|    527|  auto rc = std::find(src, src + N, key);
  450|    527|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 494, False: 33]
  ------------------
  451|    527|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  447|   127k|const T* find(T (&src)[N], const K& key) {
  448|   127k|  static_assert(N > 0, "Passed zero length find");
  449|   127k|  auto rc = std::find(src, src + N, key);
  450|   127k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.06k, False: 126k]
  ------------------
  451|   127k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  447|  3.08k|const T* find(T (&src)[N], const K& key) {
  448|  3.08k|  static_assert(N > 0, "Passed zero length find");
  449|  3.08k|  auto rc = std::find(src, src + N, key);
  450|  3.08k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.59k, False: 1.48k]
  ------------------
  451|  3.08k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  447|  3.87k|const T* find(T (&src)[N], const K& key) {
  448|  3.87k|  static_assert(N > 0, "Passed zero length find");
  449|  3.87k|  auto rc = std::find(src, src + N, key);
  450|  3.87k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.32k, False: 1.55k]
  ------------------
  451|  3.87k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  447|  7.24k|const T* find(T (&src)[N], const K& key) {
  448|  7.24k|  static_assert(N > 0, "Passed zero length find");
  449|  7.24k|  auto rc = std::find(src, src + N, key);
  450|  7.24k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 6.36k, False: 887]
  ------------------
  451|  7.24k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  466|  4.16k|std::string toString(const T& arg) {
  467|  4.16k|  return toStringHelper(arg, std::is_integral<T>());
  468|  4.16k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  460|  4.16k|std::string toStringHelper(const T& arg, std::false_type) {
  461|  4.16k|  std::ostringstream os;
  462|  4.16k|  os << arg;
  463|  4.16k|  return os.str();
  464|  4.16k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  466|  1.19k|std::string toString(const T& arg) {
  467|  1.19k|  return toStringHelper(arg, std::is_integral<T>());
  468|  1.19k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  455|  1.19k|std::string toStringHelper(const T& arg, std::true_type) {
  456|  1.19k|  return std::to_string(arg);
  457|  1.19k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  466|   790k|std::string toString(const T& arg) {
  467|   790k|  return toStringHelper(arg, std::is_integral<T>());
  468|   790k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  460|   790k|std::string toStringHelper(const T& arg, std::false_type) {
  461|   790k|  std::ostringstream os;
  462|   790k|  os << arg;
  463|   790k|  return os.str();
  464|   790k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  447|    532|const T* find(T (&src)[N], const K& key) {
  448|    532|  static_assert(N > 0, "Passed zero length find");
  449|    532|  auto rc = std::find(src, src + N, key);
  450|    532|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 489, False: 43]
  ------------------
  451|    532|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  447|  8.10k|const T* find(T (&src)[N], const K& key) {
  448|  8.10k|  static_assert(N > 0, "Passed zero length find");
  449|  8.10k|  auto rc = std::find(src, src + N, key);
  450|  8.10k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 4.43k, False: 3.67k]
  ------------------
  451|  8.10k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  447|  8.10k|const T* find(T (&src)[N], const K& key) {
  448|  8.10k|  static_assert(N > 0, "Passed zero length find");
  449|  8.10k|  auto rc = std::find(src, src + N, key);
  450|  8.10k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 7.57k, False: 534]
  ------------------
  451|  8.10k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  447|  5.08k|const T* find(T (&src)[N], const K& key) {
  448|  5.08k|  static_assert(N > 0, "Passed zero length find");
  449|  5.08k|  auto rc = std::find(src, src + N, key);
  450|  5.08k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.39k, False: 1.69k]
  ------------------
  451|  5.08k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  447|  64.5k|const T* find(T (&src)[N], const K& key) {
  448|  64.5k|  static_assert(N > 0, "Passed zero length find");
  449|  64.5k|  auto rc = std::find(src, src + N, key);
  450|  64.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 56.3k, False: 8.15k]
  ------------------
  451|  64.5k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  447|  17.7k|const T* find(T (&src)[N], const K& key) {
  448|  17.7k|  static_assert(N > 0, "Passed zero length find");
  449|  17.7k|  auto rc = std::find(src, src + N, key);
  450|  17.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 7.80k, False: 9.95k]
  ------------------
  451|  17.7k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  447|  2.86k|const T* find(T (&src)[N], const K& key) {
  448|  2.86k|  static_assert(N > 0, "Passed zero length find");
  449|  2.86k|  auto rc = std::find(src, src + N, key);
  450|  2.86k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 2.25k, False: 611]
  ------------------
  451|  2.86k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  447|  2.86k|const T* find(T (&src)[N], const K& key) {
  448|  2.86k|  static_assert(N > 0, "Passed zero length find");
  449|  2.86k|  auto rc = std::find(src, src + N, key);
  450|  2.86k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.87k, False: 987]
  ------------------
  451|  2.86k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  447|    369|const T* find(T (&src)[N], const K& key) {
  448|    369|  static_assert(N > 0, "Passed zero length find");
  449|    369|  auto rc = std::find(src, src + N, key);
  450|    369|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 248, False: 121]
  ------------------
  451|    369|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  447|   308k|const T* find(T (&src)[N], const K& key) {
  448|   308k|  static_assert(N > 0, "Passed zero length find");
  449|   308k|  auto rc = std::find(src, src + N, key);
  450|   308k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 297k, False: 10.4k]
  ------------------
  451|   308k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  447|   107k|const T* find(T (&src)[N], const K& key) {
  448|   107k|  static_assert(N > 0, "Passed zero length find");
  449|   107k|  auto rc = std::find(src, src + N, key);
  450|   107k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 104k, False: 3.09k]
  ------------------
  451|   107k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  447|  2.80k|const T* find(T (&src)[N], const K& key) {
  448|  2.80k|  static_assert(N > 0, "Passed zero length find");
  449|  2.80k|  auto rc = std::find(src, src + N, key);
  450|  2.80k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 367, False: 2.43k]
  ------------------
  451|  2.80k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  447|  4.96k|const T* find(T (&src)[N], const K& key) {
  448|  4.96k|  static_assert(N > 0, "Passed zero length find");
  449|  4.96k|  auto rc = std::find(src, src + N, key);
  450|  4.96k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 1.17k, False: 3.79k]
  ------------------
  451|  4.96k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  447|  4.83M|const T* find(T (&src)[N], const K& key) {
  448|  4.83M|  static_assert(N > 0, "Passed zero length find");
  449|  4.83M|  auto rc = std::find(src, src + N, key);
  450|  4.83M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 4.83M]
  ------------------
  451|  4.83M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  447|  3.89M|const T* find(T (&src)[N], const K& key) {
  448|  3.89M|  static_assert(N > 0, "Passed zero length find");
  449|  3.89M|  auto rc = std::find(src, src + N, key);
  450|  3.89M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 3.89M]
  ------------------
  451|  3.89M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  447|  3.16M|const T* find(T (&src)[N], const K& key) {
  448|  3.16M|  static_assert(N > 0, "Passed zero length find");
  449|  3.16M|  auto rc = std::find(src, src + N, key);
  450|  3.16M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.15M, False: 9.66k]
  ------------------
  451|  3.16M|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  447|   110k|const T* find(T (&src)[N], const K& key) {
  448|   110k|  static_assert(N > 0, "Passed zero length find");
  449|   110k|  auto rc = std::find(src, src + N, key);
  450|   110k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 33.3k, False: 76.9k]
  ------------------
  451|   110k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  447|  1.08M|const T* find(T (&src)[N], const K& key) {
  448|  1.08M|  static_assert(N > 0, "Passed zero length find");
  449|  1.08M|  auto rc = std::find(src, src + N, key);
  450|  1.08M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 72, False: 1.08M]
  ------------------
  451|  1.08M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  447|  12.2k|const T* find(T (&src)[N], const K& key) {
  448|  12.2k|  static_assert(N > 0, "Passed zero length find");
  449|  12.2k|  auto rc = std::find(src, src + N, key);
  450|  12.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 3.98k, False: 8.27k]
  ------------------
  451|  12.2k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  447|  6.06k|const T* find(T (&src)[N], const K& key) {
  448|  6.06k|  static_assert(N > 0, "Passed zero length find");
  449|  6.06k|  auto rc = std::find(src, src + N, key);
  450|  6.06k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 0, False: 6.06k]
  ------------------
  451|  6.06k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  447|  1.13k|const T* find(T (&src)[N], const K& key) {
  448|  1.13k|  static_assert(N > 0, "Passed zero length find");
  449|  1.13k|  auto rc = std::find(src, src + N, key);
  450|  1.13k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 280, False: 851]
  ------------------
  451|  1.13k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  482|    165|T stringTo(const std::string& s, bool& ok) {
  483|    165|  std::istringstream is(s);
  484|    165|  T tmp = T();
  485|    165|  ok = static_cast<bool>(is >> tmp);
  486|    165|  std::string rest;
  487|    165|  is >> std::skipws >> rest;
  488|    165|  if (!rest.empty())
  ------------------
  |  Branch (488:7): [True: 91, False: 74]
  ------------------
  489|     91|    ok = false;
  490|    165|  return tmp;
  491|    165|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  447|     78|const T* find(T (&src)[N], const K& key) {
  448|     78|  static_assert(N > 0, "Passed zero length find");
  449|     78|  auto rc = std::find(src, src + N, key);
  450|     78|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (450:10): [True: 78, False: 0]
  ------------------
  451|     78|}

_ZNK5Exiv25Value6typeIdEv:
   85|  6.39M|  TypeId typeId() const {
   86|  6.39M|    return type_;
   87|  6.39M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  7.99M|  UniquePtr clone() const {
   94|  7.99M|    return UniquePtr(clone_());
   95|  7.99M|  }
_ZNK5Exiv25Value2okEv:
  181|   102k|  bool ok() const {
  182|   102k|    return ok_;
  183|   102k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  14.9k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  14.9k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 9.63k, False: 5.31k]
  ------------------
  797|  9.63k|      return str1.size() > str2.size();
  798|       |
  799|  5.31k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  5.31k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  14.9k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  41.5k|inline TypeId getType<uint16_t>() {
 1084|  41.5k|  return unsignedShort;
 1085|  41.5k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  2.91k|inline TypeId getType<uint32_t>() {
 1089|  2.91k|  return unsignedLong;
 1090|  2.91k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  8.38k|inline TypeId getType<URational>() {
 1094|  8.38k|  return unsignedRational;
 1095|  8.38k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  17.3k|inline TypeId getType<int16_t>() {
 1099|  17.3k|  return signedShort;
 1100|  17.3k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  53.1k|inline TypeId getType<int32_t>() {
 1104|  53.1k|  return signedLong;
 1105|  53.1k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  7.85k|inline TypeId getType<Rational>() {
 1109|  7.85k|  return signedRational;
 1110|  7.85k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  5.61k|inline TypeId getType<float>() {
 1114|  5.61k|  return tiffFloat;
 1115|  5.61k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  8.38k|inline TypeId getType<double>() {
 1119|  8.38k|  return tiffDouble;
 1120|  8.38k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|   830k|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|   830k|  return getUShort(buf, byteOrder);
 1316|   830k|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  1.83M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  1.83M|  return getULong(buf, byteOrder);
 1321|  1.83M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   714k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   714k|  return getURational(buf, byteOrder);
 1326|   714k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|  98.6k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|  98.6k|  return getShort(buf, byteOrder);
 1331|  98.6k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   444k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   444k|  return getLong(buf, byteOrder);
 1336|   444k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   357k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   357k|  return getRational(buf, byteOrder);
 1341|   357k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  44.5k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  44.5k|  return getFloat(buf, byteOrder);
 1346|  44.5k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   133k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   133k|  return getDouble(buf, byteOrder);
 1351|   133k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   556k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   556k|  return us2Data(buf, t, byteOrder);
 1374|   556k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  1.10M|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  1.10M|  return ul2Data(buf, t, byteOrder);
 1382|  1.10M|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   625k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   625k|  return ur2Data(buf, t, byteOrder);
 1390|   625k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   113k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   113k|  return s2Data(buf, t, byteOrder);
 1398|   113k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   272k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   272k|  return l2Data(buf, t, byteOrder);
 1406|   272k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   212k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   212k|  return r2Data(buf, t, byteOrder);
 1414|   212k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  56.6k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  56.6k|  return f2Data(buf, t, byteOrder);
 1422|  56.6k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   117k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   117k|  return d2Data(buf, t, byteOrder);
 1430|   117k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  1.08k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  1.08k|  return float_to_integer_helper<int64_t>(n);
 1550|  1.08k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  5.19k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  5.19k|  return float_to_integer_helper<uint32_t>(n);
 1555|  5.19k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  5.30k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  5.30k|  return float_to_integer_helper<int64_t>(n);
 1560|  5.30k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  8.44k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  8.44k|  return float_to_integer_helper<uint32_t>(n);
 1564|  8.44k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  5.19k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  5.19k|  return rational_to_integer_helper<int64_t>(n);
 1569|  5.19k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  9.55k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  9.55k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  9.55k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  7.09k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  7.09k|  return rational_to_integer_helper<int64_t>(n);
 1578|  7.09k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  22.9k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  22.9k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  22.9k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  1.08k|  I float_to_integer_helper(size_t n) const {
 1213|  1.08k|    const auto v = value_.at(n);
 1214|  1.08k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 999, False: 84]
  ------------------
 1215|    999|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 777, False: 222]
  ------------------
 1216|    777|      return static_cast<I>(std::lround(v));
 1217|    777|    }
 1218|    306|    return 0;
 1219|  1.08k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  5.19k|  I float_to_integer_helper(size_t n) const {
 1213|  5.19k|    const auto v = value_.at(n);
 1214|  5.19k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 4.58k, False: 611]
  ------------------
 1215|  4.58k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.97k, False: 611]
  ------------------
 1216|  3.97k|      return static_cast<I>(std::lround(v));
 1217|  3.97k|    }
 1218|  1.22k|    return 0;
 1219|  5.19k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  5.30k|  I float_to_integer_helper(size_t n) const {
 1213|  5.30k|    const auto v = value_.at(n);
 1214|  5.30k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 4.50k, False: 809]
  ------------------
 1215|  4.50k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.64k, False: 853]
  ------------------
 1216|  3.64k|      return static_cast<I>(std::lround(v));
 1217|  3.64k|    }
 1218|  1.66k|    return 0;
 1219|  5.30k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  8.44k|  I float_to_integer_helper(size_t n) const {
 1213|  8.44k|    const auto v = value_.at(n);
 1214|  8.44k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 5.33k, False: 3.11k]
  ------------------
 1215|  5.33k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 4.68k, False: 651]
  ------------------
 1216|  4.68k|      return static_cast<I>(std::lround(v));
 1217|  4.68k|    }
 1218|  3.76k|    return 0;
 1219|  8.44k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  5.19k|  I rational_to_integer_helper(size_t n) const {
 1224|  5.19k|    auto a = value_.at(n).first;
 1225|  5.19k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  5.19k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.81k, False: 3.37k]
  ------------------
 1229|  1.81k|      return 0;
 1230|  1.81k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  3.37k|#ifdef __cpp_if_constexpr
 1234|  3.37k|    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|  3.37k|      const auto imin = std::numeric_limits<I>::min();
 1240|  3.37k|      const auto imax = std::numeric_limits<I>::max();
 1241|  3.37k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 3.37k]
  |  Branch (1241:23): [True: 0, False: 3.37k]
  |  Branch (1241:35): [True: 0, False: 3.37k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  3.37k|#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|  3.37k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  5.19k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  9.55k|  I rational_to_integer_helper(size_t n) const {
 1224|  9.55k|    auto a = value_.at(n).first;
 1225|  9.55k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  9.55k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.41k, False: 7.13k]
  ------------------
 1229|  2.41k|      return 0;
 1230|  2.41k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  7.13k|#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|  7.13k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  7.13k|      const auto imax = std::numeric_limits<I>::max();
 1257|  7.13k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 483, False: 6.65k]
  ------------------
 1258|    483|        return 0;
 1259|    483|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  6.65k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  6.65k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  6.65k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 6.65k]
  |  Branch (1263:25): [True: 0, False: 6.65k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  6.65k|    }
 1267|       |
 1268|  6.65k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  9.55k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  7.09k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.09k|    auto a = value_.at(n).first;
 1225|  7.09k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.09k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 876, False: 6.21k]
  ------------------
 1229|    876|      return 0;
 1230|    876|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.21k|#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.21k|    } 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.21k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  6.21k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 6.21k]
  |  Branch (1251:23): [True: 0, False: 6.21k]
  ------------------
 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.21k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.09k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  22.9k|  I rational_to_integer_helper(size_t n) const {
 1224|  22.9k|    auto a = value_.at(n).first;
 1225|  22.9k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  22.9k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.68k, False: 21.2k]
  ------------------
 1229|  1.68k|      return 0;
 1230|  1.68k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  21.2k|#ifdef __cpp_if_constexpr
 1234|  21.2k|    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|  21.2k|      const auto imin = std::numeric_limits<I>::min();
 1240|  21.2k|      const auto imax = std::numeric_limits<I>::max();
 1241|  21.2k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 21.2k]
  |  Branch (1241:23): [True: 0, False: 21.2k]
  |  Branch (1241:35): [True: 0, False: 21.2k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  21.2k|#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|  21.2k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  22.9k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  41.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  41.5k|}
_ZN5Exiv25ValueD2Ev:
   43|  10.2M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  40.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  40.1k|  value_.clear();
 1469|  40.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  40.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 40.1k, False: 0]
  |  Branch (1470:17): [True: 243, False: 39.9k]
  ------------------
 1471|    243|    len = (len / ts) * ts;
 1472|   871k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 830k, False: 40.1k]
  ------------------
 1473|   830k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   830k|  }
 1475|  40.1k|  return 0;
 1476|  40.1k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.32k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.32k|  std::istringstream is(buf);
 1481|  1.32k|  T tmp;
 1482|  1.32k|  ValueList val;
 1483|  2.38k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 1.05k, False: 1.32k]
  ------------------
 1484|  1.05k|    val.push_back(tmp);
 1485|  1.32k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 3, False: 1.32k]
  ------------------
 1486|      3|    return 1;
 1487|  1.32k|  value_ = std::move(val);
 1488|  1.32k|  return 0;
 1489|  1.32k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.49k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.49k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 734, False: 763]
  ------------------
 1651|    734|    pDataArea_ = Blob(buf, buf + len);
 1652|    763|  else
 1653|    763|    pDataArea_.clear();
 1654|  1.49k|  return 0;
 1655|  1.49k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  30.6k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  30.6k|  size_t offset = 0;
 1494|   556k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 556k, False: 30.6k]
  ------------------
 1495|   556k|    offset += toData(buf + offset, val, byteOrder);
 1496|   556k|  }
 1497|  30.6k|  return offset;
 1498|  30.6k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   179k|size_t ValueType<T>::count() const {
 1502|   179k|  return value_.size();
 1503|   179k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   137k|size_t ValueType<T>::size() const {
 1507|   137k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   137k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    380|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    380|  auto end = value_.end();
 1518|    380|  auto i = value_.begin();
 1519|  4.79k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.41k, False: 380]
  ------------------
 1520|  4.41k|    os << std::setprecision(15) << *i;
 1521|  4.41k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.13k, False: 279]
  ------------------
 1522|  4.13k|      os << " ";
 1523|  4.41k|  }
 1524|    380|  return os;
 1525|    380|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|  96.1k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  96.1k|  ok_ = true;
 1537|  96.1k|  return static_cast<int64_t>(value_.at(n));
 1538|  96.1k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   105k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   105k|  ok_ = true;
 1542|   105k|  return static_cast<uint32_t>(value_.at(n));
 1543|   105k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  2.73k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.73k|  return pDataArea_.size();
 1641|  2.73k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    568|DataBuf ValueType<T>::dataArea() const {
 1645|    568|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    568|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   105k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   105k|  return new ValueType<T>(*this);
 1513|   105k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   105k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   105k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.56k, False: 104k]
  ------------------
 1449|  1.56k|    pDataArea_ = rhs.pDataArea_;
 1450|   105k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  7.36M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  83.4k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  83.4k|  value_.clear();
 1469|  83.4k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  83.4k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 83.4k, False: 0]
  |  Branch (1470:17): [True: 50, False: 83.3k]
  ------------------
 1471|     50|    len = (len / ts) * ts;
 1472|  1.91M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.83M, False: 83.4k]
  ------------------
 1473|  1.83M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.83M|  }
 1475|  83.4k|  return 0;
 1476|  83.4k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    412|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    412|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 267, False: 145]
  ------------------
 1651|    267|    pDataArea_ = Blob(buf, buf + len);
 1652|    145|  else
 1653|    145|    pDataArea_.clear();
 1654|    412|  return 0;
 1655|    412|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  73.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  73.3k|  size_t offset = 0;
 1494|  1.10M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.10M, False: 73.3k]
  ------------------
 1495|  1.10M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.10M|  }
 1497|  73.3k|  return offset;
 1498|  73.3k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   230k|size_t ValueType<T>::count() const {
 1502|   230k|  return value_.size();
 1503|   230k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   517k|size_t ValueType<T>::size() const {
 1507|   517k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   517k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  2.73k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  2.73k|  auto end = value_.end();
 1518|  2.73k|  auto i = value_.begin();
 1519|  79.6k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 76.9k, False: 2.73k]
  ------------------
 1520|  76.9k|    os << std::setprecision(15) << *i;
 1521|  76.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 74.5k, False: 2.41k]
  ------------------
 1522|  74.5k|      os << " ";
 1523|  76.9k|  }
 1524|  2.73k|  return os;
 1525|  2.73k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  5.73k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  5.73k|  ok_ = true;
 1537|  5.73k|  return static_cast<int64_t>(value_.at(n));
 1538|  5.73k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  74.5k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  74.5k|  ok_ = true;
 1542|  74.5k|  return static_cast<uint32_t>(value_.at(n));
 1543|  74.5k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  8.29k|size_t ValueType<T>::sizeDataArea() const {
 1640|  8.29k|  return pDataArea_.size();
 1641|  8.29k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    842|DataBuf ValueType<T>::dataArea() const {
 1645|    842|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    842|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   246k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   246k|  return new ValueType<T>(*this);
 1513|   246k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   246k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   246k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 304, False: 245k]
  ------------------
 1449|    304|    pDataArea_ = rhs.pDataArea_;
 1450|   246k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  8.38k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  8.38k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  8.04k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.04k|  value_.clear();
 1469|  8.04k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.04k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.04k, False: 0]
  |  Branch (1470:17): [True: 0, False: 8.04k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   722k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 714k, False: 8.04k]
  ------------------
 1473|   714k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   714k|  }
 1475|  8.04k|  return 0;
 1476|  8.04k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|    442|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    442|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 221, False: 221]
  ------------------
 1651|    221|    pDataArea_ = Blob(buf, buf + len);
 1652|    221|  else
 1653|    221|    pDataArea_.clear();
 1654|    442|  return 0;
 1655|    442|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  7.22k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  7.22k|  size_t offset = 0;
 1494|   625k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 625k, False: 7.22k]
  ------------------
 1495|   625k|    offset += toData(buf + offset, val, byteOrder);
 1496|   625k|  }
 1497|  7.22k|  return offset;
 1498|  7.22k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  35.7k|size_t ValueType<T>::count() const {
 1502|  35.7k|  return value_.size();
 1503|  35.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  18.8k|size_t ValueType<T>::size() const {
 1507|  18.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  18.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    456|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    456|  auto end = value_.end();
 1518|    456|  auto i = value_.begin();
 1519|  6.35k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.90k, False: 456]
  ------------------
 1520|  5.90k|    os << std::setprecision(15) << *i;
 1521|  5.90k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.70k, False: 203]
  ------------------
 1522|  5.70k|      os << " ";
 1523|  5.90k|  }
 1524|    456|  return os;
 1525|    456|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  1.28k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.28k|  return pDataArea_.size();
 1641|  1.28k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    144|DataBuf ValueType<T>::dataArea() const {
 1645|    144|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    144|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  25.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  25.7k|  return new ValueType<T>(*this);
 1513|  25.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  25.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  25.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 513, False: 25.2k]
  ------------------
 1449|    513|    pDataArea_ = rhs.pDataArea_;
 1450|  25.7k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  17.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  17.3k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  12.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.1k|  value_.clear();
 1469|  12.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.1k, False: 0]
  |  Branch (1470:17): [True: 24, False: 12.0k]
  ------------------
 1471|     24|    len = (len / ts) * ts;
 1472|   110k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 98.6k, False: 12.1k]
  ------------------
 1473|  98.6k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  98.6k|  }
 1475|  12.1k|  return 0;
 1476|  12.1k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  5.28k|int ValueType<T>::read(const std::string& buf) {
 1480|  5.28k|  std::istringstream is(buf);
 1481|  5.28k|  T tmp;
 1482|  5.28k|  ValueList val;
 1483|  15.9k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 10.6k, False: 5.28k]
  ------------------
 1484|  10.6k|    val.push_back(tmp);
 1485|  5.28k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 5.28k]
  ------------------
 1486|      0|    return 1;
 1487|  5.28k|  value_ = std::move(val);
 1488|  5.28k|  return 0;
 1489|  5.28k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    722|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    722|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 430, False: 292]
  ------------------
 1651|    430|    pDataArea_ = Blob(buf, buf + len);
 1652|    292|  else
 1653|    292|    pDataArea_.clear();
 1654|    722|  return 0;
 1655|    722|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  5.38k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.38k|  size_t offset = 0;
 1494|   113k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 113k, False: 5.38k]
  ------------------
 1495|   113k|    offset += toData(buf + offset, val, byteOrder);
 1496|   113k|  }
 1497|  5.38k|  return offset;
 1498|  5.38k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  38.1k|size_t ValueType<T>::count() const {
 1502|  38.1k|  return value_.size();
 1503|  38.1k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  20.8k|size_t ValueType<T>::size() const {
 1507|  20.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  20.8k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    326|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    326|  auto end = value_.end();
 1518|    326|  auto i = value_.begin();
 1519|  1.98k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.65k, False: 326]
  ------------------
 1520|  1.65k|    os << std::setprecision(15) << *i;
 1521|  1.65k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.47k, False: 184]
  ------------------
 1522|  1.47k|      os << " ";
 1523|  1.65k|  }
 1524|    326|  return os;
 1525|    326|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  3.63k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  3.63k|  ok_ = true;
 1537|  3.63k|  return static_cast<int64_t>(value_.at(n));
 1538|  3.63k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|  84.6k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  84.6k|  ok_ = true;
 1542|  84.6k|  return static_cast<uint32_t>(value_.at(n));
 1543|  84.6k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.30k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.30k|  return pDataArea_.size();
 1641|  1.30k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    387|DataBuf ValueType<T>::dataArea() const {
 1645|    387|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    387|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  37.8k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  37.8k|  return new ValueType<T>(*this);
 1513|  37.8k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  37.8k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  37.8k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 848, False: 37.0k]
  ------------------
 1449|    848|    pDataArea_ = rhs.pDataArea_;
 1450|  37.8k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  53.1k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  53.1k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  53.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  53.1k|  value_.clear();
 1469|  53.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  53.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 53.1k, False: 0]
  |  Branch (1470:17): [True: 50, False: 53.0k]
  ------------------
 1471|     50|    len = (len / ts) * ts;
 1472|   498k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 444k, False: 53.1k]
  ------------------
 1473|   444k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   444k|  }
 1475|  53.1k|  return 0;
 1476|  53.1k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    643|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    643|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 323, False: 320]
  ------------------
 1651|    323|    pDataArea_ = Blob(buf, buf + len);
 1652|    320|  else
 1653|    320|    pDataArea_.clear();
 1654|    643|  return 0;
 1655|    643|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  48.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  48.3k|  size_t offset = 0;
 1494|   272k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 272k, False: 48.3k]
  ------------------
 1495|   272k|    offset += toData(buf + offset, val, byteOrder);
 1496|   272k|  }
 1497|  48.3k|  return offset;
 1498|  48.3k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   131k|size_t ValueType<T>::count() const {
 1502|   131k|  return value_.size();
 1503|   131k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   406k|size_t ValueType<T>::size() const {
 1507|   406k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   406k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    442|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    442|  auto end = value_.end();
 1518|    442|  auto i = value_.begin();
 1519|   431k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 431k, False: 442]
  ------------------
 1520|   431k|    os << std::setprecision(15) << *i;
 1521|   431k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 430k, False: 424]
  ------------------
 1522|   430k|      os << " ";
 1523|   431k|  }
 1524|    442|  return os;
 1525|    442|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  6.49k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  6.49k|  ok_ = true;
 1537|  6.49k|  return static_cast<int64_t>(value_.at(n));
 1538|  6.49k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  10.1k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  10.1k|  ok_ = true;
 1542|  10.1k|  return static_cast<uint32_t>(value_.at(n));
 1543|  10.1k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  2.57k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.57k|  return pDataArea_.size();
 1641|  2.57k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    277|DataBuf ValueType<T>::dataArea() const {
 1645|    277|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    277|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   147k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   147k|  return new ValueType<T>(*this);
 1513|   147k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   147k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   147k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 626, False: 146k]
  ------------------
 1449|    626|    pDataArea_ = rhs.pDataArea_;
 1450|   147k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  7.85k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.85k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  7.85k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  7.85k|  value_.clear();
 1469|  7.85k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  7.85k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 7.85k, False: 0]
  |  Branch (1470:17): [True: 0, False: 7.85k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   365k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 357k, False: 7.85k]
  ------------------
 1473|   357k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   357k|  }
 1475|  7.85k|  return 0;
 1476|  7.85k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    796|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    796|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 368, False: 428]
  ------------------
 1651|    368|    pDataArea_ = Blob(buf, buf + len);
 1652|    428|  else
 1653|    428|    pDataArea_.clear();
 1654|    796|  return 0;
 1655|    796|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  6.18k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.18k|  size_t offset = 0;
 1494|   212k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 212k, False: 6.18k]
  ------------------
 1495|   212k|    offset += toData(buf + offset, val, byteOrder);
 1496|   212k|  }
 1497|  6.18k|  return offset;
 1498|  6.18k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  22.9k|size_t ValueType<T>::count() const {
 1502|  22.9k|  return value_.size();
 1503|  22.9k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  18.1k|size_t ValueType<T>::size() const {
 1507|  18.1k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  18.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    768|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    768|  auto end = value_.end();
 1518|    768|  auto i = value_.begin();
 1519|  2.74k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.97k, False: 768]
  ------------------
 1520|  1.97k|    os << std::setprecision(15) << *i;
 1521|  1.97k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.58k, False: 391]
  ------------------
 1522|  1.58k|      os << " ";
 1523|  1.97k|  }
 1524|    768|  return os;
 1525|    768|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  1.18k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.18k|  return pDataArea_.size();
 1641|  1.18k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     72|DataBuf ValueType<T>::dataArea() const {
 1645|     72|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     72|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  24.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  24.7k|  return new ValueType<T>(*this);
 1513|  24.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  24.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  24.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 627, False: 24.1k]
  ------------------
 1449|    627|    pDataArea_ = rhs.pDataArea_;
 1450|  24.7k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  5.61k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.61k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  5.61k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  5.61k|  value_.clear();
 1469|  5.61k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  5.61k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 5.61k, False: 0]
  |  Branch (1470:17): [True: 0, False: 5.61k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  50.2k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 44.5k, False: 5.61k]
  ------------------
 1473|  44.5k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  44.5k|  }
 1475|  5.61k|  return 0;
 1476|  5.61k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.44k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.44k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.17k, False: 264]
  ------------------
 1651|  1.17k|    pDataArea_ = Blob(buf, buf + len);
 1652|    264|  else
 1653|    264|    pDataArea_.clear();
 1654|  1.44k|  return 0;
 1655|  1.44k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  3.75k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  3.75k|  size_t offset = 0;
 1494|  56.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 56.6k, False: 3.75k]
  ------------------
 1495|  56.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  56.6k|  }
 1497|  3.75k|  return offset;
 1498|  3.75k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  29.3k|size_t ValueType<T>::count() const {
 1502|  29.3k|  return value_.size();
 1503|  29.3k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  9.55k|size_t ValueType<T>::size() const {
 1507|  9.55k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  9.55k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    487|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    487|  auto end = value_.end();
 1518|    487|  auto i = value_.begin();
 1519|  67.8k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 67.3k, False: 487]
  ------------------
 1520|  67.3k|    os << std::setprecision(15) << *i;
 1521|  67.3k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 67.0k, False: 337]
  ------------------
 1522|  67.0k|      os << " ";
 1523|  67.3k|  }
 1524|    487|  return os;
 1525|    487|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  4.38k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.38k|  return pDataArea_.size();
 1641|  4.38k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    287|DataBuf ValueType<T>::dataArea() const {
 1645|    287|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    287|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  19.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  19.1k|  return new ValueType<T>(*this);
 1513|  19.1k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  19.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  19.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.65k, False: 17.5k]
  ------------------
 1449|  1.65k|    pDataArea_ = rhs.pDataArea_;
 1450|  19.1k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  8.38k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  8.38k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  8.38k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.38k|  value_.clear();
 1469|  8.38k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.38k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.38k, False: 0]
  |  Branch (1470:17): [True: 0, False: 8.38k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   141k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 133k, False: 8.38k]
  ------------------
 1473|   133k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   133k|  }
 1475|  8.38k|  return 0;
 1476|  8.38k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    549|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    549|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 402, False: 147]
  ------------------
 1651|    402|    pDataArea_ = Blob(buf, buf + len);
 1652|    147|  else
 1653|    147|    pDataArea_.clear();
 1654|    549|  return 0;
 1655|    549|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  3.33k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  3.33k|  size_t offset = 0;
 1494|   117k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 117k, False: 3.33k]
  ------------------
 1495|   117k|    offset += toData(buf + offset, val, byteOrder);
 1496|   117k|  }
 1497|  3.33k|  return offset;
 1498|  3.33k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  21.3k|size_t ValueType<T>::count() const {
 1502|  21.3k|  return value_.size();
 1503|  21.3k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  10.4k|size_t ValueType<T>::size() const {
 1507|  10.4k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  10.4k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    222|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    222|  auto end = value_.end();
 1518|    222|  auto i = value_.begin();
 1519|    965|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 743, False: 222]
  ------------------
 1520|    743|    os << std::setprecision(15) << *i;
 1521|    743|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 556, False: 187]
  ------------------
 1522|    556|      os << " ";
 1523|    743|  }
 1524|    222|  return os;
 1525|    222|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  2.17k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.17k|  return pDataArea_.size();
 1641|  2.17k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    249|DataBuf ValueType<T>::dataArea() const {
 1645|    249|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    249|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  23.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  23.1k|  return new ValueType<T>(*this);
 1513|  23.1k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  23.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  23.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 770, False: 22.4k]
  ------------------
 1449|    770|    pDataArea_ = rhs.pDataArea_;
 1450|  23.1k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   214k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  2.91k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  2.91k|}

_ZNK5Exiv27XmpData9usePacketEv:
  216|  14.1k|  [[nodiscard]] bool usePacket() const {
  217|  14.1k|    return usePacket_;
  218|  14.1k|  }
_ZN5Exiv27XmpData9usePacketEb:
  221|  34.5k|  bool usePacket(bool b) {
  222|  34.5k|    bool r = usePacket_;
  223|  34.5k|    usePacket_ = b;
  224|  34.5k|    return r;
  225|  34.5k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  227|  30.0k|  void setPacket(std::string xmpPacket) {
  228|  30.0k|    xmpPacket_ = std::move(xmpPacket);
  229|  30.0k|    usePacket(false);
  230|  30.0k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  260|   101k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  261|   101k|    return nsBindings_;
  262|   101k|  }
_ZN5Exiv27XmpDataC2Ev:
  140|  34.6k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  395|  24.5k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|  24.5k|    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  24.5k|  return *this;
  405|  24.5k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  395|  77.1k|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|  77.1k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  77.1k|  return *this;
  405|  77.1k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  395|   147k|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|   147k|    setValue(Exiv2::toString(value));
  404|   147k|  return *this;
  405|   147k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  395|  11.5k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  11.5k|    setValue(Exiv2::toString(value));
  404|  11.5k|  return *this;
  405|  11.5k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  395|  21.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|  21.7k|    setValue(Exiv2::toString(value));
  404|  21.7k|  return *this;
  405|  21.7k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  395|  4.16k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  4.16k|    setValue(Exiv2::toString(value));
  404|  4.16k|  return *this;
  405|  4.16k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  395|  1.23k|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.23k|    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.23k|  return *this;
  405|  1.23k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  395|  1.19k|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.19k|    setValue(Exiv2::toString(value));
  404|  1.19k|  return *this;
  405|  1.19k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  395|  3.29k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|       |    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|  3.29k|    setValue(Exiv2::toString(value));
  404|  3.29k|  return *this;
  405|  3.29k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  395|    476|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|    476|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|    476|  return *this;
  405|    476|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  395|   108k|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|   108k|    setValue(Exiv2::toString(value));
  404|   108k|  return *this;
  405|   108k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  395|  1.54k|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.54k|    setValue(Exiv2::toString(value));
  404|  1.54k|  return *this;
  405|  1.54k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  395|   146k|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|   146k|    setValue(Exiv2::toString(value));
  404|   146k|  return *this;
  405|   146k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  395|  21.8k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  396|       |  if constexpr (std::is_same_v<T, bool>)
  397|       |    setValue(value ? "True" : "False");
  398|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  399|  21.8k|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|  21.8k|  return *this;
  405|  21.8k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  395|   153k|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|   153k|    setValue(Exiv2::toString(value));
  404|   153k|  return *this;
  405|   153k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  395|     17|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|     17|    setValue(value);
  400|       |  else if constexpr (std::is_base_of_v<Value, T>)
  401|       |    setValue(&value);
  402|       |  else
  403|       |    setValue(Exiv2::toString(value));
  404|     17|  return *this;
  405|     17|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  7.68k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  7.68k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 2.71k, False: 4.96k]
  |  Branch (43:36): [True: 2.68k, False: 26]
  |  Branch (43:62): [True: 2.67k, False: 15]
  |  Branch (43:88): [True: 2.67k, False: 3]
  ------------------
   44|  7.68k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  13.1k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  13.1k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  13.1k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  13.1k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  13.1k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  13.1k|}
_ZNK5Exiv28AsfVideo7GUIDTag9to_stringEv:
   53|    426|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|    426|  return stringFormat("{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}", data1_, data2_, data3_,
  ------------------
  |  |   18|    426|#define stringFormat std::format
  ------------------
   58|    426|                      data4_[0], data4_[1], data4_[2], data4_[3], data4_[4], data4_[5], data4_[6], data4_[7]);
   59|    426|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  36.0k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  36.0k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 27.0k, False: 8.98k]
  ------------------
   63|  27.0k|    return data1_ < other.data1_;
   64|  8.98k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 210, False: 8.77k]
  ------------------
   65|    210|    return data2_ < other.data2_;
   66|  8.77k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 209, False: 8.56k]
  ------------------
   67|    209|    return data3_ < other.data3_;
   68|  8.56k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  8.77k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  183|    890|    Image(ImageType::asf, mdNone, std::move(io)), max_recursion_depth_(max_recursion_depth) {
  184|    890|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  186|    890|std::string AsfVideo::mimeType() const {
  187|    890|  return "video/asf";
  188|    890|}
_ZN5Exiv28AsfVideo13writeMetadataEv:
  190|      5|void AsfVideo::writeMetadata() {
  191|      5|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  193|    890|void AsfVideo::readMetadata() {
  194|    890|  if (io_->open() != 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 890]
  ------------------
  195|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  196|       |
  197|       |  // Ensure that this is the correct image type
  198|    890|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 890]
  ------------------
  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|    890|  IoCloser closer(*io_);
  205|    890|  clearMetadata();
  206|    890|  io_->seek(0, BasicIo::beg);
  207|    890|  height_ = width_ = 1;
  208|       |
  209|    890|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  210|    890|  xmpData()["Xmp.video.MimeType"] = mimeType();
  211|       |
  212|    890|  decodeBlock(0);
  213|       |
  214|    890|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  215|    890|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  217|  4.85k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  218|  4.85k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (218:7): [True: 4.85k, False: 0]
  ------------------
  219|  4.85k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  220|       |
  221|  4.85k|    size_ = readQWORDTag(io);
  222|  4.85k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (222:9): [True: 3.51k, False: 1.34k]
  ------------------
  223|  3.51k|      remaining_size_ = size_ - GUID - QWORD;
  224|  4.85k|  }
  225|  4.85k|}
_ZN5Exiv28AsfVideo11decodeBlockEm:
  227|  4.89k|void AsfVideo::decodeBlock(size_t depth) {
  228|  4.89k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  229|  4.89k|  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|  4.89k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  235|  4.89k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  236|       |
  237|  4.89k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (237:7): [True: 3.43k, False: 1.46k]
  ------------------
  238|  3.43k|    if (tag->second == "Header")
  ------------------
  |  Branch (238:9): [True: 1.05k, False: 2.37k]
  ------------------
  239|  1.05k|      decodeHeader(depth + 1);
  240|  2.37k|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (240:14): [True: 433, False: 1.94k]
  ------------------
  241|    433|      fileProperties();
  242|  1.94k|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (242:14): [True: 397, False: 1.54k]
  ------------------
  243|    397|      streamProperties();
  244|  1.54k|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (244:14): [True: 262, False: 1.28k]
  ------------------
  245|    262|      headerExtension();
  246|  1.28k|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (246:14): [True: 180, False: 1.10k]
  ------------------
  247|    180|      codecList();
  248|  1.10k|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (248:14): [True: 446, False: 661]
  ------------------
  249|    446|      extendedContentDescription();
  250|    661|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (250:14): [True: 369, False: 292]
  ------------------
  251|    369|      contentDescription();
  252|    292|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (252:14): [True: 91, False: 201]
  ------------------
  253|     91|      extendedStreamProperties();
  254|    201|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (254:14): [True: 0, False: 201]
  ------------------
  255|      0|      DegradableJPEGMedia();
  256|    201|    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|    201|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  260|    201|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|    201|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  262|    201|    }
  263|  3.43k|  } 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.46k|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  267|  1.46k|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  268|  1.46k|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  269|  1.46k|  }
  270|       |
  271|  4.89k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEm:
  273|  1.05k|void AsfVideo::decodeHeader(size_t depth) {
  274|  1.05k|  Internal::enforce(depth <= max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|  1.05k|  DataBuf nbHeadersBuf(DWORD + 1);
  276|  1.05k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  277|       |
  278|  1.05k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  279|  1.05k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  1.05k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  281|  1.05k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  282|  5.06k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (282:24): [True: 4.00k, False: 1.05k]
  ------------------
  283|  4.00k|    decodeBlock(depth);
  284|  4.00k|  }
  285|  1.05k|}
_ZN5Exiv28AsfVideo24extendedStreamPropertiesEv:
  287|     91|void AsfVideo::extendedStreamProperties() {
  288|     91|  xmpData()["Xmp.video.StartTimecode"] = readQWORDTag(io_);  // Start Time
  289|     91|  xmpData()["Xmp.video.EndTimecode"] = readWORDTag(io_);     // End Time
  290|       |
  291|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Data Bitrate
  292|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Buffer Size
  293|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Initial Buffer Fullness
  294|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Data Bitrate
  295|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Buffer Size
  296|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Initial Buffer Fullness
  297|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Maximum Object Size
  298|     91|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Flags Buffer Size
  299|     91|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Flags Stream Number
  300|     91|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Stream Language ID Index
  301|       |
  302|     91|  xmpData()["Xmp.video.FrameRate"] = readWORDTag(io_);  // Average Time Per Frame
  303|     91|  uint16_t stream_name_count = readWORDTag(io_);
  304|     91|  uint16_t payload_ext_sys_count = readWORDTag(io_);
  305|       |
  306|    408|  for (uint16_t i = 0; i < stream_name_count; i++) {
  ------------------
  |  Branch (306:24): [True: 317, False: 91]
  ------------------
  307|    317|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Language ID Index
  308|    317|    uint16_t stream_length = readWORDTag(io_);
  309|    317|    if (stream_length)
  ------------------
  |  Branch (309:9): [True: 207, False: 110]
  ------------------
  310|    207|      io_->seek(io_->tell() + stream_length, BasicIo::beg);  // ignore Stream name
  311|    317|  }
  312|       |
  313|    327|  for (uint16_t i = 0; i < payload_ext_sys_count; i++) {
  ------------------
  |  Branch (313:24): [True: 236, False: 91]
  ------------------
  314|    236|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Extension System ID
  315|    236|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Extension Data Size
  316|    236|    uint16_t ext_sys_info_length = readWORDTag(io_);
  317|    236|    if (ext_sys_info_length)
  ------------------
  |  Branch (317:9): [True: 134, False: 102]
  ------------------
  318|    134|      io_->seek(io_->tell() + ext_sys_info_length, BasicIo::beg);  // ignore Extension System Info
  319|    236|  }
  320|     91|}  // AsfVideo::extendedStreamProperties
_ZN5Exiv28AsfVideo16streamPropertiesEv:
  337|    397|void AsfVideo::streamProperties() {
  338|    397|  DataBuf streamTypedBuf(GUID);
  339|    397|  io_->readOrThrow(streamTypedBuf.data(), streamTypedBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  340|       |
  341|    397|  enum class streamTypeInfo { Audio = 1, Video = 2 };
  342|    397|  auto stream = streamTypeInfo{0};
  343|       |
  344|    397|  auto tag_stream_type = GUIDReferenceTags.find(GUIDTag(streamTypedBuf.data()));
  345|    397|  if (tag_stream_type != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (345:7): [True: 136, False: 261]
  ------------------
  346|    136|    if (tag_stream_type->second == "Audio_Media")
  ------------------
  |  Branch (346:9): [True: 3, False: 133]
  ------------------
  347|      3|      stream = streamTypeInfo::Audio;
  348|    133|    else if (tag_stream_type->second == "Video_Media")
  ------------------
  |  Branch (348:14): [True: 16, False: 117]
  ------------------
  349|     16|      stream = streamTypeInfo::Video;
  350|       |
  351|    136|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Error Correction Type
  352|       |
  353|    136|    uint64_t time_offset = readQWORDTag(io_);
  354|    136|    if (stream == streamTypeInfo::Video)
  ------------------
  |  Branch (354:9): [True: 16, False: 120]
  ------------------
  355|     16|      xmpData()["Xmp.video.TimeOffset"] = time_offset;
  356|    120|    else if (stream == streamTypeInfo::Audio)
  ------------------
  |  Branch (356:14): [True: 3, False: 117]
  ------------------
  357|      3|      xmpData()["Xmp.audio.TimeOffset"] = time_offset;
  358|       |
  359|    136|    auto specific_data_length = readDWORDTag(io_);
  360|    136|    auto correction_data_length = readDWORDTag(io_);
  361|       |
  362|    136|    io_->seek(io_->tell() + WORD /*Flags*/ + DWORD /*Reserved*/ + specific_data_length + correction_data_length,
  363|    136|              BasicIo::beg);
  364|    136|  }
  365|       |
  366|    397|}  // AsfVideo::streamProperties
_ZN5Exiv28AsfVideo9codecListEv:
  368|    180|void AsfVideo::codecList() {
  369|    180|  io_->seek(io_->tell() + GUID /*reserved*/, BasicIo::beg);
  370|    180|  auto entries_count = readDWORDTag(io_);
  371|    817|  for (uint32_t i = 0; i < entries_count; i++) {
  ------------------
  |  Branch (371:24): [True: 637, False: 180]
  ------------------
  372|    637|    uint16_t codec_type = readWORDTag(io_) * 2;
  373|    637|    std::string codec = (codec_type == 1) ? "Xmp.video" : "Xmp.audio";
  ------------------
  |  Branch (373:25): [True: 0, False: 637]
  ------------------
  374|       |
  375|    637|    if (uint16_t codec_name_length = readWORDTag(io_) * 2)
  ------------------
  |  Branch (375:18): [True: 506, False: 131]
  ------------------
  376|    506|      xmpData()[codec + std::string(".CodecName")] = readStringWcharTag(io_, codec_name_length);
  377|       |
  378|    637|    if (uint16_t codec_desc_length = readWORDTag(io_))
  ------------------
  |  Branch (378:18): [True: 485, False: 152]
  ------------------
  379|    485|      xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
  380|       |
  381|    637|    uint16_t codec_info_length = readWORDTag(io_);
  382|    637|    Internal::enforce(codec_info_length && codec_info_length < io_->size() - io_->tell(),
  ------------------
  |  Branch (382:23): [True: 510, False: 127]
  |  Branch (382:44): [True: 491, False: 19]
  ------------------
  383|    637|                      Exiv2::ErrorCode::kerCorruptedMetadata);
  384|    637|    xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
  385|    637|  }
  386|    180|}  // AsfVideo::codecList
_ZNK5Exiv28AsfVideo15headerExtensionEv:
  388|    262|void AsfVideo::headerExtension() const {
  389|    262|  io_->seek(io_->tell() + GUID /*reserved1*/ + WORD /*Reserved2*/, BasicIo::beg);
  390|    262|  auto header_ext_data_length = readDWORDTag(io_);
  391|    262|  io_->seek(io_->tell() + header_ext_data_length, BasicIo::beg);
  392|    262|}  // AsfVideo::headerExtension
_ZN5Exiv28AsfVideo26extendedContentDescriptionEv:
  394|    446|void AsfVideo::extendedContentDescription() {
  395|    446|  uint16_t content_descriptor_count = readWORDTag(io_);
  396|    446|  std::string value;
  397|       |
  398|  15.6k|  for (uint16_t i = 0; i < content_descriptor_count; i++) {
  ------------------
  |  Branch (398:24): [True: 15.2k, False: 394]
  ------------------
  399|  15.2k|    if (uint16_t descriptor_name_length = readWORDTag(io_))
  ------------------
  |  Branch (399:18): [True: 4.29k, False: 10.9k]
  ------------------
  400|  4.29k|      value += readStringWcharTag(io_, descriptor_name_length);  // Descriptor Name
  401|       |
  402|  15.2k|    uint16_t descriptor_value_data_type = readWORDTag(io_);
  403|  15.2k|    if (uint16_t descriptor_value_length = readWORDTag(io_)) {
  ------------------
  |  Branch (403:18): [True: 4.86k, False: 10.4k]
  ------------------
  404|       |      // Descriptor Value
  405|  4.86k|      switch (descriptor_value_data_type) {
  ------------------
  |  Branch (405:15): [True: 2.11k, False: 2.74k]
  ------------------
  406|  1.43k|        case 0 /*Unicode string */:
  ------------------
  |  Branch (406:9): [True: 1.43k, False: 3.42k]
  ------------------
  407|  1.43k|          value += std::string(": ") + readStringWcharTag(io_, descriptor_value_length);
  408|  1.43k|          break;
  409|     55|        case 1 /*BYTE array  */:
  ------------------
  |  Branch (409:9): [True: 55, False: 4.80k]
  ------------------
  410|     55|          value += std::string(": ") + readStringTag(io_, descriptor_value_length);
  411|     55|          break;
  412|    252|        case 2 /*BOOL*/:
  ------------------
  |  Branch (412:9): [True: 252, False: 4.60k]
  ------------------
  413|    252|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  414|    252|          break;
  415|     22|        case 3 /*DWORD */:
  ------------------
  |  Branch (415:9): [True: 22, False: 4.83k]
  ------------------
  416|     22|          value += std::string(": ") + std::to_string(readDWORDTag(io_));
  417|     22|          break;
  418|    184|        case 4 /*QWORD */:
  ------------------
  |  Branch (418:9): [True: 184, False: 4.67k]
  ------------------
  419|    184|          value += std::string(": ") + std::to_string(readQWORDTag(io_));
  420|    184|          break;
  421|    165|        case 5 /*WORD*/:
  ------------------
  |  Branch (421:9): [True: 165, False: 4.69k]
  ------------------
  422|    165|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  423|    165|          break;
  424|  4.86k|      }
  425|  4.86k|    }
  426|  15.2k|    value += std::string(", ");
  427|  15.2k|  }
  428|       |
  429|    394|  xmpData()["Xmp.video.ExtendedContentDescription"] = value;
  430|    394|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  432|    369|void AsfVideo::contentDescription() {
  433|    369|  uint16_t title_length = readWORDTag(io_);
  434|    369|  uint16_t author_length = readWORDTag(io_);
  435|    369|  uint16_t copyright_length = readWORDTag(io_);
  436|    369|  uint16_t desc_length = readWORDTag(io_);
  437|    369|  uint16_t rating_length = readWORDTag(io_);
  438|       |
  439|    369|  if (title_length)
  ------------------
  |  Branch (439:7): [True: 318, False: 51]
  ------------------
  440|    318|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  441|       |
  442|    369|  if (author_length)
  ------------------
  |  Branch (442:7): [True: 109, False: 260]
  ------------------
  443|    109|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  444|       |
  445|    369|  if (copyright_length)
  ------------------
  |  Branch (445:7): [True: 69, False: 300]
  ------------------
  446|     69|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  447|       |
  448|    369|  if (desc_length)
  ------------------
  |  Branch (448:7): [True: 97, False: 272]
  ------------------
  449|     97|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  450|       |
  451|    369|  if (rating_length)
  ------------------
  |  Branch (451:7): [True: 38, False: 331]
  ------------------
  452|     38|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  453|       |
  454|    369|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo14filePropertiesEv:
  456|    433|void AsfVideo::fileProperties() {
  457|    433|  DataBuf FileIddBuf(GUID);
  458|    433|  io_->readOrThrow(FileIddBuf.data(), FileIddBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  459|    433|  xmpData()["Xmp.video.FileID"] = GUIDTag(FileIddBuf.data()).to_string();
  460|    433|  xmpData()["Xmp.video.FileLength"] = readQWORDTag(io_);
  461|    433|  xmpData()["Xmp.video.CreationDate"] = readQWORDTag(io_);
  462|    433|  xmpData()["Xmp.video.DataPackets"] = readQWORDTag(io_);
  463|    433|  xmpData()["Xmp.video.duration"] = readQWORDTag(io_);
  464|    433|  xmpData()["Xmp.video.SendDuration"] = readQWORDTag(io_);
  465|    433|  xmpData()["Xmp.video.Preroll"] = readQWORDTag(io_);
  466|       |
  467|    433|  io_->seek(io_->tell() + DWORD + DWORD + DWORD,
  468|    433|            BasicIo::beg);  // ignore Flags, Minimum Data Packet Size and Maximum Data Packet Size
  469|    433|  xmpData()["Xmp.video.MaxBitRate"] = readDWORDTag(io_);
  470|    433|}  // AsfVideo::fileProperties
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  472|    890|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, bool /*create*/) {
  473|    890|  auto image = std::make_unique<AsfVideo>(std::move(io));
  474|    890|  if (!image->good()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 890]
  ------------------
  475|      0|    return nullptr;
  476|      0|  }
  477|    890|  return image;
  478|    890|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  480|  7.95k|bool isAsfType(BasicIo& iIo, bool advance) {
  481|  7.95k|  byte buf[GUID];
  482|  7.95k|  iIo.read(buf, GUID);
  483|       |
  484|  7.95k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (484:7): [True: 0, False: 7.95k]
  |  Branch (484:22): [True: 271, False: 7.68k]
  ------------------
  485|    271|    return false;
  486|    271|  }
  487|       |
  488|  7.68k|  bool matched = isASFType(buf);
  489|  7.68k|  if (!advance || !matched) {
  ------------------
  |  Branch (489:7): [True: 7.68k, False: 0]
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|  7.68k|    iIo.seek(0, BasicIo::beg);
  491|  7.68k|  }
  492|       |
  493|  7.68k|  return matched;
  494|  7.95k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  7.68k|static bool isASFType(const byte buf[]) {
  179|  7.68k|  return Header == AsfVideo::GUIDTag(buf);
  180|  7.68k|}

_ZN5Exiv27BasicIoD2Ev:
   54|  54.3k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   56|  3.52M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   57|  3.52M|  const size_t nread = read(buf, rcount);
   58|  3.52M|  Internal::enforce(nread == rcount, err);
   59|  3.52M|  Internal::enforce(!error(), err);
   60|  3.52M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   62|  15.3k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   63|  15.3k|  const int r = seek(offset, pos);
   64|  15.3k|  Internal::enforce(r == 0, err);
   65|  15.3k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  618|  28.6k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  619|  28.6k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  672|  5.44M|void MemIo::Impl::reserve(size_t wcount) {
  673|  5.44M|  const size_t need = wcount + idx_;
  674|  5.44M|  size_t blockSize = 32 * 1024;  // 32768
  675|  5.44M|  const size_t maxBlockSize = 4 * 1024 * 1024;
  676|       |
  677|  5.44M|  if (!isMalloced_) {
  ------------------
  |  Branch (677:7): [True: 18.8k, False: 5.42M]
  ------------------
  678|       |    // Minimum size for 1st block
  679|  18.8k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  680|  18.8k|    auto data = static_cast<byte*>(std::malloc(size));
  681|  18.8k|    if (!data) {
  ------------------
  |  Branch (681:9): [True: 0, False: 18.8k]
  ------------------
  682|      0|      throw Error(ErrorCode::kerMallocFailed);
  683|      0|    }
  684|  18.8k|    if (data_) {
  ------------------
  |  Branch (684:9): [True: 0, False: 18.8k]
  ------------------
  685|      0|      std::memcpy(data, data_, size_);
  686|      0|    }
  687|  18.8k|    data_ = data;
  688|  18.8k|    sizeAlloced_ = size;
  689|  18.8k|    isMalloced_ = true;
  690|  18.8k|  }
  691|       |
  692|  5.44M|  if (need > size_) {
  ------------------
  |  Branch (692:7): [True: 4.12M, False: 1.31M]
  ------------------
  693|  4.12M|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (693:9): [True: 12.0k, False: 4.10M]
  ------------------
  694|  12.0k|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  695|       |      // Allocate in blocks
  696|  12.0k|      size_t want = blockSize * (1 + need / blockSize);
  697|  12.0k|      data_ = static_cast<byte*>(std::realloc(data_, want));
  698|  12.0k|      if (!data_) {
  ------------------
  |  Branch (698:11): [True: 0, False: 12.0k]
  ------------------
  699|      0|        throw Error(ErrorCode::kerMallocFailed);
  700|      0|      }
  701|  12.0k|      sizeAlloced_ = want;
  702|  12.0k|    }
  703|  4.12M|    size_ = need;
  704|  4.12M|  }
  705|  5.44M|}
_ZN5Exiv25MemIoC2Ev:
  707|  25.7k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  708|  25.7k|}
_ZN5Exiv25MemIoC2EPKhm:
  710|  28.6k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  711|  28.6k|}
_ZN5Exiv25MemIoD2Ev:
  713|  54.3k|MemIo::~MemIo() {
  714|  54.3k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (714:7): [True: 18.4k, False: 35.8k]
  ------------------
  715|  18.4k|    std::free(p_->data_);
  716|  18.4k|  }
  717|  54.3k|}
_ZN5Exiv25MemIo5writeEPKhm:
  719|  5.40M|size_t MemIo::write(const byte* data, size_t wcount) {
  720|  5.40M|  p_->reserve(wcount);
  721|  5.40M|  if (data) {
  ------------------
  |  Branch (721:7): [True: 4.08M, False: 1.31M]
  ------------------
  722|  4.08M|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  723|  4.08M|  }
  724|  5.40M|  p_->idx_ += wcount;
  725|  5.40M|  return wcount;
  726|  5.40M|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  728|  12.8k|void MemIo::transfer(BasicIo& src) {
  729|  12.8k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (729:12): [True: 12.8k, False: 0]
  ------------------
  730|       |    // Optimization if src is another instance of MemIo
  731|  12.8k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (731:9): [True: 311, False: 12.5k]
  ------------------
  732|    311|      std::free(p_->data_);
  733|    311|    }
  734|  12.8k|    p_->idx_ = 0;
  735|  12.8k|    p_->data_ = memIo->p_->data_;
  736|  12.8k|    p_->size_ = memIo->p_->size_;
  737|  12.8k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  738|  12.8k|    memIo->p_->idx_ = 0;
  739|  12.8k|    memIo->p_->data_ = nullptr;
  740|  12.8k|    memIo->p_->size_ = 0;
  741|  12.8k|    memIo->p_->isMalloced_ = false;
  742|  12.8k|  } else {
  743|       |    // Generic reopen to reset position to start
  744|      0|    if (src.open() != 0) {
  ------------------
  |  Branch (744:9): [True: 0, False: 0]
  ------------------
  745|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, src.path(), strError());
  746|      0|    }
  747|      0|    p_->idx_ = 0;
  748|      0|    write(src);
  749|      0|    src.close();
  750|      0|  }
  751|  12.8k|  if (error() || src.error())
  ------------------
  |  Branch (751:7): [True: 0, False: 12.8k]
  |  Branch (751:18): [True: 0, False: 12.8k]
  ------------------
  752|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  753|  12.8k|}
_ZN5Exiv25MemIo4putbEh:
  773|  38.9k|int MemIo::putb(byte data) {
  774|  38.9k|  p_->reserve(1);
  775|  38.9k|  p_->data_[p_->idx_++] = data;
  776|  38.9k|  return data;
  777|  38.9k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  779|   864k|int MemIo::seek(int64_t offset, Position pos) {
  780|   864k|  int64_t newIdx = 0;
  781|       |
  782|   864k|  switch (pos) {
  ------------------
  |  Branch (782:11): [True: 864k, False: 0]
  ------------------
  783|   594k|    case BasicIo::cur:
  ------------------
  |  Branch (783:5): [True: 594k, False: 269k]
  ------------------
  784|   594k|      newIdx = p_->idx_ + offset;
  785|   594k|      break;
  786|   269k|    case BasicIo::beg:
  ------------------
  |  Branch (786:5): [True: 269k, False: 595k]
  ------------------
  787|   269k|      newIdx = offset;
  788|   269k|      break;
  789|    134|    case BasicIo::end:
  ------------------
  |  Branch (789:5): [True: 134, False: 864k]
  ------------------
  790|    134|      newIdx = p_->size_ + offset;
  791|    134|      break;
  792|   864k|  }
  793|       |
  794|   864k|  if (newIdx < 0)
  ------------------
  |  Branch (794:7): [True: 0, False: 864k]
  ------------------
  795|      0|    return 1;
  796|       |
  797|   864k|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (797:7): [True: 5.05k, False: 859k]
  ------------------
  798|  5.05k|    p_->eof_ = true;
  799|  5.05k|    return 1;
  800|  5.05k|  }
  801|       |
  802|   859k|  p_->idx_ = static_cast<size_t>(newIdx);
  803|   859k|  p_->eof_ = false;
  804|   859k|  return 0;
  805|   864k|}
_ZN5Exiv25MemIo4mmapEb:
  807|  42.7k|byte* MemIo::mmap(bool /*isWriteable*/) {
  808|  42.7k|  return p_->data_;
  809|  42.7k|}
_ZNK5Exiv25MemIo4tellEv:
  815|   650k|size_t MemIo::tell() const {
  816|   650k|  return p_->idx_;
  817|   650k|}
_ZNK5Exiv25MemIo4sizeEv:
  819|   415k|size_t MemIo::size() const {
  820|   415k|  return p_->size_;
  821|   415k|}
_ZN5Exiv25MemIo4openEv:
  823|   108k|int MemIo::open() {
  824|   108k|  p_->idx_ = 0;
  825|   108k|  p_->eof_ = false;
  826|   108k|  return 0;
  827|   108k|}
_ZNK5Exiv25MemIo6isopenEv:
  829|  84.3k|bool MemIo::isopen() const {
  830|  84.3k|  return true;
  831|  84.3k|}
_ZN5Exiv25MemIo5closeEv:
  833|  82.7k|int MemIo::close() {
  834|  82.7k|  return 0;
  835|  82.7k|}
_ZN5Exiv25MemIo4readEm:
  837|   107k|DataBuf MemIo::read(size_t rcount) {
  838|   107k|  DataBuf buf(rcount);
  839|   107k|  size_t readCount = read(buf.data(), buf.size());
  840|   107k|  buf.resize(readCount);
  841|   107k|  return buf;
  842|   107k|}
_ZN5Exiv25MemIo4readEPhm:
  844|  4.56M|size_t MemIo::read(byte* buf, size_t rcount) {
  845|  4.56M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  846|  4.56M|  const auto allow = std::min<size_t>(rcount, avail);
  847|  4.56M|  if (allow > 0) {
  ------------------
  |  Branch (847:7): [True: 4.28M, False: 279k]
  ------------------
  848|  4.28M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  849|  4.28M|  }
  850|  4.56M|  p_->idx_ += allow;
  851|  4.56M|  if (rcount > avail) {
  ------------------
  |  Branch (851:7): [True: 12.7k, False: 4.55M]
  ------------------
  852|  12.7k|    p_->eof_ = true;
  853|  12.7k|  }
  854|  4.56M|  return allow;
  855|  4.56M|}
_ZN5Exiv25MemIo4getbEv:
  857|  9.77M|int MemIo::getb() {
  858|  9.77M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (858:7): [True: 783, False: 9.77M]
  ------------------
  859|    783|    p_->eof_ = true;
  860|    783|    return EOF;
  861|    783|  }
  862|  9.77M|  return p_->data_[p_->idx_++];
  863|  9.77M|}
_ZNK5Exiv25MemIo5errorEv:
  865|  5.50M|int MemIo::error() const {
  866|  5.50M|  return 0;
  867|  5.50M|}
_ZNK5Exiv25MemIo3eofEv:
  869|   863k|bool MemIo::eof() const {
  870|   863k|  return p_->eof_;
  871|   863k|}
_ZNK5Exiv25MemIo4pathEv:
  873|  9.70k|const std::string& MemIo::path() const noexcept {
  874|  9.70k|  static std::string _path{"MemIo"};
  875|  9.70k|  return _path;
  876|  9.70k|}
_ZN5Exiv25MemIo16populateFakeDataEv:
  878|    178|void MemIo::populateFakeData() {
  879|    178|}
_ZN5Exiv25MemIo4ImplC2Ev:
  598|  25.7k|  Impl() = default;                     //!< Default constructor

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

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

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   141k|  static constexpr auto tagList() {
   39|   141k|    return tagInfo_;
   40|   141k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  1.29k|  static constexpr auto tagListCs() {
   43|  1.29k|    return tagInfoCs_;
   44|  1.29k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  2.54k|  static constexpr auto tagListSi() {
   47|  2.54k|    return tagInfoSi_;
   48|  2.54k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  2.49k|  static constexpr auto tagListCf() {
   55|  2.49k|    return tagInfoCf_;
   56|  2.49k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|    628|  static constexpr auto tagListPi() {
   59|    628|    return tagInfoPi_;
   60|    628|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|  16.3k|  static constexpr auto tagListTi() {
   63|  16.3k|    return tagInfoTi_;
   64|  16.3k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|     82|  static constexpr auto tagListFi() {
   67|     82|    return tagInfoFi_;
   68|     82|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|     79|  static constexpr auto tagListPa() {
   51|     79|    return tagInfoPa_;
   52|     79|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    705|  static constexpr auto tagListPr() {
   71|    705|    return tagInfoPr_;
   72|    705|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|  2.01k|  static constexpr auto tagListVigCor2() {
  135|  2.01k|    return tagInfoVigCor2_;
  136|  2.01k|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    402|  static constexpr auto tagListLiOp() {
  139|    402|    return tagInfoLiOp_;
  140|    402|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    146|  static constexpr auto tagListAfMiAdj() {
  127|    146|    return tagInfoAfMiAdj_;
  128|    146|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|      6|  static constexpr auto tagListLe() {
  143|      6|    return tagInfoLe_;
  144|      6|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    674|  static constexpr auto tagListAm() {
  147|    674|    return tagInfoAm_;
  148|    674|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|     79|  static constexpr auto tagListFil() {
  155|     79|    return tagInfoFil_;
  156|     79|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    360|  static constexpr auto tagListMe() {
  151|    360|    return tagInfoMe_;
  152|    360|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    227|  static constexpr auto tagListHdr() {
  159|    227|    return tagInfoHdr_;
  160|    227|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|     75|  static constexpr auto tagListAfC() {
  163|     75|    return tagInfoAfC_;
  164|     75|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    329|  static constexpr auto tagListRawB() {
  167|    329|    return tagInfoRawB_;
  168|    329|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  3.28k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  3.28k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  3.24k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  3.24k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  3.17k|void Converter::cnvToXmp() {
  503|   395k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 395k, False: 3.17k]
  ------------------
  504|   395k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 326k, False: 68.8k]
  |  Branch (504:37): [True: 163k, False: 162k]
  |  Branch (504:52): [True: 68.8k, False: 162k]
  |  Branch (504:79): [True: 34.4k, False: 34.4k]
  ------------------
  505|   198k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   198k|    }
  507|   395k|  }
  508|  3.17k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.35k|void Converter::cnvFromXmp() {
  511|   422k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 422k, False: 3.35k]
  ------------------
  512|   422k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 348k, False: 73.7k]
  |  Branch (512:37): [True: 174k, False: 174k]
  |  Branch (512:52): [True: 73.7k, False: 174k]
  |  Branch (512:79): [True: 36.8k, False: 36.8k]
  ------------------
  513|   211k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   211k|    }
  515|   422k|  }
  516|  3.35k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  3.12k|void Converter::cnvNone(const char*, const char*) {
  519|  3.12k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  4.04k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  4.04k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  4.04k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 4.04k, False: 0]
  ------------------
  524|  4.04k|    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|    750|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    750|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    750|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 750, False: 0]
  ------------------
  534|    750|    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|    713|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|    713|  auto pos = xmpData_->findKey(XmpKey(to));
  545|    713|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 713]
  ------------------
  546|      0|    return true;
  547|    713|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 713]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|    713|  xmpData_->erase(pos);
  550|    713|  return true;
  551|    713|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   142k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   142k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   142k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 141k, False: 304]
  ------------------
  556|   141k|    return;
  557|    304|  std::string value = pos->toString();
  558|    304|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 304]
  ------------------
  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|    304|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 304]
  ------------------
  565|      0|    return;
  566|    304|  (*xmpData_)[to] = value;
  567|    304|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 304]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    304|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  1.56k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  1.56k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  1.56k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 1.56k, False: 0]
  ------------------
  574|  1.56k|    return;
  575|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|    return;
  577|      0|  const auto cv = dynamic_cast<const CommentValue*>(&pos->value());
  578|      0|  if (!cv) {
  ------------------
  |  Branch (578:7): [True: 0, False: 0]
  ------------------
  579|      0|#ifndef SUPPRESS_WARNINGS
  580|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  581|      0|#endif
  582|      0|    return;
  583|      0|  }
  584|       |  // Todo: Convert to UTF-8 if necessary
  585|      0|  try {
  586|      0|    (*xmpData_)[to] = cv->comment();
  587|      0|  } catch (const Error&) {
  588|      0|#ifndef SUPPRESS_WARNINGS
  589|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  590|      0|#endif
  591|      0|  }
  592|      0|  if (erase_)
  ------------------
  |  Branch (592:7): [True: 0, False: 0]
  ------------------
  593|      0|    exifData_->erase(pos);
  594|      0|}
_ZN5Exiv29Converter12cnvExifArrayEPKcS2_:
  596|  1.56k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  1.56k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  1.56k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 1.56k, False: 0]
  ------------------
  599|  1.56k|    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|  6.30k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  6.30k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  6.30k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 6.20k, False: 104]
  ------------------
  619|  6.20k|    return;
  620|    104|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 104]
  ------------------
  621|      0|    return;
  622|    104|  int year = 0;
  623|    104|  int month = 0;
  624|    104|  int day = 0;
  625|    104|  int hour = 0;
  626|    104|  int min = 0;
  627|    104|  int sec = 0;
  628|    104|  std::string subsec;
  629|       |
  630|    104|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 104, False: 0]
  ------------------
  631|    104|    std::string value = pos->toString();
  632|    104|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 104]
  ------------------
  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|    104|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 104]
  ------------------
  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|    104|  } 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|    104|  const char* subsecTag = nullptr;
  711|    104|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 11, False: 93]
  ------------------
  712|     11|    subsecTag = "Exif.Photo.SubSecTime";
  713|     93|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 17, False: 76]
  ------------------
  714|     17|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|     76|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 76, False: 0]
  ------------------
  716|     76|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|     76|  }
  718|       |
  719|    104|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 104, False: 0]
  ------------------
  720|    104|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    104|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 11, False: 93]
  ------------------
  722|     11|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 11, False: 0]
  ------------------
  723|     11|        std::string ss = subsec_pos->toString();
  724|     11|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 11, False: 0]
  ------------------
  725|     11|          bool ok = false;
  726|     11|          stringTo<long>(ss, ok);
  727|     11|          if (ok)
  ------------------
  |  Branch (727:15): [True: 11, False: 0]
  ------------------
  728|     11|            subsec = std::string(".") + ss;
  729|     11|        }
  730|     11|      }
  731|     11|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 11]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     11|    }
  734|    104|  }
  735|       |
  736|    104|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 104]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    104|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    104|#define stringFormat std::format
  ------------------
  740|    104|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 104]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    104|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  3.13k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  3.13k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  3.13k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 3.13k, False: 0]
  ------------------
  747|  3.13k|    return;
  748|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (748:7): [True: 0, False: 0]
  ------------------
  749|      0|    return;
  750|      0|  auto count = pos->count();
  751|      0|  std::string value;
  752|      0|  value.reserve(count);
  753|      0|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (753:22): [True: 0, False: 0]
  ------------------
  754|      0|    value.push_back(pos->toUint32(i));
  755|      0|  }
  756|      0|  (*xmpData_)[to] = value;
  757|      0|  if (erase_)
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|    exifData_->erase(pos);
  759|      0|}
_ZN5Exiv29Converter17cnvExifGPSVersionEPKcS2_:
  761|  1.56k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  1.56k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  1.56k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 1.56k, False: 0]
  ------------------
  764|  1.56k|    return;
  765|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (765:7): [True: 0, False: 0]
  ------------------
  766|      0|    return;
  767|      0|  std::string value;
  768|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (768:22): [True: 0, False: 0]
  ------------------
  769|      0|    if (i > 0)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|      value += '.';
  771|      0|    value += std::to_string(pos->toInt64(i));
  772|      0|  }
  773|      0|  (*xmpData_)[to] = value;
  774|      0|  if (erase_)
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  775|      0|    exifData_->erase(pos);
  776|      0|}
_ZN5Exiv29Converter12cnvExifFlashEPKcS2_:
  778|  1.56k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  1.56k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  1.56k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 1.56k, False: 0]
  |  Branch (780:7): [True: 1.56k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  1.56k|    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|  6.26k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  6.26k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  6.26k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 6.26k, False: 0]
  ------------------
  805|  6.26k|    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|   150k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   150k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   150k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 150k, False: 411]
  ------------------
  847|   150k|    return;
  848|    411|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 411]
  ------------------
  849|      0|    return;
  850|    411|  std::string value;
  851|    411|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 104, False: 307]
  ------------------
  852|    104|#ifndef SUPPRESS_WARNINGS
  853|    104|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    104|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 104]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    104|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    104|#endif
  855|    104|    return;
  856|    104|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    307|  ExifKey key(to);
  859|    307|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 304, False: 3]
  ------------------
  860|    304|    exifData_->add(ed);
  861|    304|  }
  862|    307|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 307]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    307|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.67k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.67k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.67k]
  ------------------
  868|      0|    return;
  869|  1.67k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.67k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.67k, False: 0]
  ------------------
  871|  1.67k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  1.67k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.67k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.67k]
  ------------------
  887|      0|    return;
  888|  1.67k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.67k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.67k, False: 0]
  ------------------
  890|  1.67k|    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|  6.70k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  6.70k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  6.70k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 6.43k, False: 273]
  ------------------
  912|  6.43k|    return;
  913|    273|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 273]
  ------------------
  914|      0|    return;
  915|    273|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    273|  std::string value = pos->toString();
  917|    273|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 273]
  ------------------
  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|    273|  XMP_DateTime datetime;
  924|    273|  try {
  925|    273|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    273|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 106, False: 167]
  ------------------
  927|    106|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    106|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    106|#define stringFormat std::format
  ------------------
  930|    106|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    106|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 11, False: 95]
  ------------------
  933|     11|        const char* subsecTag = nullptr;
  934|     11|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 2, False: 9]
  ------------------
  935|      2|          subsecTag = "Exif.Photo.SubSecTime";
  936|      9|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 2, False: 7]
  ------------------
  937|      2|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|      7|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 7, False: 0]
  ------------------
  939|      7|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|      7|        }
  941|     11|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 11, False: 0]
  ------------------
  942|     11|          prepareExifTarget(subsecTag, true);
  943|     11|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|     11|        }
  945|     11|      }
  946|    167|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    167|      URational rhour(datetime.hour, 1);
  950|    167|      URational rmin(datetime.minute, 1);
  951|    167|      URational rsec(datetime.second, 1);
  952|    167|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 167]
  ------------------
  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|    167|      std::ostringstream array;
  964|    167|      array << rhour << " " << rmin << " " << rsec;
  965|    167|      (*exifData_)[to] = array.str();
  966|       |
  967|    167|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    167|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    167|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    167|#define stringFormat std::format
  ------------------
  970|    167|    }
  971|    273|  }
  972|    273|#ifndef SUPPRESS_WARNINGS
  973|    273|  catch (const XMP_Error& e) {
  974|    169|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    169|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 169]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    169|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    169|    return;
  976|    169|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    104|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 104]
  ------------------
  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|    104|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  3.35k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.35k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.35k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.35k, False: 0]
  ------------------
  995|  3.35k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  1.67k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.67k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.67k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.67k, False: 0]
  ------------------
 1015|  1.67k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  1.67k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.67k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.67k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.67k, False: 0]
  ------------------
 1035|  1.67k|    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|  6.70k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  6.70k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  6.70k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 6.70k, False: 0]
  ------------------
 1105|  6.70k|    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|  31.2k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  31.2k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  31.2k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 30.9k, False: 305]
  ------------------
 1168|  30.9k|    return;
 1169|    305|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 305]
  ------------------
 1170|      0|    return;
 1171|  98.7k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 98.4k, False: 305]
  ------------------
 1172|  98.4k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 50.2k, False: 48.1k]
  ------------------
 1173|  50.2k|      std::string value = pos->toString();
 1174|  50.2k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 50.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|  50.2k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 50.2k, False: 0]
  ------------------
 1182|  50.2k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  50.2k|      (*xmpData_)[to] = value;
 1184|  50.2k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 50.2k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  50.2k|    }
 1189|  98.4k|    ++pos;
 1190|  98.4k|  }
 1191|    305|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  36.8k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  36.8k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  36.8k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 36.1k, False: 750]
  ------------------
 1196|  36.1k|    return;
 1197|    750|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 750]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    750|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 195, False: 555]
  |  Branch (1200:35): [True: 389, False: 166]
  ------------------
 1201|    584|    std::string value;
 1202|    584|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 119, False: 465]
  ------------------
 1203|    119|#ifndef SUPPRESS_WARNINGS
 1204|    119|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    119|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 119]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    119|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    119|#endif
 1206|    119|      return;
 1207|    119|    }
 1208|    465|    (*iptcData_)[to] = value;
 1209|    465|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    465|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 465]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    465|    return;
 1213|    584|  }
 1214|       |
 1215|    166|  size_t count = pos->count();
 1216|    166|  bool added = false;
 1217|  50.2k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 50.1k, False: 166]
  ------------------
 1218|  50.1k|    std::string value = pos->toString(i);
 1219|  50.1k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 50.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|  50.1k|    IptcKey key(to);
 1226|  50.1k|    Iptcdatum id(key);
 1227|  50.1k|    id.setValue(value);
 1228|  50.1k|    iptcData_->add(id);
 1229|  50.1k|    added = true;
 1230|  50.1k|  }
 1231|    166|  if (added)
  ------------------
  |  Branch (1231:7): [True: 154, False: 12]
  ------------------
 1232|    154|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    166|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 166]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    166|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  1.61k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1317|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1318|       |  /// effect
 1319|  1.61k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  1.61k|  converter.cnvToXmp();
 1321|  1.61k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.67k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.67k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.67k|  converter.cnvFromXmp();
 1333|  1.67k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  1.56k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  1.56k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 1.56k, False: 0]
  ------------------
 1349|  1.56k|    iptcCharset = iptcData.detectCharset();
 1350|  1.56k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 1.56k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  1.56k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  1.56k|  converter.cnvToXmp();
 1355|  1.56k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.67k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.67k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.67k|  converter.cnvFromXmp();
 1371|  1.67k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  60.9k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  60.9k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 50.2k, False: 10.7k]
  ------------------
 1382|  50.2k|    return true;  // nothing to do
 1383|  10.7k|#ifdef EXV_HAVE_ICONV
 1384|  10.7k|  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|  60.9k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  10.7k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  10.7k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 10.7k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  10.7k|  bool ret = true;
 1407|  10.7k|  auto cd = iconv_open(to.data(), from.data());
 1408|  10.7k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 10.7k]
  ------------------
 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|  10.7k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  10.7k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  10.7k|#endif
 1420|  10.7k|  size_t inbytesleft = str.length();
 1421|  15.0k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 11.2k, False: 3.80k]
  ------------------
 1422|  11.2k|    char outbuf[256];
 1423|  11.2k|    char* outptr = outbuf;
 1424|  11.2k|    size_t outbytesleft = sizeof(outbuf);
 1425|  11.2k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  11.2k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  11.2k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 8.20k, False: 3.05k]
  |  Branch (1427:53): [True: 6.91k, False: 1.28k]
  ------------------
 1428|  6.91k|#ifndef SUPPRESS_WARNINGS
 1429|  6.91k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  6.91k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.91k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.91k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  6.91k|#endif
 1431|  6.91k|      ret = false;
 1432|  6.91k|      break;
 1433|  6.91k|    }
 1434|  4.34k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  4.34k|  }
 1436|       |
 1437|  10.7k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 10.7k, False: 0]
  ------------------
 1438|  10.7k|    iconv_close(cd);
 1439|       |
 1440|  10.7k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 3.80k, False: 6.91k]
  ------------------
 1441|  3.80k|    str = std::move(outstr);
 1442|  10.7k|  return ret;
 1443|  10.7k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|    995|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|    995|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 357, False: 638]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    357|    value = pos->toString(0);
 1596|    357|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 328, False: 29]
  |  Branch (1596:31): [True: 105, False: 223]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    105|      value = pos->toString();
 1600|    105|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 105, False: 0]
  |  Branch (1600:32): [True: 105, False: 0]
  ------------------
 1601|    105|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    105|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 105, False: 0]
  ------------------
 1603|    105|          value = value.substr(first_space_pos + 1);
 1604|    105|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    105|      }
 1608|    105|    }
 1609|    638|  } else {
 1610|    638|    value = pos->toString();
 1611|    638|  }
 1612|    995|  return pos->value().ok();
 1613|    995|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  28.3k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  28.3k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  28.3k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  28.3k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 28.3k]
  |  Branch (18:17): [True: 0, False: 28.3k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  28.3k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 1.78k, False: 26.5k]
  |  Branch (22:26): [True: 1.74k, False: 40]
  ------------------
   23|  1.74k|    setByteOrder(littleEndian);
   24|  26.5k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 10.0k, False: 16.5k]
  |  Branch (24:33): [True: 9.99k, False: 26]
  ------------------
   25|  9.99k|    setByteOrder(bigEndian);
   26|  16.5k|  } else {
   27|  16.5k|    return false;
   28|  16.5k|  }
   29|  11.7k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 5.48k, False: 6.25k]
  ------------------
   30|  5.48k|    return false;
   31|  6.25k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  6.25k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 5.15k, False: 1.10k]
  ------------------
   33|  5.15k|    return false;
   34|  1.10k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  1.10k|  return true;
   37|  6.25k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|     93|DataBuf Cr2Header::write() const {
   40|     93|  DataBuf buf(16);
   41|     93|  switch (byteOrder()) {
   42|     71|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 71, False: 22]
  ------------------
   43|     71|      buf.write_uint8(0, 'I');
   44|     71|      break;
   45|     22|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 22, False: 71]
  ------------------
   46|     22|      buf.write_uint8(0, 'M');
   47|     22|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 93]
  ------------------
   49|      0|      break;
   50|     93|  }
   51|     93|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|     93|  buf.write_uint16(2, tag(), byteOrder());
   54|     93|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|     93|  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|     93|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|     93|  return buf;
   59|     93|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  81.0k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  81.0k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 331, False: 80.7k]
  |  Branch (63:33): [True: 336, False: 80.4k]
  ------------------
   64|    667|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  80.4k|  return isTiffImageTag(tag, group);
   67|  81.0k|}

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

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

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

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

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

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   259k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   259k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 223k, False: 36.0k]
  |  Branch (378:31): [True: 20.2k, False: 203k]
  ------------------
  379|  20.2k|    return -1;
  380|   239k|  const DataSet* dataSet = records_[recordId];
  381|   239k|  int idx;
  382|  6.34M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 6.11M, False: 231k]
  ------------------
  383|  6.11M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 7.13k, False: 6.10M]
  ------------------
  384|  7.13k|      return -1;
  385|  6.11M|  }
  386|   231k|  return idx;
  387|   239k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  84.7k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  84.7k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 82.6k, False: 2.18k]
  |  Branch (390:31): [True: 0, False: 82.6k]
  ------------------
  391|      0|    return -1;
  392|  84.7k|  const DataSet* dataSet = records_[recordId];
  393|  84.7k|  int idx;
  394|  2.53M|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 2.44M, False: 84.7k]
  ------------------
  395|  2.44M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 2.44M]
  ------------------
  396|      0|      return -1;
  397|  2.44M|  }
  398|  84.7k|  return idx;
  399|  84.7k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  75.5k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  75.5k|  int idx = dataSetIdx(number, recordId);
  403|  75.5k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 9.13k, False: 66.3k]
  ------------------
  404|  9.13k|    return unknownDataSet.type_;
  405|  66.3k|  return records_[recordId][idx].type_;
  406|  75.5k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|   109k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|   109k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 100k, False: 9.13k]
  ------------------
  410|   100k|    return records_[recordId][idx].name_;
  411|       |
  412|  9.13k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  9.13k|#define stringFormat std::format
  ------------------
  413|   109k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  74.5k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  74.5k|  int idx = dataSetIdx(number, recordId);
  438|  74.5k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 9.13k, False: 65.4k]
  ------------------
  439|  9.13k|    return unknownDataSet.repeatable_;
  440|  65.4k|  return records_[recordId][idx].repeatable_;
  441|  74.5k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  84.7k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  84.7k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 84.7k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  84.7k|    return records_[recordId][idx].number_;
  447|  84.7k|  }
  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|   109k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|   109k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 13.2k, False: 95.9k]
  |  Branch (454:31): [True: 89.2k, False: 6.75k]
  ------------------
  455|   102k|    return recordInfo_[recordId].name_;
  456|   102k|  }
  457|       |
  458|  6.75k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  6.75k|#define stringFormat std::format
  ------------------
  459|   109k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  84.7k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  84.7k|  uint16_t i;
  470|  86.9k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 86.9k, False: 0]
  ------------------
  471|  86.9k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 84.7k, False: 2.18k]
  ------------------
  472|  84.7k|      break;
  473|  86.9k|  }
  474|  84.7k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 84.7k]
  ------------------
  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|  84.7k|  return i;
  480|  84.7k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  84.7k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  84.7k|  decomposeKey();
  492|  84.7k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  24.4k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  24.4k|  makeKey();
  496|  24.4k|}
_ZNK5Exiv27IptcKey3keyEv:
  498|  98.4k|std::string IptcKey::key() const {
  499|  98.4k|  return key_;
  500|  98.4k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|  1.32M|uint16_t IptcKey::tag() const {
  523|  1.32M|  return tag_;
  524|  1.32M|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   381k|uint16_t IptcKey::record() const {
  531|   381k|  return record_;
  532|   381k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   369k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   369k|  return UniquePtr(clone_());
  536|   369k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   369k|IptcKey* IptcKey::clone_() const {
  539|   369k|  return new IptcKey(*this);
  540|   369k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  84.7k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  84.7k|  auto posDot1 = key_.find('.');
  545|  84.7k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  84.7k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 84.7k]
  |  Branch (547:39): [True: 0, False: 84.7k]
  ------------------
  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|  84.7k|  const std::string familyName = key_.substr(0, posDot1);
  553|  84.7k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 84.7k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  84.7k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  84.7k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  84.7k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  84.7k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  84.7k|  recordName = IptcDataSets::recordName(recId);
  565|  84.7k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  84.7k|  tag_ = dataSet;
  568|  84.7k|  record_ = recId;
  569|  84.7k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  84.7k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  24.4k|void IptcKey::makeKey() {
  573|  24.4k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  24.4k|         IptcDataSets::dataSetName(tag_, record_);
  575|  24.4k|}

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

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

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

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

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

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

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

_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  140|  28.0k|    io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) {
  141|  28.0k|}
_ZN5Exiv25ImageD2Ev:
  143|  28.0k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  181|    585|bool Image::isBigEndianPlatform() {
  182|    585|  return std::endian::native == std::endian::big;
  183|    585|}
_ZN5Exiv25Image8byteSwapEjb:
  205|  2.99k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  206|       |#ifdef __cpp_lib_byteswap
  207|       |  return bSwap ? std::byteswap(value) : value;
  208|       |#elif defined(_MSC_VER)
  209|       |  return bSwap ? _byteswap_ulong(value) : value;
  210|       |#else
  211|  2.99k|  uint32_t result = 0;
  212|  2.99k|  result |= (value & 0x000000FFU) << 24;
  213|  2.99k|  result |= (value & 0x0000FF00U) << 8;
  214|  2.99k|  result |= (value & 0x00FF0000U) >> 8;
  215|  2.99k|  result |= (value & 0xFF000000U) >> 24;
  216|  2.99k|  return bSwap ? result : value;
  ------------------
  |  Branch (216:10): [True: 0, False: 2.99k]
  ------------------
  217|  2.99k|#endif
  218|  2.99k|}
_ZN5Exiv25Image13clearMetadataEv:
  537|  24.0k|void Image::clearMetadata() {
  538|  24.0k|  clearExifData();
  539|  24.0k|  clearIptcData();
  540|  24.0k|  clearXmpPacket();
  541|  24.0k|  clearXmpData();
  542|  24.0k|  clearComment();
  543|  24.0k|  clearIccProfile();
  544|  24.0k|}
_ZN5Exiv25Image8exifDataEv:
  546|  8.86k|ExifData& Image::exifData() {
  547|  8.86k|  return exifData_;
  548|  8.86k|}
_ZN5Exiv25Image8iptcDataEv:
  550|  3.56k|IptcData& Image::iptcData() {
  551|  3.56k|  return iptcData_;
  552|  3.56k|}
_ZN5Exiv25Image7xmpDataEv:
  554|  16.3k|XmpData& Image::xmpData() {
  555|  16.3k|  return xmpData_;
  556|  16.3k|}
_ZN5Exiv25Image9xmpPacketEv:
  558|    307|std::string& Image::xmpPacket() {
  559|       |  // Serialize the current XMP
  560|    307|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (560:7): [True: 1, False: 306]
  |  Branch (560:28): [True: 1, False: 0]
  ------------------
  561|      1|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  562|      1|  }
  563|    307|  return xmpPacket_;
  564|    307|}
_ZN5Exiv25Image13clearExifDataEv:
  586|  24.0k|void Image::clearExifData() {
  587|  24.0k|  exifData_.clear();
  588|  24.0k|}
_ZN5Exiv25Image11setExifDataERKNS_8ExifDataE:
  590|    314|void Image::setExifData(const ExifData& exifData) {
  591|    314|  exifData_ = exifData;
  592|    314|}
_ZN5Exiv25Image13clearIptcDataEv:
  594|  24.1k|void Image::clearIptcData() {
  595|  24.1k|  iptcData_.clear();
  596|  24.1k|}
_ZN5Exiv25Image11setIptcDataERKNS_8IptcDataE:
  598|    314|void Image::setIptcData(const IptcData& iptcData) {
  599|    314|  iptcData_ = iptcData;
  600|    314|}
_ZN5Exiv25Image14clearXmpPacketEv:
  602|  24.0k|void Image::clearXmpPacket() {
  603|  24.0k|  xmpPacket_.clear();
  604|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  605|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  606|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  607|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  608|  24.0k|  xmpData_.setPacket(std::string());
  609|  24.0k|  writeXmpFromPacket(true);
  610|  24.0k|}
_ZN5Exiv25Image12clearXmpDataEv:
  619|  24.0k|void Image::clearXmpData() {
  620|  24.0k|  xmpData_.clear();
  621|  24.0k|  writeXmpFromPacket(false);
  622|  24.0k|}
_ZN5Exiv25Image10setXmpDataERKNS_7XmpDataE:
  624|    314|void Image::setXmpData(const XmpData& xmpData) {
  625|    314|  xmpData_ = xmpData;
  626|    314|  writeXmpFromPacket(false);
  627|    314|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  630|  48.3k|void Image::writeXmpFromPacket(bool flag) {
  631|  48.3k|  writeXmpFromPacket_ = flag;
  632|  48.3k|}
_ZN5Exiv25Image12clearCommentEv:
  638|  24.0k|void Image::clearComment() {
  639|  24.0k|  comment_.erase();
  640|  24.0k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  642|    127|void Image::setComment(const std::string& comment) {
  643|    127|  comment_ = comment;
  644|    127|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  646|    102|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  647|    102|  iccProfile_ = std::move(iccProfile);
  648|    102|  if (bTestValid) {
  ------------------
  |  Branch (648:7): [True: 102, False: 0]
  ------------------
  649|    102|    checkIccProfile();
  650|    102|  }
  651|    102|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  653|  2.30k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  654|  2.30k|  if (size == 0) {
  ------------------
  |  Branch (654:7): [True: 266, False: 2.03k]
  ------------------
  655|    266|    return;
  656|    266|  }
  657|  2.03k|  const size_t start = iccProfile_.size();
  658|  2.03k|  iccProfile_.resize(Safe::add(start, size));
  659|  2.03k|  memcpy(iccProfile_.data(start), bytes, size);
  660|  2.03k|  if (bTestValid) {
  ------------------
  |  Branch (660:7): [True: 37, False: 1.99k]
  ------------------
  661|     37|    checkIccProfile();
  662|     37|  }
  663|  2.03k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  665|    139|void Image::checkIccProfile() const {
  666|    139|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (666:7): [True: 4, False: 135]
  ------------------
  667|      4|    throw Error(ErrorCode::kerInvalidIccProfile);
  668|      4|  }
  669|    135|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  670|    135|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (670:7): [True: 46, False: 89]
  ------------------
  671|     46|    throw Error(ErrorCode::kerInvalidIccProfile);
  672|     46|  }
  673|    135|}
_ZN5Exiv25Image15clearIccProfileEv:
  675|  24.0k|void Image::clearIccProfile() {
  676|  24.0k|  iccProfile_.reset();
  677|  24.0k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  679|  15.0k|void Image::setByteOrder(ByteOrder byteOrder) {
  680|  15.0k|  byteOrder_ = byteOrder;
  681|  15.0k|}
_ZNK5Exiv25Image9byteOrderEv:
  683|  4.20k|ByteOrder Image::byteOrder() const {
  684|  4.20k|  return byteOrder_;
  685|  4.20k|}
_ZNK5Exiv25Image10pixelWidthEv:
  687|  1.21k|uint32_t Image::pixelWidth() const {
  688|  1.21k|  return pixelWidth_;
  689|  1.21k|}
_ZNK5Exiv25Image11pixelHeightEv:
  691|  1.21k|uint32_t Image::pixelHeight() const {
  692|  1.21k|  return pixelHeight_;
  693|  1.21k|}
_ZNK5Exiv25Image8exifDataEv:
  695|   191k|const ExifData& Image::exifData() const {
  696|   191k|  return exifData_;
  697|   191k|}
_ZNK5Exiv25Image7xmpDataEv:
  703|  4.60k|const XmpData& Image::xmpData() const {
  704|  4.60k|  return xmpData_;
  705|  4.60k|}
_ZNK5Exiv25Image7commentEv:
  707|    783|std::string Image::comment() const {
  708|    783|  return comment_;
  709|    783|}
_ZNK5Exiv25Image2ioEv:
  715|  25.2k|BasicIo& Image::io() const {
  716|  25.2k|  return *io_;
  717|  25.2k|}
_ZNK5Exiv25Image18writeXmpFromPacketEv:
  719|  12.8k|bool Image::writeXmpFromPacket() const {
  720|  12.8k|  return writeXmpFromPacket_;
  721|  12.8k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  723|  18.6k|const NativePreviewList& Image::nativePreviews() const {
  724|  18.6k|  return nativePreviews_;
  725|  18.6k|}
_ZNK5Exiv25Image4goodEv:
  727|  27.9k|bool Image::good() const {
  728|  27.9k|  if (io_->open() != 0)
  ------------------
  |  Branch (728:7): [True: 0, False: 27.9k]
  ------------------
  729|      0|    return false;
  730|  27.9k|  IoCloser closer(*io_);
  731|  27.9k|  return ImageFactory::checkType(imageType_, *io_, false);
  732|  27.9k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  782|  27.9k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  783|  27.9k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (783:12): [True: 27.9k, False: 0]
  ------------------
  784|  27.9k|    return r->isThisType_(io, advance);
  785|      0|  return false;
  786|  27.9k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  868|  28.5k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  869|  28.5k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  870|  28.5k|  if (!image)
  ------------------
  |  Branch (870:7): [True: 804, False: 27.7k]
  ------------------
  871|    804|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  872|  27.7k|  return image;
  873|  28.5k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  875|  28.5k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  876|  28.5k|  if (io->open() != 0) {
  ------------------
  |  Branch (876:7): [True: 0, False: 28.5k]
  ------------------
  877|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  878|      0|  }
  879|   490k|  for (const auto& r : registry) {
  ------------------
  |  Branch (879:22): [True: 490k, False: 948]
  ------------------
  880|   490k|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (880:9): [True: 27.6k, False: 462k]
  ------------------
  881|  27.6k|      return r.newInstance_(std::move(io), false);
  882|  27.6k|    }
  883|   490k|  }
  884|    948|  return nullptr;
  885|  28.5k|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeE:
  904|    314|Image::UniquePtr ImageFactory::create(ImageType type) {
  905|    314|  auto image = create(type, std::make_unique<MemIo>());
  906|    314|  if (!image)
  ------------------
  |  Branch (906:7): [True: 0, False: 314]
  ------------------
  907|      0|    throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
  908|    314|  return image;
  909|    314|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  911|    314|Image::UniquePtr ImageFactory::create(ImageType type, BasicIo::UniquePtr io) {
  912|       |  // BasicIo instance does not need to be open
  913|    314|  if (type == ImageType::none)
  ------------------
  |  Branch (913:7): [True: 0, False: 314]
  ------------------
  914|      0|    return {};
  915|    314|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (915:12): [True: 314, False: 0]
  ------------------
  916|    314|    return r->newInstance_(std::move(io), true);
  917|      0|  return {};
  918|    314|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  923|   122k|void append(Blob& blob, const byte* buf, size_t len) {
  924|   122k|  if (len != 0) {
  ------------------
  |  Branch (924:7): [True: 102k, False: 19.5k]
  ------------------
  925|   102k|    Blob::size_type size = blob.size();
  926|   102k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (926:9): [True: 4.25k, False: 98.2k]
  ------------------
  927|  4.25k|      blob.reserve(size + 65536);
  928|  4.25k|    }
  929|   102k|    blob.resize(size + len);
  930|   102k|    std::copy_n(buf, len, blob.begin() + size);
  931|   102k|  }
  932|   122k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   474k|  bool operator==(const ImageType& imageType) const {
   67|   474k|    return imageType == imageType_;
   68|   474k|  }

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  75.5k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  75.5k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 24.4k, False: 51.0k]
  ------------------
   58|  24.4k|    value_ = pValue->clone();
   59|  75.5k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   236k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   236k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 236k, False: 0]
  ------------------
   63|   236k|    key_ = rhs.key_->clone();  // deep copy
   64|   236k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 236k, False: 0]
  ------------------
   65|   236k|    value_ = rhs.value_->clone();  // deep copy
   66|   236k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   311k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|  98.4k|std::string Iptcdatum::key() const {
   79|  98.4k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 98.4k, False: 0]
  ------------------
   80|  98.4k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   346k|uint16_t Iptcdatum::record() const {
   87|   346k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 346k, False: 0]
  ------------------
   88|   346k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|  1.28M|uint16_t Iptcdatum::tag() const {
  111|  1.28M|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 1.28M, False: 0]
  ------------------
  112|  1.28M|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|  39.8k|size_t Iptcdatum::size() const {
  131|  39.8k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 39.8k, False: 0]
  ------------------
  132|  39.8k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  50.6k|std::string Iptcdatum::toString() const {
  135|  50.6k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 50.6k, False: 0]
  ------------------
  136|  50.6k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  70.5k|const Value& Iptcdatum::value() const {
  159|  70.5k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 70.5k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  70.5k|  return *value_;
  162|  70.5k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|  57.4k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|  57.4k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 57.4k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|  57.4k|  key_.reset();
  169|  57.4k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 57.4k, False: 0]
  ------------------
  170|  57.4k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|  57.4k|  value_.reset();
  173|  57.4k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 57.4k, False: 0]
  ------------------
  174|  57.4k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|  57.4k|  return *this;
  177|  57.4k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.08k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.08k|  setValue(value);
  188|  1.08k|  return *this;
  189|  1.08k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  51.1k|int Iptcdatum::setValue(const std::string& value) {
  203|  51.1k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 51.0k, False: 136]
  ------------------
  204|  51.0k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  51.0k|    value_ = Value::create(type);
  206|  51.0k|  }
  207|  51.1k|  return value_->read(value);
  208|  51.1k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.08k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.08k|  IptcKey iptcKey(key);
  212|  1.08k|  auto pos = findKey(iptcKey);
  213|  1.08k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 948, False: 136]
  ------------------
  214|    948|    return iptcMetadata_.emplace_back(iptcKey);
  215|    948|  }
  216|    136|  return *pos;
  217|  1.08k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|    934|size_t IptcData::size() const {
  220|    934|  size_t newSize = 0;
  221|  19.9k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 19.9k, False: 934]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  19.9k|    newSize += 5;
  224|  19.9k|    size_t dataSize = iptc.size();
  225|  19.9k|    newSize += dataSize;
  226|  19.9k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 19.9k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  19.9k|  }
  231|    934|  return newSize;
  232|    934|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  24.4k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  24.4k|  return add(Iptcdatum(key, value));
  236|  24.4k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  74.5k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  74.5k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 15.3k, False: 59.2k]
  |  Branch (239:7): [True: 10.6k, False: 63.9k]
  ------------------
  240|  15.3k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 10.6k, False: 4.63k]
  ------------------
  241|  10.6k|    return 6;
  242|  10.6k|  }
  243|       |  // allow duplicates
  244|  63.9k|  iptcMetadata_.push_back(iptcDatum);
  245|  63.9k|  return 0;
  246|  74.5k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  1.56k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  1.56k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  1.56k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  33.1k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  33.1k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  33.1k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  15.3k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  15.3k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  15.3k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  1.56k|const char* IptcData::detectCharset() const {
  305|  1.56k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  1.56k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 436, False: 1.12k]
  ------------------
  307|    436|    const std::string value = pos->toString();
  308|    436|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 436, False: 0]
  |  Branch (308:30): [True: 436, False: 0]
  ------------------
  309|    436|      return "UTF-8";
  310|    436|  }
  311|       |
  312|  1.12k|  bool ascii = true;
  313|  1.12k|  bool utf8 = true;
  314|       |
  315|  1.12k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 1.12k]
  ------------------
  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.12k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 1.12k, False: 0]
  ------------------
  356|  1.12k|    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.59k|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.59k|  auto pRead = pData;
  367|  2.59k|  const auto pEnd = pData + size;
  368|  2.59k|  iptcData.clear();
  369|       |
  370|  2.59k|  uint16_t record = 0;
  371|  2.59k|  uint16_t dataSet = 0;
  372|  2.59k|  uint32_t sizeData = 0;
  373|  2.59k|  byte extTest = 0;
  374|       |
  375|   767k|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 765k, False: 1.80k]
  ------------------
  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|   765k|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 740k, False: 25.2k]
  ------------------
  380|   740k|      continue;
  381|  25.2k|    record = *pRead++;
  382|  25.2k|    dataSet = *pRead++;
  383|       |
  384|  25.2k|    extTest = *pRead;
  385|  25.2k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 777, False: 24.4k]
  ------------------
  386|       |      // extended dataset
  387|    777|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|    777|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 228, False: 549]
  ------------------
  389|    228|        return 5;
  390|    549|      pRead += 2;
  391|    549|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 6, False: 543]
  ------------------
  392|      6|        return 6;
  393|    543|      sizeData = 0;
  394|  1.36k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 817, False: 543]
  ------------------
  395|    817|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|    817|      }
  397|  24.4k|    } else {
  398|       |      // standard dataset
  399|  24.4k|      sizeData = getUShort(pRead, bigEndian);
  400|  24.4k|      pRead += 2;
  401|  24.4k|    }
  402|  25.0k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 24.4k, False: 554]
  ------------------
  403|  24.4k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  24.4k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 24.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|  24.4k|    } else {
  410|    554|#ifndef SUPPRESS_WARNINGS
  411|    554|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    554|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 554]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    554|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    554|#endif
  413|    554|      return 7;
  414|    554|    }
  415|  24.4k|    pRead += sizeData;
  416|  24.4k|  }
  417|       |
  418|  1.80k|  return 0;
  419|  2.59k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  14.8k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  14.8k|  DataBuf buf;
  423|  14.8k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 13.9k, False: 934]
  ------------------
  424|  13.9k|    return buf;
  425|       |
  426|    934|  buf = DataBuf(iptcData.size());
  427|    934|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|    934|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|    934|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|    934|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  19.9k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 19.9k, False: 934]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  19.9k|    *pWrite++ = marker_;
  437|  19.9k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  19.9k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  19.9k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 19.9k]
  ------------------
  442|       |      // always use 4 bytes for extended length
  443|      0|      uint16_t sizeOfSize = 4 | 0x8000;
  444|      0|      us2Data(pWrite, sizeOfSize, bigEndian);
  445|      0|      pWrite += 2;
  446|      0|      ul2Data(pWrite, static_cast<uint32_t>(dataSize), bigEndian);
  447|      0|      pWrite += 4;
  448|  19.9k|    } else {
  449|  19.9k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  19.9k|      pWrite += 2;
  451|  19.9k|    }
  452|  19.9k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  19.9k|  }
  454|       |
  455|    934|  return buf;
  456|  14.8k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|  1.12M|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|  1.12M|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 14.7k, False: 1.11M]
  |  Branch (42:43): [True: 11.5k, False: 3.18k]
  ------------------
   43|  1.12M|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  49.9k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  49.9k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  24.4k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  24.4k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  24.4k|  auto value = Exiv2::Value::create(type);
  466|  24.4k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  24.4k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 15.2k, False: 9.18k]
  ------------------
  468|  15.2k|    Exiv2::IptcKey key(dataSet, record);
  469|  15.2k|    iptcData.add(key, value.get());
  470|  15.2k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 9.18k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  9.18k|    value = Exiv2::Value::create(Exiv2::string);
  473|  9.18k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  9.18k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 9.18k, False: 0]
  ------------------
  475|  9.18k|      Exiv2::IptcKey key(dataSet, record);
  476|  9.18k|      iptcData.add(key, value.get());
  477|  9.18k|    }
  478|  9.18k|  }
  479|  24.4k|  return rc;
  480|  24.4k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|  85.4k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    107|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|    107|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 12, False: 95]
  |  Branch (15:29): [True: 20, False: 75]
  ------------------
   16|     32|    return false;
   17|     32|  }
   18|       |
   19|     75|  const size_t N = (boxData.size() - 8u) / 4u;
   20|     75|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|     75|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|     75|  bool clWithRightBrand = false;
   24|  1.25k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.18k, False: 67]
  ------------------
   25|  1.18k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.18k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 748, False: 436]
  |  Branch (26:31): [True: 5, False: 743]
  |  Branch (26:66): [True: 302, False: 877]
  |  Branch (26:87): [True: 3, False: 299]
  ------------------
   27|      8|      clWithRightBrand = true;
   28|      8|      break;
   29|      8|    }
   30|  1.18k|  }
   31|     75|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 14, False: 61]
  |  Branch (31:32): [True: 2, False: 12]
  ------------------
   32|    107|}

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

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  599|  2.05k|MatroskaVideo::MatroskaVideo(BasicIo::UniquePtr io) : Image(ImageType::mkv, mdNone, std::move(io)) {
  600|  2.05k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  602|  2.05k|std::string MatroskaVideo::mimeType() const {
  603|  2.05k|  return "video/matroska";
  604|  2.05k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  606|  1.13k|void MatroskaVideo::writeMetadata() {
  607|  1.13k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  609|  2.05k|void MatroskaVideo::readMetadata() {
  610|  2.05k|  if (io_->open() != 0)
  ------------------
  |  Branch (610:7): [True: 0, False: 2.05k]
  ------------------
  611|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  612|       |
  613|       |  // Ensure that this is the correct image type
  614|  2.05k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 2.05k]
  ------------------
  615|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (615:9): [True: 0, False: 0]
  |  Branch (615:25): [True: 0, False: 0]
  ------------------
  616|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  617|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  618|      0|  }
  619|       |
  620|  2.05k|  IoCloser closer(*io_);
  621|  2.05k|  clearMetadata();
  622|  2.05k|  continueTraversing_ = true;
  623|  2.05k|  height_ = width_ = 1;
  624|       |
  625|  2.05k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  626|  2.05k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  627|       |
  628|   129k|  while (continueTraversing_)
  ------------------
  |  Branch (628:10): [True: 127k, False: 2.05k]
  ------------------
  629|   127k|    decodeBlock();
  630|       |
  631|  2.05k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  632|  2.05k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  634|   127k|void MatroskaVideo::decodeBlock() {
  635|   127k|  byte buf[8];
  636|   127k|  io_->read(buf, 1);
  637|       |
  638|   127k|  if (io_->eof()) {
  ------------------
  |  Branch (638:7): [True: 230, False: 127k]
  ------------------
  639|    230|    continueTraversing_ = false;
  640|    230|    return;
  641|    230|  }
  642|       |
  643|   127k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  644|   127k|  if (block_size > 0)
  ------------------
  |  Branch (644:7): [True: 127k, False: 267]
  ------------------
  645|   127k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  646|       |
  647|   127k|  auto tag_id = returnTagValue(buf, block_size);
  648|   127k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  649|       |
  650|   127k|  if (!tag) {
  ------------------
  |  Branch (650:7): [True: 1.06k, False: 126k]
  ------------------
  651|  1.06k|    continueTraversing_ = false;
  652|  1.06k|    return;
  653|  1.06k|  }
  654|       |
  655|       |  // tag->dump(std::cout);
  656|       |
  657|   126k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (657:7): [True: 316, False: 126k]
  |  Branch (657:27): [True: 1, False: 126k]
  ------------------
  658|      2|    continueTraversing_ = false;
  659|      2|    return;
  660|      2|  }
  661|       |
  662|   126k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  663|   126k|  block_size = findBlockSize(buf[0]);  // 0-8
  664|       |
  665|   126k|  if (block_size > 0)
  ------------------
  |  Branch (665:7): [True: 126k, False: 391]
  ------------------
  666|   126k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  667|   126k|  size_t size = returnTagValue(buf, block_size);
  668|       |
  669|   126k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (669:7): [True: 78.4k, False: 48.0k]
  |  Branch (669:29): [True: 78.4k, False: 0]
  ------------------
  670|  78.4k|    return;
  671|       |
  672|  48.0k|  const size_t bufMaxSize = 200;
  673|       |
  674|  48.0k|#ifndef SUPPRESS_WARNINGS
  675|  48.0k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (675:7): [True: 46.7k, False: 1.28k]
  |  Branch (675:28): [True: 93, False: 46.6k]
  ------------------
  676|     93|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|     93|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 93]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     93|  LogMsg(LogMsg::warn).os()
  ------------------
  677|      0|                << bufMaxSize << ": ignoring it.\n";
  678|     93|  }
  679|  48.0k|#endif
  680|  48.0k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (680:7): [True: 1.28k, False: 46.7k]
  |  Branch (680:27): [True: 93, False: 46.6k]
  ------------------
  681|    979|    io_->seek(size, BasicIo::cur);
  682|    979|    return;
  683|    979|  }
  684|       |
  685|  47.0k|  DataBuf buf2(bufMaxSize + 1);
  686|  47.0k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  687|  47.0k|  switch (tag->_type) {
  688|  7.07k|    case InternalField:
  ------------------
  |  Branch (688:5): [True: 7.07k, False: 39.9k]
  ------------------
  689|  7.07k|      decodeInternalTags(tag, buf2.data());
  690|  7.07k|      break;
  691|  5.39k|    case String:
  ------------------
  |  Branch (691:5): [True: 5.39k, False: 41.6k]
  ------------------
  692|  5.39k|    case Utf8:
  ------------------
  |  Branch (692:5): [True: 0, False: 47.0k]
  ------------------
  693|  5.39k|      decodeStringTags(tag, buf2.data());
  694|  5.39k|      break;
  695|  14.5k|    case Integer:
  ------------------
  |  Branch (695:5): [True: 14.5k, False: 32.4k]
  ------------------
  696|  18.5k|    case UInteger:
  ------------------
  |  Branch (696:5): [True: 3.90k, False: 43.1k]
  ------------------
  697|  18.5k|      decodeIntegerTags(tag, buf2.data());
  698|  18.5k|      break;
  699|  12.0k|    case Boolean:
  ------------------
  |  Branch (699:5): [True: 12.0k, False: 34.9k]
  ------------------
  700|  12.0k|      decodeBooleanTags(tag, buf2.data());
  701|  12.0k|      break;
  702|  1.14k|    case Date:
  ------------------
  |  Branch (702:5): [True: 1.14k, False: 45.8k]
  ------------------
  703|  1.14k|      decodeDateTags(tag, buf2.data(), size);
  704|  1.14k|      break;
  705|  2.31k|    case Float:
  ------------------
  |  Branch (705:5): [True: 2.31k, False: 44.7k]
  ------------------
  706|  2.31k|      decodeFloatTags(tag, buf2.data());
  707|  2.31k|      break;
  708|      0|    case Binary:
  ------------------
  |  Branch (708:5): [True: 0, False: 47.0k]
  ------------------
  709|      0|      break;
  710|      0|    case Master:
  ------------------
  |  Branch (710:5): [True: 0, False: 47.0k]
  ------------------
  711|      0|      break;
  712|      0|    default:
  ------------------
  |  Branch (712:5): [True: 0, False: 47.0k]
  ------------------
  713|      0|      break;
  714|  47.0k|  }
  715|  47.0k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  717|  7.07k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  718|  7.07k|  uint64_t key = getULongLong(buf, bigEndian);
  719|  7.07k|  if (!key)
  ------------------
  |  Branch (719:7): [True: 71, False: 6.99k]
  ------------------
  720|     71|    return;
  721|       |
  722|  6.99k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  6.99k|    switch (tag->_id) {
  724|  6.99k|      case Xmp_video_VideoScanTpye:
  725|  6.99k|        return Exiv2::find(videoScanType, key);
  726|  6.99k|      case Xmp_audio_ChannelType:
  727|  6.99k|        return Exiv2::find(audioChannels, key);
  728|  6.99k|      case Xmp_video_ContentCompressAlgo:
  729|  6.99k|        return Exiv2::find(compressionAlgorithm, key);
  730|  6.99k|      case Xmp_video_ContentEncryptAlgo:
  731|  6.99k|        return Exiv2::find(encryptionAlgorithm, key);
  732|  6.99k|      case Xmp_video_ContentSignAlgo_1:
  733|  6.99k|      case Xmp_video_ContentSignAlgo_2:
  734|  6.99k|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|  6.99k|      case Xmp_video_ContentSignHashAlgo_1:
  736|  6.99k|      case Xmp_video_ContentSignHashAlgo_2:
  737|  6.99k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|  6.99k|      case Xmp_video_ContentEncodingType:
  739|  6.99k|        return Exiv2::find(encodingType, key);
  740|  6.99k|      case Xmp_video_DisplayUnit:
  741|  6.99k|        return Exiv2::find(displayUnit, key);
  742|  6.99k|      case Xmp_video_AspectRatioType:
  743|  6.99k|        return Exiv2::find(aspectRatioType, key);
  744|  6.99k|      case Xmp_video_PhysicalEquivalent:
  745|  6.99k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|  6.99k|      case Xmp_video_TranslateCodec:
  747|  6.99k|        return Exiv2::find(chapterTranslateCodec, key);
  748|  6.99k|      case Video_Audio_CodecID:
  749|  6.99k|        return Exiv2::find(trackCodec, key);
  750|  6.99k|      case Video_Audio_CodecName:
  751|  6.99k|        return Exiv2::find(codecInfo, key);
  752|  6.99k|      case CodecDownloadURL:
  753|  6.99k|      case CodecInfoURL:
  754|  6.99k|        return Exiv2::find(codecDownloadUrl, key);
  755|  6.99k|    }
  756|  6.99k|    return nullptr;
  757|  6.99k|  }();
  758|  6.99k|  if (internalMt) {
  ------------------
  |  Branch (758:7): [True: 2.56k, False: 4.43k]
  ------------------
  759|  2.56k|    xmpData_[tag->_label] = internalMt->_label;
  760|  4.43k|  } else {
  761|  4.43k|    xmpData_[tag->_label] = key;
  762|  4.43k|  }
  763|  6.99k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  765|  5.39k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  766|  5.39k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (766:7): [True: 1.23k, False: 4.16k]
  ------------------
  767|  1.23k|    track_count_++;
  768|  1.23k|    xmpData_[tag->_label] = track_count_;
  769|  4.16k|  } else {
  770|  4.16k|    xmpData_[tag->_label] = buf;
  771|  4.16k|  }
  772|  5.39k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  774|  18.5k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  775|  18.5k|  uint64_t value = getULongLong(buf, bigEndian);
  776|  18.5k|  if (!value)
  ------------------
  |  Branch (776:7): [True: 16.6k, False: 1.85k]
  ------------------
  777|  16.6k|    return;
  778|       |
  779|  1.85k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (779:7): [True: 1.01k, False: 840]
  |  Branch (779:40): [True: 286, False: 554]
  ------------------
  780|  1.30k|    width_ = value;
  781|  1.85k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (781:7): [True: 142, False: 1.71k]
  |  Branch (781:41): [True: 231, False: 1.48k]
  ------------------
  782|    373|    height_ = value;
  783|  1.85k|  xmpData_[tag->_label] = value;
  784|  1.85k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  786|  12.0k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  787|  12.0k|  const MatroskaTag* internalMt = nullptr;
  788|  12.0k|  uint64_t key = getULongLong(buf, bigEndian);
  789|  12.0k|  if (!key)
  ------------------
  |  Branch (789:7): [True: 4.36k, False: 7.71k]
  ------------------
  790|  4.36k|    return;
  791|       |
  792|  7.71k|  switch (tag->_id) {
  793|  5.27k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (793:5): [True: 5.27k, False: 2.43k]
  ------------------
  794|  5.27k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (794:16): [True: 276, False: 5.00k]
  ------------------
  795|    276|        stream_ = f->_id;
  796|    276|      }
  797|  5.27k|      break;
  798|    164|    case TrackUsed:
  ------------------
  |  Branch (798:5): [True: 164, False: 7.54k]
  ------------------
  799|    164|      internalMt = Exiv2::find(trackEnable, key);
  800|    164|      break;
  801|    515|    case TrackDefault:
  ------------------
  |  Branch (801:5): [True: 515, False: 7.19k]
  ------------------
  802|    515|      internalMt = Exiv2::find(defaultOn, key);
  803|    515|      break;
  804|    587|    case TrackForced:
  ------------------
  |  Branch (804:5): [True: 587, False: 7.12k]
  ------------------
  805|    587|      internalMt = Exiv2::find(trackForced, key);
  806|    587|      break;
  807|    227|    case TrackLacing:
  ------------------
  |  Branch (807:5): [True: 227, False: 7.48k]
  ------------------
  808|    227|      internalMt = Exiv2::find(trackLacing, key);
  809|    227|      break;
  810|    391|    case CodecDecodeAll:
  ------------------
  |  Branch (810:5): [True: 391, False: 7.32k]
  ------------------
  811|    391|      internalMt = Exiv2::find(codecDecodeAll, key);
  812|    391|      break;
  813|    397|    case CodecSettings:
  ------------------
  |  Branch (813:5): [True: 397, False: 7.31k]
  ------------------
  814|    397|      internalMt = Exiv2::find(codecSettings, key);
  815|    397|      break;
  816|    151|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (816:5): [True: 151, False: 7.56k]
  ------------------
  817|    151|      internalMt = tag;
  818|    151|      break;
  819|      0|    default:
  ------------------
  |  Branch (819:5): [True: 0, False: 7.71k]
  ------------------
  820|      0|      break;
  821|  7.71k|  }
  822|       |
  823|  7.71k|  if (internalMt) {
  ------------------
  |  Branch (823:7): [True: 1.19k, False: 6.51k]
  ------------------
  824|  1.19k|    xmpData_[internalMt->_label] = "Yes";
  825|  1.19k|  }
  826|  7.71k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  828|  1.14k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  829|  1.14k|  int64_t duration_in_ms = 0;
  830|  1.14k|  uint64_t value;
  831|  1.14k|  switch (tag->_id) {
  832|    445|    case Xmp_video_Duration:
  ------------------
  |  Branch (832:5): [True: 445, False: 696]
  ------------------
  833|    445|      if (size <= 4) {
  ------------------
  |  Branch (833:11): [True: 296, False: 149]
  ------------------
  834|    296|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  835|    296|      } else {
  836|    149|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  837|    149|      }
  838|    445|      xmpData_[tag->_label] = duration_in_ms;
  839|    445|      break;
  840|    206|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (840:5): [True: 206, False: 935]
  ------------------
  841|    206|      value = getULongLong(buf, bigEndian);
  842|    206|      if (!value)
  ------------------
  |  Branch (842:11): [True: 183, False: 23]
  ------------------
  843|    183|        return;
  844|     23|      duration_in_ms = value / 1000000000;
  845|     23|      xmpData_[tag->_label] = duration_in_ms;
  846|     23|      break;
  847|       |
  848|    490|    case TimecodeScale:
  ------------------
  |  Branch (848:5): [True: 490, False: 651]
  ------------------
  849|    490|      value = getULongLong(buf, bigEndian);
  850|    490|      if (!value)
  ------------------
  |  Branch (850:11): [True: 363, False: 127]
  ------------------
  851|    363|        return;
  852|    127|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  853|    127|      xmpData_[tag->_label] = time_code_scale_;
  854|    127|      break;
  855|      0|    default:
  ------------------
  |  Branch (855:5): [True: 0, False: 1.14k]
  ------------------
  856|      0|      break;
  857|  1.14k|  }
  858|  1.14k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  860|  2.31k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  861|  2.31k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  862|       |
  863|  2.31k|  switch (tag->_id) {
  864|    897|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (864:5): [True: 897, False: 1.41k]
  ------------------
  865|    981|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (865:5): [True: 84, False: 2.23k]
  ------------------
  866|    981|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  867|    981|      break;
  868|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (868:5): [True: 0, False: 2.31k]
  ------------------
  869|  1.33k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (869:5): [True: 1.33k, False: 981]
  ------------------
  870|  1.33k|      uint64_t key = getULongLong(buf, bigEndian);
  871|  1.33k|      if (!key)
  ------------------
  |  Branch (871:11): [True: 142, False: 1.19k]
  ------------------
  872|    142|        return;
  873|  1.19k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (873:16): [True: 732, False: 460]
  ------------------
  874|    732|        double frame_rate = 0;
  875|    732|        switch (stream_) {
  876|    427|          case 1:  // video
  ------------------
  |  Branch (876:11): [True: 427, False: 305]
  ------------------
  877|    427|            frame_rate = 1000000000.0 / static_cast<double>(key);
  878|    427|            break;
  879|     36|          case 2:  // audio
  ------------------
  |  Branch (879:11): [True: 36, False: 696]
  ------------------
  880|     36|            frame_rate = static_cast<double>(key) / 1000;
  881|     36|            break;
  882|    269|          default:
  ------------------
  |  Branch (882:11): [True: 269, False: 463]
  ------------------
  883|    269|            break;
  884|    732|        }
  885|    732|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (885:13): [True: 463, False: 269]
  ------------------
  886|    463|          xmpData_[internalMt->_label] = frame_rate;
  887|    732|      } else
  888|    460|        xmpData_[tag->_label] = "Variable Bit Rate";
  889|  1.19k|    } break;
  890|  1.19k|    default:
  ------------------
  |  Branch (890:5): [True: 0, False: 2.31k]
  ------------------
  891|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  892|      0|      break;
  893|  2.31k|  }
  894|  2.31k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  896|   253k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  897|   253k|  if (b & 128)
  ------------------
  |  Branch (897:7): [True: 222k, False: 31.2k]
  ------------------
  898|   222k|    return 1;
  899|  31.2k|  if (b & 64)
  ------------------
  |  Branch (899:7): [True: 15.9k, False: 15.2k]
  ------------------
  900|  15.9k|    return 2;
  901|  15.2k|  if (b & 32)
  ------------------
  |  Branch (901:7): [True: 3.61k, False: 11.6k]
  ------------------
  902|  3.61k|    return 3;
  903|  11.6k|  if (b & 16)
  ------------------
  |  Branch (903:7): [True: 5.84k, False: 5.76k]
  ------------------
  904|  5.84k|    return 4;
  905|  5.76k|  if (b & 8)
  ------------------
  |  Branch (905:7): [True: 2.36k, False: 3.39k]
  ------------------
  906|  2.36k|    return 5;
  907|  3.39k|  if (b & 4)
  ------------------
  |  Branch (907:7): [True: 227, False: 3.16k]
  ------------------
  908|    227|    return 6;
  909|  3.16k|  if (b & 2)
  ------------------
  |  Branch (909:7): [True: 686, False: 2.48k]
  ------------------
  910|    686|    return 7;
  911|  2.48k|  if (b & 1)
  ------------------
  |  Branch (911:7): [True: 2.16k, False: 321]
  ------------------
  912|  2.16k|    return 8;
  913|    321|  return 0;
  914|  2.48k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  916|  2.05k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, bool /*create*/) {
  917|  2.05k|  auto image = std::make_unique<MatroskaVideo>(std::move(io));
  918|  2.05k|  if (!image->good()) {
  ------------------
  |  Branch (918:7): [True: 0, False: 2.05k]
  ------------------
  919|      0|    return nullptr;
  920|      0|  }
  921|  2.05k|  return image;
  922|  2.05k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  924|  8.83k|bool isMkvType(BasicIo& iIo, bool advance) {
  925|  8.83k|  bool result = true;
  926|  8.83k|  byte tmpBuf[4];
  927|  8.83k|  iIo.read(tmpBuf, 4);
  928|       |
  929|  8.83k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (929:7): [True: 0, False: 8.83k]
  |  Branch (929:22): [True: 271, False: 8.56k]
  ------------------
  930|    271|    return false;
  931|       |
  932|  8.56k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (932:7): [True: 2.32k, False: 6.23k]
  |  Branch (932:28): [True: 19, False: 6.22k]
  |  Branch (932:49): [True: 36, False: 6.18k]
  |  Branch (932:70): [True: 19, False: 6.16k]
  ------------------
  933|  2.40k|    result = false;
  934|  2.40k|  }
  935|       |
  936|  8.56k|  if (!advance || !result)
  ------------------
  |  Branch (936:7): [True: 8.56k, False: 0]
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|  8.56k|    iIo.seek(0, BasicIo::beg);
  938|  8.56k|  return result;
  939|  8.83k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   253k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   253k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 253k, False: 321]
  |  Branch (583:23): [True: 253k, False: 0]
  ------------------
  584|       |
  585|   253k|  size_t b0 = buf[0] & (0xff >> size);
  586|   253k|  size_t tag = b0 << ((size - 1) * 8);
  587|   324k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 70.4k, False: 253k]
  ------------------
  588|  70.4k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  70.4k|  }
  590|       |
  591|   253k|  return tag;
  592|   253k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  722|  6.99k|  auto internalMt = [=]() -> const MatroskaTag* {
  723|  6.99k|    switch (tag->_id) {
  ------------------
  |  Branch (723:13): [True: 6.99k, False: 0]
  ------------------
  724|    576|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (724:7): [True: 576, False: 6.42k]
  ------------------
  725|    576|        return Exiv2::find(videoScanType, key);
  726|    273|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (726:7): [True: 273, False: 6.72k]
  ------------------
  727|    273|        return Exiv2::find(audioChannels, key);
  728|    240|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (728:7): [True: 240, False: 6.75k]
  ------------------
  729|    240|        return Exiv2::find(compressionAlgorithm, key);
  730|    510|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (730:7): [True: 510, False: 6.48k]
  ------------------
  731|    510|        return Exiv2::find(encryptionAlgorithm, key);
  732|     11|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (732:7): [True: 11, False: 6.98k]
  ------------------
  733|    159|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (733:7): [True: 148, False: 6.85k]
  ------------------
  734|    159|        return Exiv2::find(contentSignatureAlgorithm, key);
  735|    191|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (735:7): [True: 191, False: 6.80k]
  ------------------
  736|  1.16k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (736:7): [True: 978, False: 6.02k]
  ------------------
  737|  1.16k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  738|    712|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (738:7): [True: 712, False: 6.28k]
  ------------------
  739|    712|        return Exiv2::find(encodingType, key);
  740|    527|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (740:7): [True: 527, False: 6.47k]
  ------------------
  741|    527|        return Exiv2::find(displayUnit, key);
  742|    221|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (742:7): [True: 221, False: 6.77k]
  ------------------
  743|    221|        return Exiv2::find(aspectRatioType, key);
  744|  1.96k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (744:7): [True: 1.96k, False: 5.03k]
  ------------------
  745|  1.96k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  746|    444|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (746:7): [True: 444, False: 6.55k]
  ------------------
  747|    444|        return Exiv2::find(chapterTranslateCodec, key);
  748|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (748:7): [True: 0, False: 6.99k]
  ------------------
  749|      0|        return Exiv2::find(trackCodec, key);
  750|     89|      case Video_Audio_CodecName:
  ------------------
  |  Branch (750:7): [True: 89, False: 6.91k]
  ------------------
  751|     89|        return Exiv2::find(codecInfo, key);
  752|      8|      case CodecDownloadURL:
  ------------------
  |  Branch (752:7): [True: 8, False: 6.99k]
  ------------------
  753|    111|      case CodecInfoURL:
  ------------------
  |  Branch (753:7): [True: 103, False: 6.89k]
  ------------------
  754|    111|        return Exiv2::find(codecDownloadUrl, key);
  755|  6.99k|    }
  756|      0|    return nullptr;
  757|  6.99k|  }();

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

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

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

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

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|  56.6k|  static constexpr auto tagList() {
   34|  56.6k|    return tagInfo_;
   35|  56.6k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  24.8k|  static constexpr auto tagListCs() {
   38|  24.8k|    return tagInfoCs_;
   39|  24.8k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    640|  static constexpr auto tagListEq() {
   42|    640|    return tagInfoEq_;
   43|    640|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|     71|  static constexpr auto tagListRd() {
   46|     71|    return tagInfoRd_;
   47|     71|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    631|  static constexpr auto tagListRd2() {
   50|    631|    return tagInfoRd2_;
   51|    631|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    216|  static constexpr auto tagListIp() {
   54|    216|    return tagInfoIp_;
   55|    216|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    209|  static constexpr auto tagListFi() {
   58|    209|    return tagInfoFi_;
   59|    209|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|  1.06k|  static constexpr auto tagListFe() {
   62|  1.06k|    return tagInfoFe_;
   63|  1.06k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    622|  static constexpr auto tagListRi() {
   66|    622|    return tagInfoRi_;
   67|    622|  }

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

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

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

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

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

_ZN5Exiv29Photoshop5isIrbEPKh:
   27|  39.0M|bool Photoshop::isIrb(const byte* pPsData) {
   28|  39.0M|  if (pPsData == nullptr)
  ------------------
  |  Branch (28:7): [True: 0, False: 39.0M]
  ------------------
   29|      0|    return false;
   30|       |
   31|  39.0M|  for (auto id : irbId_)
  ------------------
  |  Branch (31:16): [True: 156M, False: 6.79k]
  ------------------
   32|   156M|    if (std::equal(id, id + 4, pPsData))
  ------------------
  |  Branch (32:9): [True: 39.0M, False: 117M]
  ------------------
   33|  39.0M|      return true;
   34|       |
   35|  6.79k|  return false;
   36|  39.0M|}
_ZN5Exiv29Photoshop5validEPKhm:
   38|  32.5k|bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {
   39|  32.5k|  const byte* record = nullptr;
   40|  32.5k|  uint32_t sizeIptc = 0;
   41|  32.5k|  uint32_t sizeHdr = 0;
   42|  32.5k|  const byte* pCur = pPsData;
   43|  32.5k|  const byte* pEnd = pPsData + sizePsData;
   44|  32.5k|  int ret = 0;
   45|  20.0M|  while (pCur < pEnd && 0 == (ret = Photoshop::locateIptcIrb(pCur, (pEnd - pCur), &record, sizeHdr, sizeIptc))) {
  ------------------
  |  Branch (45:10): [True: 20.0M, False: 25]
  |  Branch (45:25): [True: 20.0M, False: 32.5k]
  ------------------
   46|  20.0M|    pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
   47|  20.0M|  }
   48|  32.5k|  return ret >= 0;
   49|  32.5k|}
_ZN5Exiv29Photoshop9locateIrbEPKhmtPS2_RjS4_:
   55|  20.0M|                         uint32_t& sizeData) {
   56|  20.0M|  if (sizePsData < 12) {
  ------------------
  |  Branch (56:7): [True: 1.05k, False: 20.0M]
  ------------------
   57|  1.05k|    return 3;
   58|  1.05k|  }
   59|       |
   60|       |  // Used for error checking
   61|  20.0M|  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|  39.0M|  while (position <= (sizePsData - 12) && isIrb(pPsData + position)) {
  ------------------
  |  Branch (66:10): [True: 39.0M, False: 179]
  |  Branch (66:43): [True: 39.0M, False: 6.54k]
  ------------------
   67|  39.0M|    const byte* hrd = pPsData + position;
   68|  39.0M|    position += 4;
   69|  39.0M|    uint16_t type = getUShort(pPsData + position, bigEndian);
   70|  39.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|  39.0M|    byte psSize = pPsData[position] + 1;
   76|  39.0M|    psSize += (psSize & 1);
   77|  39.0M|    position += psSize;
   78|  39.0M|    if (position + 4 > sizePsData) {
  ------------------
  |  Branch (78:9): [True: 22.7k, False: 38.9M]
  ------------------
   79|       |#ifdef EXIV2_DEBUG_MESSAGES
   80|       |      std::cerr << "Warning: "
   81|       |                << "Invalid or extended Photoshop IRB\n";
   82|       |#endif
   83|  22.7k|      return -2;
   84|  22.7k|    }
   85|  38.9M|    uint32_t dataSize = getULong(pPsData + position, bigEndian);
   86|  38.9M|    position += 4;
   87|  38.9M|    if (dataSize > (sizePsData - position)) {
  ------------------
  |  Branch (87:9): [True: 3.24k, False: 38.9M]
  ------------------
   88|       |#ifdef EXIV2_DEBUG_MESSAGES
   89|       |      std::cerr << "Warning: "
   90|       |                << "Invalid Photoshop IRB data size " << dataSize << " or extended Photoshop IRB\n";
   91|       |#endif
   92|  3.24k|      return -2;
   93|  3.24k|    }
   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|  38.9M|    if (type == psTag) {
  ------------------
  |  Branch (100:9): [True: 20.0M, False: 18.9M]
  ------------------
  101|       |#ifdef EXIV2_DEBUG_MESSAGES
  102|       |      std::cerr << "ok\n";
  103|       |#endif
  104|  20.0M|      sizeData = dataSize;
  105|  20.0M|      sizeHdr = psSize + 10;
  106|  20.0M|      *record = hrd;
  107|  20.0M|      return 0;
  108|  20.0M|    }
  109|       |    // Data size is also padded to be even
  110|  18.9M|    position += dataSize + (dataSize & 1);
  111|  18.9M|  }
  112|       |#ifdef EXIV2_DEBUG_MESSAGES
  113|       |  std::cerr << "pPsData doesn't start with '8BIM'\n";
  114|       |#endif
  115|  6.72k|  if (position < sizePsData) {
  ------------------
  |  Branch (115:7): [True: 6.68k, False: 38]
  ------------------
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |    std::cerr << "Warning: "
  118|       |              << "Invalid or extended Photoshop IRB\n";
  119|       |#endif
  120|  6.68k|    return -2;
  121|  6.68k|  }
  122|     38|  return 3;
  123|  6.72k|}
_ZN5Exiv29Photoshop13locateIptcIrbEPKhmPS2_RjS4_:
  126|  20.0M|                             uint32_t& sizeData) {
  127|  20.0M|  return locateIrb(pPsData, sizePsData, iptc_, record, sizeHdr, sizeData);
  128|  20.0M|}
_ZN5Exiv29Photoshop10setIptcIrbEPKhmRKNS_8IptcDataE:
  135|    411|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|    411|  const byte* record = pPsData;
  144|    411|  uint32_t sizeIptc = 0;
  145|    411|  uint32_t sizeHdr = 0;
  146|    411|  DataBuf rc;
  147|    411|  if (0 > Photoshop::locateIptcIrb(pPsData, sizePsData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (147:7): [True: 57, False: 354]
  ------------------
  148|     57|    return rc;
  149|     57|  }
  150|       |
  151|    354|  Blob psBlob;
  152|    354|  const auto sizeFront = static_cast<size_t>(record - pPsData);
  153|       |  // Write data before old record.
  154|    354|  if (sizePsData > 0 && sizeFront > 0) {
  ------------------
  |  Branch (154:7): [True: 91, False: 263]
  |  Branch (154:25): [True: 10, False: 81]
  ------------------
  155|     10|    append(psBlob, pPsData, sizeFront);
  156|     10|  }
  157|       |
  158|       |  // Write new iptc record if we have it
  159|    354|  if (DataBuf rawIptc = IptcParser::encode(iptcData); !rawIptc.empty()) {
  ------------------
  |  Branch (159:55): [True: 131, False: 223]
  ------------------
  160|    131|    std::array<byte, 12> tmpBuf;
  161|    131|    std::copy_n(Photoshop::irbId_[0], 4, tmpBuf.begin());
  162|    131|    us2Data(tmpBuf.data() + 4, iptc_, bigEndian);
  163|    131|    tmpBuf[6] = 0;
  164|    131|    tmpBuf[7] = 0;
  165|    131|    ul2Data(tmpBuf.data() + 8, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  166|    131|    append(psBlob, tmpBuf.data(), 12);
  167|    131|    append(psBlob, rawIptc.c_data(), rawIptc.size());
  168|       |    // Data is padded to be even (but not included in size)
  169|    131|    if (rawIptc.size() & 1)
  ------------------
  |  Branch (169:9): [True: 73, False: 58]
  ------------------
  170|     73|      psBlob.push_back(0x00);
  171|    131|  }
  172|       |
  173|       |  // Write existing stuff after record, skip the current and all remaining IPTC blocks
  174|    354|  size_t pos = sizeFront;
  175|    354|  auto nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  176|    354|  Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  177|  11.9k|  while (0 == Photoshop::locateIptcIrb(pPsData + pos, nextSizeData, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (177:10): [True: 11.5k, False: 354]
  ------------------
  178|  11.5k|    const auto newPos = static_cast<size_t>(record - pPsData);
  179|  11.5k|    if (newPos > pos) {  // Copy data up to the IPTC IRB
  ------------------
  |  Branch (179:9): [True: 11.0k, False: 519]
  ------------------
  180|  11.0k|      append(psBlob, pPsData + pos, newPos - pos);
  181|  11.0k|    }
  182|  11.5k|    pos = newPos + sizeHdr + sizeIptc + (sizeIptc & 1);  // Skip the IPTC IRB
  183|  11.5k|    nextSizeData = Safe::add<long>(static_cast<long>(sizePsData), -static_cast<long>(pos));
  184|  11.5k|    Internal::enforce(nextSizeData >= 0, ErrorCode::kerCorruptedMetadata);
  185|  11.5k|  }
  186|    354|  if (pos < sizePsData) {
  ------------------
  |  Branch (186:7): [True: 80, False: 274]
  ------------------
  187|     80|    append(psBlob, pPsData + pos, sizePsData - pos);
  188|     80|  }
  189|       |
  190|       |  // Data is rounded to be even
  191|    354|  if (!psBlob.empty())
  ------------------
  |  Branch (191:7): [True: 203, False: 151]
  ------------------
  192|    203|    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|    354|  return rc;
  201|    411|}

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

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEb:
   56|  1.17k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) {
   57|  1.17k|  if (create && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 314, False: 860]
  |  Branch (57:17): [True: 314, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    314|    IoCloser closer(*io_);
   62|    314|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 314]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    314|  }
   68|  1.17k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|    860|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|    860|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 860]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|    860|  IoCloser closer(*io_);
  400|    860|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 860]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|    860|  clearMetadata();
  404|       |
  405|    860|  const size_t imgSize = io_->size();
  406|    860|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|       |
  408|  18.4k|  while (!io_->eof()) {
  ------------------
  |  Branch (408:10): [True: 18.0k, False: 311]
  ------------------
  409|  18.0k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  410|       |
  411|       |    // Decode chunk data length.
  412|  18.0k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  413|  18.0k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (413:9): [True: 229, False: 17.8k]
  ------------------
  414|    229|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  415|    229|    }
  416|       |
  417|  17.8k|    std::string chunkType(cheaderBuf.c_str(4), 4);
  418|       |#ifdef EXIV2_DEBUG_MESSAGES
  419|       |    std::cout << "Exiv2::PngImage::readMetadata: chunk type: " << chunkType << " length: " << chunkLength << '\n';
  420|       |#endif
  421|       |
  422|       |    /// \todo analyse remaining chunks of the standard
  423|       |    // Perform a chunk triage for item that we need.
  424|  17.8k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (424:9): [True: 209, False: 17.6k]
  |  Branch (424:32): [True: 1.71k, False: 15.9k]
  |  Branch (424:55): [True: 2.62k, False: 13.3k]
  |  Branch (424:78): [True: 414, False: 12.9k]
  ------------------
  425|  12.9k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (425:9): [True: 209, False: 12.7k]
  |  Branch (425:32): [True: 3.24k, False: 9.46k]
  |  Branch (425:55): [True: 819, False: 8.64k]
  ------------------
  426|  9.17k|      DataBuf chunkData(chunkLength);
  427|  9.17k|      if (chunkLength > 0) {
  ------------------
  |  Branch (427:11): [True: 7.26k, False: 1.91k]
  ------------------
  428|  7.26k|        readChunk(chunkData, *io_);  // Extract chunk data.
  429|  7.26k|      }
  430|       |
  431|  9.17k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (431:11): [True: 155, False: 9.01k]
  ------------------
  432|    155|        return;  // Last chunk found: we stop parsing.
  433|    155|      }
  434|  9.01k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (434:11): [True: 1.71k, False: 7.30k]
  |  Branch (434:34): [True: 109, False: 1.60k]
  ------------------
  435|    109|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  436|  8.90k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (436:18): [True: 2.62k, False: 6.28k]
  ------------------
  437|  2.62k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk);
  438|  6.28k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (438:18): [True: 414, False: 5.87k]
  ------------------
  439|    414|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk);
  440|  5.87k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (440:18): [True: 3.24k, False: 2.63k]
  ------------------
  441|  3.24k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk);
  442|  3.24k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (442:18): [True: 209, False: 2.42k]
  ------------------
  443|    209|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size());
  444|    209|        setByteOrder(bo);
  445|  2.42k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (445:18): [True: 819, False: 1.60k]
  ------------------
  446|       |        // The ICC profile name can vary from 1-79 characters.
  447|    819|        uint32_t iccOffset = 0;
  448|  5.05k|        do {
  449|  5.05k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (449:19): [True: 5.04k, False: 5]
  |  Branch (449:37): [True: 5.03k, False: 7]
  ------------------
  450|  5.05k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (450:18): [True: 4.23k, False: 819]
  ------------------
  451|       |
  452|    819|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  453|    819|        ++iccOffset;  // +1 = 'compressed' flag
  454|    819|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  455|       |
  456|    819|        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|    819|      }
  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|  9.01k|      chunkLength = 0;
  466|  9.01k|    }
  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|  17.7k|    io_->seek(chunkLength + 4, BasicIo::cur);
  473|  17.7k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (473:9): [True: 311, False: 17.4k]
  |  Branch (473:25): [True: 165, False: 17.2k]
  ------------------
  474|    165|      throw Error(ErrorCode::kerFailedToReadImageData);
  475|    165|    }
  476|  17.7k|  }
  477|    860|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  479|    460|void PngImage::writeMetadata() {
  480|    460|  if (io_->open() != 0) {
  ------------------
  |  Branch (480:7): [True: 0, False: 460]
  ------------------
  481|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  482|      0|  }
  483|    460|  IoCloser closer(*io_);
  484|    460|  MemIo tempIo;
  485|       |
  486|    460|  doWriteMetadata(tempIo);  // may throw
  487|    460|  io_->close();
  488|    460|  io_->transfer(tempIo);  // may throw
  489|       |
  490|    460|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  492|    460|void PngImage::doWriteMetadata(BasicIo& outIo) {
  493|    460|  if (!io_->isopen())
  ------------------
  |  Branch (493:7): [True: 0, False: 460]
  ------------------
  494|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  495|    460|  if (!outIo.isopen())
  ------------------
  |  Branch (495:7): [True: 0, False: 460]
  ------------------
  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|    460|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (503:7): [True: 0, False: 460]
  ------------------
  504|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  505|      0|  }
  506|       |
  507|       |  // Write PNG Signature.
  508|    460|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (508:7): [True: 0, False: 460]
  ------------------
  509|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  510|       |
  511|    460|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  512|       |
  513|  8.06k|  while (!io_->eof()) {
  ------------------
  |  Branch (513:10): [True: 8.06k, False: 3]
  ------------------
  514|       |    // Read chunk header.
  515|  8.06k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  516|  8.06k|    if (io_->error())
  ------------------
  |  Branch (516:9): [True: 0, False: 8.06k]
  ------------------
  517|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  518|  8.06k|    if (bufRead != 8)
  ------------------
  |  Branch (518:9): [True: 0, False: 8.06k]
  ------------------
  519|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  520|       |
  521|       |    // Decode chunk data length.
  522|       |
  523|  8.06k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  524|  8.06k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (524:9): [True: 0, False: 8.06k]
  ------------------
  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|  8.06k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  530|  8.06k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  531|  8.06k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  532|  8.06k|    if (io_->error())
  ------------------
  |  Branch (532:9): [True: 0, False: 8.06k]
  ------------------
  533|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  534|  8.06k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (534:9): [True: 62, False: 8.00k]
  ------------------
  535|     62|      throw Error(ErrorCode::kerInputDataReadFailed);
  536|       |
  537|  8.00k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  538|       |
  539|  8.00k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (539:9): [True: 395, False: 7.60k]
  ------------------
  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|    395|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (544:11): [True: 0, False: 395]
  ------------------
  545|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  546|    395|      return;
  547|    395|    }
  548|  7.60k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (548:9): [True: 44, False: 7.56k]
  |  Branch (548:30): [True: 52, False: 7.51k]
  ------------------
  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|  7.51k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (555:16): [True: 1.64k, False: 5.86k]
  ------------------
  556|       |#ifdef EXIV2_DEBUG_MESSAGES
  557|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  558|       |#endif
  559|  1.64k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (559:11): [True: 0, False: 1.64k]
  ------------------
  560|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  561|       |
  562|       |      // Write all updated metadata here, just after IHDR.
  563|  1.64k|      if (!comment_.empty()) {
  ------------------
  |  Branch (563:11): [True: 428, False: 1.21k]
  ------------------
  564|       |        // Update Comment data to a new PNG chunk
  565|    428|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  566|    428|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (566:13): [True: 0, False: 428]
  ------------------
  567|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  568|      0|        }
  569|    428|      }
  570|       |
  571|  1.64k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (571:11): [True: 190, False: 1.45k]
  ------------------
  572|       |        // Update Exif data to a new PNG chunk
  573|    190|        Blob blob;
  574|    190|        ExifParser::encode(blob, littleEndian, exifData_);
  575|    190|        if (!blob.empty()) {
  ------------------
  |  Branch (575:13): [True: 172, False: 18]
  ------------------
  576|    172|          byte length[4];
  577|    172|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  578|       |
  579|       |          // calculate CRC
  580|    172|          uLong tmp = crc32(0L, Z_NULL, 0);
  581|    172|          tmp = crc32(tmp, typeExif, 4);
  582|    172|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  583|    172|          byte crc[4];
  584|    172|          ul2Data(crc, tmp, bigEndian);
  585|       |
  586|    172|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (586:15): [True: 0, False: 172]
  |  Branch (586:46): [True: 0, False: 172]
  ------------------
  587|    172|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (587:15): [True: 0, False: 172]
  |  Branch (587:71): [True: 0, False: 172]
  ------------------
  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|    172|        }
  595|    190|      }
  596|       |
  597|  1.64k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (597:11): [True: 59, False: 1.58k]
  ------------------
  598|       |        // Update IPTC data to a new PNG chunk
  599|     59|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  600|     59|        if (!newPsData.empty()) {
  ------------------
  |  Branch (600:13): [True: 59, False: 0]
  ------------------
  601|     59|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  602|     59|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  603|     59|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (603:15): [True: 0, False: 59]
  ------------------
  604|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  605|      0|          }
  606|     59|        }
  607|     59|      }
  608|       |
  609|  1.64k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (609:11): [True: 135, False: 1.50k]
  ------------------
  610|    135|        DataBuf compressed;
  611|    135|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  612|    135|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (612:13): [True: 135, False: 0]
  ------------------
  613|    135|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  614|    135|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  615|    135|          byte length[4];
  616|    135|          ul2Data(length, chunkLength, bigEndian);
  617|       |
  618|       |          // calculate CRC
  619|    135|          uLong tmp = crc32(0L, Z_NULL, 0);
  620|    135|          tmp = crc32(tmp, typeICCP, 4);
  621|    135|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  622|    135|          tmp = crc32(tmp, nullComp, 2);
  623|    135|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  624|    135|          byte crc[4];
  625|    135|          ul2Data(crc, tmp, bigEndian);
  626|       |
  627|    135|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (627:15): [True: 0, False: 135]
  |  Branch (627:46): [True: 0, False: 135]
  ------------------
  628|    135|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (628:15): [True: 0, False: 135]
  ------------------
  629|    135|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (629:15): [True: 0, False: 135]
  ------------------
  630|    135|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (630:15): [True: 0, False: 135]
  |  Branch (630:91): [True: 0, False: 135]
  ------------------
  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|    135|        }
  638|    135|      }
  639|       |
  640|  1.64k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (640:11): [True: 1.64k, False: 3]
  |  Branch (640:36): [True: 32, False: 1.60k]
  ------------------
  641|     32|#ifndef SUPPRESS_WARNINGS
  642|     32|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     32|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 32]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     32|  LogMsg(LogMsg::error).os()
  ------------------
  643|     32|#endif
  644|     32|      }
  645|  1.64k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (645:11): [True: 788, False: 855]
  ------------------
  646|       |        // Update XMP data to a new PNG chunk
  647|    788|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  648|    788|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (648:13): [True: 0, False: 788]
  ------------------
  649|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  650|      0|        }
  651|    788|      }
  652|  5.86k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (652:16): [True: 1.01k, False: 4.85k]
  |  Branch (652:37): [True: 150, False: 4.70k]
  |  Branch (652:58): [True: 678, False: 4.02k]
  ------------------
  653|  1.84k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  654|  1.84k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (654:11): [True: 1.74k, False: 98]
  |  Branch (654:28): [True: 10, False: 1.73k]
  |  Branch (654:69): [True: 78, False: 1.65k]
  ------------------
  655|  1.65k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (655:28): [True: 230, False: 1.42k]
  |  Branch (655:69): [True: 44, False: 1.38k]
  ------------------
  656|  1.38k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (656:28): [True: 173, False: 1.20k]
  |  Branch (656:65): [True: 365, False: 843]
  ------------------
  657|       |#ifdef EXIV2_DEBUG_MESSAGES
  658|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  659|       |                  << '\n';
  660|       |#endif
  661|    941|      } else {
  662|       |#ifdef EXIV2_DEBUG_MESSAGES
  663|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  664|       |                  << '\n';
  665|       |#endif
  666|    941|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (666:13): [True: 0, False: 941]
  ------------------
  667|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  668|    941|      }
  669|  4.02k|    } 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.02k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (675:11): [True: 0, False: 4.02k]
  ------------------
  676|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  677|  4.02k|    }
  678|  7.60k|  }
  679|       |
  680|    460|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
  684|  1.17k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, bool create) {
  685|  1.17k|  auto image = std::make_unique<PngImage>(std::move(io), create);
  686|  1.17k|  if (!image->good()) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.17k]
  ------------------
  687|      0|    return nullptr;
  688|      0|  }
  689|  1.17k|  return image;
  690|  1.17k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  692|  18.8k|bool isPngType(BasicIo& iIo, bool advance) {
  693|  18.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (693:7): [True: 0, False: 18.8k]
  |  Branch (693:22): [True: 181, False: 18.6k]
  ------------------
  694|    181|    throw Error(ErrorCode::kerInputDataReadFailed);
  695|    181|  }
  696|  18.6k|  const int32_t len = 8;
  697|  18.6k|  std::array<byte, len> buf;
  698|  18.6k|  iIo.read(buf.data(), len);
  699|  18.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (699:7): [True: 0, False: 18.6k]
  |  Branch (699:22): [True: 0, False: 18.6k]
  ------------------
  700|      0|    return false;
  701|      0|  }
  702|  18.6k|  bool rc = buf == pngSignature;
  703|  18.6k|  if (!advance || !rc) {
  ------------------
  |  Branch (703:7): [True: 17.3k, False: 1.32k]
  |  Branch (703:19): [True: 0, False: 1.32k]
  ------------------
  704|  17.3k|    iIo.seek(-len, BasicIo::cur);
  705|  17.3k|  }
  706|       |
  707|  18.6k|  return rc;
  708|  18.6k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    805|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    805|  uLongf uncompressedLen = length;  // just a starting point
   76|    805|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.77k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 965, False: 805]
  ------------------
   79|    965|    result.alloc(uncompressedLen);
   80|    965|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    965|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 15, False: 950]
  |  Branch (82:31): [True: 14, False: 1]
  ------------------
   83|     14|      result.reset();
   84|       |
   85|     14|      result.alloc(uncompressedLen);
   86|     14|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|     14|    }
   88|    965|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 160, False: 805]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    160|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    160|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 160]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    160|      else
   96|    160|        uncompressedLen *= 2;
   97|    160|    }
   98|    965|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    805|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  25.3k|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|  25.3k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  25.3k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 25.3k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  25.3k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 54, False: 25.3k]
  ------------------
  388|     54|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     54|  }
  390|  25.3k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    135|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    135|  uLongf compressedLen = length;  // just a starting point
  105|    135|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|    513|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 378, False: 135]
  ------------------
  108|    378|    result.alloc(compressedLen);
  109|    378|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    378|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 243, False: 135]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|    243|      result.reset();
  113|    243|      compressedLen *= 2;
  114|    243|    } else {
  115|    135|      result.reset();
  116|    135|      result.alloc(compressedLen);
  117|    135|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    135|    }
  119|    378|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    135|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  9.14k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  9.14k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  9.14k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  9.14k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  954|    941|    properties_(std::move(properties)), preview_(std::move(data)) {
  955|    941|}
_ZNK5Exiv212PreviewImage5pDataEv:
  981|    941|const byte* PreviewImage::pData() const {
  982|    941|  return preview_.c_data();
  983|    941|}
_ZNK5Exiv212PreviewImage4sizeEv:
  985|    941|uint32_t PreviewImage::size() const {
  986|    941|  return static_cast<uint32_t>(preview_.size());
  987|    941|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1009|  4.67k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1010|  4.67k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1012|  4.67k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1013|  4.67k|  PreviewPropertiesList list;
 1014|       |  // go through the loader table and store all successfully created loaders in the list
 1015|   162k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1015:26): [True: 157k, False: 4.67k]
  ------------------
 1016|   157k|    auto loader = Loader::create(id, image_);
 1017|   157k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1017:9): [True: 9.71k, False: 148k]
  |  Branch (1017:19): [True: 5.38k, False: 4.32k]
  ------------------
 1018|  5.38k|      PreviewProperties props = loader->getProperties();
 1019|  5.38k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1020|  5.38k|      props.size_ = buf.size();         //     update the size
 1021|  5.38k|      list.push_back(std::move(props));
 1022|  5.38k|    }
 1023|   157k|  }
 1024|  4.67k|  std::sort(list.begin(), list.end(),
 1025|  4.67k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1026|       |
 1027|  4.67k|  return list;
 1028|  4.67k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1030|    941|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1031|    941|  auto loader = Loader::create(properties.id_, image_);
 1032|    941|  DataBuf buf;
 1033|    941|  if (loader) {
  ------------------
  |  Branch (1033:7): [True: 941, False: 0]
  ------------------
 1034|    941|    buf = loader->getData();
 1035|    941|  }
 1036|       |
 1037|    941|  return {properties, std::move(buf)};
 1038|    941|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  342|   321k|PreviewId Loader::getNumLoaders() {
  343|   321k|  return PreviewId{std::size(loaderList_)};
  344|   321k|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  360|  18.6k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  361|  18.6k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  362|  18.6k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  346|  18.6k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  347|  18.6k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (347:7): [True: 0, False: 18.6k]
  |  Branch (347:21): [True: 18.6k, False: 0]
  ------------------
  348|  18.6k|    return;
  349|      0|  nativePreview_ = image.nativePreviews()[parIdx];
  350|      0|  width_ = nativePreview_.width_;
  351|      0|  height_ = nativePreview_.height_;
  352|      0|  valid_ = true;
  353|      0|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (353:7): [True: 0, False: 0]
  ------------------
  354|      0|    size_ = nativePreview_.size_;
  355|      0|  } else {
  356|      0|    size_ = getData().size();
  357|      0|  }
  358|      0|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  335|   149k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  336|   149k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  338|  5.38k|PreviewProperties Loader::getProperties() const {
  339|  5.38k|  return {"", "", size_, width_, height_, id_};
  340|  5.38k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   69|  1.28k|  virtual bool readDimensions() {
   70|  1.28k|    return true;
   71|  1.28k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   46|   149k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   58|   162k|  [[nodiscard]] virtual bool valid() const {
   59|   162k|    return valid_;
   60|   162k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  553|  56.0k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  554|  56.0k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  555|  56.0k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  540|  56.0k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  541|  56.0k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (541:55): [True: 80, False: 56.0k]
  ------------------
  542|     80|    size_ = pos->sizeDataArea();  // indirect data
  543|     80|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (543:9): [True: 80, False: 0]
  |  Branch (543:23): [True: 50, False: 30]
  ------------------
  544|     50|      size_ = pos->size();  // direct data
  545|     80|  }
  546|       |
  547|  56.0k|  if (size_ == 0)
  ------------------
  |  Branch (547:7): [True: 56.0k, False: 49]
  ------------------
  548|  56.0k|    return;
  549|       |
  550|     49|  valid_ = true;
  551|     49|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  557|     16|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  558|     16|  PreviewProperties prop = Loader::getProperties();
  559|     16|  prop.mimeType_ = "image/jpeg";
  560|     16|  prop.extension_ = ".jpg";
  561|     16|  return prop;
  562|     16|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  564|     65|DataBuf LoaderExifDataJpeg::getData() const {
  565|     65|  DataBuf buf;
  566|       |
  567|     65|  if (!valid())
  ------------------
  |  Branch (567:7): [True: 0, False: 65]
  ------------------
  568|      0|    return buf;
  569|       |
  570|     65|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (570:55): [True: 65, False: 0]
  ------------------
  571|     65|    buf = pos->dataArea();  // indirect data
  572|       |
  573|     65|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (573:9): [True: 65, False: 0]
  ------------------
  574|     65|      buf = DataBuf(pos->size());
  575|     65|      pos->copy(buf.data(), invalidByteOrder);
  576|     65|    }
  577|       |
  578|     65|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  579|     65|    return buf;
  580|     65|  }
  581|       |
  582|      0|  return buf;
  583|     65|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  585|     38|bool LoaderExifDataJpeg::readDimensions() {
  586|     38|  if (!valid())
  ------------------
  |  Branch (586:7): [True: 0, False: 38]
  ------------------
  587|      0|    return false;
  588|       |
  589|     38|  DataBuf buf = getData();
  590|     38|  if (buf.empty())
  ------------------
  |  Branch (590:7): [True: 0, False: 38]
  ------------------
  591|      0|    return false;
  592|       |
  593|     38|  try {
  594|     38|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  595|     38|    if (!image)
  ------------------
  |  Branch (595:9): [True: 0, False: 38]
  ------------------
  596|      0|      return false;
  597|     38|    image->readMetadata();
  598|       |
  599|     38|    width_ = image->pixelWidth();
  600|     38|    height_ = image->pixelHeight();
  601|     38|  } catch (const Error& /* error */) {
  602|     22|    return false;
  603|     22|  }
  604|       |
  605|     16|  return true;
  606|     38|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  666|  32.5k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  667|  32.5k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  668|  32.5k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  609|  32.5k|    Loader(id, image), group_(param_[parIdx].group_) {
  610|  32.5k|  const ExifData& exifData = image_.exifData();
  611|       |
  612|  32.5k|  size_t offsetCount = 0;
  613|  32.5k|  ExifData::const_iterator pos;
  614|       |
  615|       |  // check if the group_ contains a preview image
  616|  32.5k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (616:7): [True: 27.9k, False: 4.60k]
  ------------------
  617|  27.9k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  618|  27.9k|    if (pos == exifData.end())
  ------------------
  |  Branch (618:9): [True: 25.7k, False: 2.19k]
  ------------------
  619|  25.7k|      return;
  620|  2.19k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (620:9): [True: 2.19k, False: 0]
  |  Branch (620:9): [True: 350, False: 1.84k]
  |  Branch (620:39): [True: 350, False: 1.84k]
  ------------------
  621|    350|      return;
  622|  2.19k|  }
  623|       |
  624|  6.44k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  625|  6.44k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (625:7): [True: 1.69k, False: 4.75k]
  ------------------
  626|  1.69k|    offsetTag_ = "StripOffsets";
  627|  1.69k|    sizeTag_ = "StripByteCounts";
  628|  1.69k|    offsetCount = pos->value().count();
  629|  4.75k|  } else {
  630|  4.75k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  631|  4.75k|    if (pos == exifData.end())
  ------------------
  |  Branch (631:9): [True: 4.67k, False: 84]
  ------------------
  632|  4.67k|      return;
  633|     84|    offsetTag_ = "TileOffsets";
  634|     84|    sizeTag_ = "TileByteCounts";
  635|     84|    offsetCount = pos->value().count();
  636|     84|  }
  637|       |
  638|  1.77k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  639|  1.77k|  if (pos == exifData.end())
  ------------------
  |  Branch (639:7): [True: 52, False: 1.72k]
  ------------------
  640|     52|    return;
  641|  1.72k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (641:7): [True: 16, False: 1.70k]
  ------------------
  642|     16|    return;
  643|  12.0k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (643:22): [True: 10.3k, False: 1.70k]
  ------------------
  644|  10.3k|    size_ += pos->toUint32(i);
  645|  10.3k|  }
  646|       |
  647|  1.70k|  if (size_ == 0)
  ------------------
  |  Branch (647:7): [True: 72, False: 1.63k]
  ------------------
  648|     72|    return;
  649|       |
  650|  1.63k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  651|  1.63k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (651:7): [True: 1.57k, False: 61]
  |  Branch (651:7): [True: 1.44k, False: 187]
  |  Branch (651:32): [True: 1.44k, False: 126]
  ------------------
  652|  1.44k|    width_ = pos->toUint32();
  653|  1.44k|  }
  654|       |
  655|  1.63k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  656|  1.63k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (656:7): [True: 1.55k, False: 79]
  |  Branch (656:7): [True: 1.47k, False: 159]
  |  Branch (656:32): [True: 1.47k, False: 80]
  ------------------
  657|  1.47k|    height_ = pos->toUint32();
  658|  1.47k|  }
  659|       |
  660|  1.63k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (660:7): [True: 193, False: 1.44k]
  |  Branch (660:22): [True: 73, False: 1.37k]
  ------------------
  661|    266|    return;
  662|       |
  663|  1.37k|  valid_ = true;
  664|  1.37k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  670|  1.28k|PreviewProperties LoaderTiff::getProperties() const {
  671|  1.28k|  PreviewProperties prop = Loader::getProperties();
  672|  1.28k|  prop.mimeType_ = "image/tiff";
  673|  1.28k|  prop.extension_ = ".tif";
  674|  1.28k|  return prop;
  675|  1.28k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  677|  1.37k|DataBuf LoaderTiff::getData() const {
  678|  1.37k|  const ExifData& exifData = image_.exifData();
  679|       |
  680|  1.37k|  ExifData preview;
  681|       |
  682|       |  // copy tags
  683|   214k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (683:19): [True: 214k, False: 1.37k]
  ------------------
  684|   214k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (684:9): [True: 51.0k, False: 163k]
  ------------------
  685|       |      /*
  686|       |         Write only the necessary TIFF image tags
  687|       |         tags that especially could cause problems are:
  688|       |         "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
  689|       |         "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
  690|       |                         consistent result for all previews, including JPEG
  691|       |      */
  692|  51.0k|      uint16_t tag = pos.tag();
  693|  51.0k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (693:11): [True: 49.5k, False: 1.48k]
  |  Branch (693:28): [True: 49.2k, False: 308]
  |  Branch (693:45): [True: 19.2k, False: 29.9k]
  ------------------
  694|  19.2k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  695|  19.2k|      }
  696|  51.0k|    }
  697|   214k|  }
  698|       |
  699|  1.37k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  700|       |
  701|  1.37k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (701:7): [True: 1.37k, False: 0]
  ------------------
  702|       |    // image data are not available via exifData, read them from image_.io()
  703|  1.37k|    BasicIo& io = image_.io();
  704|       |
  705|  1.37k|    if (io.open() != 0) {
  ------------------
  |  Branch (705:9): [True: 0, False: 1.37k]
  ------------------
  706|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  707|      0|    }
  708|  1.37k|    IoCloser closer(io);
  709|       |
  710|  1.37k|    const Exiv2::byte* base = io.mmap();
  711|       |
  712|  1.37k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  713|       |
  714|  1.37k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (714:9): [True: 1.37k, False: 0]
  ------------------
  715|  1.37k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (715:11): [True: 1.23k, False: 134]
  ------------------
  716|       |        // this saves one copying of the buffer
  717|  1.23k|        uint32_t offset = dataValue.toUint32(0);
  718|  1.23k|        uint32_t size = sizes.toUint32(0);
  719|  1.23k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (719:13): [True: 246, False: 990]
  ------------------
  720|    246|          dataValue.setDataArea(base + offset, size);
  721|  1.23k|      } else {
  722|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  723|    134|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  724|    134|        DataBuf buf(size_);
  725|    134|        uint32_t idxBuf = 0;
  726|  3.22k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (726:28): [True: 3.09k, False: 134]
  ------------------
  727|  3.09k|          uint32_t offset = dataValue.toUint32(i);
  728|  3.09k|          uint32_t size = sizes.toUint32(i);
  729|       |
  730|       |          // the size_ parameter is originally computed by summing all values inside sizes
  731|       |          // see the constructor of LoaderTiff
  732|       |          // But e.g in malicious files some of these values could be negative
  733|       |          // That's why we check again for each step here to really make sure we don't overstep
  734|  3.09k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  735|  3.09k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (735:15): [True: 1.37k, False: 1.71k]
  |  Branch (735:28): [True: 617, False: 762]
  ------------------
  736|    617|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  737|    617|          }
  738|       |
  739|  3.09k|          idxBuf += size;
  740|  3.09k|        }
  741|    134|        dataValue.setDataArea(buf.c_data(), buf.size());
  742|    134|      }
  743|  1.37k|    }
  744|  1.37k|  }
  745|       |
  746|       |  // Fix compression value in the CR2 IFD2 image
  747|  1.37k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (747:7): [True: 0, False: 1.37k]
  |  Branch (747:7): [True: 0, False: 1.37k]
  |  Branch (747:40): [True: 0, False: 0]
  ------------------
  748|      0|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  749|      0|  }
  750|       |
  751|       |  // write new image
  752|  1.37k|  MemIo mio;
  753|  1.37k|  IptcData emptyIptc;
  754|  1.37k|  XmpData emptyXmp;
  755|  1.37k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  756|  1.37k|  return {mio.mmap(), mio.size()};
  757|  1.37k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  481|  37.6k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  482|  37.6k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  483|  37.6k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  452|  37.6k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  453|  37.6k|  const ExifData& exifData = image_.exifData();
  454|  37.6k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  455|  37.6k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (455:7): [True: 9.90k, False: 27.7k]
  |  Branch (455:7): [True: 9.56k, False: 28.0k]
  |  Branch (455:32): [True: 9.56k, False: 337]
  ------------------
  456|  9.56k|    offset_ = pos->toUint32();
  457|  9.56k|  }
  458|       |
  459|  37.6k|  size_ = 0;
  460|  37.6k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  461|  37.6k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (461:7): [True: 10.1k, False: 27.5k]
  |  Branch (461:7): [True: 9.54k, False: 28.1k]
  |  Branch (461:32): [True: 9.54k, False: 575]
  ------------------
  462|  9.54k|    size_ = pos->toUint32();
  463|  9.54k|  }
  464|       |
  465|  37.6k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (465:7): [True: 28.1k, False: 9.49k]
  |  Branch (465:23): [True: 148, False: 9.34k]
  ------------------
  466|  28.3k|    return;
  467|       |
  468|  9.34k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (468:7): [True: 0, False: 9.34k]
  ------------------
  469|      0|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  470|      0|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:9): [True: 0, False: 0]
  |  Branch (470:9): [True: 0, False: 0]
  |  Branch (470:34): [True: 0, False: 0]
  ------------------
  471|      0|      offset_ += pos->toUint32();
  472|      0|    }
  473|      0|  }
  474|       |
  475|  9.34k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (475:7): [True: 110, False: 9.23k]
  ------------------
  476|    110|    return;
  477|       |
  478|  9.23k|  valid_ = true;
  479|  9.23k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  485|  4.09k|PreviewProperties LoaderExifJpeg::getProperties() const {
  486|  4.09k|  PreviewProperties prop = Loader::getProperties();
  487|  4.09k|  prop.mimeType_ = "image/jpeg";
  488|  4.09k|  prop.extension_ = ".jpg";
  489|  4.09k|  return prop;
  490|  4.09k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  492|  4.93k|DataBuf LoaderExifJpeg::getData() const {
  493|  4.93k|  if (!valid())
  ------------------
  |  Branch (493:7): [True: 0, False: 4.93k]
  ------------------
  494|      0|    return {};
  495|  4.93k|  BasicIo& io = image_.io();
  496|       |
  497|  4.93k|  if (io.open() != 0) {
  ------------------
  |  Branch (497:7): [True: 0, False: 4.93k]
  ------------------
  498|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  499|      0|  }
  500|  4.93k|  IoCloser closer(io);
  501|       |
  502|  4.93k|  const Exiv2::byte* base = io.mmap();
  503|       |
  504|  4.93k|  return {base + offset_, size_};
  505|  4.93k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  507|  8.39k|bool LoaderExifJpeg::readDimensions() {
  508|  8.39k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 8.39k]
  ------------------
  509|      0|    return false;
  510|  8.39k|  if (width_ || height_)
  ------------------
  |  Branch (510:7): [True: 0, False: 8.39k]
  |  Branch (510:17): [True: 0, False: 8.39k]
  ------------------
  511|      0|    return true;
  512|       |
  513|  8.39k|  BasicIo& io = image_.io();
  514|       |
  515|  8.39k|  if (io.open() != 0) {
  ------------------
  |  Branch (515:7): [True: 0, False: 8.39k]
  ------------------
  516|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  517|      0|  }
  518|  8.39k|  IoCloser closer(io);
  519|  8.39k|  const Exiv2::byte* base = io.mmap();
  520|       |
  521|  8.39k|  try {
  522|  8.39k|    auto image = ImageFactory::open(base + offset_, size_);
  523|  8.39k|    if (!image)
  ------------------
  |  Branch (523:9): [True: 0, False: 8.39k]
  ------------------
  524|      0|      return false;
  525|  8.39k|    image->readMetadata();
  526|       |
  527|  8.39k|    width_ = image->pixelWidth();
  528|  8.39k|    height_ = image->pixelHeight();
  529|  8.39k|  } catch (const Error& /* error */) {
  530|  4.30k|#ifndef SUPPRESS_WARNINGS
  531|  4.30k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  4.30k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.30k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.30k|  LogMsg(LogMsg::warn).os()
  ------------------
  532|  4.30k|#endif
  533|  4.30k|    return false;
  534|  4.30k|  }
  535|       |
  536|  4.09k|  return true;
  537|  8.39k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  792|  4.60k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  793|  4.60k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  794|  4.60k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  759|  4.60k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  760|  4.60k|  (void)parIdx;
  761|       |
  762|  4.60k|  const XmpData& xmpData = image_.xmpData();
  763|       |
  764|  4.60k|  std::string prefix = "xmpGImg";
  765|  4.60k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (765:7): [True: 0, False: 4.60k]
  ------------------
  766|      0|    prefix = "xapGImg";
  767|      0|  }
  768|       |
  769|  4.60k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  770|  4.60k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (770:7): [True: 4.60k, False: 0]
  ------------------
  771|  4.60k|    return;
  772|      0|  auto formatDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":format"));
  773|      0|  if (formatDatum == xmpData.end())
  ------------------
  |  Branch (773:7): [True: 0, False: 0]
  ------------------
  774|      0|    return;
  775|      0|  auto widthDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":width"));
  776|      0|  if (widthDatum == xmpData.end())
  ------------------
  |  Branch (776:7): [True: 0, False: 0]
  ------------------
  777|      0|    return;
  778|      0|  auto heightDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":height"));
  779|      0|  if (heightDatum == xmpData.end())
  ------------------
  |  Branch (779:7): [True: 0, False: 0]
  ------------------
  780|      0|    return;
  781|       |
  782|      0|  if (formatDatum->toString() != "JPEG")
  ------------------
  |  Branch (782:7): [True: 0, False: 0]
  ------------------
  783|      0|    return;
  784|       |
  785|      0|  width_ = widthDatum->toUint32();
  786|      0|  height_ = heightDatum->toUint32();
  787|      0|  preview_ = decodeBase64(imageDatum->toString());
  788|      0|  size_ = preview_.size();
  789|      0|  valid_ = true;
  790|      0|}
preview.cpp:_ZN12_GLOBAL__N_16Loader6createEiRKN5Exiv25ImageE:
  320|   158k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  321|   158k|  Loader::UniquePtr loader;
  322|   158k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (322:7): [True: 0, False: 158k]
  |  Branch (322:17): [True: 0, False: 158k]
  ------------------
  323|      0|    return loader;
  324|       |
  325|   158k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (325:7): [True: 13.8k, False: 144k]
  |  Branch (325:7): [True: 9.20k, False: 149k]
  |  Branch (325:41): [True: 9.20k, False: 4.68k]
  ------------------
  326|  9.20k|    return loader;
  327|       |
  328|   149k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  329|   149k|  if (!loader->valid())
  ------------------
  |  Branch (329:7): [True: 138k, False: 10.6k]
  ------------------
  330|   138k|    loader = nullptr;
  331|       |
  332|   149k|  return loader;
  333|   158k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1025|  4.34k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  2.05M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  2.05M|  return ns_ == ns.ns_;
 4941|  2.05M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  61.0M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  61.0M|  return prefix_ == prefix.prefix_;
 4945|  61.0M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  1.94M|std::mutex& XmpProperties::getMutex() {
 4953|  1.94M|  static std::mutex m;
 4954|  1.94M|  return m;
 4955|  1.94M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.14M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  34.5M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 34.5M, False: 2.13M]
  ------------------
 4965|  34.5M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 14.4k, False: 34.4M]
  ------------------
 4966|  14.4k|      return &p;
 4967|  34.5M|  }
 4968|  2.13M|  return nullptr;
 4969|  2.14M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     20|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     20|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 20]
  ------------------
 4978|      0|    return;
 4979|     20|  std::string ns2 = ns;
 4980|     20|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 5, False: 15]
  |  Branch (4980:28): [True: 5, False: 0]
  ------------------
 4981|      5|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     20|  auto it = nsRegistry_.find(ns2);
 4985|     20|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 20]
  |  Branch (4985:7): [True: 0, False: 20]
  |  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|     20|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 20]
  ------------------
 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|     20|  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|     20|  XmpNsInfo xn;
 5005|     20|  auto c = new char[ns2.size() + 1];
 5006|     20|  std::strcpy(c, ns2.c_str());
 5007|     20|  xn.ns_ = c;
 5008|     20|  c = new char[prefix.size() + 1];
 5009|     20|  std::strcpy(c, prefix.c_str());
 5010|     20|  xn.prefix_ = c;
 5011|     20|  xn.xmpPropertyInfo_ = nullptr;
 5012|     20|  xn.desc_ = "";
 5013|     20|  nsRegistry_[ns2] = xn;
 5014|     20|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     20|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     20|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     20|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     40|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     40|  auto i = nsRegistry_.find(ns);
 5027|     40|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 20, False: 20]
  ------------------
 5028|     20|    delete[] i->second.prefix_;
 5029|     20|    delete[] i->second.ns_;
 5030|     20|    nsRegistry_.erase(i);
 5031|     20|  }
 5032|     40|}
_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|     21|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 20, False: 1]
  ------------------
 5046|     20|    auto kill = i++;
 5047|     20|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     20|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   112k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   112k|  std::string ns2 = ns;
 5058|   112k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 15.2k, False: 97.2k]
  |  Branch (5058:28): [True: 9.66k, False: 5.55k]
  ------------------
 5059|  9.66k|    ns2 += '/';
 5060|       |
 5061|   112k|  auto i = nsRegistry_.find(ns2);
 5062|   112k|  std::string p;
 5063|   112k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 2.19k, False: 110k]
  ------------------
 5064|  2.19k|    p = i->second.prefix_;
 5065|   110k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 76.9k, False: 33.3k]
  ------------------
 5066|  76.9k|    p = std::string(xn->prefix_);
 5067|   112k|  return p;
 5068|   112k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.06M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.06M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 11.6k, False: 1.05M]
  ------------------
 5077|  11.6k|    return xn->ns_;
 5078|  1.05M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.06M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  5.97k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  5.97k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  5.97k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 2.74k, False: 3.23k]
  |  Branch (5083:59): [True: 3.21k, False: 20]
  ------------------
 5084|  5.97k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  29.6k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  29.6k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  29.6k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 28.7k, False: 914]
  ------------------
 5114|  29.6k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  29.6k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  29.6k|  std::string prefix = key.groupName();
 5123|  29.6k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  29.6k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 29.6k]
  ------------------
 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|  29.6k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 29.6k, False: 0]
  ------------------
 5138|  3.79M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 3.79M, False: 914]
  ------------------
 5139|  3.79M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 28.7k, False: 3.76M]
  ------------------
 5140|  28.7k|        return pl + j;
 5141|  28.7k|      }
 5142|  3.79M|    }
 5143|  29.6k|  }
 5144|    914|  return nullptr;
 5145|  29.6k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  29.6k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  29.6k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  29.6k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.08M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.08M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.08M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.08M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.08M, False: 0]
  ------------------
 5175|  1.08M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.08M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 52, False: 1.08M]
  ------------------
 5177|     52|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.08M|  return xn;
 5179|  1.08M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   105k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   105k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 105k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   105k|  property_ = property;
 5256|   105k|  prefix_ = prefix;
 5257|   105k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   230k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   230k|  p_->decomposeKey(key);
 5261|   230k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   726k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   726k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   726k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   105k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   105k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.42M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   362k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   362k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   362k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   362k|  return UniquePtr(clone_());
 5288|   362k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   362k|XmpKey* XmpKey::clone_() const {
 5291|   362k|  return new XmpKey(*this);
 5292|   362k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  20.8M|std::string XmpKey::key() const {
 5295|  20.8M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  20.8M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|   130k|std::string XmpKey::groupName() const {
 5303|   130k|  return p_->prefix_;
 5304|   130k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|   295k|std::string XmpKey::tagName() const {
 5307|   295k|  return p_->property_;
 5308|   295k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5336|   230k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5337|   230k|  XmpProperties::XmpLock lock;
 5338|   230k|  decomposeKeyUnlocked(key, lock);
 5339|   230k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5341|   957k|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|   957k|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5343:7): [True: 200, False: 956k]
  ------------------
 5344|    200|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|   956k|  std::string::size_type pos1 = key.find('.');
 5346|   956k|  std::string::size_type pos0 = pos1 + 1;
 5347|   956k|  pos1 = key.find('.', pos0);
 5348|   956k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5348:7): [True: 0, False: 956k]
  ------------------
 5349|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5350|   956k|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5351|   956k|  if (prefix.empty())
  ------------------
  |  Branch (5351:7): [True: 0, False: 956k]
  ------------------
 5352|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5353|   956k|  std::string property = key.substr(pos1 + 1);
 5354|   956k|  if (property.empty())
  ------------------
  |  Branch (5354:7): [True: 0, False: 956k]
  ------------------
 5355|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5356|       |
 5357|       |  // Validate prefix unlocked (must hold lock)
 5358|   956k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5358:7): [True: 0, False: 956k]
  ------------------
 5359|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5360|       |
 5361|   956k|  property_ = std::move(property);
 5362|   956k|  prefix_ = std::move(prefix);
 5363|   956k|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|   957k|  Impl() = default;                                                                             //!< Default constructor

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEEm:
  540|  2.41k|    Image(ImageType::qtime, mdNone, std::move(io)),
  541|  2.41k|    mvhdTimeScale_(1),
  542|  2.41k|    mdhdTimeScale_(1),
  543|  2.41k|    currentStream_(Null),
  544|  2.41k|    max_recursion_depth_(max_recursion_depth) {
  545|  2.41k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  547|  2.40k|std::string QuickTimeVideo::mimeType() const {
  548|  2.40k|  return "video/quicktime";
  549|  2.40k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  551|    208|void QuickTimeVideo::writeMetadata() {
  552|    208|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  554|  2.40k|void QuickTimeVideo::readMetadata() {
  555|  2.40k|  if (io_->open() != 0)
  ------------------
  |  Branch (555:7): [True: 0, False: 2.40k]
  ------------------
  556|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  557|       |
  558|       |  // Ensure that this is the correct image type
  559|  2.40k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (559:7): [True: 0, False: 2.40k]
  ------------------
  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|  2.40k|  IoCloser closer(*io_);
  566|  2.40k|  clearMetadata();
  567|  2.40k|  continueTraversing_ = true;
  568|  2.40k|  height_ = width_ = 1;
  569|       |
  570|  2.40k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  571|  2.40k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  572|       |
  573|  60.7k|  while (continueTraversing_)
  ------------------
  |  Branch (573:10): [True: 58.3k, False: 2.40k]
  ------------------
  574|  58.3k|    decodeBlock(0);
  575|       |
  576|  2.40k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  577|  2.40k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  68.1k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  580|  68.1k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  581|       |
  582|  68.1k|  const long bufMinSize = 4;
  583|  68.1k|  DataBuf buf(bufMinSize + 1);
  584|  68.1k|  uint64_t size = 0;
  585|  68.1k|  buf.data()[4] = '\0';
  586|       |
  587|  68.1k|  io_->read(buf.data(), 4);
  588|  68.1k|  if (io_->eof()) {
  ------------------
  |  Branch (588:7): [True: 295, False: 67.8k]
  ------------------
  589|    295|    continueTraversing_ = false;
  590|    295|    return;
  591|    295|  }
  592|       |
  593|  67.8k|  size = buf.read_uint32(0, bigEndian);
  594|       |
  595|  67.8k|  io_->readOrThrow(buf.data(), 4);
  596|       |
  597|       |  // we have read 2x 4 bytes
  598|  67.8k|  size_t hdrsize = 8;
  599|       |
  600|  67.8k|  if (size == 1) {
  ------------------
  |  Branch (600:7): [True: 120, False: 67.6k]
  ------------------
  601|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  602|    120|    DataBuf data(8);
  603|    120|    hdrsize += 8;
  604|    120|    io_->readOrThrow(data.data(), data.size());
  605|    120|    size = data.read_uint64(0, bigEndian);
  606|  67.6k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (606:14): [True: 2.78k, False: 64.9k]
  |  Branch (606:27): [True: 2.67k, False: 111]
  ------------------
  607|  2.67k|    size = buf.read_uint32(0, bigEndian);
  608|  2.67k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  2.67k|  }
  610|       |
  611|  67.8k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  612|  67.8k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  613|  67.8k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  614|       |
  615|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  616|  67.8k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  617|  67.8k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (617:7): [True: 12.0k, False: 55.7k]
  ------------------
  618|  12.0k|    discard(newsize);
  619|  12.0k|    return;
  620|  12.0k|  }
  621|  55.7k|  if (newsize > buf.size()) {
  ------------------
  |  Branch (621:7): [True: 36.5k, False: 19.2k]
  ------------------
  622|  36.5k|    buf.resize(newsize);
  623|  36.5k|  }
  624|  55.7k|  tagDecoder(buf, newsize, recursion_depth + 1);
  625|  55.7k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  635|  57.2k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  636|  57.2k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  637|  57.2k|  assert(buf.size() > 4);
  638|       |
  639|  57.2k|  if (ignoreList(buf))
  ------------------
  |  Branch (639:7): [True: 0, False: 57.2k]
  ------------------
  640|      0|    discard(size);
  641|       |
  642|  57.2k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (642:12): [True: 7.14k, False: 50.1k]
  ------------------
  643|  7.14k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  644|  50.1k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (644:14): [True: 8.62k, False: 41.5k]
  ------------------
  645|  8.62k|    fileTypeDecoder(size);
  646|       |
  647|  41.5k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (647:12): [True: 2.25k, False: 39.2k]
  ------------------
  648|  2.25k|    setMediaStream(size);
  649|       |
  650|  39.2k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (650:12): [True: 152, False: 39.0k]
  ------------------
  651|    152|    movieHeaderDecoder(size);
  652|       |
  653|  39.0k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (653:12): [True: 1.13k, False: 37.9k]
  ------------------
  654|  1.13k|    trackHeaderDecoder(size);
  655|       |
  656|  37.9k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (656:12): [True: 1.18k, False: 36.7k]
  ------------------
  657|  1.18k|    mediaHeaderDecoder(size);
  658|       |
  659|  36.7k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (659:12): [True: 4.96k, False: 31.8k]
  ------------------
  660|  4.96k|    handlerDecoder(size);
  661|       |
  662|  31.8k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (662:12): [True: 2.96k, False: 28.8k]
  ------------------
  663|  2.96k|    videoHeaderDecoder(size);
  664|       |
  665|  28.8k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (665:12): [True: 7.13k, False: 21.7k]
  ------------------
  666|  7.13k|    userDataDecoder(size, recursion_depth + 1);
  667|       |
  668|  21.7k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (668:12): [True: 1.90k, False: 19.8k]
  ------------------
  669|  1.90k|    multipleEntriesDecoder(recursion_depth + 1);
  670|       |
  671|  19.8k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (671:12): [True: 1.01k, False: 18.8k]
  ------------------
  672|  1.01k|    sampleDesc(size);
  673|       |
  674|  18.8k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (674:12): [True: 1.18k, False: 17.6k]
  ------------------
  675|  1.18k|    timeToSampleDecoder();
  676|       |
  677|  17.6k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (677:12): [True: 831, False: 16.7k]
  ------------------
  678|    831|    previewTagDecoder(size);
  679|       |
  680|  16.7k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (680:12): [True: 990, False: 15.8k]
  ------------------
  681|    990|    trackApertureTagDecoder(size);
  682|       |
  683|  15.8k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (683:12): [True: 349, False: 15.4k]
  ------------------
  684|    349|    keysTagDecoder(size);
  685|       |
  686|  15.4k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (686:12): [True: 204, False: 15.2k]
  ------------------
  687|    204|    if (currentStream_ == Video)
  ------------------
  |  Branch (687:9): [True: 72, False: 132]
  ------------------
  688|     72|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  689|    132|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (689:14): [True: 102, False: 30]
  ------------------
  690|    102|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  691|     30|    else
  692|     30|      discard(size);
  693|    204|  }
  694|       |
  695|  15.2k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (695:12): [True: 2.98k, False: 12.2k]
  ------------------
  696|  2.98k|    if (currentStream_ == Video)
  ------------------
  |  Branch (696:9): [True: 2.18k, False: 801]
  ------------------
  697|  2.18k|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  698|    801|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (698:14): [True: 742, False: 59]
  ------------------
  699|    742|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  700|     59|    else
  701|     59|      discard(size);
  702|  2.98k|  }
  703|       |
  704|  12.2k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (704:12): [True: 74, False: 12.1k]
  ------------------
  705|     74|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  706|     74|  }
  707|       |
  708|  12.1k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (708:12): [True: 210, False: 11.9k]
  ------------------
  709|    210|    io_->readOrThrow(buf.data(), 4);
  710|    210|    io_->readOrThrow(buf.data(), 4);
  711|    210|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  712|    210|  }
  713|       |
  714|  11.9k|  else {
  715|  11.9k|    discard(size);
  716|  11.9k|  }
  717|  57.2k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  719|  24.0k|void QuickTimeVideo::discard(size_t size) {
  720|  24.0k|  size_t cur_pos = io_->tell();
  721|  24.0k|  io_->seek(cur_pos + size, BasicIo::beg);
  722|  24.0k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  724|    831|void QuickTimeVideo::previewTagDecoder(size_t size) {
  725|    831|  DataBuf buf(4);
  726|    831|  size_t cur_pos = io_->tell();
  727|    831|  io_->readOrThrow(buf.data(), 4);
  728|    831|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  729|    831|  io_->readOrThrow(buf.data(), 2);
  730|    831|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  731|       |
  732|    831|  io_->readOrThrow(buf.data(), 4);
  733|    831|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (733:7): [True: 6, False: 825]
  ------------------
  734|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  735|    825|  else
  736|    825|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  737|       |
  738|    831|  io_->seek(cur_pos + size, BasicIo::beg);
  739|    831|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  741|    349|void QuickTimeVideo::keysTagDecoder(size_t size) {
  742|    349|  DataBuf buf(4);
  743|    349|  size_t cur_pos = io_->tell();
  744|    349|  io_->readOrThrow(buf.data(), 4);
  745|    349|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  746|    349|  io_->readOrThrow(buf.data(), 2);
  747|    349|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  748|       |
  749|    349|  io_->readOrThrow(buf.data(), 4);
  750|    349|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (750:7): [True: 10, False: 339]
  ------------------
  751|     10|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  752|    339|  else
  753|    339|    xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
  754|       |
  755|    349|  io_->seek(cur_pos + size, BasicIo::beg);
  756|    349|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  758|    990|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  759|    990|  DataBuf buf(4);
  760|    990|  DataBuf buf2(2);
  761|    990|  size_t cur_pos = io_->tell();
  762|    990|  byte n = 3;
  763|       |
  764|  3.95k|  while (n--) {
  ------------------
  |  Branch (764:10): [True: 2.96k, False: 990]
  ------------------
  765|  2.96k|    io_->seek(4L, BasicIo::cur);
  766|  2.96k|    io_->readOrThrow(buf.data(), 4);
  767|       |
  768|  2.96k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (768:9): [True: 13, False: 2.95k]
  ------------------
  769|     13|      io_->seek(4L, BasicIo::cur);
  770|     13|      io_->readOrThrow(buf.data(), 2);
  771|     13|      io_->readOrThrow(buf2.data(), 2);
  772|     13|      xmpData_["Xmp.video.CleanApertureWidth"] =
  773|     13|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     13|#define stringFormat std::format
  ------------------
  774|     13|      io_->readOrThrow(buf.data(), 2);
  775|     13|      io_->readOrThrow(buf2.data(), 2);
  776|     13|      xmpData_["Xmp.video.CleanApertureHeight"] =
  777|     13|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     13|#define stringFormat std::format
  ------------------
  778|     13|    }
  779|       |
  780|  2.95k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (780:14): [True: 56, False: 2.89k]
  ------------------
  781|     56|      io_->seek(4L, BasicIo::cur);
  782|     56|      io_->readOrThrow(buf.data(), 2);
  783|     56|      io_->readOrThrow(buf2.data(), 2);
  784|     56|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  785|     56|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     56|#define stringFormat std::format
  ------------------
  786|     56|      io_->readOrThrow(buf.data(), 2);
  787|     56|      io_->readOrThrow(buf2.data(), 2);
  788|     56|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  789|     56|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     56|#define stringFormat std::format
  ------------------
  790|     56|    }
  791|       |
  792|  2.89k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (792:14): [True: 264, False: 2.63k]
  ------------------
  793|    264|      io_->seek(4L, BasicIo::cur);
  794|    264|      io_->readOrThrow(buf.data(), 2);
  795|    264|      io_->readOrThrow(buf2.data(), 2);
  796|    264|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  797|    264|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    264|#define stringFormat std::format
  ------------------
  798|    264|      io_->readOrThrow(buf.data(), 2);
  799|    264|      io_->readOrThrow(buf2.data(), 2);
  800|    264|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  801|    264|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    264|#define stringFormat std::format
  ------------------
  802|    264|    }
  803|  2.96k|  }
  804|    990|  io_->seek(cur_pos + size, BasicIo::beg);
  805|    990|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  807|    751|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  808|    751|  size_t cur_pos = io_->tell();
  809|    751|  DataBuf buf(50);
  810|    751|  DataBuf buf2(4);
  811|       |
  812|    751|  io_->readOrThrow(buf.data(), 4);
  813|    751|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (813:7): [True: 547, False: 204]
  ------------------
  814|    547|    io_->seek(cur_pos, BasicIo::beg);
  815|       |
  816|    547|    io_->readOrThrow(buf.data(), 24);
  817|    547|    xmpData_["Xmp.video.Make"] = buf.data();
  818|    547|    io_->readOrThrow(buf.data(), 14);
  819|    547|    xmpData_["Xmp.video.Model"] = buf.data();
  820|    547|    io_->readOrThrow(buf.data(), 4);
  821|    547|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|    547|#define stringFormat std::format
  ------------------
  822|    547|    io_->readOrThrow(buf.data(), 4);
  823|    547|    io_->readOrThrow(buf2.data(), 4);
  824|    547|    xmpData_["Xmp.video.FNumber"] =
  825|    547|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  826|    547|    io_->readOrThrow(buf.data(), 4);
  827|    547|    io_->readOrThrow(buf2.data(), 4);
  828|    547|    xmpData_["Xmp.video.ExposureCompensation"] =
  829|    547|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  830|    547|    io_->readOrThrow(buf.data(), 10);
  831|    547|    io_->readOrThrow(buf.data(), 4);
  832|    547|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (832:14): [True: 43, False: 504]
  ------------------
  833|     43|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|     43|#define _(String) (String)
  ------------------
  834|    547|    io_->readOrThrow(buf.data(), 4);
  835|    547|    io_->readOrThrow(buf2.data(), 4);
  836|    547|    xmpData_["Xmp.video.FocalLength"] =
  837|    547|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  838|    547|    io_->seek(95L, BasicIo::cur);
  839|    547|    io_->readOrThrow(buf.data(), 48);
  840|    547|    buf.write_uint8(48, 0);
  841|    547|    xmpData_["Xmp.video.Software"] = buf.data();
  842|    547|    io_->readOrThrow(buf.data(), 4);
  843|    547|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  844|    547|  }
  845|       |
  846|    751|  io_->seek(cur_pos + size, BasicIo::beg);
  847|    751|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  849|  7.23k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  850|  7.23k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  851|  7.23k|  size_t cur_pos = io_->tell();
  852|  7.23k|  const TagVocabulary* td;
  853|  7.23k|  const TagVocabulary* tv;
  854|  7.23k|  const TagVocabulary* tv_internal;
  855|       |
  856|  7.23k|  const long bufMinSize = 100;
  857|  7.23k|  DataBuf buf(bufMinSize);
  858|  7.23k|  size_t size_internal = outer_size;
  859|  7.23k|  std::memset(buf.data(), 0x0, buf.size());
  860|       |
  861|  13.6k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (861:10): [True: 10.1k, False: 3.45k]
  |  Branch (861:38): [True: 10.1k, False: 0]
  ------------------
  862|  10.1k|    buf.data()[4] = '\0';
  863|  10.1k|    io_->readOrThrow(buf.data(), 4);
  864|  10.1k|    const size_t size = buf.read_uint32(0, bigEndian);
  865|  10.1k|    if (size > size_internal)
  ------------------
  |  Branch (865:9): [True: 2.08k, False: 8.10k]
  ------------------
  866|  2.08k|      break;
  867|  8.10k|    size_internal -= size;
  868|  8.10k|    io_->readOrThrow(buf.data(), 4);
  869|       |
  870|  8.10k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (870:9): [True: 205, False: 7.90k]
  ------------------
  871|    205|      buf.data()[0] = ' ';
  872|  8.10k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  873|       |
  874|  8.10k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  875|       |
  876|  8.10k|    if (size <= 12)
  ------------------
  |  Branch (876:9): [True: 1.69k, False: 6.41k]
  ------------------
  877|  1.69k|      break;
  878|       |
  879|  6.41k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (879:9): [True: 66, False: 6.34k]
  |  Branch (879:40): [True: 32, False: 6.31k]
  ------------------
  880|     95|      userDataDecoder(size - 8, recursion_depth + 1);
  881|       |
  882|  6.32k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (882:14): [True: 994, False: 5.32k]
  ------------------
  883|    994|      NikonTagsDecoder(size - 8);
  884|       |
  885|  5.32k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (885:14): [True: 751, False: 4.57k]
  ------------------
  886|    751|      CameraTagsDecoder(size - 8);
  887|       |
  888|  4.57k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (888:14): [True: 8, False: 4.56k]
  |  Branch (888:45): [True: 37, False: 4.53k]
  |  Branch (888:76): [True: 19, False: 4.51k]
  ------------------
  889|  4.51k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (889:14): [True: 11, False: 4.50k]
  |  Branch (889:45): [True: 166, False: 4.33k]
  ------------------
  890|    238|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  891|    238|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    238|#define _(String) (String)
  ------------------
  892|    238|    }
  893|       |
  894|  4.33k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (894:14): [True: 128, False: 4.20k]
  |  Branch (894:45): [True: 0, False: 4.20k]
  ------------------
  895|    125|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  896|    125|      io_->readOrThrow(buf.data(), 2);
  897|    125|      buf.data()[2] = '\0';
  898|    125|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  899|       |
  900|    125|      if (tv_internal)
  ------------------
  |  Branch (900:11): [True: 81, False: 44]
  ------------------
  901|     81|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     81|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     81|#define _(String) (String)
  ------------------
  902|     44|      else
  903|     44|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     44|#define _(String) (String)
  ------------------
  904|    125|    }
  905|       |
  906|  4.21k|    else if (tv) {
  ------------------
  |  Branch (906:14): [True: 174, False: 4.03k]
  ------------------
  907|    174|      io_->readOrThrow(buf.data(), 4);
  908|    174|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    174|#define _(String) (String)
  ------------------
  909|    174|    }
  910|       |
  911|  4.03k|    else if (td)
  ------------------
  |  Branch (911:14): [True: 2.66k, False: 1.37k]
  ------------------
  912|  2.66k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  913|  6.41k|  }
  914|       |
  915|  7.23k|  io_->seek(cur_pos + outer_size, BasicIo::beg);
  916|  7.23k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|    994|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|    994|  size_t cur_pos = io_->tell();
  920|    994|  DataBuf buf(201);
  921|    994|  DataBuf buf2(4 + 1);
  922|    994|  uint32_t TagID = 0;
  923|    994|  uint16_t dataLength = 0;
  924|    994|  uint16_t dataType = 2;
  925|    994|  const TagDetails* td;
  926|    994|  const TagDetails* td2;
  927|       |
  928|  65.6k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 64.6k, False: 994]
  ------------------
  929|  64.6k|    io_->readOrThrow(buf.data(), 4);
  930|  64.6k|    TagID = buf.read_uint32(0, bigEndian);
  931|  64.6k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|  64.6k|    io_->readOrThrow(buf.data(), 2);
  934|  64.6k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|  64.6k|    std::memset(buf.data(), 0x0, buf.size());
  937|  64.6k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|  64.6k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 2.97k, False: 61.7k]
  ------------------
  940|  2.97k|      size_t local_pos = io_->tell();
  941|  2.97k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  2.97k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  2.97k|      io_->readOrThrow(buf.data(), 4);
  945|  2.97k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  2.97k|      io_->readOrThrow(buf.data(), 20);
  947|  2.97k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  2.97k|      io_->readOrThrow(buf.data(), 20);
  949|  2.97k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  2.97k|      io_->readOrThrow(buf.data(), 4);
  951|  2.97k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  2.97k|      io_->readOrThrow(buf.data(), 1);
  954|  2.97k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  2.97k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 1.85k, False: 1.11k]
  ------------------
  956|  1.85k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  1.85k|#define _(String) (String)
  ------------------
  957|  1.11k|      else
  958|  1.11k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  2.97k|      io_->readOrThrow(buf.data(), 1);
  961|  2.97k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  2.97k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 1.80k, False: 1.16k]
  ------------------
  963|  1.80k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  1.80k|#define _(String) (String)
  ------------------
  964|       |
  965|  2.97k|      io_->readOrThrow(buf.data(), 1);
  966|  2.97k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  2.97k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 1.92k, False: 1.04k]
  ------------------
  968|  1.92k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  1.92k|#define _(String) (String)
  ------------------
  969|  1.04k|      else
  970|  1.04k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  2.97k|      io_->readOrThrow(buf.data(), 1);
  973|  2.97k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  2.97k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 1.17k, False: 1.79k]
  ------------------
  975|  1.17k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  1.17k|#define _(String) (String)
  ------------------
  976|  1.79k|      else
  977|  1.79k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  2.97k|      io_->readOrThrow(buf.data(), 1);
  980|  2.97k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  2.97k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 1.74k, False: 1.23k]
  ------------------
  982|  1.74k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  1.74k|#define _(String) (String)
  ------------------
  983|  1.23k|      else
  984|  1.23k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  2.97k|      io_->readOrThrow(buf.data(), 1);
  987|  2.97k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  2.97k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 1.25k, False: 1.71k]
  ------------------
  989|  1.25k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  1.25k|#define _(String) (String)
  ------------------
  990|  1.71k|      else
  991|  1.71k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  2.97k|      io_->readOrThrow(buf.data(), 1);
  994|  2.97k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  2.97k|      io_->readOrThrow(buf.data(), 1);
  997|  2.97k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  2.97k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 611, False: 2.36k]
  ------------------
  999|    611|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    611|#define _(String) (String)
  ------------------
 1000|  2.36k|      else
 1001|  2.36k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  2.97k|      io_->readOrThrow(buf.data(), 1);
 1004|  2.97k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  2.97k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 987, False: 1.98k]
  ------------------
 1006|    987|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|    987|#define _(String) (String)
  ------------------
 1007|  1.98k|      else
 1008|  1.98k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  2.97k|      io_->readOrThrow(buf.data(), 1);
 1011|  2.97k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  2.97k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  2.97k|    }
 1015|       |
 1016|  61.7k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 370, False: 61.3k]
  ------------------
 1017|    370|      size_t local_pos = io_->tell();
 1018|    370|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    370|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    370|      io_->readOrThrow(buf.data(), 2);
 1022|    370|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    370|      io_->readOrThrow(buf.data(), 1);
 1024|    370|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    370|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 121, False: 249]
  ------------------
 1026|    121|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    121|#define _(String) (String)
  ------------------
 1027|       |
 1028|    370|      io_->readOrThrow(buf.data(), 1);
 1029|    370|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    370|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 193, False: 177]
  ------------------
 1031|    193|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    193|#define _(String) (String)
  ------------------
 1032|       |
 1033|    370|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    370|    }
 1035|       |
 1036|  61.3k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 967, False: 60.3k]
  |  Branch (1036:31): [True: 263, False: 60.1k]
  ------------------
 1037|    876|      dataLength = buf.read_uint16(0, bigEndian);
 1038|    876|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|    876|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 440, False: 436]
  ------------------
 1042|    440|#ifndef SUPPRESS_WARNINGS
 1043|    440|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    440|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 440]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    440|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    440|#endif
 1046|    440|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    440|        buf.data()[0] = '\0';
 1048|    440|      } else {
 1049|    436|        io_->readOrThrow(buf.data(), dataLength);
 1050|    436|        buf.data()[dataLength] = '\0';
 1051|    436|      }
 1052|       |
 1053|    876|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 173, False: 703]
  ------------------
 1054|    173|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    173|#define _(String) (String)
  ------------------
 1055|    173|      }
 1056|  60.4k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 746, False: 59.7k]
  ------------------
 1057|    746|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|    746|      std::memset(buf.data(), 0x0, buf.size());
 1059|    746|      io_->readOrThrow(buf.data(), 4);
 1060|    746|      if (td)
  ------------------
  |  Branch (1060:11): [True: 231, False: 515]
  ------------------
 1061|    231|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    231|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|    746|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 363, False: 383]
  |  Branch (1064:31): [True: 171, False: 212]
  ------------------
 1065|    534|#ifndef SUPPRESS_WARNINGS
 1066|    534|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    534|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 534]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    534|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    534|#endif
 1069|    534|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    534|      } else
 1071|    212|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  59.7k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 1.85k, False: 57.8k]
  ------------------
 1073|  1.85k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  1.85k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  1.85k|      io_->readOrThrow(buf.data(), 2);
 1076|  1.85k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 796, False: 1.06k]
  ------------------
 1077|    796|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|    796|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  1.85k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 1.49k, False: 365]
  |  Branch (1080:31): [True: 170, False: 195]
  ------------------
 1081|  1.66k|#ifndef SUPPRESS_WARNINGS
 1082|  1.66k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.66k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.66k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.66k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  1.66k|#endif
 1085|  1.66k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  1.66k|      } else
 1087|    195|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  57.8k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 252, False: 57.6k]
  ------------------
 1089|    252|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|    252|      std::memset(buf.data(), 0x0, buf.size());
 1091|    252|      io_->readOrThrow(buf.data(), 4);
 1092|    252|      io_->readOrThrow(buf2.data(), 4);
 1093|    252|      if (td)
  ------------------
  |  Branch (1093:11): [True: 126, False: 126]
  ------------------
 1094|    126|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    126|#define _(String) (String)
  ------------------
 1095|    126|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1096|       |
 1097|       |      // Sanity check with an "unreasonably" large number
 1098|    252|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 145, False: 107]
  |  Branch (1098:31): [True: 101, False: 6]
  ------------------
 1099|    245|#ifndef SUPPRESS_WARNINGS
 1100|    245|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    245|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 245]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    245|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    245|#endif
 1103|    245|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    245|      } else
 1105|      7|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  57.6k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.09k, False: 56.5k]
  ------------------
 1107|  1.09k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.09k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.09k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.09k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.09k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 590, False: 508]
  ------------------
 1112|    590|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    590|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    590|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.09k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 720, False: 378]
  |  Branch (1115:31): [True: 50, False: 328]
  ------------------
 1116|    770|#ifndef SUPPRESS_WARNINGS
 1117|    770|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    770|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 770]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    770|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    770|#endif
 1120|    770|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    770|      } else
 1122|    328|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.09k|    }
 1124|  64.6k|  }
 1125|       |
 1126|    994|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|    994|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  2.25k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  2.25k|  size_t current_position = io_->tell();
 1131|  2.25k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  2.25k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 2.25k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  2.25k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  53.1k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 53.1k, False: 0]
  |  Branch (1136:25): [True: 52.4k, False: 627]
  ------------------
 1137|  52.4k|    io_->readOrThrow(buf.data(), 4);
 1138|  52.4k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 1.63k, False: 50.8k]
  ------------------
 1139|  1.63k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 11, False: 1.62k]
  ------------------
 1140|     11|        break;
 1141|  1.62k|      io_->readOrThrow(buf.data(), 4);
 1142|  1.62k|      io_->readOrThrow(buf.data(), 4);
 1143|  1.62k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  1.62k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 19, False: 1.60k]
  ------------------
 1146|     19|        currentStream_ = Video;
 1147|  1.60k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 552, False: 1.04k]
  ------------------
 1148|    552|        currentStream_ = Audio;
 1149|  1.04k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 60, False: 989]
  ------------------
 1150|     60|        currentStream_ = Hint;
 1151|    989|      else
 1152|    989|        currentStream_ = GenMediaHeader;
 1153|  1.62k|      break;
 1154|  1.63k|    }
 1155|  52.4k|  }
 1156|       |
 1157|  2.25k|  io_->seek(current_position, BasicIo::beg);
 1158|  2.25k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|  1.18k|void QuickTimeVideo::timeToSampleDecoder() {
 1161|  1.18k|  DataBuf buf(4 + 1);
 1162|  1.18k|  io_->readOrThrow(buf.data(), 4);
 1163|  1.18k|  io_->readOrThrow(buf.data(), 4);
 1164|  1.18k|  uint64_t totalframes = 0;
 1165|  1.18k|  uint64_t timeOfFrames = 0;
 1166|  1.18k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  3.12k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 1.94k, False: 1.18k]
  ------------------
 1169|  1.94k|    io_->readOrThrow(buf.data(), 4);
 1170|  1.94k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  1.94k|    totalframes = Safe::add(totalframes, temp);
 1172|  1.94k|    io_->readOrThrow(buf.data(), 4);
 1173|  1.94k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  1.94k|  }
 1175|  1.18k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 458, False: 723]
  ------------------
 1176|    458|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 240, False: 218]
  ------------------
 1177|    240|      timeOfFrames = 1;
 1178|    458|    xmpData_["Xmp.video.FrameRate"] =
 1179|    458|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    458|  }
 1181|  1.18k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.01k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.01k|  DataBuf buf(100);
 1185|  1.01k|  size_t cur_pos = io_->tell();
 1186|  1.01k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.01k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.01k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|   104k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 103k, False: 624]
  ------------------
 1191|   103k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 33.2k, False: 70.2k]
  ------------------
 1192|  33.2k|      imageDescDecoder();
 1193|  70.2k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 69.8k, False: 387]
  ------------------
 1194|  69.8k|      audioDescDecoder();
 1195|    387|    else
 1196|    387|      break;
 1197|   103k|  }
 1198|  1.01k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.01k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  69.8k|void QuickTimeVideo::audioDescDecoder() {
 1202|  69.8k|  DataBuf buf(40);
 1203|  69.8k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  69.8k|  buf.data()[4] = '\0';
 1205|  69.8k|  io_->readOrThrow(buf.data(), 4);
 1206|  69.8k|  size_t size = 82;
 1207|       |
 1208|  69.8k|  const TagVocabulary* td;
 1209|       |
 1210|  1.46M|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 1.39M, False: 69.7k]
  ------------------
 1211|  1.39M|    io_->readOrThrow(buf.data(), 4);
 1212|  1.39M|    switch (i) {
 1213|  69.8k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 69.8k, False: 1.32M]
  ------------------
 1214|  69.8k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  69.8k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 464, False: 69.3k]
  ------------------
 1216|    464|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    464|#define _(String) (String)
  ------------------
 1217|  69.3k|        else
 1218|  69.3k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  69.8k|        break;
 1220|  69.8k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 69.8k, False: 1.32M]
  ------------------
 1221|  69.8k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  69.8k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 1.06k, False: 68.7k]
  ------------------
 1223|  1.06k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.06k|#define _(String) (String)
  ------------------
 1224|  69.8k|        break;
 1225|  69.8k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 69.8k, False: 1.32M]
  ------------------
 1226|  69.8k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  69.8k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  69.8k|        break;
 1229|  69.8k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 69.8k, False: 1.32M]
  ------------------
 1230|  69.8k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  69.8k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  69.8k|        break;
 1233|  1.11M|      default:
  ------------------
  |  Branch (1233:7): [True: 1.11M, False: 279k]
  ------------------
 1234|  1.11M|        break;
 1235|  1.39M|    }
 1236|  1.39M|  }
 1237|  69.7k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  69.7k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  33.2k|void QuickTimeVideo::imageDescDecoder() {
 1241|  33.2k|  DataBuf buf(40);
 1242|  33.2k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  33.2k|  buf.data()[4] = '\0';
 1244|  33.2k|  io_->readOrThrow(buf.data(), 4);
 1245|  33.2k|  size_t size = 82;
 1246|       |
 1247|  33.2k|  const TagVocabulary* td;
 1248|       |
 1249|   398k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 365k, False: 33.1k]
  ------------------
 1250|   365k|    io_->readOrThrow(buf.data(), 4);
 1251|       |
 1252|   365k|    switch (i) {
 1253|  33.2k|      case codec:
  ------------------
  |  Branch (1253:7): [True: 33.2k, False: 332k]
  ------------------
 1254|  33.2k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1255|  33.2k|        if (td)
  ------------------
  |  Branch (1255:13): [True: 310, False: 32.9k]
  ------------------
 1256|    310|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    310|#define _(String) (String)
  ------------------
 1257|  32.9k|        else
 1258|  32.9k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1259|  33.2k|        break;
 1260|  33.2k|      case VendorID:
  ------------------
  |  Branch (1260:7): [True: 33.2k, False: 332k]
  ------------------
 1261|  33.2k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1262|  33.2k|        if (td)
  ------------------
  |  Branch (1262:13): [True: 615, False: 32.5k]
  ------------------
 1263|    615|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    615|#define _(String) (String)
  ------------------
 1264|  33.2k|        break;
 1265|  33.1k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1265:7): [True: 33.1k, False: 332k]
  ------------------
 1266|  33.1k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1267|  33.1k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1268|  33.1k|        break;
 1269|  33.1k|      case XResolution:
  ------------------
  |  Branch (1269:7): [True: 33.1k, False: 332k]
  ------------------
 1270|  33.1k|        xmpData_["Xmp.video.XResolution"] =
 1271|  33.1k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1272|  33.1k|        break;
 1273|  33.1k|      case YResolution:
  ------------------
  |  Branch (1273:7): [True: 33.1k, False: 332k]
  ------------------
 1274|  33.1k|        xmpData_["Xmp.video.YResolution"] =
 1275|  33.1k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1276|  33.1k|        io_->readOrThrow(buf.data(), 3);
 1277|  33.1k|        size -= 3;
 1278|  33.1k|        break;
 1279|  33.1k|      case CompressorName:
  ------------------
  |  Branch (1279:7): [True: 33.1k, False: 332k]
  ------------------
 1280|  33.1k|        io_->readOrThrow(buf.data(), 32);
 1281|  33.1k|        size -= 32;
 1282|  33.1k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1283|  33.1k|        break;
 1284|   166k|      default:
  ------------------
  |  Branch (1284:7): [True: 166k, False: 199k]
  ------------------
 1285|   166k|        break;
 1286|   365k|    }
 1287|   365k|  }
 1288|  33.1k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1289|  33.1k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1290|  33.1k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1292|  1.90k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1293|  1.90k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1294|  1.90k|  DataBuf buf(4 + 1);
 1295|  1.90k|  io_->readOrThrow(buf.data(), 4);
 1296|  1.90k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.90k|  uint32_t noOfEntries;
 1298|       |
 1299|  1.90k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1300|       |
 1301|  4.51k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1301:24): [True: 2.88k, False: 1.62k]
  |  Branch (1301:43): [True: 2.61k, False: 277]
  ------------------
 1302|  2.61k|    decodeBlock(recursion_depth + 1);
 1303|  2.61k|  }
 1304|  1.90k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1306|  2.96k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1307|  2.96k|  DataBuf buf(3);
 1308|  2.96k|  std::memset(buf.data(), 0x0, buf.size());
 1309|  2.96k|  buf.data()[2] = '\0';
 1310|  2.96k|  currentStream_ = Video;
 1311|       |
 1312|  2.96k|  const TagDetails* td;
 1313|       |
 1314|  18.1k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1314:19): [True: 15.2k, False: 2.96k]
  ------------------
 1315|  15.2k|    io_->readOrThrow(buf.data(), 2);
 1316|       |
 1317|  15.2k|    switch (i) {
 1318|  2.80k|      case GraphicsMode:
  ------------------
  |  Branch (1318:7): [True: 2.80k, False: 12.4k]
  ------------------
 1319|  2.80k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1320|  2.80k|        if (td)
  ------------------
  |  Branch (1320:13): [True: 2.43k, False: 367]
  ------------------
 1321|  2.43k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.43k|#define _(String) (String)
  ------------------
 1322|  2.80k|        break;
 1323|  2.80k|      case OpColor:
  ------------------
  |  Branch (1323:7): [True: 2.80k, False: 12.4k]
  ------------------
 1324|  2.80k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1325|  2.80k|        break;
 1326|  9.61k|      default:
  ------------------
  |  Branch (1326:7): [True: 9.61k, False: 5.60k]
  ------------------
 1327|  9.61k|        break;
 1328|  15.2k|    }
 1329|  15.2k|  }
 1330|  2.96k|  io_->readOrThrow(buf.data(), size % 2);
 1331|  2.96k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1333|  4.96k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1334|  4.96k|  size_t cur_pos = io_->tell();
 1335|  4.96k|  DataBuf buf(100);
 1336|  4.96k|  std::memset(buf.data(), 0x0, buf.size());
 1337|  4.96k|  buf.data()[4] = '\0';
 1338|       |
 1339|  4.96k|  const TagVocabulary* tv;
 1340|       |
 1341|  29.7k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1341:19): [True: 24.8k, False: 4.96k]
  ------------------
 1342|  24.8k|    io_->readOrThrow(buf.data(), 4);
 1343|       |
 1344|  24.8k|    switch (i) {
  ------------------
  |  Branch (1344:13): [True: 14.8k, False: 9.93k]
  ------------------
 1345|  4.96k|      case HandlerClass:
  ------------------
  |  Branch (1345:7): [True: 4.96k, False: 19.8k]
  ------------------
 1346|  4.96k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1347|  4.96k|        if (tv) {
  ------------------
  |  Branch (1347:13): [True: 1.61k, False: 3.34k]
  ------------------
 1348|  1.61k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1348:15): [True: 422, False: 1.19k]
  ------------------
 1349|    422|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    422|#define _(String) (String)
  ------------------
 1350|  1.19k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1350:20): [True: 390, False: 805]
  ------------------
 1351|    390|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    390|#define _(String) (String)
  ------------------
 1352|  1.61k|        }
 1353|  4.96k|        break;
 1354|  4.96k|      case HandlerType:
  ------------------
  |  Branch (1354:7): [True: 4.96k, False: 19.8k]
  ------------------
 1355|  4.96k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1356|  4.96k|        if (tv) {
  ------------------
  |  Branch (1356:13): [True: 3.79k, False: 1.17k]
  ------------------
 1357|  3.79k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1357:15): [True: 1.17k, False: 2.62k]
  ------------------
 1358|  1.17k|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.17k|#define _(String) (String)
  ------------------
 1359|  2.62k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1359:20): [True: 884, False: 1.73k]
  ------------------
 1360|    884|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    884|#define _(String) (String)
  ------------------
 1361|  3.79k|        }
 1362|  4.96k|        break;
 1363|  4.96k|      case HandlerVendorID:
  ------------------
  |  Branch (1363:7): [True: 4.96k, False: 19.8k]
  ------------------
 1364|  4.96k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1365|  4.96k|        if (tv) {
  ------------------
  |  Branch (1365:13): [True: 1.41k, False: 3.54k]
  ------------------
 1366|  1.41k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1366:15): [True: 195, False: 1.22k]
  ------------------
 1367|    195|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    195|#define _(String) (String)
  ------------------
 1368|  1.22k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1368:20): [True: 364, False: 859]
  ------------------
 1369|    364|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    364|#define _(String) (String)
  ------------------
 1370|  1.41k|        }
 1371|  4.96k|        break;
 1372|  24.8k|    }
 1373|  24.8k|  }
 1374|  4.96k|  io_->seek(cur_pos + size, BasicIo::beg);
 1375|  4.96k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1377|  8.62k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1378|  8.62k|  DataBuf buf(5);
 1379|  8.62k|  std::memset(buf.data(), 0x0, buf.size());
 1380|  8.62k|  buf.data()[4] = '\0';
 1381|  8.62k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1382|  8.62k|  const TagVocabulary* td;
 1383|       |
 1384|   204k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1384:19): [True: 195k, False: 8.62k]
  ------------------
 1385|   195k|    io_->readOrThrow(buf.data(), 4);
 1386|   195k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1387|       |
 1388|   195k|    switch (i) {
 1389|  8.58k|      case 0:
  ------------------
  |  Branch (1389:7): [True: 8.58k, False: 187k]
  ------------------
 1390|  8.58k|        if (td)
  ------------------
  |  Branch (1390:13): [True: 1.74k, False: 6.84k]
  ------------------
 1391|  1.74k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  1.74k|#define _(String) (String)
  ------------------
 1392|  8.58k|        break;
 1393|    912|      case 1:
  ------------------
  |  Branch (1393:7): [True: 912, False: 195k]
  ------------------
 1394|    912|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1395|    912|        break;
 1396|   186k|      default:
  ------------------
  |  Branch (1396:7): [True: 186k, False: 9.49k]
  ------------------
 1397|   186k|        if (td)
  ------------------
  |  Branch (1397:13): [True: 681, False: 185k]
  ------------------
 1398|    681|          v->read(_(td->label_));
  ------------------
  |  |   40|    681|#define _(String) (String)
  ------------------
 1399|   185k|        else
 1400|   185k|          v->read(Exiv2::toString(buf.data()));
 1401|   186k|        break;
 1402|   195k|    }
 1403|   195k|  }
 1404|  8.62k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1405|  8.62k|  io_->readOrThrow(buf.data(), size % 4);
 1406|  8.62k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1408|  1.18k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1409|  1.18k|  DataBuf buf(5);
 1410|  1.18k|  std::memset(buf.data(), 0x0, buf.size());
 1411|  1.18k|  buf.data()[4] = '\0';
 1412|  1.18k|  int64_t time_scale = 1;
 1413|       |
 1414|  7.29k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1414:19): [True: 6.11k, False: 1.18k]
  ------------------
 1415|  6.11k|    io_->readOrThrow(buf.data(), 4);
 1416|       |
 1417|  6.11k|    switch (i) {
 1418|  1.00k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1418:7): [True: 1.00k, False: 5.10k]
  ------------------
 1419|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1419:13): [True: 301, False: 708]
  ------------------
 1420|    301|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1421|    708|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1421:18): [True: 190, False: 518]
  ------------------
 1422|    190|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1423|  1.00k|        break;
 1424|  1.00k|      case MediaCreateDate:
  ------------------
  |  Branch (1424:7): [True: 1.00k, False: 5.10k]
  ------------------
 1425|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1426|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1426:13): [True: 299, False: 707]
  ------------------
 1427|    299|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1428|    707|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1428:18): [True: 190, False: 517]
  ------------------
 1429|    190|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1430|  1.00k|        break;
 1431|  1.00k|      case MediaModifyDate:
  ------------------
  |  Branch (1431:7): [True: 1.00k, False: 5.10k]
  ------------------
 1432|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1433|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1433:13): [True: 295, False: 707]
  ------------------
 1434|    295|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1435|    707|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1435:18): [True: 190, False: 517]
  ------------------
 1436|    190|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1437|  1.00k|        break;
 1438|  1.00k|      case MediaTimeScale:
  ------------------
  |  Branch (1438:7): [True: 1.00k, False: 5.10k]
  ------------------
 1439|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1439:13): [True: 295, False: 707]
  ------------------
 1440|    295|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1441|    707|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1441:18): [True: 190, False: 517]
  ------------------
 1442|    190|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1443|  1.00k|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1444|  1.00k|        mdhdTimeScale_ = time_scale;
 1445|  1.00k|        break;
 1446|  1.00k|      case MediaDuration:
  ------------------
  |  Branch (1446:7): [True: 1.00k, False: 5.10k]
  ------------------
 1447|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1447:13): [True: 295, False: 706]
  ------------------
 1448|    295|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1448:49): [True: 295, False: 0]
  ------------------
 1449|    706|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1449:18): [True: 190, False: 516]
  ------------------
 1450|    190|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1450:49): [True: 190, False: 0]
  ------------------
 1451|  1.00k|        break;
 1452|  1.00k|      case MediaLanguageCode:
  ------------------
  |  Branch (1452:7): [True: 1.00k, False: 5.10k]
  ------------------
 1453|  1.00k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1453:13): [True: 295, False: 706]
  ------------------
 1454|    295|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1455|    706|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1455:18): [True: 190, False: 516]
  ------------------
 1456|    190|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1457|  1.00k|        break;
 1458|       |
 1459|     89|      default:
  ------------------
  |  Branch (1459:7): [True: 89, False: 6.02k]
  ------------------
 1460|     89|        break;
 1461|  6.11k|    }
 1462|  6.11k|  }
 1463|  1.18k|  io_->readOrThrow(buf.data(), size % 4);
 1464|  1.18k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1466|  1.13k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1467|  1.13k|  DataBuf buf(5);
 1468|  1.13k|  std::memset(buf.data(), 0x0, buf.size());
 1469|  1.13k|  buf.data()[4] = '\0';
 1470|  1.13k|  int64_t temp = 0;
 1471|       |
 1472|  20.7k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1472:19): [True: 19.5k, False: 1.13k]
  ------------------
 1473|  19.5k|    io_->readOrThrow(buf.data(), 4);
 1474|       |
 1475|  19.5k|    switch (i) {
 1476|    973|      case TrackHeaderVersion:
  ------------------
  |  Branch (1476:7): [True: 973, False: 18.6k]
  ------------------
 1477|    973|        if (currentStream_ == Video)
  ------------------
  |  Branch (1477:13): [True: 180, False: 793]
  ------------------
 1478|    180|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1479|    793|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1479:18): [True: 325, False: 468]
  ------------------
 1480|    325|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1481|    973|        break;
 1482|    972|      case TrackCreateDate:
  ------------------
  |  Branch (1482:7): [True: 972, False: 18.6k]
  ------------------
 1483|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1484|    972|        if (currentStream_ == Video)
  ------------------
  |  Branch (1484:13): [True: 180, False: 792]
  ------------------
 1485|    180|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1486|    792|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1486:18): [True: 325, False: 467]
  ------------------
 1487|    325|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1488|    972|        break;
 1489|    971|      case TrackModifyDate:
  ------------------
  |  Branch (1489:7): [True: 971, False: 18.6k]
  ------------------
 1490|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1491|    971|        if (currentStream_ == Video)
  ------------------
  |  Branch (1491:13): [True: 180, False: 791]
  ------------------
 1492|    180|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1493|    791|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1493:18): [True: 325, False: 466]
  ------------------
 1494|    325|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1495|    971|        break;
 1496|    970|      case TrackID:
  ------------------
  |  Branch (1496:7): [True: 970, False: 18.6k]
  ------------------
 1497|    970|        if (currentStream_ == Video)
  ------------------
  |  Branch (1497:13): [True: 180, False: 790]
  ------------------
 1498|    180|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1499|    790|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1499:18): [True: 325, False: 465]
  ------------------
 1500|    325|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1501|    970|        break;
 1502|    969|      case TrackDuration:
  ------------------
  |  Branch (1502:7): [True: 969, False: 18.6k]
  ------------------
 1503|    969|        if (currentStream_ == Video)
  ------------------
  |  Branch (1503:13): [True: 179, False: 790]
  ------------------
 1504|    179|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1504:49): [True: 179, False: 0]
  ------------------
 1505|    790|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1505:18): [True: 325, False: 465]
  ------------------
 1506|    325|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1506:49): [True: 325, False: 0]
  ------------------
 1507|    969|        break;
 1508|    901|      case TrackLayer:
  ------------------
  |  Branch (1508:7): [True: 901, False: 18.6k]
  ------------------
 1509|    901|        if (currentStream_ == Video)
  ------------------
  |  Branch (1509:13): [True: 128, False: 773]
  ------------------
 1510|    128|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1511|    773|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1511:18): [True: 325, False: 448]
  ------------------
 1512|    325|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1513|    901|        break;
 1514|    900|      case TrackVolume:
  ------------------
  |  Branch (1514:7): [True: 900, False: 18.6k]
  ------------------
 1515|    900|        if (currentStream_ == Video)
  ------------------
  |  Branch (1515:13): [True: 127, False: 773]
  ------------------
 1516|    127|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1517|    773|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1517:18): [True: 325, False: 448]
  ------------------
 1518|    325|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1519|    900|        break;
 1520|    880|      case ImageWidth:
  ------------------
  |  Branch (1520:7): [True: 880, False: 18.7k]
  ------------------
 1521|    880|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1521:13): [True: 122, False: 758]
  ------------------
 1522|    122|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1523|    122|          xmpData_["Xmp.video.Width"] = temp;
 1524|    122|          width_ = temp;
 1525|    122|        }
 1526|    880|        break;
 1527|    880|      case ImageHeight:
  ------------------
  |  Branch (1527:7): [True: 880, False: 18.7k]
  ------------------
 1528|    880|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1528:13): [True: 122, False: 758]
  ------------------
 1529|    122|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1530|    122|          xmpData_["Xmp.video.Height"] = temp;
 1531|    122|          height_ = temp;
 1532|    122|        }
 1533|    880|        break;
 1534|  11.1k|      default:
  ------------------
  |  Branch (1534:7): [True: 11.1k, False: 8.41k]
  ------------------
 1535|  11.1k|        break;
 1536|  19.5k|    }
 1537|  19.5k|  }
 1538|  1.13k|  io_->readOrThrow(buf.data(), size % 4);
 1539|  1.13k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1541|    152|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1542|    152|  DataBuf buf(5);
 1543|    152|  std::memset(buf.data(), 0x0, buf.size());
 1544|    152|  buf.data()[4] = '\0';
 1545|       |
 1546|  1.94k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1546:19): [True: 1.79k, False: 152]
  ------------------
 1547|  1.79k|    io_->readOrThrow(buf.data(), 4);
 1548|       |
 1549|  1.79k|    switch (i) {
 1550|     96|      case MovieHeaderVersion:
  ------------------
  |  Branch (1550:7): [True: 96, False: 1.69k]
  ------------------
 1551|     96|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1552|     96|        break;
 1553|     95|      case CreateDate:
  ------------------
  |  Branch (1553:7): [True: 95, False: 1.69k]
  ------------------
 1554|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1555|     95|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1556|     95|        break;
 1557|     91|      case ModifyDate:
  ------------------
  |  Branch (1557:7): [True: 91, False: 1.70k]
  ------------------
 1558|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1559|     91|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1560|     91|        break;
 1561|     90|      case TimeScale:
  ------------------
  |  Branch (1561:7): [True: 90, False: 1.70k]
  ------------------
 1562|     90|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1563|     90|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1564|     90|        break;
 1565|     89|      case Duration:
  ------------------
  |  Branch (1565:7): [True: 89, False: 1.70k]
  ------------------
 1566|     89|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1566:13): [True: 89, False: 0]
  ------------------
 1567|     89|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1568|     89|        }
 1569|     89|        break;
 1570|     89|      case PreferredRate:
  ------------------
  |  Branch (1570:7): [True: 89, False: 1.70k]
  ------------------
 1571|     89|        xmpData_["Xmp.video.PreferredRate"] =
 1572|     89|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1573|     89|        break;
 1574|     89|      case PreferredVolume:
  ------------------
  |  Branch (1574:7): [True: 89, False: 1.70k]
  ------------------
 1575|     89|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1576|     89|        break;
 1577|     51|      case PreviewTime:
  ------------------
  |  Branch (1577:7): [True: 51, False: 1.74k]
  ------------------
 1578|     51|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1579|     51|        break;
 1580|     51|      case PreviewDuration:
  ------------------
  |  Branch (1580:7): [True: 51, False: 1.74k]
  ------------------
 1581|     51|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1582|     51|        break;
 1583|     51|      case PosterTime:
  ------------------
  |  Branch (1583:7): [True: 51, False: 1.74k]
  ------------------
 1584|     51|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1585|     51|        break;
 1586|     51|      case SelectionTime:
  ------------------
  |  Branch (1586:7): [True: 51, False: 1.74k]
  ------------------
 1587|     51|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1588|     51|        break;
 1589|     51|      case SelectionDuration:
  ------------------
  |  Branch (1589:7): [True: 51, False: 1.74k]
  ------------------
 1590|     51|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1591|     51|        break;
 1592|     51|      case CurrentTime:
  ------------------
  |  Branch (1592:7): [True: 51, False: 1.74k]
  ------------------
 1593|     51|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1594|     51|        break;
 1595|     51|      case NextTrackID:
  ------------------
  |  Branch (1595:7): [True: 51, False: 1.74k]
  ------------------
 1596|     51|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1597|     51|        break;
 1598|    798|      default:
  ------------------
  |  Branch (1598:7): [True: 798, False: 996]
  ------------------
 1599|    798|        break;
 1600|  1.79k|    }
 1601|  1.79k|  }
 1602|    152|  io_->readOrThrow(buf.data(), size % 4);
 1603|    152|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEEb:
 1605|  2.41k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool /*create*/) {
 1606|  2.41k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io));
 1607|  2.41k|  if (!image->good()) {
  ------------------
  |  Branch (1607:7): [True: 6, False: 2.40k]
  ------------------
 1608|      6|    return nullptr;
 1609|      6|  }
 1610|  2.40k|  return image;
 1611|  2.41k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1613|  13.4k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1614|  13.4k|  auto buf = DataBuf(12);
 1615|  13.4k|  iIo.read(buf.data(), 12);
 1616|       |
 1617|  13.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 13.4k]
  |  Branch (1617:22): [True: 271, False: 13.1k]
  ------------------
 1618|    271|    return false;
 1619|    271|  }
 1620|  13.1k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1621|       |
 1622|  13.1k|  bool matched = false;
 1623|       |
 1624|  93.3k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1624:24): [True: 93.3k, False: 3.98k]
  ------------------
 1625|  93.3k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1626|  93.3k|    if (tmp == 0) {
  ------------------
  |  Branch (1626:9): [True: 9.15k, False: 84.1k]
  ------------------
 1627|       |      // we only match if we actually know the video type. This is done
 1628|       |      // to avoid matching just on ftyp because bmffimage also has that
 1629|       |      // header.
 1630|  9.15k|      if (Exiv2::find(qTimeFileType, std::string{buf.c_str(8), 4})) {
  ------------------
  |  Branch (1630:11): [True: 7.23k, False: 1.92k]
  ------------------
 1631|  7.23k|        matched = true;
 1632|  7.23k|      }
 1633|  9.15k|      break;
 1634|  9.15k|    }
 1635|  93.3k|  }
 1636|       |
 1637|  13.1k|  if (!advance || !matched) {
  ------------------
  |  Branch (1637:7): [True: 13.1k, False: 0]
  |  Branch (1637:19): [True: 0, False: 0]
  ------------------
 1638|  13.1k|    iIo.seek(0L, BasicIo::beg);
 1639|  13.1k|  }
 1640|       |
 1641|  13.1k|  return matched;
 1642|  13.4k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   123k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   123k|  const char ignoreList[13][5] = {
  505|   123k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   123k|  };
  507|       |
  508|   123k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.50M, False: 111k]
  ------------------
  509|  1.50M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 12.0k, False: 1.49M]
  ------------------
  510|  12.0k|      return true;
  511|       |
  512|   111k|  return false;
  513|   123k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  57.2k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  57.2k|  const char ignoreList[8][5] = {
  524|  57.2k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  57.2k|  };
  526|       |
  527|  57.2k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 441k, False: 50.1k]
  ------------------
  528|   441k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 7.14k, False: 434k]
  ------------------
  529|  7.14k|      return true;
  530|       |
  531|  50.1k|  return false;
  532|  57.2k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.53M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.53M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.53M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.53M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.92M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  627|  3.58k|static std::string readString(BasicIo& io, size_t size) {
  628|  3.58k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  629|  3.58k|  Exiv2::DataBuf str(size + 1);
  630|  3.58k|  io.readOrThrow(str.data(), size);
  631|  3.58k|  str.write_uint8(size, 0);  // nul-terminate string
  632|  3.58k|  return Exiv2::toString(str.data());
  633|  3.58k|}

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

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

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  19.2k|  static constexpr auto tagList() {
   30|  19.2k|    return tagInfo_;
   31|  19.2k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    809|  static constexpr auto tagListCs() {
   34|    809|    return tagInfoCs_;
   35|    809|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    609|  static constexpr auto tagListCs2() {
   38|    609|    return tagInfoCs2_;
   39|    609|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  84.6k|  static constexpr auto tagListFp() {
   42|  84.6k|    return tagInfoFp_;
   43|  84.6k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  1.33k|  static constexpr auto tagListSonyMisc1() {
   46|  1.33k|    return tagInfoSonyMisc1_;
   47|  1.33k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|    248|  static constexpr auto tagListSonyMisc2b() {
   50|    248|    return tagInfoSonyMisc2b_;
   51|    248|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  4.48k|  static constexpr auto tagListSonyMisc3c() {
   54|  4.48k|    return tagInfoSonyMisc3c_;
   55|  4.48k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   414k|  static constexpr auto tagListSonySInfo1() {
   58|   414k|    return tagInfoSonySInfo1_;
   59|   414k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.23M|const TagInfo* ifdTagList() {
 1779|  1.23M|  return ifdTagInfo;
 1780|  1.23M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   214k|const TagInfo* exifTagList() {
 2217|   214k|  return exifTagInfo;
 2218|   214k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   107k|const TagInfo* gpsTagList() {
 2433|   107k|  return gpsTagInfo;
 2434|   107k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  49.4k|const TagInfo* iopTagList() {
 2508|  49.4k|  return iopTagInfo;
 2509|  49.4k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  12.2k|const TagInfo* mnTagList() {
 2524|  12.2k|  return mnTagInfo;
 2525|  12.2k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|   825k|bool isMakerIfd(IfdId ifdId) {
 2528|   825k|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 825k, False: 0]
  ------------------
 2529|   825k|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|   825k|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  2.01M|bool isExifIfd(IfdId ifdId) {
 2534|  2.01M|  switch (ifdId) {
 2535|   317k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 317k, False: 1.69M]
  ------------------
 2536|   429k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 112k, False: 1.89M]
  ------------------
 2537|   490k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 60.2k, False: 1.95M]
  ------------------
 2538|   537k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 46.9k, False: 1.96M]
  ------------------
 2539|   578k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 41.8k, False: 1.97M]
  ------------------
 2540|   590k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 12.1k, False: 1.99M]
  ------------------
 2541|   591k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 566, False: 2.01M]
  ------------------
 2542|   591k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 2.01M]
  ------------------
 2543|   775k|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 183k, False: 1.82M]
  ------------------
 2544|   888k|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 113k, False: 1.89M]
  ------------------
 2545|   978k|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 89.4k, False: 1.92M]
  ------------------
 2546|  1.03M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 57.8k, False: 1.95M]
  ------------------
 2547|  1.04M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 12.2k, False: 1.99M]
  ------------------
 2548|  1.05M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 7.40k, False: 2.00M]
  ------------------
 2549|  1.06M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 10.6k, False: 2.00M]
  ------------------
 2550|  1.06M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 3.14k, False: 2.00M]
  ------------------
 2551|  1.07M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 5.83k, False: 2.00M]
  ------------------
 2552|  1.08M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 14.3k, False: 1.99M]
  ------------------
 2553|  1.18M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 96.7k, False: 1.91M]
  ------------------
 2554|  1.18M|      return true;
 2555|   825k|    default:
  ------------------
  |  Branch (2555:5): [True: 825k, False: 1.18M]
  ------------------
 2556|   825k|      return false;
 2557|  2.01M|  }
 2558|  2.01M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  2.66M|const TagInfo* tagList(IfdId ifdId) {
 2569|  2.66M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 2.66M, False: 0]
  ------------------
 2570|  2.66M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 2.66M, False: 0]
  ------------------
 2571|  2.66M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  2.66M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  2.01M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  2.01M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 2.01M, False: 0]
  ------------------
 2577|  2.01M|    int idx = 0;
 2578|   154M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 153M, False: 1.18M]
  ------------------
 2579|   153M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 831k, False: 152M]
  ------------------
 2580|   831k|        break;
 2581|   153M|    }
 2582|  2.01M|    return ti + idx;
 2583|  2.01M|  }
 2584|      0|  return nullptr;
 2585|  2.01M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   652k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   652k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 652k]
  ------------------
 2589|      0|    return nullptr;
 2590|   652k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 652k, False: 0]
  ------------------
 2591|  37.1M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 37.1M, False: 49.8k]
  ------------------
 2592|  37.1M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 602k, False: 36.5M]
  ------------------
 2593|   602k|        return ti + idx;
 2594|   602k|      }
 2595|  37.1M|    }
 2596|   652k|  }
 2597|  49.8k|  return nullptr;
 2598|   652k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  3.89M|IfdId groupId(const std::string& groupName) {
 2601|  3.89M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 3.89M, False: 0]
  ------------------
 2602|  3.89M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  3.89M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  1.34M|const char* groupName(IfdId ifdId) {
 2613|  1.34M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 1.34M, False: 0]
  ------------------
 2614|  1.34M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  1.34M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    171|float fnumber(float apertureValue) {
 2648|    171|  float result = std::exp2(apertureValue / 2.F);
 2649|    171|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 3, False: 168]
  ------------------
 2650|      3|    result = 3.5F;
 2651|      3|  }
 2652|    171|  return result;
 2653|    171|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    171|URational exposureTime(float shutterSpeedValue) {
 2656|    171|  URational ur(1, 1);
 2657|    171|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    171|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 75, False: 96]
  ------------------
 2659|     75|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|     75|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 38, False: 37]
  ------------------
 2662|     38|      ur.second = static_cast<uint32_t>(x);
 2663|     38|    }
 2664|     96|  } else {
 2665|     96|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|     96|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 96, False: 0]
  |  Branch (2667:19): [True: 96, False: 0]
  ------------------
 2668|     96|      ur.first = static_cast<uint32_t>(x);
 2669|     96|    }
 2670|     96|  }
 2671|    171|  return ur;
 2672|    171|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   652k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   652k|  auto ti = tagInfo(tagName, ifdId);
 2676|   652k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 602k, False: 49.8k]
  |  Branch (2676:13): [True: 602k, False: 0]
  ------------------
 2677|   602k|    return ti->tag_;
 2678|  49.8k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 49.8k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  49.8k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  49.8k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  6.60k|const TagInfo* tagList(const std::string& groupName) {
 3295|  6.60k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  6.60k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 6.60k]
  |  Branch (3296:14): [True: 0, False: 6.60k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  6.60k|  return ii->tagList_();
 3300|  6.60k|}

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

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

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

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  7.58M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  7.58M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  32.8M|  [[nodiscard]] uint16_t tag() const {
   82|  32.8M|    return static_cast<uint16_t>(extendedTag_);
   83|  32.8M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  7.49M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  7.49M|    return extendedTag_;
   87|  7.49M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  8.22M|  [[nodiscard]] IfdId group() const {
   90|  8.22M|    return group_;
   91|  8.22M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  4.89M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  4.89M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  2.98M|  void setStart(const byte* pStart) {
  217|  2.98M|    pStart_ = const_cast<byte*>(pStart);
  218|  2.98M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   157M|  [[nodiscard]] uint16_t tag() const {
  241|   157M|    return tag_;
  242|   157M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  20.1M|  [[nodiscard]] IfdId group() const {
  245|  20.1M|    return group_;
  246|  20.1M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  3.07M|  [[nodiscard]] byte* start() const {
  249|  3.07M|    return pStart_;
  250|  3.07M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  2.08M|  void setOffset(size_t offset) {
  417|  2.08M|    offset_ = offset;
  418|  2.08M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.00M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.00M|    return tiffType_;
  460|  1.00M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  64.7k|  [[nodiscard]] size_t offset() const {
  466|  64.7k|    return offset_;
  467|  64.7k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  2.28M|  [[nodiscard]] const byte* pData() const {
  477|  2.28M|    return pData_;
  478|  2.28M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  16.8M|  [[nodiscard]] const Value* pValue() const {
  481|  16.8M|    return pValue_.get();
  482|  16.8M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|   991k|  void setCount(size_t count) {
  498|   991k|    count_ = count;
  499|   991k|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  2.01M|  void setIdx(int idx) {
  502|  2.01M|    idx_ = idx;
  503|  2.01M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  1.10M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  1.10M|    return storage_;
  542|  1.10M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  41.0k|  [[nodiscard]] uint16_t szTag() const {
  624|  41.0k|    return szTag_;
  625|  41.0k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  41.0k|  [[nodiscard]] IfdId szGroup() const {
  628|  41.0k|    return szGroup_;
  629|  41.0k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  44.1k|  [[nodiscard]] uint16_t dtTag() const {
  790|  44.1k|    return dtTag_;
  791|  44.1k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  44.1k|  [[nodiscard]] IfdId dtGroup() const {
  794|  44.1k|    return dtGroup_;
  795|  44.1k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  17.8k|  [[nodiscard]] bool hasNext() const {
  843|  17.8k|    return hasNext_;
  844|  17.8k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  11.0k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  11.0k|    imageByteOrder_ = byteOrder;
 1108|  11.0k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  4.86M|  bool operator==(size_t idx) const {
 1218|  4.86M|    return idx_ == idx;
 1219|  4.86M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  2.27M|  [[nodiscard]] size_t tagStep() const {
 1235|  2.27M|    return elDefaultDef_.size(0, group_);
 1236|  2.27M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  2.08M|  void setDecoded(bool decoded) {
 1311|  2.08M|    decoded_ = decoded;
 1312|  2.08M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  6.89M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  6.89M|    return arrayCfg_;
 1320|  6.89M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   115k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   115k|    return arrayDef_;
 1324|   115k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  58.8k|  [[nodiscard]] size_t defSize() const {
 1327|  58.8k|    return defSize_;
 1328|  58.8k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   185k|  [[nodiscard]] bool decoded() const {
 1331|   185k|    return decoded_;
 1332|   185k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  1.10M|  void setElDef(const ArrayDef& def) {
 1405|  1.10M|    elDef_ = def;
 1406|  1.10M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  1.10M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  1.10M|    elByteOrder_ = byteOrder;
 1412|  1.10M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  1.12M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  1.12M|    return &elDef_;
 1422|  1.12M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  1.13M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  1.13M|    return elByteOrder_;
 1428|  1.13M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  21.1k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  21.1k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  21.1k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|      7|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|      7|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|      7|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     78|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     78|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     78|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     13|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     13|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     13|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    174|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    174|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    174|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|      8|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|      8|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|      8|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  7.58k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  7.58k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  7.58k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.01k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.01k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.01k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.09k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.09k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.09k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.11k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.11k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.11k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    485|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    485|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    485|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.16k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.16k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.16k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  7.35k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  7.35k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  7.35k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.62k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.62k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.62k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.68k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.68k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.68k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  3.76k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  3.76k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  3.76k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    864|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    864|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    864|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    718|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    718|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    718|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    164|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    164|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    164|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    441|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    441|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    441|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.16k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.16k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.16k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  6.26k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  6.26k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  6.26k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    758|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    758|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    758|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    846|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    846|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    846|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    282|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    282|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    282|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    760|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    760|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    760|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.68k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.68k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.68k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.98k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.98k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.98k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    672|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    672|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    672|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    842|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    842|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    842|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    171|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    171|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    171|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    976|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    976|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    976|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.93k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.93k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.93k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.40k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.40k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.40k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    398|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    398|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    398|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    458|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    458|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    458|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    211|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    211|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    211|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    586|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    586|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    586|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.91k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.91k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.91k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.52k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.52k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.52k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    194|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    194|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    194|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    221|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    221|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    221|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    248|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    248|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    248|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    319|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    319|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    319|}
_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.28k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.28k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.28k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     63|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     63|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     63|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    217|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    217|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    217|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    249|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    249|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    249|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    203|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    203|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    203|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.58k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.58k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.58k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     31|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     31|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     31|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    246|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    246|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    246|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    225|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    225|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    225|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    501|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    501|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    501|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.90k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.90k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.90k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.85k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.85k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.85k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__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_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    258|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    258|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    258|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    190|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    190|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    190|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    431|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    431|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    431|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    418|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    418|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    418|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    503|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    503|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    503|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    220|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    220|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    220|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    140|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    140|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    140|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    221|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    221|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    221|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    235|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    235|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    235|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    190|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    190|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    190|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    701|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    701|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    701|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    306|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    306|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    306|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    240|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    240|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    240|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    179|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    179|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    179|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     86|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     86|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     86|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    144|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    144|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    144|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.02k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.02k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.02k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  11.8k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  11.8k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  11.8k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  7.45k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  7.45k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  7.45k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    384|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    384|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    384|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    188|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    188|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    188|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    212|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    212|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    212|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     52|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     52|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     52|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     75|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     75|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     75|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    249|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    249|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    249|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    135|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    135|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    135|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     92|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     92|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     92|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    223|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    223|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    223|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    238|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    238|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    238|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    118|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    118|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    118|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    163|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    163|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    163|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    210|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    210|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    210|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     15|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     15|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     15|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    108|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    108|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    108|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    300|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    300|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    300|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  6.23k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  6.23k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  6.23k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.39k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.39k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.39k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    173|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    173|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    173|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.52k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.52k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.52k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    114|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    114|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    114|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     86|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     86|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     86|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    177|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    177|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    177|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    274|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    274|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    274|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__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_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    174|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    174|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    174|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    314|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    314|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    314|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    160|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    160|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    160|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.37k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.37k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.37k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    750|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    750|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    750|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    477|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    477|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    477|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.33k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.33k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.33k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.34k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.34k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.34k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.01k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.01k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.01k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.14k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.14k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.14k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    337|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    337|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    337|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    778|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    778|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    778|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    778|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    911|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    911|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    911|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    172|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    172|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    172|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    294|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    294|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    294|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     60|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     60|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     60|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    129|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    129|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    129|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     43|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     43|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     43|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     43|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     85|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     85|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     85|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    183|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    183|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    183|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     92|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     92|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     92|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     35|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     35|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     35|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     35|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    127|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    127|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    127|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     59|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     59|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     59|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     14|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     14|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     14|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     23|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     23|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     23|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     76|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     76|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     76|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     60|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     60|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     60|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    277|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    277|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    277|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     86|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     86|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     86|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     86|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    100|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    100|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    100|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    100|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     87|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     87|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     87|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     87|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    103|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    103|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    103|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    103|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    272|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    272|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    272|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    272|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    349|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    349|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    349|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    349|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    226|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    226|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    226|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    226|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    397|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    397|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    397|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    397|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    215|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    215|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    215|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    215|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     48|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     48|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     48|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     48|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|     81|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|     81|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|     81|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|     81|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     86|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     86|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     86|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     86|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     61|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     61|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     61|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     61|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    168|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    168|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    168|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    317|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    317|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    317|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    576|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    576|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    576|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    518|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    518|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    518|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     61|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     61|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     61|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.17k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.17k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.17k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  3.62k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  3.62k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  3.62k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  3.62k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    224|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    224|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    224|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    163|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    163|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    163|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    609|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    609|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    609|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    158|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    158|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    158|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    158|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    506|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    506|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    506|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    506|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    276|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    276|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    276|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    276|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    601|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    601|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    601|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    601|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    103|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    103|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    103|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    103|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.12k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.12k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.12k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.12k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    204|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    204|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    204|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    204|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|     66|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|     66|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|     66|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    195|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    195|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    195|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    195|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    102|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     51|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     51|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     51|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    144|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    144|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    144|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    144|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     84|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     84|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     84|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|      9|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|      9|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|      9|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    110|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    110|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    110|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    110|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.33k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.33k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.33k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.33k|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    323|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    323|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    323|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     66|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     66|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     66|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     68|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     68|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     68|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     68|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  4.67k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  4.67k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  4.67k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  4.92M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|  97.1k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  32.9k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  21.5k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  9.01M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  9.01M|  return ifdId_ == md.ifdId();
   31|  9.01M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.28M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.28M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.28M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 5.22k, False: 1.27M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  5.22k|    decoderFct = td->decoderFct_;
 1996|  5.22k|  }
 1997|  1.28M|  return decoderFct;
 1998|  1.28M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  1.87M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  1.87M|  EncoderFct encoderFct = nullptr;
 2002|  1.87M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 4.44k, False: 1.87M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  4.44k|    encoderFct = td->encoderFct_;
 2005|  4.44k|  }
 2006|  1.87M|  return encoderFct;
 2007|  1.87M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  4.89M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  4.89M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  4.89M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  4.89M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 4.66M, False: 234k]
  ------------------
 2014|  4.66M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  4.66M|  }
 2016|  4.89M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 4.82M, False: 69.0k]
  |  Branch (2016:7): [True: 4.81M, False: 79.6k]
  |  Branch (2016:37): [True: 4.81M, False: 10.6k]
  ------------------
 2017|  4.81M|    return i->second(tag, group);
 2018|  4.81M|  }
 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|  79.6k|  return nullptr;
 2028|  4.89M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  1.88M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  1.88M|  TiffPath ret;
 2032|  7.58M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 7.58M, Folded]
  ------------------
 2033|  7.58M|    ret.emplace(extendedTag, group);
 2034|  7.58M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  7.58M|    assert(ts != tiffTreeTable_.end());
 2036|  7.58M|    extendedTag = ts->second.second;
 2037|  7.58M|    group = ts->second.first;
 2038|  7.58M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 1.88M, False: 5.70M]
  ------------------
 2039|  1.88M|      break;
 2040|  1.88M|    }
 2041|  7.58M|  }
 2042|  1.88M|  return ret;
 2043|  1.88M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseE:
 2046|  12.2k|                                   size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase* pHeader) {
 2047|       |  // Create standard TIFF header if necessary
 2048|  12.2k|  std::unique_ptr<TiffHeaderBase> ph;
 2049|  12.2k|  if (!pHeader) {
  ------------------
  |  Branch (2049:7): [True: 7.31k, False: 4.98k]
  ------------------
 2050|  7.31k|    ph = std::make_unique<TiffHeader>();
 2051|  7.31k|    pHeader = ph.get();
 2052|  7.31k|  }
 2053|       |
 2054|  12.2k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2054:12): [True: 11.8k, False: 430]
  ------------------
 2055|  11.8k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct);
 2056|  11.8k|    rootDir->accept(decoder);
 2057|  11.8k|  }
 2058|  12.2k|  return pHeader->byteOrder();
 2059|       |
 2060|  12.2k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2065|  10.6k|                                     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|  10.6k|  WriteMethod writeMethod = wmIntrusive;
 2074|  10.6k|  auto parsedTree = parse(pData, size, root, pHeader);
 2075|  10.6k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2076|  10.6k|  if (parsedTree) {
  ------------------
  |  Branch (2076:7): [True: 4.15k, False: 6.51k]
  ------------------
 2077|       |    // Attempt to update existing TIFF components based on metadata entries
 2078|  4.15k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2079|  4.15k|    parsedTree->accept(encoder);
 2080|  4.15k|    if (!encoder.dirty())
  ------------------
  |  Branch (2080:9): [True: 623, False: 3.52k]
  ------------------
 2081|    623|      writeMethod = wmNonIntrusive;
 2082|  4.15k|  }
 2083|  10.6k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2083:7): [True: 10.0k, False: 628]
  ------------------
 2084|  10.0k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2085|  10.0k|    if (parsedTree) {
  ------------------
  |  Branch (2085:9): [True: 3.52k, False: 6.50k]
  ------------------
 2086|       |      // Copy image tags from the original image to the composite
 2087|  3.52k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2088|  3.52k|      parsedTree->accept(copier);
 2089|  3.52k|    }
 2090|       |    // Add entries from metadata to composite
 2091|  10.0k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2092|  10.0k|                        findEncoderFct);
 2093|  10.0k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2094|       |    // Write binary representation from the composite tree
 2095|  10.0k|    DataBuf header = pHeader->write();
 2096|  10.0k|    auto tempIo = MemIo();
 2097|  10.0k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2098|  10.0k|    auto imageIdx(std::string::npos);
 2099|  10.0k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2100|  10.0k|    if (pOffsetWriter)
  ------------------
  |  Branch (2100:9): [True: 85, False: 9.94k]
  ------------------
 2101|     85|      pOffsetWriter->writeOffsets(tempIo);
 2102|  10.0k|    io.transfer(tempIo);  // may throw
 2103|  10.0k|#ifndef SUPPRESS_WARNINGS
 2104|  10.0k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  10.0k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 10.0k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  10.0k|  LogMsg(LogMsg::info).os()
  ------------------
 2105|  10.0k|#endif
 2106|  10.0k|  }
 2107|    628|#ifndef SUPPRESS_WARNINGS
 2108|    628|  else {
 2109|    628|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    628|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 628]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    628|  LogMsg(LogMsg::info).os()
  ------------------
 2110|    628|  }
 2111|  10.6k|#endif
 2112|  10.6k|  return writeMethod;
 2113|  10.6k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2116|  22.9k|                                                 TiffHeaderBase* pHeader) {
 2117|  22.9k|  TiffComponent::UniquePtr rootDir;
 2118|  22.9k|  if (!pData || size == 0)
  ------------------
  |  Branch (2118:7): [True: 6.74k, False: 16.2k]
  |  Branch (2118:17): [True: 0, False: 16.2k]
  ------------------
 2119|  6.74k|    return rootDir;
 2120|  16.2k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2120:7): [True: 62, False: 16.1k]
  |  Branch (2120:38): [True: 130, False: 16.0k]
  ------------------
 2121|    192|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2122|    192|  }
 2123|  16.0k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2124|  16.0k|  if (rootDir) {
  ------------------
  |  Branch (2124:7): [True: 16.0k, False: 0]
  ------------------
 2125|  16.0k|    rootDir->setStart(pData + pHeader->offset());
 2126|  16.0k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2127|  16.0k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2128|  16.0k|    rootDir->accept(reader);
 2129|  16.0k|    reader.postProcess();
 2130|  16.0k|  }
 2131|  16.0k|  return rootDir;
 2132|       |
 2133|  16.2k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2135|  10.6k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2136|  10.6k|  PrimaryGroups ret;
 2137|  10.6k|  if (!pSourceDir)
  ------------------
  |  Branch (2137:7): [True: 6.50k, False: 4.15k]
  ------------------
 2138|  6.50k|    return ret;
 2139|       |
 2140|  4.15k|  static constexpr auto imageGroups = std::array{
 2141|  4.15k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2142|  4.15k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2143|  4.15k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2144|  4.15k|  };
 2145|       |
 2146|  53.9k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2146:24): [True: 53.9k, False: 4.15k]
  ------------------
 2147|  53.9k|    TiffFinder finder(0x00fe, imageGroup);
 2148|  53.9k|    pSourceDir->accept(finder);
 2149|  53.9k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2150|  53.9k|    if (!te)
  ------------------
  |  Branch (2150:9): [True: 53.1k, False: 830]
  ------------------
 2151|  53.1k|      continue;
 2152|    830|    const Value* pV = te->pValue();
 2153|    830|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2153:9): [True: 733, False: 97]
  |  Branch (2153:15): [True: 642, False: 91]
  |  Branch (2153:47): [True: 619, False: 23]
  |  Branch (2153:67): [True: 509, False: 110]
  ------------------
 2154|    509|      ret.push_back(te->group());
 2155|    509|    }
 2156|    830|  }
 2157|  4.15k|  return ret;
 2158|  10.6k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2161|   258k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2162|   258k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2164|   208k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2165|   208k|  if (!pData || size < 8)
  ------------------
  |  Branch (2165:7): [True: 0, False: 208k]
  |  Branch (2165:17): [True: 24, False: 208k]
  ------------------
 2166|     24|    return false;
 2167|       |
 2168|   208k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2168:7): [True: 5.04k, False: 203k]
  |  Branch (2168:26): [True: 4.74k, False: 307]
  ------------------
 2169|  4.74k|    byteOrder_ = littleEndian;
 2170|   203k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2170:14): [True: 75.0k, False: 128k]
  |  Branch (2170:33): [True: 74.8k, False: 204]
  ------------------
 2171|  74.8k|    byteOrder_ = bigEndian;
 2172|   129k|  } else {
 2173|   129k|    return false;
 2174|   129k|  }
 2175|  79.5k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2176|  79.5k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2176:7): [True: 79.5k, False: 15]
  |  Branch (2176:19): [True: 79.5k, False: 36]
  |  Branch (2176:33): [True: 24.9k, False: 54.5k]
  ------------------
 2177|  24.9k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2178|  54.6k|  tag_ = t;
 2179|  54.6k|  offset_ = getULong(pData + 4, byteOrder_);
 2180|       |
 2181|  54.6k|  return true;
 2182|  79.5k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2184|  10.1k|DataBuf TiffHeaderBase::write() const {
 2185|  10.1k|  DataBuf buf(8);
 2186|  10.1k|  switch (byteOrder_) {
  ------------------
  |  Branch (2186:11): [True: 10.1k, False: 0]
  ------------------
 2187|  7.02k|    case littleEndian:
  ------------------
  |  Branch (2187:5): [True: 7.02k, False: 3.12k]
  ------------------
 2188|  7.02k|      buf.write_uint8(0, 'I');
 2189|  7.02k|      break;
 2190|  3.12k|    case bigEndian:
  ------------------
  |  Branch (2190:5): [True: 3.12k, False: 7.02k]
  ------------------
 2191|  3.12k|      buf.write_uint8(0, 'M');
 2192|  3.12k|      break;
 2193|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2193:5): [True: 0, False: 10.1k]
  ------------------
 2194|      0|      break;
 2195|  10.1k|  }
 2196|  10.1k|  buf.write_uint8(1, buf.read_uint8(0));
 2197|  10.1k|  buf.write_uint16(2, tag_, byteOrder_);
 2198|  10.1k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2199|  10.1k|  return buf;
 2200|  10.1k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2218|  73.4k|ByteOrder TiffHeaderBase::byteOrder() const {
 2219|  73.4k|  return byteOrder_;
 2220|  73.4k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2222|  12.2k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2223|  12.2k|  byteOrder_ = byteOrder;
 2224|  12.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2226|  32.8k|uint32_t TiffHeaderBase::offset() const {
 2227|  32.8k|  return offset_;
 2228|  32.8k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2230|  6.68k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2231|  6.68k|  offset_ = offset;
 2232|  6.68k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2238|  13.0k|uint16_t TiffHeaderBase::tag() const {
 2239|  13.0k|  return tag_;
 2240|  13.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2242|  1.02k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2243|  1.02k|  return false;
 2244|  1.02k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2324|  2.29M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2325|  2.29M|  const bool result = isTiffImageTagLookup(tag, group);
 2326|       |#ifdef EXIV2_DEBUG_MESSAGES
 2327|       |  if (result) {
 2328|       |    ExifKey key(tag, groupName(group));
 2329|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2330|       |  } else {
 2331|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2332|       |  }
 2333|       |#endif
 2334|  2.29M|  return result;
 2335|  2.29M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2338|   178k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2339|   178k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2341|  2.24M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2342|  2.24M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2342:7): [True: 42.7k, False: 2.20M]
  ------------------
 2343|       |#ifdef EXIV2_DEBUG_MESSAGES
 2344|       |    std::cerr << "No image tags in this image\n";
 2345|       |#endif
 2346|  42.7k|    return false;
 2347|  42.7k|  }
 2348|       |#ifdef EXIV2_DEBUG_MESSAGES
 2349|       |  ExifKey key(tag, groupName(group));
 2350|       |#endif
 2351|       |  // If there are primary groups and none matches group, we're done
 2352|  2.20M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2352:7): [True: 35.8k, False: 2.16M]
  |  Branch (2352:7): [True: 11.7k, False: 2.19M]
  ------------------
 2353|  35.8k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2353:7): [True: 11.7k, False: 24.0k]
  ------------------
 2354|       |#ifdef EXIV2_DEBUG_MESSAGES
 2355|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2356|       |#endif
 2357|  11.7k|    return false;
 2358|  11.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|  2.19M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2361:7): [True: 24.0k, False: 2.16M]
  |  Branch (2361:34): [True: 23.4k, False: 623]
  ------------------
 2362|       |#ifdef EXIV2_DEBUG_MESSAGES
 2363|       |    ExifKey key(tag, groupName(group));
 2364|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2365|       |#endif
 2366|  23.4k|    return true;
 2367|  23.4k|  }
 2368|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2369|  2.16M|  return isTiffImageTag(tag, group);
 2370|  2.19M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2372|    111|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2373|    111|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2374|    111|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2376|     11|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2377|     11|  auto it = offsetList_.find(id);
 2378|     11|  if (it != offsetList_.end())
  ------------------
  |  Branch (2378:7): [True: 11, False: 0]
  ------------------
 2379|     11|    it->second.target_ = target;
 2380|     11|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2382|     85|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2383|     85|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2383:29): [True: 85, False: 85]
  ------------------
 2384|     85|    io.seek(off.origin_, BasicIo::beg);
 2385|     85|    byte buf[4] = {0, 0, 0, 0};
 2386|     85|    l2Data(buf, off.target_, off.byteOrder_);
 2387|     85|    io.write(buf, 4);
 2388|     85|  }
 2389|     85|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2246|  2.29M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2247|  2.29M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2247:7): [True: 2.00M, False: 288k]
  ------------------
 2248|  2.00M|    return false;
 2249|  2.00M|  }
 2250|       |  //! List of TIFF image tags
 2251|   288k|  switch (tag) {
 2252|    636|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2252:5): [True: 636, False: 288k]
  ------------------
 2253|  1.37k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2253:5): [True: 743, False: 288k]
  ------------------
 2254|  7.55k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2254:5): [True: 6.17k, False: 282k]
  ------------------
 2255|  12.8k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2255:5): [True: 5.29k, False: 283k]
  ------------------
 2256|  15.6k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2256:5): [True: 2.81k, False: 286k]
  ------------------
 2257|  16.0k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2257:5): [True: 411, False: 288k]
  ------------------
 2258|  16.4k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2258:5): [True: 371, False: 288k]
  ------------------
 2259|  16.7k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2259:5): [True: 300, False: 288k]
  ------------------
 2260|  18.7k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2260:5): [True: 2.00k, False: 286k]
  ------------------
 2261|  19.0k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2261:5): [True: 292, False: 288k]
  ------------------
 2262|  19.3k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2262:5): [True: 347, False: 288k]
  ------------------
 2263|  21.2k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2263:5): [True: 1.89k, False: 286k]
  ------------------
 2264|  21.6k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2264:5): [True: 337, False: 288k]
  ------------------
 2265|  22.0k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2265:5): [True: 436, False: 288k]
  ------------------
 2266|  22.2k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2266:5): [True: 173, False: 288k]
  ------------------
 2267|  22.2k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2267:5): [True: 64, False: 288k]
  ------------------
 2268|  22.3k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2268:5): [True: 64, False: 288k]
  ------------------
 2269|  22.4k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2269:5): [True: 116, False: 288k]
  ------------------
 2270|  22.6k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2270:5): [True: 158, False: 288k]
  ------------------
 2271|  22.8k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2271:5): [True: 244, False: 288k]
  ------------------
 2272|  23.1k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2272:5): [True: 316, False: 288k]
  ------------------
 2273|  23.2k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2273:5): [True: 45, False: 288k]
  ------------------
 2274|  23.3k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2274:5): [True: 78, False: 288k]
  ------------------
 2275|  23.4k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2275:5): [True: 146, False: 288k]
  ------------------
 2276|  23.7k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2276:5): [True: 309, False: 288k]
  ------------------
 2277|  24.1k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2277:5): [True: 376, False: 288k]
  ------------------
 2278|  24.2k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2278:5): [True: 114, False: 288k]
  ------------------
 2279|  24.3k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2279:5): [True: 55, False: 288k]
  ------------------
 2280|  24.3k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2280:5): [True: 65, False: 288k]
  ------------------
 2281|  24.6k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2281:5): [True: 263, False: 288k]
  ------------------
 2282|  25.4k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2282:5): [True: 822, False: 288k]
  ------------------
 2283|  25.4k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2283:5): [True: 3, False: 288k]
  ------------------
 2284|  25.6k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2284:5): [True: 189, False: 288k]
  ------------------
 2285|  25.6k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2285:5): [True: 21, False: 288k]
  ------------------
 2286|  25.7k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2286:5): [True: 70, False: 288k]
  ------------------
 2287|  25.8k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2287:5): [True: 59, False: 288k]
  ------------------
 2288|  25.8k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2288:5): [True: 51, False: 288k]
  ------------------
 2289|  26.0k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2289:5): [True: 222, False: 288k]
  ------------------
 2290|  26.1k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2290:5): [True: 27, False: 288k]
  ------------------
 2291|  26.1k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2291:5): [True: 58, False: 288k]
  ------------------
 2292|  26.3k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2292:5): [True: 170, False: 288k]
  ------------------
 2293|  26.4k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2293:5): [True: 103, False: 288k]
  ------------------
 2294|  26.6k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2294:5): [True: 177, False: 288k]
  ------------------
 2295|  26.7k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 127, False: 288k]
  ------------------
 2296|  26.8k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2296:5): [True: 70, False: 288k]
  ------------------
 2297|  26.8k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2297:5): [True: 30, False: 288k]
  ------------------
 2298|  27.7k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2298:5): [True: 949, False: 287k]
  ------------------
 2299|  33.6k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2299:5): [True: 5.86k, False: 282k]
  ------------------
 2300|  38.8k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2300:5): [True: 5.20k, False: 283k]
  ------------------
 2301|  39.1k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2301:5): [True: 257, False: 288k]
  ------------------
 2302|  39.1k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2302:5): [True: 30, False: 288k]
  ------------------
 2303|  39.1k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2303:5): [True: 38, False: 288k]
  ------------------
 2304|  39.2k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2304:5): [True: 64, False: 288k]
  ------------------
 2305|  39.3k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2305:5): [True: 142, False: 288k]
  ------------------
 2306|  39.4k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2306:5): [True: 106, False: 288k]
  ------------------
 2307|  39.8k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2307:5): [True: 394, False: 288k]
  ------------------
 2308|  39.9k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2308:5): [True: 76, False: 288k]
  ------------------
 2309|  40.0k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2309:5): [True: 74, False: 288k]
  ------------------
 2310|  40.2k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2310:5): [True: 172, False: 288k]
  ------------------
 2311|  40.2k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2311:5): [True: 15, False: 288k]
  ------------------
 2312|  40.2k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2312:5): [True: 65, False: 288k]
  ------------------
 2313|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2314|  40.3k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2314:5): [True: 53, False: 288k]
  ------------------
 2315|  40.4k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2315:5): [True: 70, False: 288k]
  ------------------
 2316|  40.5k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2316:5): [True: 106, False: 288k]
  ------------------
 2317|  40.6k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2317:5): [True: 171, False: 288k]
  ------------------
 2318|  40.6k|      return true;
 2319|   248k|    default:
  ------------------
  |  Branch (2319:5): [True: 248k, False: 40.6k]
  ------------------
 2320|   248k|      return false;
 2321|   288k|  }
 2322|   288k|}

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

_ZN5Exiv28Internal11TiffVisitor5setGoENS1_7GoEventEb:
   61|   733k|void TiffVisitor::setGo(GoEvent event, bool go) {
   62|   733k|  go_[event] = go;
   63|   733k|}
_ZNK5Exiv28Internal11TiffVisitor2goENS1_7GoEventE:
   65|  67.6M|bool TiffVisitor::go(GoEvent event) const {
   66|  67.6M|  return go_[event];
   67|  67.6M|}
_ZN5Exiv28Internal11TiffVisitor18visitDirectoryNextEPNS0_13TiffDirectoryE:
   69|   801k|void TiffVisitor::visitDirectoryNext(TiffDirectory* /*object*/) {
   70|   801k|}
_ZN5Exiv28Internal11TiffVisitor17visitDirectoryEndEPNS0_13TiffDirectoryE:
   72|   791k|void TiffVisitor::visitDirectoryEnd(TiffDirectory* /*object*/) {
   73|   791k|}
_ZN5Exiv28Internal11TiffVisitor20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
   75|  36.9k|void TiffVisitor::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
   76|  36.9k|}
_ZN5Exiv28Internal11TiffVisitor19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
   78|   105k|void TiffVisitor::visitBinaryArrayEnd(TiffBinaryArray* /*object*/) {
   79|   105k|}
_ZN5Exiv28Internal10TiffFinder4initEtNS_5IfdIdE:
   81|    266|void TiffFinder::init(uint16_t tag, IfdId group) {
   82|    266|  tag_ = tag;
   83|    266|  group_ = group;
   84|    266|  tiffComponent_ = nullptr;
   85|    266|  setGo(geTraverse, true);
   86|    266|}
_ZN5Exiv28Internal10TiffFinder10findObjectEPNS0_13TiffComponentE:
   88|  26.6M|void TiffFinder::findObject(TiffComponent* object) {
   89|  26.6M|  if (object->tag() == tag_ && object->group() == group_) {
  ------------------
  |  Branch (89:7): [True: 383k, False: 26.2M]
  |  Branch (89:32): [True: 96.1k, False: 287k]
  ------------------
   90|  96.1k|    tiffComponent_ = object;
   91|  96.1k|    setGo(geTraverse, false);
   92|  96.1k|  }
   93|  26.6M|}
_ZN5Exiv28Internal10TiffFinder10visitEntryEPNS0_9TiffEntryE:
   95|  15.4M|void TiffFinder::visitEntry(TiffEntry* object) {
   96|  15.4M|  findObject(object);
   97|  15.4M|}
_ZN5Exiv28Internal10TiffFinder14visitDataEntryEPNS0_13TiffDataEntryE:
   99|   236k|void TiffFinder::visitDataEntry(TiffDataEntry* object) {
  100|   236k|  findObject(object);
  101|   236k|}
_ZN5Exiv28Internal10TiffFinder15visitImageEntryEPNS0_14TiffImageEntryE:
  103|   988k|void TiffFinder::visitImageEntry(TiffImageEntry* object) {
  104|   988k|  findObject(object);
  105|   988k|}
_ZN5Exiv28Internal10TiffFinder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  107|  1.29M|void TiffFinder::visitSizeEntry(TiffSizeEntry* object) {
  108|  1.29M|  findObject(object);
  109|  1.29M|}
_ZN5Exiv28Internal10TiffFinder14visitDirectoryEPNS0_13TiffDirectoryE:
  111|   828k|void TiffFinder::visitDirectory(TiffDirectory* object) {
  112|   828k|  findObject(object);
  113|   828k|}
_ZN5Exiv28Internal10TiffFinder11visitSubIfdEPNS0_10TiffSubIfdE:
  115|   150k|void TiffFinder::visitSubIfd(TiffSubIfd* object) {
  116|   150k|  findObject(object);
  117|   150k|}
_ZN5Exiv28Internal10TiffFinder12visitMnEntryEPNS0_11TiffMnEntryE:
  119|   150k|void TiffFinder::visitMnEntry(TiffMnEntry* object) {
  120|   150k|  findObject(object);
  121|   150k|}
_ZN5Exiv28Internal10TiffFinder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  123|  43.8k|void TiffFinder::visitIfdMakernote(TiffIfdMakernote* object) {
  124|  43.8k|  findObject(object);
  125|  43.8k|}
_ZN5Exiv28Internal10TiffFinder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  127|  86.8k|void TiffFinder::visitBinaryArray(TiffBinaryArray* object) {
  128|  86.8k|  findObject(object);
  129|  86.8k|}
_ZN5Exiv28Internal10TiffFinder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  131|  7.49M|void TiffFinder::visitBinaryElement(TiffBinaryElement* object) {
  132|  7.49M|  findObject(object);
  133|  7.49M|}
_ZN5Exiv28Internal10TiffCopierC2EPNS0_13TiffComponentEjPKNS0_14TiffHeaderBaseENSt3__16vectorINS_5IfdIdENS7_9allocatorIS9_EEEE:
  137|  3.52k|    pRoot_(pRoot), root_(root), pHeader_(pHeader), pPrimaryGroups_(std::move(pPrimaryGroups)) {
  138|  3.52k|}
_ZN5Exiv28Internal10TiffCopier10copyObjectEPKNS0_13TiffComponentE:
  140|   859k|void TiffCopier::copyObject(const TiffComponent* object) {
  141|   859k|  if (pHeader_->isImageTag(object->tag(), object->group(), pPrimaryGroups_)) {
  ------------------
  |  Branch (141:7): [True: 26.5k, False: 833k]
  ------------------
  142|  26.5k|    auto clone = object->clone();
  143|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  144|  26.5k|    auto tiffPath = TiffCreator::getPath(object->tag(), object->group(), root_);
  145|  26.5k|    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|  26.5k|  }
  151|   859k|}
_ZN5Exiv28Internal10TiffCopier10visitEntryEPNS0_9TiffEntryE:
  153|   278k|void TiffCopier::visitEntry(TiffEntry* object) {
  154|   278k|  copyObject(object);
  155|   278k|}
_ZN5Exiv28Internal10TiffCopier14visitDataEntryEPNS0_13TiffDataEntryE:
  157|  4.28k|void TiffCopier::visitDataEntry(TiffDataEntry* object) {
  158|  4.28k|  copyObject(object);
  159|  4.28k|}
_ZN5Exiv28Internal10TiffCopier15visitImageEntryEPNS0_14TiffImageEntryE:
  161|  6.69k|void TiffCopier::visitImageEntry(TiffImageEntry* object) {
  162|  6.69k|  copyObject(object);
  163|  6.69k|}
_ZN5Exiv28Internal10TiffCopier14visitSizeEntryEPNS0_13TiffSizeEntryE:
  165|  11.5k|void TiffCopier::visitSizeEntry(TiffSizeEntry* object) {
  166|  11.5k|  copyObject(object);
  167|  11.5k|}
_ZN5Exiv28Internal10TiffCopier14visitDirectoryEPNS0_13TiffDirectoryE:
  169|  13.3k|void TiffCopier::visitDirectory(TiffDirectory* /*object*/) {
  170|       |  // Do not copy directories (avoids problems with SubIfds)
  171|  13.3k|}
_ZN5Exiv28Internal10TiffCopier11visitSubIfdEPNS0_10TiffSubIfdE:
  173|  3.04k|void TiffCopier::visitSubIfd(TiffSubIfd* object) {
  174|  3.04k|  copyObject(object);
  175|  3.04k|}
_ZN5Exiv28Internal10TiffCopier12visitMnEntryEPNS0_11TiffMnEntryE:
  177|  5.62k|void TiffCopier::visitMnEntry(TiffMnEntry* object) {
  178|  5.62k|  copyObject(object);
  179|  5.62k|}
_ZN5Exiv28Internal10TiffCopier17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  181|  1.72k|void TiffCopier::visitIfdMakernote(TiffIfdMakernote* object) {
  182|  1.72k|  copyObject(object);
  183|  1.72k|}
_ZN5Exiv28Internal10TiffCopier16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  185|  3.75k|void TiffCopier::visitBinaryArray(TiffBinaryArray* object) {
  186|  3.75k|  copyObject(object);
  187|  3.75k|}
_ZN5Exiv28Internal10TiffCopier18visitBinaryElementEPNS0_17TiffBinaryElementE:
  189|   544k|void TiffCopier::visitBinaryElement(TiffBinaryElement* object) {
  190|   544k|  copyObject(object);
  191|   544k|}
_ZN5Exiv28Internal11TiffDecoderC2ERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPNS0_13TiffComponentEPFMS1_FvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSF_11char_traitsIcEEEEjNS_5IfdIdEE:
  195|  11.8k|    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|  11.8k|  ExifKey key("Exif.Image.Make");
  199|  11.8k|  if (exifData_.findKey(key) != exifData_.end()) {
  ------------------
  |  Branch (199:7): [True: 188, False: 11.6k]
  ------------------
  200|    188|    make_ = exifData_.findKey(key)->toString();
  201|  11.6k|  } else {
  202|       |    // Find camera make by looking for tag 0x010f in IFD0
  203|  11.6k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  204|  11.6k|    pRoot_->accept(finder);
  205|  11.6k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  206|  11.6k|    if (te && te->pValue()) {
  ------------------
  |  Branch (206:9): [True: 2.23k, False: 9.44k]
  |  Branch (206:15): [True: 2.15k, False: 84]
  ------------------
  207|  2.15k|      make_ = te->pValue()->toString();
  208|  2.15k|    }
  209|  11.6k|  }
  210|  11.8k|}
_ZN5Exiv28Internal11TiffDecoder10visitEntryEPNS0_9TiffEntryE:
  212|  1.38M|void TiffDecoder::visitEntry(TiffEntry* object) {
  213|  1.38M|  decodeTiffEntry(object);
  214|  1.38M|}
_ZN5Exiv28Internal11TiffDecoder14visitDataEntryEPNS0_13TiffDataEntryE:
  216|  5.14k|void TiffDecoder::visitDataEntry(TiffDataEntry* object) {
  217|  5.14k|  decodeTiffEntry(object);
  218|  5.14k|}
_ZN5Exiv28Internal11TiffDecoder15visitImageEntryEPNS0_14TiffImageEntryE:
  220|  24.2k|void TiffDecoder::visitImageEntry(TiffImageEntry* object) {
  221|  24.2k|  decodeTiffEntry(object);
  222|  24.2k|}
_ZN5Exiv28Internal11TiffDecoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  224|  32.0k|void TiffDecoder::visitSizeEntry(TiffSizeEntry* object) {
  225|  32.0k|  decodeTiffEntry(object);
  226|  32.0k|}
_ZN5Exiv28Internal11TiffDecoder14visitDirectoryEPNS0_13TiffDirectoryE:
  228|  53.7k|void TiffDecoder::visitDirectory(TiffDirectory* /* object */) {
  229|       |  // Nothing to do
  230|  53.7k|}
_ZN5Exiv28Internal11TiffDecoder11visitSubIfdEPNS0_10TiffSubIfdE:
  232|  10.3k|void TiffDecoder::visitSubIfd(TiffSubIfd* object) {
  233|  10.3k|  decodeTiffEntry(object);
  234|  10.3k|}
_ZN5Exiv28Internal11TiffDecoder12visitMnEntryEPNS0_11TiffMnEntryE:
  236|  7.39k|void TiffDecoder::visitMnEntry(TiffMnEntry* object) {
  237|       |  // Always decode binary makernote tag
  238|  7.39k|  decodeTiffEntry(object);
  239|  7.39k|}
_ZN5Exiv28Internal11TiffDecoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  241|  2.66k|void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
  242|  2.66k|  exifData_["Exif.MakerNote.Offset"] = static_cast<uint32_t>(object->mnOffset());
  243|  2.66k|  switch (object->byteOrder()) {
  ------------------
  |  Branch (243:11): [True: 2.66k, False: 0]
  ------------------
  244|    412|    case littleEndian:
  ------------------
  |  Branch (244:5): [True: 412, False: 2.25k]
  ------------------
  245|    412|      exifData_["Exif.MakerNote.ByteOrder"] = "II";
  246|    412|      break;
  247|  2.25k|    case bigEndian:
  ------------------
  |  Branch (247:5): [True: 2.25k, False: 412]
  ------------------
  248|  2.25k|      exifData_["Exif.MakerNote.ByteOrder"] = "MM";
  249|  2.25k|      break;
  250|      0|    case invalidByteOrder:
  ------------------
  |  Branch (250:5): [True: 0, False: 2.66k]
  ------------------
  251|      0|      break;
  252|  2.66k|  }
  253|  2.66k|}
_ZN5Exiv28Internal11TiffDecoder10getObjDataERPKhRmtNS_5IfdIdEPKNS0_13TiffEntryBaseE:
  255|  4.28k|void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
  256|  4.28k|  if (object && object->tag() == tag && object->group() == group) {
  ------------------
  |  Branch (256:7): [True: 4.28k, False: 0]
  |  Branch (256:17): [True: 3.89k, False: 386]
  |  Branch (256:41): [True: 3.89k, False: 0]
  ------------------
  257|  3.89k|    pData = object->pData();
  258|  3.89k|    size = object->size();
  259|  3.89k|    return;
  260|  3.89k|  }
  261|    386|  TiffFinder finder(tag, group);
  262|    386|  pRoot_->accept(finder);
  263|    386|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (263:12): [True: 37, False: 349]
  ------------------
  264|     37|    pData = te->pData();
  265|     37|    size = te->size();
  266|     37|    return;
  267|     37|  }
  268|    386|}
_ZN5Exiv28Internal11TiffDecoder9decodeXmpEPKNS0_13TiffEntryBaseE:
  270|  3.20k|void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
  271|       |  // add Exif tag anyway
  272|  3.20k|  decodeStdTiffEntry(object);
  273|       |
  274|  3.20k|  const byte* pData = nullptr;
  275|  3.20k|  size_t size = 0;
  276|  3.20k|  getObjData(pData, size, 0x02bc, IfdId::ifd0Id, object);
  277|  3.20k|  if (pData) {
  ------------------
  |  Branch (277:7): [True: 3.20k, False: 0]
  ------------------
  278|  3.20k|    std::string xmpPacket;
  279|  3.20k|    xmpPacket.assign(reinterpret_cast<const char*>(pData), size);
  280|  3.20k|    std::string::size_type idx = xmpPacket.find_first_of('<');
  281|  3.20k|    if (idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (281:9): [True: 2.39k, False: 815]
  |  Branch (281:37): [True: 2.36k, False: 26]
  ------------------
  282|  2.36k|#ifndef SUPPRESS_WARNINGS
  283|  2.36k|      EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|  2.36k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.36k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.36k|  LogMsg(LogMsg::warn).os()
  ------------------
  284|  2.36k|#endif
  285|  2.36k|      xmpPacket = xmpPacket.substr(idx);
  286|  2.36k|    }
  287|  3.20k|    if (XmpParser::decode(xmpData_, xmpPacket)) {
  ------------------
  |  Branch (287:9): [True: 1.28k, False: 1.92k]
  ------------------
  288|  1.28k|#ifndef SUPPRESS_WARNINGS
  289|  1.28k|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|  1.28k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.28k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.28k|  LogMsg(LogMsg::warn).os()
  ------------------
  290|  1.28k|#endif
  291|  1.28k|    }
  292|  3.20k|  }
  293|  3.20k|}  // TiffDecoder::decodeXmp
_ZN5Exiv28Internal11TiffDecoder10decodeIptcEPKNS0_13TiffEntryBaseE:
  295|    925|void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
  296|       |  // add Exif tag anyway
  297|    925|  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|    925|  if (decodedIptc_) {
  ------------------
  |  Branch (301:7): [True: 225, False: 700]
  ------------------
  302|    225|    return;
  303|    225|  }
  304|    700|  decodedIptc_ = true;
  305|       |  // 1st choice: IPTCNAA
  306|    700|  const byte* pData = nullptr;
  307|    700|  size_t size = 0;
  308|    700|  getObjData(pData, size, 0x83bb, IfdId::ifd0Id, object);
  309|    700|  if (pData) {
  ------------------
  |  Branch (309:7): [True: 477, False: 223]
  ------------------
  310|    477|    if (0 == IptcParser::decode(iptcData_, pData, size)) {
  ------------------
  |  Branch (310:9): [True: 323, False: 154]
  ------------------
  311|    323|      return;
  312|    323|    }
  313|    154|#ifndef SUPPRESS_WARNINGS
  314|    154|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x83bb\n";
  ------------------
  |  |  138|    154|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 154]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    154|  LogMsg(LogMsg::warn).os()
  ------------------
  315|       |
  316|    154|#endif
  317|    154|  }
  318|       |
  319|       |  // 2nd choice if no IPTCNAA record found or failed to decode it:
  320|       |  // ImageResources
  321|    377|  pData = nullptr;
  322|    377|  size = 0;
  323|    377|  getObjData(pData, size, 0x8649, IfdId::ifd0Id, object);
  324|    377|  if (pData) {
  ------------------
  |  Branch (324:7): [True: 244, False: 133]
  ------------------
  325|    244|    const byte* record = nullptr;
  326|    244|    uint32_t sizeHdr = 0;
  327|    244|    uint32_t sizeData = 0;
  328|    244|    if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {
  ------------------
  |  Branch (328:9): [True: 219, False: 25]
  ------------------
  329|    219|      return;
  330|    219|    }
  331|     25|    if (0 == IptcParser::decode(iptcData_, record + sizeHdr, sizeData)) {
  ------------------
  |  Branch (331:9): [True: 16, False: 9]
  ------------------
  332|     16|      return;
  333|     16|    }
  334|      9|#ifndef SUPPRESS_WARNINGS
  335|      9|    EXV_WARNING << "Failed to decode IPTC block found in " << "Directory Image, entry 0x8649\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()
  ------------------
  336|       |
  337|      9|#endif
  338|      9|  }
  339|    377|}  // TiffMetadataDecoder::decodeIptc
_ZN5Exiv28Internal11TiffDecoder17decodeCanonAFInfoEPKNS0_13TiffEntryBaseE:
  347|  1.09k|void TiffDecoder::decodeCanonAFInfo(const TiffEntryBase* object) {
  348|       |  // report Exif.Canon.AFInfo as usual
  349|  1.09k|  TiffDecoder::decodeStdTiffEntry(object);
  350|  1.09k|  if (object->pValue()->count() < 3 || object->pValue()->typeId() != unsignedShort)
  ------------------
  |  Branch (350:7): [True: 226, False: 867]
  |  Branch (350:40): [True: 86, False: 781]
  ------------------
  351|    312|    return;  // insufficient data
  352|       |
  353|       |  // create vector of signedShorts from unsignedShorts in Exif.Canon.AFInfo
  354|    781|  std::vector<int16_t> ints;
  355|    781|  std::vector<uint16_t> uint;
  356|  92.6k|  for (size_t i = 0; i < object->pValue()->count(); i++) {
  ------------------
  |  Branch (356:22): [True: 91.9k, False: 781]
  ------------------
  357|  91.9k|    ints.push_back(object->pValue()->toInt64(i));
  358|  91.9k|    uint.push_back(object->pValue()->toUint32(i));
  359|  91.9k|  }
  360|       |  // Check this is AFInfo2 (ints[0] = bytes in object)
  361|    781|  if (ints.front() != static_cast<int16_t>(object->pValue()->count()) * 2)
  ------------------
  |  Branch (361:7): [True: 125, False: 656]
  ------------------
  362|    125|    return;
  363|       |
  364|    656|  std::string familyGroup(std::string("Exif.") + groupName(object->group()) + ".");
  365|       |
  366|    656|  const uint16_t nPoints = uint.at(2);
  367|    656|  const uint16_t nMasks = (nPoints + 15) / (sizeof(uint16_t) * 8);
  368|    656|  int nStart = 0;
  369|       |
  370|    656|  const std::tuple<uint16_t, uint16_t, bool> records[] = {
  371|    656|      {0x2600, 1, true},        // AFInfoSize
  372|    656|      {0x2601, 1, true},        // AFAreaMode
  373|    656|      {0x2602, 1, true},        // AFNumPoints
  374|    656|      {0x2603, 1, true},        // AFValidPoints
  375|    656|      {0x2604, 1, true},        // AFCanonImageWidth
  376|    656|      {0x2605, 1, true},        // AFCanonImageHeight
  377|    656|      {0x2606, 1, true},        // AFImageWidth"
  378|    656|      {0x2607, 1, true},        // AFImageHeight
  379|    656|      {0x2608, nPoints, true},  // AFAreaWidths
  380|    656|      {0x2609, nPoints, true},  // AFAreaHeights
  381|    656|      {0x260a, nPoints, true},  // AFXPositions
  382|    656|      {0x260b, nPoints, true},  // AFYPositions
  383|    656|      {0x260c, nMasks, false},  // AFPointsInFocus
  384|    656|      {0x260d, nMasks, false},  // AFPointsSelected
  385|    656|      {0x260e, nMasks, false},  // AFPointsUnusable
  386|    656|  };
  387|       |  // check we have enough data!
  388|    656|  uint16_t count = 0;
  389|  8.67k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (389:41): [True: 8.67k, False: 440]
  ------------------
  390|  8.67k|    count += size;
  391|  8.67k|    if (count > ints.size())
  ------------------
  |  Branch (391:9): [True: 216, False: 8.46k]
  ------------------
  392|    216|      return;
  393|  8.67k|  }
  394|       |
  395|  6.60k|  for (const auto& [tag, size, bSigned] : records) {
  ------------------
  |  Branch (395:41): [True: 6.60k, False: 440]
  ------------------
  396|  6.60k|    auto pTags = ExifTags::tagList("Canon");
  397|  6.60k|    if (auto pTag = findTag(pTags, tag)) {
  ------------------
  |  Branch (397:14): [True: 6.60k, False: 0]
  ------------------
  398|  6.60k|      auto v = Exiv2::Value::create(bSigned ? Exiv2::signedShort : Exiv2::unsignedShort);
  ------------------
  |  Branch (398:37): [True: 5.28k, False: 1.32k]
  ------------------
  399|  6.60k|      std::string s;
  400|  6.60k|      if (bSigned) {
  ------------------
  |  Branch (400:11): [True: 5.28k, False: 1.32k]
  ------------------
  401|  15.9k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (401:30): [True: 10.6k, False: 5.28k]
  ------------------
  402|  10.6k|          s += stringFormat(" {}", ints.at(nStart++));
  ------------------
  |  |   18|  10.6k|#define stringFormat std::format
  ------------------
  403|  5.28k|      } else {
  404|  2.33k|        for (uint16_t k = 0; k < size; k++)
  ------------------
  |  Branch (404:30): [True: 1.01k, False: 1.32k]
  ------------------
  405|  1.01k|          s += stringFormat(" {}", uint.at(nStart++));
  ------------------
  |  |   18|  1.01k|#define stringFormat std::format
  ------------------
  406|  1.32k|      }
  407|       |
  408|  6.60k|      v->read(s);
  409|  6.60k|      exifData_[familyGroup + pTag->name_] = *v;
  410|  6.60k|    }
  411|  6.60k|  }
  412|    440|}
_ZN5Exiv28Internal11TiffDecoder15decodeTiffEntryEPKNS0_13TiffEntryBaseE:
  414|  2.04M|void TiffDecoder::decodeTiffEntry(const TiffEntryBase* object) {
  415|       |  // Don't decode the entry if value is not set
  416|  2.04M|  if (!object->pValue())
  ------------------
  |  Branch (416:7): [True: 762k, False: 1.28M]
  ------------------
  417|   762k|    return;
  418|       |
  419|       |  // skip decoding if decoderFct == 0
  420|  1.28M|  if (auto decoderFct = findDecoderFct_(make_, object->tag(), object->group()))
  ------------------
  |  Branch (420:12): [True: 1.28M, False: 0]
  ------------------
  421|  1.28M|    std::invoke(decoderFct, *this, object);
  422|  1.28M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder18decodeStdTiffEntryEPKNS0_13TiffEntryBaseE:
  424|  1.28M|void TiffDecoder::decodeStdTiffEntry(const TiffEntryBase* object) {
  425|  1.28M|  ExifKey key(object->tag(), groupName(object->group()));
  426|  1.28M|  key.setIdx(object->idx());
  427|  1.28M|  exifData_.add(key, object->pValue());
  428|       |
  429|  1.28M|}  // TiffDecoder::decodeTiffEntry
_ZN5Exiv28Internal11TiffDecoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  431|  5.44k|void TiffDecoder::visitBinaryArray(TiffBinaryArray* object) {
  432|  5.44k|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (432:7): [True: 971, False: 4.47k]
  |  Branch (432:25): [True: 3.08k, False: 1.39k]
  ------------------
  433|  4.05k|    decodeTiffEntry(object);
  434|  4.05k|  }
  435|  5.44k|}
_ZN5Exiv28Internal11TiffDecoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  437|   582k|void TiffDecoder::visitBinaryElement(TiffBinaryElement* object) {
  438|   582k|  decodeTiffEntry(object);
  439|   582k|}
_ZN5Exiv28Internal11TiffEncoderC2ENS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEPNS0_13TiffComponentEbNSt3__16vectorINS_5IfdIdENSB_9allocatorISD_EEEEPKNS0_14TiffHeaderBaseEPFMS1_FvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSB_17basic_string_viewIcNSB_11char_traitsIcEEEEjSD_E:
  444|  14.1k|    exifData_(std::move(exifData)),
  445|  14.1k|    iptcData_(iptcData),
  446|  14.1k|    xmpData_(xmpData),
  447|  14.1k|    pHeader_(pHeader),
  448|  14.1k|    pRoot_(pRoot),
  449|  14.1k|    isNewImage_(isNewImage),
  450|  14.1k|    pPrimaryGroups_(std::move(pPrimaryGroups)),
  451|  14.1k|    byteOrder_(pHeader->byteOrder()),
  452|  14.1k|    origByteOrder_(byteOrder_),
  453|  14.1k|    findEncoderFct_(findEncoderFct) {
  454|  14.1k|  encodeIptc();
  455|  14.1k|  encodeXmp();
  456|       |
  457|       |  // Find camera make
  458|  14.1k|  ExifKey key("Exif.Image.Make");
  459|  14.1k|  if (auto pos = exifData_.findKey(key); pos != exifData_.end()) {
  ------------------
  |  Branch (459:42): [True: 6.93k, False: 7.25k]
  ------------------
  460|  6.93k|    make_ = pos->toString();
  461|  6.93k|  }
  462|  14.1k|  if (make_.empty() && pRoot_) {
  ------------------
  |  Branch (462:7): [True: 7.57k, False: 6.60k]
  |  Branch (462:24): [True: 7.57k, False: 0]
  ------------------
  463|  7.57k|    TiffFinder finder(0x010f, IfdId::ifd0Id);
  464|  7.57k|    pRoot_->accept(finder);
  465|  7.57k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
  466|  7.57k|    if (te && te->pValue()) {
  ------------------
  |  Branch (466:9): [True: 102, False: 7.47k]
  |  Branch (466:15): [True: 81, False: 21]
  ------------------
  467|     81|      make_ = te->pValue()->toString();
  468|     81|    }
  469|  7.57k|  }
  470|  14.1k|}
_ZN5Exiv28Internal11TiffEncoder10encodeIptcEv:
  472|  14.1k|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|  14.1k|  bool del = false;
  478|  14.1k|  ExifKey iptcNaaKey("Exif.Image.IPTCNAA");
  479|  14.1k|  auto pos = exifData_.findKey(iptcNaaKey);
  480|  14.1k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (480:7): [True: 784, False: 13.4k]
  ------------------
  481|    784|    iptcNaaKey.setIdx(pos->idx());
  482|    784|    exifData_.erase(pos);
  483|    784|    del = true;
  484|    784|  }
  485|  14.1k|  DataBuf rawIptc = IptcParser::encode(iptcData_);
  486|  14.1k|  ExifKey irbKey("Exif.Image.ImageResources");
  487|  14.1k|  pos = exifData_.findKey(irbKey);
  488|  14.1k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (488:7): [True: 319, False: 13.8k]
  ------------------
  489|    319|    irbKey.setIdx(pos->idx());
  490|    319|  }
  491|  14.1k|  if (!rawIptc.empty() && (del || pos == exifData_.end())) {
  ------------------
  |  Branch (491:7): [True: 495, False: 13.6k]
  |  Branch (491:7): [True: 492, False: 13.6k]
  |  Branch (491:28): [True: 492, False: 3]
  |  Branch (491:35): [True: 0, False: 3]
  ------------------
  492|    492|    auto value = Value::create(unsignedLong);
  493|    492|    DataBuf buf;
  494|    492|    if (rawIptc.size() % 4 != 0) {
  ------------------
  |  Branch (494:9): [True: 377, False: 115]
  ------------------
  495|       |      // Pad the last unsignedLong value with 0s
  496|    377|      buf.alloc(((rawIptc.size() / 4) * 4) + 4);
  497|    377|      std::move(rawIptc.begin(), rawIptc.end(), buf.begin());
  498|    377|    } else {
  499|    115|      buf = std::move(rawIptc);  // Note: This resets rawIptc
  500|    115|    }
  501|    492|    value->read(buf.data(), buf.size(), byteOrder_);
  502|    492|    Exifdatum iptcDatum(iptcNaaKey, value.get());
  503|    492|    exifData_.add(iptcDatum);
  504|    492|    pos = exifData_.findKey(irbKey);  // needed after add()
  505|    492|  }
  506|       |  // Also update IPTC IRB in Exif.Image.ImageResources if it exists,
  507|       |  // but don't create it if not.
  508|  14.1k|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (508:7): [True: 319, False: 13.8k]
  ------------------
  509|    319|    DataBuf irbBuf(pos->value().size());
  510|    319|    pos->value().copy(irbBuf.data(), invalidByteOrder);
  511|    319|    irbBuf = Photoshop::setIptcIrb(irbBuf.c_data(), irbBuf.size(), iptcData_);
  512|    319|    exifData_.erase(pos);
  513|    319|    if (!irbBuf.empty()) {
  ------------------
  |  Branch (513:9): [True: 117, False: 202]
  ------------------
  514|    117|      auto value = Value::create(unsignedByte);
  515|    117|      value->read(irbBuf.data(), irbBuf.size(), invalidByteOrder);
  516|    117|      Exifdatum iptcDatum(irbKey, value.get());
  517|    117|      exifData_.add(iptcDatum);
  518|    117|    }
  519|    319|  }
  520|  14.1k|}  // TiffEncoder::encodeIptc
_ZN5Exiv28Internal11TiffEncoder9encodeXmpEv:
  522|  14.1k|void TiffEncoder::encodeXmp() {
  523|  14.1k|#ifdef EXV_HAVE_XMP_TOOLKIT
  524|  14.1k|  ExifKey xmpKey("Exif.Image.XMLPacket");
  525|       |  // Remove any existing XMP Exif tag
  526|  14.1k|  if (auto pos = exifData_.findKey(xmpKey); pos != exifData_.end()) {
  ------------------
  |  Branch (526:45): [True: 1.31k, False: 12.8k]
  ------------------
  527|  1.31k|    xmpKey.setIdx(pos->idx());
  528|  1.31k|    exifData_.erase(pos);
  529|  1.31k|  }
  530|  14.1k|  std::string xmpPacket;
  531|  14.1k|  if (xmpData_.usePacket()) {
  ------------------
  |  Branch (531:7): [True: 0, False: 14.1k]
  ------------------
  532|      0|    xmpPacket = xmpData_.xmpPacket();
  533|  14.1k|  } else {
  534|  14.1k|    if (XmpParser::encode(xmpPacket, xmpData_) > 1) {
  ------------------
  |  Branch (534:9): [True: 16, False: 14.1k]
  ------------------
  535|     16|#ifndef SUPPRESS_WARNINGS
  536|     16|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     16|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 16]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     16|  LogMsg(LogMsg::error).os()
  ------------------
  537|     16|#endif
  538|     16|    }
  539|  14.1k|  }
  540|  14.1k|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (540:7): [True: 406, False: 13.7k]
  ------------------
  541|       |    // Set the XMP Exif tag to the new value
  542|    406|    auto value = Value::create(unsignedByte);
  543|    406|    value->read(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size(), invalidByteOrder);
  544|    406|    Exifdatum xmpDatum(xmpKey, value.get());
  545|    406|    exifData_.add(xmpDatum);
  546|    406|  }
  547|  14.1k|#endif
  548|  14.1k|}  // TiffEncoder::encodeXmp
_ZN5Exiv28Internal11TiffEncoder8setDirtyEb:
  550|   636k|void TiffEncoder::setDirty(bool flag) {
  551|   636k|  dirty_ = flag;
  552|   636k|  setGo(geTraverse, !flag);
  553|   636k|}
_ZNK5Exiv28Internal11TiffEncoder5dirtyEv:
  555|  4.14k|bool TiffEncoder::dirty() const {
  556|  4.14k|  return dirty_ || !exifData_.empty();
  ------------------
  |  Branch (556:10): [True: 3.52k, False: 625]
  |  Branch (556:20): [True: 2, False: 623]
  ------------------
  557|  4.14k|}
_ZN5Exiv28Internal11TiffEncoder10visitEntryEPNS0_9TiffEntryE:
  559|  32.6k|void TiffEncoder::visitEntry(TiffEntry* object) {
  560|  32.6k|  encodeTiffComponent(object);
  561|  32.6k|}
_ZN5Exiv28Internal11TiffEncoder14visitDataEntryEPNS0_13TiffDataEntryE:
  563|  1.39k|void TiffEncoder::visitDataEntry(TiffDataEntry* object) {
  564|  1.39k|  encodeTiffComponent(object);
  565|  1.39k|}
_ZN5Exiv28Internal11TiffEncoder15visitImageEntryEPNS0_14TiffImageEntryE:
  567|  1.34k|void TiffEncoder::visitImageEntry(TiffImageEntry* object) {
  568|  1.34k|  encodeTiffComponent(object);
  569|  1.34k|}
_ZN5Exiv28Internal11TiffEncoder14visitSizeEntryEPNS0_13TiffSizeEntryE:
  571|  1.74k|void TiffEncoder::visitSizeEntry(TiffSizeEntry* object) {
  572|  1.74k|  encodeTiffComponent(object);
  573|  1.74k|}
_ZN5Exiv28Internal11TiffEncoder14visitDirectoryEPNS0_13TiffDirectoryE:
  575|  8.76k|void TiffEncoder::visitDirectory(TiffDirectory* /*object*/) {
  576|       |  // Nothing to do
  577|  8.76k|}
_ZN5Exiv28Internal11TiffEncoder18visitDirectoryNextEPNS0_13TiffDirectoryE:
  579|  4.53k|void TiffEncoder::visitDirectoryNext(TiffDirectory* object) {
  580|       |  // Update type and count in IFD entries, in case they changed
  581|  4.53k|  byte* p = object->start() + 2;
  582|  14.1k|  for (const auto& component : object->components_) {
  ------------------
  |  Branch (582:30): [True: 14.1k, False: 4.53k]
  ------------------
  583|  14.1k|    p += updateDirEntry(p, byteOrder(), component);
  584|  14.1k|  }
  585|  4.53k|}
_ZN5Exiv28Internal11TiffEncoder14updateDirEntryEPhNS_9ByteOrderERKNSt3__110shared_ptrINS0_13TiffComponentEEE:
  587|  14.1k|uint32_t TiffEncoder::updateDirEntry(byte* buf, ByteOrder byteOrder, const TiffComponent::SharedPtr& tiffComponent) {
  588|  14.1k|  auto pTiffEntry = std::dynamic_pointer_cast<TiffEntryBase>(tiffComponent);
  589|  14.1k|  if (!pTiffEntry)
  ------------------
  |  Branch (589:7): [True: 0, False: 14.1k]
  ------------------
  590|      0|    return 0;
  591|  14.1k|  us2Data(buf + 2, pTiffEntry->tiffType(), byteOrder);
  592|  14.1k|  ul2Data(buf + 4, static_cast<uint32_t>(pTiffEntry->count()), byteOrder);
  593|       |  // Move data to offset field, if it fits and is not yet there.
  594|  14.1k|  if (pTiffEntry->size() <= 4 && buf + 8 != pTiffEntry->pData()) {
  ------------------
  |  Branch (594:7): [True: 11.6k, False: 2.57k]
  |  Branch (594:34): [True: 2.90k, False: 8.70k]
  ------------------
  595|       |#ifdef EXIV2_DEBUG_MESSAGES
  596|       |    std::cerr << "Copying data for tag " << pTiffEntry->tag() << " to offset area.\n";
  597|       |#endif
  598|  2.90k|    memset(buf + 8, 0x0, 4);
  599|  2.90k|    if (pTiffEntry->size() > 0) {
  ------------------
  |  Branch (599:9): [True: 57, False: 2.84k]
  ------------------
  600|     57|      std::copy_n(pTiffEntry->pData(), pTiffEntry->size(), buf + 8);
  601|     57|      memset(const_cast<byte*>(pTiffEntry->pData()), 0x0, pTiffEntry->size());
  602|     57|    }
  603|  2.90k|  }
  604|  14.1k|  return 12;
  605|  14.1k|}
_ZN5Exiv28Internal11TiffEncoder11visitSubIfdEPNS0_10TiffSubIfdE:
  607|  1.33k|void TiffEncoder::visitSubIfd(TiffSubIfd* object) {
  608|  1.33k|  encodeTiffComponent(object);
  609|  1.33k|}
_ZN5Exiv28Internal11TiffEncoder12visitMnEntryEPNS0_11TiffMnEntryE:
  611|    873|void TiffEncoder::visitMnEntry(TiffMnEntry* object) {
  612|       |  // Test is required here as well as in the callback encoder function
  613|    873|  if (!object->mn_) {
  ------------------
  |  Branch (613:7): [True: 479, False: 394]
  ------------------
  614|    479|    encodeTiffComponent(object);
  615|    479|  } else if (del_) {
  ------------------
  |  Branch (615:14): [True: 394, False: 0]
  ------------------
  616|       |    // The makernote is made up of decoded tags, delete binary tag
  617|    394|    ExifKey key(object->tag(), groupName(object->group()));
  618|    394|    auto pos = exifData_.findKey(key);
  619|    394|    if (pos != exifData_.end())
  ------------------
  |  Branch (619:9): [True: 383, False: 11]
  ------------------
  620|    383|      exifData_.erase(pos);
  621|    394|  }
  622|    873|}
_ZN5Exiv28Internal11TiffEncoder17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
  624|    394|void TiffEncoder::visitIfdMakernote(TiffIfdMakernote* object) {
  625|    394|  auto pos = exifData_.findKey(ExifKey("Exif.MakerNote.ByteOrder"));
  626|    394|  if (pos != exifData_.end()) {
  ------------------
  |  Branch (626:7): [True: 177, False: 217]
  ------------------
  627|       |    // Set Makernote byte order
  628|    177|    ByteOrder bo = stringToByteOrder(pos->toString());
  629|    177|    if (bo != invalidByteOrder && bo != object->byteOrder()) {
  ------------------
  |  Branch (629:9): [True: 177, False: 0]
  |  Branch (629:35): [True: 1, False: 176]
  ------------------
  630|      1|      object->setByteOrder(bo);
  631|      1|      setDirty();
  632|      1|    }
  633|    177|    if (del_)
  ------------------
  |  Branch (633:9): [True: 177, False: 0]
  ------------------
  634|    177|      exifData_.erase(pos);
  635|    177|  }
  636|    394|  if (del_) {
  ------------------
  |  Branch (636:7): [True: 394, False: 0]
  ------------------
  637|       |    // Remove remaining synthesized tags
  638|    394|    for (auto synthesizedTag : {"Exif.MakerNote.Offset"}) {
  ------------------
  |  Branch (638:30): [True: 394, False: 394]
  ------------------
  639|    394|      pos = exifData_.findKey(ExifKey(synthesizedTag));
  640|    394|      if (pos != exifData_.end())
  ------------------
  |  Branch (640:11): [True: 177, False: 217]
  ------------------
  641|    177|        exifData_.erase(pos);
  642|    394|    }
  643|    394|  }
  644|       |  // Modify encoder for Makernote peculiarities, byte order
  645|    394|  byteOrder_ = object->byteOrder();
  646|       |
  647|    394|}  // TiffEncoder::visitIfdMakernote
_ZN5Exiv28Internal11TiffEncoder20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
  649|    271|void TiffEncoder::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
  650|       |  // Reset byte order back to that from the c'tor
  651|    271|  byteOrder_ = origByteOrder_;
  652|       |
  653|    271|}  // TiffEncoder::visitIfdMakernoteEnd
_ZN5Exiv28Internal11TiffEncoder16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
  655|    394|void TiffEncoder::visitBinaryArray(TiffBinaryArray* object) {
  656|    394|  if (!object->cfg() || !object->decoded()) {
  ------------------
  |  Branch (656:7): [True: 81, False: 313]
  |  Branch (656:25): [True: 168, False: 145]
  ------------------
  657|    249|    encodeTiffComponent(object);
  658|    249|  }
  659|    394|}
_ZN5Exiv28Internal11TiffEncoder19visitBinaryArrayEndEPNS0_15TiffBinaryArrayE:
  661|    387|void TiffEncoder::visitBinaryArrayEnd(TiffBinaryArray* object) {
  662|    387|  if (!object->cfg() || !object->decoded())
  ------------------
  |  Branch (662:7): [True: 81, False: 306]
  |  Branch (662:25): [True: 161, False: 145]
  ------------------
  663|    242|    return;
  664|    145|  size_t size = object->TiffEntryBase::doSize();
  665|    145|  if (size == 0)
  ------------------
  |  Branch (665:7): [True: 0, False: 145]
  ------------------
  666|      0|    return;
  667|    145|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (667:7): [True: 0, False: 145]
  ------------------
  668|      0|    return;
  669|       |
  670|       |  // Re-encrypt buffer if necessary
  671|    145|  CryptFct cryptFct = object->cfg()->cryptFct_;
  672|    145|  if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (672:7): [True: 12, False: 133]
  ------------------
  673|     12|    cryptFct = sonyTagEncipher;
  674|     12|  }
  675|    145|  if (cryptFct) {
  ------------------
  |  Branch (675:7): [True: 51, False: 94]
  ------------------
  676|     51|    const byte* pData = object->pData();
  677|     51|    DataBuf buf = cryptFct(object->tag(), pData, size, pRoot_);
  678|     51|    if (!buf.empty()) {
  ------------------
  |  Branch (678:9): [True: 24, False: 27]
  ------------------
  679|     24|      pData = buf.c_data();
  680|     24|      size = buf.size();
  681|     24|    }
  682|     51|    if (!object->updOrigDataBuf(pData, size)) {
  ------------------
  |  Branch (682:9): [True: 0, False: 51]
  ------------------
  683|      0|      setDirty();
  684|      0|    }
  685|     51|  }
  686|    145|}
_ZN5Exiv28Internal11TiffEncoder18visitBinaryElementEPNS0_17TiffBinaryElementE:
  688|  2.61k|void TiffEncoder::visitBinaryElement(TiffBinaryElement* object) {
  689|       |  // Temporarily overwrite byte order according to that of the binary element
  690|  2.61k|  ByteOrder boOrig = byteOrder_;
  691|  2.61k|  if (object->elByteOrder() != invalidByteOrder)
  ------------------
  |  Branch (691:7): [True: 674, False: 1.94k]
  ------------------
  692|    674|    byteOrder_ = object->elByteOrder();
  693|  2.61k|  encodeTiffComponent(object);
  694|  2.61k|  byteOrder_ = boOrig;
  695|  2.61k|}
_ZNK5Exiv28Internal11TiffEncoder10isImageTagEtNS_5IfdIdE:
  697|  3.75M|bool TiffEncoder::isImageTag(uint16_t tag, IfdId group) const {
  698|  3.75M|  return !isNewImage_ && pHeader_->isImageTag(tag, group, pPrimaryGroups_);
  ------------------
  |  Branch (698:10): [True: 1.46M, False: 2.28M]
  |  Branch (698:26): [True: 18.9k, False: 1.45M]
  ------------------
  699|  3.75M|}
_ZN5Exiv28Internal11TiffEncoder19encodeTiffComponentEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  701|  1.88M|void TiffEncoder::encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum) {
  702|  1.88M|  auto pos = exifData_.end();
  703|  1.88M|  const Exifdatum* ed = datum;
  704|  1.88M|  if (!ed) {
  ------------------
  |  Branch (704:7): [True: 41.7k, False: 1.84M]
  ------------------
  705|       |    // Non-intrusive writing: find matching tag
  706|  41.7k|    ExifKey key(object->tag(), groupName(object->group()));
  707|  41.7k|    pos = exifData_.findKey(key);
  708|  41.7k|    if (pos != exifData_.end()) {
  ------------------
  |  Branch (708:9): [True: 38.4k, False: 3.33k]
  ------------------
  709|  38.4k|      ed = &(*pos);
  710|  38.4k|      if (object->idx() != pos->idx()) {
  ------------------
  |  Branch (710:11): [True: 3.91k, False: 34.5k]
  ------------------
  711|       |        // Try to find exact match (in case of duplicate tags)
  712|  3.91k|        auto pos2 = std::find_if(exifData_.begin(), exifData_.end(), FindExifdatum2(object->group(), object->idx()));
  713|  3.91k|        if (pos2 != exifData_.end() && pos2->key() == key.key()) {
  ------------------
  |  Branch (713:13): [True: 102, False: 3.81k]
  |  Branch (713:13): [True: 32, False: 3.88k]
  |  Branch (713:40): [True: 32, False: 70]
  ------------------
  714|     32|          ed = &(*pos2);
  715|     32|          pos = pos2;  // make sure we delete the correct tag below
  716|     32|        }
  717|  3.91k|      }
  718|  38.4k|    } else {
  719|  3.33k|      setDirty();
  720|       |#ifdef EXIV2_DEBUG_MESSAGES
  721|       |      std::cerr << "DELETING          " << key << ", idx = " << object->idx() << "\n";
  722|       |#endif
  723|  3.33k|    }
  724|  1.84M|  } else {
  725|       |    // For intrusive writing, the index is used to preserve the order of
  726|       |    // duplicate tags
  727|  1.84M|    object->idx_ = ed->idx();
  728|  1.84M|  }
  729|       |  // Skip encoding image tags of existing TIFF image - they were copied earlier -
  730|       |  // but encode image tags of new images (creation)
  731|  1.88M|  if (ed && !isImageTag(object->tag(), object->group())) {
  ------------------
  |  Branch (731:7): [True: 1.88M, False: 3.33k]
  |  Branch (731:13): [True: 1.87M, False: 4.39k]
  ------------------
  732|  1.87M|    if (auto fct = findEncoderFct_(make_, object->tag(), object->group())) {
  ------------------
  |  Branch (732:14): [True: 0, False: 1.87M]
  ------------------
  733|       |      // If an encoding function is registered for the tag, use it
  734|      0|      std::invoke(fct, *this, object, ed);
  735|  1.87M|    } 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|  1.87M|      object->encode(*this, ed);
  739|  1.87M|    }
  740|  1.87M|  }
  741|  1.88M|  if (del_ && pos != exifData_.end()) {
  ------------------
  |  Branch (741:7): [True: 41.7k, False: 1.84M]
  |  Branch (741:7): [True: 38.4k, False: 1.84M]
  |  Branch (741:15): [True: 38.4k, False: 3.33k]
  ------------------
  742|  38.4k|    exifData_.erase(pos);
  743|  38.4k|  }
  744|       |#ifdef EXIV2_DEBUG_MESSAGES
  745|       |  std::cerr << "\n";
  746|       |#endif
  747|  1.88M|}  // TiffEncoder::encodeTiffComponent
_ZN5Exiv28Internal11TiffEncoder17encodeBinaryArrayEPNS0_15TiffBinaryArrayEPKNS_9ExifdatumE:
  749|  7.77k|void TiffEncoder::encodeBinaryArray(TiffBinaryArray* object, const Exifdatum* datum) {
  750|  7.77k|  encodeOffsetEntry(object, datum);
  751|  7.77k|}  // TiffEncoder::encodeBinaryArray
_ZN5Exiv28Internal11TiffEncoder19encodeBinaryElementEPNS0_17TiffBinaryElementEPKNS_9ExifdatumE:
  753|   984k|void TiffEncoder::encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum) {
  754|   984k|  encodeTiffEntryBase(object, datum);
  755|   984k|}  // TiffEncoder::encodeArrayElement
_ZN5Exiv28Internal11TiffEncoder15encodeDataEntryEPNS0_13TiffDataEntryEPKNS_9ExifdatumE:
  757|  5.99k|void TiffEncoder::encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum) {
  758|  5.99k|  encodeOffsetEntry(object, datum);
  759|       |
  760|  5.99k|  if (!dirty_ && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (760:7): [True: 1.64k, False: 4.34k]
  |  Branch (760:18): [True: 1.26k, False: 379]
  ------------------
  761|  1.26k|    if (object->sizeDataArea_ < object->pValue()->sizeDataArea()) {
  ------------------
  |  Branch (761:9): [True: 0, False: 1.26k]
  ------------------
  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.26k|    } 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.26k|      DataBuf buf = object->pValue()->dataArea();
  774|  1.26k|      if (!buf.empty()) {
  ------------------
  |  Branch (774:11): [True: 437, False: 827]
  ------------------
  775|    437|        std::copy(buf.begin(), buf.end(), object->pDataArea_);
  776|    437|        if (object->sizeDataArea_ > buf.size()) {
  ------------------
  |  Branch (776:13): [True: 0, False: 437]
  ------------------
  777|      0|          memset(object->pDataArea_ + buf.size(), 0x0, object->sizeDataArea_ - buf.size());
  778|      0|        }
  779|    437|      }
  780|  1.26k|    }
  781|  1.26k|  }
  782|       |
  783|  5.99k|}  // TiffEncoder::encodeDataEntry
_ZN5Exiv28Internal11TiffEncoder15encodeTiffEntryEPNS0_9TiffEntryEPKNS_9ExifdatumE:
  785|   843k|void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) {
  786|   843k|  encodeTiffEntryBase(object, datum);
  787|   843k|}  // TiffEncoder::encodeTiffEntry
_ZN5Exiv28Internal11TiffEncoder16encodeImageEntryEPNS0_14TiffImageEntryEPKNS_9ExifdatumE:
  789|  10.2k|void TiffEncoder::encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum) {
  790|  10.2k|  encodeOffsetEntry(object, datum);
  791|       |
  792|  10.2k|  size_t sizeDataArea = object->pValue()->sizeDataArea();
  793|       |
  794|  10.2k|  if (sizeDataArea > 0 && writeMethod() == wmNonIntrusive) {
  ------------------
  |  Branch (794:7): [True: 122, False: 10.1k]
  |  Branch (794:27): [True: 0, False: 122]
  ------------------
  795|       |#ifdef EXIV2_DEBUG_MESSAGES
  796|       |    std::cerr << "\t DATAAREA IS SET (NON-INTRUSIVE WRITING)";
  797|       |#endif
  798|      0|    setDirty();
  799|      0|  }
  800|       |
  801|  10.2k|  if (sizeDataArea > 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (801:7): [True: 122, False: 10.1k]
  |  Branch (801:27): [True: 122, 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|    122|    ExifKey key(object->szTag(), groupName(object->szGroup()));
  807|    122|    auto pos = exifData_.findKey(key);
  808|    122|    const byte* zero = nullptr;
  809|    122|    if (pos == exifData_.end()) {
  ------------------
  |  Branch (809:9): [True: 0, False: 122]
  ------------------
  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|    122|    } else {
  816|    122|      size_t sizeTotal = 0;
  817|    122|      object->strips_.clear();
  818|  3.00k|      for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (818:26): [True: 2.88k, False: 122]
  ------------------
  819|  2.88k|        uint32_t len = pos->toUint32(i);
  820|  2.88k|        object->strips_.emplace_back(zero, len);
  821|  2.88k|        sizeTotal += len;
  822|  2.88k|      }
  823|    122|      if (sizeTotal != sizeDataArea) {
  ------------------
  |  Branch (823:11): [True: 0, False: 122]
  ------------------
  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|    122|    }
  832|    122|  }
  833|       |
  834|  10.2k|  if (sizeDataArea == 0 && writeMethod() == wmIntrusive) {
  ------------------
  |  Branch (834:7): [True: 10.1k, False: 122]
  |  Branch (834:28): [True: 9.55k, False: 612]
  ------------------
  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|  9.55k|    if (pSourceTree_) {
  ------------------
  |  Branch (839:9): [True: 4.01k, False: 5.54k]
  ------------------
  840|  4.01k|      TiffFinder finder(object->tag(), object->group());
  841|  4.01k|      pSourceTree_->accept(finder);
  842|  4.01k|      if (auto ti = dynamic_cast<const TiffImageEntry*>(finder.result())) {
  ------------------
  |  Branch (842:16): [True: 4.01k, False: 3]
  ------------------
  843|  4.01k|        object->strips_ = ti->strips_;
  844|  4.01k|      }
  845|  4.01k|    }
  846|  5.54k|#ifndef SUPPRESS_WARNINGS
  847|  5.54k|    else {
  848|  5.54k|      ExifKey key2(object->tag(), groupName(object->group()));
  849|  5.54k|      EXV_WARNING << "No image data to encode " << key2 << ".\n";
  ------------------
  |  |  138|  5.54k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.54k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.54k|  LogMsg(LogMsg::warn).os()
  ------------------
  850|  5.54k|    }
  851|  9.55k|#endif
  852|  9.55k|  }
  853|       |
  854|  10.2k|}  // TiffEncoder::encodeImageEntry
_ZN5Exiv28Internal11TiffEncoder13encodeMnEntryEPNS0_11TiffMnEntryEPKNS_9ExifdatumE:
  856|  9.41k|void TiffEncoder::encodeMnEntry(TiffMnEntry* object, const Exifdatum* datum) {
  857|       |  // Test is required here as well as in the visit function
  858|  9.41k|  if (!object->mn_)
  ------------------
  |  Branch (858:7): [True: 9.33k, False: 83]
  ------------------
  859|  9.33k|    encodeTiffEntryBase(object, datum);
  860|  9.41k|}  // TiffEncoder::encodeMnEntry
_ZN5Exiv28Internal11TiffEncoder15encodeSizeEntryEPNS0_13TiffSizeEntryEPKNS_9ExifdatumE:
  862|  15.3k|void TiffEncoder::encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum) {
  863|  15.3k|  encodeTiffEntryBase(object, datum);
  864|  15.3k|}  // TiffEncoder::encodeSizeEntry
_ZN5Exiv28Internal11TiffEncoder12encodeSubIfdEPNS0_10TiffSubIfdEPKNS_9ExifdatumE:
  866|  1.28k|void TiffEncoder::encodeSubIfd(TiffSubIfd* object, const Exifdatum* datum) {
  867|  1.28k|  encodeOffsetEntry(object, datum);
  868|  1.28k|}  // TiffEncoder::encodeSubIfd
_ZN5Exiv28Internal11TiffEncoder19encodeTiffEntryBaseEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  870|  1.85M|void TiffEncoder::encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum) {
  871|       |#ifdef EXIV2_DEBUG_MESSAGES
  872|       |  bool tooLarge = false;
  873|       |#endif
  874|  1.85M|  if (datum->size() > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (874:7): [True: 626k, False: 1.22M]
  ------------------
  875|   626k|    setDirty();
  876|       |#ifdef EXIV2_DEBUG_MESSAGES
  877|       |    tooLarge = true;
  878|       |#endif
  879|   626k|  }
  880|  1.85M|  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|  1.85M|}
_ZN5Exiv28Internal11TiffEncoder17encodeOffsetEntryEPNS0_13TiffEntryBaseEPKNS_9ExifdatumE:
  890|  25.3k|void TiffEncoder::encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum) {
  891|  25.3k|  size_t newSize = datum->size();
  892|  25.3k|  if (newSize > object->size_) {  // value doesn't fit, encode for intrusive writing
  ------------------
  |  Branch (892:7): [True: 6.86k, False: 18.4k]
  ------------------
  893|  6.86k|    setDirty();
  894|  6.86k|    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|  18.4k|  } else {
  901|  18.4k|    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|  18.4k|  }
  908|  25.3k|}
_ZN5Exiv28Internal11TiffEncoder3addEPNS0_13TiffComponentENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEEj:
  910|  10.0k|void TiffEncoder::add(TiffComponent* pRootDir, TiffComponent::UniquePtr pSourceDir, uint32_t root) {
  911|  10.0k|  writeMethod_ = wmIntrusive;
  912|  10.0k|  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|  10.0k|  del_ = false;
  917|       |
  918|  10.0k|  auto posBo = exifData_.end();
  919|  1.89M|  for (auto i = exifData_.begin(); i != exifData_.end(); ++i) {
  ------------------
  |  Branch (919:36): [True: 1.88M, False: 10.0k]
  ------------------
  920|  1.88M|    IfdId group = groupId(i->groupName());
  921|       |    // Skip synthesized info tags
  922|  1.88M|    if (group == IfdId::mnId) {
  ------------------
  |  Branch (922:9): [True: 9.69k, False: 1.87M]
  ------------------
  923|  9.69k|      if (i->tag() == 0x0002) {
  ------------------
  |  Branch (923:11): [True: 4.84k, False: 4.84k]
  ------------------
  924|  4.84k|        posBo = i;
  925|  4.84k|      }
  926|  9.69k|      continue;
  927|  9.69k|    }
  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|  1.87M|    if (isImageTag(i->tag(), group))
  ------------------
  |  Branch (931:9): [True: 14.5k, False: 1.85M]
  ------------------
  932|  14.5k|      continue;
  933|       |
  934|       |    // Assumption is that the corresponding TIFF entry doesn't exist
  935|  1.85M|    auto tiffPath = TiffCreator::getPath(i->tag(), group, root);
  936|  1.85M|    TiffComponent* tc = pRootDir->addPath(i->tag(), tiffPath, pRootDir);
  937|  1.85M|    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|  1.85M|    if (object) {
  ------------------
  |  Branch (944:9): [True: 1.84M, False: 12.0k]
  ------------------
  945|  1.84M|      encodeTiffComponent(object, &(*i));
  946|  1.84M|    }
  947|  1.85M|  }
  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|  10.0k|  if (posBo == exifData_.end())
  ------------------
  |  Branch (956:7): [True: 5.18k, False: 4.84k]
  ------------------
  957|  5.18k|    return;
  958|       |
  959|  4.84k|  TiffFinder finder(0x927c, IfdId::exifId);
  960|  4.84k|  pRootDir->accept(finder);
  961|  4.84k|  if (auto te = dynamic_cast<const TiffMnEntry*>(finder.result())) {
  ------------------
  |  Branch (961:12): [True: 4.74k, False: 108]
  ------------------
  962|  4.74k|    if (const auto& mn = te->mn_) {
  ------------------
  |  Branch (962:21): [True: 4.73k, False: 11]
  ------------------
  963|       |      // Set Makernote byte order
  964|  4.73k|      ByteOrder bo = stringToByteOrder(posBo->toString());
  965|  4.73k|      if (bo != invalidByteOrder)
  ------------------
  |  Branch (965:11): [True: 4.73k, False: 0]
  ------------------
  966|  4.73k|        mn->setByteOrder(bo);
  967|  4.73k|    }
  968|  4.74k|  }
  969|       |
  970|  4.84k|}  // TiffEncoder::add
_ZN5Exiv28Internal10TiffReaderC2EPKhmPNS0_13TiffComponentENS0_11TiffRwStateE:
  973|  16.0k|    pData_(pData), size_(size), pLast_(pData + size), pRoot_(pRoot), origState_(state), mnState_(state) {
  974|  16.0k|  pState_ = &origState_;
  975|       |
  976|  16.0k|}  // TiffReader::TiffReader
_ZN5Exiv28Internal10TiffReader12setOrigStateEv:
  978|  20.5k|void TiffReader::setOrigState() {
  979|  20.5k|  pState_ = &origState_;
  980|  20.5k|}
_ZN5Exiv28Internal10TiffReader10setMnStateEPKNS0_11TiffRwStateE:
  982|  20.5k|void TiffReader::setMnState(const TiffRwState* state) {
  983|  20.5k|  if (state) {
  ------------------
  |  Branch (983:7): [True: 4.54k, False: 16.0k]
  ------------------
  984|       |    // invalidByteOrder indicates 'no change'
  985|  4.54k|    if (state->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (985:9): [True: 0, False: 4.54k]
  ------------------
  986|      0|      mnState_ = TiffRwState{origState_.byteOrder(), state->baseOffset()};
  987|  4.54k|    } else {
  988|  4.54k|      mnState_ = *state;
  989|  4.54k|    }
  990|  4.54k|  }
  991|  20.5k|  pState_ = &mnState_;
  992|  20.5k|}
_ZNK5Exiv28Internal10TiffReader9byteOrderEv:
  994|  7.47M|ByteOrder TiffReader::byteOrder() const {
  995|  7.47M|  return pState_->byteOrder();
  996|  7.47M|}
_ZNK5Exiv28Internal10TiffReader10baseOffsetEv:
  998|  1.15M|size_t TiffReader::baseOffset() const {
  999|  1.15M|  return pState_->baseOffset();
 1000|  1.15M|}
_ZN5Exiv28Internal10TiffReader17readDataEntryBaseEPNS0_17TiffDataEntryBaseE:
 1002|  40.9k|void TiffReader::readDataEntryBase(TiffDataEntryBase* object) {
 1003|  40.9k|  readTiffEntry(object);
 1004|  40.9k|  TiffFinder finder(object->szTag(), object->szGroup());
 1005|  40.9k|  pRoot_->accept(finder);
 1006|  40.9k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1007|  40.9k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1007:7): [True: 30.7k, False: 10.1k]
  |  Branch (1007:13): [True: 18.1k, False: 12.5k]
  ------------------
 1008|  18.1k|    object->setStrips(te->pValue(), pData_, size_, baseOffset());
 1009|  18.1k|  }
 1010|  40.9k|}
_ZN5Exiv28Internal10TiffReader10visitEntryEPNS0_9TiffEntryE:
 1012|  1.66M|void TiffReader::visitEntry(TiffEntry* object) {
 1013|  1.66M|  readTiffEntry(object);
 1014|  1.66M|}
_ZN5Exiv28Internal10TiffReader14visitDataEntryEPNS0_13TiffDataEntryE:
 1016|  9.78k|void TiffReader::visitDataEntry(TiffDataEntry* object) {
 1017|  9.78k|  readDataEntryBase(object);
 1018|  9.78k|}
_ZN5Exiv28Internal10TiffReader15visitImageEntryEPNS0_14TiffImageEntryE:
 1020|  31.1k|void TiffReader::visitImageEntry(TiffImageEntry* object) {
 1021|  31.1k|  readDataEntryBase(object);
 1022|  31.1k|}
_ZN5Exiv28Internal10TiffReader14visitSizeEntryEPNS0_13TiffSizeEntryE:
 1024|  44.1k|void TiffReader::visitSizeEntry(TiffSizeEntry* object) {
 1025|  44.1k|  readTiffEntry(object);
 1026|  44.1k|  TiffFinder finder(object->dtTag(), object->dtGroup());
 1027|  44.1k|  pRoot_->accept(finder);
 1028|  44.1k|  auto te = dynamic_cast<TiffDataEntryBase*>(finder.result());
 1029|  44.1k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1029:7): [True: 30.0k, False: 14.0k]
  |  Branch (1029:13): [True: 23.3k, False: 6.73k]
  ------------------
 1030|  23.3k|    te->setStrips(object->pValue(), pData_, size_, baseOffset());
 1031|  23.3k|  }
 1032|  44.1k|}
_ZN5Exiv28Internal10TiffReader17circularReferenceEPKhNS_5IfdIdE:
 1034|  68.6k|bool TiffReader::circularReference(const byte* start, IfdId group) {
 1035|  68.6k|  if (auto pos = dirList_.find(start); pos != dirList_.end()) {
  ------------------
  |  Branch (1035:40): [True: 8.06k, False: 60.5k]
  ------------------
 1036|  8.06k|#ifndef SUPPRESS_WARNINGS
 1037|  8.06k|    EXV_ERROR << groupName(group) << " pointer references previously read " << groupName(pos->second)
  ------------------
  |  |  142|  8.06k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 8.06k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  8.06k|  LogMsg(LogMsg::error).os()
  ------------------
 1038|      0|              << " directory; ignored.\n";
 1039|  8.06k|#endif
 1040|  8.06k|    return true;
 1041|  8.06k|  }
 1042|  60.5k|  dirList_[start] = group;
 1043|  60.5k|  return false;
 1044|  68.6k|}
_ZN5Exiv28Internal10TiffReader7nextIdxENS_5IfdIdE:
 1046|  2.01M|int TiffReader::nextIdx(IfdId group) {
 1047|  2.01M|  return ++idxSeq_[group];
 1048|  2.01M|}
_ZN5Exiv28Internal10TiffReader11postProcessEv:
 1050|  16.0k|void TiffReader::postProcess() {
 1051|  16.0k|  setMnState();  // All components to be post-processed must be from the Makernote
 1052|  16.0k|  postProc_ = true;
 1053|  16.0k|  for (auto pos : postList_) {
  ------------------
  |  Branch (1053:17): [True: 9.24k, False: 16.0k]
  ------------------
 1054|  9.24k|    pos->accept(*this);
 1055|  9.24k|  }
 1056|  16.0k|  postProc_ = false;
 1057|  16.0k|  setOrigState();
 1058|  16.0k|}
_ZN5Exiv28Internal10TiffReader14visitDirectoryEPNS0_13TiffDirectoryE:
 1060|  68.6k|void TiffReader::visitDirectory(TiffDirectory* object) {
 1061|  68.6k|  const byte* p = object->start();
 1062|       |
 1063|  68.6k|  if (circularReference(object->start(), object->group()))
  ------------------
  |  Branch (1063:7): [True: 8.06k, False: 60.5k]
  ------------------
 1064|  8.06k|    return;
 1065|       |
 1066|  60.5k|  if (p + 2 > pLast_) {
  ------------------
  |  Branch (1066:7): [True: 142, False: 60.4k]
  ------------------
 1067|    142|#ifndef SUPPRESS_WARNINGS
 1068|    142|    EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD exceeds data buffer, cannot read entry count.\n";
  ------------------
  |  |  142|    142|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 142]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    142|  LogMsg(LogMsg::error).os()
  ------------------
 1069|    142|#endif
 1070|    142|    return;
 1071|    142|  }
 1072|  60.4k|  const uint16_t n = getUShort(p, byteOrder());
 1073|  60.4k|  p += 2;
 1074|       |  // Sanity check with an "unreasonably" large number
 1075|  60.4k|  if (n > 256) {
  ------------------
  |  Branch (1075:7): [True: 12.0k, False: 48.3k]
  ------------------
 1076|  12.0k|#ifndef SUPPRESS_WARNINGS
 1077|  12.0k|    EXV_ERROR << "Directory " << groupName(object->group()) << " with " << n
  ------------------
  |  |  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()
  ------------------
 1078|      0|              << " entries considered invalid; not read.\n";
 1079|  12.0k|#endif
 1080|  12.0k|    return;
 1081|  12.0k|  }
 1082|  1.92M|  for (uint16_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (1082:24): [True: 1.91M, False: 17.8k]
  ------------------
 1083|  1.91M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1083:9): [True: 30.5k, False: 1.88M]
  ------------------
 1084|  30.5k|#ifndef SUPPRESS_WARNINGS
 1085|  30.5k|      EXV_ERROR << "Directory " << groupName(object->group()) << ": IFD entry " << i
  ------------------
  |  |  142|  30.5k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 30.5k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  30.5k|  LogMsg(LogMsg::error).os()
  ------------------
 1086|      0|                << " lies outside of the data buffer.\n";
 1087|  30.5k|#endif
 1088|  30.5k|      return;
 1089|  30.5k|    }
 1090|  1.88M|    uint16_t tag = getUShort(p, byteOrder());
 1091|  1.88M|    if (auto tc = TiffCreator::create(tag, object->group())) {
  ------------------
  |  Branch (1091:14): [True: 1.81M, False: 68.1k]
  ------------------
 1092|  1.81M|      tc->setStart(p);
 1093|  1.81M|      object->addChild(std::move(tc));
 1094|  1.81M|    } else {
 1095|  68.1k|#ifndef SUPPRESS_WARNINGS
 1096|  68.1k|      EXV_WARNING << "Unable to handle tag " << tag << ".\n";
  ------------------
  |  |  138|  68.1k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 68.1k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  68.1k|  LogMsg(LogMsg::warn).os()
  ------------------
 1097|  68.1k|#endif
 1098|  68.1k|    }
 1099|  1.88M|    p += 12;
 1100|  1.88M|  }
 1101|       |
 1102|  17.8k|  if (object->hasNext()) {
  ------------------
  |  Branch (1102:7): [True: 17.8k, False: 26]
  ------------------
 1103|  17.8k|    if (p + 4 > pLast_) {
  ------------------
  |  Branch (1103:9): [True: 173, False: 17.6k]
  ------------------
 1104|    173|#ifndef SUPPRESS_WARNINGS
 1105|    173|      EXV_ERROR << "Directory " << groupName(object->group())
  ------------------
  |  |  142|    173|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 173]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    173|  LogMsg(LogMsg::error).os()
  ------------------
 1106|      0|                << ": IFD exceeds data buffer, cannot read next pointer.\n";
 1107|    173|#endif
 1108|    173|      return;
 1109|    173|    }
 1110|  17.6k|    TiffComponent::UniquePtr tc;
 1111|  17.6k|    uint32_t next = getULong(p, byteOrder());
 1112|  17.6k|    if (next) {
  ------------------
  |  Branch (1112:9): [True: 15.5k, False: 2.10k]
  ------------------
 1113|  15.5k|      tc = TiffCreator::create(Tag::next, object->group());
 1114|  15.5k|#ifndef SUPPRESS_WARNINGS
 1115|  15.5k|      if (!tc) {
  ------------------
  |  Branch (1115:11): [True: 11.5k, False: 3.95k]
  ------------------
 1116|  11.5k|        EXV_WARNING << "Directory " << groupName(object->group()) << " has an unexpected next pointer; ignored.\n";
  ------------------
  |  |  138|  11.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  11.5k|  LogMsg(LogMsg::warn).os()
  ------------------
 1117|  11.5k|      }
 1118|  15.5k|#endif
 1119|  15.5k|    }
 1120|  17.6k|    if (tc) {
  ------------------
  |  Branch (1120:9): [True: 3.95k, False: 13.6k]
  ------------------
 1121|  3.95k|      if (baseOffset() + next > size_) {
  ------------------
  |  Branch (1121:11): [True: 2.21k, False: 1.74k]
  ------------------
 1122|  2.21k|#ifndef SUPPRESS_WARNINGS
 1123|  2.21k|        EXV_ERROR << "Directory " << groupName(object->group()) << ": Next pointer is out of bounds; ignored.\n";
  ------------------
  |  |  142|  2.21k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.21k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.21k|  LogMsg(LogMsg::error).os()
  ------------------
 1124|  2.21k|#endif
 1125|  2.21k|        return;
 1126|  2.21k|      }
 1127|  1.74k|      tc->setStart(pData_ + baseOffset() + next);
 1128|  1.74k|      object->addNext(std::move(tc));
 1129|  1.74k|    }
 1130|  17.6k|  }  // object->hasNext()
 1131|       |
 1132|  17.8k|}  // TiffReader::visitDirectory
_ZN5Exiv28Internal10TiffReader11visitSubIfdEPNS0_10TiffSubIfdE:
 1134|  13.6k|void TiffReader::visitSubIfd(TiffSubIfd* object) {
 1135|  13.6k|  readTiffEntry(object);
 1136|  13.6k|  if ((object->tiffType() == ttUnsignedLong || object->tiffType() == ttSignedLong || object->tiffType() == ttTiffIfd) &&
  ------------------
  |  Branch (1136:8): [True: 8.04k, False: 5.57k]
  |  Branch (1136:48): [True: 2.11k, False: 3.45k]
  |  Branch (1136:86): [True: 2.23k, False: 1.22k]
  ------------------
 1137|  12.3k|      object->count() >= 1) {
  ------------------
  |  Branch (1137:7): [True: 8.92k, False: 3.46k]
  ------------------
 1138|       |    // Todo: Fix hack
 1139|  8.92k|    uint32_t maxi = 9;
 1140|  8.92k|    if (object->group() == IfdId::ifd1Id)
  ------------------
  |  Branch (1140:9): [True: 119, False: 8.80k]
  ------------------
 1141|    119|      maxi = 1;
 1142|  55.3k|    for (uint32_t i = 0; i < object->count(); ++i) {
  ------------------
  |  Branch (1142:26): [True: 53.9k, False: 1.41k]
  ------------------
 1143|  53.9k|      uint32_t offset = getULong(object->pData() + (4 * i), byteOrder());
 1144|  53.9k|      if (baseOffset() + offset > size_) {
  ------------------
  |  Branch (1144:11): [True: 7.29k, False: 46.6k]
  ------------------
 1145|  7.29k|#ifndef SUPPRESS_WARNINGS
 1146|  7.29k|        EXV_ERROR << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  142|  7.29k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 7.29k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  7.29k|  LogMsg(LogMsg::error).os()
  ------------------
 1147|      0|                  << std::hex << object->tag() << " Sub-IFD pointer " << i << " is out of bounds; ignoring it.\n";
 1148|  7.29k|#endif
 1149|  7.29k|        return;
 1150|  7.29k|      }
 1151|  46.6k|      if (i >= maxi) {
  ------------------
  |  Branch (1151:11): [True: 216, False: 46.4k]
  ------------------
 1152|    216|#ifndef SUPPRESS_WARNINGS
 1153|    216|        EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|    216|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 216]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    216|  LogMsg(LogMsg::warn).os()
  ------------------
 1154|      0|                    << std::hex << object->tag() << ": Skipping sub-IFDs beyond the first " << i << ".\n";
 1155|    216|#endif
 1156|    216|        break;
 1157|    216|      }
 1158|       |      // If there are multiple dirs, group is incremented for each
 1159|  46.4k|      auto td = std::make_unique<TiffDirectory>(object->tag(),
 1160|  46.4k|                                                static_cast<IfdId>(static_cast<uint32_t>(object->newGroup_) + i));
 1161|  46.4k|      td->setStart(pData_ + baseOffset() + offset);
 1162|  46.4k|      object->addChild(std::move(td));
 1163|  46.4k|    }
 1164|  8.92k|  }
 1165|  4.69k|#ifndef SUPPRESS_WARNINGS
 1166|  4.69k|  else {
 1167|  4.69k|    EXV_WARNING << "Directory " << groupName(object->group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
  ------------------
  |  |  138|  4.69k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.69k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.69k|  LogMsg(LogMsg::warn).os()
  ------------------
 1168|      0|                << std::hex << object->tag() << " doesn't look like a sub-IFD.\n";
 1169|  4.69k|  }
 1170|  13.6k|#endif
 1171|       |
 1172|  13.6k|}  // TiffReader::visitSubIfd
_ZN5Exiv28Internal10TiffReader12visitMnEntryEPNS0_11TiffMnEntryE:
 1174|  13.2k|void TiffReader::visitMnEntry(TiffMnEntry* object) {
 1175|  13.2k|  readTiffEntry(object);
 1176|       |  // Find camera make
 1177|  13.2k|  TiffFinder finder(0x010f, IfdId::ifd0Id);
 1178|  13.2k|  pRoot_->accept(finder);
 1179|  13.2k|  auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 1180|  13.2k|  if (te && te->pValue()) {
  ------------------
  |  Branch (1180:7): [True: 12.7k, False: 499]
  |  Branch (1180:13): [True: 12.2k, False: 520]
  ------------------
 1181|  12.2k|    auto make = te->pValue()->toString();
 1182|       |    // create concrete makernote, based on make and makernote contents
 1183|  12.2k|    object->mn_ =
 1184|  12.2k|        TiffMnCreator::create(object->tag(), object->mnGroup_, make, object->pData_, object->size_, byteOrder());
 1185|  12.2k|  }
 1186|  13.2k|  if (object->mn_)
  ------------------
  |  Branch (1186:7): [True: 5.04k, False: 8.23k]
  ------------------
 1187|  5.04k|    object->mn_->setStart(object->pData());
 1188|       |
 1189|  13.2k|}  // TiffReader::visitMnEntry
_ZN5Exiv28Internal10TiffReader17visitIfdMakernoteEPNS0_16TiffIfdMakernoteE:
 1191|  5.04k|void TiffReader::visitIfdMakernote(TiffIfdMakernote* object) {
 1192|  5.04k|  object->setImageByteOrder(byteOrder());  // set the byte order for the image
 1193|       |
 1194|  5.04k|  if (!object->readHeader(object->start(), pLast_ - object->start(), byteOrder())) {
  ------------------
  |  Branch (1194:7): [True: 498, False: 4.54k]
  ------------------
 1195|    498|#ifndef SUPPRESS_WARNINGS
 1196|    498|    EXV_ERROR << "Failed to read " << groupName(object->ifd_.group()) << " IFD Makernote header.\n";
  ------------------
  |  |  142|    498|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 498]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    498|  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|    498|#endif  // SUPPRESS_WARNINGS
 1203|    498|    setGo(geKnownMakernote, false);
 1204|    498|    return;
 1205|    498|  }
 1206|       |
 1207|  4.54k|  object->ifd_.setStart(object->start() + object->ifdOffset());
 1208|       |
 1209|       |  // Modify reader for Makernote peculiarities, byte order and offset
 1210|  4.54k|  object->mnOffset_ = object->start() - pData_;
 1211|  4.54k|  auto state = TiffRwState{object->byteOrder(), object->baseOffset()};
 1212|  4.54k|  setMnState(&state);
 1213|       |
 1214|  4.54k|}  // TiffReader::visitIfdMakernote
_ZN5Exiv28Internal10TiffReader20visitIfdMakernoteEndEPNS0_16TiffIfdMakernoteE:
 1216|  4.53k|void TiffReader::visitIfdMakernoteEnd(TiffIfdMakernote* /*object*/) {
 1217|       |  // Reset state (byte order, create function, offset) back to that for the image
 1218|  4.53k|  setOrigState();
 1219|  4.53k|}  // TiffReader::visitIfdMakernoteEnd
_ZN5Exiv28Internal10TiffReader13readTiffEntryEPNS0_13TiffEntryBaseE:
 1221|  1.78M|void TiffReader::readTiffEntry(TiffEntryBase* object) {
 1222|  1.78M|  try {
 1223|  1.78M|    byte* p = object->start();
 1224|       |
 1225|  1.78M|    if (p + 12 > pLast_) {
  ------------------
  |  Branch (1225:9): [True: 3, False: 1.78M]
  ------------------
 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|  1.78M|    p += 2;
 1234|  1.78M|    auto tiffType = static_cast<TiffType>(getUShort(p, byteOrder()));
 1235|  1.78M|    TypeId typeId = toTypeId(tiffType, object->tag(), object->group());
 1236|  1.78M|    size_t typeSize = TypeInfo::typeSize(typeId);
 1237|  1.78M|    if (0 == typeSize) {
  ------------------
  |  Branch (1237:9): [True: 1.59M, False: 193k]
  ------------------
 1238|  1.59M|#ifndef SUPPRESS_WARNINGS
 1239|  1.59M|      EXV_WARNING << stringFormat(
  ------------------
  |  |  138|  1.59M|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.59M]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.59M|  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|  1.59M|#endif
 1243|  1.59M|      typeSize = 1;
 1244|  1.59M|    }
 1245|  1.78M|    p += 2;
 1246|  1.78M|    uint32_t count = getULong(p, byteOrder());
 1247|  1.78M|    if (count >= 0x10000000) {
  ------------------
  |  Branch (1247:9): [True: 895k, False: 891k]
  ------------------
 1248|   895k|#ifndef SUPPRESS_WARNINGS
 1249|   895k|      EXV_ERROR << stringFormat("Directory {}, entry 0x{:04x} has invalid size {}*{}; skipping entry.\n",
  ------------------
  |  |  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()
  ------------------
                    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|   895k|#endif
 1252|   895k|      return;
 1253|   895k|    }
 1254|   891k|    p += 4;
 1255|       |
 1256|   891k|    if (count > std::numeric_limits<size_t>::max() / typeSize) {
  ------------------
  |  Branch (1256:9): [True: 0, False: 891k]
  ------------------
 1257|      0|      throw Error(ErrorCode::kerArithmeticOverflow);
 1258|      0|    }
 1259|   891k|    size_t size = typeSize * count;
 1260|   891k|    size_t offset = getULong(p, byteOrder());
 1261|   891k|    byte* pData = p;
 1262|   891k|    if (size > 4 && Safe::add<size_t>(baseOffset(), offset) >= size_) {
  ------------------
  |  Branch (1262:9): [True: 684k, False: 206k]
  |  Branch (1262:21): [True: 521k, False: 163k]
  ------------------
 1263|       |      // #1143
 1264|   521k|      if (object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1") {
  ------------------
  |  Branch (1264:11): [True: 449, False: 521k]
  |  Branch (1264:11): [True: 61, False: 521k]
  |  Branch (1264:38): [True: 61, False: 388]
  ------------------
 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|     61|        typeId = undefined;
 1277|     61|        size = 0;
 1278|   521k|      } else {
 1279|   521k|#ifndef SUPPRESS_WARNINGS
 1280|   521k|        EXV_ERROR << "Offset of directory " << groupName(object->group()) << ", entry 0x" << std::setw(4)
  ------------------
  |  |  142|   521k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 521k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|   521k|  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|   521k|#endif
 1284|   521k|      }
 1285|   521k|      size = 0;
 1286|   521k|    }
 1287|   891k|    if (size > 4) {
  ------------------
  |  Branch (1287:9): [True: 163k, False: 728k]
  ------------------
 1288|       |      // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
 1289|       |      // as offset can be arbitrarily large
 1290|   163k|      if (Safe::add<size_t>(baseOffset(), offset) > static_cast<size_t>(pLast_ - pData_)) {
  ------------------
  |  Branch (1290:11): [True: 0, False: 163k]
  ------------------
 1291|      0|        throw Error(ErrorCode::kerCorruptedMetadata);
 1292|      0|      }
 1293|   163k|      pData = const_cast<byte*>(pData_) + baseOffset() + offset;
 1294|       |
 1295|       |      // check for size being invalid
 1296|   163k|      if (size > static_cast<size_t>(pLast_ - pData)) {
  ------------------
  |  Branch (1296:11): [True: 76.6k, False: 86.4k]
  ------------------
 1297|  76.6k|#ifndef SUPPRESS_WARNINGS
 1298|  76.6k|        EXV_ERROR << "Upper boundary of data for " << "directory " << groupName(object->group()) << ", entry 0x"
  ------------------
  |  |  142|  76.6k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 76.6k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  76.6k|  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|  76.6k|#endif
 1306|  76.6k|        size = 0;
 1307|  76.6k|      }
 1308|   163k|    }
 1309|   891k|    auto v = Value::create(typeId);
 1310|   891k|    enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1311|   891k|    v->read(pData, size, byteOrder());
 1312|       |
 1313|   891k|    object->setValue(std::move(v));
 1314|   891k|    auto d = std::make_shared<DataBuf>();
 1315|   891k|    object->setData(pData, size, std::move(d));
 1316|   891k|    object->setOffset(offset);
 1317|   891k|    object->setIdx(nextIdx(object->group()));
 1318|   891k|  } catch (std::overflow_error&) {
 1319|      0|    throw Error(ErrorCode::kerCorruptedMetadata);  // #562 don't throw std::overflow_error
 1320|      0|  }
 1321|  1.78M|}  // TiffReader::readTiffEntry
_ZN5Exiv28Internal10TiffReader16visitBinaryArrayEPNS0_15TiffBinaryArrayE:
 1323|  18.4k|void TiffReader::visitBinaryArray(TiffBinaryArray* object) {
 1324|  18.4k|  if (!postProc_) {
  ------------------
  |  Branch (1324:7): [True: 9.24k, False: 9.24k]
  ------------------
 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|  9.24k|    readTiffEntry(object);
 1328|  9.24k|    object->iniOrigDataBuf();
 1329|  9.24k|    postList_.push_back(object);
 1330|  9.24k|    return;
 1331|  9.24k|  }
 1332|       |  // Check duplicates
 1333|  9.24k|  TiffFinder finder(object->tag(), object->group());
 1334|  9.24k|  pRoot_->accept(finder);
 1335|  9.24k|  if (auto te = dynamic_cast<const TiffEntryBase*>(finder.result())) {
  ------------------
  |  Branch (1335:12): [True: 8.41k, False: 828]
  ------------------
 1336|  8.41k|    if (te->idx() != object->idx()) {
  ------------------
  |  Branch (1336:9): [True: 3.82k, False: 4.59k]
  ------------------
 1337|  3.82k|#ifndef SUPPRESS_WARNINGS
 1338|  3.82k|      EXV_WARNING << "Not decoding duplicate binary array tag 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  3.82k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.82k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.82k|  LogMsg(LogMsg::warn).os()
  ------------------
 1339|      0|                  << object->tag() << std::dec << ", group " << groupName(object->group()) << ", idx " << object->idx()
 1340|      0|                  << "\n";
 1341|  3.82k|#endif
 1342|  3.82k|      object->setDecoded(false);
 1343|  3.82k|      return;
 1344|  3.82k|    }
 1345|  8.41k|  }
 1346|       |
 1347|  5.42k|  if (object->TiffEntryBase::doSize() == 0)
  ------------------
  |  Branch (1347:7): [True: 2.58k, False: 2.84k]
  ------------------
 1348|  2.58k|    return;
 1349|  2.84k|  if (!object->initialize(pRoot_))
  ------------------
  |  Branch (1349:7): [True: 574, False: 2.26k]
  ------------------
 1350|    574|    return;
 1351|  2.26k|  const ArrayCfg* cfg = object->cfg();
 1352|  2.26k|  if (!cfg)
  ------------------
  |  Branch (1352:7): [True: 0, False: 2.26k]
  ------------------
 1353|      0|    return;
 1354|       |
 1355|  2.26k|  if (auto cryptFct = cfg->cryptFct_) {
  ------------------
  |  Branch (1355:12): [True: 758, False: 1.50k]
  ------------------
 1356|    758|    const byte* pData = object->pData();
 1357|    758|    size_t size = object->TiffEntryBase::doSize();
 1358|    758|    auto buf = std::make_shared<DataBuf>(cryptFct(object->tag(), pData, size, pRoot_));
 1359|    758|    if (!buf->empty())
  ------------------
  |  Branch (1359:9): [True: 529, False: 229]
  ------------------
 1360|    529|      object->setData(std::move(buf));
 1361|    758|  }
 1362|       |
 1363|  2.26k|  const ArrayDef* defs = object->def();
 1364|  2.26k|  const ArrayDef* defsEnd = defs + object->defSize();
 1365|  2.26k|  const ArrayDef* def = &cfg->elDefaultDef_;
 1366|  2.26k|  ArrayDef gap = *def;
 1367|       |
 1368|  1.10M|  for (size_t idx = 0; idx < object->TiffEntryBase::doSize();) {
  ------------------
  |  Branch (1368:24): [True: 1.10M, False: 2.26k]
  ------------------
 1369|  1.10M|    if (defs) {
  ------------------
  |  Branch (1369:9): [True: 1.01M, False: 90.2k]
  ------------------
 1370|  1.01M|      def = std::find(defs, defsEnd, idx);
 1371|  1.01M|      if (def == defsEnd) {
  ------------------
  |  Branch (1371:11): [True: 1.00M, False: 6.72k]
  ------------------
 1372|  1.00M|        if (cfg->concat_) {
  ------------------
  |  Branch (1372:13): [True: 536, False: 1.00M]
  ------------------
 1373|       |          // Determine gap-size
 1374|    536|          const ArrayDef* xdef = defs;
 1375|  2.32k|          for (; xdef != defsEnd && xdef->idx_ <= idx; ++xdef) {
  ------------------
  |  Branch (1375:18): [True: 2.18k, False: 135]
  |  Branch (1375:37): [True: 1.78k, False: 401]
  ------------------
 1376|  1.78k|          }
 1377|    536|          size_t gapSize = 0;
 1378|    536|          if (xdef != defsEnd && xdef->idx_ > idx) {
  ------------------
  |  Branch (1378:15): [True: 401, False: 135]
  |  Branch (1378:34): [True: 401, False: 0]
  ------------------
 1379|    401|            gapSize = xdef->idx_ - idx;
 1380|    401|          } else {
 1381|    135|            gapSize = object->TiffEntryBase::doSize() - idx;
 1382|    135|          }
 1383|    536|          gap.idx_ = idx;
 1384|    536|          gap.tiffType_ = cfg->elDefaultDef_.tiffType_;
 1385|    536|          gap.count_ = gapSize / cfg->tagStep();
 1386|    536|          if (gap.count_ * cfg->tagStep() != gapSize) {
  ------------------
  |  Branch (1386:15): [True: 7, False: 529]
  ------------------
 1387|      7|            gap.tiffType_ = ttUndefined;
 1388|      7|            gap.count_ = gapSize;
 1389|      7|          }
 1390|    536|          def = &gap;
 1391|  1.00M|        } else {
 1392|  1.00M|          def = &cfg->elDefaultDef_;
 1393|  1.00M|        }
 1394|  1.00M|      }
 1395|  1.01M|    }
 1396|  1.10M|    idx += object->addElement(idx, *def);  // idx may be different from def->idx_
 1397|  1.10M|  }
 1398|       |
 1399|  2.26k|}  // TiffReader::visitBinaryArray
_ZN5Exiv28Internal10TiffReader18visitBinaryElementEPNS0_17TiffBinaryElementE:
 1401|  1.12M|void TiffReader::visitBinaryElement(TiffBinaryElement* object) {
 1402|  1.12M|  auto pData = object->start();
 1403|  1.12M|  size_t size = object->TiffEntryBase::doSize();
 1404|  1.12M|  ByteOrder bo = object->elByteOrder();
 1405|  1.12M|  if (bo == invalidByteOrder)
  ------------------
  |  Branch (1405:7): [True: 78.6k, False: 1.04M]
  ------------------
 1406|  78.6k|    bo = byteOrder();
 1407|  1.12M|  TypeId typeId = toTypeId(object->elDef()->tiffType_, object->tag(), object->group());
 1408|  1.12M|  auto v = Value::create(typeId);
 1409|  1.12M|  enforce(v != nullptr, ErrorCode::kerCorruptedMetadata);
 1410|  1.12M|  v->read(pData, size, bo);
 1411|       |
 1412|  1.12M|  object->setValue(std::move(v));
 1413|  1.12M|  object->setOffset(0);
 1414|  1.12M|  object->setIdx(nextIdx(object->group()));
 1415|  1.12M|}
tiffvisitor_int.cpp:_ZN5Exiv28InternalL7findTagEPKNS_7TagInfoEt:
  341|  6.60k|static const TagInfo* findTag(const TagInfo* pList, uint16_t tag) {
  342|   462k|  while (pList->tag_ != 0xffff && pList->tag_ != tag)
  ------------------
  |  Branch (342:10): [True: 462k, False: 0]
  |  Branch (342:35): [True: 455k, False: 6.60k]
  ------------------
  343|   455k|    pList++;
  344|  6.60k|  return pList->tag_ != 0xffff ? pList : nullptr;
  ------------------
  |  Branch (344:10): [True: 6.60k, False: 0]
  ------------------
  345|  6.60k|}
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_117stringToByteOrderENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   48|  4.90k|Exiv2::ByteOrder stringToByteOrder(std::string_view val) {
   49|  4.90k|  if (val == "II")
  ------------------
  |  Branch (49:7): [True: 120, False: 4.78k]
  ------------------
   50|    120|    return Exiv2::littleEndian;
   51|  4.78k|  if (val == "MM")
  ------------------
  |  Branch (51:7): [True: 4.78k, False: 0]
  ------------------
   52|  4.78k|    return Exiv2::bigEndian;
   53|       |
   54|      0|  return Exiv2::invalidByteOrder;
   55|  4.78k|}
tiffvisitor_int.cpp:_ZNK12_GLOBAL__N_114FindExifdatum2clERKN5Exiv29ExifdatumE:
   38|   319k|  bool operator()(const Exiv2::Exifdatum& md) const {
   39|   319k|    return idx_ == md.idx() && md.groupName() == groupName_;
  ------------------
  |  Branch (39:12): [True: 2.37k, False: 317k]
  |  Branch (39:32): [True: 102, False: 2.27k]
  ------------------
   40|   319k|  }
tiffvisitor_int.cpp:_ZN12_GLOBAL__N_114FindExifdatum2C2EN5Exiv25IfdIdEi:
   35|  3.91k|  FindExifdatum2(Exiv2::IfdId group, int idx) : groupName_(Exiv2::Internal::groupName(group)), idx_(idx) {
   36|  3.91k|  }

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

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

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   19|  2.89M|Value::Value(TypeId typeId) : type_(typeId) {
   20|  2.89M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   22|  2.15M|Value::UniquePtr Value::create(TypeId typeId) {
   23|  2.15M|  switch (typeId) {
   24|      0|    case invalidTypeId:
  ------------------
  |  Branch (24:5): [True: 0, False: 2.15M]
  ------------------
   25|  2.34k|    case signedByte:
  ------------------
  |  Branch (25:5): [True: 2.34k, False: 2.14M]
  ------------------
   26|  1.01M|    case unsignedByte:
  ------------------
  |  Branch (26:5): [True: 1.01M, False: 1.13M]
  ------------------
   27|  1.01M|      return std::make_unique<DataValue>(typeId);
   28|  29.2k|    case asciiString:
  ------------------
  |  Branch (28:5): [True: 29.2k, False: 2.12M]
  ------------------
   29|  29.2k|      return std::make_unique<AsciiValue>();
   30|  37.8k|    case unsignedShort:
  ------------------
  |  Branch (30:5): [True: 37.8k, False: 2.11M]
  ------------------
   31|  37.8k|      return std::make_unique<ValueType<uint16_t>>();
   32|  75.4k|    case unsignedLong:
  ------------------
  |  Branch (32:5): [True: 75.4k, False: 2.07M]
  ------------------
   33|  83.3k|    case tiffIfd:
  ------------------
  |  Branch (33:5): [True: 7.98k, False: 2.14M]
  ------------------
   34|  83.3k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   35|  8.04k|    case unsignedRational:
  ------------------
  |  Branch (35:5): [True: 8.04k, False: 2.14M]
  ------------------
   36|  8.04k|      return std::make_unique<ValueType<URational>>();
   37|  34.5k|    case undefined:
  ------------------
  |  Branch (37:5): [True: 34.5k, False: 2.11M]
  ------------------
   38|  34.5k|      return std::make_unique<DataValue>();
   39|  17.3k|    case signedShort:
  ------------------
  |  Branch (39:5): [True: 17.3k, False: 2.13M]
  ------------------
   40|  17.3k|      return std::make_unique<ValueType<int16_t>>();
   41|  53.1k|    case signedLong:
  ------------------
  |  Branch (41:5): [True: 53.1k, False: 2.09M]
  ------------------
   42|  53.1k|      return std::make_unique<ValueType<int32_t>>();
   43|  7.85k|    case signedRational:
  ------------------
  |  Branch (43:5): [True: 7.85k, False: 2.14M]
  ------------------
   44|  7.85k|      return std::make_unique<ValueType<Rational>>();
   45|  5.61k|    case tiffFloat:
  ------------------
  |  Branch (45:5): [True: 5.61k, False: 2.14M]
  ------------------
   46|  5.61k|      return std::make_unique<ValueType<float>>();
   47|  8.38k|    case tiffDouble:
  ------------------
  |  Branch (47:5): [True: 8.38k, False: 2.14M]
  ------------------
   48|  8.38k|      return std::make_unique<ValueType<double>>();
   49|  71.3k|    case string:
  ------------------
  |  Branch (49:5): [True: 71.3k, False: 2.07M]
  ------------------
   50|  71.3k|      return std::make_unique<StringValue>();
   51|  3.93k|    case date:
  ------------------
  |  Branch (51:5): [True: 3.93k, False: 2.14M]
  ------------------
   52|  3.93k|      return std::make_unique<DateValue>();
   53|  7.28k|    case time:
  ------------------
  |  Branch (53:5): [True: 7.28k, False: 2.14M]
  ------------------
   54|  7.28k|      return std::make_unique<TimeValue>();
   55|  5.37k|    case comment:
  ------------------
  |  Branch (55:5): [True: 5.37k, False: 2.14M]
  ------------------
   56|  5.37k|      return std::make_unique<CommentValue>();
   57|  29.0k|    case xmpText:
  ------------------
  |  Branch (57:5): [True: 29.0k, False: 2.12M]
  ------------------
   58|  29.0k|      return std::make_unique<XmpTextValue>();
   59|     13|    case xmpBag:
  ------------------
  |  Branch (59:5): [True: 13, False: 2.15M]
  ------------------
   60|  8.89k|    case xmpSeq:
  ------------------
  |  Branch (60:5): [True: 8.88k, False: 2.14M]
  ------------------
   61|  8.89k|    case xmpAlt:
  ------------------
  |  Branch (61:5): [True: 0, False: 2.15M]
  ------------------
   62|  8.89k|      return std::make_unique<XmpArrayValue>(typeId);
   63|    375|    case langAlt:
  ------------------
  |  Branch (63:5): [True: 375, False: 2.15M]
  ------------------
   64|    375|      return std::make_unique<LangAltValue>();
   65|   723k|    default:
  ------------------
  |  Branch (65:5): [True: 723k, False: 1.42M]
  ------------------
   66|   723k|      return std::make_unique<DataValue>(typeId);
   67|  2.15M|  }
   68|  2.15M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   70|    788|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   71|    788|  return -1;
   72|    788|}
_ZNK5Exiv25Value8toStringEv:
   74|   264k|std::string Value::toString() const {
   75|   264k|  std::ostringstream os;
   76|   264k|  write(os);
   77|   264k|  ok_ = !os.fail();
   78|   264k|  return os.str();
   79|   264k|}
_ZNK5Exiv25Value8toStringEm:
   81|   180k|std::string Value::toString(size_t /*n*/) const {
   82|   180k|  return toString();
   83|   180k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   85|  23.3k|size_t Value::sizeDataArea() const {
   86|  23.3k|  return 0;
   87|  23.3k|}
_ZNK5Exiv25Value8dataAreaEv:
   89|  1.44k|DataBuf Value::dataArea() const {
   90|  1.44k|  return {nullptr, 0};
   91|  1.44k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   93|  1.77M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   94|  1.77M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   96|     15|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   97|     15|  read(buf, len, byteOrder);
   98|     15|}
_ZNK5Exiv29DataValue5countEv:
  100|  6.81M|size_t DataValue::count() const {
  101|  6.81M|  return size();
  102|  6.81M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  104|  1.77M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  105|       |  // byteOrder not needed
  106|  1.77M|  value_.assign(buf, buf + len);
  107|  1.77M|  return 0;
  108|  1.77M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  122|  2.27M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  123|       |  // byteOrder not needed
  124|  2.27M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  125|  2.27M|}
_ZNK5Exiv29DataValue4sizeEv:
  127|  15.3M|size_t DataValue::size() const {
  128|  15.3M|  return value_.size();
  129|  15.3M|}
_ZNK5Exiv29DataValue6clone_Ev:
  131|  6.59M|DataValue* DataValue::clone_() const {
  132|  6.59M|  return new DataValue(*this);
  133|  6.59M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  135|  1.43k|std::ostream& DataValue::write(std::ostream& os) const {
  136|  1.43k|  if (!value_.empty()) {
  ------------------
  |  Branch (136:7): [True: 837, False: 595]
  ------------------
  137|    837|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  138|    837|    os << static_cast<int>(value_.back());
  139|    837|  }
  140|  1.43k|  return os;
  141|  1.43k|}
_ZNK5Exiv29DataValue7toInt64Em:
  148|  39.4k|int64_t DataValue::toInt64(size_t n) const {
  149|  39.4k|  ok_ = true;
  150|  39.4k|  return value_.at(n);
  151|  39.4k|}
_ZNK5Exiv29DataValue8toUint32Em:
  153|  4.56M|uint32_t DataValue::toUint32(size_t n) const {
  154|  4.56M|  ok_ = true;
  155|  4.56M|  return value_.at(n);
  156|  4.56M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  172|  50.9k|int StringValueBase::read(const std::string& buf) {
  173|  50.9k|  value_ = buf;
  174|  50.9k|  return 0;
  175|  50.9k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  177|  53.3k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  178|       |  // byteOrder not needed
  179|  53.3k|  if (buf)
  ------------------
  |  Branch (179:7): [True: 53.3k, False: 0]
  ------------------
  180|  53.3k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  181|  53.3k|  return 0;
  182|  53.3k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  184|  51.3k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  185|  51.3k|  if (value_.empty())
  ------------------
  |  Branch (185:7): [True: 27.9k, False: 23.3k]
  ------------------
  186|  27.9k|    return 0;
  187|       |  // byteOrder not needed
  188|  23.3k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  189|  51.3k|}
_ZNK5Exiv215StringValueBase5countEv:
  191|  66.6k|size_t StringValueBase::count() const {
  192|  66.6k|  return size();
  193|  66.6k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  195|   209k|size_t StringValueBase::size() const {
  196|   209k|  return value_.size();
  197|   209k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  199|  50.6k|std::ostream& StringValueBase::write(std::ostream& os) const {
  200|  50.6k|  return os << value_;
  201|  50.6k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  203|  1.43k|int64_t StringValueBase::toInt64(size_t n) const {
  204|  1.43k|  ok_ = true;
  205|  1.43k|  return value_.at(n);
  206|  1.43k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  208|  15.1k|uint32_t StringValueBase::toUint32(size_t n) const {
  209|  15.1k|  ok_ = true;
  210|  15.1k|  return value_.at(n);
  211|  15.1k|}
_ZN5Exiv211StringValueC2Ev:
  223|  71.3k|StringValue::StringValue() : StringValueBase(string) {
  224|  71.3k|}
_ZNK5Exiv211StringValue6clone_Ev:
  229|   309k|StringValue* StringValue::clone_() const {
  230|   309k|  return new StringValue(*this);
  231|   309k|}
_ZN5Exiv210AsciiValueC2Ev:
  233|  29.3k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  234|  29.3k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  239|  3.10k|int AsciiValue::read(const std::string& buf) {
  240|  3.10k|  value_ = buf;
  241|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  242|  3.10k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (242:7): [True: 13, False: 3.08k]
  |  Branch (242:25): [True: 3.08k, False: 0]
  ------------------
  243|  3.10k|    value_ += '\0';
  244|  3.10k|  }
  245|  3.10k|  return 0;
  246|  3.10k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  248|   100k|AsciiValue* AsciiValue::clone_() const {
  249|   100k|  return new AsciiValue(*this);
  250|   100k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  252|  22.5k|std::ostream& AsciiValue::write(std::ostream& os) const {
  253|       |  // Write only up to the first '\0' (if any)
  254|  22.5k|  std::string::size_type pos = value_.find_first_of('\0');
  255|  22.5k|  if (pos == std::string::npos)
  ------------------
  |  Branch (255:7): [True: 5.25k, False: 17.3k]
  ------------------
  256|  5.25k|    pos = value_.size();
  257|  22.5k|  return os << value_.substr(0, pos);
  258|  22.5k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  285|  4.46k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  286|  4.46k|  int i = 0;
  287|  20.7k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (287:10): [True: 18.1k, False: 2.60k]
  |  Branch (287:10): [True: 16.3k, False: 4.46k]
  |  Branch (287:58): [True: 16.3k, False: 1.86k]
  ------------------
  288|  16.3k|  }
  289|  4.46k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (289:10): [True: 2.60k, False: 1.86k]
  ------------------
  290|  4.46k|}
_ZN5Exiv212CommentValueC2Ev:
  292|  5.37k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  293|  5.37k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  329|  5.37k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  330|  5.37k|  byteOrder_ = byteOrder;
  331|  5.37k|  return StringValueBase::read(buf, len, byteOrder);
  332|  5.37k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  334|  6.42k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  335|  6.42k|  std::string c = value_;
  336|  6.42k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (336:7): [True: 978, False: 5.44k]
  ------------------
  337|    978|    c = value_.substr(8);
  338|    978|    [[maybe_unused]] const size_t sz = c.size();
  339|    978|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (339:9): [True: 26, False: 952]
  |  Branch (339:39): [True: 0, False: 26]
  ------------------
  340|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  341|    978|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (341:16): [True: 952, False: 26]
  |  Branch (341:43): [True: 306, False: 646]
  ------------------
  342|    306|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  343|    306|    }
  344|    978|    c = value_.substr(0, 8) + c;
  345|    978|  }
  346|  6.42k|  if (c.empty())
  ------------------
  |  Branch (346:7): [True: 1.74k, False: 4.68k]
  ------------------
  347|  1.74k|    return 0;
  348|  4.68k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  349|  6.42k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  381|  6.42k|CommentValue::CharsetId CommentValue::charsetId() const {
  382|  6.42k|  CharsetId charsetId = undefined;
  383|  6.42k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (383:7): [True: 4.46k, False: 1.96k]
  ------------------
  384|  4.46k|    const std::string code = value_.substr(0, 8);
  385|  4.46k|    charsetId = CharsetInfo::charsetIdByCode(code);
  386|  4.46k|  }
  387|  6.42k|  return charsetId;
  388|  6.42k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  410|  16.3k|CommentValue* CommentValue::clone_() const {
  411|  16.3k|  return new CommentValue(*this);
  412|  16.3k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  414|  18.5k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  415|  18.5k|  xmpArrayType_ = xmpArrayType;
  416|  18.5k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  418|  8.21k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  419|  8.21k|  xmpStruct_ = xmpStruct;
  420|  8.21k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  422|   473k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  423|   473k|  return xmpArrayType_;
  424|   473k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  426|  18.5k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  427|  18.5k|  XmpArrayType xa = xaNone;
  428|  18.5k|  switch (typeId) {
  429|    404|    case xmpAlt:
  ------------------
  |  Branch (429:5): [True: 404, False: 18.0k]
  ------------------
  430|    404|      xa = xaAlt;
  431|    404|      break;
  432|    206|    case xmpBag:
  ------------------
  |  Branch (432:5): [True: 206, False: 18.2k]
  ------------------
  433|    206|      xa = xaBag;
  434|    206|      break;
  435|  10.1k|    case xmpSeq:
  ------------------
  |  Branch (435:5): [True: 10.1k, False: 8.39k]
  ------------------
  436|  10.1k|      xa = xaSeq;
  437|  10.1k|      break;
  438|  7.78k|    default:
  ------------------
  |  Branch (438:5): [True: 7.78k, False: 10.7k]
  ------------------
  439|  7.78k|      break;
  440|  18.5k|  }
  441|  18.5k|  return xa;
  442|  18.5k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  444|   487k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  445|   487k|  return xmpStruct_;
  446|   487k|}
_ZN5Exiv212XmpTextValueC2Ev:
  468|   132k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  469|   132k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  475|   744k|int XmpTextValue::read(const std::string& buf) {
  476|       |  // support a type=Alt,Bag,Seq,Struct indicator
  477|   744k|  std::string b = buf;
  478|   744k|  std::string type;
  479|   744k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (479:7): [True: 664, False: 743k]
  ------------------
  480|    664|    std::string::size_type pos = buf.find_first_of(' ');
  481|    664|    type = buf.substr(5, pos - 5);
  482|       |    // Strip quotes (so you can also specify the type without quotes)
  483|    664|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (483:9): [True: 570, False: 94]
  |  Branch (483:26): [True: 333, False: 237]
  ------------------
  484|    333|      type = type.substr(1);
  485|    664|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (485:9): [True: 542, False: 122]
  |  Branch (485:26): [True: 232, False: 310]
  ------------------
  486|    232|      type.pop_back();
  487|    664|    b.clear();
  488|    664|    if (pos != std::string::npos)
  ------------------
  |  Branch (488:9): [True: 201, False: 463]
  ------------------
  489|    201|      b = buf.substr(pos + 1);
  490|    664|  }
  491|   744k|  if (!type.empty()) {
  ------------------
  |  Branch (491:7): [True: 542, False: 743k]
  ------------------
  492|    542|    if (type == "Alt") {
  ------------------
  |  Branch (492:9): [True: 43, False: 499]
  ------------------
  493|     43|      setXmpArrayType(XmpValue::xaAlt);
  494|    499|    } else if (type == "Bag") {
  ------------------
  |  Branch (494:16): [True: 29, False: 470]
  ------------------
  495|     29|      setXmpArrayType(XmpValue::xaBag);
  496|    470|    } else if (type == "Seq") {
  ------------------
  |  Branch (496:16): [True: 18, False: 452]
  ------------------
  497|     18|      setXmpArrayType(XmpValue::xaSeq);
  498|    452|    } else if (type == "Struct") {
  ------------------
  |  Branch (498:16): [True: 175, False: 277]
  ------------------
  499|    175|      setXmpStruct();
  500|    277|    } else {
  501|    277|      throw Error(ErrorCode::kerInvalidXmpText, type);
  502|    277|    }
  503|    542|  }
  504|   744k|  value_ = std::move(b);
  505|   744k|  return 0;
  506|   744k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  512|  99.3k|size_t XmpTextValue::size() const {
  513|  99.3k|  std::ostringstream os;
  514|  99.3k|  write(os);
  515|  99.3k|  return os.str().size();
  516|  99.3k|}
_ZNK5Exiv212XmpTextValue5countEv:
  518|  99.3k|size_t XmpTextValue::count() const {
  519|  99.3k|  return size();
  520|  99.3k|}
_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: 235, False: 282k]
  ------------------
  525|    235|    switch (xmpArrayType()) {
  ------------------
  |  Branch (525:13): [True: 235, False: 0]
  ------------------
  526|     84|      case XmpValue::xaAlt:
  ------------------
  |  Branch (526:7): [True: 84, False: 151]
  ------------------
  527|     84|        os << "type=\"Alt\"";
  528|     84|        break;
  529|      6|      case XmpValue::xaBag:
  ------------------
  |  Branch (529:7): [True: 6, False: 229]
  ------------------
  530|      6|        os << "type=\"Bag\"";
  531|      6|        break;
  532|    145|      case XmpValue::xaSeq:
  ------------------
  |  Branch (532:7): [True: 145, False: 90]
  ------------------
  533|    145|        os << "type=\"Seq\"";
  534|    145|        break;
  535|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (535:7): [True: 0, False: 235]
  ------------------
  536|      0|        break;  // just to suppress the warning
  537|    235|    }
  538|    235|    del = true;
  539|   282k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (539:14): [True: 7.37k, False: 274k]
  ------------------
  540|  7.37k|    switch (xmpStruct()) {
  ------------------
  |  Branch (540:13): [True: 7.37k, False: 0]
  ------------------
  541|  7.37k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (541:7): [True: 7.37k, False: 0]
  ------------------
  542|  7.37k|        os << "type=\"Struct\"";
  543|  7.37k|        break;
  544|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (544:7): [True: 0, False: 7.37k]
  ------------------
  545|      0|        break;  // just to suppress the warning
  546|  7.37k|    }
  547|  7.37k|    del = true;
  548|  7.37k|  }
  549|   282k|  if (del && !value_.empty())
  ------------------
  |  Branch (549:7): [True: 7.61k, False: 274k]
  |  Branch (549:14): [True: 8, False: 7.60k]
  ------------------
  550|      8|    os << " ";
  551|   282k|  return os << value_;
  552|   282k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  570|   319k|XmpTextValue* XmpTextValue::clone_() const {
  571|   319k|  return new XmpTextValue(*this);
  572|   319k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  574|  10.4k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  575|  10.4k|  setXmpArrayType(xmpArrayType(typeId));
  576|  10.4k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  578|   294k|int XmpArrayValue::read(const std::string& buf) {
  579|   294k|  if (!buf.empty())
  ------------------
  |  Branch (579:7): [True: 291k, False: 3.20k]
  ------------------
  580|   291k|    value_.push_back(buf);
  581|   294k|  return 0;
  582|   294k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  588|  59.9k|size_t XmpArrayValue::count() const {
  589|  59.9k|  return value_.size();
  590|  59.9k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  592|    151|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  593|    151|  if (!value_.empty()) {
  ------------------
  |  Branch (593:7): [True: 140, False: 11]
  ------------------
  594|    140|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  595|    140|    os << value_.back();
  596|    140|  }
  597|    151|  return os;
  598|    151|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  600|   167k|std::string XmpArrayValue::toString(size_t n) const {
  601|   167k|  ok_ = true;
  602|   167k|  return value_.at(n);
  603|   167k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  621|  24.2k|XmpArrayValue* XmpArrayValue::clone_() const {
  622|  24.2k|  return new XmpArrayValue(*this);
  623|  24.2k|}
_ZN5Exiv212LangAltValueC2Ev:
  625|  1.02k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  626|  1.02k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  632|    375|int LangAltValue::read(const std::string& buf) {
  633|    375|  std::string b = buf;
  634|    375|  std::string lang = "x-default";
  635|    375|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (635:7): [True: 73, False: 302]
  ------------------
  636|     73|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  637|       |
  638|     73|    const std::string::size_type pos = buf.find_first_of(' ');
  639|     73|    if (pos == std::string::npos) {
  ------------------
  |  Branch (639:9): [True: 30, False: 43]
  ------------------
  640|     30|      lang = buf.substr(5);
  641|     43|    } else {
  642|     43|      lang = buf.substr(5, pos - 5);
  643|     43|    }
  644|     73|    if (lang.empty())
  ------------------
  |  Branch (644:9): [True: 1, False: 72]
  ------------------
  645|      1|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  646|       |    // Strip quotes (so you can also specify the language without quotes)
  647|     72|    if (lang.front() == '"') {
  ------------------
  |  Branch (647:9): [True: 15, False: 57]
  ------------------
  648|     15|      lang = lang.substr(1);
  649|       |
  650|     15|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (650:11): [True: 1, False: 14]
  |  Branch (650:27): [True: 9, False: 5]
  ------------------
  651|     10|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  652|       |
  653|      5|      lang.pop_back();
  654|      5|    }
  655|       |
  656|     62|    if (lang.empty())
  ------------------
  |  Branch (656:9): [True: 0, False: 62]
  ------------------
  657|      0|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  658|       |
  659|       |    // Check language is in the correct format (see https://www.ietf.org/rfc/rfc3066.txt)
  660|     62|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (660:55): [True: 48, False: 14]
  ------------------
  661|     48|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  662|     48|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (662:11): [True: 28, False: 20]
  |  Branch (662:38): [True: 9, False: 11]
  ------------------
  663|     37|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  664|     48|    }
  665|       |
  666|     25|    b.clear();
  667|     25|    if (pos != std::string::npos)
  ------------------
  |  Branch (667:9): [True: 15, False: 10]
  ------------------
  668|     15|      b = buf.substr(pos + 1);
  669|     25|  }
  670|       |
  671|    327|  value_[lang] = std::move(b);
  672|    327|  return 0;
  673|    375|}
_ZNK5Exiv212LangAltValue5countEv:
  679|    328|size_t LangAltValue::count() const {
  680|    328|  return value_.size();
  681|    328|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  683|    105|std::ostream& LangAltValue::write(std::ostream& os) const {
  684|    105|  bool first = true;
  685|       |
  686|       |  // Write the default entry first
  687|    105|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (687:42): [True: 0, False: 105]
  ------------------
  688|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  689|      0|    first = false;
  690|      0|  }
  691|       |
  692|       |  // Write the others
  693|    105|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (693:30): [True: 105, False: 105]
  ------------------
  694|    105|    if (lang != "x-default") {
  ------------------
  |  Branch (694:9): [True: 105, False: 0]
  ------------------
  695|    105|      if (!first)
  ------------------
  |  Branch (695:11): [True: 0, False: 105]
  ------------------
  696|      0|        os << ", ";
  697|    105|      os << "lang=\"" << lang << "\" " << s;
  698|    105|      first = false;
  699|    105|    }
  700|    105|  }
  701|    105|  return os;
  702|    105|}
_ZNK5Exiv212LangAltValue8toStringEm:
  704|    357|std::string LangAltValue::toString(size_t /*n*/) const {
  705|    357|  return toString("x-default");
  706|    357|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  708|    357|std::string LangAltValue::toString(const std::string& qualifier) const {
  709|    357|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (709:40): [True: 29, False: 328]
  ------------------
  710|     29|    ok_ = true;
  711|     29|    return i->second;
  712|     29|  }
  713|    328|  ok_ = false;
  714|    328|  return "";
  715|    357|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  737|  1.53k|LangAltValue* LangAltValue::clone_() const {
  738|  1.53k|  return new LangAltValue(*this);
  739|  1.53k|}
_ZN5Exiv29DateValueC2Ev:
  741|  3.93k|DateValue::DateValue() : Value(date) {
  742|  3.93k|  date_ = {};
  743|  3.93k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  749|  3.67k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  750|  3.67k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  751|  3.67k|  return read(str);
  752|  3.67k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  754|  3.93k|int DateValue::read(const std::string& buf) {
  755|       |  // ISO 8601 date formats:
  756|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  757|  3.93k|  size_t monthPos = 0;
  758|  3.93k|  size_t dayPos = 0;
  759|       |
  760|  3.93k|  auto printWarning = [] {
  761|  3.93k|#ifndef SUPPRESS_WARNINGS
  762|  3.93k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  763|  3.93k|#endif
  764|  3.93k|  };
  765|       |
  766|  3.93k|  if (buf.size() < 8) {
  ------------------
  |  Branch (766:7): [True: 878, False: 3.05k]
  ------------------
  767|    878|    printWarning();
  768|    878|    return 1;
  769|    878|  }
  770|       |
  771|  3.05k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (771:8): [True: 1.43k, False: 1.61k]
  |  Branch (771:28): [True: 849, False: 584]
  |  Branch (771:45): [True: 529, False: 320]
  |  Branch (771:63): [True: 1.61k, False: 906]
  ------------------
  772|  2.14k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (772:9): [True: 529, False: 1.61k]
  ------------------
  773|    529|      monthPos = 5;
  774|    529|      dayPos = 8;
  775|  1.61k|    } else {
  776|  1.61k|      monthPos = 4;
  777|  1.61k|      dayPos = 6;
  778|  1.61k|    }
  779|       |
  780|  2.14k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  2.14k|      for (size_t i = start; i < start + count; ++i) {
  782|  2.14k|        if (!std::isdigit(buf[i])) {
  783|  2.14k|          printWarning();
  784|  2.14k|          return 1;
  785|  2.14k|        }
  786|  2.14k|      }
  787|  2.14k|      dest = std::stoul(buf.substr(start, count));
  788|  2.14k|      return 0;
  789|  2.14k|    };
  790|       |
  791|  2.14k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (791:9): [True: 591, False: 1.55k]
  |  Branch (791:42): [True: 946, False: 609]
  |  Branch (791:83): [True: 121, False: 488]
  ------------------
  792|  1.65k|      printWarning();
  793|  1.65k|      return 1;
  794|  1.65k|    }
  795|       |
  796|    488|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (796:9): [True: 397, False: 91]
  |  Branch (796:29): [True: 37, False: 54]
  ------------------
  797|    434|      date_.month = 0;
  798|    434|      date_.day = 0;
  799|    434|      printWarning();
  800|    434|      return 1;
  801|    434|    }
  802|     54|    return 0;
  803|    488|  }
  804|    906|  printWarning();
  805|    906|  return 1;
  806|  3.05k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  812|     53|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|     53|  auto out = reinterpret_cast<char*>(buf);
  817|     53|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|     53|#define stringFormatTo std::format_to
  ------------------
  818|       |
  819|     53|  return it - out;
  820|     53|}
_ZNK5Exiv29DateValue4sizeEv:
  830|    106|size_t DateValue::size() const {
  831|    106|  return 8;
  832|    106|}
_ZNK5Exiv29DateValue6clone_Ev:
  834|    645|DateValue* DateValue::clone_() const {
  835|    645|  return new DateValue(*this);
  836|    645|}
_ZN5Exiv29TimeValueC2Ev:
  877|  7.28k|TimeValue::TimeValue() : Value(time) {
  878|  7.28k|  time_ = {};
  879|  7.28k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  885|  7.28k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  886|  7.28k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  887|  7.28k|  return read(str);
  888|  7.28k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  890|  7.28k|int TimeValue::read(const std::string& buf) {
  891|       |  // ISO 8601 time formats:
  892|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  893|       |  // Not supported formats:
  894|       |  // 4.2.2.4 Representations with decimal fraction: 232050,5
  895|  7.28k|  auto printWarning = [] {
  896|  7.28k|#ifndef SUPPRESS_WARNINGS
  897|  7.28k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  898|  7.28k|#endif
  899|  7.28k|    return 1;
  900|  7.28k|  };
  901|       |
  902|  7.28k|  if (buf.size() < 2)
  ------------------
  |  Branch (902:7): [True: 779, False: 6.50k]
  ------------------
  903|    779|    return printWarning();
  904|       |
  905|  6.50k|  for (auto c : buf)
  ------------------
  |  Branch (905:15): [True: 77.7k, False: 4.47k]
  ------------------
  906|  77.7k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (906:9): [True: 75.1k, False: 2.66k]
  |  Branch (906:21): [True: 71.9k, False: 3.13k]
  |  Branch (906:33): [True: 67.9k, False: 4.06k]
  |  Branch (906:45): [True: 65.6k, False: 2.28k]
  |  Branch (906:57): [True: 2.03k, False: 63.6k]
  ------------------
  907|  2.03k|      return printWarning();
  908|       |
  909|  4.47k|  size_t mpos;
  910|  4.47k|  size_t spos;
  911|  4.47k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (911:7): [True: 1.80k, False: 2.66k]
  ------------------
  912|  1.80k|    mpos = 3;
  913|  1.80k|    spos = 6;
  914|  2.66k|  } else {
  915|  2.66k|    mpos = 2;
  916|  2.66k|    spos = 4;
  917|  2.66k|  }
  918|       |
  919|  4.47k|  try {
  920|  4.47k|    auto hi = std::stoi(buf.substr(0, 2));
  921|  4.47k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (921:9): [True: 47, False: 4.42k]
  |  Branch (921:19): [True: 73, False: 4.35k]
  ------------------
  922|    111|      return printWarning();
  923|  4.36k|    time_.hour = hi;
  924|  4.36k|    if (buf.size() > 3) {
  ------------------
  |  Branch (924:9): [True: 3.23k, False: 1.12k]
  ------------------
  925|  3.23k|      auto mi = std::stoi(buf.substr(mpos, 2));
  926|  3.23k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (926:11): [True: 330, False: 2.90k]
  |  Branch (926:21): [True: 39, False: 2.86k]
  ------------------
  927|    339|        return printWarning();
  928|  2.89k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  929|  2.89k|    } else {
  930|  1.12k|      time_.minute = 0;
  931|  1.12k|    }
  932|  4.02k|    if (buf.size() > 5) {
  ------------------
  |  Branch (932:9): [True: 2.46k, False: 1.56k]
  ------------------
  933|  2.46k|      auto si = std::stoi(buf.substr(spos, 2));
  934|  2.46k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (934:11): [True: 23, False: 2.43k]
  |  Branch (934:21): [True: 114, False: 2.32k]
  ------------------
  935|    129|        return printWarning();
  936|  2.33k|      time_.second = std::stoi(buf.substr(spos, 2));
  937|  2.33k|    } else {
  938|  1.56k|      time_.second = 0;
  939|  1.56k|    }
  940|       |
  941|  3.89k|    auto fpos = buf.find('+');
  942|  3.89k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (942:9): [True: 1.70k, False: 2.19k]
  ------------------
  943|  1.70k|      fpos = buf.find('-');
  944|       |
  945|  3.89k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (945:9): [True: 3.56k, False: 326]
  ------------------
  946|  3.56k|      auto format = buf.substr(fpos, buf.size());
  947|  3.56k|      auto posColon = format.find(':');
  948|  3.56k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (948:11): [True: 1.90k, False: 1.65k]
  ------------------
  949|       |        // Extended format
  950|  1.90k|        auto tzhi = std::stoi(format.substr(0, 3));
  951|  1.90k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (951:13): [True: 55, False: 1.85k]
  |  Branch (951:27): [True: 511, False: 1.34k]
  ------------------
  952|    554|          return printWarning();
  953|  1.35k|        time_.tzHour = tzhi;
  954|  1.35k|        if (format.size() > 3) {
  ------------------
  |  Branch (954:13): [True: 571, False: 783]
  ------------------
  955|    571|          int minute = std::stoi(format.substr(3));
  956|    571|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (956:15): [True: 89, False: 482]
  |  Branch (956:29): [True: 154, False: 328]
  ------------------
  957|    212|            return printWarning();
  958|    359|          time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (958:28): [True: 142, False: 217]
  ------------------
  959|    359|        }
  960|  1.65k|      } else {
  961|       |        // Basic format
  962|  1.65k|        auto tzhi = std::stoi(format.substr(0, posColon));
  963|  1.65k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (963:13): [True: 419, False: 1.24k]
  |  Branch (963:27): [True: 205, False: 1.03k]
  ------------------
  964|    547|          return printWarning();
  965|  1.11k|        time_.tzHour = tzhi;
  966|  1.11k|        int minute = std::stoi(format.substr(posColon + 1));
  967|  1.11k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (967:13): [True: 332, False: 780]
  |  Branch (967:27): [True: 439, False: 341]
  ------------------
  968|    627|          return printWarning();
  969|    485|        time_.tzMinute = time_.tzHour < 0 ? -minute : minute;
  ------------------
  |  Branch (969:26): [True: 151, False: 334]
  ------------------
  970|    485|      }
  971|  3.56k|    }
  972|  3.89k|  } catch (std::exception&) {
  973|       |    // std::stoi might throw an exception if the syntax is invalid.
  974|    234|    return printWarning();
  975|    234|  }
  976|  1.71k|  return 0;
  977|  4.47k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  984|    222|size_t TimeValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  985|       |  // NOTE: Here the time is copied in the Basic format HHMMSS:HHMM, as the IPTC key
  986|       |  // Iptc.Application2.TimeCreated wants it. Check https://exiv2.org/iptc.html
  987|    222|  char plusMinus = '+';
  988|    222|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (988:7): [True: 111, False: 111]
  |  Branch (988:27): [True: 0, False: 111]
  ------------------
  989|    111|    plusMinus = '-';
  990|       |
  991|    222|  auto out = reinterpret_cast<char*>(buf);
  992|    222|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    222|#define stringFormatTo std::format_to
  ------------------
  993|    222|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
  994|       |
  995|    222|  auto wrote = static_cast<size_t>(it - out);
  996|    222|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
  997|    222|  return wrote;
  998|    222|}
_ZNK5Exiv29TimeValue4sizeEv:
 1008|    444|size_t TimeValue::size() const {
 1009|    444|  return 11;
 1010|    444|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1012|  2.67k|TimeValue* TimeValue::clone_() const {
 1013|  2.67k|  return new TimeValue(*this);
 1014|  2.67k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  760|  5.53k|  auto printWarning = [] {
  761|  5.53k|#ifndef SUPPRESS_WARNINGS
  762|  5.53k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  5.53k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.53k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.53k|  LogMsg(LogMsg::warn).os()
  ------------------
  763|  5.53k|#endif
  764|  5.53k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  780|  4.31k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  781|  14.2k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (781:30): [True: 11.5k, False: 2.65k]
  ------------------
  782|  11.5k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (782:13): [True: 1.65k, False: 9.93k]
  ------------------
  783|  1.65k|          printWarning();
  784|  1.65k|          return 1;
  785|  1.65k|        }
  786|  11.5k|      }
  787|  2.65k|      dest = std::stoul(buf.substr(start, count));
  788|  2.65k|      return 0;
  789|  4.31k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  895|  5.56k|  auto printWarning = [] {
  896|  5.56k|#ifndef SUPPRESS_WARNINGS
  897|  5.56k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  5.56k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.56k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.56k|  LogMsg(LogMsg::warn).os()
  ------------------
  898|  5.56k|#endif
  899|  5.56k|    return 1;
  900|  5.56k|  };

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

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  251|   155k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  252|   155k|  if (pValue)
  ------------------
  |  Branch (252:7): [True: 113k, False: 42.0k]
  ------------------
  253|   113k|    value_ = pValue->clone();
  254|   155k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  256|   204k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  257|   204k|  if (rhs.key_)
  ------------------
  |  Branch (257:7): [True: 204k, False: 0]
  ------------------
  258|   204k|    key_ = rhs.key_->clone();  // deep copy
  259|   204k|  if (rhs.value_)
  ------------------
  |  Branch (259:7): [True: 204k, False: 0]
  ------------------
  260|   204k|    value_ = rhs.value_->clone();  // deep copy
  261|   204k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  263|  1.60k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  264|  1.60k|  if (this == &rhs)
  ------------------
  |  Branch (264:7): [True: 0, False: 1.60k]
  ------------------
  265|      0|    return *this;
  266|  1.60k|  key_.reset();
  267|  1.60k|  if (rhs.key_)
  ------------------
  |  Branch (267:7): [True: 1.60k, False: 0]
  ------------------
  268|  1.60k|    key_ = rhs.key_->clone();  // deep copy
  269|  1.60k|  value_.reset();
  270|  1.60k|  if (rhs.value_)
  ------------------
  |  Branch (270:7): [True: 1.60k, False: 0]
  ------------------
  271|  1.60k|    value_ = rhs.value_->clone();  // deep copy
  272|  1.60k|  return *this;
  273|  1.60k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  275|   155k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  276|   155k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  278|   204k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  279|   204k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  281|  1.60k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  282|  1.60k|  if (this == &rhs)
  ------------------
  |  Branch (282:7): [True: 0, False: 1.60k]
  ------------------
  283|      0|    return *this;
  284|  1.60k|  *p_ = *rhs.p_;
  285|  1.60k|  return *this;
  286|  1.60k|}
_ZN5Exiv28XmpdatumD2Ev:
  288|   360k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  290|  19.8M|std::string Xmpdatum::key() const {
  291|  19.8M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (291:10): [True: 19.8M, False: 0]
  ------------------
  292|  19.8M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  298|   101k|std::string Xmpdatum::groupName() const {
  299|   101k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (299:10): [True: 101k, False: 0]
  ------------------
  300|   101k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  302|   265k|std::string Xmpdatum::tagName() const {
  303|   265k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (303:10): [True: 265k, False: 0]
  ------------------
  304|   265k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  318|   503k|TypeId Xmpdatum::typeId() const {
  319|   503k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (319:10): [True: 503k, False: 0]
  ------------------
  320|   503k|}
_ZNK5Exiv28Xmpdatum5countEv:
  330|   159k|size_t Xmpdatum::count() const {
  331|   159k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (331:10): [True: 159k, False: 0]
  ------------------
  332|   159k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  338|  2.12k|std::string Xmpdatum::toString() const {
  339|  2.12k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (339:10): [True: 2.12k, False: 0]
  ------------------
  340|  2.12k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  342|   347k|std::string Xmpdatum::toString(size_t n) const {
  343|   347k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (343:10): [True: 347k, False: 0]
  ------------------
  344|   347k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  362|   278k|const Value& Xmpdatum::value() const {
  363|   278k|  if (!p_->value_)
  ------------------
  |  Branch (363:7): [True: 0, False: 278k]
  ------------------
  364|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  365|   278k|  return *p_->value_;
  366|   278k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  376|  24.5k|void Xmpdatum::setValue(const Value* pValue) {
  377|  24.5k|  p_->value_.reset();
  378|  24.5k|  if (pValue)
  ------------------
  |  Branch (378:7): [True: 24.5k, False: 0]
  ------------------
  379|  24.5k|    p_->value_ = pValue->clone();
  380|  24.5k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  382|   700k|int Xmpdatum::setValue(const std::string& value) {
  383|   700k|  XmpProperties::XmpLock lock;
  384|   700k|  if (!p_->value_) {
  ------------------
  |  Branch (384:7): [True: 29.6k, False: 670k]
  ------------------
  385|  29.6k|    TypeId type = xmpText;
  386|  29.6k|    if (p_->key_) {
  ------------------
  |  Branch (386:9): [True: 29.6k, False: 0]
  ------------------
  387|  29.6k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  388|  29.6k|    }
  389|  29.6k|    p_->value_ = Value::create(type);
  390|  29.6k|  }
  391|   700k|  return p_->value_->read(value);
  392|   700k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   726k|Xmpdatum& XmpData::operator[](const std::string& key) {
  395|   726k|  XmpProperties::XmpLock lock;
  396|   726k|  XmpKey xmpKey(key, lock);
  397|   726k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  398|   726k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (398:7): [True: 42.0k, False: 684k]
  ------------------
  399|  42.0k|    return xmpMetadata_.emplace_back(xmpKey);
  400|  42.0k|  }
  401|   684k|  return *pos;
  402|   726k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  404|  8.62k|int XmpData::add(const XmpKey& key, const Value* value) {
  405|  8.62k|  XmpProperties::XmpLock lock;
  406|  8.62k|  return addUnlocked(key, value, lock);
  407|  8.62k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  409|   113k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  410|   113k|  xmpMetadata_.emplace_back(key, value);
  411|   113k|  return 0;
  412|   113k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  424|  9.20k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  425|  9.20k|  XmpProperties::XmpLock lock;
  426|  9.20k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  427|  9.20k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  429|   212k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  430|   212k|  XmpProperties::XmpLock lock;
  431|   212k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  432|   212k|}
_ZN5Exiv27XmpData5clearEv:
  434|  27.0k|void XmpData::clear() {
  435|  27.0k|  XmpProperties::XmpLock lock;
  436|  27.0k|  clearUnlocked(lock);
  437|  27.0k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  439|  32.3k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  440|  32.3k|  xmpMetadata_.clear();
  441|  32.3k|  nsBindings_.clear();
  442|  32.3k|}
_ZNK5Exiv27XmpData5beginEv:
  453|  2.44k|XmpData::const_iterator XmpData::begin() const {
  454|  2.44k|  return xmpMetadata_.begin();
  455|  2.44k|}
_ZNK5Exiv27XmpData3endEv:
  457|  11.6k|XmpData::const_iterator XmpData::end() const {
  458|  11.6k|  return xmpMetadata_.end();
  459|  11.6k|}
_ZNK5Exiv27XmpData5emptyEv:
  461|  1.74k|bool XmpData::empty() const {
  462|  1.74k|  XmpProperties::XmpLock lock;
  463|  1.74k|  return emptyUnlocked(lock);
  464|  1.74k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  466|  23.7k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  467|  23.7k|  return xmpMetadata_.empty();
  468|  23.7k|}
_ZN5Exiv27XmpData5beginEv:
  479|  4.80k|XmpData::iterator XmpData::begin() {
  480|  4.80k|  return xmpMetadata_.begin();
  481|  4.80k|}
_ZN5Exiv27XmpData3endEv:
  483|   217k|XmpData::iterator XmpData::end() {
  484|   217k|  return xmpMetadata_.end();
  485|   217k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  487|    713|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  488|    713|  XmpProperties::XmpLock lock;
  489|    713|  return xmpMetadata_.erase(pos);
  490|    713|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  536|  59.8k|void xmpToolkitEnsureInitialized() {
  537|  59.8k|  static XmpToolkitLifetimeManager instance;
  538|  59.8k|  (void)instance;
  539|  59.8k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  541|  32.5k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  542|  32.5k|  xmpToolkitEnsureInitialized();
  543|  32.5k|  try {
  544|  32.5k|    std::string existingPrefix;
  545|  32.5k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (545:9): [True: 32.5k, False: 4]
  ------------------
  546|  32.5k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (546:11): [True: 32.5k, False: 0]
  |  Branch (546:38): [True: 32.5k, False: 0]
  ------------------
  547|  32.5k|        existingPrefix.pop_back();
  548|  32.5k|      }
  549|  32.5k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (549:11): [True: 32.2k, False: 284]
  ------------------
  550|       |        // Already registered correctly, skip overhead
  551|  32.2k|        return;
  552|  32.2k|      }
  553|  32.5k|    }
  554|       |
  555|    288|    SXMPMeta::DeleteNamespace(ns.c_str());
  556|       |#ifdef EXV_ADOBE_XMPSDK
  557|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  558|       |#else
  559|    288|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  560|    288|#endif
  561|    288|  } catch (const XMP_Error& /* e */) {
  562|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  563|      0|  }
  564|  32.5k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  661|  6.03k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
  662|  6.03k|  try {
  663|  6.03k|    xmpData.setPacket(xmpPacket);
  664|  6.03k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (664:9): [True: 735, False: 5.29k]
  ------------------
  665|    735|      xmpData.clear();
  666|    735|      return 0;
  667|    735|    }
  668|       |
  669|       |    // Acquire Giant Lock
  670|  5.29k|    XmpProperties::XmpLock lock;
  671|  5.29k|    try {
  672|  5.29k|      xmpToolkitEnsureInitialized();
  673|  5.29k|    } 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|  5.29k|    xmpData.clearUnlocked(lock);
  681|       |
  682|       |    // Make sure the unterminated substring is used
  683|  5.29k|    size_t len = xmpPacket.size();
  684|  1.00M|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (684:12): [True: 1.00M, False: 116]
  |  Branch (684:23): [True: 1.00M, False: 5.18k]
  ------------------
  685|  1.00M|      --len;
  686|       |
  687|  5.29k|    XMLValidator::check(xmpPacket.data(), len);
  688|  5.29k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  689|  5.29k|    SXMPIterator iter(meta);
  690|  5.29k|    std::string schemaNs;
  691|  5.29k|    std::string propPath;
  692|  5.29k|    std::string propValue;
  693|  5.29k|    XMP_OptionBits opt = 0;
  694|   117k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (694:12): [True: 112k, False: 5.29k]
  ------------------
  695|   112k|      printNode(schemaNs, propPath, propValue, opt);
  696|   112k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (696:11): [True: 0, False: 112k]
  ------------------
  697|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  698|      0|      }
  699|   112k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (699:11): [True: 7.20k, False: 105k]
  ------------------
  700|       |        // Register unknown namespaces with Exiv2
  701|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  702|  7.20k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  703|  7.20k|        if (prefix.empty()) {
  ------------------
  |  Branch (703:13): [True: 5.97k, False: 1.23k]
  ------------------
  704|  5.97k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (704:15): [True: 0, False: 5.97k]
  ------------------
  705|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  706|  5.97k|          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|  5.97k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (714:15): [True: 20, False: 5.95k]
  ------------------
  715|     20|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  716|  5.97k|        }
  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|  7.20k|        xmpData.nsBindings_[prefix] = schemaNs;
  722|  7.20k|        continue;
  723|  7.20k|      }
  724|   105k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  725|   105k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (725:11): [True: 651, False: 104k]
  ------------------
  726|       |        // Read Lang Alt property
  727|    651|        auto val = std::make_unique<LangAltValue>();
  728|    651|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  729|  4.18k|        while (count-- > 0) {
  ------------------
  |  Branch (729:16): [True: 3.53k, False: 651]
  ------------------
  730|       |          // Get the text
  731|  3.53k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  732|  3.53k|          printNode(schemaNs, propPath, propValue, opt);
  733|  3.53k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (733:15): [True: 0, False: 3.53k]
  |  Branch (733:28): [True: 0, False: 3.53k]
  |  Branch (733:54): [True: 0, False: 3.53k]
  ------------------
  734|      0|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  735|      0|          }
  736|  3.53k|          std::string text = propValue;
  737|       |          // Get the language qualifier
  738|  3.53k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  739|  3.53k|          printNode(schemaNs, propPath, propValue, opt);
  740|  3.53k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (740:15): [True: 0, False: 3.53k]
  |  Branch (740:15): [True: 0, False: 3.53k]
  |  Branch (740:28): [True: 0, False: 3.53k]
  |  Branch (740:54): [True: 0, False: 3.53k]
  ------------------
  741|  3.53k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (741:15): [True: 0, False: 3.53k]
  ------------------
  742|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  743|      0|          }
  744|  3.53k|          val->value_[propValue] = std::move(text);
  745|  3.53k|        }
  746|    651|        xmpData.addUnlocked(*key, val.get(), lock);
  747|    651|        continue;
  748|    651|      }
  749|   104k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (749:11): [True: 1.81k, False: 102k]
  |  Branch (749:35): [True: 1.81k, False: 0]
  |  Branch (749:66): [True: 1.81k, False: 0]
  ------------------
  750|       |        // Check if all elements are simple
  751|  1.81k|        bool simpleArray = true;
  752|  1.81k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  753|  1.81k|        std::string aSchemaNs;
  754|  1.81k|        std::string aPropPath;
  755|  1.81k|        std::string aPropValue;
  756|  1.81k|        XMP_OptionBits aOpt = 0;
  757|  62.8k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (757:16): [True: 61.3k, False: 1.56k]
  ------------------
  758|  61.3k|          if (propPath == aPropPath)
  ------------------
  |  Branch (758:15): [True: 1.81k, False: 59.4k]
  ------------------
  759|  1.81k|            continue;
  760|  59.4k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (760:15): [True: 150, False: 59.3k]
  |  Branch (760:42): [True: 100, False: 59.2k]
  |  Branch (760:73): [True: 0, False: 59.2k]
  ------------------
  761|  59.4k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (761:15): [True: 0, False: 59.2k]
  |  Branch (761:41): [True: 0, False: 59.2k]
  ------------------
  762|    250|            simpleArray = false;
  763|    250|            break;
  764|    250|          }
  765|  59.4k|        }
  766|  1.81k|        if (simpleArray) {
  ------------------
  |  Branch (766:13): [True: 1.56k, False: 250]
  ------------------
  767|       |          // Read the array into an XmpArrayValue
  768|  1.56k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  769|  1.56k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  770|  59.4k|          while (count-- > 0) {
  ------------------
  |  Branch (770:18): [True: 57.8k, False: 1.56k]
  ------------------
  771|  57.8k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  772|  57.8k|            printNode(schemaNs, propPath, propValue, opt);
  773|  57.8k|            val->read(propValue);
  774|  57.8k|          }
  775|  1.56k|          xmpData.addUnlocked(*key, val.get(), lock);
  776|  1.56k|          continue;
  777|  1.56k|        }
  778|  1.81k|      }
  779|       |
  780|   103k|      auto val = std::make_unique<XmpTextValue>();
  781|   103k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (781:11): [True: 7.78k, False: 95.2k]
  |  Branch (781:36): [True: 250, False: 94.9k]
  ------------------
  782|       |        // Create a metadatum with only XMP options
  783|  8.03k|        val->setXmpArrayType(xmpArrayType(opt));
  784|  8.03k|        val->setXmpStruct(xmpStruct(opt));
  785|  8.03k|        xmpData.addUnlocked(*key, val.get(), lock);
  786|  8.03k|        continue;
  787|  8.03k|      }
  788|  94.9k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (788:11): [True: 94.9k, False: 0]
  |  Branch (788:36): [True: 0, False: 0]
  ------------------
  789|  94.9k|        val->read(propValue);
  790|  94.9k|        xmpData.addUnlocked(*key, val.get(), lock);
  791|  94.9k|        continue;
  792|  94.9k|      }
  793|       |      // Don't let any node go by unnoticed
  794|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  795|  94.9k|    }  // iterate through all XMP nodes
  796|       |
  797|  5.29k|    return 0;
  798|  5.29k|  }
  799|  6.03k|#ifndef SUPPRESS_WARNINGS
  800|  6.03k|  catch (const Error& e) {
  801|     48|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (801:9): [True: 0, False: 48]
  ------------------
  802|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  803|      0|    }
  804|     48|    throw;
  805|  2.30k|  } catch (const XMP_Error& e) {
  806|  2.30k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  2.30k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.30k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.30k|  LogMsg(LogMsg::error).os()
  ------------------
  807|  2.30k|    xmpData.clear();
  808|  2.30k|    return 3;
  809|  2.30k|  }
  810|       |#else
  811|       |  catch (const XMP_Error&) {
  812|       |    xmpData.clear();
  813|       |    return 3;
  814|       |  }
  815|       |#endif  // SUPPRESS_WARNINGS
  816|  6.03k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  830|  22.0k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  831|  22.0k|  try {
  832|       |    // Acquire Giant Lock
  833|  22.0k|    XmpProperties::XmpLock lock;
  834|  22.0k|    try {
  835|  22.0k|      xmpToolkitEnsureInitialized();
  836|  22.0k|    } 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|  22.0k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (843:9): [True: 19.5k, False: 2.44k]
  ------------------
  844|  19.5k|      xmpPacket.clear();
  845|  19.5k|      return 0;
  846|  19.5k|    }  // 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|  32.5k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (848:33): [True: 32.5k, False: 2.44k]
  ------------------
  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|  32.5k|      registerNsImpl(xmp, uri.prefix_);
  854|  32.5k|    }
  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.44k|    SXMPMeta meta;
  864|   101k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (864:26): [True: 101k, False: 2.44k]
  ------------------
  865|   101k|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  866|   101k|      XMP_OptionBits options = 0;
  867|       |
  868|   101k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (868:11): [True: 564, False: 100k]
  ------------------
  869|       |        // Encode Lang Alt property
  870|    564|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  871|    564|        if (!la)
  ------------------
  |  Branch (871:13): [True: 0, False: 564]
  ------------------
  872|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  873|       |
  874|    564|        int idx = 1;
  875|  2.12k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (875:40): [True: 2.12k, False: 564]
  ------------------
  876|  2.12k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (876:15): [True: 2.10k, False: 15]
  ------------------
  877|  2.10k|            printNode(ns, xmp.tagName(), specs, 0);
  878|  2.10k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  879|  2.10k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  880|  2.10k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  881|  2.10k|          }
  882|  2.12k|        }
  883|    564|        continue;
  884|    564|      }
  885|       |
  886|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  887|   100k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  888|   100k|      if (!val)
  ------------------
  |  Branch (888:11): [True: 0, False: 100k]
  ------------------
  889|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  890|   100k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  891|   100k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (891:11): [True: 137, False: 100k]
  |  Branch (891:37): [True: 916, False: 99.4k]
  |  Branch (891:63): [True: 188, False: 99.3k]
  ------------------
  892|  1.24k|        printNode(ns, xmp.tagName(), "", options);
  893|  1.24k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  894|  59.7k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (894:30): [True: 58.5k, False: 1.24k]
  ------------------
  895|  58.5k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  896|  58.5k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  897|  58.5k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  898|  58.5k|        }
  899|  1.24k|        continue;
  900|  1.24k|      }
  901|  99.3k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (901:11): [True: 99.3k, False: 0]
  ------------------
  902|  99.3k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  903|  99.3k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (903:13): [True: 1.96k, False: 97.3k]
  |  Branch (903:33): [True: 7.11k, False: 90.2k]
  |  Branch (903:72): [True: 198, False: 90.0k]
  ------------------
  904|  9.28k|          printNode(ns, xmp.tagName(), "", options);
  905|  9.28k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  906|  90.0k|        } else {
  907|  90.0k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  908|  90.0k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  909|  90.0k|        }
  910|  99.3k|        continue;
  911|  99.3k|      }
  912|       |      // Don't let any Xmpdatum go by unnoticed
  913|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  914|  99.3k|    }
  915|  2.44k|    std::string tmpPacket;
  916|  2.44k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  917|  2.44k|                           padding);  // throws
  918|  2.44k|    xmpPacket = std::move(tmpPacket);
  919|       |
  920|  2.44k|    return 0;
  921|  2.44k|  }
  922|  22.0k|#ifndef SUPPRESS_WARNINGS
  923|  22.0k|  catch (const Error& /* e */) {
  924|      0|    throw;
  925|    116|  } catch (const XMP_Error& e) {
  926|    116|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    116|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 116]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    116|  LogMsg(LogMsg::error).os()
  ------------------
  927|    116|    return 3;
  928|    116|  }
  929|       |#else
  930|       |  catch (const XMP_Error&) {
  931|       |    return 3;
  932|       |  }
  933|       |#endif  // SUPPRESS_WARNINGS
  934|  22.0k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1096|   105k|                                                      const XmpProperties::XmpLock& lock) {
 1097|   105k|  std::string property;
 1098|   105k|  std::string::size_type idx = propPath.find(':');
 1099|   105k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 105k]
  ------------------
 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|   105k|  property = propPath.substr(idx + 1);
 1104|   105k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1105|   105k|  if (prefix.empty()) {
  ------------------
  |  Branch (1105:7): [True: 27.3k, False: 77.8k]
  ------------------
 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|  27.3k|    std::string toolkitPrefix;
 1111|  27.3k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1111:9): [True: 27.3k, False: 0]
  ------------------
 1112|  27.3k|      toolkitPrefix.pop_back();
 1113|  27.3k|      prefix = std::move(toolkitPrefix);
 1114|  27.3k|    }
 1115|  27.3k|  }
 1116|   105k|  if (prefix.empty()) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 105k]
  ------------------
 1117|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1118|      0|  }
 1119|   105k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1120|   105k|}  // makeXmpKey
_ZN5Exiv29XmpParser16resolveNamespaceERKNS_7XmpDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 1123|   101k|                                               const XmpProperties::XmpLock& lock) {
 1124|   101k|  const auto& nsBindings = xmpData.nsBindings();
 1125|   101k|  const auto binding = nsBindings.find(prefix);
 1126|   101k|  return binding != nsBindings.end() ? binding->second : XmpProperties::nsUnlocked(prefix, lock);
  ------------------
  |  Branch (1126:10): [True: 100k, False: 522]
  ------------------
 1127|   101k|}  // resolveNamespace
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  201|  19.8M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  202|  19.8M|    return key_ == xmpdatum.key();
  203|  19.8M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  195|   948k|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  196|   948k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcm:
   66|  5.29k|  static void check(const char* buf, size_t buflen) {
   67|  5.29k|    XMLValidator validator;
   68|  5.29k|    validator.check_internal(buf, buflen);
   69|  5.29k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Ev:
   77|  5.29k|  XMLValidator() : parser_(XML_ParserCreateNS(nullptr, '@')) {
   78|  5.29k|    if (!parser_) {
  ------------------
  |  Branch (78:9): [True: 0, False: 5.29k]
  ------------------
   79|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   80|      0|    }
   81|  5.29k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  102|  5.29k|  void check_internal(const char* buf, size_t buflen) {
  103|  5.29k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (103:9): [True: 0, False: 5.29k]
  ------------------
  104|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  105|      0|    }
  106|       |
  107|  5.29k|    XML_SetUserData(parser_, this);
  108|  5.29k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  109|  5.29k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  110|  5.29k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  111|       |
  112|  5.29k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (112:9): [True: 1.34k, False: 3.95k]
  ------------------
  113|  1.34k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  114|  1.34k|    }
  115|       |
  116|  5.29k|    if (haserror_) {
  ------------------
  |  Branch (116:9): [True: 1.34k, False: 3.95k]
  ------------------
  117|  1.34k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  118|  1.34k|    }
  119|  5.29k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  158|   114k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  159|   114k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  160|   114k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  121|   114k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  122|   114k|    if (element_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (122:9): [True: 301, False: 113k]
  ------------------
  123|    301|      setError("Too deeply nested");
  124|    301|    }
  125|   114k|    ++element_depth_;
  126|   114k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  164|   109k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  165|   109k|    static_cast<XMLValidator*>(userData)->endElement(name);
  166|   109k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  128|   109k|  void endElement(const XML_Char*) noexcept {
  129|   109k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (129:9): [True: 109k, False: 0]
  ------------------
  130|   109k|      --element_depth_;
  131|   109k|    } else {
  132|      0|      setError("Negative depth");
  133|      0|    }
  134|   109k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  170|  31.3k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  171|  31.3k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  172|  31.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  136|  31.3k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  137|  31.3k|    if (namespace_depth_ > max_recursion_limit_) {
  ------------------
  |  Branch (137:9): [True: 2, False: 31.3k]
  ------------------
  138|      2|      setError("Too deeply nested");
  139|      2|    }
  140|  31.3k|    ++namespace_depth_;
  141|  31.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  176|  30.2k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  177|  30.2k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  178|  30.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  143|  30.2k|  void endNamespace(const XML_Char*) noexcept {
  144|  30.2k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (144:9): [True: 30.2k, False: 0]
  ------------------
  145|  30.2k|      --namespace_depth_;
  146|  30.2k|    } else {
  147|      0|      setError("Negative depth");
  148|      0|    }
  149|  30.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  181|      3|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  182|      3|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  183|      3|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  151|      3|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  152|       |    // DOCTYPE is used for XXE attacks.
  153|      3|    setError("DOCTYPE not supported");
  154|      3|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   87|  1.64k|  void setError(const char* msg) {
   88|  1.64k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   89|  1.64k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   90|  1.64k|#ifndef SUPPRESS_WARNINGS
   91|  1.64k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  1.64k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 1.64k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  1.64k|  LogMsg(LogMsg::info).os()
  ------------------
   92|  1.64k|#endif
   93|       |    // If this is the first error, then save it.
   94|  1.64k|    if (!haserror_) {
  ------------------
  |  Branch (94:9): [True: 1.34k, False: 306]
  ------------------
   95|  1.34k|      haserror_ = true;
   96|  1.34k|      errmsg_ = msg;
   97|  1.34k|      errlinenum_ = errlinenum;
   98|  1.34k|      errcolnum_ = errcolnum;
   99|  1.34k|    }
  100|  1.64k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   83|  5.29k|  ~XMLValidator() {
   84|  5.29k|    XML_ParserFree(parser_);
   85|  5.29k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  953|  8.03k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  954|  8.03k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  955|  8.03k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (955:7): [True: 7.78k, False: 250]
  ------------------
  956|  7.78k|    var = Exiv2::XmpValue::xsStruct;
  957|  7.78k|  }
  958|  8.03k|  return var;
  959|  8.03k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  961|   100k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  962|   100k|  XMP_OptionBits var(0);
  963|   100k|  switch (xs) {
  ------------------
  |  Branch (963:11): [True: 100k, False: 0]
  ------------------
  964|  93.4k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (964:5): [True: 93.4k, False: 7.11k]
  ------------------
  965|  93.4k|      break;
  966|  7.11k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (966:5): [True: 7.11k, False: 93.4k]
  ------------------
  967|  7.11k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  968|  7.11k|      break;
  969|   100k|  }
  970|   100k|  return var;
  971|   100k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  973|  9.60k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  974|  9.60k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  975|  9.60k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (975:7): [True: 1.81k, False: 7.78k]
  ------------------
  976|  1.81k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (976:9): [True: 404, False: 1.41k]
  ------------------
  977|    404|      typeId = Exiv2::xmpAlt;
  978|  1.41k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (978:14): [True: 1.22k, False: 193]
  ------------------
  979|  1.22k|      typeId = Exiv2::xmpSeq;
  980|    193|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (980:14): [True: 193, False: 0]
  ------------------
  981|    193|      typeId = Exiv2::xmpBag;
  982|  1.81k|  }
  983|  9.60k|  return typeId;
  984|  9.60k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  986|  8.03k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  987|  8.03k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  988|  8.03k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
  990|   100k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
  991|   100k|  XMP_OptionBits var(0);
  992|   100k|  switch (xat) {
  ------------------
  |  Branch (992:11): [True: 100k, False: 0]
  ------------------
  993|  99.1k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (993:5): [True: 99.1k, False: 1.43k]
  ------------------
  994|  99.1k|      break;
  995|    235|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (995:5): [True: 235, False: 100k]
  ------------------
  996|    235|      XMP_SetOption(var, kXMP_PropValueIsArray);
  997|    235|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
  998|    235|      break;
  999|  1.06k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (999:5): [True: 1.06k, False: 99.4k]
  ------------------
 1000|  1.06k|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1001|  1.06k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
 1002|  1.06k|      break;
 1003|    143|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (1003:5): [True: 143, False: 100k]
  ------------------
 1004|    143|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1005|    143|      break;
 1006|   100k|  }
 1007|   100k|  return var;
 1008|   100k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
 1014|  2.33k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
 1015|  2.33k|  XMP_OptionBits var(0);
 1016|  2.33k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (1016:7): [True: 958, False: 1.37k]
  ------------------
 1017|    958|    var |= kXMP_OmitPacketWrapper;
 1018|  2.33k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (1018:7): [True: 0, False: 2.33k]
  ------------------
 1019|      0|    var |= kXMP_ReadOnlyPacket;
 1020|  2.33k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1020:7): [True: 2.33k, False: 0]
  ------------------
 1021|  2.33k|    var |= kXMP_UseCompactFormat;
 1022|  2.33k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1022:7): [True: 0, False: 2.33k]
  ------------------
 1023|      0|    var |= kXMP_IncludeThumbnailPad;
 1024|  2.33k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1024:7): [True: 0, False: 2.33k]
  ------------------
 1025|      0|    var |= kXMP_ExactPacketLength;
 1026|  2.33k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1026:7): [True: 0, False: 2.33k]
  ------------------
 1027|      0|    var |= kXMP_WriteAliasComments;
 1028|  2.33k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1028:7): [True: 11, False: 2.31k]
  ------------------
 1029|     11|    var |= kXMP_OmitAllFormatting;
 1030|  2.33k|  return var;
 1031|  2.33k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1089|   338k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1090|   338k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  244|   360k|  ~Impl() = default;

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

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

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

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

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   954k|{
   88|       |
   89|   954k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   954k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   954k|	const XMP_Uns8 * namePos   = nameStart;
   92|   954k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   954k|	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: 954k]
  ------------------
   97|       |
   98|   954k|	cp = *namePos;
   99|   954k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 954k, False: 150]
  ------------------
  100|   954k|		++namePos;
  101|   954k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 954k]
  ------------------
  102|   954k|	} else {
  103|    150|		cp = GetCodePoint ( &namePos );
  104|    150|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 150]
  ------------------
  105|    150|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  69.4M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 68.5M, False: 954k]
  ------------------
  110|  68.5M|		cp = *namePos;
  111|  68.5M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 68.5M, False: 15.7k]
  ------------------
  112|  68.5M|			++namePos;
  113|  68.5M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 284k, False: 68.2M]
  |  Branch (113:38): [True: 0, False: 284k]
  ------------------
  114|  68.5M|		} else {
  115|  15.7k|			cp = GetCodePoint ( &namePos );
  116|  15.7k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 4.36k, False: 11.3k]
  |  Branch (116:41): [True: 0, False: 4.36k]
  ------------------
  117|  15.7k|		}
  118|  68.5M|	}
  119|       |
  120|   954k|	return;
  121|       |
  122|   954k|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|  69.4M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  69.4M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 34.4M, False: 34.9M]
  |  Branch (33:23): [True: 34.4M, False: 0]
  |  Branch (33:40): [True: 34.7M, False: 284k]
  |  Branch (33:55): [True: 34.6M, False: 64.4k]
  |  Branch (33:71): [True: 64.4k, False: 284k]
  ------------------
   34|   284k|	return false;
   35|  69.4M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  15.8k|{
   20|  15.8k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  15.8k|	XMP_Uns32 cp;
   22|  15.8k|	size_t u8Len;
   23|  15.8k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  15.8k|	*utf8Str_io = u8Ptr + u8Len;
   25|  15.8k|	return cp;
   26|  15.8k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  15.8k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  15.8k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 12.0k, False: 3.86k]
  |  Branch (43:24): [True: 347, False: 11.6k]
  |  Branch (43:43): [True: 11.6k, False: 3.86k]
  |  Branch (43:59): [True: 6.22k, False: 5.46k]
  ------------------
   44|  9.32k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 5.46k, False: 3.86k]
  |  Branch (44:24): [True: 3.44k, False: 2.02k]
  |  Branch (44:43): [True: 1.52k, False: 4.36k]
  |  Branch (44:60): [True: 0, False: 1.52k]
  ------------------
   45|       |
   46|  5.88k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 1.52k, False: 4.36k]
  |  Branch (46:25): [True: 1.22k, False: 300]
  |  Branch (46:46): [True: 300, False: 4.36k]
  |  Branch (46:64): [True: 0, False: 300]
  ------------------
   47|  4.66k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 300, False: 4.36k]
  |  Branch (47:26): [True: 0, False: 300]
  |  Branch (47:46): [True: 300, False: 4.36k]
  |  Branch (47:64): [True: 0, False: 300]
  ------------------
   48|  4.66k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 300, False: 4.36k]
  |  Branch (48:26): [True: 300, False: 0]
  |  Branch (48:46): [True: 0, False: 4.36k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  4.36k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 4.36k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 4.36k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  4.36k|	return false;
   52|       |
   53|  4.36k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   284k|{
   59|       |	// ASCII following characters for an XML name.
   60|   284k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 208k, False: 75.9k]
  |  Branch (60:23): [True: 208k, False: 0]
  |  Branch (60:39): [True: 24.0k, False: 51.8k]
  |  Branch (60:54): [True: 51.8k, False: 0]
  ------------------
   61|      0|	return false;
   62|   284k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  4.36k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  4.36k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 3.86k, False: 497]
  |  Branch (69:24): [True: 497, False: 0]
  |  Branch (69:41): [True: 497, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  4.36k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  5.60k|{
   20|  5.60k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  5.60k|	XMP_Uns32 cp;
   22|  5.60k|	size_t u8Len;
   23|  5.60k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  5.60k|	*utf8Str_io = u8Ptr + u8Len;
   25|  5.60k|	return cp;
   26|  5.60k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  30.1k|{
   88|       |
   89|  30.1k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  30.1k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  30.1k|	const XMP_Uns8 * namePos   = nameStart;
   92|  30.1k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  30.1k|	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: 30.1k]
  ------------------
   97|       |
   98|  30.1k|	cp = *namePos;
   99|  30.1k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 29.9k, False: 241]
  ------------------
  100|  29.9k|		++namePos;
  101|  29.9k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 29.9k]
  ------------------
  102|  29.9k|	} else {
  103|    241|		cp = GetCodePoint ( &namePos );
  104|    241|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 241]
  ------------------
  105|    241|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  6.58M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 6.55M, False: 30.1k]
  ------------------
  110|  6.55M|		cp = *namePos;
  111|  6.55M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 6.54M, False: 6.08k]
  ------------------
  112|  6.54M|			++namePos;
  113|  6.54M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 34.4k, False: 6.51M]
  |  Branch (113:38): [True: 0, False: 34.4k]
  ------------------
  114|  6.54M|		} else {
  115|  6.08k|			cp = GetCodePoint ( &namePos );
  116|  6.08k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 3.44k, False: 2.64k]
  |  Branch (116:41): [True: 0, False: 3.44k]
  ------------------
  117|  6.08k|		}
  118|  6.55M|	}
  119|       |
  120|  30.1k|	return;
  121|       |
  122|  30.1k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  6.57M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  6.57M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 6.38M, False: 194k]
  |  Branch (33:23): [True: 6.38M, False: 0]
  |  Branch (33:40): [True: 159k, False: 34.4k]
  |  Branch (33:55): [True: 148k, False: 11.5k]
  |  Branch (33:71): [True: 11.5k, False: 34.4k]
  ------------------
   34|  34.4k|	return false;
   35|  6.57M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  6.32k|{
   20|  6.32k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  6.32k|	XMP_Uns32 cp;
   22|  6.32k|	size_t u8Len;
   23|  6.32k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  6.32k|	*utf8Str_io = u8Ptr + u8Len;
   25|  6.32k|	return cp;
   26|  6.32k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  6.32k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  6.32k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 3.00k, False: 3.31k]
  |  Branch (43:24): [True: 144, False: 2.86k]
  |  Branch (43:43): [True: 2.86k, False: 3.31k]
  |  Branch (43:59): [True: 310, False: 2.55k]
  ------------------
   44|  5.87k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 2.55k, False: 3.31k]
  |  Branch (44:24): [True: 1.95k, False: 602]
  |  Branch (44:43): [True: 474, False: 3.44k]
  |  Branch (44:60): [True: 0, False: 474]
  ------------------
   45|       |
   46|  3.91k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 474, False: 3.44k]
  |  Branch (46:25): [True: 364, False: 110]
  |  Branch (46:46): [True: 110, False: 3.44k]
  |  Branch (46:64): [True: 0, False: 110]
  ------------------
   47|  3.55k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 110, False: 3.44k]
  |  Branch (47:26): [True: 0, False: 110]
  |  Branch (47:46): [True: 110, False: 3.44k]
  |  Branch (47:64): [True: 0, False: 110]
  ------------------
   48|  3.55k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 110, False: 3.44k]
  |  Branch (48:26): [True: 110, False: 0]
  |  Branch (48:46): [True: 0, False: 3.44k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  3.44k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 3.44k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 3.44k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  3.44k|	return false;
   52|       |
   53|  3.44k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|  34.4k|{
   59|       |	// ASCII following characters for an XML name.
   60|  34.4k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 13.5k, False: 20.8k]
  |  Branch (60:23): [True: 13.5k, False: 0]
  |  Branch (60:39): [True: 7.49k, False: 13.3k]
  |  Branch (60:54): [True: 13.3k, False: 0]
  ------------------
   61|      0|	return false;
   62|  34.4k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  3.44k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  3.44k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 3.31k, False: 128]
  |  Branch (69:24): [True: 128, False: 0]
  |  Branch (69:41): [True: 128, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  3.44k|}

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

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

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

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   291k|{
   40|   291k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 91.8k, False: 200k]
  ------------------
   41|       |
   42|   839k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 639k, False: 199k]
  ------------------
   43|   639k|		unsigned char ch = this->value[i];
   44|   639k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   639k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 539k, False: 100k]
  |  |  |  Branch (45:49): [True: 448, False: 99.5k]
  |  |  |  Branch (45:67): [True: 99.3k, False: 247]
  |  |  |  Branch (45:85): [True: 5, False: 242]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|    242|		return false;	// All the checks failed, this isn't whitespace.
   47|   639k|	}
   48|       |
   49|   199k|	return true;
   50|       |
   51|   200k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   520k|{
  428|       |
  429|   617k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 97.5k, False: 520k]
  ------------------
  430|   520k|	this->attrs.clear();
  431|       |
  432|   520k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   520k|{
  440|       |
  441|   939k|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 418k, False: 520k]
  ------------------
  442|   520k|	this->content.clear();
  443|       |
  444|   520k|}	// 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|   504k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   504k|		int err = pthread_mutex_lock ( &mutex );
  125|   504k|		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: 504k]
  ------------------
  126|   504k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   504k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   504k|		int err = pthread_mutex_unlock ( &mutex );
  130|   504k|		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: 504k]
  ------------------
  131|   504k|	}
_Z16VerifySetOptionsjPKc:
  563|   165k|{
  564|       |
  565|   165k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 44, False: 165k]
  ------------------
  566|   165k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 2.38k, False: 163k]
  ------------------
  567|   165k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 3.47k, False: 162k]
  ------------------
  568|       |	
  569|   165k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 165k]
  ------------------
  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|   165k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 7.11k, False: 158k]
  |  Branch (573:45): [True: 0, False: 7.11k]
  ------------------
  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|   165k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 165k]
  |  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|   165k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 152k, False: 12.7k]
  |  Branch (581:27): [True: 0, False: 152k]
  ------------------
  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|   165k|	return options;
  586|       |
  587|   165k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   405k|{
  663|   405k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   405k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   405k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   405k|	XMP_StringPtr	qualName, nameEnd;
  667|   405k|	XMP_VarString	currStep;
  668|       |		
  669|   405k|	qualName = nameEnd = NULL;
  670|   405k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  72.3M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 71.9M, False: 405k]
  ------------------
  672|  71.9M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 156k, False: 71.7M]
  |  Branch (672:29): [True: 365k, False: 71.4M]
  ------------------
  673|  71.9M|	}
  674|       |	
  675|   405k|	expandedXPath->clear();
  676|   405k|	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|   405k|	stepBegin = propPath;
  683|   405k|	stepEnd = stepBegin;
  684|  60.2M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 60.1M, False: 35.2k]
  |  Branch (684:29): [True: 60.1M, False: 4.44k]
  |  Branch (684:50): [True: 59.8M, False: 365k]
  |  Branch (684:71): [True: 59.8M, False: 0]
  ------------------
  685|   405k|	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: 405k]
  ------------------
  686|   405k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   405k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   405k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   405k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 405k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   405k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   927k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 522k, False: 405k]
  ------------------
  700|       |
  701|   522k|		stepBegin = stepEnd;
  702|   522k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 156k, False: 365k]
  ------------------
  703|   522k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 522k]
  ------------------
  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|   522k|		stepEnd = stepBegin;
  708|       |
  709|   522k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 156k, False: 365k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|   156k|			qualName = stepBegin;
  713|  10.3M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 10.1M, False: 156k]
  |  Branch (713:31): [True: 10.1M, False: 254]
  |  Branch (713:52): [True: 10.1M, False: 399]
  |  Branch (713:73): [True: 10.1M, False: 0]
  ------------------
  714|   156k|			nameEnd = stepEnd;
  715|   156k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   365k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   365k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   365k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 365k, False: 0]
  |  Branch (723:30): [True: 365k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|  1.42M|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 1.42M, False: 0]
  |  Branch (726:32): [True: 1.42M, False: 0]
  |  Branch (726:53): [True: 1.05M, False: 365k]
  ------------------
  727|   365k|				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: 365k]
  ------------------
  728|   365k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   365k|			} 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|   365k|			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: 365k]
  ------------------
  774|   365k|			++stepEnd;
  775|       |			
  776|   365k|		}
  777|       |
  778|   522k|		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: 522k]
  ------------------
  779|   522k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   522k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   522k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 156k, False: 365k]
  ------------------
  782|       |
  783|   156k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 156k]
  ------------------
  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|   156k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 102k, False: 54.3k]
  ------------------
  788|   102k|				++qualName;
  789|   102k|				stepFlags = kXMP_QualifierStep;
  790|   102k|			}
  791|   156k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   365k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   365k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 365k]
  ------------------
  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|   522k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   522k|	}
  812|       |
  813|   405k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   449k|{
  829|   449k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   449k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   449k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|  1.19M|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 1.15M, False: 39.1k]
  ------------------
  834|  1.15M|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|  1.15M|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|  1.15M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|  1.15M|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 410k, False: 748k]
  ------------------
  837|   410k|			schemaNode = currSchema;
  838|   410k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 394k, False: 16.1k]
  ------------------
  839|   410k|			break;
  840|   410k|		}
  841|  1.15M|	}
  842|       |	
  843|   449k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 39.1k, False: 410k]
  |  Branch (843:28): [True: 15.8k, False: 23.3k]
  ------------------
  844|       |
  845|  15.8k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  15.8k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  15.8k|		XMP_StringPtr prefixPtr;
  847|  15.8k|		XMP_StringLen prefixLen;
  848|  15.8k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  15.8k|		XMP_Assert ( found );
  ------------------
  |  |  142|  15.8k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  15.8k|		UNUSED(found);
  851|       |
  852|  15.8k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  15.8k|		xmpTree->children.push_back ( schemaNode );
  854|  15.8k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 6.59k, False: 9.21k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  15.8k|	}
  861|       |	
  862|   449k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   449k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   449k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   449k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   449k|	return schemaNode;
  865|       |	
  866|   449k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   501k|{
  882|   501k|	XMP_Node * childNode = 0;
  883|       |
  884|   501k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 5, False: 501k]
  ------------------
  885|      5|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|      5|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 5, False: 0]
  ------------------
  886|      5|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|		}
  888|      0|		if ( parent->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|      0|			XMP_Throw ( "Named children not allowed for arrays", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  890|      0|		}
  891|      0|		if ( ! createNodes ) {	// *** Should be assert? If !createNodes, why is the parent a new implicit node?
  ------------------
  |  Branch (891:8): [True: 0, False: 0]
  ------------------
  892|      0|			XMP_Throw ( "Parent is new implicit node, but createNodes is false", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  893|      0|		}
  894|      0|		parent->options |= kXMP_PropValueIsStruct;
  895|      0|	}
  896|       |	
  897|  1.75M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 1.67M, False: 84.5k]
  ------------------
  898|  1.67M|		XMP_Node * currChild = parent->children[childNum];
  899|  1.67M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  1.67M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  1.67M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 417k, False: 1.25M]
  ------------------
  901|   417k|			childNode = currChild;
  902|   417k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 416k, False: 198]
  ------------------
  903|   417k|			break;
  904|   417k|		}
  905|  1.67M|	}
  906|       |	
  907|   501k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 84.5k, False: 417k]
  |  Branch (907:27): [True: 38.3k, False: 46.2k]
  ------------------
  908|  38.3k|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  38.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|  38.3k|		parent->children.push_back ( childNode );
  910|  38.3k|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 38.3k, False: 0]
  ------------------
  911|  38.3k|	}
  912|       |	
  913|   501k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   501k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   501k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   501k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   501k|	return childNode;
  916|       |	
  917|   501k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|   102k|{
  935|   102k|	XMP_Node * qualNode = 0;
  936|       |	
  937|   102k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|   102k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  1.40M|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 1.35M, False: 50.1k]
  ------------------
  940|  1.35M|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  1.35M|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  1.35M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  1.35M|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 52.2k, False: 1.30M]
  ------------------
  943|  52.2k|			qualNode = currQual;
  944|  52.2k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 52.2k, False: 0]
  ------------------
  945|  52.2k|			break;
  946|  52.2k|		}
  947|  1.35M|	}
  948|       |	
  949|   102k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 50.1k, False: 52.2k]
  |  Branch (949:26): [True: 50.1k, False: 0]
  ------------------
  950|       |
  951|  50.1k|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|  50.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|  50.1k|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|  50.1k|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|  50.1k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|  50.1k|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|  50.1k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|  50.1k|		const bool isSpecial = isLang | isType;
  957|       |
  958|  50.1k|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 6.61k, False: 43.5k]
  ------------------
  959|  6.61k|			parent->options |= kXMP_PropHasLang;
  960|  43.5k|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 15, False: 43.5k]
  ------------------
  961|     15|			parent->options |= kXMP_PropHasType;
  962|     15|		}
  963|       |		
  964|  50.1k|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 8.32k, False: 41.8k]
  |  Branch (964:38): [True: 41.8k, False: 6]
  ------------------
  965|  50.1k|			parent->qualifiers.push_back ( qualNode );
  966|  50.1k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 50.1k, False: 0]
  ------------------
  967|  50.1k|		} else {
  968|      6|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      6|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 6, False: 0]
  |  Branch (969:19): [True: 6, False: 0]
  ------------------
  970|      6|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      6|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 6, False: 0]
  ------------------
  972|      6|		}
  973|       |
  974|  50.1k|	}
  975|       |	
  976|   102k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|   102k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|   102k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   102k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|   102k|	return qualNode;
  979|       |	
  980|   102k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   401k|{
 1063|   401k|	XMP_Node *     currNode = 0;
 1064|   401k|	XMP_NodePtrPos currPos;
 1065|   401k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   401k|	bool           leafIsNew = false;
 1067|       |	
 1068|   401k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   401k|	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: 401k]
  ------------------
 1071|       |	
 1072|   401k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   401k|	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|   401k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 401k, False: 0]
  ------------------
 1082|       |		
 1083|   401k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   401k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 239, False: 401k]
  ------------------
 1085|       |
 1086|   401k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   401k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 6.59k, False: 394k]
  ------------------
 1087|  6.59k|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  6.59k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|  6.59k|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 6.59k, False: 0]
  ------------------
 1089|  6.59k|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|  6.59k|		}
 1091|       |
 1092|   401k|	} 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|   401k|	try {
 1138|  1.32M|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 921k, False: 400k]
  ------------------
 1139|   921k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   921k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 309, False: 921k]
  ------------------
 1141|   921k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   921k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 161k, False: 759k]
  ------------------
 1142|   161k|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|   161k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|   161k|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|   161k|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 155k, False: 6.59k]
  ------------------
 1145|   161k|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|   161k|			}
 1147|   921k|		}
 1148|   401k|	} catch ( ... ) {
 1149|     18|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 18, False: 0]
  ------------------
 1150|     18|		throw;
 1151|     18|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   401k|EXIT:
 1156|       |
 1157|   401k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   401k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   401k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 161k, False: 239k]
  ------------------
 1161|   161k|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 161k, False: 0]
  ------------------
 1162|   161k|			currNode->options |= leafOptions;
 1163|   161k|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|   161k|	}
 1167|       |
 1168|   401k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 400k, False: 309]
  |  Branch (1168:26): [True: 0, False: 400k]
  ------------------
 1169|   401k|	return currNode;
 1170|       |	
 1171|   401k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  15.4k|{
 1344|  15.4k|	char * tagStart;
 1345|  15.4k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  15.4k|	tagStart = (char*) value->c_str();
 1350|   678k|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 672k, False: 6.23k]
  |  Branch (1350:45): [True: 663k, False: 9.22k]
  ------------------
 1351|   663k|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 646k, False: 16.9k]
  |  Branch (1351:28): [True: 7.93k, False: 638k]
  ------------------
 1352|   663k|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  15.4k|	tagStart = tagEnd;
 1357|  15.4k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 9.22k, False: 6.23k]
  ------------------
 1358|  1.09M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 1.08M, False: 14.4k]
  |  Branch (1358:45): [True: 1.08M, False: 967]
  ------------------
 1359|  1.08M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.04M, False: 32.0k]
  |  Branch (1359:28): [True: 9.27k, False: 1.03M]
  ------------------
 1360|  1.08M|	}
 1361|  15.4k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 2.04k, False: 13.4k]
  ------------------
 1362|  2.04k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 90, False: 1.95k]
  |  Branch (1362:30): [True: 86, False: 4]
  ------------------
 1363|  2.04k|		++tagStart;
 1364|  2.04k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 2.02k, False: 17]
  |  Branch (1364:30): [True: 858, False: 1.17k]
  ------------------
 1365|  2.04k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  16.9k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 16.9k, Folded]
  ------------------
 1370|  16.9k|		tagStart = tagEnd;
 1371|  16.9k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 1.59k, False: 15.3k]
  ------------------
 1372|  16.9k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 15.4k, False: 1.54k]
  ------------------
 1373|  5.32M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 5.31M, False: 909]
  |  Branch (1373:46): [True: 5.31M, False: 631]
  ------------------
 1374|  5.31M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 5.29M, False: 22.2k]
  |  Branch (1374:29): [True: 23.2k, False: 5.27M]
  ------------------
 1375|  5.31M|		}
 1376|  1.54k|	}
 1377|       |	
 1378|  15.4k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    555|{
 1391|    555|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    555|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    555|	size_t itemNum;
 1394|    555|	size_t itemLim = array->children.size();
 1395|    555|	bool   hasDefault = false;
 1396|       |	
 1397|  3.47k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 2.98k, False: 488]
  ------------------
 1398|       |	
 1399|  2.98k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 2.98k]
  ------------------
 1400|  2.98k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 2.98k]
  ------------------
 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|  2.98k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 67, False: 2.91k]
  ------------------
 1405|     67|			hasDefault = true;
 1406|     67|			break;
 1407|     67|		}
 1408|       |
 1409|  2.98k|	}
 1410|       |
 1411|    555|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 67, False: 488]
  ------------------
 1412|       |
 1413|     67|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 32, False: 35]
  ------------------
 1414|     32|			XMP_Node * temp = array->children[0];
 1415|     32|			array->children[0] = array->children[itemNum];
 1416|     32|			array->children[itemNum] = temp;
 1417|     32|		}
 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|     67|	}
 1423|       |	
 1424|    555|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.19k|{
 1435|  1.19k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.19k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.19k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  4.62k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 4.03k, False: 590]
  ------------------
 1440|  4.03k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  4.03k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 80, False: 3.95k]
  |  Branch (1441:50): [True: 523, False: 3.43k]
  ------------------
 1442|  4.03k|	}
 1443|       |	
 1444|  1.19k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.15k, False: 35]
  |  Branch (1444:25): [True: 555, False: 603]
  ------------------
 1445|    555|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    555|		NormalizeLangArray ( xmpParent );
 1447|    555|	}
 1448|       |
 1449|  1.19k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   405k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   405k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   405k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   405k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   405k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   405k|	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: 405k]
  ------------------
  161|       |
  162|   405k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 405k]
  |  Branch (162:29): [True: 0, False: 405k]
  ------------------
  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|  60.2M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 59.8M, False: 405k]
  ------------------
  166|  59.8M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 59.8M]
  |  Branch (166:24): [True: 0, False: 59.8M]
  ------------------
  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|  59.8M|	}
  170|       |
  171|   405k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   405k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 405k]
  ------------------
  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|   405k|	XMP_StringPtr colonPos = propName;
  177|  39.6M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 39.5M, False: 169k]
  |  Branch (177:30): [True: 39.2M, False: 235k]
  ------------------
  178|   405k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   405k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 169k, False: 235k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|   169k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|   169k|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|   169k|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   235k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   235k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   235k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   235k|		XMP_VarString prefix ( propName, prefixLen );
  198|   235k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   235k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 235k]
  ------------------
  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|   235k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 71, False: 235k]
  ------------------
  203|     71|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     71|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   235k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   235k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   235k|	}
  210|       |
  211|   405k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|   156k|{
  220|   156k|	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: 156k]
  ------------------
  221|       |
  222|   156k|	XMP_StringPtr colonPos = qualName;
  223|  7.15M|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 7.15M, False: 0]
  |  Branch (223:34): [True: 7.00M, False: 156k]
  ------------------
  224|   156k|	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: 156k]
  |  Branch (224:33): [True: 0, False: 156k]
  ------------------
  225|       |
  226|   156k|	VerifySimpleXMLName ( qualName, colonPos );
  227|   156k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|   156k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|   156k|	XMP_VarString prefix ( qualName, prefixLen );
  231|   156k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|   156k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 66, False: 156k]
  ------------------
  233|     66|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|     66|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|   156k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   921k|{
  395|   921k|	XMP_Node * nextNode = 0;
  396|   921k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   921k|	XMP_Index      index    = 0;
  398|   921k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   921k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   921k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   921k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 455k, False: 466k]
  ------------------
  403|       |
  404|   455k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   466k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 102k, False: 363k]
  ------------------
  407|       |	
  408|   102k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|   102k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|   102k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|   102k|		++qualStep;
  411|   102k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   363k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   363k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 18, False: 363k]
  ------------------
  418|     18|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|     18|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   363k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 363k, False: 0]
  ------------------
  422|   363k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   363k|		} 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|   363k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 363k, False: 0]
  |  Branch (437:24): [True: 363k, False: 0]
  ------------------
  438|       |
  439|   363k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 0, False: 363k]
  |  Branch (439:25): [True: 0, False: 0]
  |  Branch (439:40): [True: 0, False: 0]
  |  Branch (439:60): [True: 0, False: 0]
  ------------------
  440|       |		
  441|       |			// An ugly special case without an obvious better place to be. We have an alias to the
  442|       |			// x-default item of an alt-text array. A simple reference via SetProperty must create
  443|       |			// the x-default item if it does not yet exist.
  444|       |			
  445|      0|			XMP_Assert ( parentNode->options & kXMP_PropArrayIsAltText );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  446|      0|			XMP_Assert ( (stepNum == 2) && (nextStep.step == "[?xml:lang=\"x-default\"]") );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  447|       |
  448|      0|			nextNode = new XMP_Node ( parentNode, kXMP_ArrayItemName,
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  449|      0|									  (kXMP_PropHasQualifiers | kXMP_PropHasLang | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  450|       |
  451|      0|			XMP_Node * langQual = new XMP_Node ( nextNode, "xml:lang", "x-default", kXMP_PropIsQualifier );
  452|      0|			nextNode->qualifiers.push_back ( langQual );
  453|       |
  454|      0|			if ( parentNode->children.empty() ) {
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  ------------------
  455|      0|				parentNode->children.push_back ( nextNode );
  456|      0|			} else {
  457|      0|				parentNode->children.insert ( parentNode->children.begin(), nextNode );
  458|      0|			}
  459|       |
  460|      0|			index = 0;	// ! C-style index! The x-default item is always first.
  461|       |
  462|      0|		}
  463|       |		
  464|   363k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 363k, False: 0]
  |  Branch (464:27): [True: 363k, False: 0]
  ------------------
  465|       |	
  466|   363k|	}
  467|       |
  468|   921k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   921k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 921k, False: 309]
  |  Branch (468:26): [True: 161k, False: 759k]
  ------------------
  469|   161k|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|   161k|	}
  471|       |	
  472|   921k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   921k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   921k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   921k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   921k|	return nextNode;
  475|       |	
  476|   921k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   363k|{
  249|   363k|	XMP_Index index = 0;
  250|   363k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   363k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   363k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|  1.41M|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 1.05M, False: 363k]
  ------------------
  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|   363k|	--index;	// Change to a C-style, zero based index.
  263|   363k|	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: 363k]
  ------------------
  264|       |
  265|   363k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 73.2k, False: 290k]
  |  Branch (265:59): [True: 73.2k, False: 0]
  ------------------
  266|  73.2k|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|  73.2k|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  73.2k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|  73.2k|		arrayNode->children.push_back ( newItem );
  268|  73.2k|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   363k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 0, False: 363k]
  ------------------
  272|   363k|	return index;
  273|       |	
  274|   363k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|   161k|{
  488|       |
  489|   161k|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 19, False: 161k]
  ------------------
  490|     19|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 19, False: 0]
  ------------------
  491|     19|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|     19|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 1, False: 18]
  ------------------
  492|       |
  493|      1|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      1|	}
  496|       |
  497|   161k|}	// CheckImplicitStruct
XMPCore_Impl.cpp:_ZL13DeleteSubtreeNSt3__111__wrap_iterIPP8XMP_NodeEE:
  507|     18|{
  508|     18|	XMP_Node * rootNode   = *rootNodePos;
  509|     18|	XMP_Node * rootParent = rootNode->parent;
  510|       |
  511|     18|	if ( ! (rootNode->options & kXMP_PropIsQualifier) ) {
  ------------------
  |  Branch (511:7): [True: 18, False: 0]
  ------------------
  512|       |
  513|     18|		rootParent->children.erase ( rootNodePos );
  514|       |
  515|     18|	} else {
  516|       |
  517|      0|		rootParent->qualifiers.erase ( rootNodePos );
  518|       |
  519|      0|		XMP_Assert ( rootParent->options & kXMP_PropHasQualifiers);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  520|      0|		if ( rootParent->qualifiers.empty() ) rootParent->options ^= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (520:8): [True: 0, False: 0]
  ------------------
  521|       |
  522|      0|		if ( rootNode->name == "xml:lang" ) {
  ------------------
  |  Branch (522:8): [True: 0, False: 0]
  ------------------
  523|      0|			XMP_Assert ( rootParent->options & kXMP_PropHasLang);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  524|      0|			rootParent->options ^= kXMP_PropHasLang;
  525|      0|		} else if ( rootNode->name == "rdf:type" ) {
  ------------------
  |  Branch (525:15): [True: 0, False: 0]
  ------------------
  526|      0|			XMP_Assert ( rootParent->options & kXMP_PropHasType);
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  527|      0|			rootParent->options ^= kXMP_PropHasType;
  528|      0|		}
  529|       |
  530|      0|	}
  531|       |
  532|     18|	delete rootNode;
  533|       |
  534|     18|}	// DeleteSubtree

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

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  3.95k|{
 1097|  3.95k|	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: 3.95k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  3.95k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 3.95k]
  ------------------
 1099|       |	
 1100|  3.95k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  3.95k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  3.95k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 3.95k, False: 0]
  ------------------
 1105|  3.95k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 3.95k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  3.95k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  3.95k|	}
 1108|       |	
 1109|  3.95k|	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|  3.95k|	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|  3.95k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 3.95k, False: 0]
  ------------------
 1127|       |
 1128|  3.95k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 3.95k, False: 0]
  |  Branch (1128:39): [True: 3.94k, False: 15]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  3.94k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  3.94k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     15|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     15|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 15, False: 0]
  ------------------
 1139|       |
 1140|     15|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     15|				buffer += pendingOverlap;
 1142|     15|				xmpSize -= pendingOverlap;
 1143|     15|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     15|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 15]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     15|				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|     15|			}
 1153|       |
 1154|  3.95k|		}
 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|  3.95k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  3.95k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  3.95k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 3.95k]
  ------------------
 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|  3.95k|		} 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|  3.97k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 15, False: 3.95k]
  ------------------
 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|     15|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     15|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 15, False: 0]
  ------------------
 1190|       |				
 1191|     15|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     15|				parser.pendingCount += pendingOverlap;
 1193|     15|				buffer += pendingOverlap;
 1194|     15|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     15|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 15]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     15|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     15|				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|     15|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 15, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     15|					parser.pendingCount = 0;
 1208|       |
 1209|     15|				} 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|     15|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  3.95k|			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|  3.95k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 3.95k]
  ------------------
 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|  3.95k|		}
 1258|       |		
 1259|  3.95k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 3.94k, False: 15]
  ------------------
 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|  3.94k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  3.94k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 3.58k, False: 351]
  ------------------
 1269|       |
 1270|  3.58k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  3.58k|				NormalizeDCArrays ( &this->tree );
 1272|  3.58k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 3.58k]
  ------------------
 1273|  3.58k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  3.58k|				size_t schemaNum = 0;
 1277|  10.9k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 7.33k, False: 3.58k]
  ------------------
 1278|  7.33k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  7.33k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 7.33k, False: 0]
  ------------------
 1280|  7.33k|						++schemaNum;
 1281|  7.33k|					} 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|  7.33k|				}
 1286|       |				
 1287|  3.58k|			}
 1288|       |
 1289|  3.94k|			delete this->xmlParser;
 1290|  3.94k|			this->xmlParser = 0;
 1291|       |
 1292|  3.94k|		}
 1293|       |		
 1294|  3.95k|	} catch ( ... ) {
 1295|       |
 1296|    893|		delete this->xmlParser;
 1297|    893|		this->xmlParser = 0;
 1298|    893|		prevTkVer = 0;
 1299|    893|		this->tree.ClearNode();
 1300|    893|		throw;
 1301|       |
 1302|    893|	}
 1303|       |	
 1304|  3.95k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  3.95k|{
  811|  3.95k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 3.95k]
  ------------------
  812|       |	
  813|  3.95k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  3.95k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 3.95k]
  ------------------
  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|  3.95k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 3.94k, False: 9]
  ------------------
  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|  3.94k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 3.94k, 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|      9|	} 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|      9|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 9, 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|  3.95k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  3.97k|{
  977|  3.97k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  3.97k|	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|  3.97k|	std::string copy;
  992|       |		
  993|  59.2M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 59.1M, False: 3.97k]
  ------------------
  994|       |
  995|  59.1M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 58.9M, False: 230k]
  |  Branch (995:30): [True: 58.9M, False: 51.4k]
  |  Branch (995:52): [True: 58.1M, False: 743k]
  ------------------
  996|  58.1M|			copy.push_back(*spanEnd);
  997|  58.1M|			continue;	// A regular ASCII character.
  998|  58.1M|		}
  999|       |
 1000|  1.02M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 20.8k, False: 1.00M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  20.8k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  20.8k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 20.8k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  20.8k|				copy.append((const char*)spanEnd, uniLen);
 1010|  20.8k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  20.8k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|  1.00M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 230k, False: 774k]
  |  Branch (1026:36): [True: 30.5k, False: 743k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   261k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   261k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   256k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|  33.8k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 4.38k, False: 256k]
  |  Branch (1030:31): [True: 223k, False: 33.8k]
  |  Branch (1030:52): [True: 3.30k, False: 30.5k]
  ------------------
 1031|   230k|				copy.push_back(*spanEnd);
 1032|   230k|				continue;
 1033|   230k|			}
 1034|       |
 1035|  30.5k|			copy.push_back(' ');
 1036|       |		
 1037|   743k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   743k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   743k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   743k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   743k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 6, False: 743k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|      6|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 6, False: 0]
  ------------------
 1048|      6|					copy.push_back('&');
 1049|      6|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|      6|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   743k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 27.6k, False: 716k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  27.6k|				copy.push_back(' ');
 1058|  27.6k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   716k|			} else {
 1061|   716k|				copy.push_back('&');
 1062|   716k|			}
 1063|       |
 1064|   743k|		}
 1065|       |		
 1066|  1.02M|	}
 1067|       |	
 1068|  3.97k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  3.97k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  3.97k|	copy.push_back(' ');
 1070|  3.97k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  3.97k|	return length;
 1072|       |
 1073|  3.97k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  20.8k|{
  868|  20.8k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  20.8k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  20.8k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 20.8k]
  ------------------
  870|  20.8k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 20.8k]
  ------------------
  871|       |	
  872|  20.8k|	int byteCount = 2;
  873|  20.8k|	XMP_Uns8 firstByte = *charStart;
  874|  25.3k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 4.51k, False: 20.8k]
  ------------------
  875|       |	
  876|  20.8k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 20.8k]
  ------------------
  877|       |
  878|  46.1k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 25.3k, False: 20.8k]
  ------------------
  879|  25.3k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 25.3k]
  ------------------
  880|  25.3k|	}
  881|       |	
  882|  20.8k|	return byteCount;
  883|       |	
  884|  20.8k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   743k|{
  898|   743k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   743k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   743k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 743k]
  ------------------
  900|   743k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   743k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   743k|	size_t tailLen = bufEnd - escStart;
  903|   743k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 6, False: 743k]
  ------------------
  904|       |	
  905|   743k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 354k, False: 389k]
  ------------------
  906|       |	
  907|   389k|	XMP_Uns8 escValue = 0;
  908|   389k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   389k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 389k, False: 411]
  |  Branch (910:27): [True: 346k, False: 43.3k]
  ------------------
  911|   346k|		escValue = *escPos - '0';
  912|   346k|		++escPos;
  913|   346k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 40.2k, False: 3.55k]
  |  Branch (913:34): [True: 18.5k, False: 21.7k]
  ------------------
  914|  18.5k|		escValue = *escPos - 'A' + 10;
  915|  18.5k|		++escPos;
  916|  25.2k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 21.4k, False: 3.79k]
  |  Branch (916:34): [True: 7.13k, False: 14.3k]
  ------------------
  917|  7.13k|		escValue = *escPos - 'a' + 10;
  918|  7.13k|		++escPos;
  919|  7.13k|	}
  920|       |	
  921|   389k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 345k, False: 44.6k]
  |  Branch (921:27): [True: 119k, False: 225k]
  ------------------
  922|   119k|		escValue = (escValue << 4) + (*escPos - '0');
  923|   119k|		++escPos;
  924|   270k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 61.4k, False: 208k]
  |  Branch (924:34): [True: 18.7k, False: 42.6k]
  ------------------
  925|  18.7k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  18.7k|		++escPos;
  927|   251k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 37.3k, False: 214k]
  |  Branch (927:34): [True: 1.76k, False: 35.6k]
  ------------------
  928|  1.76k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|  1.76k|		++escPos;
  930|  1.76k|	}
  931|       |	
  932|   389k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 389k]
  ------------------
  933|   389k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 224k, False: 165k]
  ------------------
  934|       |	
  935|   165k|	size_t escLen = escPos - escStart + 1;
  936|   165k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 3.00k, False: 162k]
  ------------------
  937|       |	
  938|   162k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|   162k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  27.8k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  27.7k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 134k, False: 27.8k]
  |  Branch (938:29): [True: 68, False: 27.7k]
  |  Branch (938:50): [True: 195, False: 27.6k]
  ------------------
  939|       |	
  940|  27.6k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|   162k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  3.94k|{
  152|  3.94k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  3.94k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 79, False: 3.86k]
  ------------------
  155|  3.94k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 351, False: 3.58k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  3.58k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  3.58k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  3.58k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  3.58k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 3.58k]
  ------------------
  164|      0|		     ((rootNode->parent == 0) ||
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|		      ((rootNode->parent->name != "x:xmpmeta") && (rootNode->parent->name != "x:xapmeta"))) ) return 0;
  ------------------
  |  Branch (165:10): [True: 0, False: 0]
  |  Branch (165:53): [True: 0, False: 0]
  ------------------
  166|       |
  167|  3.93k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.15k, False: 2.77k]
  ------------------
  168|  1.15k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.15k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 775, False: 383]
  |  Branch (169:42): [True: 42, False: 341]
  ------------------
  170|    817|				verStr = currAttr->value.c_str();
  171|    817|				break;
  172|    817|			}
  173|  1.15k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  3.58k|	unsigned long part;
  178|  24.6k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 21.8k, False: 2.79k]
  |  Branch (178:29): [True: 1.76k, False: 20.0k]
  |  Branch (178:48): [True: 19.2k, False: 794]
  ------------------
  179|       |	
  180|  3.58k|	part = 0;
  181|  5.99k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.19k, False: 2.80k]
  |  Branch (181:28): [True: 2.51k, False: 679]
  |  Branch (181:48): [True: 2.40k, False: 105]
  ------------------
  182|  2.40k|		part = (part * 10) + (*verStr - '0');
  183|  2.40k|		++verStr;
  184|  2.40k|	}
  185|  3.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 88, False: 3.50k]
  ------------------
  186|  3.58k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  3.58k|	part = 0;
  189|  3.58k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 459, False: 3.13k]
  ------------------
  190|  5.54k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 2.74k, False: 2.80k]
  |  Branch (190:28): [True: 2.08k, False: 663]
  |  Branch (190:48): [True: 1.95k, False: 121]
  ------------------
  191|  1.95k|		part = (part * 10) + (*verStr - '0');
  192|  1.95k|		++verStr;
  193|  1.95k|	}
  194|  3.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 90, False: 3.49k]
  ------------------
  195|  3.58k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  3.58k|	part = 0;
  198|  3.58k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 106, False: 3.48k]
  ------------------
  199|  4.74k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 1.92k, False: 2.81k]
  |  Branch (199:28): [True: 1.31k, False: 614]
  |  Branch (199:48): [True: 1.15k, False: 164]
  ------------------
  200|  1.15k|		part = (part * 10) + (*verStr - '0');
  201|  1.15k|		++verStr;
  202|  1.15k|	}
  203|  3.58k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 39, False: 3.55k]
  ------------------
  204|  3.58k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  3.58k|	part = 0;
  207|  3.58k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 379, False: 3.21k]
  ------------------
  208|  4.77k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.95k, False: 2.82k]
  |  Branch (208:28): [True: 1.69k, False: 257]
  |  Branch (208:48): [True: 1.18k, False: 512]
  ------------------
  209|  1.18k|		part = (part * 10) + (*verStr - '0');
  210|  1.18k|		++verStr;
  211|  1.18k|	}
  212|  3.58k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 34, False: 3.55k]
  ------------------
  213|  3.58k|	thiz->prevTkVer += part;
  214|       |	
  215|  3.58k|	return rootNode;
  216|       |	
  217|  3.58k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|    469|{
  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|  3.01k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 2.64k, False: 378]
  ------------------
  116|  2.64k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  2.64k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 1.27k, False: 1.36k]
  ------------------
  118|  1.36k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 91, False: 1.27k]
  |  Branch (118:44): [True: 0, False: 1.27k]
  ------------------
  119|  1.36k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|    378|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 378, False: 0]
  ------------------
  122|  2.41k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 2.11k, False: 305]
  ------------------
  123|  2.11k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  2.11k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 952, False: 1.16k]
  ------------------
  125|  1.16k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 73, False: 1.08k]
  ------------------
  126|  1.16k|		}
  127|    378|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|    601|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 299, False: 302]
  ------------------
  131|    299|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|    299|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 3, False: 296]
  ------------------
  133|    299|	}
  134|       |	
  135|    302|	return 0;
  136|       |
  137|    305|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  2.71k|{
  232|  2.71k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.71k|#define kXMP_ExistingOnly	false
  ------------------
  233|  2.71k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 2.47k, False: 238]
  ------------------
  234|       |	
  235|  1.02k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 785, False: 238]
  ------------------
  236|    785|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|    785|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|    785|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 164, False: 621]
  ------------------
  240|       |		
  241|    621|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 28, False: 593]
  ------------------
  242|    593|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 2, False: 591]
  ------------------
  243|     30|			arrayForm = kXMP_PropArrayIsOrdered;
  244|    591|		} else if (
  245|    591|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 6, False: 585]
  ------------------
  246|    585|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 10, False: 575]
  ------------------
  247|    575|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 28, False: 547]
  ------------------
  248|     44|			arrayForm = kXMP_PropArrayIsAltText;
  249|    547|		} else if (
  250|    547|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 10, False: 537]
  ------------------
  251|    537|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 8, False: 529]
  ------------------
  252|    529|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 4, False: 525]
  ------------------
  253|    525|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 47, False: 478]
  ------------------
  254|    478|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 16, False: 462]
  ------------------
  255|    462|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 0, False: 462]
  ------------------
  256|     85|			arrayForm = kXMP_PropValueIsArray;
  257|     85|		}
  258|    621|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 462, False: 159]
  ------------------
  259|       |		
  260|    159|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    159|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    159|		dcSchema->children[propNum] = newArray;
  263|    159|		newArray->children.push_back ( currProp );
  264|    159|		currProp->parent = newArray;
  265|    159|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    159|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    159|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 44, False: 115]
  |  Branch (267:44): [True: 30, False: 14]
  ------------------
  268|     30|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|     30|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|     30|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 30, False: 0]
  ------------------
  271|     30|				currProp->qualifiers.push_back ( newLang );
  272|     30|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|     30|		}
  276|       |
  277|    159|	}
  278|       |	
  279|    238|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  2.71k|{
  666|  2.71k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  2.71k|	XMP_Node * currSchema = 0;
  671|       |
  672|  2.71k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.71k|#define kXMP_ExistingOnly	false
  ------------------
  673|  2.71k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 16, False: 2.69k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     16|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     16|#define kXMP_ExistingOnly	false
  ------------------
  677|     16|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 16]
  ------------------
  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|     16|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     16|#define kXMP_ExistingOnly	false
  ------------------
  682|     16|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 16]
  |  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|     16|	}
  697|       |
  698|  2.71k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.71k|#define kXMP_ExistingOnly	false
  ------------------
  699|  2.71k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 2.71k]
  ------------------
  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|  2.71k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.71k|#define kXMP_ExistingOnly	false
  ------------------
  707|  2.71k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 238, False: 2.47k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    238|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    238|#define kXMP_ExistingOnly	false
  ------------------
  710|    238|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 19, False: 219]
  ------------------
  711|     19|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     19|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     19|		}
  714|    238|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  2.71k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  2.71k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  2.71k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  2.71k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  2.71k|	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|  2.71k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 168, False: 2.54k]
  ------------------
  732|       |
  733|    168|		bool nameIsUUID = false;
  734|    168|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    168|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    168|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 25, False: 143]
  |  |  ------------------
  ------------------
  737|       |
  738|     25|			nameIsUUID = true;
  739|       |
  740|    143|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 75, False: 68]
  ------------------
  741|       |
  742|     75|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  2.03k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 2.01k, False: 24]
  ------------------
  744|  2.01k|				char ch = nameStr[i];
  745|  2.01k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 109, False: 1.90k]
  ------------------
  746|    109|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 33, False: 76]
  |  Branch (746:23): [True: 25, False: 51]
  |  Branch (746:36): [True: 11, False: 40]
  |  Branch (746:49): [True: 21, False: 19]
  ------------------
  747|     19|					nameIsUUID = false;
  748|     19|					break;
  749|  1.90k|				} else {
  750|  1.90k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 1.88k, False: 18]
  |  Branch (750:27): [True: 586, False: 1.29k]
  |  Branch (750:44): [True: 1.29k, False: 24]
  |  Branch (750:59): [True: 1.28k, False: 8]
  ------------------
  751|     32|					nameIsUUID = false;
  752|     32|					break;
  753|  1.90k|				}
  754|  2.01k|			}
  755|       |
  756|     75|		}
  757|       |		
  758|    168|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 49, False: 119]
  ------------------
  759|       |
  760|     49|			XMP_ExpandedXPath expPath;
  761|     49|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     49|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     49|#define kXMP_CreateNodes	true
  ------------------
  763|     49|			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: 49]
  ------------------
  764|       |
  765|     49|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     49|			idNode->value = tree.name;
  767|     49|			idNode->RemoveChildren();
  768|     49|			idNode->RemoveQualifiers();
  769|       |
  770|     49|			tree.name.erase();
  771|       |
  772|     49|		}
  773|       |
  774|    168|	}
  775|       |
  776|  2.71k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  13.5k|{
  610|  13.5k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  13.5k|#define kXMP_ExistingOnly	false
  ------------------
  611|  13.5k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 12.7k, False: 762]
  ------------------
  612|       |	
  613|    762|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|    762|#define kXMP_ExistingOnly	false
  ------------------
  614|    762|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 595, False: 167]
  |  Branch (614:27): [True: 94, False: 73]
  ------------------
  615|       |	
  616|     73|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 7, False: 66]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     66|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|    552|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 486, False: 66]
  ------------------
  622|       |
  623|    486|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|    486|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 29, False: 457]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     29|			delete ( currChild );
  629|     29|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|    457|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 398, False: 59]
  ------------------
  632|       |		
  633|    398|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 19, False: 379]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     19|				delete ( currChild );
  637|     19|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|    379|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|    379|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|    379|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 379, False: 0]
  ------------------
  644|    379|					currChild->qualifiers.push_back ( repairLang );
  645|    379|				} else {
  646|      0|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|      0|				}
  648|    379|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|    379|			}
  651|       |
  652|    398|		}
  653|       |
  654|    486|	}
  655|       |
  656|     66|}	// RepairAltText

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

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

