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

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

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

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

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

_ZN5Exiv28ExifData5beginEv:
  438|   112k|  iterator begin() {
  439|   112k|    return exifMetadata_.begin();
  440|   112k|  }
_ZN5Exiv28ExifData3endEv:
  442|  8.10M|  iterator end() {
  443|  8.10M|    return exifMetadata_.end();
  444|  8.10M|  }
_ZNK5Exiv28ExifData5beginEv:
  455|  4.36k|  [[nodiscard]] const_iterator begin() const {
  456|  4.36k|    return exifMetadata_.begin();
  457|  4.36k|  }
_ZNK5Exiv28ExifData3endEv:
  459|   562k|  [[nodiscard]] const_iterator end() const {
  460|   562k|    return exifMetadata_.end();
  461|   562k|  }
_ZNK5Exiv28ExifData5emptyEv:
  468|  13.5k|  [[nodiscard]] bool empty() const {
  469|  13.5k|    return exifMetadata_.empty();
  470|  13.5k|  }
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ByteOrderERNS_8ExifDataE:
  564|  5.41k|  static void encode(Blob& blob, ByteOrder byteOrder, ExifData& exifData) {
  565|  5.41k|    encode(blob, nullptr, 0, byteOrder, exifData);
  566|  5.41k|  }

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  12.6M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  18.8M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   391k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  158|  5.32M|  [[nodiscard]] auto begin() noexcept {
  159|  5.32M|    return pData_.begin();
  160|  5.32M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  64.8k|  [[nodiscard]] auto end() noexcept {
  163|  64.8k|    return pData_.end();
  164|  64.8k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  37.4k|  [[nodiscard]] auto begin() const noexcept {
  167|  37.4k|    return pData_.begin();
  168|  37.4k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  37.2k|  [[nodiscard]] auto end() const noexcept {
  171|  37.2k|    return pData_.end();
  172|  37.2k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  8.10M|  [[nodiscard]] size_t size() const {
  175|  8.10M|    return pData_.size();
  176|  8.10M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  87.2k|  [[nodiscard]] bool empty() const {
  208|  87.2k|    return pData_.empty();
  209|  87.2k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  2.37M|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  20.0k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  59.0k|const T* find(T (&src)[N], const K& key) {
  461|  59.0k|  static_assert(N > 0, "Passed zero length find");
  462|  59.0k|  auto rc = std::find(src, src + N, key);
  463|  59.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 59.0k]
  ------------------
  464|  59.0k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   116k|std::string toString(const T& arg) {
  480|   116k|  return toStringHelper(arg, std::is_integral<T>());
  481|   116k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   116k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   116k|  return std::to_string(arg);
  470|   116k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  48.3M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  48.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 956k, False: 47.3M]
  ------------------
  242|   956k|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|   956k|  }
  244|  47.3M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  48.3M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|   396k|const T* find(T (&src)[N], const K& key) {
  461|   396k|  static_assert(N > 0, "Passed zero length find");
  462|   396k|  auto rc = std::find(src, src + N, key);
  463|   396k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 391k, False: 5.26k]
  ------------------
  464|   396k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  12.7M|const T* find(T (&src)[N], const K& key) {
  461|  12.7M|  static_assert(N > 0, "Passed zero length find");
  462|  12.7M|  auto rc = std::find(src, src + N, key);
  463|  12.7M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.16M, False: 8.62M]
  ------------------
  464|  12.7M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     17|T stringTo(const std::string& s, bool& ok) {
  496|     17|  std::istringstream is(s);
  497|     17|  T tmp = T();
  498|     17|  ok = static_cast<bool>(is >> tmp);
  499|     17|  std::string rest;
  500|     17|  is >> std::skipws >> rest;
  501|     17|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 0, False: 17]
  ------------------
  502|      0|    ok = false;
  503|     17|  return tmp;
  504|     17|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  21.2k|std::string toString(const T& arg) {
  480|  21.2k|  return toStringHelper(arg, std::is_integral<T>());
  481|  21.2k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  21.2k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  21.2k|  return std::to_string(arg);
  470|  21.2k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.52k|std::string toString(const T& arg) {
  480|  3.52k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.52k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  3.52k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  3.52k|  return std::to_string(arg);
  470|  3.52k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   180k|std::string toString(const T& arg) {
  480|   180k|  return toStringHelper(arg, std::is_integral<T>());
  481|   180k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   180k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   180k|  return std::to_string(arg);
  470|   180k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.01k|std::string toString(const T& arg) {
  480|  3.01k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.01k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  3.01k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  3.01k|  std::ostringstream os;
  475|  3.01k|  os << arg;
  476|  3.01k|  return os.str();
  477|  3.01k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   169k|std::string toString(const T& arg) {
  480|   169k|  return toStringHelper(arg, std::is_integral<T>());
  481|   169k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   169k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   169k|  std::ostringstream os;
  475|   169k|  os << arg;
  476|   169k|  return os.str();
  477|   169k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  38.9k|std::string toString(const T& arg) {
  480|  38.9k|  return toStringHelper(arg, std::is_integral<T>());
  481|  38.9k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  38.9k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  38.9k|  return std::to_string(arg);
  470|  38.9k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|  1.38k|const T* find(T (&src)[N], const K& key) {
  461|  1.38k|  static_assert(N > 0, "Passed zero length find");
  462|  1.38k|  auto rc = std::find(src, src + N, key);
  463|  1.38k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.04k, False: 337]
  ------------------
  464|  1.38k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.48k|const T* find(T (&src)[N], const K& key) {
  461|  1.48k|  static_assert(N > 0, "Passed zero length find");
  462|  1.48k|  auto rc = std::find(src, src + N, key);
  463|  1.48k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 656, False: 830]
  ------------------
  464|  1.48k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|  1.46k|const T* find(T (&src)[N], const K& key) {
  461|  1.46k|  static_assert(N > 0, "Passed zero length find");
  462|  1.46k|  auto rc = std::find(src, src + N, key);
  463|  1.46k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.34k, False: 125]
  ------------------
  464|  1.46k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|   158k|const T* find(T (&src)[N], const K& key) {
  461|   158k|  static_assert(N > 0, "Passed zero length find");
  462|   158k|  auto rc = std::find(src, src + N, key);
  463|   158k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.97k, False: 156k]
  ------------------
  464|   158k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  3.46k|const T* find(T (&src)[N], const K& key) {
  461|  3.46k|  static_assert(N > 0, "Passed zero length find");
  462|  3.46k|  auto rc = std::find(src, src + N, key);
  463|  3.46k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.89k, False: 1.56k]
  ------------------
  464|  3.46k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  7.47k|const T* find(T (&src)[N], const K& key) {
  461|  7.47k|  static_assert(N > 0, "Passed zero length find");
  462|  7.47k|  auto rc = std::find(src, src + N, key);
  463|  7.47k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.43k, False: 2.03k]
  ------------------
  464|  7.47k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  9.52k|const T* find(T (&src)[N], const K& key) {
  461|  9.52k|  static_assert(N > 0, "Passed zero length find");
  462|  9.52k|  auto rc = std::find(src, src + N, key);
  463|  9.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 8.35k, False: 1.17k]
  ------------------
  464|  9.52k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  3.49k|std::string toString(const T& arg) {
  480|  3.49k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.49k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  3.49k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  3.49k|  std::ostringstream os;
  475|  3.49k|  os << arg;
  476|  3.49k|  return os.str();
  477|  3.49k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  2.67k|std::string toString(const T& arg) {
  480|  2.67k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.67k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  2.67k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  2.67k|  return std::to_string(arg);
  470|  2.67k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   492k|std::string toString(const T& arg) {
  480|   492k|  return toStringHelper(arg, std::is_integral<T>());
  481|   492k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   492k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   492k|  std::ostringstream os;
  475|   492k|  os << arg;
  476|   492k|  return os.str();
  477|   492k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.59k|const T* find(T (&src)[N], const K& key) {
  461|  1.59k|  static_assert(N > 0, "Passed zero length find");
  462|  1.59k|  auto rc = std::find(src, src + N, key);
  463|  1.59k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.40k, False: 193]
  ------------------
  464|  1.59k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  9.02k|const T* find(T (&src)[N], const K& key) {
  461|  9.02k|  static_assert(N > 0, "Passed zero length find");
  462|  9.02k|  auto rc = std::find(src, src + N, key);
  463|  9.02k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.12k, False: 3.89k]
  ------------------
  464|  9.02k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  9.02k|const T* find(T (&src)[N], const K& key) {
  461|  9.02k|  static_assert(N > 0, "Passed zero length find");
  462|  9.02k|  auto rc = std::find(src, src + N, key);
  463|  9.02k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 8.20k, False: 814]
  ------------------
  464|  9.02k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  4.70k|const T* find(T (&src)[N], const K& key) {
  461|  4.70k|  static_assert(N > 0, "Passed zero length find");
  462|  4.70k|  auto rc = std::find(src, src + N, key);
  463|  4.70k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.11k, False: 1.59k]
  ------------------
  464|  4.70k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  460|   103k|const T* find(T (&src)[N], const K& key) {
  461|   103k|  static_assert(N > 0, "Passed zero length find");
  462|   103k|  auto rc = std::find(src, src + N, key);
  463|   103k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 90.3k, False: 13.4k]
  ------------------
  464|   103k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  30.5k|const T* find(T (&src)[N], const K& key) {
  461|  30.5k|  static_assert(N > 0, "Passed zero length find");
  462|  30.5k|  auto rc = std::find(src, src + N, key);
  463|  30.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 11.5k, False: 18.9k]
  ------------------
  464|  30.5k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  4.83k|const T* find(T (&src)[N], const K& key) {
  461|  4.83k|  static_assert(N > 0, "Passed zero length find");
  462|  4.83k|  auto rc = std::find(src, src + N, key);
  463|  4.83k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.80k, False: 1.02k]
  ------------------
  464|  4.83k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  4.81k|const T* find(T (&src)[N], const K& key) {
  461|  4.81k|  static_assert(N > 0, "Passed zero length find");
  462|  4.81k|  auto rc = std::find(src, src + N, key);
  463|  4.81k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.68k, False: 2.13k]
  ------------------
  464|  4.81k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|  1.30k|const T* find(T (&src)[N], const K& key) {
  461|  1.30k|  static_assert(N > 0, "Passed zero length find");
  462|  1.30k|  auto rc = std::find(src, src + N, key);
  463|  1.30k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 753, False: 549]
  ------------------
  464|  1.30k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   141k|const T* find(T (&src)[N], const K& key) {
  461|   141k|  static_assert(N > 0, "Passed zero length find");
  462|   141k|  auto rc = std::find(src, src + N, key);
  463|   141k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 121k, False: 19.4k]
  ------------------
  464|   141k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|   114k|const T* find(T (&src)[N], const K& key) {
  461|   114k|  static_assert(N > 0, "Passed zero length find");
  462|   114k|  auto rc = std::find(src, src + N, key);
  463|   114k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 109k, False: 4.33k]
  ------------------
  464|   114k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  3.27k|const T* find(T (&src)[N], const K& key) {
  461|  3.27k|  static_assert(N > 0, "Passed zero length find");
  462|  3.27k|  auto rc = std::find(src, src + N, key);
  463|  3.27k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 785, False: 2.49k]
  ------------------
  464|  3.27k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  4.63k|const T* find(T (&src)[N], const K& key) {
  461|  4.63k|  static_assert(N > 0, "Passed zero length find");
  462|  4.63k|  auto rc = std::find(src, src + N, key);
  463|  4.63k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.74k, False: 2.89k]
  ------------------
  464|  4.63k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  11.7M|const T* find(T (&src)[N], const K& key) {
  461|  11.7M|  static_assert(N > 0, "Passed zero length find");
  462|  11.7M|  auto rc = std::find(src, src + N, key);
  463|  11.7M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 11.7M]
  ------------------
  464|  11.7M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  8.35M|const T* find(T (&src)[N], const K& key) {
  461|  8.35M|  static_assert(N > 0, "Passed zero length find");
  462|  8.35M|  auto rc = std::find(src, src + N, key);
  463|  8.35M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 8.35M]
  ------------------
  464|  8.35M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  6.74M|const T* find(T (&src)[N], const K& key) {
  461|  6.74M|  static_assert(N > 0, "Passed zero length find");
  462|  6.74M|  auto rc = std::find(src, src + N, key);
  463|  6.74M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 6.73M, False: 16.0k]
  ------------------
  464|  6.74M|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  6.78k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|   148k|const T* find(T (&src)[N], const K& key) {
  461|   148k|  static_assert(N > 0, "Passed zero length find");
  462|   148k|  auto rc = std::find(src, src + N, key);
  463|   148k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 43.1k, False: 105k]
  ------------------
  464|   148k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|  1.40M|const T* find(T (&src)[N], const K& key) {
  461|  1.40M|  static_assert(N > 0, "Passed zero length find");
  462|  1.40M|  auto rc = std::find(src, src + N, key);
  463|  1.40M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 125, False: 1.40M]
  ------------------
  464|  1.40M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  19.5k|const T* find(T (&src)[N], const K& key) {
  461|  19.5k|  static_assert(N > 0, "Passed zero length find");
  462|  19.5k|  auto rc = std::find(src, src + N, key);
  463|  19.5k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 7.37k, False: 12.1k]
  ------------------
  464|  19.5k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  460|  9.50k|const T* find(T (&src)[N], const K& key) {
  461|  9.50k|  static_assert(N > 0, "Passed zero length find");
  462|  9.50k|  auto rc = std::find(src, src + N, key);
  463|  9.50k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 9.50k]
  ------------------
  464|  9.50k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|  1.82k|const T* find(T (&src)[N], const K& key) {
  461|  1.82k|  static_assert(N > 0, "Passed zero length find");
  462|  1.82k|  auto rc = std::find(src, src + N, key);
  463|  1.82k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 313, False: 1.51k]
  ------------------
  464|  1.82k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    225|T stringTo(const std::string& s, bool& ok) {
  496|    225|  std::istringstream is(s);
  497|    225|  T tmp = T();
  498|    225|  ok = static_cast<bool>(is >> tmp);
  499|    225|  std::string rest;
  500|    225|  is >> std::skipws >> rest;
  501|    225|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 75, False: 150]
  ------------------
  502|     75|    ok = false;
  503|    225|  return tmp;
  504|    225|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|    126|const T* find(T (&src)[N], const K& key) {
  461|    126|  static_assert(N > 0, "Passed zero length find");
  462|    126|  auto rc = std::find(src, src + N, key);
  463|    126|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 117, False: 9]
  ------------------
  464|    126|}

_ZNK5Exiv25Value6typeIdEv:
   85|  11.4M|  TypeId typeId() const {
   86|  11.4M|    return type_;
   87|  11.4M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  16.1M|  UniquePtr clone() const {
   94|  16.1M|    return UniquePtr(clone_());
   95|  16.1M|  }
_ZNK5Exiv25Value2okEv:
  181|  35.5k|  bool ok() const {
  182|  35.5k|    return ok_;
  183|  35.5k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  42.5k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  42.5k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 24.6k, False: 17.9k]
  ------------------
  797|  24.6k|      return str1.size() > str2.size();
  798|       |
  799|  17.9k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  17.9k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  42.5k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   524k|inline TypeId getType<uint16_t>() {
 1084|   524k|  return unsignedShort;
 1085|   524k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  4.83k|inline TypeId getType<uint32_t>() {
 1089|  4.83k|  return unsignedLong;
 1090|  4.83k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  14.2k|inline TypeId getType<URational>() {
 1094|  14.2k|  return unsignedRational;
 1095|  14.2k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  47.5k|inline TypeId getType<int16_t>() {
 1099|  47.5k|  return signedShort;
 1100|  47.5k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  43.5k|inline TypeId getType<int32_t>() {
 1104|  43.5k|  return signedLong;
 1105|  43.5k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  14.7k|inline TypeId getType<Rational>() {
 1109|  14.7k|  return signedRational;
 1110|  14.7k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  8.76k|inline TypeId getType<float>() {
 1114|  8.76k|  return tiffFloat;
 1115|  8.76k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  15.3k|inline TypeId getType<double>() {
 1119|  15.3k|  return tiffDouble;
 1120|  15.3k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.69M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.69M|  return getUShort(buf, byteOrder);
 1316|  1.69M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  3.35M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  3.35M|  return getULong(buf, byteOrder);
 1321|  3.35M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   484k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   484k|  return getURational(buf, byteOrder);
 1326|   484k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   597k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   597k|  return getShort(buf, byteOrder);
 1331|   597k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   591k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   591k|  return getLong(buf, byteOrder);
 1336|   591k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   427k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   427k|  return getRational(buf, byteOrder);
 1341|   427k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|   206k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|   206k|  return getFloat(buf, byteOrder);
 1346|   206k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   517k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   517k|  return getDouble(buf, byteOrder);
 1351|   517k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   625k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   625k|  return us2Data(buf, t, byteOrder);
 1374|   625k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  1.99M|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  1.99M|  return ul2Data(buf, t, byteOrder);
 1382|  1.99M|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   346k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   346k|  return ur2Data(buf, t, byteOrder);
 1390|   346k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   561k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   561k|  return s2Data(buf, t, byteOrder);
 1398|   561k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   368k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   368k|  return l2Data(buf, t, byteOrder);
 1406|   368k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   404k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   404k|  return r2Data(buf, t, byteOrder);
 1414|   404k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|   173k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|   173k|  return f2Data(buf, t, byteOrder);
 1422|   173k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   214k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   214k|  return d2Data(buf, t, byteOrder);
 1430|   214k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  4.99k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  4.99k|  return float_to_integer_helper<int64_t>(n);
 1550|  4.99k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  29.6k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  29.6k|  return float_to_integer_helper<uint32_t>(n);
 1555|  29.6k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  9.61k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  9.61k|  return float_to_integer_helper<int64_t>(n);
 1560|  9.61k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  17.4k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  17.4k|  return float_to_integer_helper<uint32_t>(n);
 1564|  17.4k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  4.91k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  4.91k|  return rational_to_integer_helper<int64_t>(n);
 1569|  4.91k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  9.31k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  9.31k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  9.31k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  1.17k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  1.17k|  return rational_to_integer_helper<int64_t>(n);
 1578|  1.17k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  4.99k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  4.99k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  4.99k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  4.99k|  I float_to_integer_helper(size_t n) const {
 1213|  4.99k|    const auto v = value_.at(n);
 1214|  4.99k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 4.34k, False: 647]
  ------------------
 1215|  4.34k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 3.26k, False: 1.07k]
  ------------------
 1216|  3.26k|      return static_cast<I>(std::lround(v));
 1217|  3.26k|    }
 1218|  1.72k|    return 0;
 1219|  4.99k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  29.6k|  I float_to_integer_helper(size_t n) const {
 1213|  29.6k|    const auto v = value_.at(n);
 1214|  29.6k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 24.1k, False: 5.57k]
  ------------------
 1215|  24.1k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 16.7k, False: 7.32k]
  ------------------
 1216|  16.7k|      return static_cast<I>(std::lround(v));
 1217|  16.7k|    }
 1218|  12.9k|    return 0;
 1219|  29.6k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  9.61k|  I float_to_integer_helper(size_t n) const {
 1213|  9.61k|    const auto v = value_.at(n);
 1214|  9.61k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 8.65k, False: 963]
  ------------------
 1215|  8.65k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 7.03k, False: 1.61k]
  ------------------
 1216|  7.03k|      return static_cast<I>(std::lround(v));
 1217|  7.03k|    }
 1218|  2.57k|    return 0;
 1219|  9.61k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  17.4k|  I float_to_integer_helper(size_t n) const {
 1213|  17.4k|    const auto v = value_.at(n);
 1214|  17.4k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 14.1k, False: 3.25k]
  ------------------
 1215|  14.1k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 11.5k, False: 2.63k]
  ------------------
 1216|  11.5k|      return static_cast<I>(std::lround(v));
 1217|  11.5k|    }
 1218|  5.88k|    return 0;
 1219|  17.4k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  4.91k|  I rational_to_integer_helper(size_t n) const {
 1224|  4.91k|    auto a = value_.at(n).first;
 1225|  4.91k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  4.91k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.67k, False: 3.24k]
  ------------------
 1229|  1.67k|      return 0;
 1230|  1.67k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  3.24k|#ifdef __cpp_if_constexpr
 1234|  3.24k|    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.24k|      const auto imin = std::numeric_limits<I>::min();
 1240|  3.24k|      const auto imax = std::numeric_limits<I>::max();
 1241|  3.24k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 3.24k]
  |  Branch (1241:23): [True: 0, False: 3.24k]
  |  Branch (1241:35): [True: 0, False: 3.24k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  3.24k|#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.24k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  4.91k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  9.31k|  I rational_to_integer_helper(size_t n) const {
 1224|  9.31k|    auto a = value_.at(n).first;
 1225|  9.31k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  9.31k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.07k, False: 7.23k]
  ------------------
 1229|  2.07k|      return 0;
 1230|  2.07k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  7.23k|#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.23k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  7.23k|      const auto imax = std::numeric_limits<I>::max();
 1257|  7.23k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 1.09k, False: 6.14k]
  ------------------
 1258|  1.09k|        return 0;
 1259|  1.09k|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  6.14k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  6.14k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  6.14k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 6.14k]
  |  Branch (1263:25): [True: 0, False: 6.14k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  6.14k|    }
 1267|       |
 1268|  6.14k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  9.31k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  1.17k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.17k|    auto a = value_.at(n).first;
 1225|  1.17k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.17k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 353, False: 822]
  ------------------
 1229|    353|      return 0;
 1230|    353|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|    822|#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|    822|    } 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|    822|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|    822|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 822]
  |  Branch (1251:23): [True: 0, False: 822]
  ------------------
 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|    822|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.17k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  4.99k|  I rational_to_integer_helper(size_t n) const {
 1224|  4.99k|    auto a = value_.at(n).first;
 1225|  4.99k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  4.99k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 788, False: 4.20k]
  ------------------
 1229|    788|      return 0;
 1230|    788|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  4.20k|#ifdef __cpp_if_constexpr
 1234|  4.20k|    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|  4.20k|      const auto imin = std::numeric_limits<I>::min();
 1240|  4.20k|      const auto imax = std::numeric_limits<I>::max();
 1241|  4.20k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 4.20k]
  |  Branch (1241:23): [True: 0, False: 4.20k]
  |  Branch (1241:35): [True: 0, False: 4.20k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  4.20k|#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|  4.20k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  4.99k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   524k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   524k|}
_ZN5Exiv25ValueD2Ev:
   43|  20.9M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   523k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   523k|  value_.clear();
 1469|   523k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   523k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 523k, False: 0]
  |  Branch (1470:17): [True: 542, False: 522k]
  ------------------
 1471|    542|    len = (len / ts) * ts;
 1472|  2.21M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.69M, False: 523k]
  ------------------
 1473|  1.69M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.69M|  }
 1475|   523k|  return 0;
 1476|   523k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.63k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.63k|  std::istringstream is(buf);
 1481|  1.63k|  T tmp;
 1482|  1.63k|  ValueList val;
 1483|  3.26k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 1.63k, False: 1.63k]
  ------------------
 1484|  1.63k|    val.push_back(tmp);
 1485|  1.63k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 7, False: 1.62k]
  ------------------
 1486|      7|    return 1;
 1487|  1.62k|  value_ = std::move(val);
 1488|  1.62k|  return 0;
 1489|  1.63k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.96k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.96k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.34k, False: 620]
  ------------------
 1651|  1.34k|    pDataArea_ = Blob(buf, buf + len);
 1652|    620|  else
 1653|    620|    pDataArea_.clear();
 1654|  1.96k|  return 0;
 1655|  1.96k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  56.7k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  56.7k|  size_t offset = 0;
 1494|   625k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 625k, False: 56.7k]
  ------------------
 1495|   625k|    offset += toData(buf + offset, val, byteOrder);
 1496|   625k|  }
 1497|  56.7k|  return offset;
 1498|  56.7k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   856k|size_t ValueType<T>::count() const {
 1502|   856k|  return value_.size();
 1503|   856k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   276k|size_t ValueType<T>::size() const {
 1507|   276k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   276k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    924|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    924|  auto end = value_.end();
 1518|    924|  auto i = value_.begin();
 1519|  4.56M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.56M, False: 924]
  ------------------
 1520|  4.56M|    os << std::setprecision(15) << *i;
 1521|  4.56M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.56M, False: 410]
  ------------------
 1522|  4.56M|      os << " ";
 1523|  4.56M|  }
 1524|    924|  return os;
 1525|    924|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   205k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   205k|  ok_ = true;
 1537|   205k|  return static_cast<int64_t>(value_.at(n));
 1538|   205k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   237k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   237k|  ok_ = true;
 1542|   237k|  return static_cast<uint32_t>(value_.at(n));
 1543|   237k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  9.38k|size_t ValueType<T>::sizeDataArea() const {
 1640|  9.38k|  return pDataArea_.size();
 1641|  9.38k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|  1.22k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.22k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.22k|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|  1.11M|ValueType<T>* ValueType<T>::clone_() const {
 1512|  1.11M|  return new ValueType<T>(*this);
 1513|  1.11M|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|  1.11M|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  1.11M|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.11k, False: 1.11M]
  ------------------
 1449|  3.11k|    pDataArea_ = rhs.pDataArea_;
 1450|  1.11M|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  14.3M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  91.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  91.7k|  value_.clear();
 1469|  91.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  91.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 91.7k, False: 0]
  |  Branch (1470:17): [True: 72, False: 91.6k]
  ------------------
 1471|     72|    len = (len / ts) * ts;
 1472|  3.45M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 3.35M, False: 91.7k]
  ------------------
 1473|  3.35M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  3.35M|  }
 1475|  91.7k|  return 0;
 1476|  91.7k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|    985|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    985|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 621, False: 364]
  ------------------
 1651|    621|    pDataArea_ = Blob(buf, buf + len);
 1652|    364|  else
 1653|    364|    pDataArea_.clear();
 1654|    985|  return 0;
 1655|    985|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  43.1k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  43.1k|  size_t offset = 0;
 1494|  1.99M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.99M, False: 43.1k]
  ------------------
 1495|  1.99M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.99M|  }
 1497|  43.1k|  return offset;
 1498|  43.1k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   231k|size_t ValueType<T>::count() const {
 1502|   231k|  return value_.size();
 1503|   231k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   161k|size_t ValueType<T>::size() const {
 1507|   161k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   161k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  5.23k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  5.23k|  auto end = value_.end();
 1518|  5.23k|  auto i = value_.begin();
 1519|  29.3k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 24.0k, False: 5.23k]
  ------------------
 1520|  24.0k|    os << std::setprecision(15) << *i;
 1521|  24.0k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 19.2k, False: 4.85k]
  ------------------
 1522|  19.2k|      os << " ";
 1523|  24.0k|  }
 1524|  5.23k|  return os;
 1525|  5.23k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  8.54k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  8.54k|  ok_ = true;
 1537|  8.54k|  return static_cast<int64_t>(value_.at(n));
 1538|  8.54k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  92.0k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  92.0k|  ok_ = true;
 1542|  92.0k|  return static_cast<uint32_t>(value_.at(n));
 1543|  92.0k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  16.2k|size_t ValueType<T>::sizeDataArea() const {
 1640|  16.2k|  return pDataArea_.size();
 1641|  16.2k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|  1.67k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.67k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.67k|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   279k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   279k|  return new ValueType<T>(*this);
 1513|   279k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   279k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   279k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 515, False: 279k]
  ------------------
 1449|    515|    pDataArea_ = rhs.pDataArea_;
 1450|   279k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  14.2k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  14.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  13.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  13.5k|  value_.clear();
 1469|  13.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  13.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 13.5k, False: 0]
  |  Branch (1470:17): [True: 0, False: 13.5k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   498k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 484k, False: 13.5k]
  ------------------
 1473|   484k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   484k|  }
 1475|  13.5k|  return 0;
 1476|  13.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|  1.39k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.39k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 874, False: 517]
  ------------------
 1651|    874|    pDataArea_ = Blob(buf, buf + len);
 1652|    517|  else
 1653|    517|    pDataArea_.clear();
 1654|  1.39k|  return 0;
 1655|  1.39k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  10.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  10.3k|  size_t offset = 0;
 1494|   346k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 346k, False: 10.3k]
  ------------------
 1495|   346k|    offset += toData(buf + offset, val, byteOrder);
 1496|   346k|  }
 1497|  10.3k|  return offset;
 1498|  10.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  30.8k|size_t ValueType<T>::count() const {
 1502|  30.8k|  return value_.size();
 1503|  30.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  28.7k|size_t ValueType<T>::size() const {
 1507|  28.7k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  28.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    831|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    831|  auto end = value_.end();
 1518|    831|  auto i = value_.begin();
 1519|  83.3k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 82.5k, False: 831]
  ------------------
 1520|  82.5k|    os << std::setprecision(15) << *i;
 1521|  82.5k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 82.0k, False: 464]
  ------------------
 1522|  82.0k|      os << " ";
 1523|  82.5k|  }
 1524|    831|  return os;
 1525|    831|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  9.06k|size_t ValueType<T>::sizeDataArea() const {
 1640|  9.06k|  return pDataArea_.size();
 1641|  9.06k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    682|DataBuf ValueType<T>::dataArea() const {
 1645|    682|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    682|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  42.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  42.3k|  return new ValueType<T>(*this);
 1513|  42.3k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  42.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  42.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.47k, False: 40.8k]
  ------------------
 1449|  1.47k|    pDataArea_ = rhs.pDataArea_;
 1450|  42.3k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  47.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  47.5k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  41.0k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  41.0k|  value_.clear();
 1469|  41.0k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  41.0k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 41.0k, False: 0]
  |  Branch (1470:17): [True: 61, False: 40.9k]
  ------------------
 1471|     61|    len = (len / ts) * ts;
 1472|   638k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 597k, False: 41.0k]
  ------------------
 1473|   597k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   597k|  }
 1475|  41.0k|  return 0;
 1476|  41.0k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  6.48k|int ValueType<T>::read(const std::string& buf) {
 1480|  6.48k|  std::istringstream is(buf);
 1481|  6.48k|  T tmp;
 1482|  6.48k|  ValueList val;
 1483|  27.6k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 21.2k, False: 6.48k]
  ------------------
 1484|  21.2k|    val.push_back(tmp);
 1485|  6.48k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 6.48k]
  ------------------
 1486|      0|    return 1;
 1487|  6.48k|  value_ = std::move(val);
 1488|  6.48k|  return 0;
 1489|  6.48k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    970|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    970|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 501, False: 469]
  ------------------
 1651|    501|    pDataArea_ = Blob(buf, buf + len);
 1652|    469|  else
 1653|    469|    pDataArea_.clear();
 1654|    970|  return 0;
 1655|    970|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  10.4k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  10.4k|  size_t offset = 0;
 1494|   561k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 561k, False: 10.4k]
  ------------------
 1495|   561k|    offset += toData(buf + offset, val, byteOrder);
 1496|   561k|  }
 1497|  10.4k|  return offset;
 1498|  10.4k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|   118k|size_t ValueType<T>::count() const {
 1502|   118k|  return value_.size();
 1503|   118k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  57.6k|size_t ValueType<T>::size() const {
 1507|  57.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  57.6k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    678|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    678|  auto end = value_.end();
 1518|    678|  auto i = value_.begin();
 1519|  54.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 53.8k, False: 678]
  ------------------
 1520|  53.8k|    os << std::setprecision(15) << *i;
 1521|  53.8k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 53.5k, False: 370]
  ------------------
 1522|  53.5k|      os << " ";
 1523|  53.8k|  }
 1524|    678|  return os;
 1525|    678|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  28.7k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  28.7k|  ok_ = true;
 1537|  28.7k|  return static_cast<int64_t>(value_.at(n));
 1538|  28.7k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   131k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   131k|  ok_ = true;
 1542|   131k|  return static_cast<uint32_t>(value_.at(n));
 1543|   131k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  2.29k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.29k|  return pDataArea_.size();
 1641|  2.29k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    328|DataBuf ValueType<T>::dataArea() const {
 1645|    328|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    328|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|   107k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   107k|  return new ValueType<T>(*this);
 1513|   107k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|   107k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   107k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 656, False: 106k]
  ------------------
 1449|    656|    pDataArea_ = rhs.pDataArea_;
 1450|   107k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  43.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  43.5k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  43.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  43.5k|  value_.clear();
 1469|  43.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  43.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 43.5k, False: 0]
  |  Branch (1470:17): [True: 149, False: 43.4k]
  ------------------
 1471|    149|    len = (len / ts) * ts;
 1472|   634k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 591k, False: 43.5k]
  ------------------
 1473|   591k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   591k|  }
 1475|  43.5k|  return 0;
 1476|  43.5k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|  1.24k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.24k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 889, False: 358]
  ------------------
 1651|    889|    pDataArea_ = Blob(buf, buf + len);
 1652|    358|  else
 1653|    358|    pDataArea_.clear();
 1654|  1.24k|  return 0;
 1655|  1.24k|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  33.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  33.3k|  size_t offset = 0;
 1494|   368k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 368k, False: 33.3k]
  ------------------
 1495|   368k|    offset += toData(buf + offset, val, byteOrder);
 1496|   368k|  }
 1497|  33.3k|  return offset;
 1498|  33.3k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   155k|size_t ValueType<T>::count() const {
 1502|   155k|  return value_.size();
 1503|   155k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   236k|size_t ValueType<T>::size() const {
 1507|   236k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   236k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    673|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    673|  auto end = value_.end();
 1518|    673|  auto i = value_.begin();
 1519|  6.60k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.92k, False: 673]
  ------------------
 1520|  5.92k|    os << std::setprecision(15) << *i;
 1521|  5.92k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 5.46k, False: 462]
  ------------------
 1522|  5.46k|      os << " ";
 1523|  5.92k|  }
 1524|    673|  return os;
 1525|    673|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  17.3k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  17.3k|  ok_ = true;
 1537|  17.3k|  return static_cast<int64_t>(value_.at(n));
 1538|  17.3k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  29.7k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  29.7k|  ok_ = true;
 1542|  29.7k|  return static_cast<uint32_t>(value_.at(n));
 1543|  29.7k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  12.4k|size_t ValueType<T>::sizeDataArea() const {
 1640|  12.4k|  return pDataArea_.size();
 1641|  12.4k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    996|DataBuf ValueType<T>::dataArea() const {
 1645|    996|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    996|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   131k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   131k|  return new ValueType<T>(*this);
 1513|   131k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   131k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   131k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 2.37k, False: 128k]
  ------------------
 1449|  2.37k|    pDataArea_ = rhs.pDataArea_;
 1450|   131k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  14.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  14.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  14.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  14.7k|  value_.clear();
 1469|  14.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  14.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 14.7k, False: 0]
  |  Branch (1470:17): [True: 0, False: 14.7k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   442k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 427k, False: 14.7k]
  ------------------
 1473|   427k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   427k|  }
 1475|  14.7k|  return 0;
 1476|  14.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    840|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    840|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 569, False: 271]
  ------------------
 1651|    569|    pDataArea_ = Blob(buf, buf + len);
 1652|    271|  else
 1653|    271|    pDataArea_.clear();
 1654|    840|  return 0;
 1655|    840|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  8.21k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  8.21k|  size_t offset = 0;
 1494|   404k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 404k, False: 8.21k]
  ------------------
 1495|   404k|    offset += toData(buf + offset, val, byteOrder);
 1496|   404k|  }
 1497|  8.21k|  return offset;
 1498|  8.21k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  36.7k|size_t ValueType<T>::count() const {
 1502|  36.7k|  return value_.size();
 1503|  36.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  24.4k|size_t ValueType<T>::size() const {
 1507|  24.4k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  24.4k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|  1.48k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  1.48k|  auto end = value_.end();
 1518|  1.48k|  auto i = value_.begin();
 1519|  12.5k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 11.0k, False: 1.48k]
  ------------------
 1520|  11.0k|    os << std::setprecision(15) << *i;
 1521|  11.0k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 10.2k, False: 784]
  ------------------
 1522|  10.2k|      os << " ";
 1523|  11.0k|  }
 1524|  1.48k|  return os;
 1525|  1.48k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  9.49k|size_t ValueType<T>::sizeDataArea() const {
 1640|  9.49k|  return pDataArea_.size();
 1641|  9.49k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|    831|DataBuf ValueType<T>::dataArea() const {
 1645|    831|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    831|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  43.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  43.4k|  return new ValueType<T>(*this);
 1513|  43.4k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  43.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  43.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 493, False: 42.9k]
  ------------------
 1449|    493|    pDataArea_ = rhs.pDataArea_;
 1450|  43.4k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  8.76k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  8.76k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  8.76k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  8.76k|  value_.clear();
 1469|  8.76k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  8.76k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 8.76k, False: 0]
  |  Branch (1470:17): [True: 0, False: 8.76k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   214k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 206k, False: 8.76k]
  ------------------
 1473|   206k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   206k|  }
 1475|  8.76k|  return 0;
 1476|  8.76k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|    596|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    596|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 442, False: 154]
  ------------------
 1651|    442|    pDataArea_ = Blob(buf, buf + len);
 1652|    154|  else
 1653|    154|    pDataArea_.clear();
 1654|    596|  return 0;
 1655|    596|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  4.99k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  4.99k|  size_t offset = 0;
 1494|   173k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 173k, False: 4.99k]
  ------------------
 1495|   173k|    offset += toData(buf + offset, val, byteOrder);
 1496|   173k|  }
 1497|  4.99k|  return offset;
 1498|  4.99k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  42.7k|size_t ValueType<T>::count() const {
 1502|  42.7k|  return value_.size();
 1503|  42.7k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  12.3k|size_t ValueType<T>::size() const {
 1507|  12.3k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  12.3k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    977|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    977|  auto end = value_.end();
 1518|    977|  auto i = value_.begin();
 1519|  6.01k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 5.03k, False: 977]
  ------------------
 1520|  5.03k|    os << std::setprecision(15) << *i;
 1521|  5.03k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.39k, False: 644]
  ------------------
 1522|  4.39k|      os << " ";
 1523|  5.03k|  }
 1524|    977|  return os;
 1525|    977|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  7.26k|size_t ValueType<T>::sizeDataArea() const {
 1640|  7.26k|  return pDataArea_.size();
 1641|  7.26k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    217|DataBuf ValueType<T>::dataArea() const {
 1645|    217|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    217|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  30.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  30.5k|  return new ValueType<T>(*this);
 1513|  30.5k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  30.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  30.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 569, False: 29.9k]
  ------------------
 1449|    569|    pDataArea_ = rhs.pDataArea_;
 1450|  30.5k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  15.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  15.3k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  15.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  15.3k|  value_.clear();
 1469|  15.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  15.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 15.3k, False: 0]
  |  Branch (1470:17): [True: 0, False: 15.3k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   532k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 517k, False: 15.3k]
  ------------------
 1473|   517k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   517k|  }
 1475|  15.3k|  return 0;
 1476|  15.3k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    607|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    607|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 329, False: 278]
  ------------------
 1651|    329|    pDataArea_ = Blob(buf, buf + len);
 1652|    278|  else
 1653|    278|    pDataArea_.clear();
 1654|    607|  return 0;
 1655|    607|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  7.40k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  7.40k|  size_t offset = 0;
 1494|   214k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 214k, False: 7.40k]
  ------------------
 1495|   214k|    offset += toData(buf + offset, val, byteOrder);
 1496|   214k|  }
 1497|  7.40k|  return offset;
 1498|  7.40k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  44.9k|size_t ValueType<T>::count() const {
 1502|  44.9k|  return value_.size();
 1503|  44.9k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  24.9k|size_t ValueType<T>::size() const {
 1507|  24.9k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  24.9k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    630|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    630|  auto end = value_.end();
 1518|    630|  auto i = value_.begin();
 1519|  4.26k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 3.63k, False: 630]
  ------------------
 1520|  3.63k|    os << std::setprecision(15) << *i;
 1521|  3.63k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.20k, False: 430]
  ------------------
 1522|  3.20k|      os << " ";
 1523|  3.63k|  }
 1524|    630|  return os;
 1525|    630|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  6.46k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.46k|  return pDataArea_.size();
 1641|  6.46k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    491|DataBuf ValueType<T>::dataArea() const {
 1645|    491|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    491|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  44.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  44.6k|  return new ValueType<T>(*this);
 1513|  44.6k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  44.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  44.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 339, False: 44.3k]
  ------------------
 1449|    339|    pDataArea_ = rhs.pDataArea_;
 1450|  44.6k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   397k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  4.83k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.83k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  23.4k|  [[nodiscard]] bool usePacket() const {
  218|  23.4k|    return usePacket_;
  219|  23.4k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  69.6k|  bool usePacket(bool b) {
  223|  69.6k|    bool r = usePacket_;
  224|  69.6k|    usePacket_ = b;
  225|  69.6k|    return r;
  226|  69.6k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  62.5k|  void setPacket(std::string xmpPacket) {
  229|  62.5k|    xmpPacket_ = std::move(xmpPacket);
  230|  62.5k|    usePacket(false);
  231|  62.5k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  261|  40.4k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  262|  40.4k|    return nsBindings_;
  263|  40.4k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  70.9k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  396|  27.0k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|  27.0k|    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  27.0k|  return *this;
  406|  27.0k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  51.8k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  51.8k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  51.8k|  return *this;
  406|  51.8k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   169k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   169k|    setValue(Exiv2::toString(value));
  405|   169k|  return *this;
  406|   169k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  18.1k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  18.1k|    setValue(Exiv2::toString(value));
  405|  18.1k|  return *this;
  406|  18.1k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  21.2k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  21.2k|    setValue(Exiv2::toString(value));
  405|  21.2k|  return *this;
  406|  21.2k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  396|  3.49k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  3.49k|    setValue(Exiv2::toString(value));
  405|  3.49k|  return *this;
  406|  3.49k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  1.80k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  1.80k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  1.80k|  return *this;
  406|  1.80k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|  2.67k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  2.67k|    setValue(Exiv2::toString(value));
  405|  2.67k|  return *this;
  406|  2.67k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  3.01k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  3.01k|    setValue(Exiv2::toString(value));
  405|  3.01k|  return *this;
  406|  3.01k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    414|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|    414|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    414|  return *this;
  406|    414|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|   116k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   116k|    setValue(Exiv2::toString(value));
  405|   116k|  return *this;
  406|   116k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  3.52k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  3.52k|    setValue(Exiv2::toString(value));
  405|  3.52k|  return *this;
  406|  3.52k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   170k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   170k|    setValue(Exiv2::toString(value));
  405|   170k|  return *this;
  406|   170k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  35.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  35.4k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  35.4k|  return *this;
  406|  35.4k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   176k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|   176k|    setValue(Exiv2::toString(value));
  405|   176k|  return *this;
  406|   176k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|     50|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|     50|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|     50|  return *this;
  406|     50|}

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

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

_ZN5Exiv29BmffImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   87|  3.32k|    Image(ImageType::bmff, mdExif | mdIptc | mdXmp, std::move(io), params) {
   88|  3.32k|}  // BmffImage::BmffImage
_ZN5Exiv29BmffImage7fullBoxEj:
  109|  58.6k|bool BmffImage::fullBox(uint32_t box) {
  110|  58.6k|  return box == TAG::meta || box == TAG::iinf || box == TAG::iloc || box == TAG::thmb || box == TAG::prvw;
  ------------------
  |  Branch (110:10): [True: 1.64k, False: 57.0k]
  |  Branch (110:30): [True: 713, False: 56.3k]
  |  Branch (110:50): [True: 2.80k, False: 53.5k]
  |  Branch (110:70): [True: 9.00k, False: 44.5k]
  |  Branch (110:90): [True: 118, False: 44.3k]
  ------------------
  111|  58.6k|}
_ZNK5Exiv29BmffImage10pixelWidthEv:
  151|    223|uint32_t BmffImage::pixelWidth() const {
  152|    223|  auto imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
  153|    223|  if (imageWidth == exifData_.end() || imageWidth->count() == 0)
  ------------------
  |  Branch (153:7): [True: 208, False: 15]
  |  Branch (153:7): [True: 215, False: 8]
  |  Branch (153:40): [True: 7, False: 8]
  ------------------
  154|    215|    return pixelWidth_;
  155|      8|  return imageWidth->toUint32();
  156|    223|}
_ZNK5Exiv29BmffImage11pixelHeightEv:
  158|    223|uint32_t BmffImage::pixelHeight() const {
  159|    223|  auto imageHeight = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
  160|    223|  if (imageHeight == exifData_.end() || imageHeight->count() == 0)
  ------------------
  |  Branch (160:7): [True: 215, False: 8]
  |  Branch (160:7): [True: 219, False: 4]
  |  Branch (160:41): [True: 4, False: 4]
  ------------------
  161|    219|    return pixelHeight_;
  162|      4|  return imageHeight->toUint32();
  163|    223|}
_ZN5Exiv29BmffImage8uuidNameERKNS_7DataBufE:
  165|  1.38k|std::string BmffImage::uuidName(const Exiv2::DataBuf& uuid) {
  166|  1.38k|  const char* uuidCano = "\x85\xC0\xB6\x87\x82\xF\x11\xE0\x81\x11\xF4\xCE\x46\x2B\x6A\x48";
  167|  1.38k|  const char* uuidXmp = "\xBE\x7A\xCF\xCB\x97\xA9\x42\xE8\x9C\x71\x99\x94\x91\xE3\xAF\xAC";
  168|  1.38k|  const char* uuidCanp = "\xEA\xF4\x2B\x5E\x1C\x98\x4B\x88\xB9\xFB\xB7\xDC\x40\x6E\x4D\x16";
  169|  1.38k|  if (uuid.cmpBytes(0, uuidCano, 16) == 0)
  ------------------
  |  Branch (169:7): [True: 51, False: 1.32k]
  ------------------
  170|     51|    return "cano";
  171|  1.32k|  if (uuid.cmpBytes(0, uuidXmp, 16) == 0)
  ------------------
  |  Branch (171:7): [True: 262, False: 1.06k]
  ------------------
  172|    262|    return "xmp";
  173|  1.06k|  if (uuid.cmpBytes(0, uuidCanp, 16) == 0)
  ------------------
  |  Branch (173:7): [True: 708, False: 359]
  ------------------
  174|    708|    return "canp";
  175|    359|  return "";
  176|  1.06k|}
_ZN5Exiv29BmffImage16brotliUncompressEPKhmRNS_7DataBufE:
  184|    248|void BmffImage::brotliUncompress(const byte* compressedBuf, size_t compressedBufSize, DataBuf& arr) {
  185|    248|  auto decoder = BrotliDecoder(BrotliDecoderCreateInstance(nullptr, nullptr, nullptr), BrotliDecoderDestroyInstance);
  186|    248|  size_t uncompressedLen = compressedBufSize * 2;  // just a starting point
  187|    248|  BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
  188|    248|  int dos = 0;
  189|    248|  size_t available_in = compressedBufSize;
  190|    248|  const byte* next_in = compressedBuf;
  191|    248|  size_t available_out;
  192|    248|  byte* next_out;
  193|    248|  size_t total_out = 0;
  194|       |
  195|    697|  while (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (195:10): [True: 593, False: 104]
  ------------------
  196|    593|    arr.alloc(uncompressedLen);
  197|    593|    available_out = uncompressedLen - total_out;
  198|    593|    next_out = arr.data() + total_out;
  199|    593|    result =
  200|    593|        BrotliDecoderDecompressStream(decoder.get(), &available_in, &next_in, &available_out, &next_out, &total_out);
  201|    593|    if (result == BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (201:9): [True: 104, False: 489]
  ------------------
  202|    104|      arr.resize(total_out);
  203|    489|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
  ------------------
  |  Branch (203:16): [True: 381, False: 108]
  ------------------
  204|    381|      uncompressedLen *= 2;
  205|       |      // DoS protection - can't be bigger than 128k
  206|    381|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (206:11): [True: 81, False: 300]
  ------------------
  207|     81|        if (++dos > 1 || total_out > 131072)
  ------------------
  |  Branch (207:13): [True: 35, False: 46]
  |  Branch (207:26): [True: 1, False: 45]
  ------------------
  208|     36|          break;
  209|     45|        uncompressedLen = 131072;
  210|     45|      }
  211|    381|    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
  ------------------
  |  Branch (211:16): [True: 44, False: 64]
  ------------------
  212|       |      // compressed input buffer in incomplete
  213|     44|      throw Error(ErrorCode::kerFailedToReadImageData);
  214|     64|    } else {
  215|       |      // something bad happened
  216|     64|      throw Error(ErrorCode::kerErrorMessage, BrotliDecoderErrorString(BrotliDecoderGetErrorCode(decoder.get())));
  217|     64|    }
  218|    593|  }
  219|       |
  220|    140|  if (result != BROTLI_DECODER_RESULT_SUCCESS) {
  ------------------
  |  Branch (220:7): [True: 36, False: 104]
  ------------------
  221|     36|    throw Error(ErrorCode::kerFailedToReadImageData);
  222|     36|  }
  223|    140|}
_ZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmm:
  227|  60.0k|                               uint64_t pbox_end, size_t depth) {
  228|  60.0k|  const size_t address = io_->tell();
  229|       |  // never visit a box twice!
  230|  60.0k|  if (depth == 0)
  ------------------
  |  Branch (230:7): [True: 35.0k, False: 24.9k]
  ------------------
  231|  35.0k|    visits_.clear();
  232|  60.0k|  if (visits_.contains(address) || visits_.size() > visits_max_ || depth >= max_recursion_depth_) {
  ------------------
  |  Branch (232:7): [True: 0, False: 60.0k]
  |  Branch (232:36): [True: 78, False: 59.9k]
  |  Branch (232:68): [True: 1, False: 59.9k]
  ------------------
  233|     79|    throw Error(ErrorCode::kerCorruptedMetadata);
  234|     79|  }
  235|  59.9k|  visits_.insert(address);
  236|       |
  237|       |#ifdef EXIV2_DEBUG_MESSAGES
  238|       |  bool bTrace = true;
  239|       |#else
  240|  59.9k|  bool bTrace = option == kpsBasic || option == kpsRecursive;
  ------------------
  |  Branch (240:17): [True: 0, False: 59.9k]
  |  Branch (240:39): [True: 0, False: 59.9k]
  ------------------
  241|  59.9k|#endif
  242|       |
  243|       |  // 8-byte buffer for parsing the box length and type.
  244|  59.9k|  byte hdrbuf[2 * sizeof(uint32_t)];
  245|       |
  246|  59.9k|  size_t hdrsize = sizeof(hdrbuf);
  247|  59.9k|  Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  248|  59.9k|  if (io_->read(hdrbuf, sizeof(hdrbuf)) != sizeof(hdrbuf))
  ------------------
  |  Branch (248:7): [True: 0, False: 59.9k]
  ------------------
  249|      0|    return pbox_end;
  250|       |
  251|       |  // The box length is encoded as a uint32_t by default, but the special value 1 means
  252|       |  // that it's a uint64_t.
  253|  59.9k|  uint64_t box_length = getULong(&hdrbuf[0], endian_);
  254|  59.9k|  uint32_t box_type = getULong(&hdrbuf[sizeof(uint32_t)], endian_);
  255|  59.9k|  bool bLF = true;
  256|       |
  257|  59.9k|  if (bTrace) {
  ------------------
  |  Branch (257:7): [True: 0, False: 59.9k]
  ------------------
  258|      0|    bLF = true;
  259|      0|    out << Internal::indent(depth) << "Exiv2::BmffImage::boxHandler: " << toAscii(box_type)
  260|      0|        << stringFormat(" {:8}->{} ", address, box_length);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  261|      0|  }
  262|       |
  263|  59.9k|  if (box_length == 1) {
  ------------------
  |  Branch (263:7): [True: 196, False: 59.7k]
  ------------------
  264|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  265|    196|    hdrsize += 8;
  266|    196|    Internal::enforce(hdrsize <= static_cast<size_t>(pbox_end - address), Exiv2::ErrorCode::kerCorruptedMetadata);
  267|    196|    DataBuf data(8);
  268|    196|    io_->read(data.data(), data.size());
  269|    196|    box_length = data.read_uint64(0, endian_);
  270|    196|  }
  271|       |
  272|  59.9k|  if (box_length == 0) {
  ------------------
  |  Branch (272:7): [True: 22.3k, False: 37.5k]
  ------------------
  273|       |    // Zero length is also valid and indicates box extends to the end of file.
  274|  22.3k|    box_length = pbox_end - address;
  275|  22.3k|  }
  276|       |
  277|       |  // read data in box and restore file position
  278|  59.9k|  const size_t restore = io_->tell();
  279|  59.9k|  Internal::enforce(box_length >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  59.9k|  Internal::enforce(box_length - hdrsize <= pbox_end - restore, Exiv2::ErrorCode::kerCorruptedMetadata);
  281|       |
  282|  59.9k|  const auto buffer_size = box_length - hdrsize;
  283|  59.9k|  if (skipBox(box_type)) {
  ------------------
  |  Branch (283:7): [True: 243, False: 59.7k]
  ------------------
  284|    243|    if (bTrace) {
  ------------------
  |  Branch (284:9): [True: 0, False: 243]
  ------------------
  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|    243|    return restore + buffer_size;
  290|    243|  }
  291|       |
  292|  59.7k|  DataBuf data(static_cast<size_t>(buffer_size));
  293|  59.7k|  const size_t box_end = restore + data.size();
  294|  59.7k|  io_->read(data.data(), data.size());
  295|  59.7k|  io_->seek(restore, BasicIo::beg);
  296|       |
  297|  59.7k|  size_t skip = 0;  // read position in data.pData_
  298|  59.7k|  uint8_t version = 0;
  299|  59.7k|  uint32_t flags = 0;
  300|       |
  301|  59.7k|  if (fullBox(box_type)) {
  ------------------
  |  Branch (301:7): [True: 14.2k, False: 45.4k]
  ------------------
  302|  14.2k|    Internal::enforce(data.size() - skip >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  303|  14.2k|    flags = data.read_uint32(skip, endian_);  // version/flags
  304|  14.2k|    version = static_cast<uint8_t>(flags >> 24);
  305|  14.2k|    flags &= 0x00ffffff;
  306|  14.2k|    skip += 4;
  307|  14.2k|  }
  308|       |
  309|  59.7k|  switch (box_type) {
  310|       |    //  See notes in skipBox()
  311|  5.28k|    case TAG::ftyp: {
  ------------------
  |  Branch (311:5): [True: 5.28k, False: 54.4k]
  ------------------
  312|  5.28k|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  313|  5.28k|      fileType_ = data.read_uint32(0, endian_);
  314|  5.28k|      if (bTrace) {
  ------------------
  |  Branch (314:11): [True: 0, False: 5.28k]
  ------------------
  315|      0|        out << "brand: " << toAscii(fileType_);
  316|      0|      }
  317|  5.28k|    } break;
  318|       |
  319|       |    // 8.11.6.1
  320|    713|    case TAG::iinf: {
  ------------------
  |  Branch (320:5): [True: 713, False: 58.9k]
  ------------------
  321|    713|      if (bTrace) {
  ------------------
  |  Branch (321:11): [True: 0, False: 713]
  ------------------
  322|      0|        out << '\n';
  323|      0|        bLF = false;
  324|      0|      }
  325|       |
  326|    713|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  327|    713|      uint16_t n = data.read_uint16(skip, endian_);
  328|    713|      skip += 2;
  329|       |
  330|    713|      io_->seek(skip, BasicIo::cur);
  331|  2.39k|      while (n-- > 0) {
  ------------------
  |  Branch (331:14): [True: 1.67k, False: 713]
  ------------------
  332|  1.67k|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  333|  1.67k|      }
  334|    713|    } break;
  335|       |
  336|       |    // 8.11.6.2
  337|  1.14k|    case TAG::infe: {  // .__._.__hvc1_ 2 0 0 1 0 1 0 0 104 118 99 49 0
  ------------------
  |  Branch (337:5): [True: 1.14k, False: 58.5k]
  ------------------
  338|  1.14k|      Internal::enforce(data.size() - skip >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  339|  1.14k|      /* getULong (data.pData_+skip,endian_) ; */ skip += 4;
  340|  1.14k|      uint16_t ID = data.read_uint16(skip, endian_);
  341|  1.14k|      skip += 2;
  342|  1.14k|      /* getShort(data.pData_+skip,endian_) ; */ skip += 2;  // protection
  343|  1.14k|      std::string id;
  344|       |      // Check that the string has a '\0' terminator.
  345|  1.14k|      const char* str = data.c_str(skip);
  346|  1.14k|      const size_t maxlen = data.size() - skip;
  347|  1.14k|      Internal::enforce(maxlen > 0 && strnlen(str, maxlen) < maxlen, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (347:25): [True: 1.12k, False: 22]
  |  Branch (347:39): [True: 1.08k, False: 37]
  ------------------
  348|  1.14k|      std::string name(str);
  349|  1.14k|      if (Internal::contains(name, "Exif")) {  // "Exif" or "ExifExif"
  ------------------
  |  Branch (349:11): [True: 413, False: 732]
  ------------------
  350|    413|        exifID_ = ID;
  351|    413|        id = " *** Exif ***";
  352|    732|      } else if (Internal::contains(name, "mime\0xmp") || Internal::contains(name, "mime\0application/rdf+xml")) {
  ------------------
  |  Branch (352:18): [True: 365, False: 367]
  |  Branch (352:59): [True: 0, False: 367]
  ------------------
  353|    306|        xmpID_ = ID;
  354|    306|        id = " *** XMP ***";
  355|    306|      }
  356|  1.14k|      if (bTrace) {
  ------------------
  |  Branch (356:11): [True: 0, False: 1.14k]
  ------------------
  357|      0|        out << stringFormat("ID = {:3} {} {}", ID, name, id);
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  358|      0|      }
  359|  1.14k|    } break;
  360|       |
  361|     35|    case TAG::moov:
  ------------------
  |  Branch (361:5): [True: 35, False: 59.6k]
  ------------------
  362|    102|    case TAG::iprp:
  ------------------
  |  Branch (362:5): [True: 67, False: 59.6k]
  ------------------
  363|  18.4k|    case TAG::ipco:
  ------------------
  |  Branch (363:5): [True: 18.3k, False: 41.4k]
  ------------------
  364|  20.0k|    case TAG::meta: {
  ------------------
  |  Branch (364:5): [True: 1.63k, False: 58.0k]
  ------------------
  365|  20.0k|      if (bTrace) {
  ------------------
  |  Branch (365:11): [True: 0, False: 20.0k]
  ------------------
  366|      0|        out << '\n';
  367|      0|        bLF = false;
  368|      0|      }
  369|  20.0k|      io_->seek(skip, BasicIo::cur);
  370|  42.4k|      while (io_->tell() < box_end) {
  ------------------
  |  Branch (370:14): [True: 22.4k, False: 20.0k]
  ------------------
  371|  22.4k|        io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  372|  22.4k|      }
  373|       |      // post-process meta box to recover Exif and XMP
  374|  20.0k|      if (box_type == TAG::meta) {
  ------------------
  |  Branch (374:11): [True: 1.36k, False: 18.6k]
  ------------------
  375|  1.36k|        auto ilo = ilocs_.find(exifID_);
  376|  1.36k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (376:13): [True: 107, False: 1.26k]
  ------------------
  377|    107|          const Iloc& iloc = ilo->second;
  378|    107|          if (bTrace) {
  ------------------
  |  Branch (378:15): [True: 0, False: 107]
  ------------------
  379|      0|            out << Internal::indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString() << '\n';
  380|      0|          }
  381|    107|          parseTiff(Internal::Tag::root, iloc.length_, iloc.start_);
  382|    107|        }
  383|  1.36k|        ilo = ilocs_.find(xmpID_);
  384|  1.36k|        if (ilo != ilocs_.end()) {
  ------------------
  |  Branch (384:13): [True: 124, False: 1.24k]
  ------------------
  385|    124|          const Iloc& iloc = ilo->second;
  386|    124|          if (bTrace) {
  ------------------
  |  Branch (386:15): [True: 0, False: 124]
  ------------------
  387|      0|            out << Internal::indent(depth) << "Exiv2::BMFF XMP: " << iloc.toString() << '\n';
  388|      0|          }
  389|    124|          parseXmp(iloc.length_, iloc.start_);
  390|    124|        }
  391|  1.36k|        ilocs_.clear();
  392|  1.36k|      }
  393|  20.0k|    } break;
  394|       |
  395|       |    // 8.11.3.1
  396|  2.79k|    case TAG::iloc: {
  ------------------
  |  Branch (396:5): [True: 2.79k, False: 56.9k]
  ------------------
  397|  2.79k|      Internal::enforce(data.size() - skip >= 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  398|  2.79k|      uint8_t u = data.read_uint8(skip++);
  399|  2.79k|      uint16_t offsetSize = u >> 4;
  400|  2.79k|      uint16_t lengthSize = u & 0xF;
  401|       |#if 0
  402|       |                uint16_t indexSize  = 0       ;
  403|       |                u             = data.read_uint8(skip++);
  404|       |                if ( version == 1 || version == 2 ) {
  405|       |                    indexSize = u & 0xF ;
  406|       |                }
  407|       |#else
  408|  2.79k|      skip++;
  409|  2.79k|#endif
  410|  2.79k|      Internal::enforce(data.size() - skip >= (version < 2u ? 2u : 4u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (410:48): [True: 2.61k, False: 174]
  ------------------
  411|  2.79k|      uint32_t itemCount = version < 2 ? data.read_uint16(skip, endian_) : data.read_uint32(skip, endian_);
  ------------------
  |  Branch (411:28): [True: 2.61k, False: 174]
  ------------------
  412|  2.79k|      skip += version < 2 ? 2 : 4;
  ------------------
  |  Branch (412:15): [True: 2.61k, False: 174]
  ------------------
  413|  2.79k|      if (itemCount && itemCount < box_length / 14 && offsetSize == 4 && lengthSize == 4 &&
  ------------------
  |  Branch (413:11): [True: 2.22k, False: 571]
  |  Branch (413:24): [True: 1.46k, False: 754]
  |  Branch (413:55): [True: 1.40k, False: 61]
  |  Branch (413:74): [True: 864, False: 543]
  ------------------
  414|    864|          ((box_length - 16) % itemCount) == 0) {
  ------------------
  |  Branch (414:11): [True: 817, False: 47]
  ------------------
  415|    817|        if (bTrace) {
  ------------------
  |  Branch (415:13): [True: 0, False: 817]
  ------------------
  416|      0|          out << '\n';
  417|      0|          bLF = false;
  418|      0|        }
  419|    817|        auto step = (static_cast<size_t>(box_length) - 16) / itemCount;  // length of data per item.
  420|    817|        size_t base = skip;
  421|  9.62k|        for (uint32_t i = 0; i < itemCount; i++) {
  ------------------
  |  Branch (421:30): [True: 8.81k, False: 817]
  ------------------
  422|  8.81k|          skip = base + (i * step);  // move in 14, 16 or 18 byte steps
  423|  8.81k|          Internal::enforce(data.size() - skip >= (version > 2u ? 4u : 2u), Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (423:52): [True: 415, False: 8.39k]
  ------------------
  424|  8.81k|          Internal::enforce(data.size() - skip >= step, Exiv2::ErrorCode::kerCorruptedMetadata);
  425|  8.81k|          uint32_t ID = version > 2 ? data.read_uint32(skip, endian_) : data.read_uint16(skip, endian_);
  ------------------
  |  Branch (425:25): [True: 378, False: 8.43k]
  ------------------
  426|  8.81k|          auto offset = [&data, skip, step] {
  427|  8.81k|            if (step == 14 || step == 16)
  428|  8.81k|              return data.read_uint32(skip + step - 8, endian_);
  429|  8.81k|            if (step == 18)
  430|  8.81k|              return data.read_uint32(skip + 4, endian_);
  431|  8.81k|            return 0u;
  432|  8.81k|          }();
  433|       |
  434|  8.81k|          uint32_t ldata = data.read_uint32(skip + step - 4, endian_);
  435|  8.81k|          if (bTrace) {
  ------------------
  |  Branch (435:15): [True: 0, False: 8.81k]
  ------------------
  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|  8.81k|          if (offset && ldata && ID != unknownID_) {
  ------------------
  |  Branch (440:15): [True: 7.68k, False: 1.12k]
  |  Branch (440:25): [True: 7.05k, False: 638]
  |  Branch (440:34): [True: 6.45k, False: 596]
  ------------------
  441|  6.45k|            ilocs_[ID] = Iloc{ID, offset, ldata};
  442|  6.45k|          }
  443|  8.81k|        }
  444|    817|      }
  445|  2.79k|    } break;
  446|       |
  447|    463|    case TAG::ispe: {
  ------------------
  |  Branch (447:5): [True: 463, False: 59.2k]
  ------------------
  448|    463|      Internal::enforce(data.size() - skip >= 12, Exiv2::ErrorCode::kerCorruptedMetadata);
  449|    463|      skip += 4;
  450|    463|      uint32_t width = data.read_uint32(skip, endian_);
  451|    463|      skip += 4;
  452|    463|      uint32_t height = data.read_uint32(skip, endian_);
  453|    463|      skip += 4;
  454|    463|      if (bTrace) {
  ------------------
  |  Branch (454:11): [True: 0, False: 463]
  ------------------
  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|    463|      if (width > pixelWidth_ && height > pixelHeight_) {
  ------------------
  |  Branch (459:11): [True: 199, False: 264]
  |  Branch (459:34): [True: 105, False: 94]
  ------------------
  460|    105|        pixelWidth_ = width;
  461|    105|        pixelHeight_ = height;
  462|    105|      }
  463|    463|    } break;
  464|       |
  465|       |    // 12.1.5.2
  466|  1.23k|    case TAG::colr: {
  ------------------
  |  Branch (466:5): [True: 1.23k, False: 58.4k]
  ------------------
  467|  1.23k|      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: 1.19k, False: 37]
  ------------------
  468|       |        // https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf
  469|  1.19k|        uint8_t meth = data.read_uint8(skip + 0);
  470|  1.19k|        uint8_t prec = data.read_uint8(skip + 1);
  471|  1.19k|        uint8_t approx = data.read_uint8(skip + 2);
  472|  1.19k|        auto colour_type = std::string(data.c_str(), 4);
  473|  1.19k|        skip += 4;
  474|  1.19k|        if (colour_type == "rICC" || colour_type == "prof") {
  ------------------
  |  Branch (474:13): [True: 422, False: 775]
  |  Branch (474:38): [True: 17, False: 758]
  ------------------
  475|    439|          DataBuf profile(data.c_data(skip), data.size() - skip);
  476|    439|          setIccProfile(std::move(profile));
  477|    758|        } else if (meth == 2 && prec == 0 && approx == 0) {
  ------------------
  |  Branch (477:20): [True: 57, False: 701]
  |  Branch (477:33): [True: 51, False: 6]
  |  Branch (477:46): [True: 41, False: 10]
  ------------------
  478|       |          // JP2000 files have a 3 byte head // 2 0 0 icc......
  479|     41|          skip -= 1;
  480|     41|          DataBuf profile(data.c_data(skip), data.size() - skip);
  481|     41|          setIccProfile(std::move(profile));
  482|     41|        }
  483|  1.19k|      }
  484|  1.23k|    } break;
  485|       |
  486|  1.38k|    case TAG::uuid: {
  ------------------
  |  Branch (486:5): [True: 1.38k, False: 58.3k]
  ------------------
  487|  1.38k|      DataBuf uuid(16);
  488|  1.38k|      io_->read(uuid.data(), uuid.size());
  489|  1.38k|      std::string name = uuidName(uuid);
  490|  1.38k|      if (bTrace) {
  ------------------
  |  Branch (490:11): [True: 0, False: 1.38k]
  ------------------
  491|      0|        out << " uuidName " << name << '\n';
  492|      0|        bLF = false;
  493|      0|      }
  494|  1.38k|      if (name == "cano" || name == "canp") {
  ------------------
  |  Branch (494:11): [True: 51, False: 1.32k]
  |  Branch (494:29): [True: 708, False: 621]
  ------------------
  495|    759|        if (name == "canp") {
  ------------------
  |  Branch (495:13): [True: 708, False: 51]
  ------------------
  496|       |          // based on
  497|       |          // https://github.com/lclevy/canon_cr3/blob/7be75d6/parse_cr3.py#L271
  498|    708|          io_->seek(8, BasicIo::cur);
  499|    708|        }
  500|  1.57k|        while (io_->tell() < box_end) {
  ------------------
  |  Branch (500:16): [True: 814, False: 759]
  ------------------
  501|    814|          io_->seek(boxHandler(out, option, box_end, depth + 1), BasicIo::beg);
  502|    814|        }
  503|    759|      } else if (name == "xmp") {
  ------------------
  |  Branch (503:18): [True: 262, False: 359]
  ------------------
  504|    262|        parseXmp(box_length, io_->tell());
  505|    262|      }
  506|  1.38k|    } break;
  507|       |
  508|    162|    case TAG::cmt1:
  ------------------
  |  Branch (508:5): [True: 162, False: 59.5k]
  ------------------
  509|    162|      parseTiff(Internal::Tag::root, box_length);
  510|    162|      break;
  511|    842|    case TAG::cmt2:
  ------------------
  |  Branch (511:5): [True: 842, False: 58.8k]
  ------------------
  512|    842|      parseTiff(Internal::Tag::cmt2, box_length);
  513|    842|      break;
  514|    546|    case TAG::cmt3:
  ------------------
  |  Branch (514:5): [True: 546, False: 59.1k]
  ------------------
  515|    546|      parseTiff(Internal::Tag::cmt3, box_length);
  516|    546|      break;
  517|    299|    case TAG::cmt4:
  ------------------
  |  Branch (517:5): [True: 299, False: 59.4k]
  ------------------
  518|    299|      parseTiff(Internal::Tag::cmt4, box_length);
  519|    299|      break;
  520|  7.93k|    case TAG::exif:
  ------------------
  |  Branch (520:5): [True: 7.93k, False: 51.7k]
  ------------------
  521|  7.93k|      parseTiff(Internal::Tag::root, buffer_size, io_->tell());
  522|  7.93k|      break;
  523|    186|    case TAG::xml:
  ------------------
  |  Branch (523:5): [True: 186, False: 59.5k]
  ------------------
  524|    186|      parseXmp(buffer_size, io_->tell());
  525|    186|      break;
  526|    249|    case TAG::brob: {
  ------------------
  |  Branch (526:5): [True: 249, False: 59.4k]
  ------------------
  527|    249|      Internal::enforce(data.size() >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  528|    249|      uint32_t realType = data.read_uint32(0, endian_);
  529|    249|      if (bTrace) {
  ------------------
  |  Branch (529:11): [True: 0, False: 249]
  ------------------
  530|      0|        out << "type: " << toAscii(realType);
  531|      0|      }
  532|    249|#ifdef EXV_HAVE_BROTLI
  533|    249|      DataBuf arr;
  534|    249|      brotliUncompress(data.c_data(4), data.size() - 4, arr);
  535|    249|      const DecodeParams dp(max_recursion_depth_);
  536|    249|      if (realType == TAG::exif) {
  ------------------
  |  Branch (536:11): [True: 1, False: 248]
  ------------------
  537|      1|        uint32_t offset = Safe::add(arr.read_uint32(0, endian_), 4u);
  538|      1|        Internal::enforce(Safe::add(offset, 4u) < arr.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  539|      1|        Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), arr.c_data(offset), arr.size() - offset,
  540|      1|                                           Internal::Tag::root, Internal::TiffMapping::findDecoder, dp);
  541|    248|      } else if (realType == TAG::xml) {
  ------------------
  |  Branch (541:18): [True: 28, False: 220]
  ------------------
  542|     28|        try {
  543|     28|          Exiv2::XmpParser::decode(xmpData(), std::string(arr.c_str(), arr.size()), dp);
  544|     28|        } catch (...) {
  545|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  546|      0|        }
  547|     28|      }
  548|    249|#endif
  549|    249|    } break;
  550|  9.00k|    case TAG::thmb:
  ------------------
  |  Branch (550:5): [True: 9.00k, False: 50.7k]
  ------------------
  551|  9.00k|      switch (version) {
  552|     35|        case 0:  // JPEG
  ------------------
  |  Branch (552:9): [True: 35, False: 8.96k]
  ------------------
  553|     35|          parseCr3Preview(data, out, bTrace, version, skip, skip + 2, skip + 4, skip + 12);
  554|     35|          break;
  555|  8.94k|        case 1:  // HDR
  ------------------
  |  Branch (555:9): [True: 8.94k, False: 56]
  ------------------
  556|  8.94k|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  557|  8.94k|          break;
  558|     21|        default:
  ------------------
  |  Branch (558:9): [True: 21, False: 8.97k]
  ------------------
  559|     21|          break;
  560|  9.00k|      }
  561|  8.99k|      break;
  562|  8.99k|    case TAG::prvw:
  ------------------
  |  Branch (562:5): [True: 117, False: 59.5k]
  ------------------
  563|    117|      switch (version) {
  564|     65|        case 0:  // JPEG
  ------------------
  |  Branch (564:9): [True: 65, False: 52]
  ------------------
  565|     65|        case 1:  // HDR
  ------------------
  |  Branch (565:9): [True: 0, False: 117]
  ------------------
  566|     65|          parseCr3Preview(data, out, bTrace, version, skip + 2, skip + 4, skip + 8, skip + 12);
  567|     65|          break;
  568|     52|        default:
  ------------------
  |  Branch (568:9): [True: 52, False: 65]
  ------------------
  569|     52|          break;
  570|    117|      }
  571|    116|      break;
  572|       |
  573|  6.27k|    default:
  ------------------
  |  Branch (573:5): [True: 6.27k, False: 53.4k]
  ------------------
  574|  6.27k|      break; /* do nothing */
  575|  59.7k|  }
  576|  40.6k|  if (bLF && bTrace)
  ------------------
  |  Branch (576:7): [True: 40.6k, False: 0]
  |  Branch (576:14): [True: 0, False: 40.6k]
  ------------------
  577|      0|    out << '\n';
  578|       |
  579|       |  // return address of next box
  580|  40.6k|  return box_end;
  581|  59.7k|}
_ZN5Exiv29BmffImage9parseTiffEjmm:
  583|  8.04k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length, uint64_t start) {
  584|  8.04k|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  585|  8.04k|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  586|  8.04k|  Internal::enforce(start <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()),
  587|  8.04k|                    ErrorCode::kerCorruptedMetadata);
  588|  8.04k|  Internal::enforce(length <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  589|       |
  590|       |  // read and parse exif data
  591|  8.04k|  const size_t restore = io_->tell();
  592|  8.04k|  DataBuf exif(static_cast<size_t>(length));
  593|  8.04k|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  594|  8.04k|  if (exif.size() > 8 && io_->read(exif.data(), exif.size()) == exif.size()) {
  ------------------
  |  Branch (594:7): [True: 2.32k, False: 5.71k]
  |  Branch (594:26): [True: 2.32k, False: 0]
  ------------------
  595|       |    // hunt for "II" or "MM"
  596|  2.32k|    const size_t eof = std::numeric_limits<size_t>::max();  // impossible value for punt
  597|  2.32k|    size_t punt = eof;
  598|  1.19M|    for (size_t i = 0; i < exif.size() - 9 && punt == eof; ++i) {
  ------------------
  |  Branch (598:24): [True: 1.19M, False: 1.11k]
  |  Branch (598:47): [True: 1.19M, False: 1.21k]
  ------------------
  599|  1.19M|      auto charCurrent = exif.read_uint8(i);
  600|  1.19M|      auto charNext = exif.read_uint8(i + 1);
  601|  1.19M|      if (charCurrent == charNext && (charCurrent == 'I' || charCurrent == 'M'))
  ------------------
  |  Branch (601:11): [True: 587k, False: 605k]
  |  Branch (601:39): [True: 375, False: 587k]
  |  Branch (601:61): [True: 1.23k, False: 586k]
  ------------------
  602|  1.61k|        punt = i;
  603|  1.19M|    }
  604|  2.32k|    if (punt != eof) {
  ------------------
  |  Branch (604:9): [True: 1.61k, False: 715]
  ------------------
  605|  1.61k|      const DecodeParams dp(max_recursion_depth_);
  606|  1.61k|      Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), exif.c_data(punt), exif.size() - punt,
  607|  1.61k|                                         root_tag, Internal::TiffMapping::findDecoder, dp);
  608|  1.61k|    }
  609|  2.32k|  }
  610|  8.04k|  io_->seek(restore, BasicIo::beg);
  611|  8.04k|}
_ZN5Exiv29BmffImage9parseTiffEjm:
  613|  1.84k|void BmffImage::parseTiff(uint32_t root_tag, uint64_t length) {
  614|  1.84k|  if (length > 8) {
  ------------------
  |  Branch (614:7): [True: 626, False: 1.22k]
  ------------------
  615|    626|    Internal::enforce(length - 8 <= io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  616|    626|    Internal::enforce(length - 8 <= std::numeric_limits<size_t>::max(), ErrorCode::kerCorruptedMetadata);
  617|    626|    DataBuf data(static_cast<size_t>(length - 8u));
  618|    626|    const size_t bufRead = io_->read(data.data(), data.size());
  619|       |
  620|    626|    if (io_->error())
  ------------------
  |  Branch (620:9): [True: 0, False: 626]
  ------------------
  621|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  622|    626|    if (bufRead != data.size())
  ------------------
  |  Branch (622:9): [True: 0, False: 626]
  ------------------
  623|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  624|       |
  625|    626|    const DecodeParams dp(max_recursion_depth_);
  626|    626|    Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), data.c_data(), data.size(), root_tag,
  627|    626|                                       Internal::TiffMapping::findDecoder, dp);
  628|    626|  }
  629|  1.84k|}
_ZN5Exiv29BmffImage8parseXmpEmm:
  631|    572|void BmffImage::parseXmp(uint64_t length, uint64_t start) {
  632|    572|  Internal::enforce(start <= io_->size(), ErrorCode::kerCorruptedMetadata);
  633|    572|  Internal::enforce(length <= io_->size() - start, ErrorCode::kerCorruptedMetadata);
  634|       |
  635|    572|  const size_t restore = io_->tell();
  636|    572|  io_->seek(static_cast<int64_t>(start), BasicIo::beg);
  637|       |
  638|    572|  auto lengthSizeT = static_cast<size_t>(length);
  639|    572|  DataBuf xmp(lengthSizeT + 1);
  640|    572|  xmp.write_uint8(lengthSizeT, 0);  // ensure xmp is null terminated!
  641|    572|  if (io_->read(xmp.data(), lengthSizeT) != lengthSizeT)
  ------------------
  |  Branch (641:7): [True: 0, False: 572]
  ------------------
  642|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  643|    572|  if (io_->error())
  ------------------
  |  Branch (643:7): [True: 0, False: 572]
  ------------------
  644|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  645|    572|  try {
  646|    572|    const DecodeParams dp(max_recursion_depth_);
  647|    572|    Exiv2::XmpParser::decode(xmpData(), std::string(xmp.c_str()), dp);
  648|    572|  } catch (...) {
  649|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  650|      0|  }
  651|       |
  652|    533|  io_->seek(restore, BasicIo::beg);
  653|    533|}
_ZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmm:
  658|  9.04k|                                size_t relative_position) {
  659|       |  // Derived from https://github.com/lclevy/canon_cr3
  660|  9.04k|  const size_t here = io_->tell();
  661|  9.04k|  Internal::enforce(here <= std::numeric_limits<size_t>::max() - relative_position, ErrorCode::kerCorruptedMetadata);
  662|  9.04k|  NativePreview nativePreview;
  663|  9.04k|  nativePreview.position_ = here + relative_position;
  664|  9.04k|  nativePreview.width_ = data.read_uint16(width_offset, endian_);
  665|  9.04k|  nativePreview.height_ = data.read_uint16(height_offset, endian_);
  666|  9.04k|  nativePreview.size_ = data.read_uint32(size_offset, endian_);
  667|  9.04k|  nativePreview.filter_ = "";
  668|  9.04k|  nativePreview.mimeType_ = [version] {
  669|  9.04k|    if (version == 0)
  670|  9.04k|      return "image/jpeg";
  671|  9.04k|    return "application/octet-stream";
  672|  9.04k|  }();
  673|  9.04k|  if (bTrace) {
  ------------------
  |  Branch (673:7): [True: 0, False: 9.04k]
  ------------------
  674|      0|    out << stringFormat("width,height,size = {},{},{}", nativePreview.width_, nativePreview.height_,
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  675|      0|                        nativePreview.size_);
  676|      0|  }
  677|  9.04k|  nativePreviews_.push_back(std::move(nativePreview));
  678|  9.04k|}
_ZNK5Exiv29BmffImage11openOrThrowEv:
  697|  3.32k|void BmffImage::openOrThrow() const {
  698|  3.32k|  if (io_->open() != 0) {
  ------------------
  |  Branch (698:7): [True: 0, False: 3.32k]
  ------------------
  699|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  700|      0|  }
  701|       |  // Ensure that this is the correct image type
  702|  3.32k|  if (!isBmffType(*io_, false)) {
  ------------------
  |  Branch (702:7): [True: 0, False: 3.32k]
  ------------------
  703|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (703:9): [True: 0, False: 0]
  |  Branch (703:25): [True: 0, False: 0]
  ------------------
  704|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  705|      0|    throw Error(ErrorCode::kerNotAnImage, "BMFF");
  706|      0|  }
  707|  3.32k|}
_ZN5Exiv29BmffImage12readMetadataEv:
  709|  3.32k|void BmffImage::readMetadata() {
  710|  3.32k|  openOrThrow();
  711|  3.32k|  IoCloser closer(*io_);
  712|       |
  713|  3.32k|  clearMetadata();
  714|  3.32k|  ilocs_.clear();
  715|  3.32k|  visits_max_ = io_->size() / 16;
  716|  3.32k|  unknownID_ = 0xffff;
  717|  3.32k|  exifID_ = unknownID_;
  718|  3.32k|  xmpID_ = unknownID_;
  719|       |
  720|  3.32k|  uint64_t address = 0;
  721|  3.32k|  const auto file_end = io_->size();
  722|  38.3k|  while (address < file_end) {
  ------------------
  |  Branch (722:10): [True: 35.0k, False: 3.32k]
  ------------------
  723|  35.0k|    io_->seek(address, BasicIo::beg);
  724|  35.0k|    address = boxHandler(std::cout, kpsNone, file_end, 0);
  725|  35.0k|  }
  726|  3.32k|  bReadMetadata_ = true;
  727|  3.32k|}  // BmffImage::readMetadata
_ZN5Exiv29BmffImage13writeMetadataEv:
  765|  1.15k|void BmffImage::writeMetadata() {
  766|       |  // bmff files are read-only
  767|  1.15k|  throw(Error(ErrorCode::kerWritingImageFormatUnsupported, "BMFF"));
  768|  1.15k|}  // BmffImage::writeMetadata
_ZN5Exiv215newBmffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|  3.32k|Image::UniquePtr newBmffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|  3.32k|  auto image = std::make_unique<BmffImage>(std::move(io), params);
  774|  3.32k|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 3.32k]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|  3.32k|  return image;
  778|  3.32k|}
_ZN5Exiv210isBmffTypeERNS_7BasicIoEb:
  780|  11.8k|bool isBmffType(BasicIo& iIo, bool advance) {
  781|  11.8k|  const int32_t len = 12;
  782|  11.8k|  byte buf[len];
  783|  11.8k|  iIo.read(buf, len);
  784|  11.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (784:7): [True: 0, False: 11.8k]
  |  Branch (784:22): [True: 501, False: 11.3k]
  ------------------
  785|    501|    return false;
  786|    501|  }
  787|       |
  788|       |  // bmff should start with "ftyp"
  789|  11.3k|  bool const is_ftyp = (buf[4] == 'f' && buf[5] == 't' && buf[6] == 'y' && buf[7] == 'p');
  ------------------
  |  Branch (789:25): [True: 10.1k, False: 1.20k]
  |  Branch (789:42): [True: 10.0k, False: 80]
  |  Branch (789:59): [True: 9.95k, False: 74]
  |  Branch (789:76): [True: 9.95k, False: 6]
  ------------------
  790|       |  // jxl files have a special start indicator of "JXL "
  791|  11.3k|  bool const is_jxl = (buf[4] == 'J' && buf[5] == 'X' && buf[6] == 'L' && buf[7] == ' ');
  ------------------
  |  Branch (791:24): [True: 125, False: 11.1k]
  |  Branch (791:41): [True: 37, False: 88]
  |  Branch (791:58): [True: 25, False: 12]
  |  Branch (791:75): [True: 18, False: 7]
  ------------------
  792|       |
  793|  11.3k|  bool matched = is_jxl || is_ftyp;
  ------------------
  |  Branch (793:18): [True: 18, False: 11.3k]
  |  Branch (793:28): [True: 9.95k, False: 1.35k]
  ------------------
  794|  11.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (794:7): [True: 11.3k, False: 0]
  |  Branch (794:19): [True: 0, False: 0]
  ------------------
  795|  11.3k|    iIo.seek(0, BasicIo::beg);
  796|  11.3k|  }
  797|  11.3k|  return matched;
  798|  11.8k|}
bmffimage.cpp:_ZN5Exiv2L7skipBoxEj:
  113|  58.9k|static bool skipBox(uint32_t box) {
  114|       |  // Allows boxHandler() to optimise the reading of files by identifying
  115|       |  // box types that we're not interested in. Box types listed here must
  116|       |  // not appear in the cases in switch (box_type) in boxHandler().
  117|  58.9k|  return box == 0 || box == TAG::mdat;  // mdat is where the main image lives and can be huge
  ------------------
  |  Branch (117:10): [True: 171, False: 58.7k]
  |  Branch (117:22): [True: 72, False: 58.6k]
  ------------------
  118|  58.9k|}
bmffimage.cpp:_ZZN5Exiv29BmffImage10boxHandlerERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_20PrintStructureOptionEmmENK3$_0clEv:
  426|  8.77k|          auto offset = [&data, skip, step] {
  427|  8.77k|            if (step == 14 || step == 16)
  ------------------
  |  Branch (427:17): [True: 6.02k, False: 2.74k]
  |  Branch (427:31): [True: 1.21k, False: 1.53k]
  ------------------
  428|  7.24k|              return data.read_uint32(skip + step - 8, endian_);
  429|  1.53k|            if (step == 18)
  ------------------
  |  Branch (429:17): [True: 1.12k, False: 407]
  ------------------
  430|  1.12k|              return data.read_uint32(skip + 4, endian_);
  431|    407|            return 0u;
  432|  1.53k|          }();
bmffimage.cpp:_ZZN5Exiv29BmffImage15parseCr3PreviewERKNS_7DataBufERNSt3__113basic_ostreamIcNS4_11char_traitsIcEEEEbhmmmmENK3$_0clEv:
  668|  9.04k|  nativePreview.mimeType_ = [version] {
  669|  9.04k|    if (version == 0)
  ------------------
  |  Branch (669:9): [True: 97, False: 8.94k]
  ------------------
  670|     97|      return "image/jpeg";
  671|  8.94k|    return "application/octet-stream";
  672|  9.04k|  }();

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

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   219k|  static constexpr auto tagList() {
   39|   219k|    return tagInfo_;
   40|   219k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  4.74k|  static constexpr auto tagListCs() {
   43|  4.74k|    return tagInfoCs_;
   44|  4.74k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  5.51k|  static constexpr auto tagListSi() {
   47|  5.51k|    return tagInfoSi_;
   48|  5.51k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|    957|  static constexpr auto tagListCf() {
   55|    957|    return tagInfoCf_;
   56|    957|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.48k|  static constexpr auto tagListPi() {
   59|  1.48k|    return tagInfoPi_;
   60|  1.48k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    256|  static constexpr auto tagListTi() {
   63|    256|    return tagInfoTi_;
   64|    256|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|    364|  static constexpr auto tagListFi() {
   67|    364|    return tagInfoFi_;
   68|    364|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|   426k|  static constexpr auto tagListPa() {
   51|   426k|    return tagInfoPa_;
   52|   426k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|  2.87k|  static constexpr auto tagListPr() {
   71|  2.87k|    return tagInfoPr_;
   72|  2.87k|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    327|  static constexpr auto tagListVigCor2() {
  135|    327|    return tagInfoVigCor2_;
  136|    327|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    903|  static constexpr auto tagListLiOp() {
  139|    903|    return tagInfoLiOp_;
  140|    903|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    554|  static constexpr auto tagListAfMiAdj() {
  127|    554|    return tagInfoAfMiAdj_;
  128|    554|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|    708|  static constexpr auto tagListLe() {
  143|    708|    return tagInfoLe_;
  144|    708|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    462|  static constexpr auto tagListAm() {
  147|    462|    return tagInfoAm_;
  148|    462|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    367|  static constexpr auto tagListFil() {
  155|    367|    return tagInfoFil_;
  156|    367|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    828|  static constexpr auto tagListMe() {
  151|    828|    return tagInfoMe_;
  152|    828|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    435|  static constexpr auto tagListHdr() {
  159|    435|    return tagInfoHdr_;
  160|    435|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    205|  static constexpr auto tagListAfC() {
  163|    205|    return tagInfoAfC_;
  164|    205|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    249|  static constexpr auto tagListRawB() {
  167|    249|    return tagInfoRawB_;
  168|    249|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  5.88k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  5.88k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  5.77k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  5.77k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  5.58k|void Converter::cnvToXmp() {
  503|   693k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 693k, False: 5.58k]
  ------------------
  504|   693k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 572k, False: 120k]
  |  Branch (504:37): [True: 287k, False: 284k]
  |  Branch (504:52): [True: 120k, False: 284k]
  |  Branch (504:79): [True: 60.1k, False: 60.2k]
  ------------------
  505|   347k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   347k|    }
  507|   693k|  }
  508|  5.58k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  6.07k|void Converter::cnvFromXmp() {
  511|   765k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 765k, False: 6.07k]
  ------------------
  512|   765k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 632k, False: 133k]
  |  Branch (512:37): [True: 316k, False: 316k]
  |  Branch (512:52): [True: 133k, False: 316k]
  |  Branch (512:79): [True: 66.8k, False: 66.8k]
  ------------------
  513|   382k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   382k|    }
  515|   765k|  }
  516|  6.07k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  5.46k|void Converter::cnvNone(const char*, const char*) {
  519|  5.46k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  7.36k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  7.36k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  7.36k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 7.36k, False: 0]
  ------------------
  524|  7.36k|    return true;
  525|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (525:7): [True: 0, False: 0]
  |  Branch (525:22): [True: 0, False: 0]
  ------------------
  526|      0|    return false;
  527|      0|  exifData_->erase(pos);
  528|      0|  return true;
  529|      0|}
_ZN5Exiv29Converter17prepareIptcTargetEPKcb:
  531|  1.46k|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|  1.46k|  auto pos = iptcData_->findKey(IptcKey(to));
  533|  1.46k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 1.46k, False: 0]
  ------------------
  534|  1.46k|    return true;
  535|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  |  Branch (535:22): [True: 0, False: 0]
  ------------------
  536|      0|    return false;
  537|      0|  while ((pos = iptcData_->findKey(IptcKey(to))) != iptcData_->end()) {
  ------------------
  |  Branch (537:10): [True: 0, False: 0]
  ------------------
  538|      0|    iptcData_->erase(pos);
  539|      0|  }
  540|      0|  return true;
  541|      0|}
_ZN5Exiv29Converter16prepareXmpTargetEPKcb:
  543|  1.22k|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|  1.22k|  auto pos = xmpData_->findKey(XmpKey(to));
  545|  1.22k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 1.22k]
  ------------------
  546|      0|    return true;
  547|  1.22k|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 1.22k]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|  1.22k|  xmpData_->erase(pos);
  550|  1.22k|  return true;
  551|  1.22k|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   249k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   249k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   249k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 248k, False: 548]
  ------------------
  556|   248k|    return;
  557|    548|  std::string value = pos->toString();
  558|    548|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 548]
  ------------------
  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|    548|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 548]
  ------------------
  565|      0|    return;
  566|    548|  (*xmpData_)[to] = value;
  567|    548|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 548]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    548|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  2.74k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  2.74k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  2.74k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 2.74k, False: 0]
  ------------------
  574|  2.74k|    return;
  575|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|    return;
  577|      0|  const auto cv = dynamic_cast<const CommentValue*>(&pos->value());
  578|      0|  if (!cv) {
  ------------------
  |  Branch (578:7): [True: 0, False: 0]
  ------------------
  579|      0|#ifndef SUPPRESS_WARNINGS
  580|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  581|      0|#endif
  582|      0|    return;
  583|      0|  }
  584|       |  // Todo: Convert to UTF-8 if necessary
  585|      0|  try {
  586|      0|    (*xmpData_)[to] = cv->comment();
  587|      0|  } catch (const Error&) {
  588|      0|#ifndef SUPPRESS_WARNINGS
  589|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  590|      0|#endif
  591|      0|  }
  592|      0|  if (erase_)
  ------------------
  |  Branch (592:7): [True: 0, False: 0]
  ------------------
  593|      0|    exifData_->erase(pos);
  594|      0|}
_ZN5Exiv29Converter12cnvExifArrayEPKcS2_:
  596|  2.74k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  2.74k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  2.74k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 2.74k, False: 0]
  ------------------
  599|  2.74k|    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|  11.0k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  11.0k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  11.0k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 10.8k, False: 169]
  ------------------
  619|  10.8k|    return;
  620|    169|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 169]
  ------------------
  621|      0|    return;
  622|    169|  int year = 0;
  623|    169|  int month = 0;
  624|    169|  int day = 0;
  625|    169|  int hour = 0;
  626|    169|  int min = 0;
  627|    169|  int sec = 0;
  628|    169|  std::string subsec;
  629|       |
  630|    169|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 169, False: 0]
  ------------------
  631|    169|    std::string value = pos->toString();
  632|    169|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 169]
  ------------------
  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|    169|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 169]
  ------------------
  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|    169|  } 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|    169|  const char* subsecTag = nullptr;
  711|    169|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 13, False: 156]
  ------------------
  712|     13|    subsecTag = "Exif.Photo.SubSecTime";
  713|    156|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 16, False: 140]
  ------------------
  714|     16|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|    140|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 140, False: 0]
  ------------------
  716|    140|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|    140|  }
  718|       |
  719|    169|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 169, False: 0]
  ------------------
  720|    169|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    169|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 17, False: 152]
  ------------------
  722|     17|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 17, False: 0]
  ------------------
  723|     17|        std::string ss = subsec_pos->toString();
  724|     17|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 17, False: 0]
  ------------------
  725|     17|          bool ok = false;
  726|     17|          stringTo<long>(ss, ok);
  727|     17|          if (ok)
  ------------------
  |  Branch (727:15): [True: 17, False: 0]
  ------------------
  728|     17|            subsec = std::string(".") + ss;
  729|     17|        }
  730|     17|      }
  731|     17|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 17]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     17|    }
  734|    169|  }
  735|       |
  736|    169|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 169]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    169|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    169|#define stringFormat std::format
  ------------------
  740|    169|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 169]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    169|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  5.48k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  5.48k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  5.48k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 5.48k, False: 0]
  ------------------
  747|  5.48k|    return;
  748|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (748:7): [True: 0, False: 0]
  ------------------
  749|      0|    return;
  750|      0|  auto count = pos->count();
  751|      0|  std::string value;
  752|      0|  value.reserve(count);
  753|      0|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (753:22): [True: 0, False: 0]
  ------------------
  754|      0|    value.push_back(pos->toUint32(i));
  755|      0|  }
  756|      0|  (*xmpData_)[to] = value;
  757|      0|  if (erase_)
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|    exifData_->erase(pos);
  759|      0|}
_ZN5Exiv29Converter17cnvExifGPSVersionEPKcS2_:
  761|  2.74k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  2.74k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  2.74k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 2.74k, False: 0]
  ------------------
  764|  2.74k|    return;
  765|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (765:7): [True: 0, False: 0]
  ------------------
  766|      0|    return;
  767|      0|  std::string value;
  768|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (768:22): [True: 0, False: 0]
  ------------------
  769|      0|    if (i > 0)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|      value += '.';
  771|      0|    value += std::to_string(pos->toInt64(i));
  772|      0|  }
  773|      0|  (*xmpData_)[to] = value;
  774|      0|  if (erase_)
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  775|      0|    exifData_->erase(pos);
  776|      0|}
_ZN5Exiv29Converter12cnvExifFlashEPKcS2_:
  778|  2.74k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  2.74k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  2.74k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 2.74k, False: 0]
  |  Branch (780:7): [True: 2.74k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  2.74k|    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|  10.9k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  10.9k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  10.9k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 10.9k, False: 0]
  ------------------
  805|  10.9k|    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|   273k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   273k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   273k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 272k, False: 757]
  ------------------
  847|   272k|    return;
  848|    757|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 757]
  ------------------
  849|      0|    return;
  850|    757|  std::string value;
  851|    757|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 201, False: 556]
  ------------------
  852|    201|#ifndef SUPPRESS_WARNINGS
  853|    201|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    201|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 201]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    201|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    201|#endif
  855|    201|    return;
  856|    201|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    556|  ExifKey key(to);
  859|    556|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 549, False: 7]
  ------------------
  860|    549|    exifData_->add(ed);
  861|    549|  }
  862|    556|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 556]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    556|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  3.03k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  3.03k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 3.03k]
  ------------------
  868|      0|    return;
  869|  3.03k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  3.03k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 3.03k, False: 0]
  ------------------
  871|  3.03k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  3.03k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  3.03k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 3.03k]
  ------------------
  887|      0|    return;
  888|  3.03k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  3.03k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 3.03k, False: 0]
  ------------------
  890|  3.03k|    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|  12.1k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  12.1k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  12.1k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 11.6k, False: 516]
  ------------------
  912|  11.6k|    return;
  913|    516|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 516]
  ------------------
  914|      0|    return;
  915|    516|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    516|  std::string value = pos->toString();
  917|    516|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 516]
  ------------------
  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|    516|  XMP_DateTime datetime;
  924|    516|  try {
  925|    516|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    516|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 174, False: 342]
  ------------------
  927|    174|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    174|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    174|#define stringFormat std::format
  ------------------
  930|    174|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    174|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 17, False: 157]
  ------------------
  933|     17|        const char* subsecTag = nullptr;
  934|     17|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 3, False: 14]
  ------------------
  935|      3|          subsecTag = "Exif.Photo.SubSecTime";
  936|     14|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 2, False: 12]
  ------------------
  937|      2|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|     12|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 12, False: 0]
  ------------------
  939|     12|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|     12|        }
  941|     17|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 17, False: 0]
  ------------------
  942|     17|          prepareExifTarget(subsecTag, true);
  943|     17|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|     17|        }
  945|     17|      }
  946|    342|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    342|      URational rhour(datetime.hour, 1);
  950|    342|      URational rmin(datetime.minute, 1);
  951|    342|      URational rsec(datetime.second, 1);
  952|    342|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 342]
  ------------------
  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|    342|      std::ostringstream array;
  964|    342|      array << rhour << " " << rmin << " " << rsec;
  965|    342|      (*exifData_)[to] = array.str();
  966|       |
  967|    342|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    342|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    342|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    342|#define stringFormat std::format
  ------------------
  970|    342|    }
  971|    516|  }
  972|    516|#ifndef SUPPRESS_WARNINGS
  973|    516|  catch (const XMP_Error& e) {
  974|    347|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    347|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 347]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    347|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    347|    return;
  976|    347|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    169|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 169]
  ------------------
  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|    169|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  6.07k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  6.07k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  6.07k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 6.07k, False: 0]
  ------------------
  995|  6.07k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  3.03k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  3.03k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  3.03k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 3.03k, False: 0]
  ------------------
 1015|  3.03k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  3.03k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  3.03k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  3.03k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 3.03k, False: 0]
  ------------------
 1035|  3.03k|    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|  12.1k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  12.1k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  12.1k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 12.1k, False: 0]
  ------------------
 1105|  12.1k|    return;
 1106|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1106:7): [True: 0, False: 0]
  ------------------
 1107|      0|    return;
 1108|      0|  std::string value = pos->toString();
 1109|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1109:7): [True: 0, False: 0]
  ------------------
 1110|      0|#ifndef SUPPRESS_WARNINGS
 1111|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1112|      0|#endif
 1113|      0|    return;
 1114|      0|  }
 1115|      0|  if (value.empty()) {
  ------------------
  |  Branch (1115:7): [True: 0, False: 0]
  ------------------
 1116|      0|#ifndef SUPPRESS_WARNINGS
 1117|      0|    EXV_WARNING << from << " is empty\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1118|      0|#endif
 1119|      0|    return;
 1120|      0|  }
 1121|       |
 1122|      0|  double deg = 0.0;
 1123|      0|  double min = 0.0;
 1124|      0|  double sec = 0.0;
 1125|      0|  char ref = value.back();
 1126|      0|  char sep1 = '\0';
 1127|      0|  char sep2 = '\0';
 1128|       |
 1129|      0|  value.pop_back();
 1130|       |
 1131|      0|  std::istringstream in(value);
 1132|       |
 1133|      0|  in >> deg >> sep1 >> min >> sep2;
 1134|       |
 1135|      0|  if (sep2 == ',') {
  ------------------
  |  Branch (1135:7): [True: 0, False: 0]
  ------------------
 1136|      0|    in >> sec;
 1137|      0|  } else {
 1138|      0|    sec = (min - static_cast<int>(min)) * 60.0;
 1139|      0|    min = static_cast<double>(static_cast<int>(min));
 1140|      0|  }
 1141|       |
 1142|      0|  if (in.bad() || (ref != 'N' && ref != 'S' && ref != 'E' && ref != 'W') || sep1 != ',' || !in.eof()) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 0]
  |  Branch (1142:20): [True: 0, False: 0]
  |  Branch (1142:34): [True: 0, False: 0]
  |  Branch (1142:48): [True: 0, False: 0]
  |  Branch (1142:62): [True: 0, False: 0]
  |  Branch (1142:77): [True: 0, False: 0]
  |  Branch (1142:92): [True: 0, False: 0]
  ------------------
 1143|      0|#ifndef SUPPRESS_WARNINGS
 1144|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1145|      0|#endif
 1146|      0|    return;
 1147|      0|  }
 1148|       |
 1149|      0|  Rational rdeg = floatToRationalCast(static_cast<float>(deg));
 1150|      0|  Rational rmin = floatToRationalCast(static_cast<float>(min));
 1151|      0|  Rational rsec = floatToRationalCast(static_cast<float>(sec));
 1152|       |
 1153|      0|  std::ostringstream array;
 1154|      0|  array << rdeg << " " << rmin << " " << rsec;
 1155|      0|  (*exifData_)[to] = array.str();
 1156|       |
 1157|      0|  prepareExifTarget((std::string(to) + "Ref").c_str(), true);
 1158|      0|  char ref_str[2] = {ref, 0};
 1159|      0|  (*exifData_)[std::string(to) + "Ref"] = ref_str;
 1160|       |
 1161|      0|  if (erase_)
  ------------------
  |  Branch (1161:7): [True: 0, False: 0]
  ------------------
 1162|      0|    xmpData_->erase(pos);
 1163|      0|}
_ZN5Exiv29Converter12cnvIptcValueEPKcS2_:
 1165|  54.6k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  54.6k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  54.6k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 54.1k, False: 510]
  ------------------
 1168|  54.1k|    return;
 1169|    510|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 510]
  ------------------
 1170|      0|    return;
 1171|  28.1k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 27.6k, False: 510]
  ------------------
 1172|  27.6k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 14.2k, False: 13.3k]
  ------------------
 1173|  14.2k|      std::string value = pos->toString();
 1174|  14.2k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 14.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|  14.2k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 14.2k, False: 0]
  ------------------
 1182|  14.2k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  14.2k|      (*xmpData_)[to] = value;
 1184|  14.2k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 14.2k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  14.2k|    }
 1189|  27.6k|    ++pos;
 1190|  27.6k|  }
 1191|    510|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  66.8k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  66.8k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  66.8k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 65.3k, False: 1.46k]
  ------------------
 1196|  65.3k|    return;
 1197|  1.46k|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 1.46k]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|  1.46k|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 446, False: 1.01k]
  |  Branch (1200:35): [True: 703, False: 312]
  ------------------
 1201|  1.14k|    std::string value;
 1202|  1.14k|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 222, False: 927]
  ------------------
 1203|    222|#ifndef SUPPRESS_WARNINGS
 1204|    222|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    222|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 222]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    222|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    222|#endif
 1206|    222|      return;
 1207|    222|    }
 1208|    927|    (*iptcData_)[to] = value;
 1209|    927|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    927|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 927]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    927|    return;
 1213|  1.14k|  }
 1214|       |
 1215|    312|  size_t count = pos->count();
 1216|    312|  bool added = false;
 1217|  16.4k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 16.1k, False: 312]
  ------------------
 1218|  16.1k|    std::string value = pos->toString(i);
 1219|  16.1k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 16.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|  16.1k|    IptcKey key(to);
 1226|  16.1k|    Iptcdatum id(key);
 1227|  16.1k|    id.setValue(value);
 1228|  16.1k|    iptcData_->add(id);
 1229|  16.1k|    added = true;
 1230|  16.1k|  }
 1231|    312|  if (added)
  ------------------
  |  Branch (1231:7): [True: 305, False: 7]
  ------------------
 1232|    305|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    312|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 312]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    312|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  2.84k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1317|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1318|       |  /// effect
 1319|  2.84k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  2.84k|  converter.cnvToXmp();
 1321|  2.84k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  3.03k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  3.03k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  3.03k|  converter.cnvFromXmp();
 1333|  3.03k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  2.74k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  2.74k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 2.74k, False: 0]
  ------------------
 1349|  2.74k|    iptcCharset = iptcData.detectCharset();
 1350|  2.74k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 2.74k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  2.74k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  2.74k|  converter.cnvToXmp();
 1355|  2.74k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  3.03k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  3.03k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  3.03k|  converter.cnvFromXmp();
 1371|  3.03k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  24.3k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  24.3k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 14.2k, False: 10.0k]
  ------------------
 1382|  14.2k|    return true;  // nothing to do
 1383|  10.0k|#ifdef EXV_HAVE_ICONV
 1384|  10.0k|  return convertStringCharsetIconv(str, from, to);
 1385|       |#elif defined _WIN32
 1386|       |  return convertStringCharsetWindows(str, from, to);
 1387|       |#else
 1388|       |#ifndef SUPPRESS_WARNINGS
 1389|       |  EXV_WARNING << "Charset conversion required but no character mapping functionality available.\n";
 1390|       |#endif
 1391|       |  return false;
 1392|       |#endif
 1393|  24.3k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  10.0k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  10.0k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 10.0k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  10.0k|  bool ret = true;
 1407|  10.0k|  auto cd = iconv_open(to.data(), from.data());
 1408|  10.0k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 10.0k]
  ------------------
 1409|      0|#ifndef SUPPRESS_WARNINGS
 1410|      0|    EXV_WARNING << "iconv_open: " << strError() << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1411|      0|#endif
 1412|      0|    return false;
 1413|      0|  }
 1414|  10.0k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  10.0k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  10.0k|#endif
 1420|  10.0k|  size_t inbytesleft = str.length();
 1421|  21.5k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 16.7k, False: 4.74k]
  ------------------
 1422|  16.7k|    char outbuf[256];
 1423|  16.7k|    char* outptr = outbuf;
 1424|  16.7k|    size_t outbytesleft = sizeof(outbuf);
 1425|  16.7k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  16.7k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  16.7k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 13.2k, False: 3.55k]
  |  Branch (1427:53): [True: 5.27k, False: 7.93k]
  ------------------
 1428|  5.27k|#ifndef SUPPRESS_WARNINGS
 1429|  5.27k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  5.27k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.27k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.27k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  5.27k|#endif
 1431|  5.27k|      ret = false;
 1432|  5.27k|      break;
 1433|  5.27k|    }
 1434|  11.4k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  11.4k|  }
 1436|       |
 1437|  10.0k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 10.0k, False: 0]
  ------------------
 1438|  10.0k|    iconv_close(cd);
 1439|       |
 1440|  10.0k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 4.74k, False: 5.27k]
  ------------------
 1441|  4.74k|    str = std::move(outstr);
 1442|  10.0k|  return ret;
 1443|  10.0k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|  1.90k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|  1.90k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 801, False: 1.10k]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    801|    value = pos->toString(0);
 1596|    801|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 777, False: 24]
  |  Branch (1596:31): [True: 354, False: 423]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    354|      value = pos->toString();
 1600|    354|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 354, False: 0]
  |  Branch (1600:32): [True: 354, False: 0]
  ------------------
 1601|    354|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    354|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 354, False: 0]
  ------------------
 1603|    354|          value = value.substr(first_space_pos + 1);
 1604|    354|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    354|      }
 1608|    354|    }
 1609|  1.10k|  } else {
 1610|  1.10k|    value = pos->toString();
 1611|  1.10k|  }
 1612|  1.90k|  return pos->value().ok();
 1613|  1.90k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  59.5k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  59.5k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  59.5k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  59.5k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 59.5k]
  |  Branch (18:17): [True: 0, False: 59.5k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  59.5k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 3.86k, False: 55.6k]
  |  Branch (22:26): [True: 3.75k, False: 111]
  ------------------
   23|  3.75k|    setByteOrder(littleEndian);
   24|  55.8k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 22.4k, False: 33.3k]
  |  Branch (24:33): [True: 22.3k, False: 118]
  ------------------
   25|  22.3k|    setByteOrder(bigEndian);
   26|  33.4k|  } else {
   27|  33.4k|    return false;
   28|  33.4k|  }
   29|  26.0k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 15.3k, False: 10.7k]
  ------------------
   30|  15.3k|    return false;
   31|  10.7k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  10.7k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 8.50k, False: 2.23k]
  ------------------
   33|  8.50k|    return false;
   34|  2.23k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  2.23k|  return true;
   37|  10.7k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    146|DataBuf Cr2Header::write() const {
   40|    146|  DataBuf buf(16);
   41|    146|  switch (byteOrder()) {
   42|     82|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 82, False: 64]
  ------------------
   43|     82|      buf.write_uint8(0, 'I');
   44|     82|      break;
   45|     64|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 64, False: 82]
  ------------------
   46|     64|      buf.write_uint8(0, 'M');
   47|     64|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 146]
  ------------------
   49|      0|      break;
   50|    146|  }
   51|    146|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    146|  buf.write_uint16(2, tag(), byteOrder());
   54|    146|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    146|  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|    146|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    146|  return buf;
   59|    146|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  31.3k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  31.3k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 329, False: 31.0k]
  |  Branch (63:33): [True: 352, False: 30.6k]
  ------------------
   64|    681|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  30.6k|  return isTiffImageTag(tag, group);
   67|  31.3k|}

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

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

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

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

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  11.9k|  [[nodiscard]] const byte* pData() const {
  214|  11.9k|    return pData_;
  215|  11.9k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  8.50k|  [[nodiscard]] size_t size() const {
  204|  8.50k|    return size_;
  205|  8.50k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  27.2k|  static auto signature() {
  419|  27.2k|    return signature_;
  420|  27.2k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  20.4k|  void setDir(uint16_t dir) {
  147|  20.4k|    dir_ = dir;
  148|  20.4k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  7.78k|  [[nodiscard]] uint16_t dir() const {
  184|  7.78k|    return dir_;
  185|  7.78k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|  88.2k|  [[nodiscard]] uint16_t tag() const {
  189|  88.2k|    return tag_;
  190|  88.2k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  4.71k|  [[nodiscard]] size_t offset() const {
  209|  4.71k|    return offset_;
  210|  4.71k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  30.8k|  [[nodiscard]] uint16_t tagId() const {
  219|  30.8k|    return tag_ & 0x3fff;
  220|  30.8k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  2.60k|  [[nodiscard]] TypeId typeId() const {
  224|  2.60k|    return typeId(tag_);
  225|  2.60k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  37.6k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  37.6k|    return dataLocation(tag_);
  230|  37.6k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.70k|  void setSize(size_t size) {
  254|  1.70k|    size_ = size;
  255|  1.70k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.70k|  void setOffset(size_t offset) {
  258|  1.70k|    offset_ = offset;
  259|  1.70k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.49k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.49k|    return byteOrder_;
  446|  1.49k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  21.6k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  22.2k|  virtual ~CiffComponent() = default;

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

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

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

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

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

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

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

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

_ZN5Exiv215ImageCtorParamsC2Ebm:
  141|  58.8k|    create_(create), max_recursion_depth_(max_recursion_depth) {
  142|  58.8k|}
_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsE:
  145|  58.8k|    io_(std::move(io)),
  146|  58.8k|    max_recursion_depth_(params.max_recursion_depth()),
  147|  58.8k|    imageType_(type),
  148|  58.8k|    supportedMetadata_(supportedMetadata) {
  149|  58.8k|}
_ZN5Exiv25ImageD2Ev:
  151|  58.8k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  189|    886|bool Image::isBigEndianPlatform() {
  190|    886|  return std::endian::native == std::endian::big;
  191|    886|}
_ZN5Exiv25Image8byteSwapEjb:
  213|  4.52k|uint32_t Image::byteSwap(uint32_t value, bool bSwap) {
  214|       |#ifdef __cpp_lib_byteswap
  215|       |  return bSwap ? std::byteswap(value) : value;
  216|       |#elif defined(_MSC_VER)
  217|       |  return bSwap ? _byteswap_ulong(value) : value;
  218|       |#else
  219|  4.52k|  uint32_t result = 0;
  220|  4.52k|  result |= (value & 0x000000FFU) << 24;
  221|  4.52k|  result |= (value & 0x0000FF00U) << 8;
  222|  4.52k|  result |= (value & 0x00FF0000U) >> 8;
  223|  4.52k|  result |= (value & 0xFF000000U) >> 24;
  224|  4.52k|  return bSwap ? result : value;
  ------------------
  |  Branch (224:10): [True: 0, False: 4.52k]
  ------------------
  225|  4.52k|#endif
  226|  4.52k|}
_ZN5Exiv25Image13clearMetadataEv:
  545|  51.1k|void Image::clearMetadata() {
  546|  51.1k|  clearExifData();
  547|  51.1k|  clearIptcData();
  548|  51.1k|  clearXmpPacket();
  549|  51.1k|  clearXmpData();
  550|  51.1k|  clearComment();
  551|  51.1k|  clearIccProfile();
  552|  51.1k|}
_ZN5Exiv25Image8exifDataEv:
  554|  19.4k|ExifData& Image::exifData() {
  555|  19.4k|  return exifData_;
  556|  19.4k|}
_ZN5Exiv25Image8iptcDataEv:
  558|  6.50k|IptcData& Image::iptcData() {
  559|  6.50k|  return iptcData_;
  560|  6.50k|}
_ZN5Exiv25Image7xmpDataEv:
  562|  26.6k|XmpData& Image::xmpData() {
  563|  26.6k|  return xmpData_;
  564|  26.6k|}
_ZN5Exiv25Image9xmpPacketEv:
  566|    659|std::string& Image::xmpPacket() {
  567|       |  // Serialize the current XMP
  568|    659|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (568:7): [True: 0, False: 659]
  |  Branch (568:28): [True: 0, False: 0]
  ------------------
  569|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  570|      0|  }
  571|    659|  return xmpPacket_;
  572|    659|}
_ZN5Exiv25Image13clearExifDataEv:
  594|  51.1k|void Image::clearExifData() {
  595|  51.1k|  exifData_.clear();
  596|  51.1k|}
_ZN5Exiv25Image11setExifDataERKNS_8ExifDataE:
  598|    475|void Image::setExifData(const ExifData& exifData) {
  599|    475|  exifData_ = exifData;
  600|    475|}
_ZN5Exiv25Image13clearIptcDataEv:
  602|  51.1k|void Image::clearIptcData() {
  603|  51.1k|  iptcData_.clear();
  604|  51.1k|}
_ZN5Exiv25Image11setIptcDataERKNS_8IptcDataE:
  606|    475|void Image::setIptcData(const IptcData& iptcData) {
  607|    475|  iptcData_ = iptcData;
  608|    475|}
_ZN5Exiv25Image14clearXmpPacketEv:
  610|  51.1k|void Image::clearXmpPacket() {
  611|  51.1k|  xmpPacket_.clear();
  612|       |  // Also clear the packet cached inside xmpData_. Some formats (e.g. TIFF, where
  613|       |  // XMP is stored in the Exif.Image.XMLPacket tag) write XMP from xmpData_'s
  614|       |  // packet when writeXmpFromPacket() is set. Without this, a stale packet would
  615|       |  // survive and the XMP would not be erased (e.g. "exiv2 -dx" on a TIFF).
  616|  51.1k|  xmpData_.setPacket(std::string());
  617|  51.1k|  writeXmpFromPacket(true);
  618|  51.1k|}
_ZN5Exiv25Image12clearXmpDataEv:
  628|  51.1k|void Image::clearXmpData() {
  629|  51.1k|  xmpData_.clear();
  630|  51.1k|  writeXmpFromPacket(false);
  631|  51.1k|}
_ZN5Exiv25Image10setXmpDataERKNS_7XmpDataE:
  633|    475|void Image::setXmpData(const XmpData& xmpData) {
  634|    475|  xmpData_ = xmpData;
  635|    475|  writeXmpFromPacket(false);
  636|    475|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  639|   102k|void Image::writeXmpFromPacket(bool flag) {
  640|   102k|  writeXmpFromPacket_ = flag;
  641|   102k|}
_ZN5Exiv25Image12clearCommentEv:
  647|  51.1k|void Image::clearComment() {
  648|  51.1k|  comment_.erase();
  649|  51.1k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  651|    252|void Image::setComment(const std::string& comment) {
  652|    252|  comment_ = comment;
  653|    252|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  655|    579|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  656|    579|  iccProfile_ = std::move(iccProfile);
  657|    579|  if (bTestValid) {
  ------------------
  |  Branch (657:7): [True: 579, False: 0]
  ------------------
  658|    579|    checkIccProfile();
  659|    579|  }
  660|    579|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  662|  8.82k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  663|  8.82k|  if (size == 0) {
  ------------------
  |  Branch (663:7): [True: 420, False: 8.40k]
  ------------------
  664|    420|    return;
  665|    420|  }
  666|  8.40k|  const size_t start = iccProfile_.size();
  667|  8.40k|  iccProfile_.resize(Safe::add(start, size));
  668|  8.40k|  memcpy(iccProfile_.data(start), bytes, size);
  669|  8.40k|  if (bTestValid) {
  ------------------
  |  Branch (669:7): [True: 59, False: 8.34k]
  ------------------
  670|     59|    checkIccProfile();
  671|     59|  }
  672|  8.40k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  674|    638|void Image::checkIccProfile() const {
  675|    638|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (675:7): [True: 41, False: 597]
  ------------------
  676|     41|    throw Error(ErrorCode::kerInvalidIccProfile);
  677|     41|  }
  678|    597|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  679|    597|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (679:7): [True: 52, False: 545]
  ------------------
  680|     52|    throw Error(ErrorCode::kerInvalidIccProfile);
  681|     52|  }
  682|    597|}
_ZN5Exiv25Image15clearIccProfileEv:
  684|  51.1k|void Image::clearIccProfile() {
  685|  51.1k|  iccProfile_.reset();
  686|  51.1k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  688|  30.5k|void Image::setByteOrder(ByteOrder byteOrder) {
  689|  30.5k|  byteOrder_ = byteOrder;
  690|  30.5k|}
_ZNK5Exiv25Image9byteOrderEv:
  692|  6.60k|ByteOrder Image::byteOrder() const {
  693|  6.60k|  return byteOrder_;
  694|  6.60k|}
_ZNK5Exiv25Image10pixelWidthEv:
  696|  3.01k|uint32_t Image::pixelWidth() const {
  697|  3.01k|  return pixelWidth_;
  698|  3.01k|}
_ZNK5Exiv25Image11pixelHeightEv:
  700|  3.01k|uint32_t Image::pixelHeight() const {
  701|  3.01k|  return pixelHeight_;
  702|  3.01k|}
_ZNK5Exiv25Image8exifDataEv:
  704|   557k|const ExifData& Image::exifData() const {
  705|   557k|  return exifData_;
  706|   557k|}
_ZNK5Exiv25Image7xmpDataEv:
  712|  13.4k|const XmpData& Image::xmpData() const {
  713|  13.4k|  return xmpData_;
  714|  13.4k|}
_ZNK5Exiv25Image7commentEv:
  716|  3.42k|std::string Image::comment() const {
  717|  3.42k|  return comment_;
  718|  3.42k|}
_ZNK5Exiv25Image2ioEv:
  724|  75.5k|BasicIo& Image::io() const {
  725|  75.5k|  return *io_;
  726|  75.5k|}
_ZNK5Exiv25Image18writeXmpFromPacketEv:
  728|  20.5k|bool Image::writeXmpFromPacket() const {
  729|  20.5k|  return writeXmpFromPacket_;
  730|  20.5k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  732|  55.4k|const NativePreviewList& Image::nativePreviews() const {
  733|  55.4k|  return nativePreviews_;
  734|  55.4k|}
_ZNK5Exiv25Image4goodEv:
  736|  58.6k|bool Image::good() const {
  737|  58.6k|  if (io_->open() != 0)
  ------------------
  |  Branch (737:7): [True: 0, False: 58.6k]
  ------------------
  738|      0|    return false;
  739|  58.6k|  IoCloser closer(*io_);
  740|  58.6k|  return ImageFactory::checkType(imageType_, *io_, false);
  741|  58.6k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  791|  58.6k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  792|  58.6k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (792:12): [True: 58.6k, False: 0]
  ------------------
  793|  58.6k|    return r->isThisType_(io, advance);
  794|      0|  return false;
  795|  58.6k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  877|  60.3k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  878|  60.3k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  879|  60.3k|  if (!image)
  ------------------
  |  Branch (879:7): [True: 1.92k, False: 58.4k]
  ------------------
  880|  1.92k|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  881|  58.4k|  return image;
  882|  60.3k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  884|  60.3k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  885|  60.3k|  if (io->open() != 0) {
  ------------------
  |  Branch (885:7): [True: 0, False: 60.3k]
  ------------------
  886|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  887|      0|  }
  888|  1.02M|  for (const auto& r : registry) {
  ------------------
  |  Branch (888:22): [True: 1.02M, False: 2.18k]
  ------------------
  889|  1.02M|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (889:9): [True: 58.1k, False: 969k]
  ------------------
  890|  58.1k|      return r.newInstance_(std::move(io), ImageCtorParams(false, 1000));
  891|  58.1k|    }
  892|  1.02M|  }
  893|  2.18k|  return nullptr;
  894|  60.3k|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeE:
  913|    475|Image::UniquePtr ImageFactory::create(ImageType type) {
  914|    475|  auto image = create(type, std::make_unique<MemIo>());
  915|    475|  if (!image)
  ------------------
  |  Branch (915:7): [True: 0, False: 475]
  ------------------
  916|      0|    throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
  917|    475|  return image;
  918|    475|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  920|    475|Image::UniquePtr ImageFactory::create(ImageType type, BasicIo::UniquePtr io) {
  921|       |  // BasicIo instance does not need to be open
  922|    475|  if (type == ImageType::none)
  ------------------
  |  Branch (922:7): [True: 0, False: 475]
  ------------------
  923|      0|    return {};
  924|    475|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (924:12): [True: 475, False: 0]
  ------------------
  925|    475|    return r->newInstance_(std::move(io), ImageCtorParams(true, 1000));
  926|      0|  return {};
  927|    475|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  932|   101k|void append(Blob& blob, const byte* buf, size_t len) {
  933|   101k|  if (len != 0) {
  ------------------
  |  Branch (933:7): [True: 97.8k, False: 3.46k]
  ------------------
  934|  97.8k|    Blob::size_type size = blob.size();
  935|  97.8k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (935:9): [True: 7.13k, False: 90.6k]
  ------------------
  936|  7.13k|      blob.reserve(size + 65536);
  937|  7.13k|    }
  938|  97.8k|    blob.resize(size + len);
  939|  97.8k|    std::copy_n(buf, len, blob.begin() + size);
  940|  97.8k|  }
  941|   101k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|   982k|  bool operator==(const ImageType& imageType) const {
   67|   982k|    return imageType == imageType_;
   68|   982k|  }

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

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    233|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|    233|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 21, False: 212]
  |  Branch (15:29): [True: 37, False: 175]
  ------------------
   16|     58|    return false;
   17|     58|  }
   18|       |
   19|    175|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    175|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    175|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    175|  bool clWithRightBrand = false;
   24|  2.27k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 2.12k, False: 146]
  ------------------
   25|  2.12k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  2.12k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 624, False: 1.50k]
  |  Branch (26:31): [True: 15, False: 609]
  |  Branch (26:66): [True: 757, False: 1.35k]
  |  Branch (26:87): [True: 14, False: 743]
  ------------------
   27|     29|      clWithRightBrand = true;
   28|     29|      break;
   29|     29|    }
   30|  2.12k|  }
   31|    175|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 27, False: 148]
  |  Branch (31:32): [True: 10, False: 17]
  ------------------
   32|    233|}

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

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.79k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.79k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  3.79k|std::string MatroskaVideo::mimeType() const {
  604|  3.79k|  return "video/matroska";
  605|  3.79k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  607|  1.97k|void MatroskaVideo::writeMetadata() {
  608|  1.97k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.79k|void MatroskaVideo::readMetadata() {
  611|  3.79k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.79k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.79k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.79k]
  ------------------
  616|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  618|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  619|      0|  }
  620|       |
  621|  3.79k|  IoCloser closer(*io_);
  622|  3.79k|  clearMetadata();
  623|  3.79k|  continueTraversing_ = true;
  624|  3.79k|  height_ = width_ = 1;
  625|       |
  626|  3.79k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.79k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|   163k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 159k, False: 3.79k]
  ------------------
  630|   159k|    decodeBlock();
  631|       |
  632|  3.79k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.79k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|   159k|void MatroskaVideo::decodeBlock() {
  636|   159k|  byte buf[8];
  637|   159k|  io_->read(buf, 1);
  638|       |
  639|   159k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 516, False: 159k]
  ------------------
  640|    516|    continueTraversing_ = false;
  641|    516|    return;
  642|    516|  }
  643|       |
  644|   159k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|   159k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 158k, False: 532]
  ------------------
  646|   158k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|   159k|  auto tag_id = returnTagValue(buf, block_size);
  649|   159k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|   159k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.97k, False: 157k]
  ------------------
  652|  1.97k|    continueTraversing_ = false;
  653|  1.97k|    return;
  654|  1.97k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|   157k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 589, False: 156k]
  |  Branch (658:27): [True: 1, False: 156k]
  ------------------
  659|      2|    continueTraversing_ = false;
  660|      2|    return;
  661|      2|  }
  662|       |
  663|   157k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|   157k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|   157k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 156k, False: 726]
  ------------------
  667|   156k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|   157k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|   157k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 95.7k, False: 61.6k]
  |  Branch (670:29): [True: 95.7k, False: 0]
  ------------------
  671|  95.7k|    return;
  672|       |
  673|  61.6k|  const size_t bufMaxSize = 200;
  674|       |
  675|  61.6k|#ifndef SUPPRESS_WARNINGS
  676|  61.6k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 59.3k, False: 2.34k]
  |  Branch (676:28): [True: 231, False: 59.0k]
  ------------------
  677|    231|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    231|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 231]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    231|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    231|  }
  680|  61.6k|#endif
  681|  61.6k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.34k, False: 59.3k]
  |  Branch (681:27): [True: 231, False: 59.0k]
  ------------------
  682|  1.82k|    io_->seek(size, BasicIo::cur);
  683|  1.82k|    return;
  684|  1.82k|  }
  685|       |
  686|  59.8k|  DataBuf buf2(bufMaxSize + 1);
  687|  59.8k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  59.8k|  switch (tag->_type) {
  689|  12.2k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 12.2k, False: 47.5k]
  ------------------
  690|  12.2k|      decodeInternalTags(tag, buf2.data());
  691|  12.2k|      break;
  692|  4.61k|    case String:
  ------------------
  |  Branch (692:5): [True: 4.61k, False: 55.2k]
  ------------------
  693|  4.61k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 59.8k]
  ------------------
  694|  4.61k|      decodeStringTags(tag, buf2.data());
  695|  4.61k|      break;
  696|  15.5k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 15.5k, False: 44.2k]
  ------------------
  697|  20.2k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 4.71k, False: 55.1k]
  ------------------
  698|  20.2k|      decodeIntegerTags(tag, buf2.data());
  699|  20.2k|      break;
  700|  17.0k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 17.0k, False: 42.7k]
  ------------------
  701|  17.0k|      decodeBooleanTags(tag, buf2.data());
  702|  17.0k|      break;
  703|  2.46k|    case Date:
  ------------------
  |  Branch (703:5): [True: 2.46k, False: 57.3k]
  ------------------
  704|  2.46k|      decodeDateTags(tag, buf2.data(), size);
  705|  2.46k|      break;
  706|  2.10k|    case Float:
  ------------------
  |  Branch (706:5): [True: 2.10k, False: 57.7k]
  ------------------
  707|  2.10k|      decodeFloatTags(tag, buf2.data());
  708|  2.10k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 59.8k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 59.8k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 59.8k]
  ------------------
  714|      0|      break;
  715|  59.8k|  }
  716|  59.8k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  12.2k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  12.2k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  12.2k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 112, False: 12.1k]
  ------------------
  721|    112|    return;
  722|       |
  723|  12.1k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  12.1k|    switch (tag->_id) {
  725|  12.1k|      case Xmp_video_VideoScanTpye:
  726|  12.1k|        return Exiv2::find(videoScanType, key);
  727|  12.1k|      case Xmp_audio_ChannelType:
  728|  12.1k|        return Exiv2::find(audioChannels, key);
  729|  12.1k|      case Xmp_video_ContentCompressAlgo:
  730|  12.1k|        return Exiv2::find(compressionAlgorithm, key);
  731|  12.1k|      case Xmp_video_ContentEncryptAlgo:
  732|  12.1k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  12.1k|      case Xmp_video_ContentSignAlgo_1:
  734|  12.1k|      case Xmp_video_ContentSignAlgo_2:
  735|  12.1k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  12.1k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  12.1k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  12.1k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  12.1k|      case Xmp_video_ContentEncodingType:
  740|  12.1k|        return Exiv2::find(encodingType, key);
  741|  12.1k|      case Xmp_video_DisplayUnit:
  742|  12.1k|        return Exiv2::find(displayUnit, key);
  743|  12.1k|      case Xmp_video_AspectRatioType:
  744|  12.1k|        return Exiv2::find(aspectRatioType, key);
  745|  12.1k|      case Xmp_video_PhysicalEquivalent:
  746|  12.1k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  12.1k|      case Xmp_video_TranslateCodec:
  748|  12.1k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  12.1k|      case Video_Audio_CodecID:
  750|  12.1k|        return Exiv2::find(trackCodec, key);
  751|  12.1k|      case Video_Audio_CodecName:
  752|  12.1k|        return Exiv2::find(codecInfo, key);
  753|  12.1k|      case CodecDownloadURL:
  754|  12.1k|      case CodecInfoURL:
  755|  12.1k|        return Exiv2::find(codecDownloadUrl, key);
  756|  12.1k|    }
  757|  12.1k|    return nullptr;
  758|  12.1k|  }();
  759|  12.1k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 3.22k, False: 8.95k]
  ------------------
  760|  3.22k|    xmpData_[tag->_label] = internalMt->_label;
  761|  8.95k|  } else {
  762|  8.95k|    xmpData_[tag->_label] = key;
  763|  8.95k|  }
  764|  12.1k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  4.61k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  4.61k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 1.12k, False: 3.49k]
  ------------------
  768|  1.12k|    track_count_++;
  769|  1.12k|    xmpData_[tag->_label] = track_count_;
  770|  3.49k|  } else {
  771|  3.49k|    xmpData_[tag->_label] = buf;
  772|  3.49k|  }
  773|  4.61k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  20.2k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  20.2k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  20.2k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 17.6k, False: 2.62k]
  ------------------
  778|  17.6k|    return;
  779|       |
  780|  2.62k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 1.28k, False: 1.33k]
  |  Branch (780:40): [True: 267, False: 1.07k]
  ------------------
  781|  1.55k|    width_ = value;
  782|  2.62k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 446, False: 2.17k]
  |  Branch (782:41): [True: 595, False: 1.58k]
  ------------------
  783|  1.04k|    height_ = value;
  784|  2.62k|  xmpData_[tag->_label] = value;
  785|  2.62k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  17.0k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  17.0k|  const MatroskaTag* internalMt = nullptr;
  789|  17.0k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  17.0k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 5.40k, False: 11.6k]
  ------------------
  791|  5.40k|    return;
  792|       |
  793|  11.6k|  switch (tag->_id) {
  794|  5.47k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 5.47k, False: 6.21k]
  ------------------
  795|  5.47k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 462, False: 5.00k]
  ------------------
  796|    462|        stream_ = f->_id;
  797|    462|      }
  798|  5.47k|      break;
  799|    398|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 398, False: 11.2k]
  ------------------
  800|    398|      internalMt = Exiv2::find(trackEnable, key);
  801|    398|      break;
  802|  1.47k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 1.47k, False: 10.2k]
  ------------------
  803|  1.47k|      internalMt = Exiv2::find(defaultOn, key);
  804|  1.47k|      break;
  805|  1.12k|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 1.12k, False: 10.5k]
  ------------------
  806|  1.12k|      internalMt = Exiv2::find(trackForced, key);
  807|  1.12k|      break;
  808|    525|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 525, False: 11.1k]
  ------------------
  809|    525|      internalMt = Exiv2::find(trackLacing, key);
  810|    525|      break;
  811|  2.18k|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 2.18k, False: 9.49k]
  ------------------
  812|  2.18k|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|  2.18k|      break;
  814|    303|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 303, False: 11.3k]
  ------------------
  815|    303|      internalMt = Exiv2::find(codecSettings, key);
  816|    303|      break;
  817|    200|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 200, False: 11.4k]
  ------------------
  818|    200|      internalMt = tag;
  819|    200|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 11.6k]
  ------------------
  821|      0|      break;
  822|  11.6k|  }
  823|       |
  824|  11.6k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.76k, False: 9.92k]
  ------------------
  825|  1.76k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.76k|  }
  827|  11.6k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  2.46k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  2.46k|  int64_t duration_in_ms = 0;
  831|  2.46k|  uint64_t value;
  832|  2.46k|  switch (tag->_id) {
  833|  2.07k|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 2.07k, False: 391]
  ------------------
  834|  2.07k|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 1.77k, False: 302]
  ------------------
  835|  1.77k|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|  1.77k|      } else {
  837|    302|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    302|      }
  839|  2.07k|      xmpData_[tag->_label] = duration_in_ms;
  840|  2.07k|      break;
  841|     86|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 86, False: 2.37k]
  ------------------
  842|     86|      value = getULongLong(buf, bigEndian);
  843|     86|      if (!value)
  ------------------
  |  Branch (843:11): [True: 13, False: 73]
  ------------------
  844|     13|        return;
  845|     73|      duration_in_ms = value / 1000000000;
  846|     73|      xmpData_[tag->_label] = duration_in_ms;
  847|     73|      break;
  848|       |
  849|    305|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 305, False: 2.15k]
  ------------------
  850|    305|      value = getULongLong(buf, bigEndian);
  851|    305|      if (!value)
  ------------------
  |  Branch (851:11): [True: 83, False: 222]
  ------------------
  852|     83|        return;
  853|    222|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    222|      xmpData_[tag->_label] = time_code_scale_;
  855|    222|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 2.46k]
  ------------------
  857|      0|      break;
  858|  2.46k|  }
  859|  2.46k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  2.10k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  2.10k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  2.10k|  switch (tag->_id) {
  865|    797|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 797, False: 1.31k]
  ------------------
  866|    902|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 105, False: 2.00k]
  ------------------
  867|    902|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|    902|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 2.10k]
  ------------------
  870|  1.20k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 1.20k, False: 902]
  ------------------
  871|  1.20k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  1.20k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 74, False: 1.13k]
  ------------------
  873|     74|        return;
  874|  1.13k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 815, False: 317]
  ------------------
  875|    815|        double frame_rate = 0;
  876|    815|        switch (stream_) {
  877|    401|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 401, False: 414]
  ------------------
  878|    401|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|    401|            break;
  880|    116|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 116, False: 699]
  ------------------
  881|    116|            frame_rate = static_cast<double>(key) / 1000;
  882|    116|            break;
  883|    298|          default:
  ------------------
  |  Branch (883:11): [True: 298, False: 517]
  ------------------
  884|    298|            break;
  885|    815|        }
  886|    815|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 517, False: 298]
  ------------------
  887|    517|          xmpData_[internalMt->_label] = frame_rate;
  888|    815|      } else
  889|    317|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|  1.13k|    } break;
  891|  1.13k|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.10k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  2.10k|  }
  895|  2.10k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   316k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   316k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 268k, False: 47.3k]
  ------------------
  899|   268k|    return 1;
  900|  47.3k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 25.2k, False: 22.1k]
  ------------------
  901|  25.2k|    return 2;
  902|  22.1k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 5.65k, False: 16.4k]
  ------------------
  903|  5.65k|    return 3;
  904|  16.4k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 9.69k, False: 6.78k]
  ------------------
  905|  9.69k|    return 4;
  906|  6.78k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 2.91k, False: 3.86k]
  ------------------
  907|  2.91k|    return 5;
  908|  3.86k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 317, False: 3.55k]
  ------------------
  909|    317|    return 6;
  910|  3.55k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 762, False: 2.79k]
  ------------------
  911|    762|    return 7;
  912|  2.79k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.13k, False: 654]
  ------------------
  913|  2.13k|    return 8;
  914|    654|  return 0;
  915|  2.79k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.79k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.79k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.79k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.79k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.79k|  return image;
  923|  3.79k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  16.5k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  16.5k|  bool result = true;
  927|  16.5k|  byte tmpBuf[4];
  928|  16.5k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  16.5k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 16.5k]
  |  Branch (930:22): [True: 501, False: 16.0k]
  ------------------
  931|    501|    return false;
  932|       |
  933|  16.0k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 4.46k, False: 11.5k]
  |  Branch (933:28): [True: 69, False: 11.5k]
  |  Branch (933:49): [True: 69, False: 11.4k]
  |  Branch (933:70): [True: 71, False: 11.3k]
  ------------------
  934|  4.67k|    result = false;
  935|  4.67k|  }
  936|       |
  937|  16.0k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 16.0k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  16.0k|    iIo.seek(0, BasicIo::beg);
  939|  16.0k|  return result;
  940|  16.5k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   316k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   316k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 315k, False: 654]
  |  Branch (583:23): [True: 315k, False: 0]
  ------------------
  584|       |
  585|   316k|  size_t b0 = buf[0] & (0xff >> size);
  586|   316k|  size_t tag = b0 << ((size - 1) * 8);
  587|   414k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 98.0k, False: 316k]
  ------------------
  588|  98.0k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  98.0k|  }
  590|       |
  591|   316k|  return tag;
  592|   316k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  12.1k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  12.1k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 12.1k, False: 0]
  ------------------
  725|    470|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 470, False: 11.7k]
  ------------------
  726|    470|        return Exiv2::find(videoScanType, key);
  727|    953|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 953, False: 11.2k]
  ------------------
  728|    953|        return Exiv2::find(audioChannels, key);
  729|    428|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 428, False: 11.7k]
  ------------------
  730|    428|        return Exiv2::find(compressionAlgorithm, key);
  731|  1.48k|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 1.48k, False: 10.6k]
  ------------------
  732|  1.48k|        return Exiv2::find(encryptionAlgorithm, key);
  733|    213|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 213, False: 11.9k]
  ------------------
  734|    495|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 282, False: 11.9k]
  ------------------
  735|    495|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    131|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 131, False: 12.0k]
  ------------------
  737|    694|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 563, False: 11.6k]
  ------------------
  738|    694|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  1.05k|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 1.05k, False: 11.1k]
  ------------------
  740|  1.05k|        return Exiv2::find(encodingType, key);
  741|  1.46k|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 1.46k, False: 10.7k]
  ------------------
  742|  1.46k|        return Exiv2::find(displayUnit, key);
  743|    457|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 457, False: 11.7k]
  ------------------
  744|    457|        return Exiv2::find(aspectRatioType, key);
  745|  4.05k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 4.05k, False: 8.12k]
  ------------------
  746|  4.05k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    308|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 308, False: 11.8k]
  ------------------
  748|    308|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 12.1k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    128|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 128, False: 12.0k]
  ------------------
  752|    128|        return Exiv2::find(codecInfo, key);
  753|     10|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 10, False: 12.1k]
  ------------------
  754|    178|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 168, False: 12.0k]
  ------------------
  755|    178|        return Exiv2::find(codecDownloadUrl, key);
  756|  12.1k|    }
  757|      0|    return nullptr;
  758|  12.1k|  }();

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

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

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

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

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|   123k|  static constexpr auto tagList() {
   34|   123k|    return tagInfo_;
   35|   123k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  62.4k|  static constexpr auto tagListCs() {
   38|  62.4k|    return tagInfoCs_;
   39|  62.4k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    513|  static constexpr auto tagListEq() {
   42|    513|    return tagInfoEq_;
   43|    513|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|  2.74k|  static constexpr auto tagListRd() {
   46|  2.74k|    return tagInfoRd_;
   47|  2.74k|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    245|  static constexpr auto tagListRd2() {
   50|    245|    return tagInfoRd2_;
   51|    245|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    563|  static constexpr auto tagListIp() {
   54|    563|    return tagInfoIp_;
   55|    563|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    553|  static constexpr auto tagListFi() {
   58|    553|    return tagInfoFi_;
   59|    553|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|  2.66k|  static constexpr auto tagListFe() {
   62|  2.66k|    return tagInfoFe_;
   63|  2.66k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    456|  static constexpr auto tagListRi() {
   66|    456|    return tagInfoRi_;
   67|    456|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  4.91k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  4.91k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  4.90k|std::string QuickTimeVideo::mimeType() const {
  544|  4.90k|  return "video/quicktime";
  545|  4.90k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  547|    304|void QuickTimeVideo::writeMetadata() {
  548|    304|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  4.90k|void QuickTimeVideo::readMetadata() {
  551|  4.90k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 4.90k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  4.90k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 4.90k]
  ------------------
  556|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (556:9): [True: 0, False: 0]
  |  Branch (556:25): [True: 0, False: 0]
  ------------------
  557|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  558|      0|    throw Error(ErrorCode::kerNotAnImage, "QuickTime");
  559|      0|  }
  560|       |
  561|  4.90k|  IoCloser closer(*io_);
  562|  4.90k|  clearMetadata();
  563|  4.90k|  continueTraversing_ = true;
  564|  4.90k|  height_ = width_ = 1;
  565|       |
  566|  4.90k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  4.90k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  58.8k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 53.9k, False: 4.90k]
  ------------------
  570|  53.9k|    decodeBlock(0);
  571|       |
  572|  4.90k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  4.90k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  62.7k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  62.7k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  62.7k|  const long bufMinSize = 4;
  579|  62.7k|  DataBuf buf(bufMinSize + 1);
  580|  62.7k|  uint64_t size = 0;
  581|  62.7k|  buf.data()[4] = '\0';
  582|       |
  583|  62.7k|  io_->read(buf.data(), 4);
  584|  62.7k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 469, False: 62.3k]
  ------------------
  585|    469|    continueTraversing_ = false;
  586|    469|    return;
  587|    469|  }
  588|       |
  589|  62.3k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  62.3k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  62.3k|  size_t hdrsize = 8;
  595|       |
  596|  62.3k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 147, False: 62.1k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    147|    DataBuf data(8);
  599|    147|    hdrsize += 8;
  600|    147|    io_->readOrThrow(data.data(), data.size());
  601|    147|    size = data.read_uint64(0, bigEndian);
  602|  62.1k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 1.81k, False: 60.3k]
  |  Branch (602:27): [True: 1.54k, False: 272]
  ------------------
  603|  1.54k|    size = buf.read_uint32(0, bigEndian);
  604|  1.54k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|  1.54k|  }
  606|       |
  607|  62.3k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  62.3k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  62.3k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  610|       |
  611|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  612|  62.3k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  62.3k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 6.94k, False: 55.3k]
  ------------------
  614|  6.94k|    discard(newsize);
  615|  6.94k|    return;
  616|  6.94k|  }
  617|  55.3k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  55.3k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  54.6k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  54.6k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  54.6k|  assert(buf.size() > 4);
  631|       |
  632|  54.6k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 54.6k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  54.6k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 7.13k, False: 47.4k]
  ------------------
  636|  7.13k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  47.4k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 2.68k, False: 44.8k]
  ------------------
  638|  2.68k|    fileTypeDecoder(size);
  639|       |
  640|  44.8k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 4.14k, False: 40.6k]
  ------------------
  641|  4.14k|    setMediaStream(size);
  642|       |
  643|  40.6k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 86, False: 40.5k]
  ------------------
  644|     86|    movieHeaderDecoder(size);
  645|       |
  646|  40.5k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 1.18k, False: 39.3k]
  ------------------
  647|  1.18k|    trackHeaderDecoder(size);
  648|       |
  649|  39.3k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 1.30k, False: 38.0k]
  ------------------
  650|  1.30k|    mediaHeaderDecoder(size);
  651|       |
  652|  38.0k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 4.64k, False: 33.4k]
  ------------------
  653|  4.64k|    handlerDecoder(size);
  654|       |
  655|  33.4k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 3.76k, False: 29.6k]
  ------------------
  656|  3.76k|    videoHeaderDecoder(size);
  657|       |
  658|  29.6k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 8.48k, False: 21.1k]
  ------------------
  659|  8.48k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  21.1k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 1.46k, False: 19.7k]
  ------------------
  662|  1.46k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  19.7k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 1.19k, False: 18.5k]
  ------------------
  665|  1.19k|    sampleDesc(size);
  666|       |
  667|  18.5k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 1.12k, False: 17.4k]
  ------------------
  668|  1.12k|    timeToSampleDecoder();
  669|       |
  670|  17.4k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 1.92k, False: 15.4k]
  ------------------
  671|  1.92k|    previewTagDecoder(size);
  672|       |
  673|  15.4k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 1.81k, False: 13.6k]
  ------------------
  674|  1.81k|    trackApertureTagDecoder(size);
  675|       |
  676|  13.6k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 288, False: 13.3k]
  ------------------
  677|    288|    keysTagDecoder(size);
  678|       |
  679|  13.3k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 1.09k, False: 12.2k]
  ------------------
  680|  1.09k|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 433, False: 662]
  ------------------
  681|    433|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    662|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 444, False: 218]
  ------------------
  683|    444|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|    218|    else
  685|    218|      discard(size);
  686|  1.09k|  }
  687|       |
  688|  12.2k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 462, False: 11.8k]
  ------------------
  689|    462|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 144, False: 318]
  ------------------
  690|    144|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    318|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 240, False: 78]
  ------------------
  692|    240|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|     78|    else
  694|     78|      discard(size);
  695|    462|  }
  696|       |
  697|  11.8k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 290, False: 11.5k]
  ------------------
  698|    290|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|    290|  }
  700|       |
  701|  11.5k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 412, False: 11.1k]
  ------------------
  702|    412|    io_->readOrThrow(buf.data(), 4);
  703|    412|    io_->readOrThrow(buf.data(), 4);
  704|    412|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|    412|  }
  706|       |
  707|  11.1k|  else {
  708|  11.1k|    discard(size);
  709|  11.1k|  }
  710|  54.6k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  18.3k|void QuickTimeVideo::discard(size_t size) {
  713|  18.3k|  size_t cur_pos = io_->tell();
  714|  18.3k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  18.3k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|  1.92k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|  1.92k|  DataBuf buf(5);
  719|  1.92k|  size_t cur_pos = io_->tell();
  720|  1.92k|  io_->readOrThrow(buf.data(), 4);
  721|  1.92k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|  1.92k|  io_->readOrThrow(buf.data(), 2);
  723|  1.92k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|  1.92k|  io_->readOrThrow(buf.data(), 4);
  726|  1.92k|  buf.write_uint8(4, 0);  // nul-terminate string
  727|  1.92k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 6, False: 1.92k]
  ------------------
  728|      6|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|  1.92k|  else
  730|  1.92k|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|  1.92k|  io_->seek(cur_pos + size, BasicIo::beg);
  733|  1.92k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    288|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    288|  DataBuf buf(5);
  737|    288|  size_t cur_pos = io_->tell();
  738|    288|  io_->readOrThrow(buf.data(), 4);
  739|    288|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    288|  io_->readOrThrow(buf.data(), 2);
  741|    288|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    288|  io_->readOrThrow(buf.data(), 4);
  744|    288|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    288|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 91, False: 197]
  ------------------
  746|     91|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    197|  else
  748|    197|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    288|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    288|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|  1.81k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|  1.81k|  DataBuf buf(4);
  755|  1.81k|  DataBuf buf2(2);
  756|  1.81k|  size_t cur_pos = io_->tell();
  757|  1.81k|  byte n = 3;
  758|       |
  759|  7.25k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 5.43k, False: 1.81k]
  ------------------
  760|  5.43k|    io_->seek(4L, BasicIo::cur);
  761|  5.43k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  5.43k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 202, False: 5.23k]
  ------------------
  764|    202|      io_->seek(4L, BasicIo::cur);
  765|    202|      io_->readOrThrow(buf.data(), 2);
  766|    202|      io_->readOrThrow(buf2.data(), 2);
  767|    202|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|    202|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    202|#define stringFormat std::format
  ------------------
  769|    202|      io_->readOrThrow(buf.data(), 2);
  770|    202|      io_->readOrThrow(buf2.data(), 2);
  771|    202|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|    202|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    202|#define stringFormat std::format
  ------------------
  773|    202|    }
  774|       |
  775|  5.23k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 41, False: 5.19k]
  ------------------
  776|     41|      io_->seek(4L, BasicIo::cur);
  777|     41|      io_->readOrThrow(buf.data(), 2);
  778|     41|      io_->readOrThrow(buf2.data(), 2);
  779|     41|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|     41|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     41|#define stringFormat std::format
  ------------------
  781|     41|      io_->readOrThrow(buf.data(), 2);
  782|     41|      io_->readOrThrow(buf2.data(), 2);
  783|     41|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|     41|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     41|#define stringFormat std::format
  ------------------
  785|     41|    }
  786|       |
  787|  5.19k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 11, False: 5.18k]
  ------------------
  788|     11|      io_->seek(4L, BasicIo::cur);
  789|     11|      io_->readOrThrow(buf.data(), 2);
  790|     11|      io_->readOrThrow(buf2.data(), 2);
  791|     11|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     11|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     11|#define stringFormat std::format
  ------------------
  793|     11|      io_->readOrThrow(buf.data(), 2);
  794|     11|      io_->readOrThrow(buf2.data(), 2);
  795|     11|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     11|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     11|#define stringFormat std::format
  ------------------
  797|     11|    }
  798|  5.43k|  }
  799|  1.81k|  io_->seek(cur_pos + size, BasicIo::beg);
  800|  1.81k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|  1.95k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|  1.95k|  size_t cur_pos = io_->tell();
  804|  1.95k|  DataBuf buf(49);
  805|  1.95k|  DataBuf buf2(4);
  806|       |
  807|  1.95k|  io_->readOrThrow(buf.data(), 4);
  808|  1.95k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 1.66k, False: 289]
  ------------------
  809|  1.66k|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|  1.66k|    io_->readOrThrow(buf.data(), 24);
  812|  1.66k|    buf.write_uint8(24, 0);  // nul-terminate string
  813|  1.66k|    xmpData_["Xmp.video.Make"] = buf.data();
  814|  1.66k|    io_->readOrThrow(buf.data(), 14);
  815|  1.66k|    buf.write_uint8(14, 0);  // nul-terminate string
  816|  1.66k|    xmpData_["Xmp.video.Model"] = buf.data();
  817|  1.66k|    io_->readOrThrow(buf.data(), 4);
  818|  1.66k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.66k|#define stringFormat std::format
  ------------------
  819|  1.66k|    io_->readOrThrow(buf.data(), 4);
  820|  1.66k|    io_->readOrThrow(buf2.data(), 4);
  821|  1.66k|    xmpData_["Xmp.video.FNumber"] =
  822|  1.66k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|  1.66k|    io_->readOrThrow(buf.data(), 4);
  824|  1.66k|    io_->readOrThrow(buf2.data(), 4);
  825|  1.66k|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|  1.66k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|  1.66k|    io_->readOrThrow(buf.data(), 10);
  828|  1.66k|    io_->readOrThrow(buf.data(), 4);
  829|  1.66k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 193, False: 1.46k]
  ------------------
  830|    193|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    193|#define _(String) (String)
  ------------------
  831|  1.66k|    io_->readOrThrow(buf.data(), 4);
  832|  1.66k|    io_->readOrThrow(buf2.data(), 4);
  833|  1.66k|    xmpData_["Xmp.video.FocalLength"] =
  834|  1.66k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|  1.66k|    io_->seek(95L, BasicIo::cur);
  836|  1.66k|    io_->readOrThrow(buf.data(), 48);
  837|  1.66k|    buf.write_uint8(48, 0);
  838|  1.66k|    xmpData_["Xmp.video.Software"] = buf.data();
  839|  1.66k|    io_->readOrThrow(buf.data(), 4);
  840|  1.66k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|  1.66k|  }
  842|       |
  843|  1.95k|  io_->seek(cur_pos + size, BasicIo::beg);
  844|  1.95k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  846|  8.72k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  847|  8.72k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  848|  8.72k|  const size_t start_pos = io_->tell();
  849|  8.72k|  const TagVocabulary* td;
  850|  8.72k|  const TagVocabulary* tv;
  851|  8.72k|  const TagVocabulary* tv_internal;
  852|       |
  853|  8.72k|  const long bufMinSize = 100;
  854|  8.72k|  DataBuf buf(bufMinSize);
  855|  8.72k|  size_t size_internal = outer_size;
  856|  8.72k|  std::memset(buf.data(), 0x0, buf.size());
  857|       |
  858|  16.8k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 11.1k, False: 5.65k]
  |  Branch (858:38): [True: 11.1k, False: 0]
  ------------------
  859|  11.1k|    const size_t loop_start_pos = io_->tell();
  860|  11.1k|    buf.data()[4] = '\0';
  861|  11.1k|    io_->readOrThrow(buf.data(), 4);
  862|  11.1k|    const size_t size = buf.read_uint32(0, bigEndian);
  863|  11.1k|    if (size > size_internal)
  ------------------
  |  Branch (863:9): [True: 2.13k, False: 9.02k]
  ------------------
  864|  2.13k|      break;
  865|  9.02k|    size_internal -= size;
  866|  9.02k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  9.02k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 6, False: 9.01k]
  ------------------
  869|      6|      buf.data()[0] = ' ';
  870|  9.02k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  9.02k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  9.02k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 938, False: 8.08k]
  ------------------
  875|    938|      break;
  876|       |
  877|  8.08k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 166, False: 7.91k]
  |  Branch (877:40): [True: 72, False: 7.84k]
  ------------------
  878|    238|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  7.84k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 1.70k, False: 6.14k]
  ------------------
  881|  1.70k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  6.14k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 1.95k, False: 4.19k]
  ------------------
  884|  1.95k|      CameraTagsDecoder(size - 8);
  885|       |
  886|  4.19k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 11, False: 4.18k]
  |  Branch (886:45): [True: 163, False: 4.02k]
  |  Branch (886:76): [True: 35, False: 3.98k]
  ------------------
  887|  3.98k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 210, False: 3.77k]
  |  Branch (887:45): [True: 104, False: 3.67k]
  ------------------
  888|    523|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    523|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    523|#define _(String) (String)
  ------------------
  890|    523|    }
  891|       |
  892|  3.67k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 69, False: 3.60k]
  |  Branch (892:45): [True: 0, False: 3.60k]
  ------------------
  893|     69|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|     69|      io_->readOrThrow(buf.data(), 2);
  895|     69|      buf.data()[2] = '\0';
  896|     69|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|     69|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 36, False: 33]
  ------------------
  899|     36|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     36|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     36|#define _(String) (String)
  ------------------
  900|     33|      else
  901|     33|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     33|#define _(String) (String)
  ------------------
  902|     69|    }
  903|       |
  904|  3.60k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 224, False: 3.38k]
  ------------------
  905|    224|      io_->readOrThrow(buf.data(), 4);
  906|    224|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    224|#define _(String) (String)
  ------------------
  907|    224|    }
  908|       |
  909|  3.38k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 1.55k, False: 1.82k]
  ------------------
  910|  1.55k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  8.08k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  8.08k|  }
  914|       |
  915|  8.72k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  8.72k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.70k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.70k|  size_t cur_pos = io_->tell();
  920|  1.70k|  DataBuf buf(201);
  921|  1.70k|  DataBuf buf2(4 + 1);
  922|  1.70k|  uint32_t TagID = 0;
  923|  1.70k|  uint16_t dataLength = 0;
  924|  1.70k|  uint16_t dataType = 2;
  925|  1.70k|  const TagDetails* td;
  926|  1.70k|  const TagDetails* td2;
  927|       |
  928|   105k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 104k, False: 1.70k]
  ------------------
  929|   104k|    io_->readOrThrow(buf.data(), 4);
  930|   104k|    TagID = buf.read_uint32(0, bigEndian);
  931|   104k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   104k|    io_->readOrThrow(buf.data(), 2);
  934|   104k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   104k|    std::memset(buf.data(), 0x0, buf.size());
  937|   104k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   104k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 4.99k, False: 99.2k]
  ------------------
  940|  4.99k|      size_t local_pos = io_->tell();
  941|  4.99k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  4.99k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  4.99k|      io_->readOrThrow(buf.data(), 4);
  945|  4.99k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  4.99k|      io_->readOrThrow(buf.data(), 20);
  947|  4.99k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  4.99k|      io_->readOrThrow(buf.data(), 20);
  949|  4.99k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  4.99k|      io_->readOrThrow(buf.data(), 4);
  951|  4.99k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  4.99k|      io_->readOrThrow(buf.data(), 1);
  954|  4.99k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  4.99k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 2.81k, False: 2.17k]
  ------------------
  956|  2.81k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.81k|#define _(String) (String)
  ------------------
  957|  2.17k|      else
  958|  2.17k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  4.99k|      io_->readOrThrow(buf.data(), 1);
  961|  4.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  4.99k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 3.41k, False: 1.57k]
  ------------------
  963|  3.41k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.41k|#define _(String) (String)
  ------------------
  964|       |
  965|  4.99k|      io_->readOrThrow(buf.data(), 1);
  966|  4.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  4.99k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 2.91k, False: 2.08k]
  ------------------
  968|  2.91k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  2.91k|#define _(String) (String)
  ------------------
  969|  2.08k|      else
  970|  2.08k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  4.99k|      io_->readOrThrow(buf.data(), 1);
  973|  4.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  4.99k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 2.54k, False: 2.44k]
  ------------------
  975|  2.54k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  2.54k|#define _(String) (String)
  ------------------
  976|  2.44k|      else
  977|  2.44k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  4.99k|      io_->readOrThrow(buf.data(), 1);
  980|  4.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  4.99k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 2.88k, False: 2.11k]
  ------------------
  982|  2.88k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  2.88k|#define _(String) (String)
  ------------------
  983|  2.11k|      else
  984|  2.11k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  4.99k|      io_->readOrThrow(buf.data(), 1);
  987|  4.99k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  4.99k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 3.30k, False: 1.68k]
  ------------------
  989|  3.30k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  3.30k|#define _(String) (String)
  ------------------
  990|  1.68k|      else
  991|  1.68k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  4.99k|      io_->readOrThrow(buf.data(), 1);
  994|  4.99k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  4.99k|      io_->readOrThrow(buf.data(), 1);
  997|  4.99k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  4.99k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 1.02k, False: 3.96k]
  ------------------
  999|  1.02k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.02k|#define _(String) (String)
  ------------------
 1000|  3.96k|      else
 1001|  3.96k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  4.99k|      io_->readOrThrow(buf.data(), 1);
 1004|  4.99k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  4.99k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 2.13k, False: 2.86k]
  ------------------
 1006|  2.13k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  2.13k|#define _(String) (String)
  ------------------
 1007|  2.86k|      else
 1008|  2.86k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  4.99k|      io_->readOrThrow(buf.data(), 1);
 1011|  4.99k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  4.99k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  4.99k|    }
 1015|       |
 1016|  99.2k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 1.30k, False: 97.9k]
  ------------------
 1017|  1.30k|      size_t local_pos = io_->tell();
 1018|  1.30k|      dataLength = buf.read_uint16(0, bigEndian);
 1019|  1.30k|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|  1.30k|      io_->readOrThrow(buf.data(), 2);
 1022|  1.30k|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|  1.30k|      io_->readOrThrow(buf.data(), 1);
 1024|  1.30k|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|  1.30k|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 549, False: 758]
  ------------------
 1026|    549|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    549|#define _(String) (String)
  ------------------
 1027|       |
 1028|  1.30k|      io_->readOrThrow(buf.data(), 1);
 1029|  1.30k|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|  1.30k|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 1.09k, False: 212]
  ------------------
 1031|  1.09k|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|  1.09k|#define _(String) (String)
  ------------------
 1032|       |
 1033|  1.30k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|  1.30k|    }
 1035|       |
 1036|  97.9k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 2.07k, False: 95.8k]
  |  Branch (1036:31): [True: 629, False: 95.2k]
  ------------------
 1037|  1.96k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.96k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.96k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 773, False: 1.19k]
  ------------------
 1042|    773|#ifndef SUPPRESS_WARNINGS
 1043|    773|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    773|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 773]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    773|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    773|#endif
 1046|    773|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    773|        buf.data()[0] = '\0';
 1048|  1.19k|      } else {
 1049|  1.19k|        io_->readOrThrow(buf.data(), dataLength);
 1050|  1.19k|        buf.data()[dataLength] = '\0';
 1051|  1.19k|      }
 1052|       |
 1053|  1.96k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 620, False: 1.34k]
  ------------------
 1054|    620|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    620|#define _(String) (String)
  ------------------
 1055|    620|      }
 1056|  95.9k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 1.50k, False: 94.4k]
  ------------------
 1057|  1.50k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  1.50k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  1.50k|      io_->readOrThrow(buf.data(), 4);
 1060|  1.50k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 829, False: 671]
  ------------------
 1061|    829|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    829|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  1.50k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 751, False: 749]
  |  Branch (1064:31): [True: 424, False: 325]
  ------------------
 1065|  1.16k|#ifndef SUPPRESS_WARNINGS
 1066|  1.16k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.16k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.16k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.16k|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|  1.16k|#endif
 1069|  1.16k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|  1.16k|      } else
 1071|    332|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  94.4k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 3.54k, False: 90.8k]
  ------------------
 1073|  3.54k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  3.54k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  3.54k|      io_->readOrThrow(buf.data(), 2);
 1076|  3.54k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 1.35k, False: 2.19k]
  ------------------
 1077|  1.35k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.35k|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  3.54k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 2.25k, False: 1.28k]
  |  Branch (1080:31): [True: 899, False: 389]
  ------------------
 1081|  3.15k|#ifndef SUPPRESS_WARNINGS
 1082|  3.15k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.15k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.15k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.15k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  3.15k|#endif
 1085|  3.15k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  3.15k|      } else
 1087|    389|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  90.8k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 1.44k, False: 89.4k]
  ------------------
 1089|  1.44k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  1.44k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  1.44k|      io_->readOrThrow(buf.data(), 4);
 1092|  1.44k|      io_->readOrThrow(buf2.data(), 4);
 1093|  1.44k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 377, False: 1.07k]
  ------------------
 1094|    377|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    377|#define _(String) (String)
  ------------------
 1095|    377|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1096|       |
 1097|       |      // Sanity check with an "unreasonably" large number
 1098|  1.44k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 411, False: 1.03k]
  |  Branch (1098:31): [True: 564, False: 473]
  ------------------
 1099|    974|#ifndef SUPPRESS_WARNINGS
 1100|    974|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    974|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 974]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    974|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    974|#endif
 1103|    974|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    974|      } else
 1105|    474|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  89.4k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.29k, False: 88.1k]
  ------------------
 1107|  1.29k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.29k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.29k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.29k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.29k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 280, False: 1.01k]
  ------------------
 1112|    280|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    280|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    280|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.29k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 548, False: 750]
  |  Branch (1115:31): [True: 176, False: 574]
  ------------------
 1116|    723|#ifndef SUPPRESS_WARNINGS
 1117|    723|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    723|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 723]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    723|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    723|#endif
 1120|    723|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    723|      } else
 1122|    575|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.29k|    }
 1124|   104k|  }
 1125|       |
 1126|  1.70k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.70k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  4.14k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  4.14k|  size_t current_position = io_->tell();
 1131|  4.14k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  4.14k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 4.14k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  4.14k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  58.4k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 58.4k, False: 0]
  |  Branch (1136:25): [True: 57.5k, False: 886]
  ------------------
 1137|  57.5k|    io_->readOrThrow(buf.data(), 4);
 1138|  57.5k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 3.25k, False: 54.3k]
  ------------------
 1139|  3.25k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 130, False: 3.12k]
  ------------------
 1140|    130|        break;
 1141|  3.12k|      io_->readOrThrow(buf.data(), 4);
 1142|  3.12k|      io_->readOrThrow(buf.data(), 4);
 1143|  3.12k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  3.12k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 70, False: 3.05k]
  ------------------
 1146|     70|        currentStream_ = Video;
 1147|  3.05k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 890, False: 2.16k]
  ------------------
 1148|    890|        currentStream_ = Audio;
 1149|  2.16k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 83, False: 2.08k]
  ------------------
 1150|     83|        currentStream_ = Hint;
 1151|  2.08k|      else
 1152|  2.08k|        currentStream_ = GenMediaHeader;
 1153|  3.12k|      break;
 1154|  3.25k|    }
 1155|  57.5k|  }
 1156|       |
 1157|  4.14k|  io_->seek(current_position, BasicIo::beg);
 1158|  4.14k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|  1.12k|void QuickTimeVideo::timeToSampleDecoder() {
 1161|  1.12k|  DataBuf buf(4 + 1);
 1162|  1.12k|  io_->readOrThrow(buf.data(), 4);
 1163|  1.12k|  io_->readOrThrow(buf.data(), 4);
 1164|  1.12k|  uint64_t totalframes = 0;
 1165|  1.12k|  uint64_t timeOfFrames = 0;
 1166|  1.12k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  3.13k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 2.01k, False: 1.12k]
  ------------------
 1169|  2.01k|    io_->readOrThrow(buf.data(), 4);
 1170|  2.01k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  2.01k|    totalframes = Safe::add(totalframes, temp);
 1172|  2.01k|    io_->readOrThrow(buf.data(), 4);
 1173|  2.01k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  2.01k|  }
 1175|  1.12k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 289, False: 836]
  ------------------
 1176|    289|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 119, False: 170]
  ------------------
 1177|    119|      timeOfFrames = 1;
 1178|    289|    xmpData_["Xmp.video.FrameRate"] =
 1179|    289|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    289|  }
 1181|  1.12k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.19k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.19k|  DataBuf buf(100);
 1185|  1.19k|  size_t cur_pos = io_->tell();
 1186|  1.19k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.19k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.19k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|   110k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 109k, False: 910]
  ------------------
 1191|   109k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 40.9k, False: 68.7k]
  ------------------
 1192|  40.9k|      imageDescDecoder();
 1193|  68.7k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 68.5k, False: 287]
  ------------------
 1194|  68.5k|      audioDescDecoder();
 1195|    287|    else
 1196|    287|      break;
 1197|   109k|  }
 1198|  1.19k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.19k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  68.5k|void QuickTimeVideo::audioDescDecoder() {
 1202|  68.5k|  DataBuf buf(40);
 1203|  68.5k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  68.5k|  buf.data()[4] = '\0';
 1205|  68.5k|  io_->readOrThrow(buf.data(), 4);
 1206|  68.5k|  size_t size = 82;
 1207|       |
 1208|  68.5k|  const TagVocabulary* td;
 1209|       |
 1210|  1.43M|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 1.36M, False: 68.3k]
  ------------------
 1211|  1.36M|    io_->readOrThrow(buf.data(), 4);
 1212|  1.36M|    switch (i) {
 1213|  68.4k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 68.4k, False: 1.29M]
  ------------------
 1214|  68.4k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  68.4k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 1.06k, False: 67.4k]
  ------------------
 1216|  1.06k|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|  1.06k|#define _(String) (String)
  ------------------
 1217|  67.4k|        else
 1218|  67.4k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  68.4k|        break;
 1220|  68.4k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 68.4k, False: 1.29M]
  ------------------
 1221|  68.4k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  68.4k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 1.75k, False: 66.6k]
  ------------------
 1223|  1.75k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.75k|#define _(String) (String)
  ------------------
 1224|  68.4k|        break;
 1225|  68.4k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 68.4k, False: 1.29M]
  ------------------
 1226|  68.4k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  68.4k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  68.4k|        break;
 1229|  68.3k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 68.3k, False: 1.29M]
  ------------------
 1230|  68.3k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  68.3k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  68.3k|        break;
 1233|  1.09M|      default:
  ------------------
  |  Branch (1233:7): [True: 1.09M, False: 273k]
  ------------------
 1234|  1.09M|        break;
 1235|  1.36M|    }
 1236|  1.36M|  }
 1237|  68.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  68.3k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  40.9k|void QuickTimeVideo::imageDescDecoder() {
 1241|  40.9k|  DataBuf buf(40);
 1242|  40.9k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  40.9k|  buf.data()[4] = '\0';
 1244|  40.9k|  io_->readOrThrow(buf.data(), 4);
 1245|  40.9k|  size_t size = 82;
 1246|       |
 1247|  40.9k|  const TagVocabulary* td;
 1248|       |
 1249|   491k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 450k, False: 40.7k]
  ------------------
 1250|   450k|    io_->readOrThrow(buf.data(), 4);
 1251|   450k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   450k|    switch (i) {
 1254|  40.9k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 40.9k, False: 409k]
  ------------------
 1255|  40.9k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  40.9k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 618, False: 40.3k]
  ------------------
 1257|    618|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    618|#define _(String) (String)
  ------------------
 1258|  40.3k|        else
 1259|  40.3k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  40.9k|        break;
 1261|  40.9k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 40.9k, False: 409k]
  ------------------
 1262|  40.9k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  40.9k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 999, False: 39.9k]
  ------------------
 1264|    999|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    999|#define _(String) (String)
  ------------------
 1265|  40.9k|        break;
 1266|  40.9k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 40.9k, False: 409k]
  ------------------
 1267|  40.9k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  40.9k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  40.9k|        break;
 1270|  40.9k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 40.9k, False: 409k]
  ------------------
 1271|  40.9k|        xmpData_["Xmp.video.XResolution"] =
 1272|  40.9k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  40.9k|        break;
 1274|  40.9k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 40.9k, False: 409k]
  ------------------
 1275|  40.9k|        xmpData_["Xmp.video.YResolution"] =
 1276|  40.9k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  40.9k|        io_->readOrThrow(buf.data(), 3);
 1278|  40.9k|        size -= 3;
 1279|  40.9k|        break;
 1280|  40.8k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 40.8k, False: 409k]
  ------------------
 1281|  40.8k|        io_->readOrThrow(buf.data(), 32);
 1282|  40.8k|        size -= 32;
 1283|  40.8k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  40.8k|        break;
 1285|   204k|      default:
  ------------------
  |  Branch (1285:7): [True: 204k, False: 245k]
  ------------------
 1286|   204k|        break;
 1287|   450k|    }
 1288|   450k|  }
 1289|  40.7k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  40.7k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  40.7k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  1.46k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  1.46k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  1.46k|  DataBuf buf(4 + 1);
 1296|  1.46k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.46k|  io_->readOrThrow(buf.data(), 4);
 1298|  1.46k|  uint32_t noOfEntries;
 1299|       |
 1300|  1.46k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  3.15k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 1.98k, False: 1.16k]
  |  Branch (1302:43): [True: 1.69k, False: 294]
  ------------------
 1303|  1.69k|    decodeBlock(recursion_depth + 1);
 1304|  1.69k|  }
 1305|  1.46k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  3.76k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  3.76k|  DataBuf buf(3);
 1309|  3.76k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  3.76k|  buf.data()[2] = '\0';
 1311|  3.76k|  currentStream_ = Video;
 1312|       |
 1313|  3.76k|  const TagDetails* td;
 1314|       |
 1315|  21.5k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 17.8k, False: 3.76k]
  ------------------
 1316|  17.8k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  17.8k|    switch (i) {
 1319|  3.27k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 3.27k, False: 14.5k]
  ------------------
 1320|  3.27k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  3.27k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 2.49k, False: 785]
  ------------------
 1322|  2.49k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.49k|#define _(String) (String)
  ------------------
 1323|  3.27k|        break;
 1324|  3.27k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 3.27k, False: 14.5k]
  ------------------
 1325|  3.27k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  3.27k|        break;
 1327|  11.2k|      default:
  ------------------
  |  Branch (1327:7): [True: 11.2k, False: 6.55k]
  ------------------
 1328|  11.2k|        break;
 1329|  17.8k|    }
 1330|  17.8k|  }
 1331|  3.76k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  3.76k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  4.64k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  4.64k|  size_t cur_pos = io_->tell();
 1336|  4.64k|  DataBuf buf(5);
 1337|  4.64k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  4.64k|  buf.data()[4] = '\0';
 1339|       |
 1340|  4.64k|  const TagVocabulary* tv;
 1341|       |
 1342|  27.8k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 23.1k, False: 4.63k]
  ------------------
 1343|  23.1k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  23.1k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 13.9k, False: 9.28k]
  ------------------
 1346|  4.63k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 4.63k, False: 18.5k]
  ------------------
 1347|  4.63k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  4.63k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 1.55k, False: 3.07k]
  ------------------
 1349|  1.55k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 138, False: 1.42k]
  ------------------
 1350|    138|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    138|#define _(String) (String)
  ------------------
 1351|  1.42k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 826, False: 595]
  ------------------
 1352|    826|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    826|#define _(String) (String)
  ------------------
 1353|  1.55k|        }
 1354|  4.63k|        break;
 1355|  4.63k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 4.63k, False: 18.5k]
  ------------------
 1356|  4.63k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  4.63k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 2.89k, False: 1.74k]
  ------------------
 1358|  2.89k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 296, False: 2.60k]
  ------------------
 1359|    296|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    296|#define _(String) (String)
  ------------------
 1360|  2.60k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 1.41k, False: 1.18k]
  ------------------
 1361|  1.41k|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.41k|#define _(String) (String)
  ------------------
 1362|  2.89k|        }
 1363|  4.63k|        break;
 1364|  4.63k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 4.63k, False: 18.5k]
  ------------------
 1365|  4.63k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  4.63k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 1.58k, False: 3.05k]
  ------------------
 1367|  1.58k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 94, False: 1.48k]
  ------------------
 1368|     94|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|     94|#define _(String) (String)
  ------------------
 1369|  1.48k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 792, False: 696]
  ------------------
 1370|    792|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    792|#define _(String) (String)
  ------------------
 1371|  1.58k|        }
 1372|  4.63k|        break;
 1373|  23.1k|    }
 1374|  23.1k|  }
 1375|  4.63k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  4.63k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  2.68k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  2.68k|  DataBuf buf(5);
 1380|  2.68k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  2.68k|  buf.data()[4] = '\0';
 1382|  2.68k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  2.68k|  const TagVocabulary* td;
 1384|       |
 1385|  16.4k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 13.7k, False: 2.68k]
  ------------------
 1386|  13.7k|    io_->readOrThrow(buf.data(), 4);
 1387|  13.7k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  13.7k|    switch (i) {
 1390|  2.66k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 2.66k, False: 11.0k]
  ------------------
 1391|  2.66k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 2.03k, False: 629]
  ------------------
 1392|  2.03k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  2.03k|#define _(String) (String)
  ------------------
 1393|  2.66k|        break;
 1394|    886|      case 1:
  ------------------
  |  Branch (1394:7): [True: 886, False: 12.8k]
  ------------------
 1395|    886|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|    886|        break;
 1397|  10.1k|      default:
  ------------------
  |  Branch (1397:7): [True: 10.1k, False: 3.55k]
  ------------------
 1398|  10.1k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 1.06k, False: 9.11k]
  ------------------
 1399|  1.06k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.06k|#define _(String) (String)
  ------------------
 1400|  9.11k|        else
 1401|  9.11k|          v->read(Exiv2::toString(buf.data()));
 1402|  10.1k|        break;
 1403|  13.7k|    }
 1404|  13.7k|  }
 1405|  2.68k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  2.68k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  2.68k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|  1.30k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|  1.30k|  DataBuf buf(5);
 1411|  1.30k|  std::memset(buf.data(), 0x0, buf.size());
 1412|  1.30k|  buf.data()[4] = '\0';
 1413|  1.30k|  int64_t time_scale = 1;
 1414|       |
 1415|  6.19k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 4.88k, False: 1.30k]
  ------------------
 1416|  4.88k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  4.88k|    switch (i) {
 1419|    816|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 816, False: 4.07k]
  ------------------
 1420|    816|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 99, False: 717]
  ------------------
 1421|     99|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|    717|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 406, False: 311]
  ------------------
 1423|    406|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    816|        break;
 1425|    801|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 801, False: 4.08k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|    801|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 87, False: 714]
  ------------------
 1428|     87|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|    714|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 406, False: 308]
  ------------------
 1430|    406|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    801|        break;
 1432|    723|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 723, False: 4.16k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|    723|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 65, False: 658]
  ------------------
 1435|     65|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|    658|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 406, False: 252]
  ------------------
 1437|    406|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    723|        break;
 1439|    723|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 723, False: 4.16k]
  ------------------
 1440|    723|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 65, False: 658]
  ------------------
 1441|     65|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|    658|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 406, False: 252]
  ------------------
 1443|    406|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    723|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|    723|        mdhdTimeScale_ = time_scale;
 1446|    723|        break;
 1447|    723|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 723, False: 4.16k]
  ------------------
 1448|    723|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 65, False: 658]
  ------------------
 1449|     65|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 65, False: 0]
  ------------------
 1450|    658|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 406, False: 252]
  ------------------
 1451|    406|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 406, False: 0]
  ------------------
 1452|    723|        break;
 1453|    723|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 723, False: 4.16k]
  ------------------
 1454|    723|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 65, False: 658]
  ------------------
 1455|     65|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|    658|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 406, False: 252]
  ------------------
 1457|    406|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    723|        break;
 1459|       |
 1460|    380|      default:
  ------------------
  |  Branch (1460:7): [True: 380, False: 4.50k]
  ------------------
 1461|    380|        break;
 1462|  4.88k|    }
 1463|  4.88k|  }
 1464|  1.30k|  io_->readOrThrow(buf.data(), size % 4);
 1465|  1.30k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|  1.18k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|  1.18k|  DataBuf buf(5);
 1469|  1.18k|  std::memset(buf.data(), 0x0, buf.size());
 1470|  1.18k|  buf.data()[4] = '\0';
 1471|  1.18k|  int64_t temp = 0;
 1472|       |
 1473|  12.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 11.1k, False: 1.18k]
  ------------------
 1474|  11.1k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  11.1k|    switch (i) {
 1477|    538|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 538, False: 10.5k]
  ------------------
 1478|    538|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 43, False: 495]
  ------------------
 1479|     43|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|    495|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 279, False: 216]
  ------------------
 1481|    279|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    538|        break;
 1483|    537|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 537, False: 10.5k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|    537|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 43, False: 494]
  ------------------
 1486|     43|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|    494|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 279, False: 215]
  ------------------
 1488|    279|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    537|        break;
 1490|    536|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 536, False: 10.5k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|    536|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 43, False: 493]
  ------------------
 1493|     43|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|    493|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 279, False: 214]
  ------------------
 1495|    279|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    536|        break;
 1497|    534|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 534, False: 10.5k]
  ------------------
 1498|    534|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 43, False: 491]
  ------------------
 1499|     43|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|    491|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 279, False: 212]
  ------------------
 1501|    279|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    534|        break;
 1503|    533|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 533, False: 10.5k]
  ------------------
 1504|    533|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 43, False: 490]
  ------------------
 1505|     43|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 43, False: 0]
  ------------------
 1506|    490|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 279, False: 211]
  ------------------
 1507|    279|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 279, False: 0]
  ------------------
 1508|    533|        break;
 1509|    510|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 510, False: 10.6k]
  ------------------
 1510|    510|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 32, False: 478]
  ------------------
 1511|     32|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|    478|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 279, False: 199]
  ------------------
 1513|    279|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    510|        break;
 1515|    510|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 510, False: 10.6k]
  ------------------
 1516|    510|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 32, False: 478]
  ------------------
 1517|     32|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|    478|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 279, False: 199]
  ------------------
 1519|    279|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    510|        break;
 1521|    504|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 504, False: 10.6k]
  ------------------
 1522|    504|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 31, False: 473]
  ------------------
 1523|     31|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|     31|          xmpData_["Xmp.video.Width"] = temp;
 1525|     31|          width_ = temp;
 1526|     31|        }
 1527|    504|        break;
 1528|    504|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 504, False: 10.6k]
  ------------------
 1529|    504|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 31, False: 473]
  ------------------
 1530|     31|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|     31|          xmpData_["Xmp.video.Height"] = temp;
 1532|     31|          height_ = temp;
 1533|     31|        }
 1534|    504|        break;
 1535|  6.41k|      default:
  ------------------
  |  Branch (1535:7): [True: 6.41k, False: 4.70k]
  ------------------
 1536|  6.41k|        break;
 1537|  11.1k|    }
 1538|  11.1k|  }
 1539|  1.18k|  io_->readOrThrow(buf.data(), size % 4);
 1540|  1.18k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|     86|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|     86|  DataBuf buf(5);
 1544|     86|  std::memset(buf.data(), 0x0, buf.size());
 1545|     86|  buf.data()[4] = '\0';
 1546|       |
 1547|    968|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 882, False: 86]
  ------------------
 1548|    882|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|    882|    switch (i) {
 1551|     68|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 68, False: 814]
  ------------------
 1552|     68|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|     68|        break;
 1554|     67|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 67, False: 815]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|     67|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|     67|        break;
 1558|     66|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 66, False: 816]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|     66|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|     66|        break;
 1562|     64|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 64, False: 818]
  ------------------
 1563|     64|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|     64|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|     64|        break;
 1566|     62|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 62, False: 820]
  ------------------
 1567|     62|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 62, False: 0]
  ------------------
 1568|     62|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|     62|        }
 1570|     62|        break;
 1571|     62|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 62, False: 820]
  ------------------
 1572|     62|        xmpData_["Xmp.video.PreferredRate"] =
 1573|     62|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|     62|        break;
 1575|     62|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 62, False: 820]
  ------------------
 1576|     62|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|     62|        break;
 1578|     15|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 15, False: 867]
  ------------------
 1579|     15|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     15|        break;
 1581|     15|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 15, False: 867]
  ------------------
 1582|     15|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     15|        break;
 1584|     15|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 15, False: 867]
  ------------------
 1585|     15|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     15|        break;
 1587|     15|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 15, False: 867]
  ------------------
 1588|     15|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     15|        break;
 1590|     15|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 15, False: 867]
  ------------------
 1591|     15|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     15|        break;
 1593|     15|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 15, False: 867]
  ------------------
 1594|     15|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     15|        break;
 1596|     15|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 15, False: 867]
  ------------------
 1597|     15|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|     15|        break;
 1599|    326|      default:
  ------------------
  |  Branch (1599:7): [True: 326, False: 556]
  ------------------
 1600|    326|        break;
 1601|    882|    }
 1602|    882|  }
 1603|     86|  io_->readOrThrow(buf.data(), size % 4);
 1604|     86|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  4.91k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  4.91k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  4.91k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 10, False: 4.90k]
  ------------------
 1609|     10|    return nullptr;
 1610|     10|  }
 1611|  4.90k|  return image;
 1612|  4.91k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  27.1k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  27.1k|  auto buf = DataBuf(12 + 1);
 1616|  27.1k|  iIo.read(buf.data(), 12);
 1617|  27.1k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  27.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 27.1k]
  |  Branch (1619:22): [True: 501, False: 26.6k]
  ------------------
 1620|    501|    return false;
 1621|    501|  }
 1622|  26.6k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  26.6k|  bool matched = false;
 1625|       |
 1626|   199k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 199k, False: 8.55k]
  ------------------
 1627|   199k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   199k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 18.1k, False: 181k]
  ------------------
 1629|       |      // we only match if we actually know the video type. This is done
 1630|       |      // to avoid matching just on ftyp because bmffimage also has that
 1631|       |      // header.
 1632|  18.1k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 14.7k, False: 3.40k]
  ------------------
 1633|  14.7k|        matched = true;
 1634|  14.7k|      }
 1635|  18.1k|      break;
 1636|  18.1k|    }
 1637|   199k|  }
 1638|       |
 1639|  26.6k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 26.6k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  26.6k|    iIo.seek(0L, BasicIo::beg);
 1641|  26.6k|  }
 1642|       |
 1643|  26.6k|  return matched;
 1644|  27.1k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   114k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   114k|  const char ignoreList[13][5] = {
  505|   114k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   114k|  };
  507|       |
  508|   114k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.45M, False: 107k]
  ------------------
  509|  1.45M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 6.94k, False: 1.44M]
  ------------------
  510|  6.94k|      return true;
  511|       |
  512|   107k|  return false;
  513|   114k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  54.6k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  54.6k|  const char ignoreList[8][5] = {
  524|  54.6k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  54.6k|  };
  526|       |
  527|  54.6k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 422k, False: 47.4k]
  ------------------
  528|   422k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 7.13k, False: 414k]
  ------------------
  529|  7.13k|      return true;
  530|       |
  531|  47.4k|  return false;
  532|  54.6k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.48M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.48M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.48M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.48M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.91M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  2.29k|static std::string readString(BasicIo& io, size_t size) {
  621|  2.29k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  2.29k|  Exiv2::DataBuf str(size + 1);
  623|  2.29k|  io.readOrThrow(str.data(), size);
  624|  2.29k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  2.29k|  return Exiv2::toString(str.data());
  626|  2.29k|}

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

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

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  23.0k|  static constexpr auto tagList() {
   30|  23.0k|    return tagInfo_;
   31|  23.0k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|  18.2k|  static constexpr auto tagListCs() {
   34|  18.2k|    return tagInfoCs_;
   35|  18.2k|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    377|  static constexpr auto tagListCs2() {
   38|    377|    return tagInfoCs2_;
   39|    377|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|   154k|  static constexpr auto tagListFp() {
   42|   154k|    return tagInfoFp_;
   43|   154k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|    645|  static constexpr auto tagListSonyMisc1() {
   46|    645|    return tagInfoSonyMisc1_;
   47|    645|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|    578|  static constexpr auto tagListSonyMisc2b() {
   50|    578|    return tagInfoSonyMisc2b_;
   51|    578|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  58.5k|  static constexpr auto tagListSonyMisc3c() {
   54|  58.5k|    return tagInfoSonyMisc3c_;
   55|  58.5k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   697k|  static constexpr auto tagListSonySInfo1() {
   58|   697k|    return tagInfoSonySInfo1_;
   59|   697k|  }
_ZN5Exiv28Internal13SonyMakerNote12tagList2010eEv:
   61|    565|  static constexpr auto tagList2010e() {
   62|    565|    return tagInfo2010e_;
   63|    565|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  3.03M|const TagInfo* ifdTagList() {
 1779|  3.03M|  return ifdTagInfo;
 1780|  3.03M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   405k|const TagInfo* exifTagList() {
 2217|   405k|  return exifTagInfo;
 2218|   405k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   232k|const TagInfo* gpsTagList() {
 2433|   232k|  return gpsTagInfo;
 2434|   232k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|   150k|const TagInfo* iopTagList() {
 2508|   150k|  return iopTagInfo;
 2509|   150k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  18.8k|const TagInfo* mnTagList() {
 2524|  18.8k|  return mnTagInfo;
 2525|  18.8k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.93M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.93M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.93M, False: 0]
  ------------------
 2529|  1.93M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.93M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  4.93M|bool isExifIfd(IfdId ifdId) {
 2534|  4.93M|  switch (ifdId) {
 2535|   569k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 569k, False: 4.36M]
  ------------------
 2536|   778k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 209k, False: 4.72M]
  ------------------
 2537|   918k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 140k, False: 4.79M]
  ------------------
 2538|  1.06M|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 141k, False: 4.79M]
  ------------------
 2539|  1.13M|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 77.4k, False: 4.86M]
  ------------------
 2540|  1.16M|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 29.3k, False: 4.90M]
  ------------------
 2541|  1.16M|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 598, False: 4.93M]
  ------------------
 2542|  1.16M|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 4.93M]
  ------------------
 2543|  1.74M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 581k, False: 4.35M]
  ------------------
 2544|  2.11M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 365k, False: 4.57M]
  ------------------
 2545|  2.35M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 242k, False: 4.69M]
  ------------------
 2546|  2.56M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 205k, False: 4.73M]
  ------------------
 2547|  2.57M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 16.2k, False: 4.92M]
  ------------------
 2548|  2.58M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 11.3k, False: 4.92M]
  ------------------
 2549|  2.60M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 14.9k, False: 4.92M]
  ------------------
 2550|  2.61M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 5.09k, False: 4.93M]
  ------------------
 2551|  2.61M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 7.88k, False: 4.92M]
  ------------------
 2552|  2.65M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 41.3k, False: 4.89M]
  ------------------
 2553|  3.00M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 346k, False: 4.59M]
  ------------------
 2554|  3.00M|      return true;
 2555|  1.93M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.93M, False: 3.00M]
  ------------------
 2556|  1.93M|      return false;
 2557|  4.93M|  }
 2558|  4.93M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  6.40M|const TagInfo* tagList(IfdId ifdId) {
 2569|  6.40M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 6.40M, False: 0]
  ------------------
 2570|  6.40M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 6.40M, False: 0]
  ------------------
 2571|  6.40M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  6.40M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  4.93M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  4.93M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 4.93M, False: 0]
  ------------------
 2577|  4.93M|    int idx = 0;
 2578|   407M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 404M, False: 3.15M]
  ------------------
 2579|   404M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.78M, False: 402M]
  ------------------
 2580|  1.78M|        break;
 2581|   404M|    }
 2582|  4.93M|    return ti + idx;
 2583|  4.93M|  }
 2584|      0|  return nullptr;
 2585|  4.93M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|  1.46M|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|  1.46M|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 1.46M]
  ------------------
 2589|      0|    return nullptr;
 2590|  1.46M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 1.46M, False: 0]
  ------------------
 2591|  88.9M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 88.7M, False: 159k]
  ------------------
 2592|  88.7M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 1.30M, False: 87.4M]
  ------------------
 2593|  1.30M|        return ti + idx;
 2594|  1.30M|      }
 2595|  88.7M|    }
 2596|  1.46M|  }
 2597|   159k|  return nullptr;
 2598|  1.46M|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  8.34M|IfdId groupId(const std::string& groupName) {
 2601|  8.34M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 8.34M, False: 0]
  ------------------
 2602|  8.34M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  8.34M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  3.43M|const char* groupName(IfdId ifdId) {
 2613|  3.43M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 3.43M, False: 0]
  ------------------
 2614|  3.43M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  3.43M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    354|float fnumber(float apertureValue) {
 2648|    354|  float result = std::exp2(apertureValue / 2.F);
 2649|    354|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 12, False: 342]
  ------------------
 2650|     12|    result = 3.5F;
 2651|     12|  }
 2652|    354|  return result;
 2653|    354|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    354|URational exposureTime(float shutterSpeedValue) {
 2656|    354|  URational ur(1, 1);
 2657|    354|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    354|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 140, False: 214]
  ------------------
 2659|    140|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    140|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 59, False: 81]
  ------------------
 2662|     59|      ur.second = static_cast<uint32_t>(x);
 2663|     59|    }
 2664|    214|  } else {
 2665|    214|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    214|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 214, False: 0]
  |  Branch (2667:19): [True: 214, False: 0]
  ------------------
 2668|    214|      ur.first = static_cast<uint32_t>(x);
 2669|    214|    }
 2670|    214|  }
 2671|    354|  return ur;
 2672|    354|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|  1.46M|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|  1.46M|  auto ti = tagInfo(tagName, ifdId);
 2676|  1.46M|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 1.30M, False: 159k]
  |  Branch (2676:13): [True: 1.30M, False: 0]
  ------------------
 2677|  1.30M|    return ti->tag_;
 2678|   159k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 159k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|   159k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|   159k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  8.10k|const TagInfo* tagList(const std::string& groupName) {
 3295|  8.10k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  8.10k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 8.10k]
  |  Branch (3296:14): [True: 0, False: 8.10k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  8.10k|  return ii->tagList_();
 3300|  8.10k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  33.7M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  33.7M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 33.7M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 6.74M, False: 26.9M]
  |  Branch (42:86): [True: 23.2k, False: 26.9M]
  ------------------
   43|  6.77M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 16.0k, False: 6.75M]
  ------------------
   44|  33.7M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  24.5k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  24.5k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 7.54k, False: 17.0k]
  |  Branch (48:20): [True: 0, False: 17.0k]
  ------------------
   49|  7.54k|    wroteHeader_ = true;
   50|  24.5k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  4.84M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  4.84M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 16.8k, False: 4.83M]
  |  Branch (53:24): [True: 16.8k, False: 0]
  ------------------
   54|  16.8k|    io_.write(pHeader_, size_);
   55|  16.8k|    wroteHeader_ = true;
   56|  16.8k|  }
   57|  4.84M|  return io_.write(pData, wcount);
   58|  4.84M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  48.1k|int IoWrapper::putb(byte data) {
   61|  48.1k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 48.1k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  48.1k|  return io_.putb(data);
   66|  48.1k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     40|void IoWrapper::setTarget(int id, size_t target) {
   69|     40|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 40]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     40|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 13, False: 27]
  ------------------
   73|     13|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     40|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   200k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   200k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  65.8k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  65.8k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  17.1k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  17.1k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  17.1k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  29.4k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  29.4k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  5.12k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  5.12k|    cfgSelFct_(cfgSelFct),
   99|  5.12k|    arraySet_(arraySet),
  100|  5.12k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  5.12k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  10.3M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  10.3M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  10.3M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  42.8k|    TiffComponent(rhs),
  125|  42.8k|    tiffType_(rhs.tiffType_),
  126|  42.8k|    count_(rhs.count_),
  127|  42.8k|    offset_(rhs.offset_),
  128|  42.8k|    size_(rhs.size_),
  129|  42.8k|    pData_(rhs.pData_),
  130|  42.8k|    idx_(rhs.idx_),
  131|  42.8k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 23.4k, False: 19.3k]
  ------------------
  132|  42.8k|    storage_(rhs.storage_) {
  133|  42.8k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    611|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    611|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|   107k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|   107k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|   121k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|   121k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  41.2k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  41.2k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  41.2k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  42.8k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  42.8k|  return UniquePtr(doClone());
  159|  42.8k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  34.1k|TiffEntry* TiffEntry::doClone() const {
  162|  34.1k|  return new TiffEntry(*this);
  163|  34.1k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    382|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    382|  return new TiffDataEntry(*this);
  167|    382|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  2.55k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  2.55k|  return new TiffImageEntry(*this);
  171|  2.55k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  5.15k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  5.15k|  return new TiffSizeEntry(*this);
  175|  5.15k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    611|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    611|  return new TiffSubIfd(*this);
  183|    611|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  20.0M|int TiffEntryBase::idx() const {
  206|  20.0M|  return idx_;
  207|  20.0M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|  1.02M|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|  1.02M|  storage_ = std::move(buf);
  211|  1.02M|  pData_ = storage_->data();
  212|  1.02M|  size_ = storage_->size();
  213|  1.02M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  4.46M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  4.46M|  pData_ = pData;
  217|  4.46M|  size_ = size;
  218|  4.46M|  storage_ = std::move(storage);
  219|  4.46M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 4.46M]
  ------------------
  220|      0|    size_ = 0;
  221|  4.46M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  3.36M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  3.36M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 3.36M]
  ------------------
  225|      0|    return;
  226|  3.36M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 1.02M, False: 2.33M]
  ------------------
  227|  1.02M|    auto d = std::make_shared<DataBuf>(newSize);
  228|  1.02M|    setData(std::move(d));
  229|  1.02M|  }
  230|  3.36M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 1.06M, False: 2.30M]
  ------------------
  231|  1.06M|    memset(pData_, 0x0, size_);
  232|  1.06M|  }
  233|  3.36M|  size_ = value->copy(pData_, byteOrder);
  234|  3.36M|  setValue(std::move(value));
  235|  3.36M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  7.90M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  7.90M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 7.90M]
  ------------------
  239|      0|    return;
  240|  7.90M|  tiffType_ = toTiffType(value->typeId());
  241|  7.90M|  count_ = value->count();
  242|  7.90M|  pValue_ = std::move(value);
  243|  7.90M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  14.8k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  14.8k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 564, False: 14.2k]
  |  Branch (246:20): [True: 291, False: 13.9k]
  ------------------
  247|    855|#ifndef SUPPRESS_WARNINGS
  248|    855|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    855|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 855]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    855|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|    855|#endif
  251|    855|    return;
  252|    855|  }
  253|  13.9k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 2.40k, False: 11.5k]
  ------------------
  254|  2.40k|#ifndef SUPPRESS_WARNINGS
  255|  2.40k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.40k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.40k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.40k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  2.40k|#endif
  258|  2.40k|    return;
  259|  2.40k|  }
  260|  11.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.61k, False: 9.97k]
  ------------------
  261|  1.61k|#ifndef SUPPRESS_WARNINGS
  262|  1.61k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.61k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.61k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.61k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.61k|#endif
  266|  1.61k|    return;
  267|  1.61k|  }
  268|  9.97k|  size_t size = 0;
  269|  29.3k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 19.4k, False: 9.97k]
  ------------------
  270|  19.4k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  19.4k|  }
  272|  9.97k|  const size_t offset = pValue()->toUint32(0);
  273|  9.97k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 714, False: 9.26k]
  |  Branch (273:26): [True: 469, False: 8.79k]
  |  Branch (273:54): [True: 18, False: 8.77k]
  ------------------
  274|  1.20k|#ifndef SUPPRESS_WARNINGS
  275|  1.20k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.20k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.20k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.20k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.20k|#endif
  278|  1.20k|    return;
  279|  1.20k|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  8.77k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 314, False: 8.46k]
  ------------------
  283|    314|#ifndef SUPPRESS_WARNINGS
  284|    314|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    314|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 314]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    314|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    314|#endif
  287|    314|    return;
  288|    314|  }
  289|  8.46k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  8.46k|  sizeDataArea_ = size;
  291|  8.46k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  8.46k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  71.5k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  71.5k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 2.61k, False: 68.9k]
  |  Branch (295:20): [True: 2.93k, False: 66.0k]
  ------------------
  296|  5.54k|#ifndef SUPPRESS_WARNINGS
  297|  5.54k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  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()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  5.54k|#endif
  300|  5.54k|    return;
  301|  5.54k|  }
  302|  66.0k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 18.3k, False: 47.7k]
  ------------------
  303|  18.3k|#ifndef SUPPRESS_WARNINGS
  304|  18.3k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  18.3k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18.3k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  18.3k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  18.3k|#endif
  308|  18.3k|    return;
  309|  18.3k|  }
  310|  3.92M|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 3.88M, False: 47.7k]
  ------------------
  311|  3.88M|    const size_t offset = pValue()->toUint32(i);
  312|  3.88M|    const size_t size = pSize->toUint32(i);
  313|       |
  314|  3.88M|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 36.6k, False: 3.84M]
  |  Branch (314:28): [True: 63.0k, False: 3.78M]
  |  Branch (314:56): [True: 255, False: 3.78M]
  ------------------
  315|  99.9k|#ifndef SUPPRESS_WARNINGS
  316|  99.9k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  99.9k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 99.9k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  99.9k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  99.9k|#endif
  319|  3.78M|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 3.46M, False: 310k]
  ------------------
  320|  3.46M|      const byte* pStrip = pData + baseOffset + offset;
  321|  3.46M|      strips_.emplace_back(pStrip, size);
  322|  3.46M|    }
  323|  3.88M|  }
  324|  47.7k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  6.92k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  6.92k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 2.59k, False: 4.33k]
  ------------------
  328|  2.59k|    return 0;
  329|  4.33k|  return pHeader_->ifdOffset();
  330|  6.92k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  30.8k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  30.8k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 5.63k, False: 25.1k]
  |  Branch (333:20): [True: 22.1k, False: 3.07k]
  ------------------
  334|  27.7k|    return imageByteOrder_;
  335|  27.7k|  }
  336|  3.07k|  return pHeader_->byteOrder();
  337|  30.8k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  4.06k|size_t TiffIfdMakernote::mnOffset() const {
  340|  4.06k|  return mnOffset_;
  341|  4.06k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  16.3k|size_t TiffIfdMakernote::baseOffset() const {
  344|  16.3k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.11k, False: 13.2k]
  ------------------
  345|  3.11k|    return 0;
  346|  13.2k|  return pHeader_->baseOffset(mnOffset_);
  347|  16.3k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  7.65k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  7.65k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 2.59k, False: 5.05k]
  ------------------
  351|  2.59k|    return true;
  352|  5.05k|  return pHeader_->read(pData, size, byteOrder);
  353|  7.65k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  7.75k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  7.75k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 7.24k, False: 511]
  ------------------
  357|  7.24k|    pHeader_->setByteOrder(byteOrder);
  358|  7.75k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  79.2k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  79.2k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 5.20k, False: 74.0k]
  ------------------
  362|  5.20k|    return 0;
  363|  74.0k|  return pHeader_->size();
  364|  79.2k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  9.44k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  9.44k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 514, False: 8.93k]
  ------------------
  368|    514|    return 0;
  369|  8.93k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  9.44k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  6.61M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  6.61M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  6.61M|  return count_ * TypeInfo::typeSize(typeId);
  375|  6.61M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.68M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.68M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.68M, False: 671]
  ------------------
  379|  1.68M|    return true;  // Not a complex array or already initialized
  380|       |
  381|  1.85k|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 1.85k, False: 0]
  ------------------
  382|  1.85k|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 671, False: 1.18k]
  ------------------
  383|    671|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    671|      arrayDef_ = arraySet_[idx].def_;
  385|    671|      defSize_ = arraySet_[idx].defSize_;
  386|    671|      return true;
  387|    671|    }
  388|  1.85k|  }
  389|      0|  return false;
  390|    671|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  4.62k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  4.62k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.29k, False: 2.32k]
  ------------------
  394|  2.29k|    return true;  // Not a complex array
  395|       |
  396|  2.32k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  2.32k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.55k, False: 775]
  ------------------
  398|  1.55k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.55k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.55k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.55k|  }
  402|  2.32k|  return idx > -1;
  403|  4.62k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  14.2k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  14.2k|  origData_ = const_cast<byte*>(pData());
  407|  14.2k|  origSize_ = TiffEntryBase::doSize();
  408|  14.2k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     98|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     98|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 98]
  ------------------
  412|      0|    return false;
  413|     98|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 44, False: 54]
  ------------------
  414|     44|    return true;
  415|     54|  std::memcpy(origData_, pData, origSize_);
  416|     54|  return true;
  417|     98|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  2.26M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  2.26M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  2.26M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  2.26M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  2.26M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  2.26M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 2.26M]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|  2.26M|  tp->setStart(pData() + idx);
  429|  2.26M|  auto s = storage();
  430|  2.26M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  2.26M|  tp->setElDef(def);
  432|  2.26M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  2.26M|  addChild(std::move(tc));
  434|  2.26M|  return sz;
  435|  2.26M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  21.2M|                                      TiffComponent::UniquePtr object) {
  439|  21.2M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  21.2M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  3.36M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  3.36M|  return this;
  445|  3.36M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  8.58M|                                        TiffComponent::UniquePtr object) {
  449|  8.58M|  tiffPath.pop();
  450|  8.58M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  8.58M|  TiffComponent* tc = nullptr;
  453|       |  // Try to use an existing component if there is still at least one
  454|       |  // composite tag on the stack or the tag to add is the MakerNote tag.
  455|       |  // This is used to prevent duplicate entries. Sub-IFDs also, but the > 1
  456|       |  // condition takes care of them, see below.
  457|  8.58M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 6.85M, False: 1.72M]
  |  Branch (457:31): [True: 1.32k, False: 1.72M]
  |  Branch (457:62): [True: 1.16k, False: 154]
  ------------------
  458|  6.85M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 38.9k, False: 6.81M]
  ------------------
  459|  38.9k|      tc = pNext_.get();
  460|  6.81M|    } else {
  461|  44.0M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 44.0M, False: 27.2k]
  ------------------
  462|  44.0M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 6.82M, False: 37.2M]
  |  Branch (462:46): [True: 6.79M, False: 28.8k]
  ------------------
  463|  6.79M|          tc = component.get();
  464|  6.79M|          break;
  465|  6.79M|        }
  466|  44.0M|      }
  467|  6.81M|    }
  468|  6.85M|  }
  469|       |
  470|  8.58M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 6.82M, False: 1.75M]
  ------------------
  471|  6.82M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.75M|  auto atc = [&] {
  474|  1.75M|    if (tiffPath.size() == 1 && object) {
  475|  1.75M|      return std::move(object);
  476|  1.75M|    }
  477|  1.75M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.75M|  }();
  479|       |
  480|       |  // Prevent dangling sub-IFD tags: Do not add a sub-IFD component without children.
  481|       |  // Todo: How to check before creating the component?
  482|  1.75M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.72M, False: 28.1k]
  |  Branch (482:31): [True: 23.5k, False: 1.70M]
  ------------------
  483|  23.5k|    return nullptr;
  484|       |
  485|  1.72M|  tc = [&] {
  486|  1.72M|    if (tpi.extendedTag() == Tag::next)
  487|  1.72M|      return this->addNext(std::move(atc));
  488|  1.72M|    return this->addChild(std::move(atc));
  489|  1.72M|  }();
  490|  1.72M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.75M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  2.65M|                                     TiffComponent::UniquePtr object) {
  495|  2.65M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  2.65M|  tiffPath.pop();
  497|  2.65M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.65M]
  ------------------
  498|       |    // If the last element in the path is the sub-IFD tag itself we're done.
  499|       |    // But that shouldn't happen - see TiffDirectory::doAddPath
  500|      0|    return this;
  501|      0|  }
  502|  2.65M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  2.65M|  tiffPath.push(tpi1);
  504|  2.65M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.83M, False: 15.0k]
  ------------------
  505|  2.83M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 2.64M, False: 188k]
  ------------------
  506|  2.64M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  15.0k|  auto tc = [&] {
  509|  15.0k|    if (tiffPath.size() == 1 && object) {
  510|  15.0k|      return addChild(std::move(object));
  511|  15.0k|    }
  512|  15.0k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  15.0k|  }();
  514|  15.0k|  setCount(ifds_.size());
  515|  15.0k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  2.65M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  2.48M|                                      TiffComponent::UniquePtr object) {
  520|  2.48M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  2.48M|  tiffPath.pop();
  522|  2.48M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 13.9k, False: 2.47M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  13.9k|    return this;
  525|  13.9k|  }
  526|  2.47M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  2.47M|  tiffPath.push(tpi1);
  528|  2.47M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 9.50k, False: 2.46M]
  ------------------
  529|  9.50k|    mnGroup_ = tpi2.group();
  530|  9.50k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  9.50k|  }
  532|  2.47M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  2.48M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  2.47M|                                           TiffComponent::UniquePtr object) {
  537|  2.47M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  2.47M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.69M|                                          TiffComponent::UniquePtr object) {
  542|  1.69M|  pRoot_ = pRoot;
  543|  1.69M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 12.7k, False: 1.68M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  12.7k|    return this;
  546|  12.7k|  }
  547|  1.68M|  tiffPath.pop();
  548|  1.68M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.68M|  initialize(tpi.group());
  551|       |  // Todo: Duplicates are not allowed!
  552|       |  // To allow duplicate entries, we only check if the new component already
  553|       |  // exists if there is still at least one composite tag on the stack
  554|  1.68M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.68M]
  ------------------
  555|      0|    for (const auto& element : elements_)
  ------------------
  |  Branch (555:30): [True: 0, False: 0]
  ------------------
  556|      0|      if (element->tag() == tpi.tag() && element->group() == tpi.group())
  ------------------
  |  Branch (556:11): [True: 0, False: 0]
  |  Branch (556:42): [True: 0, False: 0]
  ------------------
  557|      0|        return element->addPath(tag, tiffPath, pRoot, std::move(object));
  558|      0|  }
  559|       |
  560|  1.68M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.68M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.68M]
  ------------------
  561|      0|    auto tc = addChild(std::move(object));
  562|      0|    setCount(elements_.size());
  563|      0|    return tc->addPath(tag, tiffPath, pRoot, nullptr);
  564|      0|  }
  565|       |
  566|  1.68M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.68M|  setCount(elements_.size());
  568|  1.68M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.68M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  10.4M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  10.4M|  return doAddChild(std::move(tiffComponent));
  573|  10.4M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  6.37M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  6.37M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  6.37M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|   127k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|   127k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|   127k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 127k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|   127k|  return ifds_.emplace_back(std::move(d)).get();
  589|   127k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  3.95M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  3.95M|  setDecoded(true);
  604|  3.95M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  3.95M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  3.88k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  3.88k|  return doAddNext(std::move(tiffComponent));
  609|  3.88k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  3.88k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  3.88k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 3.88k, False: 0]
  ------------------
  617|  3.88k|    pNext_ = std::move(tiffComponent);
  618|  3.88k|    return pNext_.get();
  619|  3.88k|  }
  620|      0|  return nullptr;
  621|  3.88k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  68.1M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  68.1M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 68.1M, False: 12.8k]
  ------------------
  636|  68.1M|    doAccept(visitor);  // one for NVI :)
  637|  68.1M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  39.4M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  39.4M|  visitor.visitEntry(this);
  641|  39.4M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   179k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   179k|  visitor.visitDataEntry(this);
  645|   179k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  1.97M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  1.97M|  visitor.visitImageEntry(this);
  649|  1.97M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.90M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.90M|  visitor.visitSizeEntry(this);
  653|  2.90M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  1.95M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  1.95M|  visitor.visitDirectory(this);
  657|  46.0M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 46.0M, False: 1.63M]
  ------------------
  658|  46.0M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 318k, False: 45.7M]
  ------------------
  659|   318k|      break;
  660|  45.7M|    component->accept(visitor);
  661|  45.7M|  }
  662|  1.95M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.62M, False: 333k]
  ------------------
  663|  1.62M|    visitor.visitDirectoryNext(this);
  664|  1.95M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 57.4k, False: 1.89M]
  ------------------
  665|  57.4k|    pNext_->accept(visitor);
  666|  1.95M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.60M, False: 352k]
  ------------------
  667|  1.60M|    visitor.visitDirectoryEnd(this);
  668|  1.95M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   375k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   375k|  visitor.visitSubIfd(this);
  672|  1.48M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 1.48M, False: 297k]
  ------------------
  673|  1.48M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 77.3k, False: 1.40M]
  ------------------
  674|  77.3k|      break;
  675|  1.40M|    ifd->accept(visitor);
  676|  1.40M|  }
  677|   375k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   243k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   243k|  visitor.visitMnEntry(this);
  681|   243k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 87.5k, False: 155k]
  ------------------
  682|  87.5k|    mn_->accept(visitor);
  683|   243k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.27k, False: 241k]
  ------------------
  684|  1.27k|    mn_ = nullptr;
  685|  1.27k|  }
  686|       |
  687|   243k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  79.7k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  79.7k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 79.7k, False: 0]
  ------------------
  691|  79.7k|    visitor.visitIfdMakernote(this);
  692|  79.7k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 78.9k, False: 794]
  ------------------
  693|  78.9k|    ifd_.accept(visitor);
  694|  79.7k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 78.9k, False: 794]
  |  Branch (694:52): [True: 60.9k, False: 18.0k]
  ------------------
  695|  60.9k|    visitor.visitIfdMakernoteEnd(this);
  696|  79.7k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   168k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   168k|  visitor.visitBinaryArray(this);
  700|  20.4M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 20.4M, False: 167k]
  ------------------
  701|  20.4M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 1.34k, False: 20.4M]
  ------------------
  702|  1.34k|      break;
  703|  20.4M|    element->accept(visitor);
  704|  20.4M|  }
  705|   168k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 155k, False: 13.2k]
  ------------------
  706|   155k|    visitor.visitBinaryArrayEnd(this);
  707|   168k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  20.7M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  20.7M|  visitor.visitBinaryElement(this);
  711|  20.7M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  3.39M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  3.39M|  doEncode(encoder, datum);
  715|  3.39M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.69M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.69M|  encoder.encodeBinaryElement(this, datum);
  719|  1.69M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  13.2k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  13.2k|  encoder.encodeBinaryArray(this, datum);
  723|  13.2k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  9.96k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  9.96k|  encoder.encodeDataEntry(this, datum);
  727|  9.96k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.61M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.61M|  encoder.encodeTiffEntry(this, datum);
  731|  1.61M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  19.3k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  19.3k|  encoder.encodeImageEntry(this, datum);
  735|  19.3k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  14.6k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  14.6k|  encoder.encodeMnEntry(this, datum);
  739|  14.6k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  28.7k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  28.7k|  encoder.encodeSizeEntry(this, datum);
  743|  28.7k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  2.12k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  2.12k|  encoder.encodeSubIfd(this, datum);
  747|  2.12k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  2.10M|size_t TiffComponent::count() const {
  750|  2.10M|  return doCount();
  751|  2.10M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   202k|size_t TiffDirectory::doCount() const {
  754|   202k|  return components_.size();
  755|   202k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.88M|size_t TiffEntryBase::doCount() const {
  758|  1.88M|  return count_;
  759|  1.88M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  21.0k|size_t TiffMnEntry::doCount() const {
  762|  21.0k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 11.3k, False: 9.74k]
  ------------------
  763|  11.3k|    return TiffEntryBase::doCount();
  764|  11.3k|  }
  765|  9.74k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  9.74k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 1.96k, False: 7.77k]
  |  Branch (768:36): [True: 1.93k, False: 36]
  |  Branch (768:68): [True: 1.82k, False: 102]
  ------------------
  769|  1.82k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  1.82k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.82k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.82k|  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.82k|  }
  773|  9.74k|#endif
  774|  9.74k|  return mn_->size();
  775|  21.0k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  20.5k|size_t TiffBinaryArray::doCount() const {
  782|  20.5k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 1.02k, False: 19.5k]
  |  Branch (782:17): [True: 11.8k, False: 7.63k]
  ------------------
  783|  12.9k|    return TiffEntryBase::doCount();
  784|       |
  785|  7.63k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 7.63k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  7.63k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  7.63k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  7.63k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 88, False: 7.54k]
  ------------------
  791|     88|#ifndef SUPPRESS_WARNINGS
  792|     88|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|     88|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 88]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     88|  LogMsg(LogMsg::warn).os()
  ------------------
                  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|     88|#endif
  795|     88|    typeSize = 1;
  796|     88|  }
  797|       |
  798|  7.63k|  return size() / typeSize;
  799|  7.63k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|  1.01k|size_t TiffBinaryElement::doCount() const {
  802|  1.01k|  return elDef_.count_;
  803|  1.01k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  3.44M|                            size_t& imageIdx) {
  807|  3.44M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  3.44M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  42.2k|                              size_t& imageIdx) {
  812|  42.2k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  42.2k|  const size_t compCount = count();
  816|  42.2k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 42.2k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  42.2k|  size_t sizeNext = 0;
  821|  42.2k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 1.02k, False: 41.2k]
  ------------------
  822|  1.02k|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  42.2k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 670, False: 41.6k]
  |  Branch (825:25): [True: 214, False: 456]
  ------------------
  826|    214|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  42.0k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 40, False: 42.0k]
  ------------------
  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|     40|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     40|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  42.0k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 41.8k, False: 203]
  ------------------
  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|  42.0k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 30.3k, False: 11.7k]
  ------------------
  842|  30.3k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  30.3k|  }
  844|       |  // Size of IFD values and additional data
  845|  42.0k|  size_t sizeValue = 0;
  846|  42.0k|  size_t sizeData = 0;
  847|  1.71M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.71M, False: 42.0k]
  ------------------
  848|  1.71M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 104k, False: 1.61M]
  ------------------
  849|   104k|      sv += sv & 1;  // Align value to word boundary
  850|   104k|      sizeValue += sv;
  851|   104k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.71M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 788k, False: 930k]
  ------------------
  854|   788k|      auto sd = component->sizeData();
  855|   788k|      sd += sd & 1;  // Align data to word boundary
  856|   788k|      sizeData += sd;
  857|   788k|    }
  858|  1.71M|  }
  859|       |
  860|  42.0k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  42.0k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  42.0k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  42.0k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 16.8k, False: 25.2k]
  ------------------
  864|  16.8k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  16.8k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  16.8k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  42.0k|  byte buf[4];
  870|  42.0k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  42.0k|  ioWrapper.write(buf, 2);
  872|  42.0k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.71M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.71M, False: 42.0k]
  ------------------
  875|  1.71M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.71M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 103k, False: 1.61M]
  ------------------
  877|   103k|      sv += sv & 1;  // Align value to word boundary
  878|   103k|      valueIdx += sv;
  879|   103k|    }
  880|  1.71M|    auto sd = component->sizeData();
  881|  1.71M|    sd += sd & 1;  // Align data to word boundary
  882|  1.71M|    dataIdx += sd;
  883|  1.71M|  }
  884|       |  // c) Pointer to the next IFD
  885|  42.0k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 41.6k, False: 392]
  ------------------
  886|  41.6k|    memset(buf, 0x0, 4);
  887|  41.6k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 1.02k, False: 40.6k]
  |  Branch (887:19): [True: 1.02k, False: 1]
  ------------------
  888|  1.02k|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|  1.02k|    }
  890|  41.6k|    ioWrapper.write(buf, 4);
  891|  41.6k|    idx += 4;
  892|  41.6k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  42.0k|  valueIdx = sizeDir;
  896|  42.0k|  dataIdx = sizeDir + sizeValue;
  897|  1.70M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.70M, False: 42.0k]
  ------------------
  898|  1.70M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 102k, False: 1.59M]
  ------------------
  899|   102k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|   102k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|   102k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 18.3k, False: 83.7k]
  ------------------
  902|  18.3k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  18.3k|        sv += 1;
  904|  18.3k|      }
  905|   102k|      idx += sv;
  906|   102k|      valueIdx += sv;
  907|   102k|    }
  908|  1.70M|    auto sd = component->sizeData();
  909|  1.70M|    sd += sd & 1;  // Align data to word boundary
  910|  1.70M|    dataIdx += sd;
  911|  1.70M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  42.0k|  dataIdx = sizeDir + sizeValue;
  915|  42.0k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  42.0k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 1.01k, False: 41.0k]
  |  Branch (918:17): [True: 1.01k, False: 1]
  ------------------
  919|  1.01k|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|  1.01k|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  42.0k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 16.2k, False: 25.8k]
  ------------------
  924|  16.2k|    idx += writeImage(ioWrapper, byteOrder);
  925|  16.2k|  }
  926|       |
  927|  42.0k|  return idx;
  928|  42.2k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.71M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.71M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.71M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.71M]
  ------------------
  934|      0|    return 0;
  935|  1.71M|  byte buf[8];
  936|  1.71M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.71M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.71M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.71M|  ioWrapper.write(buf, 8);
  940|  1.71M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 103k, False: 1.61M]
  ------------------
  941|   103k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|   103k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|   103k|    ioWrapper.write(buf, 4);
  944|  1.61M|  } else {
  945|  1.61M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.61M|#ifndef SUPPRESS_WARNINGS
  947|  1.61M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 4, False: 1.61M]
  ------------------
  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|  1.61M|#endif
  951|  1.61M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.58M, False: 24.1k]
  ------------------
  952|  1.58M|      memset(buf, 0x0, 4);
  953|  1.58M|      ioWrapper.write(buf, 4 - len);
  954|  1.58M|    }
  955|  1.61M|  }
  956|  1.71M|  return 12;
  957|  1.71M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.65M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.65M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 17.9k, False: 1.63M]
  |  Branch (961:19): [True: 1.51M, False: 123k]
  ------------------
  962|  1.53M|    return 0;
  963|       |
  964|   123k|  DataBuf buf(pValue_->size());
  965|   123k|  pValue_->copy(buf.data(), byteOrder);
  966|   123k|  ioWrapper.write(buf.c_data(), buf.size());
  967|   123k|  return buf.size();
  968|  1.65M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  73.3k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  73.3k|  size_t rc = 0;
  972|  73.3k|  switch (tiffType) {
  973|  3.36k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 3.36k, False: 70.0k]
  ------------------
  974|  4.59k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 1.22k, False: 72.1k]
  ------------------
  975|  4.59k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 24, False: 4.56k]
  ------------------
  976|     24|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  4.56k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  4.56k|      break;
  979|  63.8k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 63.8k, False: 9.51k]
  ------------------
  980|  68.4k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 4.54k, False: 68.8k]
  ------------------
  981|  68.4k|      if (offset > std::numeric_limits<uint32_t>::max())
  ------------------
  |  Branch (981:11): [True: 10, False: 68.3k]
  ------------------
  982|     10|        throw Error(ErrorCode::kerOffsetOutOfRange);
  983|  68.3k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  984|  68.3k|      break;
  985|    377|    default:
  ------------------
  |  Branch (985:5): [True: 377, False: 72.9k]
  ------------------
  986|    377|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  987|  73.3k|  }
  988|  72.9k|  return rc;
  989|  73.3k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  992|  7.54k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  993|  7.54k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (993:7): [True: 240, False: 7.30k]
  |  Branch (993:20): [True: 5.10k, False: 2.19k]
  ------------------
  994|  5.34k|    return 0;
  995|       |
  996|  2.19k|  DataBuf buf(pValue()->size());
  997|  2.19k|  size_t idx = 0;
  998|  2.19k|  const size_t prevOffset = pValue()->toUint32(0);
  999|  6.16k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (999:22): [True: 3.96k, False: 2.19k]
  ------------------
 1000|  3.96k|    const size_t iOffset = pValue()->toUint32(i);
 1001|  3.96k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1002|  3.96k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1003|  3.96k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1004|  3.96k|  }
 1005|  2.19k|  ioWrapper.write(buf.c_data(), buf.size());
 1006|  2.19k|  return buf.size();
 1007|  7.54k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1010|  18.4k|                               size_t dataIdx, size_t& imageIdx) {
 1011|  18.4k|  size_t o2 = imageIdx;
 1012|       |  // For makernotes, write TIFF image data to the data area
 1013|  18.4k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1013:7): [True: 364, False: 18.1k]
  ------------------
 1014|    364|    o2 = Safe::add<size_t>(offset, dataIdx);
 1015|       |#ifdef EXIV2_DEBUG_MESSAGES
 1016|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1017|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1018|       |#endif
 1019|  18.4k|  DataBuf buf(strips_.size() * 4);
 1020|  18.4k|  size_t idx = 0;
 1021|  54.4k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1021:29): [True: 54.4k, False: 18.4k]
  ------------------
 1022|  54.4k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1023|       |    // Align strip data to word boundary
 1024|  54.4k|    const auto sz = Safe::add(off, off & 1);
 1025|  54.4k|    o2 = Safe::add(o2, sz);
 1026|  54.4k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1026:9): [True: 53.7k, False: 632]
  ------------------
 1027|  53.7k|      imageIdx = Safe::add(imageIdx, sz);
 1028|  54.4k|  }
 1029|  18.4k|  ioWrapper.write(buf.c_data(), buf.size());
 1030|  18.4k|  return buf.size();
 1031|  18.4k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1034|  11.7k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1035|  11.7k|  DataBuf buf(ifds_.size() * 4);
 1036|  11.7k|  size_t idx = 0;
 1037|       |  // Sort IFDs by group, needed if image data tags were copied first
 1038|  11.7k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1039|  15.0k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1039:19): [True: 15.0k, False: 11.7k]
  ------------------
 1040|  15.0k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1041|  15.0k|    dataIdx += ifd->size();
 1042|  15.0k|  }
 1043|  11.7k|  ioWrapper.write(buf.c_data(), buf.size());
 1044|  11.7k|  return buf.size();
 1045|  11.7k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1048|  20.5k|                            size_t& imageIdx) {
 1049|  20.5k|  if (!mn_) {
  ------------------
  |  Branch (1049:7): [True: 11.0k, False: 9.44k]
  ------------------
 1050|  11.0k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1051|  11.0k|  }
 1052|  9.44k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1053|  20.5k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1056|  9.44k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1057|  9.44k|  mnOffset_ = offset;
 1058|  9.44k|  setImageByteOrder(byteOrder);
 1059|  9.44k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1060|  9.44k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1061|  9.44k|                    imageIdx);
 1062|  9.44k|  return len;
 1063|  9.44k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1066|  20.2k|                                size_t dataIdx, size_t& imageIdx) {
 1067|  20.2k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1067:7): [True: 951, False: 19.2k]
  |  Branch (1067:17): [True: 11.7k, False: 7.54k]
  ------------------
 1068|  12.6k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1069|  7.54k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1069:7): [True: 765, False: 6.78k]
  ------------------
 1070|    765|    byteOrder = cfg()->byteOrder_;
 1071|       |  // Tags must be sorted in ascending order
 1072|  7.54k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1073|  7.54k|  size_t idx = 0;
 1074|  7.54k|  MemIo mio;  // memory stream in which to store data
 1075|  7.54k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1076|       |  // Some array entries need to have the size in the first element
 1077|  7.54k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1077:7): [True: 347, False: 7.19k]
  ------------------
 1078|    347|    byte buf[4];
 1079|    347|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1080|    347|    switch (elSize) {
 1081|    122|      case 2:
  ------------------
  |  Branch (1081:7): [True: 122, False: 225]
  ------------------
 1082|    122|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1083|    122|        break;
 1084|    225|      case 4:
  ------------------
  |  Branch (1084:7): [True: 225, False: 122]
  ------------------
 1085|    225|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1086|    225|        break;
 1087|      0|      default:
  ------------------
  |  Branch (1087:7): [True: 0, False: 347]
  ------------------
 1088|      0|        break;
 1089|    347|    }
 1090|    347|    mioWrapper.write(buf, elSize);
 1091|    347|  }
 1092|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1093|  1.68M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1093:23): [True: 1.68M, False: 7.54k]
  ------------------
 1094|       |    // Skip the manufactured tag, if it exists
 1095|  1.68M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1095:9): [True: 21.8k, False: 1.66M]
  |  Branch (1095:28): [True: 347, False: 21.5k]
  ------------------
 1096|    347|      continue;
 1097|  1.68M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1098|  1.68M|    idx += fillGap(mioWrapper, idx, newIdx);
 1099|  1.68M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1100|  1.68M|  }
 1101|  7.54k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1101:7): [True: 6.39k, False: 1.15k]
  |  Branch (1101:29): [True: 6.39k, False: 0]
  ------------------
 1102|  6.39k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1103|  6.39k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1104|  6.39k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1105|  6.39k|  }
 1106|       |
 1107|  7.54k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1107:7): [True: 567, False: 6.97k]
  ------------------
 1108|       |    // Select sonyTagEncipher
 1109|    567|    CryptFct cryptFct = cfg()->cryptFct_;
 1110|    567|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1110:9): [True: 178, False: 389]
  ------------------
 1111|    178|      cryptFct = sonyTagEncipher;
 1112|    178|    }
 1113|    567|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1114|    567|    if (!buf.empty()) {
  ------------------
  |  Branch (1114:9): [True: 210, False: 357]
  ------------------
 1115|    210|      mio.seek(0, Exiv2::BasicIo::beg);
 1116|    210|      mio.write(buf.c_data(), buf.size());
 1117|    210|    }
 1118|    567|  }
 1119|  7.54k|  ioWrapper.write(mio.mmap(), mio.size());
 1120|       |
 1121|  7.54k|  return idx;
 1122|  7.54k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1125|  1.68M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1126|  1.68M|  auto pv = pValue();
 1127|  1.68M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1127:7): [True: 0, False: 1.68M]
  |  Branch (1127:14): [True: 801k, False: 883k]
  ------------------
 1128|   801k|    return 0;
 1129|   883k|  DataBuf buf(pv->size());
 1130|   883k|  pv->copy(buf.data(), byteOrder);
 1131|   883k|  ioWrapper.write(buf.c_data(), buf.size());
 1132|   883k|  return buf.size();
 1133|  1.68M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1136|  1.73M|                                size_t& imageIdx) const {
 1137|  1.73M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1138|  1.73M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1141|  41.4k|                                  size_t& imageIdx) const {
 1142|  41.4k|  size_t len = 0;
 1143|  1.69M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1143:25): [True: 1.69M, False: 41.4k]
  ------------------
 1144|  1.69M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1145|  1.69M|  }
 1146|  41.4k|  return len;
 1147|  41.4k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1150|  1.65M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1151|  1.65M|  return 0;
 1152|  1.65M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1155|  18.1k|                                   size_t& /*imageIdx*/) const {
 1156|  18.1k|  size_t len = 0;
 1157|       |  // For makernotes, write TIFF image data to the data area
 1158|  18.1k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1158:7): [True: 352, False: 17.8k]
  ------------------
 1159|    352|    len = writeImage(ioWrapper, byteOrder);
 1160|    352|  }
 1161|  18.1k|  return len;
 1162|  18.1k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1165|  6.37k|                                  size_t& /*imageIdx*/) const {
 1166|  6.37k|  if (!pValue())
  ------------------
  |  Branch (1166:7): [True: 136, False: 6.24k]
  ------------------
 1167|    136|    return 0;
 1168|       |
 1169|  6.24k|  DataBuf buf = pValue()->dataArea();
 1170|  6.24k|  if (!buf.empty())
  ------------------
  |  Branch (1170:7): [True: 610, False: 5.63k]
  ------------------
 1171|    610|    ioWrapper.write(buf.c_data(), buf.size());
 1172|       |  // Align data to word boundary
 1173|  6.24k|  size_t align = (buf.size() & 1);
 1174|  6.24k|  if (align)
  ------------------
  |  Branch (1174:7): [True: 399, False: 5.84k]
  ------------------
 1175|    399|    ioWrapper.putb(0x0);
 1176|       |
 1177|  6.24k|  return buf.size() + align;
 1178|  6.37k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1181|  11.7k|                               size_t& imageIdx) const {
 1182|  11.7k|  size_t len = 0;
 1183|  14.8k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1183:19): [True: 14.8k, False: 11.7k]
  ------------------
 1184|  14.8k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1185|  14.8k|  }
 1186|       |  // Align data to word boundary
 1187|  11.7k|  size_t align = (len & 1);
 1188|  11.7k|  if (align)
  ------------------
  |  Branch (1188:7): [True: 0, False: 11.7k]
  ------------------
 1189|      0|    ioWrapper.putb(0x0);
 1190|       |
 1191|  11.7k|  return len + align;
 1192|  11.7k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1199|   946k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1200|   946k|  return doWriteImage(ioWrapper, byteOrder);
 1201|   946k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1203|  29.1k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1204|  29.1k|  size_t len = 0;
 1205|  29.1k|  const TiffComponent* pSubIfd = nullptr;
 1206|   917k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1206:30): [True: 917k, False: 29.1k]
  ------------------
 1207|   917k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1207:9): [True: 1.65k, False: 915k]
  ------------------
 1208|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1209|  1.65k|#ifndef SUPPRESS_WARNINGS
 1210|  1.65k|      if (pSubIfd) {
  ------------------
  |  Branch (1210:11): [True: 405, False: 1.24k]
  ------------------
 1211|    405|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    405|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 405]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    405|  LogMsg(LogMsg::error).os()
  ------------------
 1212|    405|      }
 1213|  1.65k|#endif
 1214|  1.65k|      pSubIfd = component.get();
 1215|  1.65k|      continue;
 1216|  1.65k|    }
 1217|   915k|    len += component->writeImage(ioWrapper, byteOrder);
 1218|   915k|  }
 1219|  29.1k|  if (pSubIfd) {
  ------------------
  |  Branch (1219:7): [True: 1.22k, False: 27.9k]
  ------------------
 1220|  1.22k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1221|  1.22k|  }
 1222|  29.1k|  if (pNext_) {
  ------------------
  |  Branch (1222:7): [True: 783, False: 28.3k]
  ------------------
 1223|    783|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1224|    783|  }
 1225|  29.1k|  return len;
 1226|  29.1k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1228|   892k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1229|   892k|  return 0;
 1230|   892k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1232|  9.20k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1233|  9.20k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1234|  9.20k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1235|  9.20k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1245|  16.3k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1246|  16.3k|  if (!pValue())
  ------------------
  |  Branch (1246:7): [True: 157, False: 16.1k]
  ------------------
 1247|    157|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1248|       |
 1249|  16.1k|  size_t len = pValue()->sizeDataArea();
 1250|  16.1k|  if (len > 0) {
  ------------------
  |  Branch (1250:7): [True: 316, False: 15.8k]
  ------------------
 1251|       |#ifdef EXIV2_DEBUG_MESSAGES
 1252|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1253|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1254|       |#endif
 1255|    316|    DataBuf buf = pValue()->dataArea();
 1256|    316|    ioWrapper.write(buf.c_data(), buf.size());
 1257|    316|    size_t align = len & 1;  // Align image data to word boundary
 1258|    316|    if (align)
  ------------------
  |  Branch (1258:9): [True: 172, False: 144]
  ------------------
 1259|    172|      ioWrapper.putb(0x0);
 1260|    316|    len += align;
 1261|  15.8k|  } else {
 1262|       |#ifdef EXIV2_DEBUG_MESSAGES
 1263|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1264|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1265|       |#endif
 1266|  15.8k|    len = 0;
 1267|  50.0k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1267:24): [True: 50.0k, False: 15.8k]
  ------------------
 1268|  50.0k|      ioWrapper.write(f, s);
 1269|  50.0k|      len += s;
 1270|  50.0k|      size_t align = s & 1;  // Align strip data to word boundary
 1271|  50.0k|      if (align)
  ------------------
  |  Branch (1271:11): [True: 29.2k, False: 20.7k]
  ------------------
 1272|  29.2k|        ioWrapper.putb(0x0);
 1273|  50.0k|      len += align;
 1274|  50.0k|    }
 1275|  15.8k|  }
 1276|       |#ifdef EXIV2_DEBUG_MESSAGES
 1277|       |  std::cerr << ", len = " << len << " bytes\n";
 1278|       |#endif
 1279|  16.1k|  return len;
 1280|  16.3k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1282|  20.6M|size_t TiffComponent::size() const {
 1283|  20.6M|  return doSize();
 1284|  20.6M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1286|   160k|size_t TiffDirectory::doSize() const {
 1287|   160k|  size_t compCount = count();
 1288|       |  // Size of the directory, without values and additional data
 1289|   160k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1289:40): [True: 158k, False: 1.84k]
  ------------------
 1290|       |  // Size of IFD values and data
 1291|  7.67M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1291:25): [True: 7.67M, False: 160k]
  ------------------
 1292|  7.67M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1292:40): [True: 376k, False: 7.30M]
  ------------------
 1293|   376k|      sv += sv & 1;  // Align value to word boundary
 1294|   376k|      len += sv;
 1295|   376k|    }
 1296|  7.67M|    auto sd = component->sizeData();
 1297|  7.67M|    sd += sd & 1;  // Align data to word boundary
 1298|  7.67M|    len += sd;
 1299|  7.67M|  }
 1300|       |  // Size of next-IFD, if any
 1301|   160k|  size_t sizeNext = 0;
 1302|   160k|  if (pNext_) {
  ------------------
  |  Branch (1302:7): [True: 236, False: 159k]
  ------------------
 1303|    236|    sizeNext = pNext_->size();
 1304|    236|    len += sizeNext;
 1305|    236|  }
 1306|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1307|   160k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1307:7): [True: 1.09k, False: 158k]
  |  Branch (1307:25): [True: 966, False: 130]
  ------------------
 1308|    966|    len = 0;
 1309|   160k|  return len;
 1310|   160k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1312|  21.0M|size_t TiffEntryBase::doSize() const {
 1313|  21.0M|  return size_;
 1314|  21.0M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1316|   107k|size_t TiffImageEntry::doSize() const {
 1317|   107k|  return strips_.size() * 4;
 1318|   107k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1320|  69.7k|size_t TiffSubIfd::doSize() const {
 1321|  69.7k|  return ifds_.size() * 4;
 1322|  69.7k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1324|   114k|size_t TiffMnEntry::doSize() const {
 1325|   114k|  if (!mn_) {
  ------------------
  |  Branch (1325:7): [True: 44.9k, False: 69.5k]
  ------------------
 1326|  44.9k|    return TiffEntryBase::doSize();
 1327|  44.9k|  }
 1328|  69.5k|  return mn_->size();
 1329|   114k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1331|  79.2k|size_t TiffIfdMakernote::doSize() const {
 1332|  79.2k|  return sizeHeader() + ifd_.size();
 1333|  79.2k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1335|   272k|size_t TiffBinaryArray::doSize() const {
 1336|   272k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1336:7): [True: 12.5k, False: 259k]
  |  Branch (1336:17): [True: 153k, False: 106k]
  ------------------
 1337|   165k|    return TiffEntryBase::doSize();
 1338|       |
 1339|   106k|  if (elements_.empty())
  ------------------
  |  Branch (1339:7): [True: 0, False: 106k]
  ------------------
 1340|      0|    return 0;
 1341|       |
 1342|       |  // Remaining assumptions:
 1343|       |  // - array elements don't "overlap"
 1344|       |  // - no duplicate tags in the array
 1345|   106k|  size_t idx = 0;
 1346|   106k|  size_t sz = cfg()->tagStep();
 1347|  23.6M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1347:23): [True: 23.6M, False: 106k]
  ------------------
 1348|  23.6M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1348:9): [True: 5.79M, False: 17.8M]
  ------------------
 1349|  5.79M|      idx = element->tag();
 1350|  5.79M|      sz = element->size();
 1351|  5.79M|    }
 1352|  23.6M|  }
 1353|   106k|  idx *= cfg()->tagStep();
 1354|   106k|  idx += sz;
 1355|       |
 1356|   106k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1356:7): [True: 89.7k, False: 16.6k]
  |  Branch (1356:29): [True: 89.7k, False: 0]
  ------------------
 1357|  89.7k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1358|  89.7k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1359|  89.7k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1360|  89.7k|  }
 1361|   106k|  return idx;
 1362|       |
 1363|   106k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1365|  5.79M|size_t TiffBinaryElement::doSize() const {
 1366|  5.79M|  if (!pValue())
  ------------------
  |  Branch (1366:7): [True: 0, False: 5.79M]
  ------------------
 1367|      0|    return 0;
 1368|  5.79M|  return pValue()->size();
 1369|  5.79M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1371|  11.8M|size_t TiffComponent::sizeData() const {
 1372|  11.8M|  return doSizeData();
 1373|  11.8M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1379|  11.6M|size_t TiffEntryBase::doSizeData() const {
 1380|  11.6M|  return 0;
 1381|  11.6M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1383|  80.6k|size_t TiffImageEntry::doSizeData() const {
 1384|  80.6k|  size_t len = 0;
 1385|       |  // For makernotes, TIFF image data is written to the data area
 1386|  80.6k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1386:7): [True: 6.37k, False: 74.2k]
  ------------------
 1387|  6.37k|    len = sizeImage();
 1388|  6.37k|  }
 1389|  80.6k|  return len;
 1390|  80.6k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1392|  60.9k|size_t TiffDataEntry::doSizeData() const {
 1393|  60.9k|  if (!pValue())
  ------------------
  |  Branch (1393:7): [True: 720, False: 60.2k]
  ------------------
 1394|    720|    return 0;
 1395|  60.2k|  return pValue()->sizeDataArea();
 1396|  60.9k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1398|  54.7k|size_t TiffSubIfd::doSizeData() const {
 1399|  54.7k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1400|  54.7k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1406|  6.37k|size_t TiffComponent::sizeImage() const {
 1407|  6.37k|  return doSizeImage();
 1408|  6.37k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1428|  6.37k|size_t TiffImageEntry::doSizeImage() const {
 1429|  6.37k|  if (!pValue())
  ------------------
  |  Branch (1429:7): [True: 0, False: 6.37k]
  ------------------
 1430|      0|    return 0;
 1431|  6.37k|  auto len = pValue()->sizeDataArea();
 1432|  6.37k|  if (len != 0)
  ------------------
  |  Branch (1432:7): [True: 0, False: 6.37k]
  ------------------
 1433|      0|    return len;
 1434|       |
 1435|  6.37k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1436|  6.37k|                               [](const auto& s) { return s.second; });
 1437|  6.37k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1454|  13.5M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1455|  13.5M|  auto ti = static_cast<TypeId>(tiffType);
 1456|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1457|  13.5M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1457:22): [True: 9.09k, False: 13.5M]
  ------------------
 1458|  9.09k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1458:9): [True: 6.06k, False: 3.03k]
  ------------------
 1459|  6.06k|      ti = comment;
 1460|  6.06k|    }
 1461|  9.09k|  }
 1462|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1463|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1464|  13.5M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1464:7): [True: 6.27M, False: 7.27M]
  ------------------
 1465|  6.27M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1465:9): [True: 4.87k, False: 6.26M]
  |  Branch (1465:26): [True: 801, False: 4.07k]
  |  Branch (1465:58): [True: 2.71k, False: 6.26M]
  |  Branch (1465:75): [True: 10, False: 2.70k]
  ------------------
 1466|    811|    ti = Exiv2::signedByte;
 1467|    811|  }
 1468|  13.5M|  return ti;
 1469|  13.5M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1471|  7.90M|TiffType toTiffType(TypeId typeId) {
 1472|  7.90M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1472:7): [True: 0, False: 7.90M]
  ------------------
 1473|      0|#ifndef SUPPRESS_WARNINGS
 1474|      0|    EXV_ERROR << "'" << TypeInfo::typeName(typeId) << "' is not a valid Exif (TIFF) type; using type '"
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1475|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1476|      0|#endif
 1477|      0|    return ttUndefined;
 1478|      0|  }
 1479|  7.90M|  return static_cast<TiffType>(typeId);
 1480|  7.90M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1482|  34.4M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1483|  34.4M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1483:7): [True: 26.1M, False: 8.29M]
  ------------------
 1484|  26.1M|    return lhs->tag() < rhs->tag();
 1485|  8.29M|  return lhs->idx() < rhs->idx();
 1486|  34.4M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1488|  5.93M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1489|  5.93M|  return std::make_unique<TiffEntry>(tag, group);
 1490|  5.93M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1492|  41.2k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1493|  41.2k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1494|  41.2k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1496|  4.00M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1497|  4.00M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1498|  4.00M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.75M|  auto atc = [&] {
  474|  1.75M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.72M, False: 28.1k]
  |  Branch (474:33): [True: 42.0k, False: 1.68M]
  ------------------
  475|  42.0k|      return std::move(object);
  476|  42.0k|    }
  477|  1.71M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.75M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.72M|  tc = [&] {
  486|  1.72M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 1.02k, False: 1.72M]
  ------------------
  487|  1.02k|      return this->addNext(std::move(atc));
  488|  1.72M|    return this->addChild(std::move(atc));
  489|  1.72M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  15.0k|  auto tc = [&] {
  509|  15.0k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 15.0k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  15.0k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  15.0k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1038|  3.70k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderEENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEEEEDaRKT_:
 1234|  12.0k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1436|  44.0k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1439|  80.5k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1440|  80.5k|  const TagInfo* tags = [=] {
 1441|  80.5k|    if (group == IfdId::gpsId)
 1442|  80.5k|      return Internal::gpsTagList();
 1443|  80.5k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1444|  80.5k|  }();
 1445|  80.5k|  if (tags)
  ------------------
  |  Branch (1445:7): [True: 10.2k, False: 70.3k]
  ------------------
 1446|   337k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1446:26): [True: 336k, False: 1.15k]
  ------------------
 1447|   336k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1447:11): [True: 9.09k, False: 327k]
  ------------------
 1448|  9.09k|        return tags + idx;
 1449|  71.4k|  return nullptr;
 1450|  80.5k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1440|  80.5k|  const TagInfo* tags = [=] {
 1441|  80.5k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1441:9): [True: 6.25k, False: 74.3k]
  ------------------
 1442|  6.25k|      return Internal::gpsTagList();
 1443|  74.3k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1443:12): [True: 4.00k, False: 70.3k]
  ------------------
 1444|  80.5k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1505|  1.69M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1506|  1.69M|  if (curr < tobe) {
  ------------------
  |  Branch (1506:7): [True: 254k, False: 1.43M]
  ------------------
 1507|   254k|    Exiv2::DataBuf buf(tobe - curr);
 1508|   254k|    ioWrapper.write(buf.c_data(), buf.size());
 1509|   254k|    return tobe - curr;
 1510|   254k|  }
 1511|  1.43M|  return 0;
 1512|  1.69M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  13.6M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  13.6M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  44.0M|  [[nodiscard]] uint16_t tag() const {
   82|  44.0M|    return static_cast<uint16_t>(extendedTag_);
   83|  44.0M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  13.7M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  13.7M|    return extendedTag_;
   87|  13.7M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  14.7M|  [[nodiscard]] IfdId group() const {
   90|  14.7M|    return group_;
   91|  14.7M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  10.5M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  10.5M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  7.07M|  void setStart(const byte* pStart) {
  217|  7.07M|    pStart_ = const_cast<byte*>(pStart);
  218|  7.07M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   276M|  [[nodiscard]] uint16_t tag() const {
  241|   276M|    return tag_;
  242|   276M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  42.4M|  [[nodiscard]] IfdId group() const {
  245|  42.4M|    return group_;
  246|  42.4M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  7.25M|  [[nodiscard]] byte* start() const {
  249|  7.25M|    return pStart_;
  250|  7.25M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  4.61M|  void setOffset(size_t offset) {
  417|  4.61M|    offset_ = offset;
  418|  4.61M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.88M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.88M|    return tiffType_;
  460|  1.88M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|   103k|  [[nodiscard]] size_t offset() const {
  466|   103k|    return offset_;
  467|   103k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  4.70M|  [[nodiscard]] const byte* pData() const {
  477|  4.70M|    return pData_;
  478|  4.70M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  31.2M|  [[nodiscard]] const Value* pValue() const {
  481|  31.2M|    return pValue_.get();
  482|  31.2M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.70M|  void setCount(size_t count) {
  498|  1.70M|    count_ = count;
  499|  1.70M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  4.51M|  void setIdx(int idx) {
  502|  4.51M|    idx_ = idx;
  503|  4.51M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  2.26M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  2.26M|    return storage_;
  542|  2.26M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  81.8k|  [[nodiscard]] uint16_t szTag() const {
  624|  81.8k|    return szTag_;
  625|  81.8k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  81.8k|  [[nodiscard]] IfdId szGroup() const {
  628|  81.8k|    return szGroup_;
  629|  81.8k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  94.0k|  [[nodiscard]] uint16_t dtTag() const {
  790|  94.0k|    return dtTag_;
  791|  94.0k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  94.0k|  [[nodiscard]] IfdId dtGroup() const {
  794|  94.0k|    return dtGroup_;
  795|  94.0k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  43.3k|  [[nodiscard]] bool hasNext() const {
  843|  43.3k|    return hasNext_;
  844|  43.3k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  17.1k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  17.1k|    imageByteOrder_ = byteOrder;
 1108|  17.1k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  8.84M|  bool operator==(size_t idx) const {
 1218|  8.84M|    return idx_ == idx;
 1219|  8.84M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  4.25M|  [[nodiscard]] size_t tagStep() const {
 1235|  4.25M|    return elDefaultDef_.size(0, group_);
 1236|  4.25M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  3.95M|  void setDecoded(bool decoded) {
 1311|  3.95M|    decoded_ = decoded;
 1312|  3.95M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  13.2M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  13.2M|    return arrayCfg_;
 1320|  13.2M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   195k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   195k|    return arrayDef_;
 1324|   195k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  99.7k|  [[nodiscard]] size_t defSize() const {
 1327|  99.7k|    return defSize_;
 1328|  99.7k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   306k|  [[nodiscard]] bool decoded() const {
 1331|   306k|    return decoded_;
 1332|   306k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  2.26M|  void setElDef(const ArrayDef& def) {
 1405|  2.26M|    elDef_ = def;
 1406|  2.26M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  2.26M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  2.26M|    elByteOrder_ = byteOrder;
 1412|  2.26M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  2.31M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  2.31M|    return &elDef_;
 1422|  2.31M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  2.32M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  2.32M|    return elByteOrder_;
 1428|  2.32M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  35.1k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  35.1k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  35.1k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     17|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     17|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     17|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__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|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     77|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     77|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     77|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    424|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    424|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    424|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     24|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     24|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     24|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  14.9k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  14.9k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  14.9k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  13.7k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  13.7k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  13.7k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.05k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.05k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.05k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.39k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.39k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.39k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.25k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.25k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.25k|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.47k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.47k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.47k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.1k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.1k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.1k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  15.1k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  15.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  15.1k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.38k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.38k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.38k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  5.84k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  5.84k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  5.84k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.10k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.10k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.10k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.23k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.23k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.23k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.56k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.56k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.56k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  17.1k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  17.1k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  17.1k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  18.4k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  18.4k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  18.4k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.55k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.55k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.55k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.55k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.55k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.55k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    538|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    538|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    538|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.25k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.25k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.25k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.0k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.0k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.0k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  15.9k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  15.9k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  15.9k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.62k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.62k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.62k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    693|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    693|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    693|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    854|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    854|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    854|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.6k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.6k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.6k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  13.0k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  13.0k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  13.0k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    483|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    483|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    483|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    768|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    768|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    768|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    525|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    525|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    525|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.13k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.13k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.13k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.58k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.58k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.58k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    216|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    216|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    216|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    302|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    302|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    302|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    407|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    407|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    407|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    677|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    677|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    677|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.17k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.17k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.17k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.32k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.32k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.32k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    235|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    235|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    235|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    261|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    261|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    261|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    363|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    363|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    363|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    401|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    401|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    401|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.65k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.65k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.65k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.04k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.04k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.04k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    295|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    295|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    295|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    304|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    304|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    304|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    364|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    364|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    364|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    636|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    636|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    636|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.82k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.82k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.82k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.69k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.69k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.69k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    212|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    212|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    212|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    259|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    259|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    259|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    312|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    312|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    312|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    415|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    415|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    415|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    838|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    838|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    838|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    793|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    793|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    793|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    224|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    224|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    224|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    373|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    373|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    373|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     83|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     83|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     83|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    234|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    234|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    234|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    411|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    411|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    411|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    887|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    887|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    887|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    412|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    412|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    412|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    348|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    348|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    348|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    282|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    282|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    282|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    233|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    233|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    233|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    378|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    378|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    378|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.92k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.92k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.92k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  14.1k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  14.1k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  14.1k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  10.9k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  10.9k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  10.9k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    550|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    550|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    550|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    152|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    152|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    152|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     78|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     78|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     78|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    309|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    309|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    309|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    308|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    308|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    308|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    397|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    397|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    397|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    219|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    219|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    219|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     82|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     82|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     82|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    333|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    333|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    333|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    173|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    173|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    173|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    234|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    234|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    234|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    225|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    225|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    225|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     88|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     88|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     88|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    215|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    215|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    215|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  9.26k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  9.26k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  9.26k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  2.48k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  2.48k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  2.48k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    146|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    146|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    146|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.77k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.77k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.77k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    449|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    449|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    449|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    199|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    199|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    199|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    308|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    308|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    308|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    241|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    241|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    241|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    573|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    573|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    573|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    348|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    348|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    348|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    731|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    731|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    731|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    282|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    282|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    282|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.42k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.42k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.42k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    649|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    649|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    649|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    729|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    729|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    729|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.78k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.78k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.78k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.35k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.35k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.35k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.06k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.06k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.06k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.52k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.52k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.52k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    361|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    361|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    361|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  2.36k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  2.36k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  2.36k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  2.36k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    964|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    964|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    964|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    357|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    357|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    357|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    267|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    267|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    267|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     98|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     98|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     98|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    346|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    346|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    346|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    115|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    115|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    115|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    115|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    202|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    202|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    202|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     83|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     83|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     83|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    107|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    107|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    107|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    112|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    112|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    112|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    112|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    159|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    159|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    159|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     62|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     62|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     62|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    193|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    193|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    193|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    174|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    174|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    174|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    167|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    167|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    167|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    455|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    455|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    455|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    352|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    352|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    352|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    352|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    164|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    164|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    164|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    164|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    140|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    140|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    140|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    140|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    502|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    502|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    502|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    502|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    296|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    296|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    296|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    296|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    555|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    555|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    555|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    555|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    484|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    484|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    484|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    484|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    402|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    402|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    402|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    402|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    660|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    660|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    660|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    660|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    280|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    280|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    280|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    280|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    249|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    249|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    249|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    249|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    265|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    265|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    265|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    265|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    138|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    138|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    138|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    138|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     80|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     80|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     80|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    252|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    252|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    252|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    771|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    771|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    771|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.45k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.45k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.45k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    626|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    626|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    626|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.62k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.62k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.62k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  6.35k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  6.35k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  6.35k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  6.35k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.59k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.59k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.59k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  2.39k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  2.39k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  2.39k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  2.07k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  2.07k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  2.07k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    210|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    210|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    210|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    210|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    674|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    674|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    674|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    674|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    231|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    231|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    231|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    231|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  1.02k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  1.02k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  1.02k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  1.02k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    216|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    216|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    216|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    216|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  2.02k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  2.02k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  2.02k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  2.02k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    259|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    259|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    259|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    259|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    156|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    156|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    156|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    377|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    377|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    377|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    377|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    194|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    194|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    194|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    130|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    130|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    130|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    150|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    150|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    150|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    150|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    116|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    116|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    116|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     29|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     29|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     29|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    137|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    137|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    137|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    137|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    306|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    306|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    306|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    306|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    394|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    394|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    394|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     97|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     97|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     97|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     46|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     46|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     46|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     46|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  13.8k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  13.8k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  13.8k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  10.5M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   200k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  66.4k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  34.5k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  17.1M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  17.1M|  return ifdId_ == md.ifdId();
   31|  17.1M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  3.35M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  3.35M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  3.35M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 9.82k, False: 3.34M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  9.82k|    decoderFct = td->decoderFct_;
 1996|  9.82k|  }
 1997|  3.35M|  return decoderFct;
 1998|  3.35M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  3.39M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  3.39M|  EncoderFct encoderFct = nullptr;
 2002|  3.39M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 6.21k, False: 3.38M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  6.21k|    encoderFct = td->encoderFct_;
 2005|  6.21k|  }
 2006|  3.39M|  return encoderFct;
 2007|  3.39M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  10.7M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  10.7M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  10.7M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  10.7M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 10.2M, False: 456k]
  ------------------
 2014|  10.2M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  10.2M|  }
 2016|  10.7M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 10.3M, False: 326k]
  |  Branch (2016:7): [True: 10.3M, False: 356k]
  |  Branch (2016:37): [True: 10.3M, False: 29.6k]
  ------------------
 2017|  10.3M|    return i->second(tag, group);
 2018|  10.3M|  }
 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|   356k|  return nullptr;
 2028|  10.7M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  3.41M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  3.41M|  TiffPath ret;
 2032|  13.6M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 13.6M, Folded]
  ------------------
 2033|  13.6M|    ret.emplace(extendedTag, group);
 2034|  13.6M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  13.6M|    assert(ts != tiffTreeTable_.end());
 2036|  13.6M|    extendedTag = ts->second.second;
 2037|  13.6M|    group = ts->second.first;
 2038|  13.6M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 3.41M, False: 10.2M]
  ------------------
 2039|  3.41M|      break;
 2040|  3.41M|    }
 2041|  13.6M|  }
 2042|  3.41M|  return ret;
 2043|  3.41M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2047|  26.9k|                                   TiffHeaderBase* pHeader) {
 2048|       |  // Create standard TIFF header if necessary
 2049|  26.9k|  std::unique_ptr<TiffHeaderBase> ph;
 2050|  26.9k|  if (!pHeader) {
  ------------------
  |  Branch (2050:7): [True: 12.4k, False: 14.5k]
  ------------------
 2051|  12.4k|    ph = std::make_unique<TiffHeader>();
 2052|  12.4k|    pHeader = ph.get();
 2053|  12.4k|  }
 2054|       |
 2055|  26.9k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2055:12): [True: 26.1k, False: 839]
  ------------------
 2056|  26.1k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2057|  26.1k|    rootDir->accept(decoder);
 2058|  26.1k|  }
 2059|  26.9k|  return pHeader->byteOrder();
 2060|       |
 2061|  26.9k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2066|  17.8k|                                     OffsetWriter* pOffsetWriter) {
 2067|       |  /*
 2068|       |     1) parse the binary image, if one is provided, and
 2069|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2070|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2071|       |        writing"). If there is a parsed tree, it is only used to access the
 2072|       |        image data in this case.
 2073|       |   */
 2074|  17.8k|  WriteMethod writeMethod = wmIntrusive;
 2075|  17.8k|  auto parsedTree = parse(pData, size, root, pHeader);
 2076|  17.8k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2077|  17.8k|  if (parsedTree) {
  ------------------
  |  Branch (2077:7): [True: 6.41k, False: 11.4k]
  ------------------
 2078|       |    // Attempt to update existing TIFF components based on metadata entries
 2079|  6.41k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2080|  6.41k|    parsedTree->accept(encoder);
 2081|  6.41k|    if (!encoder.dirty())
  ------------------
  |  Branch (2081:9): [True: 862, False: 5.55k]
  ------------------
 2082|    862|      writeMethod = wmNonIntrusive;
 2083|  6.41k|  }
 2084|  17.8k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2084:7): [True: 17.0k, False: 866]
  ------------------
 2085|  17.0k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2086|  17.0k|    if (parsedTree) {
  ------------------
  |  Branch (2086:9): [True: 5.55k, False: 11.4k]
  ------------------
 2087|       |      // Copy image tags from the original image to the composite
 2088|  5.55k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2089|  5.55k|      parsedTree->accept(copier);
 2090|  5.55k|    }
 2091|       |    // Add entries from metadata to composite
 2092|  17.0k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2093|  17.0k|                        findEncoderFct);
 2094|  17.0k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2095|       |    // Write binary representation from the composite tree
 2096|  17.0k|    DataBuf header = pHeader->write();
 2097|  17.0k|    auto tempIo = MemIo();
 2098|  17.0k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2099|  17.0k|    auto imageIdx(std::string::npos);
 2100|  17.0k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2101|  17.0k|    if (pOffsetWriter)
  ------------------
  |  Branch (2101:9): [True: 140, False: 16.8k]
  ------------------
 2102|    140|      pOffsetWriter->writeOffsets(tempIo);
 2103|  17.0k|    io.transfer(tempIo);  // may throw
 2104|  17.0k|#ifndef SUPPRESS_WARNINGS
 2105|  17.0k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  17.0k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 17.0k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  17.0k|  LogMsg(LogMsg::info).os()
  ------------------
 2106|  17.0k|#endif
 2107|  17.0k|  }
 2108|    866|#ifndef SUPPRESS_WARNINGS
 2109|    866|  else {
 2110|    866|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    866|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 866]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    866|  LogMsg(LogMsg::info).os()
  ------------------
 2111|    866|  }
 2112|  17.8k|#endif
 2113|  17.8k|  return writeMethod;
 2114|  17.8k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2117|  44.8k|                                                 TiffHeaderBase* pHeader) {
 2118|  44.8k|  TiffComponent::UniquePtr rootDir;
 2119|  44.8k|  if (!pData || size == 0)
  ------------------
  |  Branch (2119:7): [True: 11.6k, False: 33.1k]
  |  Branch (2119:17): [True: 0, False: 33.1k]
  ------------------
 2120|  11.6k|    return rootDir;
 2121|  33.1k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2121:7): [True: 265, False: 32.9k]
  |  Branch (2121:38): [True: 347, False: 32.5k]
  ------------------
 2122|    612|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2123|    612|  }
 2124|  32.5k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2125|  32.5k|  if (rootDir) {
  ------------------
  |  Branch (2125:7): [True: 32.5k, False: 0]
  ------------------
 2126|  32.5k|    rootDir->setStart(pData + pHeader->offset());
 2127|  32.5k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2128|  32.5k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2129|  32.5k|    rootDir->accept(reader);
 2130|  32.5k|    reader.postProcess();
 2131|  32.5k|  }
 2132|  32.5k|  return rootDir;
 2133|       |
 2134|  33.1k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2136|  17.8k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2137|  17.8k|  PrimaryGroups ret;
 2138|  17.8k|  if (!pSourceDir)
  ------------------
  |  Branch (2138:7): [True: 11.4k, False: 6.41k]
  ------------------
 2139|  11.4k|    return ret;
 2140|       |
 2141|  6.41k|  static constexpr auto imageGroups = std::array{
 2142|  6.41k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2143|  6.41k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2144|  6.41k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2145|  6.41k|  };
 2146|       |
 2147|  83.4k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2147:24): [True: 83.4k, False: 6.41k]
  ------------------
 2148|  83.4k|    TiffFinder finder(0x00fe, imageGroup);
 2149|  83.4k|    pSourceDir->accept(finder);
 2150|  83.4k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2151|  83.4k|    if (!te)
  ------------------
  |  Branch (2151:9): [True: 82.1k, False: 1.31k]
  ------------------
 2152|  82.1k|      continue;
 2153|  1.31k|    const Value* pV = te->pValue();
 2154|  1.31k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2154:9): [True: 1.15k, False: 159]
  |  Branch (2154:15): [True: 988, False: 165]
  |  Branch (2154:47): [True: 902, False: 86]
  |  Branch (2154:67): [True: 809, False: 93]
  ------------------
 2155|    809|      ret.push_back(te->group());
 2156|    809|    }
 2157|  1.31k|  }
 2158|  6.41k|  return ret;
 2159|  17.8k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2162|   548k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2163|   548k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2165|   445k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2166|   445k|  if (!pData || size < 8)
  ------------------
  |  Branch (2166:7): [True: 0, False: 445k]
  |  Branch (2166:17): [True: 61, False: 445k]
  ------------------
 2167|     61|    return false;
 2168|       |
 2169|   445k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2169:7): [True: 13.2k, False: 432k]
  |  Branch (2169:26): [True: 12.3k, False: 886]
  ------------------
 2170|  12.3k|    byteOrder_ = littleEndian;
 2171|   433k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2171:14): [True: 174k, False: 258k]
  |  Branch (2171:33): [True: 174k, False: 958]
  ------------------
 2172|   174k|    byteOrder_ = bigEndian;
 2173|   259k|  } else {
 2174|   259k|    return false;
 2175|   259k|  }
 2176|   186k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2177|   186k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2177:7): [True: 186k, False: 34]
  |  Branch (2177:19): [True: 186k, False: 79]
  |  Branch (2177:33): [True: 72.6k, False: 113k]
  ------------------
 2178|  72.6k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2179|   113k|  tag_ = t;
 2180|   113k|  offset_ = getULong(pData + 4, byteOrder_);
 2181|       |
 2182|   113k|  return true;
 2183|   186k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2185|  17.3k|DataBuf TiffHeaderBase::write() const {
 2186|  17.3k|  DataBuf buf(8);
 2187|  17.3k|  switch (byteOrder_) {
  ------------------
  |  Branch (2187:11): [True: 17.3k, False: 0]
  ------------------
 2188|  12.3k|    case littleEndian:
  ------------------
  |  Branch (2188:5): [True: 12.3k, False: 5.04k]
  ------------------
 2189|  12.3k|      buf.write_uint8(0, 'I');
 2190|  12.3k|      break;
 2191|  5.04k|    case bigEndian:
  ------------------
  |  Branch (2191:5): [True: 5.04k, False: 12.3k]
  ------------------
 2192|  5.04k|      buf.write_uint8(0, 'M');
 2193|  5.04k|      break;
 2194|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2194:5): [True: 0, False: 17.3k]
  ------------------
 2195|      0|      break;
 2196|  17.3k|  }
 2197|  17.3k|  buf.write_uint8(1, buf.read_uint8(0));
 2198|  17.3k|  buf.write_uint16(2, tag_, byteOrder_);
 2199|  17.3k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2200|  17.3k|  return buf;
 2201|  17.3k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2219|   141k|ByteOrder TiffHeaderBase::byteOrder() const {
 2220|   141k|  return byteOrder_;
 2221|   141k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2223|  26.9k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2224|  26.9k|  byteOrder_ = byteOrder;
 2225|  26.9k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2227|  66.4k|uint32_t TiffHeaderBase::offset() const {
 2228|  66.4k|  return offset_;
 2229|  66.4k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2231|  11.4k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2232|  11.4k|  offset_ = offset;
 2233|  11.4k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2239|  28.1k|uint16_t TiffHeaderBase::tag() const {
 2240|  28.1k|  return tag_;
 2241|  28.1k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2243|  1.23k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2244|  1.23k|  return false;
 2245|  1.23k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2325|  3.64M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2326|  3.64M|  const bool result = isTiffImageTagLookup(tag, group);
 2327|       |#ifdef EXIV2_DEBUG_MESSAGES
 2328|       |  if (result) {
 2329|       |    ExifKey key(tag, groupName(group));
 2330|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2331|       |  } else {
 2332|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2333|       |  }
 2334|       |#endif
 2335|  3.64M|  return result;
 2336|  3.64M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2339|   366k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2340|   366k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2342|  3.65M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2343|  3.65M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2343:7): [True: 86.6k, False: 3.56M]
  ------------------
 2344|       |#ifdef EXIV2_DEBUG_MESSAGES
 2345|       |    std::cerr << "No image tags in this image\n";
 2346|       |#endif
 2347|  86.6k|    return false;
 2348|  86.6k|  }
 2349|       |#ifdef EXIV2_DEBUG_MESSAGES
 2350|       |  ExifKey key(tag, groupName(group));
 2351|       |#endif
 2352|       |  // If there are primary groups and none matches group, we're done
 2353|  3.56M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2353:7): [True: 56.7k, False: 3.51M]
  |  Branch (2353:7): [True: 16.7k, False: 3.55M]
  ------------------
 2354|  56.7k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2354:7): [True: 16.7k, False: 39.9k]
  ------------------
 2355|       |#ifdef EXIV2_DEBUG_MESSAGES
 2356|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2357|       |#endif
 2358|  16.7k|    return false;
 2359|  16.7k|  }
 2360|       |  // All tags of marked primary groups other than IFD0 are considered
 2361|       |  // image tags. That should take care of NEFs until we know better.
 2362|  3.55M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2362:7): [True: 39.9k, False: 3.51M]
  |  Branch (2362:34): [True: 39.1k, False: 820]
  ------------------
 2363|       |#ifdef EXIV2_DEBUG_MESSAGES
 2364|       |    ExifKey key(tag, groupName(group));
 2365|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2366|       |#endif
 2367|  39.1k|    return true;
 2368|  39.1k|  }
 2369|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2370|  3.51M|  return isTiffImageTag(tag, group);
 2371|  3.55M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2373|    178|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2374|    178|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2375|    178|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2377|     13|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2378|     13|  auto it = offsetList_.find(id);
 2379|     13|  if (it != offsetList_.end())
  ------------------
  |  Branch (2379:7): [True: 13, False: 0]
  ------------------
 2380|     13|    it->second.target_ = target;
 2381|     13|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2383|    140|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2384|    140|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2384:29): [True: 140, False: 140]
  ------------------
 2385|    140|    io.seek(off.origin_, BasicIo::beg);
 2386|    140|    byte buf[4] = {0, 0, 0, 0};
 2387|    140|    l2Data(buf, off.target_, off.byteOrder_);
 2388|    140|    io.write(buf, 4);
 2389|    140|  }
 2390|    140|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2247|  3.64M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2248|  3.64M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2248:7): [True: 3.14M, False: 501k]
  ------------------
 2249|  3.14M|    return false;
 2250|  3.14M|  }
 2251|       |  //! List of TIFF image tags
 2252|   501k|  switch (tag) {
 2253|    753|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2253:5): [True: 753, False: 500k]
  ------------------
 2254|  1.84k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2254:5): [True: 1.09k, False: 500k]
  ------------------
 2255|  12.1k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2255:5): [True: 10.3k, False: 491k]
  ------------------
 2256|  19.7k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2256:5): [True: 7.57k, False: 494k]
  ------------------
 2257|  23.5k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2257:5): [True: 3.77k, False: 497k]
  ------------------
 2258|  24.1k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2258:5): [True: 643, False: 500k]
  ------------------
 2259|  24.4k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2259:5): [True: 283, False: 501k]
  ------------------
 2260|  24.5k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2260:5): [True: 105, False: 501k]
  ------------------
 2261|  28.2k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2261:5): [True: 3.66k, False: 497k]
  ------------------
 2262|  28.4k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2262:5): [True: 242, False: 501k]
  ------------------
 2263|  28.9k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2263:5): [True: 447, False: 501k]
  ------------------
 2264|  32.4k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2264:5): [True: 3.53k, False: 498k]
  ------------------
 2265|  32.9k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2265:5): [True: 461, False: 501k]
  ------------------
 2266|  33.3k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2266:5): [True: 429, False: 501k]
  ------------------
 2267|  33.6k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2267:5): [True: 308, False: 501k]
  ------------------
 2268|  33.7k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2268:5): [True: 81, False: 501k]
  ------------------
 2269|  33.7k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2269:5): [True: 78, False: 501k]
  ------------------
 2270|  34.0k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2270:5): [True: 212, False: 501k]
  ------------------
 2271|  34.5k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2271:5): [True: 500, False: 501k]
  ------------------
 2272|  34.8k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2272:5): [True: 317, False: 501k]
  ------------------
 2273|  35.1k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2273:5): [True: 337, False: 501k]
  ------------------
 2274|  35.3k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2274:5): [True: 170, False: 501k]
  ------------------
 2275|  35.4k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2275:5): [True: 139, False: 501k]
  ------------------
 2276|  35.5k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2276:5): [True: 80, False: 501k]
  ------------------
 2277|  35.8k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2277:5): [True: 308, False: 501k]
  ------------------
 2278|  36.2k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2278:5): [True: 367, False: 501k]
  ------------------
 2279|  36.4k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2279:5): [True: 194, False: 501k]
  ------------------
 2280|  36.6k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2280:5): [True: 206, False: 501k]
  ------------------
 2281|  36.7k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2281:5): [True: 82, False: 501k]
  ------------------
 2282|  37.3k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2282:5): [True: 656, False: 500k]
  ------------------
 2283|  39.3k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2283:5): [True: 1.94k, False: 499k]
  ------------------
 2284|  39.3k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2284:5): [True: 86, False: 501k]
  ------------------
 2285|  39.4k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2285:5): [True: 89, False: 501k]
  ------------------
 2286|  39.5k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2286:5): [True: 90, False: 501k]
  ------------------
 2287|  39.8k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2287:5): [True: 289, False: 501k]
  ------------------
 2288|  39.9k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2288:5): [True: 65, False: 501k]
  ------------------
 2289|  40.1k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2289:5): [True: 212, False: 501k]
  ------------------
 2290|  40.3k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2290:5): [True: 245, False: 501k]
  ------------------
 2291|  40.4k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2291:5): [True: 101, False: 501k]
  ------------------
 2292|  40.8k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2292:5): [True: 323, False: 501k]
  ------------------
 2293|  41.0k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2293:5): [True: 228, False: 501k]
  ------------------
 2294|  41.1k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2294:5): [True: 83, False: 501k]
  ------------------
 2295|  41.4k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 325, False: 501k]
  ------------------
 2296|  41.5k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2296:5): [True: 108, False: 501k]
  ------------------
 2297|  41.8k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2297:5): [True: 289, False: 501k]
  ------------------
 2298|  42.0k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2298:5): [True: 232, False: 501k]
  ------------------
 2299|  43.6k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2299:5): [True: 1.56k, False: 500k]
  ------------------
 2300|  52.7k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2300:5): [True: 9.08k, False: 492k]
  ------------------
 2301|  63.7k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2301:5): [True: 11.0k, False: 490k]
  ------------------
 2302|  64.0k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2302:5): [True: 294, False: 501k]
  ------------------
 2303|  64.1k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2303:5): [True: 89, False: 501k]
  ------------------
 2304|  64.3k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2304:5): [True: 224, False: 501k]
  ------------------
 2305|  64.4k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2305:5): [True: 81, False: 501k]
  ------------------
 2306|  64.6k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2306:5): [True: 222, False: 501k]
  ------------------
 2307|  64.8k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2307:5): [True: 147, False: 501k]
  ------------------
 2308|  65.0k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2308:5): [True: 263, False: 501k]
  ------------------
 2309|  65.5k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2309:5): [True: 484, False: 501k]
  ------------------
 2310|  65.7k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2310:5): [True: 231, False: 501k]
  ------------------
 2311|  66.1k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2311:5): [True: 418, False: 501k]
  ------------------
 2312|  66.2k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2312:5): [True: 100, False: 501k]
  ------------------
 2313|  66.3k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2313:5): [True: 38, False: 501k]
  ------------------
 2314|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2315|  66.3k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2315:5): [True: 23, False: 501k]
  ------------------
 2316|  66.4k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2316:5): [True: 82, False: 501k]
  ------------------
 2317|  66.5k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2317:5): [True: 124, False: 501k]
  ------------------
 2318|  66.6k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2318:5): [True: 69, False: 501k]
  ------------------
 2319|  66.6k|      return true;
 2320|   434k|    default:
  ------------------
  |  Branch (2320:5): [True: 434k, False: 66.6k]
  ------------------
 2321|   434k|      return false;
 2322|   501k|  }
 2323|   501k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   96|  12.7M|size_t TypeInfo::typeSize(TypeId typeId) {
   97|  12.7M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (97:12): [True: 8.62M, False: 4.16M]
  ------------------
   98|  8.62M|    return tit->size_;
   99|  4.16M|  return 0;
  100|  12.7M|}
_ZN5Exiv27DataBufC2Em:
  102|  6.05M|DataBuf::DataBuf(size_t size) : pData_(size) {
  103|  6.05M|}
_ZN5Exiv27DataBufC2EPKhm:
  105|  91.0k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
  106|  91.0k|}
_ZN5Exiv27DataBuf5allocEm:
  108|  36.6k|void DataBuf::alloc(size_t size) {
  109|  36.6k|  pData_.resize(size);
  110|  36.6k|}
_ZN5Exiv27DataBuf6resizeEm:
  112|   146k|void DataBuf::resize(size_t size) {
  113|   146k|  pData_.resize(size);
  114|   146k|}
_ZN5Exiv27DataBuf5resetEv:
  116|  52.4k|void DataBuf::reset() {
  117|  52.4k|  pData_.clear();
  118|  52.4k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  120|  2.62M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  121|  2.62M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (121:7): [True: 0, False: 2.62M]
  ------------------
  122|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  123|      0|  }
  124|  2.62M|  return pData_[offset];
  125|  2.62M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  127|  1.05M|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  128|  1.05M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 1.05M]
  ------------------
  129|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  130|      0|  }
  131|  1.05M|  pData_[offset] = x;
  132|  1.05M|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  134|   477k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  135|   477k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 477k]
  |  Branch (135:28): [True: 3, False: 477k]
  ------------------
  136|      3|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  137|      3|  }
  138|   477k|  return getUShort(&pData_[offset], byteOrder);
  139|   477k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  141|  17.7k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  142|  17.7k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 17.7k]
  |  Branch (142:28): [True: 0, False: 17.7k]
  ------------------
  143|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  144|      0|  }
  145|  17.7k|  us2Data(&pData_[offset], x, byteOrder);
  146|  17.7k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  148|   391k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  149|   391k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (149:7): [True: 1, False: 391k]
  |  Branch (149:28): [True: 1, False: 391k]
  ------------------
  150|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  151|      2|  }
  152|   391k|  return getULong(&pData_[offset], byteOrder);
  153|   391k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  155|  17.6k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  156|  17.6k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (156:7): [True: 0, False: 17.6k]
  |  Branch (156:28): [True: 0, False: 17.6k]
  ------------------
  157|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  158|      0|  }
  159|  17.6k|  ul2Data(&pData_[offset], x, byteOrder);
  160|  17.6k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  162|  13.2k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  163|  13.2k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (163:7): [True: 0, False: 13.2k]
  |  Branch (163:28): [True: 0, False: 13.2k]
  ------------------
  164|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  165|      0|  }
  166|  13.2k|  return getULongLong(&pData_[offset], byteOrder);
  167|  13.2k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  176|   543k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  177|   543k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (177:7): [True: 0, False: 543k]
  |  Branch (177:34): [True: 0, False: 543k]
  ------------------
  178|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  179|      0|  }
  180|   543k|  return memcmp(&pData_[offset], buf, bufsize);
  181|   543k|}
_ZN5Exiv27DataBuf4dataEm:
  183|  7.29M|byte* Exiv2::DataBuf::data(size_t offset) {
  184|  7.29M|  return const_cast<byte*>(c_data(offset));
  185|  7.29M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  187|  9.95M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  188|  9.95M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (188:7): [True: 1.07M, False: 8.88M]
  |  Branch (188:25): [True: 9.71k, False: 8.87M]
  ------------------
  189|  1.08M|    return nullptr;
  190|  1.08M|  }
  191|  8.87M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (191:7): [True: 0, False: 8.87M]
  ------------------
  192|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  193|      0|  }
  194|  8.87M|  return &pData_[offset];
  195|  8.87M|}
_ZNK5Exiv27DataBuf5c_strEm:
  197|  71.9k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  198|  71.9k|  return reinterpret_cast<const char*>(c_data(offset));
  199|  71.9k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  220|  11.0k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  221|  11.0k|  return os << r.first << "/" << r.second;
  222|  11.0k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  249|  82.5k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  250|  82.5k|  return os << r.first << "/" << r.second;
  251|  82.5k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  257|  48.3M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  258|  48.3M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  259|  48.3M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  261|  48.3M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  262|  48.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (262:7): [True: 637k, False: 47.6M]
  ------------------
  263|   637k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  264|   637k|  }
  265|  47.6M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  266|  48.3M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  268|  64.5k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  269|  64.5k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (269:7): [True: 12.9k, False: 51.5k]
  ------------------
  270|  12.9k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  271|  12.9k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  272|  12.9k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  273|  12.9k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  274|  12.9k|  }
  275|  51.5k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  276|  51.5k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  277|  51.5k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  278|  51.5k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  279|  64.5k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  281|   484k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  282|   484k|  uint32_t nominator = getULong(buf, byteOrder);
  283|   484k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  284|   484k|  return {nominator, denominator};
  285|   484k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  287|   601k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  288|   601k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (288:7): [True: 1.19k, False: 600k]
  ------------------
  289|  1.19k|    return buf[1] << 8 | buf[0];
  290|  1.19k|  }
  291|   600k|  return buf[0] << 8 | buf[1];
  292|   601k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  294|  1.44M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  295|  1.44M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (295:7): [True: 6.79k, False: 1.44M]
  ------------------
  296|  6.79k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  297|  6.79k|  }
  298|  1.44M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  299|  1.44M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  301|   427k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  302|   427k|  int32_t nominator = getLong(buf, byteOrder);
  303|   427k|  int32_t denominator = getLong(buf + 4, byteOrder);
  304|   427k|  return {nominator, denominator};
  305|   427k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  307|   210k|float getFloat(const byte* buf, ByteOrder byteOrder) {
  308|       |  // This algorithm assumes that the internal representation of the float
  309|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  310|       |  // required by the C++ standard.
  311|   210k|#ifdef __cpp_lib_bit_cast
  312|   210k|  return std::bit_cast<float>(getULong(buf, byteOrder));
  313|       |#else
  314|       |  union {
  315|       |    uint32_t ul_;
  316|       |    float f_;
  317|       |  } u;
  318|       |  u.ul_ = getULong(buf, byteOrder);
  319|       |  return u.f_;
  320|       |#endif
  321|   210k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  323|   517k|double getDouble(const byte* buf, ByteOrder byteOrder) {
  324|       |  // This algorithm assumes that the internal representation of the double
  325|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  326|       |  // required by the C++ standard.
  327|   517k|#ifdef __cpp_lib_bit_cast
  328|   517k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (328:7): [True: 169k, False: 347k]
  ------------------
  329|   169k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  330|   169k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  331|   169k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  332|   169k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  333|   347k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  334|   347k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  335|   347k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  336|   347k|                               static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]));
  337|       |#else
  338|       |  union {
  339|       |    uint64_t ull_;
  340|       |    double d_;
  341|       |  } u;
  342|       |  u.ull_ = 0;
  343|       |  if (byteOrder == littleEndian) {
  344|       |    u.ull_ = static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  345|       |             static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  346|       |             static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  347|       |             static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  348|       |  } else {
  349|       |    u.ull_ = static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  350|       |             static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  351|       |             static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  352|       |             static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  353|       |  }
  354|       |  return u.d_;
  355|       |#endif
  356|   517k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  358|  4.18M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  359|  4.18M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (359:7): [True: 3.09M, False: 1.09M]
  ------------------
  360|  3.09M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  361|  3.09M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  362|  3.09M|  } else {
  363|  1.09M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  364|  1.09M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  365|  1.09M|  }
  366|  4.18M|  return 2;
  367|  4.18M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  369|  4.76M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  370|  4.76M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (370:7): [True: 2.41M, False: 2.35M]
  ------------------
  371|  2.41M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  372|  2.41M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  373|  2.41M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  374|  2.41M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  375|  2.41M|  } else {
  376|  2.35M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  377|  2.35M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  378|  2.35M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  379|  2.35M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  380|  2.35M|  }
  381|  4.76M|  return 4;
  382|  4.76M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  399|   346k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  400|   346k|  size_t o = ul2Data(buf, l.first, byteOrder);
  401|   346k|  o += ul2Data(buf + o, l.second, byteOrder);
  402|   346k|  return o;
  403|   346k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  405|   561k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  406|   561k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (406:7): [True: 52.0k, False: 509k]
  ------------------
  407|  52.0k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  408|  52.0k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  409|   509k|  } else {
  410|   509k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  411|   509k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  412|   509k|  }
  413|   561k|  return 2;
  414|   561k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  416|  1.24M|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  417|  1.24M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (417:7): [True: 170k, False: 1.07M]
  ------------------
  418|   170k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  419|   170k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  420|   170k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  421|   170k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  422|  1.07M|  } else {
  423|  1.07M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  424|  1.07M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  425|  1.07M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  426|  1.07M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  427|  1.07M|  }
  428|  1.24M|  return 4;
  429|  1.24M|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  431|   404k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  432|   404k|  size_t o = l2Data(buf, l.first, byteOrder);
  433|   404k|  o += l2Data(buf + o, l.second, byteOrder);
  434|   404k|  return o;
  435|   404k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  437|   173k|size_t f2Data(byte* buf, float f, ByteOrder byteOrder) {
  438|       |  // This algorithm assumes that the internal representation of the float
  439|       |  // type is the 4-byte IEEE 754 binary32 format, which is common but not
  440|       |  // required by the C++ standard.
  441|   173k|#ifdef __cpp_lib_bit_cast
  442|   173k|  return ul2Data(buf, std::bit_cast<uint32_t>(f), byteOrder);
  443|       |#else
  444|       |  union {
  445|       |    uint32_t ul_;
  446|       |    float f_;
  447|       |  } u;
  448|       |  u.f_ = f;
  449|       |  return ul2Data(buf, u.ul_, byteOrder);
  450|       |#endif
  451|   173k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  453|   214k|size_t d2Data(byte* buf, double d, ByteOrder byteOrder) {
  454|       |  // This algorithm assumes that the internal representation of the double
  455|       |  // type is the 8-byte IEEE 754 binary64 format, which is common but not
  456|       |  // required by the C++ standard.
  457|   214k|  union {
  458|   214k|    uint64_t ull_;
  459|   214k|    double d_;
  460|   214k|  } u;
  461|   214k|  u.d_ = d;
  462|   214k|  uint64_t m = 0xff;
  463|   214k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (463:7): [True: 208k, False: 5.74k]
  ------------------
  464|   208k|    buf[0] = static_cast<byte>(u.ull_ & m);
  465|   208k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  466|   208k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  467|   208k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   208k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  469|   208k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  470|   208k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  471|   208k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  472|   208k|  } else {
  473|  5.74k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  474|  5.74k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  475|  5.74k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  476|  5.74k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  477|  5.74k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  478|  5.74k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  479|  5.74k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  480|  5.74k|    buf[7] = static_cast<byte>(u.ull_ & m);
  481|  5.74k|  }
  482|   214k|  return 8;
  483|   214k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  512|   159k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  513|   159k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (513:7): [True: 0, False: 159k]
  ------------------
  514|      0|    return false;
  515|   159k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (515:7): [True: 159k, False: 0]
  |  Branch (515:19): [True: 0, False: 159k]
  ------------------
  516|      0|    return false;
  517|       |
  518|   159k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  519|   159k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  521|     10|int exifTime(const char* buf, tm* tm) {
  522|     10|  int rc = 1;
  523|     10|  int year = 0;
  524|     10|  int mon = 0;
  525|     10|  int mday = 0;
  526|     10|  int hour = 0;
  527|     10|  int min = 0;
  528|     10|  int sec = 0;
  529|     10|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (529:7): [True: 7, False: 3]
  ------------------
  530|      7|    tm->tm_year = year - 1900;
  531|      7|    tm->tm_mon = mon - 1;
  532|      7|    tm->tm_mday = mday;
  533|      7|    tm->tm_hour = hour;
  534|      7|    tm->tm_min = min;
  535|      7|    tm->tm_sec = sec;
  536|      7|    rc = 0;
  537|      7|  }
  538|     10|  return rc;
  539|     10|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  667|    354|Rational floatToRationalCast(float f) {
  668|       |  // Convert f to double because it simplifies the range checks
  669|       |  // below. (All int values can be losslessly converted to double, but
  670|       |  // sometimes get rounded when converted to float.)
  671|    354|  const double d = f;
  672|       |  // Beware: primitive conversion algorithm
  673|    354|  int32_t den;
  674|    354|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (674:7): [True: 237, False: 117]
  ------------------
  675|    237|    den = 1000000;
  676|    237|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (676:14): [True: 35, False: 82]
  ------------------
  677|     35|    den = 10000;
  678|     82|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (678:14): [True: 25, False: 57]
  ------------------
  679|     25|    den = 100;
  680|     57|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (680:14): [True: 20, False: 37]
  ------------------
  681|     20|    den = 1;
  682|     37|  } else {
  683|     37|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (683:13): [True: 37, False: 0]
  ------------------
  684|     37|  }
  685|    317|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  686|    317|  const int32_t g = std::gcd(nom, den);
  687|       |
  688|    317|  return {nom / g, den / g};
  689|    354|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   44|   130M|  bool operator==(Exiv2::TypeId typeId) const {
   45|   130M|    return typeId_ == typeId;
   46|   130M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   20|  6.62M|Value::Value(TypeId typeId) : type_(typeId) {
   21|  6.62M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   23|  4.67M|Value::UniquePtr Value::create(TypeId typeId) {
   24|  4.67M|  switch (typeId) {
   25|      0|    case invalidTypeId:
  ------------------
  |  Branch (25:5): [True: 0, False: 4.67M]
  ------------------
   26|  4.24k|    case signedByte:
  ------------------
  |  Branch (26:5): [True: 4.24k, False: 4.67M]
  ------------------
   27|  1.80M|    case unsignedByte:
  ------------------
  |  Branch (27:5): [True: 1.79M, False: 2.87M]
  ------------------
   28|  1.80M|      return std::make_unique<DataValue>(typeId);
   29|  53.6k|    case asciiString:
  ------------------
  |  Branch (29:5): [True: 53.6k, False: 4.62M]
  ------------------
   30|  53.6k|      return std::make_unique<AsciiValue>();
   31|   515k|    case unsignedShort:
  ------------------
  |  Branch (31:5): [True: 515k, False: 4.15M]
  ------------------
   32|   515k|      return std::make_unique<ValueType<uint16_t>>();
   33|  69.5k|    case unsignedLong:
  ------------------
  |  Branch (33:5): [True: 69.5k, False: 4.60M]
  ------------------
   34|  91.7k|    case tiffIfd:
  ------------------
  |  Branch (34:5): [True: 22.1k, False: 4.65M]
  ------------------
   35|  91.7k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   36|  13.5k|    case unsignedRational:
  ------------------
  |  Branch (36:5): [True: 13.5k, False: 4.66M]
  ------------------
   37|  13.5k|      return std::make_unique<ValueType<URational>>();
   38|  71.2k|    case undefined:
  ------------------
  |  Branch (38:5): [True: 71.2k, False: 4.60M]
  ------------------
   39|  71.2k|      return std::make_unique<DataValue>();
   40|  47.5k|    case signedShort:
  ------------------
  |  Branch (40:5): [True: 47.5k, False: 4.62M]
  ------------------
   41|  47.5k|      return std::make_unique<ValueType<int16_t>>();
   42|  43.5k|    case signedLong:
  ------------------
  |  Branch (42:5): [True: 43.5k, False: 4.63M]
  ------------------
   43|  43.5k|      return std::make_unique<ValueType<int32_t>>();
   44|  14.7k|    case signedRational:
  ------------------
  |  Branch (44:5): [True: 14.7k, False: 4.66M]
  ------------------
   45|  14.7k|      return std::make_unique<ValueType<Rational>>();
   46|  8.76k|    case tiffFloat:
  ------------------
  |  Branch (46:5): [True: 8.76k, False: 4.66M]
  ------------------
   47|  8.76k|      return std::make_unique<ValueType<float>>();
   48|  15.3k|    case tiffDouble:
  ------------------
  |  Branch (48:5): [True: 15.3k, False: 4.65M]
  ------------------
   49|  15.3k|      return std::make_unique<ValueType<double>>();
   50|  56.4k|    case string:
  ------------------
  |  Branch (50:5): [True: 56.4k, False: 4.61M]
  ------------------
   51|  56.4k|      return std::make_unique<StringValue>();
   52|  8.81k|    case date:
  ------------------
  |  Branch (52:5): [True: 8.81k, False: 4.66M]
  ------------------
   53|  8.81k|      return std::make_unique<DateValue>();
   54|  10.4k|    case time:
  ------------------
  |  Branch (54:5): [True: 10.4k, False: 4.66M]
  ------------------
   55|  10.4k|      return std::make_unique<TimeValue>();
   56|  5.93k|    case comment:
  ------------------
  |  Branch (56:5): [True: 5.93k, False: 4.66M]
  ------------------
   57|  5.93k|      return std::make_unique<CommentValue>();
   58|  62.0k|    case xmpText:
  ------------------
  |  Branch (58:5): [True: 62.0k, False: 4.61M]
  ------------------
   59|  62.0k|      return std::make_unique<XmpTextValue>();
   60|     13|    case xmpBag:
  ------------------
  |  Branch (60:5): [True: 13, False: 4.67M]
  ------------------
   61|  3.16k|    case xmpSeq:
  ------------------
  |  Branch (61:5): [True: 3.14k, False: 4.67M]
  ------------------
   62|  3.16k|    case xmpAlt:
  ------------------
  |  Branch (62:5): [True: 0, False: 4.67M]
  ------------------
   63|  3.16k|      return std::make_unique<XmpArrayValue>(typeId);
   64|    656|    case langAlt:
  ------------------
  |  Branch (64:5): [True: 656, False: 4.67M]
  ------------------
   65|    656|      return std::make_unique<LangAltValue>();
   66|  1.84M|    default:
  ------------------
  |  Branch (66:5): [True: 1.84M, False: 2.82M]
  ------------------
   67|  1.84M|      return std::make_unique<DataValue>(typeId);
   68|  4.67M|  }
   69|  4.67M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   71|    842|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   72|    842|  return -1;
   73|    842|}
_ZNK5Exiv25Value8toStringEv:
   75|   135k|std::string Value::toString() const {
   76|   135k|  std::ostringstream os;
   77|   135k|  write(os);
   78|   135k|  ok_ = !os.fail();
   79|   135k|  return os.str();
   80|   135k|}
_ZNK5Exiv25Value8toStringEm:
   82|  63.2k|std::string Value::toString(size_t /*n*/) const {
   83|  63.2k|  return toString();
   84|  63.2k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   86|  34.5k|size_t Value::sizeDataArea() const {
   87|  34.5k|  return 0;
   88|  34.5k|}
_ZNK5Exiv25Value8dataAreaEv:
   90|  2.05k|DataBuf Value::dataArea() const {
   91|  2.05k|  return {nullptr, 0};
   92|  2.05k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   94|  3.72M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   95|  3.72M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   97|     14|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   98|     14|  read(buf, len, byteOrder);
   99|     14|}
_ZNK5Exiv29DataValue5countEv:
  101|  12.5M|size_t DataValue::count() const {
  102|  12.5M|  return size();
  103|  12.5M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  105|  3.72M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  106|       |  // byteOrder not needed
  107|  3.72M|  value_.assign(buf, buf + len);
  108|  3.72M|  return 0;
  109|  3.72M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  123|  4.14M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  124|       |  // byteOrder not needed
  125|  4.14M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  126|  4.14M|}
_ZNK5Exiv29DataValue4sizeEv:
  128|  28.7M|size_t DataValue::size() const {
  129|  28.7M|  return value_.size();
  130|  28.7M|}
_ZNK5Exiv29DataValue6clone_Ev:
  132|  13.3M|DataValue* DataValue::clone_() const {
  133|  13.3M|  return new DataValue(*this);
  134|  13.3M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  136|  3.55k|std::ostream& DataValue::write(std::ostream& os) const {
  137|  3.55k|  if (!value_.empty()) {
  ------------------
  |  Branch (137:7): [True: 1.99k, False: 1.55k]
  ------------------
  138|  1.99k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  139|  1.99k|    os << static_cast<int>(value_.back());
  140|  1.99k|  }
  141|  3.55k|  return os;
  142|  3.55k|}
_ZNK5Exiv29DataValue7toInt64Em:
  149|   117k|int64_t DataValue::toInt64(size_t n) const {
  150|   117k|  ok_ = true;
  151|   117k|  return value_.at(n);
  152|   117k|}
_ZNK5Exiv29DataValue8toUint32Em:
  154|  7.46M|uint32_t DataValue::toUint32(size_t n) const {
  155|  7.46M|  ok_ = true;
  156|  7.46M|  return value_.at(n);
  157|  7.46M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  173|  17.8k|int StringValueBase::read(const std::string& buf) {
  174|  17.8k|  value_ = buf;
  175|  17.8k|  return 0;
  176|  17.8k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  178|  95.4k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  179|       |  // byteOrder not needed
  180|  95.4k|  if (buf)
  ------------------
  |  Branch (180:7): [True: 95.4k, False: 0]
  ------------------
  181|  95.4k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  182|  95.4k|  return 0;
  183|  95.4k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  185|  91.5k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  186|  91.5k|  if (value_.empty())
  ------------------
  |  Branch (186:7): [True: 52.1k, False: 39.3k]
  ------------------
  187|  52.1k|    return 0;
  188|       |  // byteOrder not needed
  189|  39.3k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  190|  91.5k|}
_ZNK5Exiv215StringValueBase5countEv:
  192|   110k|size_t StringValueBase::count() const {
  193|   110k|  return size();
  194|   110k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  196|   366k|size_t StringValueBase::size() const {
  197|   366k|  return value_.size();
  198|   366k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  200|  15.0k|std::ostream& StringValueBase::write(std::ostream& os) const {
  201|  15.0k|  return os << value_;
  202|  15.0k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  204|  2.13k|int64_t StringValueBase::toInt64(size_t n) const {
  205|  2.13k|  ok_ = true;
  206|  2.13k|  return static_cast<signed char>(value_.at(n));
  207|  2.13k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  209|  4.37k|uint32_t StringValueBase::toUint32(size_t n) const {
  210|  4.37k|  ok_ = true;
  211|  4.37k|  return static_cast<unsigned char>(value_.at(n));
  212|  4.37k|}
_ZN5Exiv211StringValueC2Ev:
  224|  56.4k|StringValue::StringValue() : StringValueBase(string) {
  225|  56.4k|}
_ZNK5Exiv211StringValue6clone_Ev:
  230|   357k|StringValue* StringValue::clone_() const {
  231|   357k|  return new StringValue(*this);
  232|   357k|}
_ZN5Exiv210AsciiValueC2Ev:
  234|  53.6k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  235|  53.6k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  240|  4.80k|int AsciiValue::read(const std::string& buf) {
  241|  4.80k|  value_ = buf;
  242|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  243|  4.80k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (243:7): [True: 6, False: 4.80k]
  |  Branch (243:25): [True: 4.80k, False: 0]
  ------------------
  244|  4.80k|    value_ += '\0';
  245|  4.80k|  }
  246|  4.80k|  return 0;
  247|  4.80k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  249|   192k|AsciiValue* AsciiValue::clone_() const {
  250|   192k|  return new AsciiValue(*this);
  251|   192k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  253|  35.2k|std::ostream& AsciiValue::write(std::ostream& os) const {
  254|       |  // Write only up to the first '\0' (if any)
  255|  35.2k|  std::string::size_type pos = value_.find_first_of('\0');
  256|  35.2k|  if (pos == std::string::npos)
  ------------------
  |  Branch (256:7): [True: 7.99k, False: 27.2k]
  ------------------
  257|  7.99k|    pos = value_.size();
  258|  35.2k|  return os << value_.substr(0, pos);
  259|  35.2k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  286|  4.83k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  287|  4.83k|  int i = 0;
  288|  20.6k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (288:10): [True: 18.6k, False: 2.03k]
  |  Branch (288:10): [True: 15.8k, False: 4.83k]
  |  Branch (288:58): [True: 15.8k, False: 2.79k]
  ------------------
  289|  15.8k|  }
  290|  4.83k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (290:10): [True: 2.03k, False: 2.79k]
  ------------------
  291|  4.83k|}
_ZN5Exiv212CommentValueC2Ev:
  293|  5.93k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  294|  5.93k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  330|  5.93k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  331|  5.93k|  byteOrder_ = byteOrder;
  332|  5.93k|  return StringValueBase::read(buf, len, byteOrder);
  333|  5.93k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  335|  6.14k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  336|  6.14k|  std::string c = value_;
  337|  6.14k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (337:7): [True: 1.24k, False: 4.90k]
  ------------------
  338|  1.24k|    c = value_.substr(8);
  339|  1.24k|    [[maybe_unused]] const size_t sz = c.size();
  340|  1.24k|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (340:9): [True: 61, False: 1.18k]
  |  Branch (340:39): [True: 0, False: 61]
  ------------------
  341|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  342|  1.24k|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (342:16): [True: 1.18k, False: 61]
  |  Branch (342:43): [True: 94, False: 1.08k]
  ------------------
  343|     94|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  344|     94|    }
  345|  1.24k|    c = value_.substr(0, 8) + c;
  346|  1.24k|  }
  347|  6.14k|  if (c.empty())
  ------------------
  |  Branch (347:7): [True: 1.03k, False: 5.11k]
  ------------------
  348|  1.03k|    return 0;
  349|  5.11k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  350|  6.14k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  382|  6.14k|CommentValue::CharsetId CommentValue::charsetId() const {
  383|  6.14k|  CharsetId charsetId = undefined;
  384|  6.14k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (384:7): [True: 4.83k, False: 1.31k]
  ------------------
  385|  4.83k|    const std::string code = value_.substr(0, 8);
  386|  4.83k|    charsetId = CharsetInfo::charsetIdByCode(code);
  387|  4.83k|  }
  388|  6.14k|  return charsetId;
  389|  6.14k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  411|  16.3k|CommentValue* CommentValue::clone_() const {
  412|  16.3k|  return new CommentValue(*this);
  413|  16.3k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  415|  17.6k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  416|  17.6k|  xmpArrayType_ = xmpArrayType;
  417|  17.6k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  419|  12.1k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  420|  12.1k|  xmpStruct_ = xmpStruct;
  421|  12.1k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  423|   179k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  424|   179k|  return xmpArrayType_;
  425|   179k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  427|  17.2k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  428|  17.2k|  XmpArrayType xa = xaNone;
  429|  17.2k|  switch (typeId) {
  430|    428|    case xmpAlt:
  ------------------
  |  Branch (430:5): [True: 428, False: 16.8k]
  ------------------
  431|    428|      xa = xaAlt;
  432|    428|      break;
  433|    366|    case xmpBag:
  ------------------
  |  Branch (433:5): [True: 366, False: 16.9k]
  ------------------
  434|    366|      xa = xaBag;
  435|    366|      break;
  436|  4.98k|    case xmpSeq:
  ------------------
  |  Branch (436:5): [True: 4.98k, False: 12.3k]
  ------------------
  437|  4.98k|      xa = xaSeq;
  438|  4.98k|      break;
  439|  11.5k|    default:
  ------------------
  |  Branch (439:5): [True: 11.5k, False: 5.78k]
  ------------------
  440|  11.5k|      break;
  441|  17.2k|  }
  442|  17.2k|  return xa;
  443|  17.2k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  445|   184k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  446|   184k|  return xmpStruct_;
  447|   184k|}
_ZN5Exiv212XmpTextValueC2Ev:
  469|   199k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  470|   199k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  476|   886k|int XmpTextValue::read(const std::string& buf) {
  477|       |  // support a type=Alt,Bag,Seq,Struct indicator
  478|   886k|  std::string b = buf;
  479|   886k|  std::string type;
  480|   886k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (480:7): [True: 1.98k, False: 884k]
  ------------------
  481|  1.98k|    std::string::size_type pos = buf.find_first_of(' ');
  482|  1.98k|    type = buf.substr(5, pos - 5);
  483|       |    // Strip quotes (so you can also specify the type without quotes)
  484|  1.98k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (484:9): [True: 1.27k, False: 717]
  |  Branch (484:26): [True: 779, False: 493]
  ------------------
  485|    779|      type = type.substr(1);
  486|  1.98k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (486:9): [True: 1.20k, False: 787]
  |  Branch (486:26): [True: 473, False: 729]
  ------------------
  487|    473|      type.pop_back();
  488|  1.98k|    b.clear();
  489|  1.98k|    if (pos != std::string::npos)
  ------------------
  |  Branch (489:9): [True: 925, False: 1.06k]
  ------------------
  490|    925|      b = buf.substr(pos + 1);
  491|  1.98k|  }
  492|   886k|  if (!type.empty()) {
  ------------------
  |  Branch (492:7): [True: 1.20k, False: 884k]
  ------------------
  493|  1.20k|    if (type == "Alt") {
  ------------------
  |  Branch (493:9): [True: 192, False: 1.01k]
  ------------------
  494|    192|      setXmpArrayType(XmpValue::xaAlt);
  495|  1.01k|    } else if (type == "Bag") {
  ------------------
  |  Branch (495:16): [True: 35, False: 975]
  ------------------
  496|     35|      setXmpArrayType(XmpValue::xaBag);
  497|    975|    } else if (type == "Seq") {
  ------------------
  |  Branch (497:16): [True: 124, False: 851]
  ------------------
  498|    124|      setXmpArrayType(XmpValue::xaSeq);
  499|    851|    } else if (type == "Struct") {
  ------------------
  |  Branch (499:16): [True: 215, False: 636]
  ------------------
  500|    215|      setXmpStruct();
  501|    636|    } else {
  502|    636|      throw Error(ErrorCode::kerInvalidXmpText, type);
  503|    636|    }
  504|  1.20k|  }
  505|   885k|  value_ = std::move(b);
  506|   885k|  return 0;
  507|   886k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  513|  38.1k|size_t XmpTextValue::size() const {
  514|  38.1k|  std::ostringstream os;
  515|  38.1k|  write(os);
  516|  38.1k|  return os.str().size();
  517|  38.1k|}
_ZNK5Exiv212XmpTextValue5countEv:
  519|  38.1k|size_t XmpTextValue::count() const {
  520|  38.1k|  return size();
  521|  38.1k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  523|   107k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  524|   107k|  bool del = false;
  525|   107k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (525:7): [True: 413, False: 107k]
  ------------------
  526|    413|    switch (xmpArrayType()) {
  ------------------
  |  Branch (526:13): [True: 413, False: 0]
  ------------------
  527|     87|      case XmpValue::xaAlt:
  ------------------
  |  Branch (527:7): [True: 87, False: 326]
  ------------------
  528|     87|        os << "type=\"Alt\"";
  529|     87|        break;
  530|      5|      case XmpValue::xaBag:
  ------------------
  |  Branch (530:7): [True: 5, False: 408]
  ------------------
  531|      5|        os << "type=\"Bag\"";
  532|      5|        break;
  533|    321|      case XmpValue::xaSeq:
  ------------------
  |  Branch (533:7): [True: 321, False: 92]
  ------------------
  534|    321|        os << "type=\"Seq\"";
  535|    321|        break;
  536|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (536:7): [True: 0, False: 413]
  ------------------
  537|      0|        break;  // just to suppress the warning
  538|    413|    }
  539|    413|    del = true;
  540|   107k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (540:14): [True: 3.33k, False: 103k]
  ------------------
  541|  3.33k|    switch (xmpStruct()) {
  ------------------
  |  Branch (541:13): [True: 3.33k, False: 0]
  ------------------
  542|  3.33k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (542:7): [True: 3.33k, False: 0]
  ------------------
  543|  3.33k|        os << "type=\"Struct\"";
  544|  3.33k|        break;
  545|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (545:7): [True: 0, False: 3.33k]
  ------------------
  546|      0|        break;  // just to suppress the warning
  547|  3.33k|    }
  548|  3.33k|    del = true;
  549|  3.33k|  }
  550|   107k|  if (del && !value_.empty())
  ------------------
  |  Branch (550:7): [True: 3.74k, False: 103k]
  |  Branch (550:14): [True: 13, False: 3.73k]
  ------------------
  551|     13|    os << " ";
  552|   107k|  return os << value_;
  553|   107k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  571|   417k|XmpTextValue* XmpTextValue::clone_() const {
  572|   417k|  return new XmpTextValue(*this);
  573|   417k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  575|  5.39k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  576|  5.39k|  setXmpArrayType(xmpArrayType(typeId));
  577|  5.39k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  46.9k|int XmpArrayValue::read(const std::string& buf) {
  580|  46.9k|  if (!buf.empty())
  ------------------
  |  Branch (580:7): [True: 44.2k, False: 2.71k]
  ------------------
  581|  44.2k|    value_.push_back(buf);
  582|  46.9k|  return 0;
  583|  46.9k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  589|  22.5k|size_t XmpArrayValue::count() const {
  590|  22.5k|  return value_.size();
  591|  22.5k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  593|    267|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  594|    267|  if (!value_.empty()) {
  ------------------
  |  Branch (594:7): [True: 262, False: 5]
  ------------------
  595|    262|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  596|    262|    os << value_.back();
  597|    262|  }
  598|    267|  return os;
  599|    267|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  601|  57.6k|std::string XmpArrayValue::toString(size_t n) const {
  602|  57.6k|  ok_ = true;
  603|  57.6k|  return value_.at(n);
  604|  57.6k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  622|  9.90k|XmpArrayValue* XmpArrayValue::clone_() const {
  623|  9.90k|  return new XmpArrayValue(*this);
  624|  9.90k|}
_ZN5Exiv212LangAltValueC2Ev:
  626|  2.12k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  627|  2.12k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  633|    672|int LangAltValue::read(const std::string& buf) {
  634|    672|  std::string b = buf;
  635|    672|  std::string lang = "x-default";
  636|    672|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (636:7): [True: 230, False: 442]
  ------------------
  637|    230|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  638|       |
  639|    230|    const std::string::size_type pos = buf.find_first_of(' ');
  640|    230|    if (pos == std::string::npos) {
  ------------------
  |  Branch (640:9): [True: 61, False: 169]
  ------------------
  641|     61|      lang = buf.substr(5);
  642|    169|    } else {
  643|    169|      lang = buf.substr(5, pos - 5);
  644|    169|    }
  645|    230|    if (lang.empty())
  ------------------
  |  Branch (645:9): [True: 3, False: 227]
  ------------------
  646|      3|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  647|       |    // Strip quotes (so you can also specify the language without quotes)
  648|    227|    if (lang.front() == '"') {
  ------------------
  |  Branch (648:9): [True: 64, False: 163]
  ------------------
  649|     64|      lang = lang.substr(1);
  650|       |
  651|     64|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (651:11): [True: 1, False: 63]
  |  Branch (651:27): [True: 38, False: 25]
  ------------------
  652|     39|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  653|       |
  654|     25|      lang.pop_back();
  655|     25|    }
  656|       |
  657|    188|    if (lang.empty())
  ------------------
  |  Branch (657:9): [True: 1, False: 187]
  ------------------
  658|      1|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  659|       |
  660|       |    // Check language is in the correct format (see https://www.ietf.org/rfc/rfc3066.txt)
  661|    187|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (661:55): [True: 95, False: 92]
  ------------------
  662|     95|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  663|     95|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (663:11): [True: 54, False: 41]
  |  Branch (663:38): [True: 17, False: 24]
  ------------------
  664|     71|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  665|     95|    }
  666|       |
  667|    116|    b.clear();
  668|    116|    if (pos != std::string::npos)
  ------------------
  |  Branch (668:9): [True: 99, False: 17]
  ------------------
  669|     99|      b = buf.substr(pos + 1);
  670|    116|  }
  671|       |
  672|    558|  value_[lang] = std::move(b);
  673|    558|  return 0;
  674|    672|}
_ZNK5Exiv212LangAltValue5countEv:
  680|    777|size_t LangAltValue::count() const {
  681|    777|  return value_.size();
  682|    777|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  684|    354|std::ostream& LangAltValue::write(std::ostream& os) const {
  685|    354|  bool first = true;
  686|       |
  687|       |  // Write the default entry first
  688|    354|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (688:42): [True: 0, False: 354]
  ------------------
  689|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  690|      0|    first = false;
  691|      0|  }
  692|       |
  693|       |  // Write the others
  694|    354|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (694:30): [True: 354, False: 354]
  ------------------
  695|    354|    if (lang != "x-default") {
  ------------------
  |  Branch (695:9): [True: 354, False: 0]
  ------------------
  696|    354|      if (!first)
  ------------------
  |  Branch (696:11): [True: 0, False: 354]
  ------------------
  697|      0|        os << ", ";
  698|    354|      os << "lang=\"" << lang << "\" " << s;
  699|    354|      first = false;
  700|    354|    }
  701|    354|  }
  702|    354|  return os;
  703|    354|}
_ZNK5Exiv212LangAltValue8toStringEm:
  705|    801|std::string LangAltValue::toString(size_t /*n*/) const {
  706|    801|  return toString("x-default");
  707|    801|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  709|    801|std::string LangAltValue::toString(const std::string& qualifier) const {
  710|    801|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (710:40): [True: 24, False: 777]
  ------------------
  711|     24|    ok_ = true;
  712|     24|    return i->second;
  713|     24|  }
  714|    777|  ok_ = false;
  715|    777|  return "";
  716|    801|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  738|  3.32k|LangAltValue* LangAltValue::clone_() const {
  739|  3.32k|  return new LangAltValue(*this);
  740|  3.32k|}
_ZN5Exiv29DateValueC2Ev:
  742|  8.81k|DateValue::DateValue() : Value(date) {
  743|  8.81k|  date_ = {};
  744|  8.81k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  750|  8.32k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  751|  8.32k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  752|  8.32k|  return read(str);
  753|  8.32k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  755|  8.81k|int DateValue::read(const std::string& buf) {
  756|       |  // ISO 8601 date formats:
  757|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  758|  8.81k|  size_t monthPos = 0;
  759|  8.81k|  size_t dayPos = 0;
  760|       |
  761|  8.81k|  auto printWarning = [] {
  762|  8.81k|#ifndef SUPPRESS_WARNINGS
  763|  8.81k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  764|  8.81k|#endif
  765|  8.81k|  };
  766|       |
  767|  8.81k|  if (buf.size() < 8) {
  ------------------
  |  Branch (767:7): [True: 1.87k, False: 6.94k]
  ------------------
  768|  1.87k|    printWarning();
  769|  1.87k|    return 1;
  770|  1.87k|  }
  771|       |
  772|  6.94k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (772:8): [True: 4.38k, False: 2.56k]
  |  Branch (772:28): [True: 2.23k, False: 2.15k]
  |  Branch (772:45): [True: 313, False: 1.92k]
  |  Branch (772:63): [True: 2.55k, False: 4.08k]
  ------------------
  773|  2.86k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (773:9): [True: 313, False: 2.55k]
  ------------------
  774|    313|      monthPos = 5;
  775|    313|      dayPos = 8;
  776|  2.55k|    } else {
  777|  2.55k|      monthPos = 4;
  778|  2.55k|      dayPos = 6;
  779|  2.55k|    }
  780|       |
  781|  2.86k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  2.86k|      for (size_t i = start; i < start + count; ++i) {
  783|  2.86k|        if (!std::isdigit(buf[i])) {
  784|  2.86k|          printWarning();
  785|  2.86k|          return 1;
  786|  2.86k|        }
  787|  2.86k|      }
  788|  2.86k|      dest = std::stoul(buf.substr(start, count));
  789|  2.86k|      return 0;
  790|  2.86k|    };
  791|       |
  792|  2.86k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (792:9): [True: 1.08k, False: 1.78k]
  |  Branch (792:42): [True: 717, False: 1.06k]
  |  Branch (792:83): [True: 376, False: 689]
  ------------------
  793|  2.17k|      printWarning();
  794|  2.17k|      return 1;
  795|  2.17k|    }
  796|       |
  797|    689|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (797:9): [True: 420, False: 269]
  |  Branch (797:29): [True: 121, False: 148]
  ------------------
  798|    541|      date_.month = 0;
  799|    541|      date_.day = 0;
  800|    541|      printWarning();
  801|    541|      return 1;
  802|    541|    }
  803|    148|    return 0;
  804|    689|  }
  805|  4.08k|  printWarning();
  806|  4.08k|  return 1;
  807|  6.94k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  813|    133|size_t DateValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  814|       |  // \note Here the date is copied in the Basic format YYYYMMDD, as the IPTC key	Iptc.Application2.DateCreated
  815|       |  // wants it. Check https://exiv2.org/iptc.html
  816|       |
  817|    133|  auto out = reinterpret_cast<char*>(buf);
  818|    133|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|    133|#define stringFormatTo std::format_to
  ------------------
  819|       |
  820|    133|  return it - out;
  821|    133|}
_ZNK5Exiv29DateValue4sizeEv:
  831|    266|size_t DateValue::size() const {
  832|    266|  return 8;
  833|    266|}
_ZNK5Exiv29DateValue6clone_Ev:
  835|  1.33k|DateValue* DateValue::clone_() const {
  836|  1.33k|  return new DateValue(*this);
  837|  1.33k|}
_ZN5Exiv29TimeValueC2Ev:
  878|  10.4k|TimeValue::TimeValue() : Value(time) {
  879|  10.4k|  time_ = {};
  880|  10.4k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  886|  10.4k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  887|  10.4k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  888|  10.4k|  return read(str);
  889|  10.4k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  891|  10.4k|int TimeValue::read(const std::string& buf) {
  892|       |  // ISO 8601 time formats:
  893|       |  // https://web.archive.org/web/20171020084445/https://www.loc.gov/standards/datetime/ISO_DIS%208601-1.pdf
  894|       |  // Not supported formats:
  895|       |  // 4.2.2.4 Representations with decimal fraction: 232050,5
  896|  10.4k|  auto printWarning = [] {
  897|  10.4k|#ifndef SUPPRESS_WARNINGS
  898|  10.4k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  899|  10.4k|#endif
  900|  10.4k|    return 1;
  901|  10.4k|  };
  902|       |
  903|  10.4k|  if (buf.size() < 2)
  ------------------
  |  Branch (903:7): [True: 1.66k, False: 8.82k]
  ------------------
  904|  1.66k|    return printWarning();
  905|       |
  906|  8.82k|  for (auto c : buf)
  ------------------
  |  Branch (906:15): [True: 120k, False: 6.43k]
  ------------------
  907|   120k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (907:9): [True: 116k, False: 3.73k]
  |  Branch (907:21): [True: 113k, False: 3.53k]
  |  Branch (907:33): [True: 106k, False: 6.87k]
  |  Branch (907:45): [True: 103k, False: 3.41k]
  |  Branch (907:57): [True: 2.38k, False: 100k]
  ------------------
  908|  2.38k|      return printWarning();
  909|       |
  910|  6.43k|  size_t mpos;
  911|  6.43k|  size_t spos;
  912|  6.43k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (912:7): [True: 2.58k, False: 3.85k]
  ------------------
  913|  2.58k|    mpos = 3;
  914|  2.58k|    spos = 6;
  915|  3.85k|  } else {
  916|  3.85k|    mpos = 2;
  917|  3.85k|    spos = 4;
  918|  3.85k|  }
  919|       |
  920|  6.43k|  try {
  921|  6.43k|    auto hi = std::stoi(buf.substr(0, 2));
  922|  6.43k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (922:9): [True: 276, False: 6.16k]
  |  Branch (922:19): [True: 93, False: 6.06k]
  ------------------
  923|    264|      return printWarning();
  924|  6.17k|    time_.hour = hi;
  925|  6.17k|    if (buf.size() > 3) {
  ------------------
  |  Branch (925:9): [True: 5.84k, False: 331]
  ------------------
  926|  5.84k|      auto mi = std::stoi(buf.substr(mpos, 2));
  927|  5.84k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (927:11): [True: 235, False: 5.60k]
  |  Branch (927:21): [True: 29, False: 5.57k]
  ------------------
  928|    187|        return printWarning();
  929|  5.65k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  930|  5.65k|    } else {
  931|    331|      time_.minute = 0;
  932|    331|    }
  933|  5.98k|    if (buf.size() > 5) {
  ------------------
  |  Branch (933:9): [True: 4.02k, False: 1.96k]
  ------------------
  934|  4.02k|      auto si = std::stoi(buf.substr(spos, 2));
  935|  4.02k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (935:11): [True: 305, False: 3.72k]
  |  Branch (935:21): [True: 144, False: 3.57k]
  ------------------
  936|    305|        return printWarning();
  937|  3.72k|      time_.second = std::stoi(buf.substr(spos, 2));
  938|  3.72k|    } else {
  939|  1.96k|      time_.second = 0;
  940|  1.96k|    }
  941|       |
  942|  5.68k|    auto fpos = buf.find('+');
  943|  5.68k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (943:9): [True: 3.35k, False: 2.32k]
  ------------------
  944|  3.35k|      fpos = buf.find('-');
  945|       |
  946|  5.68k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (946:9): [True: 4.91k, False: 763]
  ------------------
  947|  4.91k|      auto format = buf.substr(fpos, buf.size());
  948|       |      // Use the sign of the raw offset string rather than of the parsed
  949|       |      // tzHour: when the hour magnitude is 0 (e.g. "-00:30"), std::stoi
  950|       |      // returns 0, which loses the '-' sign that std::stoi("-00") cannot
  951|       |      // preserve. format always starts with '+' or '-' (see fpos above).
  952|  4.91k|      const bool negative = format.at(0) == '-';
  953|  4.91k|      auto posColon = format.find(':');
  954|  4.91k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (954:11): [True: 2.78k, False: 2.12k]
  ------------------
  955|       |        // Extended format
  956|  2.78k|        auto tzhi = std::stoi(format.substr(0, 3));
  957|  2.78k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (957:13): [True: 507, False: 2.28k]
  |  Branch (957:27): [True: 140, False: 2.14k]
  ------------------
  958|    590|          return printWarning();
  959|  2.19k|        time_.tzHour = tzhi;
  960|  2.19k|        if (format.size() > 3) {
  ------------------
  |  Branch (960:13): [True: 1.74k, False: 450]
  ------------------
  961|  1.74k|          int minute = std::stoi(format.substr(3));
  962|  1.74k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (962:15): [True: 389, False: 1.36k]
  |  Branch (962:29): [True: 375, False: 985]
  ------------------
  963|    482|            return printWarning();
  964|  1.26k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (964:28): [True: 753, False: 514]
  ------------------
  965|  1.26k|        }
  966|  2.19k|      } else {
  967|       |        // Basic format
  968|  2.12k|        auto tzhi = std::stoi(format.substr(0, posColon));
  969|  2.12k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (969:13): [True: 255, False: 1.87k]
  |  Branch (969:27): [True: 59, False: 1.81k]
  ------------------
  970|    282|          return printWarning();
  971|  1.84k|        time_.tzHour = tzhi;
  972|  1.84k|        int minute = std::stoi(format.substr(posColon + 1));
  973|  1.84k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (973:13): [True: 627, False: 1.22k]
  |  Branch (973:27): [True: 494, False: 726]
  ------------------
  974|    890|          return printWarning();
  975|    957|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (975:26): [True: 129, False: 828]
  ------------------
  976|    957|      }
  977|  4.91k|    }
  978|  5.68k|  } catch (std::exception&) {
  979|       |    // std::stoi might throw an exception if the syntax is invalid.
  980|    896|    return printWarning();
  981|    896|  }
  982|  2.54k|  return 0;
  983|  6.43k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  990|    338|size_t TimeValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  991|       |  // NOTE: Here the time is copied in the Basic format HHMMSS:HHMM, as the IPTC key
  992|       |  // Iptc.Application2.TimeCreated wants it. Check https://exiv2.org/iptc.html
  993|    338|  char plusMinus = '+';
  994|    338|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (994:7): [True: 130, False: 208]
  |  Branch (994:27): [True: 9, False: 199]
  ------------------
  995|    139|    plusMinus = '-';
  996|       |
  997|    338|  auto out = reinterpret_cast<char*>(buf);
  998|    338|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    338|#define stringFormatTo std::format_to
  ------------------
  999|    338|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
 1000|       |
 1001|    338|  auto wrote = static_cast<size_t>(it - out);
 1002|    338|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
 1003|    338|  return wrote;
 1004|    338|}
_ZNK5Exiv29TimeValue4sizeEv:
 1014|    676|size_t TimeValue::size() const {
 1015|    676|  return 11;
 1016|    676|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1018|  4.51k|TimeValue* TimeValue::clone_() const {
 1019|  4.51k|  return new TimeValue(*this);
 1020|  4.51k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  761|  10.8k|  auto printWarning = [] {
  762|  10.8k|#ifndef SUPPRESS_WARNINGS
  763|  10.8k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  10.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 10.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  10.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  764|  10.8k|#endif
  765|  10.8k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  781|  5.71k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  18.8k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (782:30): [True: 15.3k, False: 3.53k]
  ------------------
  783|  15.3k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (783:13): [True: 2.17k, False: 13.1k]
  ------------------
  784|  2.17k|          printWarning();
  785|  2.17k|          return 1;
  786|  2.17k|        }
  787|  15.3k|      }
  788|  3.53k|      dest = std::stoul(buf.substr(start, count));
  789|  3.53k|      return 0;
  790|  5.71k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  896|  7.94k|  auto printWarning = [] {
  897|  7.94k|#ifndef SUPPRESS_WARNINGS
  898|  7.94k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  7.94k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.94k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.94k|  LogMsg(LogMsg::warn).os()
  ------------------
  899|  7.94k|#endif
  900|  7.94k|    return 1;
  901|  7.94k|  };

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

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  263|   220k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  264|   220k|  if (pValue)
  ------------------
  |  Branch (264:7): [True: 143k, False: 76.9k]
  ------------------
  265|   143k|    value_ = pValue->clone();
  266|   220k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  268|   257k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  269|   257k|  if (rhs.key_)
  ------------------
  |  Branch (269:7): [True: 257k, False: 0]
  ------------------
  270|   257k|    key_ = rhs.key_->clone();  // deep copy
  271|   257k|  if (rhs.value_)
  ------------------
  |  Branch (271:7): [True: 257k, False: 0]
  ------------------
  272|   257k|    value_ = rhs.value_->clone();  // deep copy
  273|   257k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  275|  2.55k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  276|  2.55k|  if (this == &rhs)
  ------------------
  |  Branch (276:7): [True: 0, False: 2.55k]
  ------------------
  277|      0|    return *this;
  278|  2.55k|  key_.reset();
  279|  2.55k|  if (rhs.key_)
  ------------------
  |  Branch (279:7): [True: 2.55k, False: 0]
  ------------------
  280|  2.55k|    key_ = rhs.key_->clone();  // deep copy
  281|  2.55k|  value_.reset();
  282|  2.55k|  if (rhs.value_)
  ------------------
  |  Branch (282:7): [True: 2.55k, False: 0]
  ------------------
  283|  2.55k|    value_ = rhs.value_->clone();  // deep copy
  284|  2.55k|  return *this;
  285|  2.55k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  287|   220k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  288|   220k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  290|   257k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  291|   257k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  293|  2.55k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  294|  2.55k|  if (this == &rhs)
  ------------------
  |  Branch (294:7): [True: 0, False: 2.55k]
  ------------------
  295|      0|    return *this;
  296|  2.55k|  *p_ = *rhs.p_;
  297|  2.55k|  return *this;
  298|  2.55k|}
_ZN5Exiv28XmpdatumD2Ev:
  300|   477k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  302|  11.0M|std::string Xmpdatum::key() const {
  303|  11.0M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (303:10): [True: 11.0M, False: 0]
  ------------------
  304|  11.0M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  310|  40.4k|std::string Xmpdatum::groupName() const {
  311|  40.4k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (311:10): [True: 40.4k, False: 0]
  ------------------
  312|  40.4k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  314|   109k|std::string Xmpdatum::tagName() const {
  315|   109k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (315:10): [True: 109k, False: 0]
  ------------------
  316|   109k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  330|   200k|TypeId Xmpdatum::typeId() const {
  331|   200k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (331:10): [True: 200k, False: 0]
  ------------------
  332|   200k|}
_ZNK5Exiv28Xmpdatum5countEv:
  342|  61.4k|size_t Xmpdatum::count() const {
  343|  61.4k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (343:10): [True: 61.4k, False: 0]
  ------------------
  344|  61.4k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  350|  3.76k|std::string Xmpdatum::toString() const {
  351|  3.76k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (351:10): [True: 3.76k, False: 0]
  ------------------
  352|  3.76k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  354|   121k|std::string Xmpdatum::toString(size_t n) const {
  355|   121k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (355:10): [True: 121k, False: 0]
  ------------------
  356|   121k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  374|   128k|const Value& Xmpdatum::value() const {
  375|   128k|  if (!p_->value_)
  ------------------
  |  Branch (375:7): [True: 0, False: 128k]
  ------------------
  376|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  377|   128k|  return *p_->value_;
  378|   128k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  388|  27.0k|void Xmpdatum::setValue(const Value* pValue) {
  389|  27.0k|  p_->value_.reset();
  390|  27.0k|  if (pValue)
  ------------------
  |  Branch (390:7): [True: 27.0k, False: 0]
  ------------------
  391|  27.0k|    p_->value_ = pValue->clone();
  392|  27.0k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   776k|int Xmpdatum::setValue(const std::string& value) {
  395|   776k|  XmpProperties::XmpLock lock;
  396|   776k|  if (!p_->value_) {
  ------------------
  |  Branch (396:7): [True: 63.1k, False: 712k]
  ------------------
  397|  63.1k|    TypeId type = xmpText;
  398|  63.1k|    if (p_->key_) {
  ------------------
  |  Branch (398:9): [True: 63.1k, False: 0]
  ------------------
  399|  63.1k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  400|  63.1k|    }
  401|  63.1k|    p_->value_ = Value::create(type);
  402|  63.1k|  }
  403|   776k|  return p_->value_->read(value);
  404|   776k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  406|   806k|Xmpdatum& XmpData::operator[](const std::string& key) {
  407|   806k|  XmpProperties::XmpLock lock;
  408|   806k|  XmpKey xmpKey(key, lock);
  409|   806k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  410|   806k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (410:7): [True: 76.9k, False: 729k]
  ------------------
  411|  76.9k|    return xmpMetadata_.emplace_back(xmpKey);
  412|  76.9k|  }
  413|   729k|  return *pos;
  414|   806k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  416|  2.68k|int XmpData::add(const XmpKey& key, const Value* value) {
  417|  2.68k|  XmpProperties::XmpLock lock;
  418|  2.68k|  return addUnlocked(key, value, lock);
  419|  2.68k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  421|   143k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  422|   143k|  xmpMetadata_.emplace_back(key, value);
  423|   143k|  return 0;
  424|   143k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  436|  26.8k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  437|  26.8k|  XmpProperties::XmpLock lock;
  438|  26.8k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  439|  26.8k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  441|   385k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  442|   385k|  XmpProperties::XmpLock lock;
  443|   385k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  444|   385k|}
_ZN5Exiv27XmpData5clearEv:
  446|  56.4k|void XmpData::clear() {
  447|  56.4k|  XmpProperties::XmpLock lock;
  448|  56.4k|  clearUnlocked(lock);
  449|  56.4k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  451|  66.8k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  452|  66.8k|  xmpMetadata_.clear();
  453|  66.8k|  nsBindings_.clear();
  454|  66.8k|}
_ZNK5Exiv27XmpData5beginEv:
  465|  4.56k|XmpData::const_iterator XmpData::begin() const {
  466|  4.56k|  return xmpMetadata_.begin();
  467|  4.56k|}
_ZNK5Exiv27XmpData3endEv:
  469|  31.4k|XmpData::const_iterator XmpData::end() const {
  470|  31.4k|  return xmpMetadata_.end();
  471|  31.4k|}
_ZNK5Exiv27XmpData5emptyEv:
  473|  2.50k|bool XmpData::empty() const {
  474|  2.50k|  XmpProperties::XmpLock lock;
  475|  2.50k|  return emptyUnlocked(lock);
  476|  2.50k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  478|  38.6k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  479|  38.6k|  return xmpMetadata_.empty();
  480|  38.6k|}
_ZN5Exiv27XmpData5beginEv:
  491|  8.55k|XmpData::iterator XmpData::begin() {
  492|  8.55k|  return xmpMetadata_.begin();
  493|  8.55k|}
_ZN5Exiv27XmpData3endEv:
  495|   393k|XmpData::iterator XmpData::end() {
  496|   393k|  return xmpMetadata_.end();
  497|   393k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  499|  1.22k|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  500|  1.22k|  XmpProperties::XmpLock lock;
  501|  1.22k|  return xmpMetadata_.erase(pos);
  502|  1.22k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  548|   170k|void xmpToolkitEnsureInitialized() {
  549|   170k|  static XmpToolkitLifetimeManager instance;
  550|   170k|  (void)instance;
  551|   170k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  553|   123k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  554|   123k|  xmpToolkitEnsureInitialized();
  555|   123k|  try {
  556|   123k|    std::string existingPrefix;
  557|   123k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (557:9): [True: 123k, False: 12]
  ------------------
  558|   123k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (558:11): [True: 123k, False: 0]
  |  Branch (558:38): [True: 123k, False: 0]
  ------------------
  559|   123k|        existingPrefix.pop_back();
  560|   123k|      }
  561|   123k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (561:11): [True: 122k, False: 693]
  ------------------
  562|       |        // Already registered correctly, skip overhead
  563|   122k|        return;
  564|   122k|      }
  565|   123k|    }
  566|       |
  567|    705|    SXMPMeta::DeleteNamespace(ns.c_str());
  568|       |#ifdef EXV_ADOBE_XMPSDK
  569|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  570|       |#else
  571|    705|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  572|    705|#endif
  573|    705|  } catch (const XMP_Error& /* e */) {
  574|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  575|      0|  }
  576|   123k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS_12DecodeParamsE:
  673|  11.3k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket, const DecodeParams& dp) {
  674|  11.3k|  try {
  675|  11.3k|    xmpData.setPacket(xmpPacket);
  676|  11.3k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (676:9): [True: 1.06k, False: 10.3k]
  ------------------
  677|  1.06k|      xmpData.clear();
  678|  1.06k|      return 0;
  679|  1.06k|    }
  680|       |
  681|       |    // Acquire Giant Lock
  682|  10.3k|    XmpProperties::XmpLock lock;
  683|  10.3k|    try {
  684|  10.3k|      xmpToolkitEnsureInitialized();
  685|  10.3k|    } catch (const Error&) {
  686|      0|#ifndef SUPPRESS_WARNINGS
  687|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  688|      0|#endif
  689|      0|      return 2;
  690|      0|    }
  691|       |
  692|  10.3k|    xmpData.clearUnlocked(lock);
  693|       |
  694|       |    // Make sure the unterminated substring is used
  695|  10.3k|    size_t len = xmpPacket.size();
  696|  42.8k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (696:12): [True: 42.6k, False: 119]
  |  Branch (696:23): [True: 32.4k, False: 10.2k]
  ------------------
  697|  32.4k|      --len;
  698|       |
  699|  10.3k|    XMLValidator::check(xmpPacket.data(), len, dp);
  700|  10.3k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  701|  10.3k|    SXMPIterator iter(meta);
  702|  10.3k|    std::string schemaNs;
  703|  10.3k|    std::string propPath;
  704|  10.3k|    std::string propValue;
  705|  10.3k|    XMP_OptionBits opt = 0;
  706|   163k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (706:12): [True: 152k, False: 10.3k]
  ------------------
  707|   152k|      printNode(schemaNs, propPath, propValue, opt);
  708|   152k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (708:11): [True: 0, False: 152k]
  ------------------
  709|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  710|      0|      }
  711|   152k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (711:11): [True: 12.0k, False: 140k]
  ------------------
  712|       |        // Register unknown namespaces with Exiv2
  713|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  714|  12.0k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  715|  12.0k|        if (prefix.empty()) {
  ------------------
  |  Branch (715:13): [True: 8.91k, False: 3.09k]
  ------------------
  716|  8.91k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (716:15): [True: 0, False: 8.91k]
  ------------------
  717|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  718|  8.91k|          prefix.pop_back();
  719|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  720|       |          // already globally bound -- a built-in standard prefix, or one a prior
  721|       |          // explicit registerNs() established -- to a different URI.  Letting it
  722|       |          // would poison every later write and lookup in this process (the
  723|       |          // namespace-leak bug).  The packet's own binding is still captured
  724|       |          // per-instance below, so this object round-trips faithfully; we just
  725|       |          // don't pollute the global registry on a read.
  726|  8.91k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (726:15): [True: 40, False: 8.87k]
  ------------------
  727|     40|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  728|  8.91k|        }
  729|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  730|       |        // encode() can resolve each property's URI from the data it came from,
  731|       |        // rather than from the process-global registry which another image may
  732|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  733|  12.0k|        xmpData.nsBindings_[prefix] = schemaNs;
  734|  12.0k|        continue;
  735|  12.0k|      }
  736|   140k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  737|   140k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (737:11): [True: 1.47k, False: 139k]
  ------------------
  738|       |        // Read Lang Alt property
  739|  1.47k|        auto val = std::make_unique<LangAltValue>();
  740|  1.47k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  741|  11.0k|        while (count-- > 0) {
  ------------------
  |  Branch (741:16): [True: 9.61k, False: 1.47k]
  ------------------
  742|       |          // Get the text
  743|  9.61k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  744|  9.61k|          printNode(schemaNs, propPath, propValue, opt);
  745|  9.61k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (745:15): [True: 0, False: 9.61k]
  |  Branch (745:28): [True: 0, False: 9.61k]
  |  Branch (745:54): [True: 0, False: 9.61k]
  ------------------
  746|      0|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  747|      0|          }
  748|  9.61k|          std::string text = propValue;
  749|       |          // Get the language qualifier
  750|  9.61k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  751|  9.61k|          printNode(schemaNs, propPath, propValue, opt);
  752|  9.61k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (752:15): [True: 0, False: 9.61k]
  |  Branch (752:15): [True: 0, False: 9.61k]
  |  Branch (752:28): [True: 0, False: 9.61k]
  |  Branch (752:54): [True: 0, False: 9.61k]
  ------------------
  753|  9.61k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (753:15): [True: 0, False: 9.61k]
  ------------------
  754|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  755|      0|          }
  756|  9.61k|          val->value_[propValue] = std::move(text);
  757|  9.61k|        }
  758|  1.47k|        xmpData.addUnlocked(*key, val.get(), lock);
  759|  1.47k|        continue;
  760|  1.47k|      }
  761|   139k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (761:11): [True: 2.62k, False: 136k]
  |  Branch (761:35): [True: 2.62k, False: 0]
  |  Branch (761:66): [True: 2.62k, False: 0]
  ------------------
  762|       |        // Check if all elements are simple
  763|  2.62k|        bool simpleArray = true;
  764|  2.62k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  765|  2.62k|        std::string aSchemaNs;
  766|  2.62k|        std::string aPropPath;
  767|  2.62k|        std::string aPropValue;
  768|  2.62k|        XMP_OptionBits aOpt = 0;
  769|  28.8k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (769:16): [True: 26.6k, False: 2.23k]
  ------------------
  770|  26.6k|          if (propPath == aPropPath)
  ------------------
  |  Branch (770:15): [True: 2.62k, False: 24.0k]
  ------------------
  771|  2.62k|            continue;
  772|  24.0k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (772:15): [True: 226, False: 23.8k]
  |  Branch (772:42): [True: 163, False: 23.6k]
  |  Branch (772:73): [True: 0, False: 23.6k]
  ------------------
  773|  24.0k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (773:15): [True: 0, False: 23.6k]
  |  Branch (773:41): [True: 0, False: 23.6k]
  ------------------
  774|    389|            simpleArray = false;
  775|    389|            break;
  776|    389|          }
  777|  24.0k|        }
  778|  2.62k|        if (simpleArray) {
  ------------------
  |  Branch (778:13): [True: 2.23k, False: 389]
  ------------------
  779|       |          // Read the array into an XmpArrayValue
  780|  2.23k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  781|  2.23k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  782|  24.5k|          while (count-- > 0) {
  ------------------
  |  Branch (782:18): [True: 22.3k, False: 2.23k]
  ------------------
  783|  22.3k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  784|  22.3k|            printNode(schemaNs, propPath, propValue, opt);
  785|  22.3k|            val->read(propValue);
  786|  22.3k|          }
  787|  2.23k|          xmpData.addUnlocked(*key, val.get(), lock);
  788|  2.23k|          continue;
  789|  2.23k|        }
  790|  2.62k|      }
  791|       |
  792|   137k|      auto val = std::make_unique<XmpTextValue>();
  793|   137k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (793:11): [True: 11.5k, False: 125k]
  |  Branch (793:36): [True: 389, False: 125k]
  ------------------
  794|       |        // Create a metadatum with only XMP options
  795|  11.8k|        val->setXmpArrayType(xmpArrayType(opt));
  796|  11.8k|        val->setXmpStruct(xmpStruct(opt));
  797|  11.8k|        xmpData.addUnlocked(*key, val.get(), lock);
  798|  11.8k|        continue;
  799|  11.8k|      }
  800|   125k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (800:11): [True: 125k, False: 0]
  |  Branch (800:36): [True: 0, False: 0]
  ------------------
  801|   125k|        val->read(propValue);
  802|   125k|        xmpData.addUnlocked(*key, val.get(), lock);
  803|   125k|        continue;
  804|   125k|      }
  805|       |      // Don't let any node go by unnoticed
  806|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  807|   125k|    }  // iterate through all XMP nodes
  808|       |
  809|  10.3k|    return 0;
  810|  10.3k|  }
  811|  11.3k|#ifndef SUPPRESS_WARNINGS
  812|  11.3k|  catch (const Error& e) {
  813|     50|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (813:9): [True: 0, False: 50]
  ------------------
  814|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  815|      0|    }
  816|     50|    throw;
  817|  4.25k|  } catch (const XMP_Error& e) {
  818|  4.25k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  4.25k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.25k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.25k|  LogMsg(LogMsg::error).os()
  ------------------
  819|  4.25k|    xmpData.clear();
  820|  4.25k|    return 3;
  821|  4.25k|  }
  822|       |#else
  823|       |  catch (const XMP_Error&) {
  824|       |    xmpData.clear();
  825|       |    return 3;
  826|       |  }
  827|       |#endif  // SUPPRESS_WARNINGS
  828|  11.3k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  842|  36.1k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  843|  36.1k|  try {
  844|       |    // Acquire Giant Lock
  845|  36.1k|    XmpProperties::XmpLock lock;
  846|  36.1k|    try {
  847|  36.1k|      xmpToolkitEnsureInitialized();
  848|  36.1k|    } catch (const Error&) {
  849|      0|#ifndef SUPPRESS_WARNINGS
  850|      0|      EXV_ERROR << "XMP toolkit initialization failed.\n";
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
  851|      0|#endif
  852|      0|      return 2;
  853|      0|    }
  854|       |
  855|  36.1k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (855:9): [True: 31.5k, False: 4.56k]
  ------------------
  856|  31.5k|      xmpPacket.clear();
  857|  31.5k|      return 0;
  858|  31.5k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  859|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  860|   123k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (860:33): [True: 123k, False: 4.56k]
  ------------------
  861|       |#ifdef EXIV2_DEBUG_MESSAGES
  862|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  863|       |#endif
  864|       |      // registerNsImpl is safe since we hold the lock
  865|   123k|      registerNsImpl(xmp, uri.prefix_);
  866|   123k|    }
  867|       |
  868|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  869|       |    // the toolkit here.  Every URI they contain was already registered while its
  870|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  871|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  872|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  873|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  874|       |    // serialization of struct fields that still carry the file's prefix.
  875|  4.56k|    SXMPMeta meta;
  876|  40.4k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (876:26): [True: 40.4k, False: 4.56k]
  ------------------
  877|  40.4k|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  878|  40.4k|      XMP_OptionBits options = 0;
  879|       |
  880|  40.4k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (880:11): [True: 801, False: 39.6k]
  ------------------
  881|       |        // Encode Lang Alt property
  882|    801|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  883|    801|        if (!la)
  ------------------
  |  Branch (883:13): [True: 0, False: 801]
  ------------------
  884|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  885|       |
  886|    801|        int idx = 1;
  887|  3.38k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (887:40): [True: 3.38k, False: 801]
  ------------------
  888|  3.38k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (888:15): [True: 3.28k, False: 105]
  ------------------
  889|  3.28k|            printNode(ns, xmp.tagName(), specs, 0);
  890|  3.28k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  891|  3.28k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  892|  3.28k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  893|  3.28k|          }
  894|  3.38k|        }
  895|    801|        continue;
  896|    801|      }
  897|       |
  898|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  899|  39.6k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  900|  39.6k|      if (!val)
  ------------------
  |  Branch (900:11): [True: 0, False: 39.6k]
  ------------------
  901|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  902|  39.6k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  903|  39.6k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (903:11): [True: 134, False: 39.5k]
  |  Branch (903:37): [True: 1.24k, False: 38.3k]
  |  Branch (903:63): [True: 131, False: 38.1k]
  ------------------
  904|  1.50k|        printNode(ns, xmp.tagName(), "", options);
  905|  1.50k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  906|  22.2k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (906:30): [True: 20.7k, False: 1.50k]
  ------------------
  907|  20.7k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  908|  20.7k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  909|  20.7k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  910|  20.7k|        }
  911|  1.50k|        continue;
  912|  1.50k|      }
  913|  38.1k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (913:11): [True: 38.1k, False: 0]
  ------------------
  914|  38.1k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  915|  38.1k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (915:13): [True: 3.23k, False: 34.9k]
  |  Branch (915:33): [True: 2.98k, False: 31.9k]
  |  Branch (915:72): [True: 348, False: 31.6k]
  ------------------
  916|  6.56k|          printNode(ns, xmp.tagName(), "", options);
  917|  6.56k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  918|  31.6k|        } else {
  919|  31.6k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  920|  31.6k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  921|  31.6k|        }
  922|  38.1k|        continue;
  923|  38.1k|      }
  924|       |      // Don't let any Xmpdatum go by unnoticed
  925|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  926|  38.1k|    }
  927|  4.56k|    std::string tmpPacket;
  928|  4.56k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  929|  4.56k|                           padding);  // throws
  930|  4.56k|    xmpPacket = std::move(tmpPacket);
  931|       |
  932|  4.56k|    return 0;
  933|  4.56k|  }
  934|  36.1k|#ifndef SUPPRESS_WARNINGS
  935|  36.1k|  catch (const Error& /* e */) {
  936|      0|    throw;
  937|    189|  } catch (const XMP_Error& e) {
  938|    189|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\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()
  ------------------
  939|    189|    return 3;
  940|    189|  }
  941|       |#else
  942|       |  catch (const XMP_Error&) {
  943|       |    return 3;
  944|       |  }
  945|       |#endif  // SUPPRESS_WARNINGS
  946|  36.1k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1108|   140k|                                                      const XmpProperties::XmpLock& lock) {
 1109|   140k|  std::string property;
 1110|   140k|  std::string::size_type idx = propPath.find(':');
 1111|   140k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1111:7): [True: 0, False: 140k]
  ------------------
 1112|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1113|      0|  }
 1114|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1115|   140k|  property = propPath.substr(idx + 1);
 1116|   140k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1117|   140k|  if (prefix.empty()) {
  ------------------
  |  Branch (1117:7): [True: 34.1k, False: 106k]
  ------------------
 1118|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1119|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1120|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1121|       |    // the property still gets a key; its URI is preserved per-instance.
 1122|  34.1k|    std::string toolkitPrefix;
 1123|  34.1k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1123:9): [True: 34.1k, False: 0]
  ------------------
 1124|  34.1k|      toolkitPrefix.pop_back();
 1125|  34.1k|      prefix = std::move(toolkitPrefix);
 1126|  34.1k|    }
 1127|  34.1k|  }
 1128|   140k|  if (prefix.empty()) {
  ------------------
  |  Branch (1128:7): [True: 0, False: 140k]
  ------------------
 1129|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1130|      0|  }
 1131|   140k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1132|   140k|}  // makeXmpKey
_ZN5Exiv29XmpParser16resolveNamespaceERKNS_7XmpDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 1135|  40.4k|                                               const XmpProperties::XmpLock& lock) {
 1136|  40.4k|  const auto& nsBindings = xmpData.nsBindings();
 1137|  40.4k|  const auto binding = nsBindings.find(prefix);
 1138|  40.4k|  return binding != nsBindings.end() ? binding->second : XmpProperties::nsUnlocked(prefix, lock);
  ------------------
  |  Branch (1138:10): [True: 39.7k, False: 774]
  ------------------
 1139|  40.4k|}  // resolveNamespace
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  213|  10.9M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  214|  10.9M|    return key_ == xmpdatum.key();
  215|  10.9M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  207|  1.21M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  208|  1.21M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcmRKN5Exiv212DecodeParamsE:
   67|  10.3k|  static void check(const char* buf, size_t buflen, const DecodeParams& dp) {
   68|  10.3k|    XMLValidator validator(dp.max_recursion_depth());
   69|  10.3k|    validator.check_internal(buf, buflen);
   70|  10.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Em:
   79|  10.3k|      max_recursion_depth_(max_recursion_depth), parser_(XML_ParserCreateNS(nullptr, '@')) {
   80|  10.3k|    if (!parser_) {
  ------------------
  |  Branch (80:9): [True: 0, False: 10.3k]
  ------------------
   81|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   82|      0|    }
   83|  10.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  114|  10.3k|  void check_internal(const char* buf, size_t buflen) {
  115|  10.3k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (115:9): [True: 0, False: 10.3k]
  ------------------
  116|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  117|      0|    }
  118|       |
  119|  10.3k|    XML_SetUserData(parser_, this);
  120|  10.3k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  121|  10.3k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  122|  10.3k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  123|       |
  124|  10.3k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (124:9): [True: 2.64k, False: 7.67k]
  ------------------
  125|  2.64k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  126|  2.64k|    }
  127|       |
  128|  10.3k|    if (haserror_) {
  ------------------
  |  Branch (128:9): [True: 2.64k, False: 7.67k]
  ------------------
  129|  2.64k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  130|  2.64k|    }
  131|  10.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  170|   137k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  171|   137k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  172|   137k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  133|   137k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  134|   137k|    if (element_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (134:9): [True: 8.65k, False: 129k]
  ------------------
  135|  8.65k|      setError("Too deeply nested");
  136|  8.65k|    }
  137|   137k|    ++element_depth_;
  138|   137k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  176|   109k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  177|   109k|    static_cast<XMLValidator*>(userData)->endElement(name);
  178|   109k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  140|   109k|  void endElement(const XML_Char*) noexcept {
  141|   109k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (141:9): [True: 109k, False: 0]
  ------------------
  142|   109k|      --element_depth_;
  143|   109k|    } else {
  144|      0|      setError("Negative depth");
  145|      0|    }
  146|   109k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  182|  71.2k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  183|  71.2k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  184|  71.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  148|  71.2k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  149|  71.2k|    if (namespace_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (149:9): [True: 8.41k, False: 62.8k]
  ------------------
  150|  8.41k|      setError("Too deeply nested");
  151|  8.41k|    }
  152|  71.2k|    ++namespace_depth_;
  153|  71.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  188|  50.1k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  189|  50.1k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  190|  50.1k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  155|  50.1k|  void endNamespace(const XML_Char*) noexcept {
  156|  50.1k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (156:9): [True: 50.1k, False: 0]
  ------------------
  157|  50.1k|      --namespace_depth_;
  158|  50.1k|    } else {
  159|      0|      setError("Negative depth");
  160|      0|    }
  161|  50.1k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  193|     37|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  194|     37|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  195|     37|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  163|     37|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  164|       |    // DOCTYPE is used for XXE attacks.
  165|     37|    setError("DOCTYPE not supported");
  166|     37|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   89|  19.7k|  void setError(const char* msg) {
   90|       |#if XML_MAJOR_VERSION > 2 || (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION >= 9)
   91|       |    // This is a workaround for XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
   92|       |    // getting deprecated and replaced with 64-bit versions in Expat 2.9.0. Until all
   93|       |    // the platforms support the latest version Expat, we need to keep this code which
   94|       |    // uses the old versions.
   95|       |    const uint64_t errlinenum = XML_GetCurrentLineNumber64(parser_);
   96|       |    const uint64_t errcolnum = XML_GetCurrentColumnNumber64(parser_);
   97|       |#else
   98|  19.7k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   99|  19.7k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
  100|  19.7k|#endif
  101|       |
  102|  19.7k|#ifndef SUPPRESS_WARNINGS
  103|  19.7k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  19.7k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 19.7k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  19.7k|  LogMsg(LogMsg::info).os()
  ------------------
  104|  19.7k|#endif
  105|       |    // If this is the first error, then save it.
  106|  19.7k|    if (!haserror_) {
  ------------------
  |  Branch (106:9): [True: 2.64k, False: 17.1k]
  ------------------
  107|  2.64k|      haserror_ = true;
  108|  2.64k|      errmsg_ = msg;
  109|  2.64k|      errlinenum_ = errlinenum;
  110|  2.64k|      errcolnum_ = errcolnum;
  111|  2.64k|    }
  112|  19.7k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   85|  10.3k|  ~XMLValidator() {
   86|  10.3k|    XML_ParserFree(parser_);
   87|  10.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  965|  11.8k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  966|  11.8k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  967|  11.8k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (967:7): [True: 11.5k, False: 389]
  ------------------
  968|  11.5k|    var = Exiv2::XmpValue::xsStruct;
  969|  11.5k|  }
  970|  11.8k|  return var;
  971|  11.8k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  973|  39.6k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  974|  39.6k|  XMP_OptionBits var(0);
  975|  39.6k|  switch (xs) {
  ------------------
  |  Branch (975:11): [True: 39.6k, False: 0]
  ------------------
  976|  36.6k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (976:5): [True: 36.6k, False: 2.98k]
  ------------------
  977|  36.6k|      break;
  978|  2.98k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (978:5): [True: 2.98k, False: 36.6k]
  ------------------
  979|  2.98k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  980|  2.98k|      break;
  981|  39.6k|  }
  982|  39.6k|  return var;
  983|  39.6k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  985|  14.1k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  986|  14.1k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  987|  14.1k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (987:7): [True: 2.62k, False: 11.5k]
  ------------------
  988|  2.62k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (988:9): [True: 428, False: 2.19k]
  ------------------
  989|    428|      typeId = Exiv2::xmpAlt;
  990|  2.19k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (990:14): [True: 1.83k, False: 353]
  ------------------
  991|  1.83k|      typeId = Exiv2::xmpSeq;
  992|    353|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (992:14): [True: 353, False: 0]
  ------------------
  993|    353|      typeId = Exiv2::xmpBag;
  994|  2.62k|  }
  995|  14.1k|  return typeId;
  996|  14.1k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  998|  11.8k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  999|  11.8k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
 1000|  11.8k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
 1002|  39.6k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
 1003|  39.6k|  XMP_OptionBits var(0);
 1004|  39.6k|  switch (xat) {
  ------------------
  |  Branch (1004:11): [True: 39.6k, False: 0]
  ------------------
 1005|  37.8k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (1005:5): [True: 37.8k, False: 1.85k]
  ------------------
 1006|  37.8k|      break;
 1007|    166|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (1007:5): [True: 166, False: 39.5k]
  ------------------
 1008|    166|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1009|    166|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
 1010|    166|      break;
 1011|  1.54k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (1011:5): [True: 1.54k, False: 38.1k]
  ------------------
 1012|  1.54k|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1013|  1.54k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
 1014|  1.54k|      break;
 1015|    139|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (1015:5): [True: 139, False: 39.5k]
  ------------------
 1016|    139|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1017|    139|      break;
 1018|  39.6k|  }
 1019|  39.6k|  return var;
 1020|  39.6k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
 1026|  4.37k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
 1027|  4.37k|  XMP_OptionBits var(0);
 1028|  4.37k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (1028:7): [True: 1.72k, False: 2.64k]
  ------------------
 1029|  1.72k|    var |= kXMP_OmitPacketWrapper;
 1030|  4.37k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (1030:7): [True: 0, False: 4.37k]
  ------------------
 1031|      0|    var |= kXMP_ReadOnlyPacket;
 1032|  4.37k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1032:7): [True: 4.37k, False: 0]
  ------------------
 1033|  4.37k|    var |= kXMP_UseCompactFormat;
 1034|  4.37k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1034:7): [True: 0, False: 4.37k]
  ------------------
 1035|      0|    var |= kXMP_IncludeThumbnailPad;
 1036|  4.37k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1036:7): [True: 0, False: 4.37k]
  ------------------
 1037|      0|    var |= kXMP_ExactPacketLength;
 1038|  4.37k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1038:7): [True: 0, False: 4.37k]
  ------------------
 1039|      0|    var |= kXMP_WriteAliasComments;
 1040|  4.37k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1040:7): [True: 24, False: 4.34k]
  ------------------
 1041|     24|    var |= kXMP_OmitAllFormatting;
 1042|  4.37k|  return var;
 1043|  4.37k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1101|   258k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1102|   258k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  256|   477k|  ~Impl() = default;

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

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

XMP_NewExpatAdapter:
   68|  7.67k|{
   69|  7.67k|	return new ExpatAdapter;
   70|  7.67k|}	// XMP_NewExpatAdapter
_ZN12ExpatAdapterC2Ev:
   74|  7.67k|ExpatAdapter::ExpatAdapter() : parser(0)
   75|  7.67k|{
   76|       |
   77|       |	#if XMP_DebugBuild
   78|       |		this->elemNesting = 0;
   79|       |		#if DumpXMLParseEvents
   80|       |			if ( this->parseLog == 0 ) this->parseLog = stdout;
   81|       |		#endif
   82|       |	#endif
   83|       |
   84|  7.67k|	this->parser = XML_ParserCreateNS ( 0, FullNameSeparator );
  ------------------
  |  |   33|  7.67k|#define FullNameSeparator	'@'
  ------------------
   85|  7.67k|	if ( this->parser == 0 ) XMP_Throw ( "Failure creating Expat parser", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (85:7): [True: 0, False: 7.67k]
  ------------------
   86|       |	
   87|  7.67k|	XML_SetUserData ( this->parser, this );
   88|       |	
   89|  7.67k|	XML_SetNamespaceDeclHandler ( this->parser, StartNamespaceDeclHandler, EndNamespaceDeclHandler );
   90|  7.67k|	XML_SetElementHandler ( this->parser, StartElementHandler, EndElementHandler );
   91|       |
   92|  7.67k|	XML_SetCharacterDataHandler ( this->parser, CharacterDataHandler );
   93|  7.67k|	XML_SetCdataSectionHandler ( this->parser, StartCdataSectionHandler, EndCdataSectionHandler );
   94|       |
   95|  7.67k|	XML_SetProcessingInstructionHandler ( this->parser, ProcessingInstructionHandler );
   96|  7.67k|	XML_SetCommentHandler ( this->parser, CommentHandler );
   97|       |
   98|  7.67k|	#if BanAllEntityUsage
   99|  7.67k|		XML_SetStartDoctypeDeclHandler ( this->parser, StartDoctypeDeclHandler );
  100|  7.67k|		isAborted = false;
  101|  7.67k|	#endif
  102|       |
  103|  7.67k|	this->parseStack.push_back ( &this->tree );	// Push the XML root node.
  104|       |
  105|  7.67k|}	// ExpatAdapter::ExpatAdapter
_ZN12ExpatAdapterD2Ev:
  110|  7.67k|{
  111|       |
  112|  7.67k|	if ( this->parser != 0 ) XML_ParserFree ( this->parser );
  ------------------
  |  Branch (112:7): [True: 7.67k, False: 0]
  ------------------
  113|  7.67k|	this->parser = 0;
  114|       |
  115|  7.67k|}	// ExpatAdapter::~ExpatAdapter
_ZN12ExpatAdapter11ParseBufferEPKvmb:
  126|  7.72k|{
  127|  7.72k|	enum XML_Status status;
  128|       |	
  129|  7.72k|	if ( length == 0 ) {	// Expat does not like empty buffers.
  ------------------
  |  Branch (129:7): [True: 0, False: 7.72k]
  ------------------
  130|      0|		if ( ! last ) return;
  ------------------
  |  Branch (130:8): [True: 0, False: 0]
  ------------------
  131|      0|		buffer = kOneSpace;
  132|      0|		length = 1;
  133|      0|	}
  134|       |	
  135|  7.72k|	status = XML_Parse ( this->parser, (const char *)buffer, length, last );
  136|       |	
  137|  7.72k|	#if BanAllEntityUsage
  138|  7.72k|		if ( this->isAborted ) XMP_Throw ( "DOCTYPE is not allowed", kXMPErr_BadXML );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (138:8): [True: 0, False: 7.72k]
  ------------------
  139|  7.72k|	#endif
  140|       |
  141|  7.72k|	if ( status != XML_STATUS_OK ) {
  ------------------
  |  Branch (141:7): [True: 52, False: 7.67k]
  ------------------
  142|       |	
  143|     52|		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|     52|		XMP_Throw ( errMsg, kXMPErr_BadXML );
  ------------------
  |  |  199|     52|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  167|       |
  168|      0|	}
  169|       |	
  170|  7.72k|}	// ExpatAdapter::ParseBuffer
ExpatAdapter.cpp:_ZL25StartNamespaceDeclHandlerPvPKcS1_:
  242|  49.2k|{
  243|  49.2k|	IgnoreParam(userData);
  ------------------
  |  |  117|  49.2k|#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|  49.2k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (252:7): [True: 527, False: 48.7k]
  ------------------
  253|  49.2k|	if ( uri == 0 ) return;	// Ignore, have xmlns:pre="", no URI to register.
  ------------------
  |  Branch (253:7): [True: 79, False: 49.2k]
  ------------------
  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|  49.2k|	if ( XMP_LitMatch ( uri, "http://purl.org/dc/1.1/" ) ) uri = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  |   96|  49.2k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  |  |  ------------------
  |  |  |  Branch (96:28): [True: 95, False: 49.1k]
  |  |  ------------------
  ------------------
  263|  49.2k|	XMPMeta::RegisterNamespace ( uri, prefix );
  264|       |
  265|  49.2k|}	// StartNamespaceDeclHandler
ExpatAdapter.cpp:_ZL23EndNamespaceDeclHandlerPvPKc:
  270|  49.2k|{
  271|  49.2k|	IgnoreParam(userData);
  ------------------
  |  |  117|  49.2k|#define IgnoreParam(p)	(void)p
  ------------------
  272|       |
  273|       |	#if XMP_DebugBuild & DumpXMLParseEvents		// Avoid unused variable warning.
  274|       |		ExpatAdapter * thiz = (ExpatAdapter*)userData;
  275|       |	#endif
  276|       |
  277|  49.2k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (277:7): [True: 527, False: 48.7k]
  ------------------
  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|  49.2k|}	// 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|   387k|	for ( XMP_StringPtr* a = attrs; *a != 0; ++a ) ++attrCount;
  ------------------
  |  Branch (298:34): [True: 279k, 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|   248k|	for ( XMP_StringPtr* attr = attrs; *attr != 0; attr += 2 ) {
  ------------------
  |  Branch (320:37): [True: 139k, False: 108k]
  ------------------
  321|       |
  322|   139k|		XMP_StringPtr attrName = *attr;
  323|   139k|		XMP_StringPtr attrValue = *(attr+1);
  324|   139k|		XML_Node * attrNode = new XML_Node ( elemNode, "", kAttrNode );
  325|       |
  326|   139k|		SetQualName ( attrName, attrNode );
  327|   139k|		attrNode->value = attrValue;
  328|   139k|		if ( attrNode->name == "xml:lang" ) NormalizeLangValue ( &attrNode->value );
  ------------------
  |  Branch (328:8): [True: 14.6k, False: 125k]
  ------------------
  329|   139k|		elemNode->attrs.push_back ( attrNode );
  330|       |
  331|   139k|	}
  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: 7.32k, False: 101k]
  ------------------
  337|  7.32k|		thiz->rootNode = elemNode;
  338|  7.32k|		++thiz->rootCount;
  339|  7.32k|	}
  340|       |	#if XMP_DebugBuild
  341|       |		++thiz->elemNesting;
  342|       |	#endif
  343|       |
  344|   108k|}	// StartElementHandler
ExpatAdapter.cpp:_ZL11SetQualNamePKcP8XML_Node:
  187|   248k|{
  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|   248k|	size_t sepPos = strlen(fullName);
  199|  16.6M|	for ( --sepPos; sepPos > 0; --sepPos ) {
  ------------------
  |  Branch (199:18): [True: 16.6M, False: 4.87k]
  ------------------
  200|  16.6M|		if ( fullName[sepPos] == FullNameSeparator ) break;
  ------------------
  |  |   33|  16.6M|#define FullNameSeparator	'@'
  ------------------
  |  Branch (200:8): [True: 243k, False: 16.4M]
  ------------------
  201|  16.6M|	}
  202|       |
  203|   248k|	if ( fullName[sepPos] == FullNameSeparator ) {
  ------------------
  |  |   33|   248k|#define FullNameSeparator	'@'
  ------------------
  |  Branch (203:7): [True: 243k, False: 4.87k]
  ------------------
  204|       |
  205|   243k|		XMP_StringPtr prefix;
  206|   243k|		XMP_StringLen prefixLen;
  207|   243k|		XMP_StringPtr localPart = fullName + sepPos + 1;
  208|       |
  209|   243k|		node->ns.assign ( fullName, sepPos );
  210|   243k|		if ( node->ns == "http://purl.org/dc/1.1/" ) node->ns = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  Branch (210:8): [True: 373, False: 242k]
  ------------------
  211|       |
  212|   243k|		bool found = XMPMeta::GetNamespacePrefix ( node->ns.c_str(), &prefix, &prefixLen );
  213|   243k|		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: 243k]
  ------------------
  214|   243k|		node->nsPrefixLen = prefixLen;	// ! Includes the ':'.
  215|       |		
  216|   243k|		node->name = prefix;
  217|   243k|		node->name += localPart;
  218|       |
  219|   243k|	} else {
  220|       |
  221|  4.87k|		node->name = fullName;	// The name is not in a namespace.
  222|       |	
  223|  4.87k|		if ( node->parent->name == "rdf:Description" ) {
  ------------------
  |  Branch (223:8): [True: 1.69k, False: 3.17k]
  ------------------
  224|  1.69k|			if ( node->name == "about" ) {
  ------------------
  |  Branch (224:9): [True: 42, False: 1.65k]
  ------------------
  225|     42|				node->ns   = kXMP_NS_RDF;
  226|     42|				node->name = "rdf:about";
  227|     42|				node->nsPrefixLen = 4;	// ! Include the ':'.
  228|  1.65k|			} else if ( node->name == "ID" ) {
  ------------------
  |  Branch (228:16): [True: 78, False: 1.57k]
  ------------------
  229|     78|				node->ns   = kXMP_NS_RDF;
  230|     78|				node->name = "rdf:ID";
  231|     78|				node->nsPrefixLen = 4;	// ! Include the ':'.
  232|     78|			}
  233|  1.69k|		}
  234|       |		
  235|  4.87k|	}
  236|       |
  237|   248k|}	// 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|  2.97M|{
  372|  2.97M|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  373|       |	
  374|  2.97M|	if ( (cData == 0) || (len == 0) ) { cData = ""; len = 0; }
  ------------------
  |  Branch (374:7): [True: 0, False: 2.97M]
  |  Branch (374:23): [True: 0, False: 2.97M]
  ------------------
  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|  2.97M|	XML_Node * parentNode = thiz->parseStack.back();
  386|  2.97M|	XML_Node * cDataNode  = new XML_Node ( parentNode, "", kCDataNode );
  387|       |	
  388|  2.97M|	cDataNode->value.assign ( cData, len );
  389|  2.97M|	parentNode->content.push_back ( cDataNode );
  390|       |	
  391|  2.97M|}	// CharacterDataHandler
ExpatAdapter.cpp:_ZL28ProcessingInstructionHandlerPvPKcS1_:
  436|  2.64k|{
  437|  2.64k|	XMP_Assert ( target != 0 );
  ------------------
  |  |  142|  2.64k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  438|  2.64k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  439|       |
  440|  2.64k|	if ( ! XMP_LitMatch ( target, "xpacket" ) ) return;	// Ignore all PIs except the XMP packet wrapper.
  ------------------
  |  |   96|  2.64k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  |  Branch (440:7): [True: 685, False: 1.96k]
  ------------------
  441|  1.96k|	if ( data == 0 ) data = "";
  ------------------
  |  Branch (441:7): [True: 0, False: 1.96k]
  ------------------
  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.96k|	XML_Node * parentNode = thiz->parseStack.back();
  451|  1.96k|	XML_Node * piNode  = new XML_Node ( parentNode, target, kPINode );
  452|       |	
  453|  1.96k|	piNode->value.assign ( data );
  454|  1.96k|	parentNode->content.push_back ( piNode );
  455|       |	
  456|  1.96k|}	// ProcessingInstructionHandler

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  6.99k|{
  625|  6.99k|	IgnoreParam(options);
  ------------------
  |  |  117|  6.99k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  6.99k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  6.99k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  6.99k|{
  647|       |
  648|  6.99k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 21, False: 6.97k]
  ------------------
  649|  6.97k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  6.97k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  6.97k|{
  664|  6.97k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  6.97k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  6.97k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  6.97k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  30.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 23.6k, False: 6.97k]
  ------------------
  670|  23.6k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 16.4k, False: 7.23k]
  ------------------
  671|  7.23k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  7.23k|	}
  673|       |
  674|  6.97k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  12.1k|{
  695|  12.1k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  12.1k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 4.94k, False: 7.21k]
  |  Branch (696:45): [True: 26, False: 4.91k]
  ------------------
  697|     26|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     26|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  12.1k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 7.22k, False: 4.90k]
  |  Branch (700:21): [True: 137, False: 7.09k]
  ------------------
  701|    137|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    137|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  11.9k|	} else {
  703|  11.9k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  11.9k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  11.9k|	}
  706|       |
  707|  12.1k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   289k|{
  265|   289k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   289k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 289k, False: 404]
  |  Branch (269:28): [True: 79.6k, False: 209k]
  ------------------
  270|       |
  271|  79.6k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 50.3k, False: 29.3k]
  ------------------
  272|  50.3k|			term = kRDFTerm_li;
  273|  50.3k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 28, False: 29.3k]
  ------------------
  274|     28|			term = kRDFTerm_parseType;
  275|  29.3k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 7.22k, False: 22.1k]
  ------------------
  276|  7.22k|			term = kRDFTerm_Description;
  277|  22.1k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.35k, False: 20.7k]
  ------------------
  278|  1.35k|			term = kRDFTerm_about;
  279|  20.7k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 42, False: 20.7k]
  ------------------
  280|     42|			term = kRDFTerm_resource;
  281|  20.7k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 27, False: 20.6k]
  ------------------
  282|     27|			term = kRDFTerm_RDF;
  283|  20.6k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 1.06k, False: 19.6k]
  ------------------
  284|  1.06k|			term = kRDFTerm_ID;
  285|  19.6k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 99, False: 19.5k]
  ------------------
  286|     99|			term = kRDFTerm_nodeID;
  287|  19.5k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 6, False: 19.5k]
  ------------------
  288|      6|			term = kRDFTerm_datatype;
  289|  19.5k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 10, False: 19.5k]
  ------------------
  290|     10|			term = kRDFTerm_aboutEach;
  291|  19.5k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 0, False: 19.5k]
  ------------------
  292|      0|			term = kRDFTerm_aboutEachPrefix;
  293|  19.5k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 37, False: 19.4k]
  ------------------
  294|     37|			term = kRDFTerm_bagID;
  295|     37|		}
  296|       |
  297|  79.6k|	}
  298|       |
  299|   289k|	return term;
  300|       |
  301|   289k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  11.9k|{
  732|  11.9k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  11.9k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  11.9k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  35.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 23.5k, False: 11.5k]
  ------------------
  738|       |
  739|  23.5k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  23.5k|		switch ( attrTerm ) {
  742|       |
  743|    956|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 956, False: 22.6k]
  ------------------
  744|    977|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 21, False: 23.5k]
  ------------------
  745|  2.33k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.35k, False: 22.2k]
  ------------------
  746|       |
  747|  2.33k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     19|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 19, False: 2.31k]
  ------------------
  748|  2.31k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  2.31k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 2.26k, False: 50]
  |  Branch (750:24): [True: 1.34k, False: 919]
  ------------------
  751|       |					// This is the rdf:about attribute on a top level node. Set the XMP tree name if
  752|       |					// it doesn't have a name yet. Make sure this name matches the XMP tree name.
  753|  1.34k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.34k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.34k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.20k, False: 136]
  ------------------
  755|  1.20k|						xmpParent->name = (*currAttr)->value;
  756|  1.20k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 125, False: 11]
  ------------------
  757|    125|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     87|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 87, False: 38]
  ------------------
  758|     38|					}
  759|  1.34k|				}
  760|       |
  761|  2.22k|				break;
  762|       |
  763|  21.1k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 21.1k, False: 2.42k]
  ------------------
  764|  21.1k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  21.1k|				break;
  766|       |
  767|     98|			default :
  ------------------
  |  Branch (767:4): [True: 98, False: 23.4k]
  ------------------
  768|     98|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     98|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  23.5k|		}
  771|       |
  772|  23.5k|	}
  773|       |
  774|  11.9k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   121k|{
  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|   121k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 298, False: 120k]
  ------------------
  371|    298|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    298|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   120k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   120k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   120k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   120k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   120k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 31.1k, False: 89.6k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  31.1k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  31.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  31.1k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  31.1k|#define kXMP_CreateNodes	true
  ------------------
  384|  31.1k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  31.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  15.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 15.3k, False: 15.8k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  31.1k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  31.1k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 31.1k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  31.1k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   120k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 70.5k, False: 50.2k]
  ------------------
  398|  70.5k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  70.5k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 41, False: 70.5k]
  ------------------
  399|     41|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     41|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  70.5k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   120k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   120k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 120k, False: 91]
  |  Branch (406:26): [True: 28, False: 63]
  ------------------
  407|   120k|		 xmpParent->children.push_back ( newChild );
  408|   120k|	} else {
  409|     98|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     98|	}
  411|   120k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 91, False: 120k]
  ------------------
  412|     91|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 22, False: 69]
  |  Branch (412:22): [True: 0, False: 69]
  ------------------
  413|     69|		xmpParent->options |= kRDF_HasValueElem;
  414|     69|	}
  415|       |	
  416|   120k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 50.1k, False: 70.5k]
  ------------------
  417|  50.1k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      2|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 2, False: 50.1k]
  ------------------
  418|  50.1k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  50.1k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  50.1k|	}
  423|       |	
  424|   120k|	return newChild;
  425|       |
  426|   120k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  11.8k|{
  787|  11.8k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  11.8k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   208k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 196k, False: 11.6k]
  ------------------
  791|   196k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 133k, False: 62.6k]
  ------------------
  792|  62.6k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 181, False: 62.5k]
  ------------------
  793|    181|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    181|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  62.5k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  62.5k|	}
  797|       |
  798|  11.8k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  62.5k|{
  854|  62.5k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  62.5k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     31|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 31, False: 62.4k]
  ------------------
  856|       |	
  857|  62.4k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 7.46k, False: 55.0k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  7.46k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  55.0k|	} 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|  55.0k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  55.0k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  55.0k|		XMP_VarString * attrName = 0;
  870|       |
  871|  68.6k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 21.0k, False: 47.5k]
  ------------------
  872|  21.0k|			attrName = &((*currAttr)->name);
  873|  21.0k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 7.46k, False: 13.5k]
  |  Branch (873:38): [True: 7.41k, False: 47]
  ------------------
  874|  21.0k|		}
  875|       |
  876|  55.0k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 7.41k, False: 47.5k]
  ------------------
  877|       |
  878|  7.41k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  7.41k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  7.41k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  7.41k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 71, False: 7.34k]
  ------------------
  882|     71|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  7.34k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 6.96k, False: 382]
  ------------------
  884|  6.96k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  6.96k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 10, False: 372]
  ------------------
  886|     10|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    372|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 279, False: 93]
  ------------------
  888|    279|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    279|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 10, False: 83]
  ------------------
  890|     10|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     83|			} else {
  892|     83|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     83|			}
  894|       |
  895|  47.5k|		} 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|  47.5k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 787, False: 46.8k]
  ------------------
  901|       |
  902|    787|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  46.8k|			} else {
  905|       |			
  906|  46.8k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  46.8k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  2.76M|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 2.71M, False: 41.8k]
  ------------------
  910|  2.71M|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 5.01k, False: 2.71M]
  ------------------
  911|  2.71M|				}
  912|       |				
  913|  46.8k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 41.8k, False: 5.01k]
  ------------------
  914|  41.8k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  41.8k|				} else {
  916|  5.01k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  5.01k|				}
  918|       |			
  919|  46.8k|			}
  920|       |
  921|  47.5k|		}
  922|       |		
  923|  55.0k|	}
  924|       |
  925|  62.4k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  62.5k|{
  350|       |
  351|  62.5k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 11, False: 62.5k]
  |  Branch (351:42): [True: 0, False: 62.5k]
  ------------------
  352|  62.5k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  62.5k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  62.5k|{
  334|       |
  335|  62.5k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 62.5k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  62.5k|	return false;
  337|       |
  338|  62.5k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  62.5k|{
  317|       |
  318|  62.5k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 50.2k, False: 12.2k]
  |  Branch (318:40): [True: 20, False: 50.2k]
  ------------------
  319|  62.4k|	return false;
  320|       |
  321|  62.5k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  15.2k|{
 1190|  15.2k|	bool hasPropertyAttrs = false;
 1191|  15.2k|	bool hasResourceAttr  = false;
 1192|  15.2k|	bool hasNodeIDAttr    = false;
 1193|  15.2k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  15.2k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  15.2k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     71|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 71, False: 15.1k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  15.1k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  15.1k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   112k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 97.2k, False: 15.1k]
  ------------------
 1205|       |
 1206|  97.2k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  97.2k|		switch ( attrTerm ) {
 1209|       |
 1210|     53|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 53, False: 97.2k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     53|				break;
 1213|       |
 1214|     41|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 41, False: 97.2k]
  ------------------
 1215|     41|				if ( hasNodeIDAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1215:10): [True: 0, False: 41]
  ------------------
 1216|     41|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 10, False: 31]
  ------------------
 1217|     31|				hasResourceAttr = true;
 1218|     31|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 31, False: 0]
  ------------------
 1219|     31|				break;
 1220|       |
 1221|     44|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 44, False: 97.2k]
  ------------------
 1222|     44|				if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1222:10): [True: 10, False: 34]
  ------------------
 1223|     34|				hasNodeIDAttr = true;
 1224|     34|				break;
 1225|       |
 1226|  97.0k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 97.0k, False: 158]
  ------------------
 1227|  97.0k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 2.52k, False: 94.5k]
  ------------------
 1228|  2.52k|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 0, False: 2.52k]
  ------------------
 1229|  2.52k|					hasValueAttr = true;
 1230|  2.52k|					valueNode = *currAttr;
 1231|  94.5k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 94.1k, False: 464]
  ------------------
 1232|  94.1k|					hasPropertyAttrs = true;
 1233|  94.1k|				}
 1234|  97.0k|				break;
 1235|       |
 1236|  97.0k|			default :
  ------------------
  |  Branch (1236:4): [True: 20, False: 97.2k]
  ------------------
 1237|     20|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     20|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  97.2k|		}
 1241|       |
 1242|  97.2k|	}
 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|  15.1k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  15.1k|	bool childIsStruct = false;
 1250|       |	
 1251|  15.1k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 2.53k, False: 12.5k]
  ------------------
 1252|  2.53k|		childNode->value = valueNode->value;
 1253|  2.53k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 21, False: 2.51k]
  ------------------
 1254|  12.5k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 11.7k, False: 844]
  ------------------
 1255|  11.7k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  11.7k|		childIsStruct = true;
 1257|  11.7k|	}
 1258|       |		
 1259|  15.1k|	currAttr = xmlNode.attrs.begin();
 1260|  15.1k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   111k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 96.9k, False: 14.9k]
  ------------------
 1263|       |
 1264|  96.9k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 2.53k, False: 94.4k]
  ------------------
 1265|  94.4k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  94.4k|		switch ( attrTerm ) {
 1268|       |
 1269|     51|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 51, False: 94.3k]
  ------------------
 1270|     85|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 34, False: 94.4k]
  ------------------
 1271|     85|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 94.4k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  94.3k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 94.3k, False: 85]
  ------------------
 1278|  94.3k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 56.6k, False: 37.7k]
  |  Branch (1278:31): [True: 28, False: 37.7k]
  ------------------
 1279|  56.6k|					AddQualifierNode ( childNode, **currAttr );
 1280|  56.6k|				} else {
 1281|  37.7k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  37.7k|				}
 1283|  94.3k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 94.4k]
  ------------------
 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|  94.4k|		}
 1290|       |
 1291|  94.4k|	}
 1292|       |
 1293|  15.1k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  69.7k|{
  484|  69.7k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 15, False: 69.7k]
  ------------------
  485|     15|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  69.7k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  69.7k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  69.9k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  69.9k|	const bool isLang = (name == "xml:lang");
  443|  69.9k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  69.9k|	XMP_Node * newQual = 0;
  446|       |
  447|  69.9k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  69.9k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 56.1k, False: 13.7k]
  ------------------
  450|  56.1k|			xmpParent->qualifiers.push_back ( newQual );
  451|  56.1k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 13.5k, False: 191]
  ------------------
  452|  13.5k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 13.5k, False: 12]
  ------------------
  453|  13.5k|				xmpParent->qualifiers.push_back ( newQual );
  454|  13.5k|			} else {
  455|     12|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     12|			}
  457|  13.5k|			xmpParent->options |= kXMP_PropHasLang;
  458|  13.5k|		} else {
  459|    191|			XMP_Assert ( isType );
  ------------------
  |  |  142|    191|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    191|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 143, False: 48]
  ------------------
  461|    143|				xmpParent->qualifiers.push_back ( newQual );
  462|    143|			} else {
  463|     48|				size_t offset = 0;
  464|     48|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 41, False: 7]
  ------------------
  465|     48|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|     48|			}
  467|    191|			xmpParent->options |= kXMP_PropHasType;
  468|    191|		}
  469|       |
  470|  69.9k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  69.9k|	return newQual;
  473|       |
  474|  69.9k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  41.8k|{
 1015|  41.8k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  41.8k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  41.8k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  55.0k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 13.1k, False: 41.8k]
  ------------------
 1021|  13.1k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  13.1k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 13.0k, False: 133]
  ------------------
 1023|  13.0k|			AddQualifierNode ( newChild, **currAttr );
 1024|  13.0k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 20, False: 113]
  |  Branch (1024:41): [True: 71, False: 42]
  ------------------
 1025|     91|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     91|		} else {
 1027|     42|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     42|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  13.1k|	}
 1030|       |	
 1031|  41.8k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  41.8k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  41.8k|	size_t      textSize  = 0;
 1034|       |
 1035|  2.74M|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 2.70M, False: 41.8k]
  ------------------
 1036|  2.70M|		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: 2.70M]
  ------------------
 1037|  2.70M|		textSize += (*currChild)->value.size();
 1038|  2.70M|	}
 1039|       |	
 1040|  41.8k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  2.74M|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 2.70M, False: 41.8k]
  ------------------
 1043|  2.70M|		newChild->value += (*currChild)->value;
 1044|  2.70M|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  41.8k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|     10|{
 1065|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1066|       |	
 1067|     10|	XMP_Throw ( "ParseTypeLiteral property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1068|       |
 1069|      0|}	// RDF_ParseTypeLiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    279|{
 1087|       |
 1088|    279|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    279|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    279|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    279|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    558|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 279, False: 279]
  ------------------
 1095|    279|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    279|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 279, False: 0]
  ------------------
 1097|    279|			continue;	// ! The caller ensured the value is "Resource".
 1098|    279|		} 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|    279|	}
 1106|       |
 1107|    279|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    279|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 279]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    279|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL18FixupQualifiedNodeP8XMP_Node:
  504|     68|{
  505|     68|	size_t qualNum, qualLim;
  506|     68|	size_t childNum, childLim;
  507|       |
  508|     68|	XMP_Enforce ( (xmpParent->options & kXMP_PropValueIsStruct) && (! xmpParent->children.empty()) );
  ------------------
  |  |  148|    136|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:11): [True: 68, False: 0]
  |  |  |  Branch (148:11): [True: 68, False: 0]
  |  |  ------------------
  |  |  149|      0|			const char * assert_msg = _NotifyMsg ( XMP_Enforce, (c), __FILE__, __LINE__ );			\
  |  |  ------------------
  |  |  |  |  139|      0|#define _NotifyMsg(n,c,f,l)	#n " failed: " #c " in " f " at line " _MakeStr(l)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define _MakeStr(p)			#p
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|			XMP_Throw ( assert_msg , kXMPErr_EnforceFailure );										\
  |  |  ------------------
  |  |  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  |  |  ------------------
  |  |  151|      0|		}
  ------------------
  509|       |
  510|     68|	XMP_Node * valueNode = xmpParent->children[0];
  511|     68|	XMP_Enforce ( valueNode->name == "rdf:value" );
  ------------------
  |  |  148|     68|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 68]
  |  |  ------------------
  |  |  149|      0|			const char * assert_msg = _NotifyMsg ( XMP_Enforce, (c), __FILE__, __LINE__ );			\
  |  |  ------------------
  |  |  |  |  139|      0|#define _NotifyMsg(n,c,f,l)	#n " failed: " #c " in " f " at line " _MakeStr(l)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define _MakeStr(p)			#p
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|			XMP_Throw ( assert_msg , kXMPErr_EnforceFailure );										\
  |  |  ------------------
  |  |  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  |  |  ------------------
  |  |  151|      0|		}
  ------------------
  512|       |	
  513|     68|	xmpParent->qualifiers.reserve ( xmpParent->qualifiers.size() + xmpParent->children.size() + valueNode->qualifiers.size() );
  514|       |	
  515|       |	// Move the qualifiers on the value node to the parent. Make sure an xml:lang qualifier stays at
  516|       |	// the front. Check for duplicate names between the value node's qualifiers and the parent's
  517|       |	// children. The parent's children are about to become qualifiers. Check here, between the
  518|       |	// groups. Intra-group duplicates are caught by AddChildNode.
  519|       |	
  520|     68|	qualNum = 0;
  521|     68|	qualLim = valueNode->qualifiers.size();
  522|       |	
  523|     68|	if ( valueNode->options & kXMP_PropHasLang ) {
  ------------------
  |  Branch (523:7): [True: 0, False: 68]
  ------------------
  524|       |
  525|      0|		if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Redundant xml:lang for rdf:value element", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (525:8): [True: 0, False: 0]
  ------------------
  526|       |
  527|      0|		XMP_Node * langQual = valueNode->qualifiers[0];
  528|       |		
  529|      0|		XMP_Assert ( langQual->name == "xml:lang" );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  530|      0|		langQual->parent = xmpParent;
  531|      0|		xmpParent->options |= kXMP_PropHasLang;
  532|       |
  533|      0|		if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (533:8): [True: 0, False: 0]
  ------------------
  534|      0|			xmpParent->qualifiers.push_back ( langQual );	// *** Should use utilities to add qual & set parent.
  535|      0|		} else {
  536|      0|			xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), langQual );
  537|      0|		}
  538|      0|		valueNode->qualifiers[0] = 0;	// We just moved it to the parent.
  539|       |
  540|      0|		qualNum = 1;	// Start the remaining copy after the xml:lang qualifier.
  541|       |
  542|      0|	}
  543|       |	
  544|     68|	for ( ; qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (544:10): [True: 0, False: 68]
  ------------------
  545|       |
  546|      0|		XMP_Node * currQual = valueNode->qualifiers[qualNum];
  547|      0|		if ( FindChildNode ( xmpParent, currQual->name.c_str(), kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|      0|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (547:8): [True: 0, False: 0]
  ------------------
  548|      0|			XMP_Throw ( "Duplicate qualifier node", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  549|      0|		}
  550|       |
  551|      0|		currQual->parent = xmpParent;
  552|      0|		xmpParent->qualifiers.push_back ( currQual );
  553|      0|		valueNode->qualifiers[qualNum] = 0;	// We just moved it to the parent.
  554|       |
  555|      0|	}
  556|       |	
  557|     68|	valueNode->qualifiers.clear();	// ! There should be nothing but null pointers.
  558|       |	
  559|       |	// Change the parent's other children into qualifiers. This loop starts at 1, child 0 is the
  560|       |	// rdf:value node. Put xml:lang at the front, append all others.
  561|       |	
  562|    441|	for ( childNum = 1, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (562:61): [True: 373, False: 68]
  ------------------
  563|       |
  564|    373|		XMP_Node * currQual = xmpParent->children[childNum];
  565|       |	
  566|    373|			bool isLang = (currQual->name == "xml:lang");
  567|       |			
  568|    373|			currQual->options |= kXMP_PropIsQualifier;
  569|    373|			currQual->parent = xmpParent;
  570|       |
  571|    373|			if ( isLang ) {
  ------------------
  |  Branch (571:9): [True: 3, False: 370]
  ------------------
  572|      3|				if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Duplicate xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (572:10): [True: 0, False: 3]
  ------------------
  573|      3|				xmpParent->options |= kXMP_PropHasLang;
  574|    370|			} else if ( currQual->name == "rdf:type" ) {
  ------------------
  |  Branch (574:16): [True: 0, False: 370]
  ------------------
  575|      0|				xmpParent->options |= kXMP_PropHasType;
  576|      0|			}
  577|       |
  578|    373|			if ( (! isLang) || xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (578:9): [True: 370, False: 3]
  |  Branch (578:23): [True: 0, False: 3]
  ------------------
  579|    370|				xmpParent->qualifiers.push_back ( currQual );
  580|    370|			} else {
  581|      3|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), currQual );
  582|      3|			}
  583|    373|			xmpParent->children[childNum] = 0;	// We just moved it to the qualifers.
  584|       |		
  585|    373|	}
  586|       |	
  587|     68|	if ( ! xmpParent->qualifiers.empty() ) xmpParent->options |= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (587:7): [True: 68, False: 0]
  ------------------
  588|       |	
  589|       |	// Move the options and value last, other checks need the parent's original options. Move the
  590|       |	// value node's children to be the parent's children. Delete the now useless value node.
  591|       |	
  592|     68|	XMP_Assert ( xmpParent->options & (kXMP_PropValueIsStruct | kRDF_HasValueElem) );
  ------------------
  |  |  142|     68|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|     68|	xmpParent->options &= ~ (static_cast<unsigned long>(kXMP_PropValueIsStruct) | static_cast<unsigned long>(kRDF_HasValueElem));
  594|     68|	xmpParent->options |= valueNode->options;
  595|       |	
  596|     68|	xmpParent->value.swap ( valueNode->value );
  597|       |	#if 0	// *** XMP_DebugBuild
  598|       |		xmpParent->_valuePtr = xmpParent->value.c_str();
  599|       |	#endif
  600|       |
  601|     68|	xmpParent->children[0] = 0;	// ! Remove the value node itself before the swap.
  602|     68|	xmpParent->children.swap ( valueNode->children );
  603|       |	
  604|     68|	for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (604:68): [True: 0, False: 68]
  ------------------
  605|      0|		XMP_Node * currChild = xmpParent->children[childNum];
  606|      0|		currChild->parent = xmpParent;
  607|      0|	}
  608|       |
  609|     68|	delete valueNode;
  610|       |	
  611|     68|}	// FixupQualifiedNode
ParseRDF.cpp:_ZL38RDF_ParseTypeCollectionPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1127|     10|{
 1128|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1129|       |
 1130|     10|	XMP_Throw ( "ParseTypeCollection property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1131|       |
 1132|      0|}	// RDF_ParseTypeCollectionPropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|     83|{
 1147|     83|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     83|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     83|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     83|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     83|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     83|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  5.01k|{
  943|  5.01k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 4.64k, False: 367]
  |  Branch (943:21): [True: 0, False: 4.64k]
  ------------------
  944|       |	
  945|  5.01k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  5.01k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  5.01k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  5.06k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 57, False: 5.01k]
  ------------------
  951|     57|		XMP_VarString & attrName = (*currAttr)->name;
  952|     57|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 52, False: 5]
  ------------------
  953|     52|			AddQualifierNode ( newCompound, **currAttr );
  954|     52|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 5, False: 0]
  ------------------
  955|      5|			continue;	// Ignore all rdf:ID attributes.
  956|      5|		} 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|     57|	}
  960|       |	
  961|  5.01k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  5.01k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  15.2k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 15.2k, False: 1]
  ------------------
  965|  15.2k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 5.00k, False: 10.2k]
  ------------------
  966|  15.2k|	}
  967|  5.01k|	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: 5.01k]
  ------------------
  968|  5.01k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     79|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 79, False: 4.93k]
  ------------------
  969|       |
  970|  4.93k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 160, False: 4.77k]
  ------------------
  971|    160|		newCompound->options |= kXMP_PropValueIsArray;
  972|  4.77k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.26k, False: 2.51k]
  ------------------
  973|  2.26k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.51k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 2.20k, False: 306]
  ------------------
  975|  2.20k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  2.20k|	} else {
  977|    306|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    306|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 184, False: 122]
  ------------------
  979|    184|			XMP_VarString typeName ( (*currChild)->ns );
  980|    184|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    184|			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: 174]
  ------------------
  982|    174|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    174|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    174|		}
  985|    306|	}
  986|       |
  987|  4.92k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  4.92k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 68, False: 4.85k]
  ------------------
  989|     68|		FixupQualifiedNode ( newCompound );
  990|  4.85k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.95k, False: 2.90k]
  ------------------
  991|  1.95k|		DetectAltText ( newCompound );
  992|  1.95k|	}
  993|       |
  994|  13.9k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 9.10k, False: 4.85k]
  ------------------
  995|  9.10k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     71|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 71, False: 9.03k]
  ------------------
  996|  9.03k|	}
  997|       |
  998|  4.92k|}	// 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|  61.2k|{
  568|  61.2k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  61.2k|	size_t unitCount = 0;
  570|       |
  571|  61.2k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  61.2k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 61.2k]
  ------------------
  573|  61.2k|	inUnit = *utf8In;
  574|  61.2k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 61.2k, 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|  61.2k|MultiByte:
  584|  61.2k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  61.2k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  61.2k|{
  517|  61.2k|	UTF8Unit  inUnit = *utf8In;
  518|  61.2k|	size_t    unitCount = 0;
  519|  61.2k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  61.2k|	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|  61.2k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|   186k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 125k, False: 61.2k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  61.2k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     24|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 13, False: 61.2k]
  |  Branch (538:28): [True: 11, False: 61.2k]
  ------------------
  539|  61.2k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 61.2k]
  ------------------
  540|  61.2k|	unitCount = bytesNeeded;
  541|       |	
  542|  61.2k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  61.2k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|   125k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 64.0k, False: 61.2k]
  ------------------
  546|  64.0k|		inUnit = *utf8Pos;
  547|  64.0k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     16|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 16, False: 64.0k]
  ------------------
  548|  64.0k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  64.0k|	}
  550|       |	
  551|  61.2k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 688, False: 60.5k]
  ------------------
  552|    688|		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: 688, False: 0]
  |  Branch (552:26): [True: 1, False: 687]
  ------------------
  553|    687|		if ( cp > 0x10FFFF ) UC_Throw ( "Bad UTF-8 - out of range", kXMPErr_BadParam );
  ------------------
  |  |   18|      2|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (553:8): [True: 2, False: 685]
  ------------------
  554|    687|	}
  555|       |	
  556|  61.2k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  61.2k|Done:	
  559|  61.2k|	*utf8Read = unitCount;
  560|  61.2k|	return;
  561|       |	
  562|  61.2k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   767k|{
   88|       |
   89|   767k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   767k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   767k|	const XMP_Uns8 * namePos   = nameStart;
   92|   767k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   767k|	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: 767k]
  ------------------
   97|       |
   98|   767k|	cp = *namePos;
   99|   767k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 766k, False: 1.05k]
  ------------------
  100|   766k|		++namePos;
  101|   766k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 766k]
  ------------------
  102|   766k|	} else {
  103|  1.05k|		cp = GetCodePoint ( &namePos );
  104|  1.05k|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 1.05k]
  ------------------
  105|  1.05k|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  94.9M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 94.1M, False: 767k]
  ------------------
  110|  94.1M|		cp = *namePos;
  111|  94.1M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 94.1M, False: 28.7k]
  ------------------
  112|  94.1M|			++namePos;
  113|  94.1M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 480k, False: 93.6M]
  |  Branch (113:38): [True: 0, False: 480k]
  ------------------
  114|  94.1M|		} else {
  115|  28.7k|			cp = GetCodePoint ( &namePos );
  116|  28.7k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 15.2k, False: 13.5k]
  |  Branch (116:41): [True: 0, False: 15.2k]
  ------------------
  117|  28.7k|		}
  118|  94.1M|	}
  119|       |
  120|   767k|	return;
  121|       |
  122|   767k|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|  94.8M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  94.8M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 64.9M, False: 29.9M]
  |  Branch (33:23): [True: 64.9M, False: 0]
  |  Branch (33:40): [True: 29.4M, False: 480k]
  |  Branch (33:55): [True: 29.3M, False: 154k]
  |  Branch (33:71): [True: 154k, False: 480k]
  ------------------
   34|   480k|	return false;
   35|  94.8M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  29.7k|{
   20|  29.7k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  29.7k|	XMP_Uns32 cp;
   22|  29.7k|	size_t u8Len;
   23|  29.7k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  29.7k|	*utf8Str_io = u8Ptr + u8Len;
   25|  29.7k|	return cp;
   26|  29.7k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  29.7k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  29.7k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 15.3k, False: 14.4k]
  |  Branch (43:24): [True: 388, False: 14.9k]
  |  Branch (43:43): [True: 14.9k, False: 14.4k]
  |  Branch (43:59): [True: 4.76k, False: 10.2k]
  ------------------
   44|  24.6k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 10.2k, False: 14.4k]
  |  Branch (44:24): [True: 5.81k, False: 4.41k]
  |  Branch (44:43): [True: 3.61k, False: 15.2k]
  |  Branch (44:60): [True: 0, False: 3.61k]
  ------------------
   45|       |
   46|  18.8k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 3.61k, False: 15.2k]
  |  Branch (46:25): [True: 3.36k, False: 256]
  |  Branch (46:46): [True: 256, False: 15.2k]
  |  Branch (46:64): [True: 0, False: 256]
  ------------------
   47|  15.4k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 256, False: 15.2k]
  |  Branch (47:26): [True: 0, False: 256]
  |  Branch (47:46): [True: 256, False: 15.2k]
  |  Branch (47:64): [True: 0, False: 256]
  ------------------
   48|  15.4k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 256, False: 15.2k]
  |  Branch (48:26): [True: 256, False: 0]
  |  Branch (48:46): [True: 0, False: 15.2k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  15.2k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 15.2k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 15.2k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  15.2k|	return false;
   52|       |
   53|  15.2k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   480k|{
   59|       |	// ASCII following characters for an XML name.
   60|   480k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 353k, False: 127k]
  |  Branch (60:23): [True: 353k, False: 0]
  |  Branch (60:39): [True: 60.5k, False: 66.8k]
  |  Branch (60:54): [True: 66.8k, False: 0]
  ------------------
   61|      0|	return false;
   62|   480k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  15.2k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  15.2k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 14.4k, False: 797]
  |  Branch (69:24): [True: 797, False: 0]
  |  Branch (69:41): [True: 797, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  15.2k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  9.64k|{
   20|  9.64k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  9.64k|	XMP_Uns32 cp;
   22|  9.64k|	size_t u8Len;
   23|  9.64k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  9.64k|	*utf8Str_io = u8Ptr + u8Len;
   25|  9.64k|	return cp;
   26|  9.64k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  49.9k|{
   88|       |
   89|  49.9k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  49.9k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  49.9k|	const XMP_Uns8 * namePos   = nameStart;
   92|  49.9k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  49.9k|	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: 49.9k]
  ------------------
   97|       |
   98|  49.9k|	cp = *namePos;
   99|  49.9k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 48.9k, False: 1.02k]
  ------------------
  100|  48.9k|		++namePos;
  101|  48.9k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 48.9k]
  ------------------
  102|  48.9k|	} else {
  103|  1.02k|		cp = GetCodePoint ( &namePos );
  104|  1.02k|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 1.02k]
  ------------------
  105|  1.02k|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  16.1M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 16.1M, False: 49.9k]
  ------------------
  110|  16.1M|		cp = *namePos;
  111|  16.1M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 16.1M, False: 20.8k]
  ------------------
  112|  16.1M|			++namePos;
  113|  16.1M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 146k, False: 15.9M]
  |  Branch (113:38): [True: 0, False: 146k]
  ------------------
  114|  16.1M|		} else {
  115|  20.8k|			cp = GetCodePoint ( &namePos );
  116|  20.8k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 13.3k, False: 7.43k]
  |  Branch (116:41): [True: 0, False: 13.3k]
  ------------------
  117|  20.8k|		}
  118|  16.1M|	}
  119|       |
  120|  49.9k|	return;
  121|       |
  122|  49.9k|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|  16.1M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  16.1M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 14.9M, False: 1.17M]
  |  Branch (33:23): [True: 14.9M, False: 0]
  |  Branch (33:40): [True: 1.02M, False: 146k]
  |  Branch (33:55): [True: 969k, False: 55.0k]
  |  Branch (33:71): [True: 55.0k, False: 146k]
  ------------------
   34|   146k|	return false;
   35|  16.1M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  21.8k|{
   20|  21.8k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  21.8k|	XMP_Uns32 cp;
   22|  21.8k|	size_t u8Len;
   23|  21.8k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  21.8k|	*utf8Str_io = u8Ptr + u8Len;
   25|  21.8k|	return cp;
   26|  21.8k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  21.8k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  21.8k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 8.66k, False: 13.1k]
  |  Branch (43:24): [True: 351, False: 8.31k]
  |  Branch (43:43): [True: 8.31k, False: 13.1k]
  |  Branch (43:59): [True: 103, False: 8.21k]
  ------------------
   44|  21.3k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 8.21k, False: 13.1k]
  |  Branch (44:24): [True: 4.49k, False: 3.72k]
  |  Branch (44:43): [True: 3.51k, False: 13.3k]
  |  Branch (44:60): [True: 0, False: 3.51k]
  ------------------
   45|       |
   46|  16.8k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 3.51k, False: 13.3k]
  |  Branch (46:25): [True: 2.56k, False: 947]
  |  Branch (46:46): [True: 947, False: 13.3k]
  |  Branch (46:64): [True: 0, False: 947]
  ------------------
   47|  14.3k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 947, False: 13.3k]
  |  Branch (47:26): [True: 0, False: 947]
  |  Branch (47:46): [True: 947, False: 13.3k]
  |  Branch (47:64): [True: 0, False: 947]
  ------------------
   48|  14.3k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 947, False: 13.3k]
  |  Branch (48:26): [True: 947, False: 0]
  |  Branch (48:46): [True: 0, False: 13.3k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  13.3k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 13.3k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 13.3k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  13.3k|	return false;
   52|       |
   53|  13.3k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   146k|{
   59|       |	// ASCII following characters for an XML name.
   60|   146k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 86.0k, False: 60.6k]
  |  Branch (60:23): [True: 86.0k, False: 0]
  |  Branch (60:39): [True: 37.4k, False: 23.1k]
  |  Branch (60:54): [True: 23.1k, False: 0]
  ------------------
   61|      0|	return false;
   62|   146k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  13.3k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  13.3k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 13.1k, False: 206]
  |  Branch (69:24): [True: 206, False: 0]
  |  Branch (69:41): [True: 206, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  13.3k|}

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

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

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

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

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

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

_ZN11XMPIterator10InitializeEv:
  376|      1|{
  377|      1|	sDummySchema = new XMP_Node ( 0, "dummy:schema/", kXMP_SchemaNode);
  378|      1|	return true;
  379|       |	
  380|      1|}	// Initialize
_ZN11XMPIterator9TerminateEv:
  388|      1|{
  389|      1|	delete ( sDummySchema );
  390|      1|	sDummySchema = 0;
  391|      1|	return;
  392|       |	
  393|      1|}	// Terminate
_ZN11XMPIteratorC2ERK7XMPMetaPKcS4_j:
  427|  8.80k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  8.80k|{
  429|  8.80k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 8.80k]
  ------------------
  430|      0|		XMP_Throw ( "Unsupported iteration kind", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  431|      0|	}
  432|       |	
  433|       |	// *** Lock the XMPMeta object if we ever stop using a full DLL lock.
  434|       |
  435|  8.80k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 2.62k, False: 6.18k]
  ------------------
  436|       |
  437|       |		// An iterator rooted at a specific node.
  438|       |
  439|       |		#if TraceIterators
  440|       |			printf ( "\nNew XMP property iterator for \"%s\", options = %X\n    Schema = %s, root = %s\n",
  441|       |			         xmpObj.tree.name.c_str(), options, schemaNS, propName );
  442|       |		#endif
  443|       |		
  444|  2.62k|		XMP_ExpandedXPath propPath;
  445|  2.62k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  2.62k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  2.62k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  2.62k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  2.62k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 2.62k, False: 0]
  ------------------
  449|       |
  450|  2.62k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  2.94k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 321, False: 2.62k]
  ------------------
  452|    321|				XMP_OptionBits stepKind = GetStepKind ( propPath[i].options );
  ------------------
  |  |  408|    321|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  453|    321|				if ( stepKind <= kXMP_QualifierStep ) rootName += '/';
  ------------------
  |  Branch (453:10): [True: 257, False: 64]
  ------------------
  454|    321|				rootName += propPath[i].step;
  455|    321|			}
  456|       |
  457|  2.62k|			propName = rootName.c_str();
  458|  2.62k|			size_t leafOffset = rootName.size();
  459|  43.1k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 40.6k, False: 2.45k]
  |  Branch (459:32): [True: 40.4k, False: 161]
  |  Branch (459:65): [True: 40.4k, False: 0]
  ------------------
  460|  2.62k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 161, False: 2.45k]
  ------------------
  461|       |
  462|  2.62k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  2.62k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  2.62k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 2.62k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  2.62k|		}
  469|       |	
  470|  6.18k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 6.18k]
  ------------------
  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|  6.18k|	} 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|  18.4k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 12.2k, False: 6.18k]
  ------------------
  507|       |
  508|  12.2k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  12.2k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  12.2k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  12.2k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 12.2k, False: 0]
  ------------------
  513|  12.2k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  12.2k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 12.2k]
  ------------------
  515|  12.2k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 12.2k]
  ------------------
  516|  12.2k|			}
  517|       |
  518|  12.2k|		}
  519|       |		
  520|  6.18k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 6.18k]
  ------------------
  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|  6.18k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  8.80k|	info.currPos = info.tree.children.begin();
  554|  8.80k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  8.80k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 8.80k]
  |  Branch (556:49): [True: 0, False: 0]
  |  Branch (556:82): [True: 0, False: 0]
  ------------------
  557|      0|		info.currPos->visitStage = kIter_VisitSelf;
  558|      0|	}
  559|       |
  560|       |	#if TraceIterators
  561|       |		if ( info.currPos == info.endPos ) {
  562|       |			printf ( "    ** Empty iteration **\n" );
  563|       |		} else {
  564|       |			printf ( "    Initial node %s, stage = %s, iterator @ %.8X\n",
  565|       |			         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage], this );
  566|       |		}
  567|       |	#endif
  568|       |	
  569|  8.80k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  8.80k|{
  592|  8.80k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  8.80k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  8.80k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   229k|{
  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|   229k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 898, False: 228k]
  ------------------
  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|   228k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   228k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 7.34k, False: 221k]
  ------------------
  632|   221k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   221k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 221k]
  ------------------
  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|   221k|	*schemaNS = info.currSchema.c_str();
  644|   221k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   221k|	*propOptions = info.currPos->options;
  647|       |
  648|   221k|	*propPath  = "";
  649|   221k|	*pathSize  = 0;
  650|   221k|	*propValue = "";
  651|   221k|	*valueSize = 0;
  652|       |	
  653|   221k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 209k, False: 12.1k]
  ------------------
  654|       |
  655|   209k|		*propPath = info.currPos->fullPath.c_str();
  656|   209k|		*pathSize = info.currPos->fullPath.size();
  657|   209k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 209k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   209k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 190k, False: 18.4k]
  ------------------
  663|   190k|			*propValue = xmpNode->value.c_str();
  664|   190k|			*valueSize = xmpNode->value.size();
  665|   190k|		}
  666|       |
  667|   209k|	}
  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|   221k|	return true;
  675|       |
  676|   221k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   221k|{
  730|   221k|	UNUSED(options);
  731|       |
  732|   221k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   221k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  2.62k|{
  182|       |
  183|  2.62k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  2.62k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   209k|{
  115|   209k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   209k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   209k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 16.9k, False: 192k]
  |  Branch (118:44): [True: 16.9k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  16.9k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  16.9k|		leafOffset += 2;
  126|       |		
  127|  88.3k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 71.3k, False: 16.9k]
  ------------------
  128|  71.3k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  71.3k|			currPath += xmpQual->name;
  130|  71.3k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  71.3k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  71.3k|		}
  136|       |		
  137|  16.9k|		leafOffset -= 2;
  138|  16.9k|		currPath.erase ( leafOffset );
  139|       |
  140|  16.9k|	}
  141|       |
  142|   209k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 18.3k, False: 190k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  18.3k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  18.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  18.3k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 11.7k, False: 6.64k]
  ------------------
  151|  11.7k|			currPath += '/';
  152|  11.7k|			leafOffset += 1;
  153|  11.7k|		}
  154|       |		
  155|   145k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 127k, False: 18.3k]
  ------------------
  156|   127k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   127k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 39.7k, False: 87.8k]
  ------------------
  158|  39.7k|				currPath += xmpChild->name;
  159|  87.8k|			} else {
  160|  87.8k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|  87.8k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|  87.8k|				currPath += buffer;
  163|  87.8k|			}
  164|   127k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   127k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   127k|		}
  170|       |	
  171|  18.3k|	}
  172|       |
  173|   209k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  12.2k|{
   49|  12.2k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  37.8k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 25.6k, False: 12.2k]
  ------------------
   55|  25.6k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  25.6k|		iterSchema.children.push_back ( IterNode ( xmpProp->options, xmpProp->name, 0 ) );
   58|       |		#if TraceIterators
   59|       |			printf ( "        %s\n", xmpProp->name.c_str() );
   60|       |		#endif
   61|  25.6k|	}
   62|       |
   63|  12.2k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   228k|{
  309|   228k|	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|   228k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 220k, False: 7.90k]
  ------------------
  323|       |	
  324|   228k|	bool isSchemaNode = false;
  325|   228k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   228k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 221k, False: 7.46k]
  ------------------
  328|       |
  329|   221k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   221k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 12.0k, False: 209k]
  ------------------
  331|  12.0k|			SetCurrSchema ( info, info.currPos->fullPath );
  332|  12.0k|			xmpNode = FindConstSchema ( &info.xmpObj->tree, info.currPos->fullPath.c_str() );
  ------------------
  |  |  298|  12.0k|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  12.0k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  333|  12.0k|			if ( xmpNode == 0 ) xmpNode = sDummySchema;
  ------------------
  |  Branch (333:9): [True: 0, False: 12.0k]
  ------------------
  334|   209k|		} else {
  335|   209k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   209k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   209k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   209k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   209k|		}
  338|   221k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 221k, False: 118]
  ------------------
  339|       |
  340|    118|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|    118|		info.currPos->children.clear();
  342|    118|		info.currPos->qualifiers.clear();
  343|    118|		AdvanceIterPos ( info );
  344|       |
  345|    118|	}
  346|       |
  347|   228k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 7.34k, False: 221k]
  ------------------
  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|   221k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   221k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   221k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 221k, False: 118]
  ------------------
  356|   221k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 209k, False: 12.0k]
  |  Branch (356:28): [True: 209k, False: 0]
  ------------------
  357|   209k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   209k|		}
  359|   221k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   221k|	}
  361|       |	
  362|   221k|	return xmpNode;
  363|       |
  364|   228k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  18.7k|{
  193|       |
  194|  18.7k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  18.7k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   220k|{
  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|   487k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 487k, Folded]
  ------------------
  221|       |	
  222|   487k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 53.7k, False: 433k]
  ------------------
  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|  53.7k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 7.34k, False: 46.3k]
  ------------------
  230|       |
  231|  46.3k|			IterPosPair & parent = info.ancestors.back();
  232|  46.3k|			info.currPos = parent.first;
  233|  46.3k|			info.endPos  = parent.second;
  234|  46.3k|			info.ancestors.pop_back();
  235|       |			
  236|       |			#if TraceIterators
  237|       |				printf ( "    Moved up to %s, stage = %s\n",
  238|       |				         info.currPos->fullPath.c_str(), sStageNames[info.currPos->visitStage] );
  239|       |			#endif
  240|       |		
  241|   433k|		} 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|   433k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 166k, False: 267k]
  ------------------
  253|   166k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 6.72k, False: 159k]
  ------------------
  254|   166k|				break;
  255|   166k|			}
  256|       |
  257|   267k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 220k, False: 46.3k]
  ------------------
  258|   220k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   220k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 16.8k, False: 203k]
  ------------------
  260|  16.8k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  16.8k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  16.8k|					info.currPos = info.currPos->qualifiers.begin();
  263|  16.8k|					break;
  264|  16.8k|				}
  265|   220k|			}
  266|       |
  267|   250k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 220k, False: 29.5k]
  ------------------
  268|   220k|				info.currPos->qualifiers.clear();
  269|   220k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   220k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 30.1k, False: 190k]
  ------------------
  271|  30.1k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  30.1k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  30.1k|					info.currPos = info.currPos->children.begin();
  274|  30.1k|					break;
  275|  30.1k|				}
  276|   220k|			}
  277|       |
  278|   220k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 220k, False: 0]
  ------------------
  279|   220k|				info.currPos->children.clear();
  280|   220k|				++info.currPos;											// Move to the next sibling.
  281|   220k|				continue;
  282|   220k|			}
  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|   220k|		}
  292|       |
  293|   487k|	}	// Loop to find the next node.
  294|       |	
  295|   220k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   220k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   220k|}	// AdvanceIterPos

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  7.67k|{
 1097|  7.67k|	if ( (buffer == 0) && (xmpSize != 0) ) XMP_Throw ( "Null parse buffer", kXMPErr_BadParam );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1097:7): [True: 0, False: 7.67k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  7.67k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 7.67k]
  ------------------
 1099|       |	
 1100|  7.67k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  7.67k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  7.67k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 7.67k, False: 0]
  ------------------
 1105|  7.67k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 7.67k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  7.67k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  7.67k|	}
 1108|       |	
 1109|  7.67k|	XMLParserAdapter& parser = *this->xmlParser;
 1110|       |	
 1111|       |	#if 0	// XMP_DebugBuild
 1112|       |		if ( parser.parseLog != 0 ) {
 1113|       |			char message [200];	// AUDIT: Using sizeof(message) below for snprintf length is safe.
 1114|       |			snprintf ( message, sizeof(message), "<!-- ParseFromBuffer, length = %d, options = %X%s -->",	// AUDIT: See above.
 1115|       |					   xmpSize, options, (lastClientCall ? " (last)" : "") );
 1116|       |			fwrite ( message, 1, strlen(message), parser.parseLog );
 1117|       |			fflush ( parser.parseLog );
 1118|       |		}
 1119|       |	#endif
 1120|       |		
 1121|  7.67k|	try {	// Cleanup the tree and xmlParser if anything fails.
 1122|       |	
 1123|       |		// Determine the character encoding before doing any real parsing. This is needed to do the
 1124|       |		// 8-bit special processing.
 1125|       |		
 1126|  7.67k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 7.67k, False: 0]
  ------------------
 1127|       |
 1128|  7.67k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 7.67k, False: 0]
  |  Branch (1128:39): [True: 7.62k, False: 52]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  7.62k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  7.62k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     52|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     52|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 52, False: 0]
  ------------------
 1139|       |
 1140|     52|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     52|				buffer += pendingOverlap;
 1142|     52|				xmpSize -= pendingOverlap;
 1143|     52|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     52|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 52]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     52|				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|     52|			}
 1153|       |
 1154|  7.67k|		}
 1155|       |		
 1156|       |		// We have the character encoding. Process UTF-16 and UTF-32 as is. UTF-8 needs special
 1157|       |		// handling to take care of things like ISO Latin-1 or unescaped ASCII controls.
 1158|       |
 1159|  7.67k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  7.67k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  7.67k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 7.67k]
  ------------------
 1162|       |		
 1163|      0|			if ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|       |				// Might have pendingInput from the above portion to determine the character encoding.
 1165|      0|				parser.ParseBuffer ( parser.pendingInput, parser.pendingCount, false );
 1166|      0|			}
 1167|      0|			parser.ParseBuffer ( buffer, xmpSize, lastClientCall );
 1168|       |			
 1169|  7.67k|		} else {
 1170|       |
 1171|       |			#if Trace_ParsingHackery
 1172|       |				fprintf ( stderr, "Parsing %d bytes @ %.8X, %s, %d pending, context: %.8s\n",
 1173|       |						  xmpSize, buffer, (lastClientCall ? "last" : "not last"), parser.pendingCount, buffer );
 1174|       |			#endif
 1175|       |
 1176|       |			// The UTF-8 processing is a bit complex due to the need to tolerate ISO Latin-1 input.
 1177|       |			// This is done by scanning the input for byte sequences that are not valid UTF-8,
 1178|       |			// assuming they are Latin-1 characters in the range 0x80..0xFF. This requires saving a
 1179|       |			// pending input buffer to handle partial UTF-8 sequences at the end of a buffer.
 1180|       |			
 1181|  7.72k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 52, False: 7.67k]
  ------------------
 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|     52|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     52|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 52, False: 0]
  ------------------
 1190|       |				
 1191|     52|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     52|				parser.pendingCount += pendingOverlap;
 1193|     52|				buffer += pendingOverlap;
 1194|     52|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     52|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 52]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     52|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     52|				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|     52|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 52, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     52|					parser.pendingCount = 0;
 1208|       |
 1209|     52|				} 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|     52|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  7.67k|			size_t bytesDone = ProcessUTF8Portion ( &parser, (XMP_Uns8*)buffer, xmpSize, lastClientCall );
 1240|       |
 1241|       |			#if Trace_ParsingHackery
 1242|       |				fprintf ( stderr, "   ProcessUTF8Portion handled %d additional bytes\n", bytesDone );
 1243|       |			#endif
 1244|       |			
 1245|  7.67k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 7.67k]
  ------------------
 1246|       |
 1247|      0|				XMP_Assert ( ! lastClientCall );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1248|      0|				size_t bytesLeft = xmpSize - bytesDone;
 1249|      0|				if ( bytesLeft > kXMLPendingInputMax ) XMP_Throw ( "Parser bytesLeft too large", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1249:10): [True: 0, False: 0]
  ------------------
 1250|       |
 1251|      0|				memcpy ( parser.pendingInput, &buffer[bytesDone], bytesLeft );	// AUDIT: Count is safe.
 1252|      0|				parser.pendingCount = bytesLeft;
 1253|      0|				return;	// Wait for the next buffer.
 1254|       |
 1255|      0|			}
 1256|       |
 1257|  7.67k|		}
 1258|       |		
 1259|  7.67k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 7.62k, False: 52]
  ------------------
 1260|       |		
 1261|       |			#if XMP_DebugBuild && DumpXMLParseTree
 1262|       |				if ( parser.parseLog == 0 ) parser.parseLog = stdout;
 1263|       |				DumpXMLTree ( parser.parseLog, parser.tree, 0 );
 1264|       |			#endif
 1265|       |
 1266|  7.62k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  7.62k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 6.99k, False: 624]
  ------------------
 1269|       |
 1270|  6.99k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  6.99k|				NormalizeDCArrays ( &this->tree );
 1272|  6.99k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 6.99k]
  ------------------
 1273|  6.99k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  6.99k|				size_t schemaNum = 0;
 1277|  19.2k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 12.2k, False: 6.99k]
  ------------------
 1278|  12.2k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  12.2k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 12.2k, False: 0]
  ------------------
 1280|  12.2k|						++schemaNum;
 1281|  12.2k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  12.2k|				}
 1286|       |				
 1287|  6.99k|			}
 1288|       |
 1289|  7.62k|			delete this->xmlParser;
 1290|  7.62k|			this->xmlParser = 0;
 1291|       |
 1292|  7.62k|		}
 1293|       |		
 1294|  7.67k|	} catch ( ... ) {
 1295|       |
 1296|  1.49k|		delete this->xmlParser;
 1297|  1.49k|		this->xmlParser = 0;
 1298|  1.49k|		prevTkVer = 0;
 1299|  1.49k|		this->tree.ClearNode();
 1300|  1.49k|		throw;
 1301|       |
 1302|  1.49k|	}
 1303|       |	
 1304|  7.67k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  7.67k|{
  811|  7.67k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 7.67k]
  ------------------
  812|       |	
  813|  7.67k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  7.67k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 7.67k]
  ------------------
  816|       |	
  817|       |		// These cases are:
  818|       |		//   00 nn -- -- - Big endian UTF-16
  819|       |		//   00 00 00 nn - Big endian UTF-32
  820|       |		//   00 00 FE FF - Big endian UTF 32
  821|       |
  822|      0|		if ( (length < 4) || (uniChar[1] != 0) ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (822:8): [True: 0, False: 0]
  |  Branch (822:24): [True: 0, False: 0]
  ------------------
  823|      0|		return kXMP_EncodeUTF32Big;
  824|       |		
  825|  7.67k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 7.65k, False: 20]
  ------------------
  826|       |	
  827|       |		// These cases are:
  828|       |		//   nn mm -- -- - UTF-8, includes EF BB BF case
  829|       |		//   nn 00 00 00 - Little endian UTF-32
  830|       |		//   nn 00 -- -- - Little endian UTF-16
  831|       |
  832|  7.65k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 7.65k, False: 0]
  ------------------
  833|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (833:8): [True: 0, False: 0]
  |  Branch (833:24): [True: 0, False: 0]
  ------------------
  834|      0|		return kXMP_EncodeUTF32Little;
  835|       |
  836|     20|	} else {
  837|       |	
  838|       |		// These cases are:
  839|       |		//   EF BB BF -- - UTF-8
  840|       |		//   FE FF -- -- - Big endian UTF-16
  841|       |		//   FF FE 00 00 - Little endian UTF-32
  842|       |		//   FF FE -- -- - Little endian UTF-16
  843|       |
  844|     20|		if ( uniChar[0] == 0xEF ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (844:8): [True: 20, False: 0]
  ------------------
  845|      0|		if ( uniChar[0] == 0xFE ) return kXMP_EncodeUTF16Big;
  ------------------
  |  Branch (845:8): [True: 0, False: 0]
  ------------------
  846|      0|		if ( (length < 4) || (uniChar[2] != 0) ) return kXMP_EncodeUTF16Little;
  ------------------
  |  Branch (846:8): [True: 0, False: 0]
  |  Branch (846:24): [True: 0, False: 0]
  ------------------
  847|      0|		return kXMP_EncodeUTF32Little;
  848|       |
  849|      0|	}
  850|       |		
  851|  7.67k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  7.72k|{
  977|  7.72k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  7.72k|	const XMP_Uns8 * spanEnd;
  980|       |
  981|       |	// `buffer` is copied into this std::string. If `buffer` only
  982|       |	// contains valid UTF-8 and no escape characters, then the copy
  983|       |	// will be identical to the original, but invalid characters are
  984|       |	// replaced - usually with a space character.  This std::string was
  985|       |	// added as a performance fix for:
  986|       |	// https://github.com/Exiv2/exiv2/security/advisories/GHSA-w8mv-g8qq-36mj
  987|       |	// Previously, the code was repeatedly calling
  988|       |	// `xmlParser->ParseBuffer()`, which turned out to have quadratic
  989|       |	// complexity, because expat kept reparsing the entire string from
  990|       |	// the beginning.
  991|  7.72k|	std::string copy;
  992|       |		
  993|  94.3M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 94.3M, False: 7.72k]
  ------------------
  994|       |
  995|  94.3M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 91.4M, False: 2.88M]
  |  Branch (995:30): [True: 91.2M, False: 207k]
  |  Branch (995:52): [True: 90.5M, False: 778k]
  ------------------
  996|  90.5M|			copy.push_back(*spanEnd);
  997|  90.5M|			continue;	// A regular ASCII character.
  998|  90.5M|		}
  999|       |
 1000|  3.86M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 40.7k, False: 3.82M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  40.7k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  40.7k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 40.7k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  40.7k|				copy.append((const char*)spanEnd, uniLen);
 1010|  40.7k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  40.7k|			} 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|  3.82M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 2.88M, False: 945k]
  |  Branch (1026:36): [True: 166k, False: 778k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|  3.04M|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|  3.04M|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|  3.03M|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   180k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 16.1k, False: 3.03M]
  |  Branch (1030:31): [True: 2.85M, False: 180k]
  |  Branch (1030:52): [True: 13.4k, False: 166k]
  ------------------
 1031|  2.88M|				copy.push_back(*spanEnd);
 1032|  2.88M|				continue;
 1033|  2.88M|			}
 1034|       |
 1035|   166k|			copy.push_back(' ');
 1036|       |		
 1037|   778k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   778k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   778k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   778k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   778k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 20, False: 778k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     20|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 20, False: 0]
  ------------------
 1048|     20|					copy.push_back('&');
 1049|     20|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     20|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   778k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 25.7k, False: 753k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  25.7k|				copy.push_back(' ');
 1058|  25.7k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   753k|			} else {
 1061|   753k|				copy.push_back('&');
 1062|   753k|			}
 1063|       |
 1064|   778k|		}
 1065|       |		
 1066|  3.86M|	}
 1067|       |	
 1068|  7.72k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  7.72k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  7.72k|	copy.push_back(' ');
 1070|  7.72k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  7.72k|	return length;
 1072|       |
 1073|  7.72k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  40.7k|{
  868|  40.7k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  40.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  40.7k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 40.7k]
  ------------------
  870|  40.7k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 40.7k]
  ------------------
  871|       |	
  872|  40.7k|	int byteCount = 2;
  873|  40.7k|	XMP_Uns8 firstByte = *charStart;
  874|  50.8k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 10.0k, False: 40.7k]
  ------------------
  875|       |	
  876|  40.7k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 40.7k]
  ------------------
  877|       |
  878|  91.6k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 50.8k, False: 40.7k]
  ------------------
  879|  50.8k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 50.8k]
  ------------------
  880|  50.8k|	}
  881|       |	
  882|  40.7k|	return byteCount;
  883|       |	
  884|  40.7k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   778k|{
  898|   778k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   778k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   778k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 778k]
  ------------------
  900|   778k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   778k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   778k|	size_t tailLen = bufEnd - escStart;
  903|   778k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 20, False: 778k]
  ------------------
  904|       |	
  905|   778k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 333k, False: 445k]
  ------------------
  906|       |	
  907|   445k|	XMP_Uns8 escValue = 0;
  908|   445k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   445k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 402k, False: 42.6k]
  |  Branch (910:27): [True: 297k, False: 105k]
  ------------------
  911|   297k|		escValue = *escPos - '0';
  912|   297k|		++escPos;
  913|   297k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 103k, False: 45.1k]
  |  Branch (913:34): [True: 70.9k, False: 32.4k]
  ------------------
  914|  70.9k|		escValue = *escPos - 'A' + 10;
  915|  70.9k|		++escPos;
  916|  77.5k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 22.0k, False: 55.5k]
  |  Branch (916:34): [True: 7.18k, False: 14.8k]
  ------------------
  917|  7.18k|		escValue = *escPos - 'a' + 10;
  918|  7.18k|		++escPos;
  919|  7.18k|	}
  920|       |	
  921|   445k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 319k, False: 125k]
  |  Branch (921:27): [True: 104k, False: 215k]
  ------------------
  922|   104k|		escValue = (escValue << 4) + (*escPos - '0');
  923|   104k|		++escPos;
  924|   341k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 76.9k, False: 264k]
  |  Branch (924:34): [True: 23.2k, False: 53.7k]
  ------------------
  925|  23.2k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  23.2k|		++escPos;
  927|   318k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 39.1k, False: 278k]
  |  Branch (927:34): [True: 5.77k, False: 33.3k]
  ------------------
  928|  5.77k|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|  5.77k|		++escPos;
  930|  5.77k|	}
  931|       |	
  932|   445k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 445k]
  ------------------
  933|   445k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 306k, False: 139k]
  ------------------
  934|       |	
  935|   139k|	size_t escLen = escPos - escStart + 1;
  936|   139k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 2.40k, False: 136k]
  ------------------
  937|       |	
  938|   136k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|   136k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  26.6k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  26.2k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 110k, False: 26.6k]
  |  Branch (938:29): [True: 394, False: 26.2k]
  |  Branch (938:50): [True: 473, False: 25.7k]
  ------------------
  939|       |	
  940|  25.7k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|   136k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  7.62k|{
  152|  7.62k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  7.62k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 143, False: 7.47k]
  ------------------
  155|  7.62k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 624, False: 6.99k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  6.99k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  6.99k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  6.99k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  6.99k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 6.99k]
  ------------------
  164|      0|		     ((rootNode->parent == 0) ||
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|		      ((rootNode->parent->name != "x:xmpmeta") && (rootNode->parent->name != "x:xapmeta"))) ) return 0;
  ------------------
  |  Branch (165:10): [True: 0, False: 0]
  |  Branch (165:53): [True: 0, False: 0]
  ------------------
  166|       |
  167|  7.40k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.31k, False: 6.09k]
  ------------------
  168|  1.31k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.31k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 869, False: 443]
  |  Branch (169:42): [True: 35, False: 408]
  ------------------
  170|    904|				verStr = currAttr->value.c_str();
  171|    904|				break;
  172|    904|			}
  173|  1.31k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  6.99k|	unsigned long part;
  178|  37.5k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 31.4k, False: 6.13k]
  |  Branch (178:29): [True: 2.88k, False: 28.5k]
  |  Branch (178:48): [True: 27.7k, False: 866]
  ------------------
  179|       |	
  180|  6.99k|	part = 0;
  181|  9.72k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.57k, False: 6.14k]
  |  Branch (181:28): [True: 2.90k, False: 674]
  |  Branch (181:48): [True: 2.72k, False: 175]
  ------------------
  182|  2.72k|		part = (part * 10) + (*verStr - '0');
  183|  2.72k|		++verStr;
  184|  2.72k|	}
  185|  6.99k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 109, False: 6.88k]
  ------------------
  186|  6.99k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  6.99k|	part = 0;
  189|  6.99k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 409, False: 6.58k]
  ------------------
  190|  7.97k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 1.82k, False: 6.15k]
  |  Branch (190:28): [True: 1.16k, False: 661]
  |  Branch (190:48): [True: 979, False: 181]
  ------------------
  191|    979|		part = (part * 10) + (*verStr - '0');
  192|    979|		++verStr;
  193|    979|	}
  194|  6.99k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 55, False: 6.94k]
  ------------------
  195|  6.99k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  6.99k|	part = 0;
  198|  6.99k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 137, False: 6.86k]
  ------------------
  199|  9.49k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 3.32k, False: 6.17k]
  |  Branch (199:28): [True: 2.72k, False: 601]
  |  Branch (199:48): [True: 2.49k, False: 225]
  ------------------
  200|  2.49k|		part = (part * 10) + (*verStr - '0');
  201|  2.49k|		++verStr;
  202|  2.49k|	}
  203|  6.99k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 79, False: 6.91k]
  ------------------
  204|  6.99k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  6.99k|	part = 0;
  207|  6.99k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 287, False: 6.71k]
  ------------------
  208|  7.70k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.52k, False: 6.18k]
  |  Branch (208:28): [True: 1.20k, False: 317]
  |  Branch (208:48): [True: 707, False: 498]
  ------------------
  209|    707|		part = (part * 10) + (*verStr - '0');
  210|    707|		++verStr;
  211|    707|	}
  212|  6.99k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 58, False: 6.94k]
  ------------------
  213|  6.99k|	thiz->prevTkVer += part;
  214|       |	
  215|  6.99k|	return rootNode;
  216|       |	
  217|  6.99k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  23.5k|{
  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|  49.7k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 26.3k, False: 23.3k]
  ------------------
  116|  26.3k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  26.3k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 24.5k, False: 1.79k]
  ------------------
  118|  1.79k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 173, False: 1.62k]
  |  Branch (118:44): [True: 0, False: 1.62k]
  ------------------
  119|  1.79k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  23.3k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 23.3k, False: 0]
  ------------------
  122|  48.9k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 25.6k, False: 23.2k]
  ------------------
  123|  25.6k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  25.6k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 24.0k, False: 1.60k]
  ------------------
  125|  1.60k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 127, False: 1.47k]
  ------------------
  126|  1.60k|		}
  127|  23.3k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  46.5k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 23.2k, False: 23.2k]
  ------------------
  131|  23.2k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  23.2k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 7, False: 23.2k]
  ------------------
  133|  23.2k|	}
  134|       |	
  135|  23.2k|	return 0;
  136|       |
  137|  23.2k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  5.55k|{
  232|  5.55k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.55k|#define kXMP_ExistingOnly	false
  ------------------
  233|  5.55k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 4.87k, False: 685]
  ------------------
  234|       |	
  235|  3.02k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 2.34k, False: 685]
  ------------------
  236|  2.34k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  2.34k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  2.34k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 662, False: 1.67k]
  ------------------
  240|       |		
  241|  1.67k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 46, False: 1.63k]
  ------------------
  242|  1.63k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 0, False: 1.63k]
  ------------------
  243|     46|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  1.63k|		} else if (
  245|  1.63k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 12, False: 1.62k]
  ------------------
  246|  1.62k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 111, False: 1.50k]
  ------------------
  247|  1.50k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 35, False: 1.47k]
  ------------------
  248|    158|			arrayForm = kXMP_PropArrayIsAltText;
  249|  1.47k|		} else if (
  250|  1.47k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 11, False: 1.46k]
  ------------------
  251|  1.46k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 51, False: 1.41k]
  ------------------
  252|  1.41k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 7, False: 1.40k]
  ------------------
  253|  1.40k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 98, False: 1.30k]
  ------------------
  254|  1.30k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 25, False: 1.28k]
  ------------------
  255|  1.28k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 10, False: 1.27k]
  ------------------
  256|    202|			arrayForm = kXMP_PropValueIsArray;
  257|    202|		}
  258|  1.67k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 1.27k, False: 406]
  ------------------
  259|       |		
  260|    406|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    406|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    406|		dcSchema->children[propNum] = newArray;
  263|    406|		newArray->children.push_back ( currProp );
  264|    406|		currProp->parent = newArray;
  265|    406|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    406|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    406|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 158, False: 248]
  |  Branch (267:44): [True: 123, False: 35]
  ------------------
  268|    123|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    123|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    123|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 123, False: 0]
  ------------------
  271|    123|				currProp->qualifiers.push_back ( newLang );
  272|    123|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    123|		}
  276|       |
  277|    406|	}
  278|       |	
  279|    685|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  5.55k|{
  666|  5.55k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  5.55k|	XMP_Node * currSchema = 0;
  671|       |
  672|  5.55k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.55k|#define kXMP_ExistingOnly	false
  ------------------
  673|  5.55k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 10, False: 5.54k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     10|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     10|#define kXMP_ExistingOnly	false
  ------------------
  677|     10|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 10]
  ------------------
  678|       |	
  679|       |		// *** Should probably have RepairAltText change simple values to LangAlt with 'x-default' item.
  680|       |		// *** For now just do this for exif:UserComment, the one case we know about, late in cycle fix.
  681|     10|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     10|#define kXMP_ExistingOnly	false
  ------------------
  682|     10|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 10]
  |  Branch (682:30): [True: 0, False: 0]
  ------------------
  683|      0|			XMP_Node * newChild = new XMP_Node ( userComment, kXMP_ArrayItemName,
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  684|      0|												 userComment->value.c_str(), userComment->options );
  685|      0|			newChild->qualifiers.swap ( userComment->qualifiers );
  686|      0|			if ( ! XMP_PropHasLang ( newChild->options ) ) {
  ------------------
  |  Branch (686:9): [True: 0, False: 0]
  ------------------
  687|      0|				XMP_Node * langQual = new XMP_Node ( newChild, "xml:lang", "x-default", kXMP_PropIsQualifier );
  688|      0|				newChild->qualifiers.insert ( newChild->qualifiers.begin(), langQual );
  689|      0|				newChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  690|      0|			}
  691|      0|			userComment->value.erase();
  692|      0|			userComment->options = kXMP_PropArrayFormMask;	// ! Happens to have all the right bits.
  693|      0|			userComment->children.push_back ( newChild );
  694|      0|		}
  695|       |
  696|     10|	}
  697|       |
  698|  5.55k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.55k|#define kXMP_ExistingOnly	false
  ------------------
  699|  5.55k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 5.55k]
  ------------------
  700|       |		// Do a special case migration of xmpDM:copyright to dc:rights['x-default']. Do this before
  701|       |		// the dc: touch up since it can affect the dc: schema.
  702|      0|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|      0|#define kXMP_ExistingOnly	false
  ------------------
  703|      0|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 0]
  ------------------
  704|      0|	}
  705|       |
  706|  5.55k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.55k|#define kXMP_ExistingOnly	false
  ------------------
  707|  5.55k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 685, False: 4.87k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    685|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    685|#define kXMP_ExistingOnly	false
  ------------------
  710|    685|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 25, False: 660]
  ------------------
  711|     25|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     25|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     25|		}
  714|    685|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  5.55k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  5.55k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  5.55k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  5.55k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  5.55k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  5.55k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 276, False: 5.28k]
  ------------------
  732|       |
  733|    276|		bool nameIsUUID = false;
  734|    276|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    276|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    276|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 41, False: 235]
  |  |  ------------------
  ------------------
  737|       |
  738|     41|			nameIsUUID = true;
  739|       |
  740|    235|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 120, False: 115]
  ------------------
  741|       |
  742|    120|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  2.38k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 2.36k, False: 24]
  ------------------
  744|  2.36k|				char ch = nameStr[i];
  745|  2.36k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 137, False: 2.22k]
  ------------------
  746|    137|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 43, False: 94]
  |  Branch (746:23): [True: 30, False: 64]
  |  Branch (746:36): [True: 25, False: 39]
  |  Branch (746:49): [True: 21, False: 18]
  ------------------
  747|     18|					nameIsUUID = false;
  748|     18|					break;
  749|  2.22k|				} else {
  750|  2.22k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 2.19k, False: 28]
  |  Branch (750:27): [True: 480, False: 1.71k]
  |  Branch (750:44): [True: 1.67k, False: 65]
  |  Branch (750:59): [True: 1.66k, False: 13]
  ------------------
  751|     78|					nameIsUUID = false;
  752|     78|					break;
  753|  2.22k|				}
  754|  2.36k|			}
  755|       |
  756|    120|		}
  757|       |		
  758|    276|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 65, False: 211]
  ------------------
  759|       |
  760|     65|			XMP_ExpandedXPath expPath;
  761|     65|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     65|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     65|#define kXMP_CreateNodes	true
  ------------------
  763|     65|			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: 65]
  ------------------
  764|       |
  765|     65|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     65|			idNode->value = tree.name;
  767|     65|			idNode->RemoveChildren();
  768|     65|			idNode->RemoveQualifiers();
  769|       |
  770|     65|			tree.name.erase();
  771|       |
  772|     65|		}
  773|       |
  774|    276|	}
  775|       |
  776|  5.55k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  27.7k|{
  610|  27.7k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  27.7k|#define kXMP_ExistingOnly	false
  ------------------
  611|  27.7k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 25.6k, False: 2.10k]
  ------------------
  612|       |	
  613|  2.10k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.10k|#define kXMP_ExistingOnly	false
  ------------------
  614|  2.10k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.67k, False: 427]
  |  Branch (614:27): [True: 266, False: 161]
  ------------------
  615|       |	
  616|    161|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 1, False: 160]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|    160|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  1.84k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 1.68k, False: 160]
  ------------------
  622|       |
  623|  1.68k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  1.68k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 74, False: 1.61k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     74|			delete ( currChild );
  629|     74|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  1.61k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.37k, False: 235]
  ------------------
  632|       |		
  633|  1.37k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 30, False: 1.34k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     30|				delete ( currChild );
  637|     30|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  1.34k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  1.34k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  1.34k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 1.33k, False: 12]
  ------------------
  644|  1.33k|					currChild->qualifiers.push_back ( repairLang );
  645|  1.33k|				} else {
  646|     12|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     12|				}
  648|  1.34k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  1.34k|			}
  651|       |
  652|  1.37k|		}
  653|       |
  654|  1.68k|	}
  655|       |
  656|    160|}	// RepairAltText

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

_ZN7XMPMetaC2Ev:
  588|  12.2k|XMPMeta::XMPMeta() : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
  589|  12.2k|{
  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|  12.2k|}	// XMPMeta
_ZN7XMPMetaD2Ev:
  599|  12.2k|{
  600|       |	#if XMP_TraceCTorDTor
  601|       |		printf ( "Destruct XMPMeta @ %.8X\n", this );
  602|       |	#endif
  603|       |
  604|  12.2k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  12.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  605|  12.2k|	if ( xmlParser != 0 ) delete ( xmlParser );
  ------------------
  |  Branch (605:7): [True: 0, False: 12.2k]
  ------------------
  606|  12.2k|	xmlParser = 0;
  607|       |
  608|  12.2k|}	// ~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|   392k|{
  845|   392k|	UNUSED(options);
  846|       |
  847|       |    #if TraceXMPLocking
  848|       |    	fprintf ( xmpOut, "  Unlocking XMP toolkit, count = %d\n", sLockCount ); fflush ( xmpOut );
  849|       |	#endif
  850|   392k|    --sLockCount;
  851|   392k|    XMP_Assert ( sLockCount == 0 );
  ------------------
  |  |  142|   392k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  852|   392k|	XMP_ExitCriticalRegion ( sXMPCoreLock );
  853|       |
  854|   392k|}	// Unlock
_ZNK7XMPMeta12UnlockObjectEj:
  863|  4.37k|{
  864|  4.37k|	UNUSED(options);
  865|       |
  866|  4.37k|	XMPMeta::Unlock ( 0 );
  867|       |
  868|  4.37k|}	// UnlockObject
_ZN7XMPMeta17RegisterNamespaceEPKcS1_:
 1041|  49.9k|{
 1042|  49.9k|	if ( (*namespaceURI == 0) || (*prefix == 0) ) {
  ------------------
  |  Branch (1042:7): [True: 0, False: 49.9k]
  |  Branch (1042:31): [True: 0, False: 49.9k]
  ------------------
 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|  49.9k|	XMP_VarString	nsURI ( namespaceURI );
 1047|  49.9k|	XMP_VarString	prfix ( prefix );
 1048|  49.9k|	if ( prfix[prfix.size()-1] != ':' ) prfix += ':';
  ------------------
  |  Branch (1048:7): [True: 49.9k, False: 0]
  ------------------
 1049|  49.9k|	VerifySimpleXMLName ( prefix, prefix+prfix.size()-1 );	// Exclude the colon.
 1050|       |	
 1051|       |        // Set the new namespace in both maps.
 1052|  49.9k|        (*sNamespaceURIToPrefixMap)[nsURI] = prfix;
 1053|  49.9k|        (*sNamespacePrefixToURIMap)[prfix] = nsURI;
 1054|       |	
 1055|  49.9k|}	// RegisterNamespace
_ZN7XMPMeta18GetNamespacePrefixEPKcPS1_Pj:
 1066|   436k|{
 1067|   436k|	bool	found	= false;
 1068|       |	
 1069|   436k|	XMP_Assert ( *namespaceURI != 0 ); 	// ! Enforced by wrapper.
  ------------------
  |  |  142|   436k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1070|   436k|	XMP_Assert ( (namespacePrefix != 0) && (prefixSize != 0) );	// ! Enforced by wrapper.
  ------------------
  |  |  142|   436k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1071|       |
 1072|   436k|	XMP_VarString    nsURI ( namespaceURI );
 1073|   436k|	XMP_StringMapPos uriPos	= sNamespaceURIToPrefixMap->find ( nsURI );
 1074|       |	
 1075|   436k|	if ( uriPos != sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (1075:7): [True: 436k, False: 12]
  ------------------
 1076|   436k|		*namespacePrefix = uriPos->second.c_str();
 1077|   436k|		*prefixSize = uriPos->second.size();
 1078|   436k|		found = true;
 1079|   436k|	}
 1080|       |	
 1081|   436k|	return found;
 1082|       |	
 1083|   436k|}	// GetNamespacePrefix
_ZN7XMPMeta15DeleteNamespaceEPKc:
 1126|    705|{
 1127|    705|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( namespaceURI );
 1128|    705|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) return;
  ------------------
  |  Branch (1128:7): [True: 12, False: 693]
  ------------------
 1129|       |
 1130|    693|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( uriPos->second );
 1131|    693|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) return;
  ------------------
  |  Branch (1131:7): [True: 5, False: 688]
  ------------------
 1132|       |	
 1133|    688|	sNamespaceURIToPrefixMap->erase ( uriPos );
 1134|    688|	sNamespacePrefixToURIMap->erase ( prefixPos );
 1135|       |
 1136|    688|}	// DeleteNamespace
_ZNK7XMPMeta15CountArrayItemsEPKcS1_:
 1510|  3.70k|{
 1511|  3.70k|	XMP_Assert ( (schemaNS != 0) && (arrayName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.70k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1512|       |
 1513|  3.70k|	XMP_ExpandedXPath	expPath;
 1514|  3.70k|	ExpandXPath ( schemaNS, arrayName, &expPath );
 1515|       |	
 1516|  3.70k|	const XMP_Node * arrayNode = FindConstNode ( &tree, expPath );
  ------------------
  |  |  301|  3.70k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.70k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
 1517|       |
 1518|  3.70k|	if ( arrayNode == 0 ) return 0;
  ------------------
  |  Branch (1518:7): [True: 0, False: 3.70k]
  ------------------
 1519|  3.70k|	if ( ! (arrayNode->options & kXMP_PropValueIsArray) ) XMP_Throw ( "The named property is not an array", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1519:7): [True: 0, False: 3.70k]
  ------------------
 1520|  3.70k|	return arrayNode->children.size();
 1521|       |	
 1522|  3.70k|}	// CountArrayItems

_ZN8XMPUtils10InitializeEv:
  640|      1|{
  641|      1|	sComposedPath	= new XMP_VarString();
  642|      1|	sConvertedValue = new XMP_VarString();
  643|      1|	sBase64Str		= new XMP_VarString();
  644|      1|	sCatenatedItems = new XMP_VarString();
  645|      1|	sStandardXMP    = new XMP_VarString();
  646|      1|	sExtendedXMP    = new XMP_VarString();
  647|      1|	sExtendedDigest = new XMP_VarString();
  648|       |
  649|       |	#if XMP_MacBuild && __MWERKS__
  650|       |		LookupTimeProcs();
  651|       |	#endif
  652|       |
  653|      1|	return true;
  654|       |
  655|      1|}	// Initialize
_ZN8XMPUtils9TerminateEv:
  666|      1|{
  667|      1|	EliminateGlobal ( sComposedPath );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  668|      1|	EliminateGlobal ( sConvertedValue );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  669|      1|	EliminateGlobal ( sBase64Str );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  670|      1|	EliminateGlobal ( sCatenatedItems );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  671|      1|	EliminateGlobal ( sStandardXMP );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  672|      1|	EliminateGlobal ( sExtendedXMP );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  673|      1|	EliminateGlobal ( sExtendedDigest );
  ------------------
  |  |  662|      1|#define EliminateGlobal(g) delete ( g ); g = 0
  ------------------
  674|       |
  675|      1|	return;
  676|       |
  677|      1|}	// Terminate
_ZN8XMPUtils20ComposeQualifierPathEPKcS1_S1_S1_PS1_Pj:
  790|  3.28k|{
  791|  3.28k|	XMP_Assert ( (schemaNS != 0) && (qualNS != 0) );		// Enforced by wrapper.
  ------------------
  |  |  142|  3.28k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  792|  3.28k|	XMP_Assert ( (*propName != 0) && (*qualName != 0) );	// Enforced by wrapper.
  ------------------
  |  |  142|  3.28k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  793|  3.28k|	XMP_Assert ( (fullPath != 0) && (pathSize != 0) );		// Enforced by wrapper.
  ------------------
  |  |  142|  3.28k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  794|       |
  795|  3.28k|	XMP_ExpandedXPath expPath;	// Just for side effects to check namespace and basic path.
  796|  3.28k|	ExpandXPath ( schemaNS, propName, &expPath );
  797|       |
  798|  3.28k|	XMP_ExpandedXPath qualPath;
  799|  3.28k|	ExpandXPath ( qualNS, qualName, &qualPath );
  800|  3.28k|	if ( qualPath.size() != 2 ) XMP_Throw ( "The qualifier name must be simple", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (800:7): [True: 0, False: 3.28k]
  ------------------
  801|       |
  802|  3.28k|	XMP_StringLen reserveLen = strlen(propName) + qualPath[kRootPropStep].step.size() + 2;
  803|       |
  804|  3.28k|	sComposedPath->erase();
  805|  3.28k|	sComposedPath->reserve ( reserveLen );
  806|  3.28k|	*sComposedPath = propName;
  807|  3.28k|	*sComposedPath += "/?";
  808|  3.28k|	*sComposedPath += qualPath[kRootPropStep].step;
  809|       |
  810|  3.28k|	*fullPath = sComposedPath->c_str();
  811|  3.28k|	*pathSize = sComposedPath->size();
  812|       |
  813|  3.28k|}	// ComposeQualifierPath
_ZN8XMPUtils13ConvertToDateEPKcP12XMP_DateTime:
 1293|    516|{
 1294|    516|	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: 516]
  |  Branch (1294:26): [True: 1, False: 515]
  ------------------
 1295|       |
 1296|    515|	size_t	 pos = 0;
 1297|    515|	XMP_Int32 temp;
 1298|       |
 1299|    515|	XMP_Assert ( sizeof(*binValue) == sizeof(XMP_DateTime) );
  ------------------
  |  |  142|    515|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1300|    515|	(void) memset ( binValue, 0, sizeof(*binValue) );	// AUDIT: Safe, using sizeof destination.
 1301|       |
 1302|    515|	bool timeOnly = ( (strValue[0] == 'T') ||
  ------------------
  |  Branch (1302:20): [True: 211, False: 304]
  ------------------
 1303|    304|					  ((strlen(strValue) >= 2) && (strValue[1] == ':')) ||
  ------------------
  |  Branch (1303:9): [True: 301, False: 3]
  |  Branch (1303:36): [True: 19, False: 282]
  ------------------
 1304|    285|					  ((strlen(strValue) >= 3) && (strValue[2] == ':')) );
  ------------------
  |  Branch (1304:9): [True: 278, False: 7]
  |  Branch (1304:36): [True: 20, False: 258]
  ------------------
 1305|       |
 1306|    515|	if ( ! timeOnly ) {
  ------------------
  |  Branch (1306:7): [True: 265, False: 250]
  ------------------
 1307|       |
 1308|    265|		if ( strValue[0] == '-' ) pos = 1;
  ------------------
  |  Branch (1308:8): [True: 179, False: 86]
  ------------------
 1309|       |
 1310|    265|		temp = GatherInt ( strValue, &pos, "Invalid year in date string" ); // Extract the year.
 1311|    265|		if ( (strValue[pos] != 0) && (strValue[pos] != '-') ) XMP_Throw ( "Invalid date string, after year", kXMPErr_BadParam );
  ------------------
  |  |  199|     14|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1311:8): [True: 165, False: 100]
  |  Branch (1311:32): [True: 14, False: 151]
  ------------------
 1312|    251|		if ( strValue[0] == '-' ) temp = -temp;
  ------------------
  |  Branch (1312:8): [True: 147, False: 104]
  ------------------
 1313|    251|		binValue->year = temp;
 1314|    251|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1314:8): [True: 58, False: 193]
  ------------------
 1315|       |
 1316|    193|		++pos;
 1317|    193|		temp = GatherInt ( strValue, &pos, "Invalid month in date string" );	// Extract the month.
 1318|    193|		if ( (temp < 1) || (temp > 12) ) XMP_Throw ( "Month is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|     20|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1318:8): [True: 72, False: 121]
  |  Branch (1318:22): [True: 14, False: 107]
  ------------------
 1319|    173|		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: 76, False: 97]
  |  Branch (1319:32): [True: 1, False: 75]
  ------------------
 1320|    172|		binValue->month = temp;
 1321|    172|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1321:8): [True: 31, False: 141]
  ------------------
 1322|       |
 1323|    141|		++pos;
 1324|    141|		temp = GatherInt ( strValue, &pos, "Invalid day in date string" );	// Extract the day.
 1325|    141|		if ( (temp < 1) || (temp > 31) ) XMP_Throw ( "Day is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1325:8): [True: 110, False: 31]
  |  Branch (1325:22): [True: 15, False: 16]
  ------------------
 1326|    106|		if ( (strValue[pos] != 0) && (strValue[pos] != 'T') ) XMP_Throw ( "Invalid date string, after day", kXMPErr_BadParam );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1326:8): [True: 7, False: 99]
  |  Branch (1326:32): [True: 6, False: 1]
  ------------------
 1327|    100|		binValue->day = temp;
 1328|    100|		if ( strValue[pos] == 0 ) return;
  ------------------
  |  Branch (1328:8): [True: 9, False: 91]
  ------------------
 1329|       |
 1330|       |		// Allow year, month, and day to all be zero; implies the date portion is missing.
 1331|     91|		if ( (binValue->year != 0) || (binValue->month != 0) || (binValue->day != 0) ) {
  ------------------
  |  Branch (1331:8): [True: 90, False: 1]
  |  Branch (1331:33): [True: 1, 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|     91|	}
 1342|       |
 1343|    341|	if ( strValue[pos] == 'T' ) {
  ------------------
  |  Branch (1343:7): [True: 212, False: 129]
  ------------------
 1344|    212|		++pos;
 1345|    212|	} else if ( ! timeOnly ) {
  ------------------
  |  Branch (1345:14): [True: 0, False: 129]
  ------------------
 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|    341|	temp = GatherInt ( strValue, &pos, "Invalid hour in date string" ); // Extract the hour.
 1350|    341|	if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after hour", kXMPErr_BadParam );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1350:7): [True: 10, False: 331]
  ------------------
 1351|    331|	if ( temp < 0 || temp > 23 ) temp = 23;	// *** 1269463: XMP_Throw ( "Hour is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1351:7): [True: 137, False: 194]
  |  Branch (1351:19): [True: 60, False: 134]
  ------------------
 1352|    331|	binValue->hour = temp;
 1353|       |	// Don't check for done, we have to work up to the time zone.
 1354|       |
 1355|    331|	++pos;
 1356|    331|	temp = GatherInt ( strValue, &pos, "Invalid minute in date string" );	// And the minute.
 1357|    331|	if ( (strValue[pos] != ':') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1357:7): [True: 85, False: 246]
  |  Branch (1357:33): [True: 84, False: 1]
  ------------------
 1358|    324|		 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) XMP_Throw ( "Invalid date string, after minute", kXMPErr_BadParam );
  ------------------
  |  |  199|      7|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1358:4): [True: 40, False: 44]
  |  Branch (1358:30): [True: 34, False: 6]
  |  Branch (1358:56): [True: 7, False: 27]
  ------------------
 1359|    324|	if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Minute is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1359:7): [True: 143, False: 181]
  |  Branch (1359:19): [True: 99, False: 82]
  ------------------
 1360|    324|	binValue->minute = temp;
 1361|       |	// Don't check for done, we have to work up to the time zone.
 1362|       |
 1363|    324|	if ( strValue[pos] == ':' ) {
  ------------------
  |  Branch (1363:7): [True: 103, False: 221]
  ------------------
 1364|       |
 1365|    103|		++pos;
 1366|    103|		temp = GatherInt ( strValue, &pos, "Invalid whole seconds in date string" );	// Extract the whole seconds.
 1367|    103|		if ( (strValue[pos] != '.') && (strValue[pos] != 'Z') &&
  ------------------
  |  Branch (1367:8): [True: 46, False: 57]
  |  Branch (1367:34): [True: 45, False: 1]
  ------------------
 1368|     45|			 (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1368:5): [True: 29, False: 16]
  |  Branch (1368:31): [True: 24, False: 5]
  |  Branch (1368:57): [True: 13, False: 11]
  ------------------
 1369|     13|			XMP_Throw ( "Invalid date string, after whole seconds", kXMPErr_BadParam );
  ------------------
  |  |  199|     13|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1370|      0|		}
 1371|     90|		if ( temp < 0 || temp > 59 ) temp = 59;	// *** 1269463: XMP_Throw ( "Whole second is out of range", kXMPErr_BadParam );
  ------------------
  |  Branch (1371:8): [True: 10, False: 80]
  |  Branch (1371:20): [True: 17, False: 63]
  ------------------
 1372|     90|		binValue->second = temp;
 1373|       |		// Don't check for done, we have to work up to the time zone.
 1374|       |
 1375|     90|		if ( strValue[pos] == '.' ) {
  ------------------
  |  Branch (1375:8): [True: 47, False: 43]
  ------------------
 1376|       |
 1377|     47|			++pos;
 1378|     47|			size_t digits = pos;	// Will be the number of digits later.
 1379|       |
 1380|     47|			temp = GatherInt ( strValue, &pos, "Invalid fractional seconds in date string" );	// Extract the fractional seconds.
 1381|     47|			if ( (strValue[pos] != 'Z') && (strValue[pos] != '+') && (strValue[pos] != '-') && (strValue[pos] != 0) ) {
  ------------------
  |  Branch (1381:9): [True: 40, False: 7]
  |  Branch (1381:35): [True: 39, False: 1]
  |  Branch (1381:61): [True: 35, False: 4]
  |  Branch (1381:87): [True: 9, False: 26]
  ------------------
 1382|      9|				XMP_Throw ( "Invalid date string, after fractional second", kXMPErr_BadParam );
  ------------------
  |  |  199|      9|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1383|      0|			}
 1384|       |
 1385|     38|			digits = pos - digits;
 1386|  1.00k|			for ( ; digits > 9; --digits ) temp = temp / 10;
  ------------------
  |  Branch (1386:12): [True: 971, False: 38]
  ------------------
 1387|    123|			for ( ; digits < 9; ++digits ) temp = temp * 10;
  ------------------
  |  Branch (1387:12): [True: 85, False: 38]
  ------------------
 1388|       |
 1389|     38|			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: 5, False: 33]
  |  Branch (1389:21): [True: 0, False: 33]
  ------------------
 1390|     38|			binValue->nanoSecond = temp;
 1391|       |			// Don't check for done, we have to work up to the time zone.
 1392|       |
 1393|     38|		}
 1394|       |
 1395|     90|	}
 1396|       |
 1397|    302|	if ( strValue[pos] == 'Z' ) {
  ------------------
  |  Branch (1397:7): [True: 4, False: 298]
  ------------------
 1398|       |
 1399|      4|		++pos;
 1400|       |
 1401|    298|	} else if ( strValue[pos] != 0 ) {
  ------------------
  |  Branch (1401:14): [True: 76, False: 222]
  ------------------
 1402|       |
 1403|     76|		if ( strValue[pos] == '+' ) {
  ------------------
  |  Branch (1403:8): [True: 61, False: 15]
  ------------------
 1404|     61|			binValue->tzSign = kXMP_TimeEastOfUTC;
 1405|     61|		} else if ( strValue[pos] == '-' ) {
  ------------------
  |  Branch (1405:15): [True: 15, False: 0]
  ------------------
 1406|     15|			binValue->tzSign = kXMP_TimeWestOfUTC;
 1407|     15|		} 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|     76|		++pos;
 1412|     76|		temp = GatherInt ( strValue, &pos, "Invalid time zone hour in date string" );	// Extract the time zone hour.
 1413|     76|		if ( strValue[pos] != ':' ) XMP_Throw ( "Invalid date string, after time zone hour", kXMPErr_BadParam );
  ------------------
  |  |  199|     15|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1413:8): [True: 15, False: 61]
  ------------------
 1414|     61|		if ( temp < 0 || temp > 23 ) XMP_Throw ( "Time zone hour is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|     17|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1414:8): [True: 15, False: 46]
  |  Branch (1414:20): [True: 17, False: 29]
  ------------------
 1415|     44|		binValue->tzHour = temp;
 1416|       |
 1417|     44|		++pos;
 1418|     44|		temp = GatherInt ( strValue, &pos, "Invalid time zone minute in date string" ); // Extract the time zone minute.
 1419|     44|		if ( temp < 0 || temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam );
  ------------------
  |  |  199|     13|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1419:8): [True: 21, False: 23]
  |  Branch (1419:20): [True: 13, False: 10]
  ------------------
 1420|     31|		binValue->tzMinute = temp;
 1421|       |
 1422|    222|	} else {
 1423|       |
 1424|    222|		XMPUtils::SetTimeZone( binValue );
 1425|       |
 1426|    222|	}
 1427|       |
 1428|    257|	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: 255]
  ------------------
 1429|       |
 1430|    255|}	// ConvertToDate
_ZN8XMPUtils11SetTimeZoneEP12XMP_DateTime:
 1946|    238|{
 1947|    238|	XMP_Assert ( xmpTime != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    238|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1948|       |
 1949|    238|	if ( (xmpTime->tzSign != 0) || (xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0) ) {
  ------------------
  |  Branch (1949:7): [True: 0, False: 238]
  |  Branch (1949:33): [True: 0, False: 238]
  |  Branch (1949:59): [True: 0, False: 238]
  ------------------
 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|    238|	ansi_tt ttTime;
 1956|    238|	ansi_tm tmLocal, tmUTC;
 1957|       |
 1958|    238|	if ( (xmpTime->year == 0) && (xmpTime->month == 0) && (xmpTime->day == 0) ) {
  ------------------
  |  Branch (1958:7): [True: 137, False: 101]
  |  Branch (1958:31): [True: 133, False: 4]
  |  Branch (1958:56): [True: 133, False: 0]
  ------------------
 1959|    133|		ansi_tt now = ansi_time(0);
  ------------------
  |  |   69|    133|	#define ansi_time		time
  ------------------
 1960|    133|		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: 133]
  ------------------
 1961|    133|		ansi_localtime ( &now, &tmLocal );
  ------------------
  |  |   74|    133|	#define ansi_localtime	localtime_r
  ------------------
 1962|    133|	} else {
 1963|    105|		if (xmpTime->year < std::numeric_limits<decltype(tmLocal.tm_year)>::min() + 1900) {
  ------------------
  |  Branch (1963:7): [True: 5, False: 100]
  ------------------
 1964|      5|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      5|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1965|    100|		} else if (xmpTime->year > std::numeric_limits<decltype(tmLocal.tm_year)>::max()) {
  ------------------
  |  Branch (1965:14): [True: 0, False: 100]
  ------------------
 1966|      0|			XMP_Throw ( "Invalid year", kXMPErr_BadParam);
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1967|    100|		} else {
 1968|    100|			tmLocal.tm_year = xmpTime->year - 1900;
 1969|    100|		}
 1970|    100|		tmLocal.tm_mon	 = xmpTime->month - 1;
 1971|    100|		tmLocal.tm_mday	 = xmpTime->day;
 1972|    100|	}
 1973|       |
 1974|    233|	tmLocal.tm_hour = xmpTime->hour;
 1975|    233|	tmLocal.tm_min = xmpTime->minute;
 1976|    233|	tmLocal.tm_sec = xmpTime->second;
 1977|    233|	tmLocal.tm_isdst = -1;	// Don't know if daylight time is in effect.
 1978|       |
 1979|    233|	ttTime = ansi_mktime ( &tmLocal );
  ------------------
  |  |   70|    233|	#define ansi_mktime		mktime
  ------------------
 1980|    233|	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: 233]
  ------------------
 1981|       |
 1982|       |	// Convert back to a localized ansi_tm time and get the corresponding UTC ansi_tm time.
 1983|       |
 1984|    233|	ansi_localtime ( &ttTime, &tmLocal );
  ------------------
  |  |   74|    233|	#define ansi_localtime	localtime_r
  ------------------
 1985|    233|	ansi_gmtime ( &ttTime, &tmUTC );
  ------------------
  |  |   73|    233|	#define ansi_gmtime		gmtime_r
  ------------------
 1986|       |
 1987|       |	// Get the offset direction and amount.
 1988|       |
 1989|    233|	ansi_tm tmx = tmLocal;	// ! Note that mktime updates the ansi_tm parameter, messing up difftime!
 1990|    233|	ansi_tm tmy = tmUTC;
 1991|    233|	tmx.tm_isdst = tmy.tm_isdst = 0;
 1992|    233|	ansi_tt ttx = ansi_mktime ( &tmx );
  ------------------
  |  |   70|    233|	#define ansi_mktime		mktime
  ------------------
 1993|    233|	ansi_tt tty = ansi_mktime ( &tmy );
  ------------------
  |  |   70|    233|	#define ansi_mktime		mktime
  ------------------
 1994|    233|	double diffSecs;
 1995|       |
 1996|    233|	if ( (ttx != -1) && (tty != -1) ) {
  ------------------
  |  Branch (1996:7): [True: 233, False: 0]
  |  Branch (1996:22): [True: 233, False: 0]
  ------------------
 1997|    233|		diffSecs = ansi_difftime ( ttx, tty );
  ------------------
  |  |   71|    233|	#define ansi_difftime	difftime
  ------------------
 1998|    233|	} 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|    233|	if ( diffSecs > 0.0 ) {
  ------------------
  |  Branch (2017:7): [True: 0, False: 233]
  ------------------
 2018|      0|		xmpTime->tzSign = kXMP_TimeEastOfUTC;
 2019|    233|	} else if ( diffSecs == 0.0 ) {
  ------------------
  |  Branch (2019:14): [True: 233, False: 0]
  ------------------
 2020|    233|		xmpTime->tzSign = kXMP_TimeIsUTC;
 2021|    233|	} else {
 2022|      0|		xmpTime->tzSign = kXMP_TimeWestOfUTC;
 2023|      0|		diffSecs = -diffSecs;
 2024|      0|	}
 2025|    233|	xmpTime->tzHour = XMP_Int32 ( diffSecs / 3600.0 );
 2026|    233|	xmpTime->tzMinute = XMP_Int32 ( (diffSecs / 60.0) - (xmpTime->tzHour * 60.0) );
 2027|       |
 2028|       |	// *** Save the tm_isdst flag in a qualifier?
 2029|       |
 2030|    233|	XMP_Assert ( (0 <= xmpTime->tzHour) && (xmpTime->tzHour <= 23) );
  ------------------
  |  |  142|    233|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2031|    233|	XMP_Assert ( (0 <= xmpTime->tzMinute) && (xmpTime->tzMinute <= 59) );
  ------------------
  |  |  142|    233|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2032|    233|	XMP_Assert ( (-1 <= xmpTime->tzSign) && (xmpTime->tzSign <= +1) );
  ------------------
  |  |  142|    233|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2033|    233|	XMP_Assert ( (xmpTime->tzSign == 0) ? ((xmpTime->tzHour == 0) && (xmpTime->tzMinute == 0)) :
  ------------------
  |  |  142|    233|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2034|    233|										  ((xmpTime->tzHour != 0) || (xmpTime->tzMinute != 0)) );
 2035|       |
 2036|    233|}	// SetTimeZone
_ZN8XMPUtils16ConvertToUTCTimeEP12XMP_DateTime:
 2045|    174|{
 2046|    174|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2047|       |
 2048|    174|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2049|    174|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2050|    174|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2051|    174|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2052|    174|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2053|       |
 2054|    174|	if ( time->tzSign == kXMP_TimeEastOfUTC ) {
  ------------------
  |  Branch (2054:7): [True: 8, False: 166]
  ------------------
 2055|       |		// We are before (east of) GMT, subtract the offset from the time.
 2056|      8|		time->hour -= time->tzHour;
 2057|      8|		time->minute -= time->tzMinute;
 2058|    166|	} else if ( time->tzSign == kXMP_TimeWestOfUTC ) {
  ------------------
  |  Branch (2058:14): [True: 2, False: 164]
  ------------------
 2059|       |		// We are behind (west of) GMT, add the offset to the time.
 2060|      2|		time->hour += time->tzHour;
 2061|      2|		time->minute += time->tzMinute;
 2062|      2|	}
 2063|       |
 2064|    174|	AdjustTimeOverflow ( time );
 2065|    174|	time->tzSign = time->tzHour = time->tzMinute = 0;
 2066|       |
 2067|    174|}	// ConvertToUTCTime
_ZN8XMPUtils18ConvertToLocalTimeEP12XMP_DateTime:
 2076|    174|{
 2077|    174|	XMP_Assert ( time != 0 );	// ! Enforced by wrapper.
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2078|       |
 2079|    174|	XMP_Assert ( (0 <= time->tzHour) && (time->tzHour <= 23) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2080|    174|	XMP_Assert ( (0 <= time->tzMinute) && (time->tzMinute <= 59) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2081|    174|	XMP_Assert ( (-1 <= time->tzSign) && (time->tzSign <= +1) );
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2082|    174|	XMP_Assert ( (time->tzSign == 0) ? ((time->tzHour == 0) && (time->tzMinute == 0)) :
  ------------------
  |  |  142|    174|	#define XMP_Assert(c)	((void) 0)
  ------------------
 2083|    174|									   ((time->tzHour != 0) || (time->tzMinute != 0)) );
 2084|       |
 2085|    174|	ConvertToUTCTime ( time );	// The existing time zone might not be the local one.
 2086|    174|	SetTimeZone ( time );		// Fill in the local timezone offset, then adjust the time.
 2087|       |
 2088|    174|	if ( time->tzSign > 0 ) {
  ------------------
  |  Branch (2088:7): [True: 0, False: 174]
  ------------------
 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|    174|	} else if ( time->tzSign < 0 ) {
  ------------------
  |  Branch (2092:14): [True: 0, False: 174]
  ------------------
 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|    174|	AdjustTimeOverflow ( time );
 2099|       |
 2100|    174|}	// ConvertToLocalTime
XMPUtils.cpp:_ZL9GatherIntPKcPmS0_:
  368|  1.19k|{
  369|  1.19k|	size_t	 pos   = *_pos;
  370|  1.19k|	XMP_Int32 value = 0;
  371|       |
  372|       |	// Limits for overflow checking. Assuming that the maximum value of XMP_Int32
  373|       |	// is 2147483647, then tens_upperbound == 214748364 and ones_upperbound == 7.
  374|       |	// Most of the time, we can just check that value < tens_upperbound to confirm
  375|       |	// that the calculation won't overflow, which makes the bounds checking more
  376|       |	// efficient for the common case.
  377|  1.19k|	const XMP_Int32 tens_upperbound = std::numeric_limits<XMP_Int32>::max() / 10;
  378|  1.19k|	const XMP_Int32 ones_upperbound = std::numeric_limits<XMP_Int32>::max() % 10;
  379|       |
  380|   529k|	for ( char ch = strValue[pos]; ('0' <= ch) && (ch <= '9'); ++pos, ch = strValue[pos] ) {
  ------------------
  |  Branch (380:33): [True: 529k, False: 643]
  |  Branch (380:48): [True: 528k, False: 465]
  ------------------
  381|   528k|		const XMP_Int32 digit = ch - '0';
  382|   528k|		if (value >= tens_upperbound) {
  ------------------
  |  Branch (382:7): [True: 99, False: 528k]
  ------------------
  383|     99|			if (value > tens_upperbound || digit > ones_upperbound) {
  ------------------
  |  Branch (383:8): [True: 64, False: 35]
  |  Branch (383:35): [True: 19, False: 16]
  ------------------
  384|     83|				XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     83|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  385|      0|			}
  386|     99|		}
  387|   528k|		value = (value * 10) + digit;
  388|   528k|	}
  389|       |
  390|  1.10k|	if ( pos == *_pos ) XMP_Throw ( errMsg, kXMPErr_BadParam );
  ------------------
  |  |  199|     96|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (390:7): [True: 96, False: 1.01k]
  ------------------
  391|  1.01k|	*_pos = pos;
  392|  1.01k|	return value;
  393|       |
  394|  1.10k|}	// GatherInt
XMPUtils.cpp:_ZL18AdjustTimeOverflowP12XMP_DateTime:
  214|    343|{
  215|    343|	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|    343|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (225:7): [True: 190, False: 153]
  |  Branch (225:28): [True: 7, False: 146]
  |  Branch (225:50): [True: 0, False: 146]
  ------------------
  226|       |
  227|    254|		while ( time->month < 1 ) {
  ------------------
  |  Branch (227:11): [True: 57, False: 197]
  ------------------
  228|     57|			time->year -= 1;
  229|     57|			time->month += 12;
  230|     57|		}
  231|       |
  232|    197|		while ( time->month > 12 ) {
  ------------------
  |  Branch (232:11): [True: 0, False: 197]
  ------------------
  233|      0|			time->year += 1;
  234|      0|			time->month -= 12;
  235|      0|		}
  236|       |
  237|    285|		while ( time->day < 1 ) {
  ------------------
  |  Branch (237:11): [True: 88, False: 197]
  ------------------
  238|     88|			time->month -= 1;
  239|     88|			if ( time->month < 1 ) {	// ! Keep the months in range for indexing daysInMonth!
  ------------------
  |  Branch (239:9): [True: 2, False: 86]
  ------------------
  240|      2|				time->year -= 1;
  241|      2|				time->month += 12;
  242|      2|			}
  243|     88|			time->day += DaysInMonth ( time->year, time->month );	// ! Decrement month before so index here is right!
  244|     88|		}
  245|       |
  246|    202|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (246:11): [True: 5, False: 197]
  ------------------
  247|      5|			time->day -= DaysInMonth ( time->year, time->month );	// ! Increment month after so index here is right!
  248|      5|			time->month += 1;
  249|      5|			if ( time->month > 12 ) {
  ------------------
  |  Branch (249:9): [True: 0, False: 5]
  ------------------
  250|      0|				time->year += 1;
  251|      0|				time->month -= 12;
  252|      0|			}
  253|      5|		}
  254|       |
  255|    197|	}
  256|       |
  257|    348|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (257:10): [True: 5, False: 343]
  ------------------
  258|      5|		time->day -= 1;
  259|      5|		time->hour += 24;
  260|      5|	}
  261|       |
  262|    344|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (262:10): [True: 1, False: 343]
  ------------------
  263|      1|		time->day += 1;
  264|      1|		time->hour -= 24;
  265|      1|	}
  266|       |
  267|    346|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (267:10): [True: 3, False: 343]
  ------------------
  268|      3|		time->hour -= 1;
  269|      3|		time->minute += 60;
  270|      3|	}
  271|       |
  272|    344|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (272:10): [True: 1, False: 343]
  ------------------
  273|      1|		time->hour += 1;
  274|      1|		time->minute -= 60;
  275|      1|	}
  276|       |
  277|    343|	while ( time->second < 0 ) {
  ------------------
  |  Branch (277:10): [True: 0, False: 343]
  ------------------
  278|      0|		time->minute -= 1;
  279|      0|		time->second += 60;
  280|      0|	}
  281|       |
  282|    343|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (282:10): [True: 0, False: 343]
  ------------------
  283|      0|		time->minute += 1;
  284|      0|		time->second -= 60;
  285|      0|	}
  286|       |
  287|    343|	while ( time->nanoSecond < 0 ) {
  ------------------
  |  Branch (287:10): [True: 0, False: 343]
  ------------------
  288|      0|		time->second -= 1;
  289|      0|		time->nanoSecond += kBillion;
  290|      0|	}
  291|       |
  292|    343|	while ( time->nanoSecond >= kBillion ) {
  ------------------
  |  Branch (292:10): [True: 0, False: 343]
  ------------------
  293|      0|		time->second += 1;
  294|      0|		time->nanoSecond -= kBillion;
  295|      0|	}
  296|       |
  297|    343|	while ( time->second < 0 ) {
  ------------------
  |  Branch (297:10): [True: 0, False: 343]
  ------------------
  298|      0|		time->minute -= 1;
  299|      0|		time->second += 60;
  300|      0|	}
  301|       |
  302|    343|	while ( time->second >= 60 ) {
  ------------------
  |  Branch (302:10): [True: 0, False: 343]
  ------------------
  303|      0|		time->minute += 1;
  304|      0|		time->second -= 60;
  305|      0|	}
  306|       |
  307|    343|	while ( time->minute < 0 ) {
  ------------------
  |  Branch (307:10): [True: 0, False: 343]
  ------------------
  308|      0|		time->hour -= 1;
  309|      0|		time->minute += 60;
  310|      0|	}
  311|       |
  312|    343|	while ( time->minute >= 60 ) {
  ------------------
  |  Branch (312:10): [True: 0, False: 343]
  ------------------
  313|      0|		time->hour += 1;
  314|      0|		time->minute -= 60;
  315|      0|	}
  316|       |
  317|    344|	while ( time->hour < 0 ) {
  ------------------
  |  Branch (317:10): [True: 1, False: 343]
  ------------------
  318|      1|		time->day -= 1;
  319|      1|		time->hour += 24;
  320|      1|	}
  321|       |
  322|    344|	while ( time->hour >= 24 ) {
  ------------------
  |  Branch (322:10): [True: 1, False: 343]
  ------------------
  323|      1|		time->day += 1;
  324|      1|		time->hour -= 24;
  325|      1|	}
  326|       |
  327|    343|	if ( (time->year != 0) || (time->month != 0) || (time->day != 0) ) {
  ------------------
  |  Branch (327:7): [True: 189, False: 154]
  |  Branch (327:28): [True: 8, False: 146]
  |  Branch (327:50): [True: 8, False: 138]
  ------------------
  328|       |
  329|    213|		while ( time->month < 1 ) { // Make sure the months are OK first, for DaysInMonth.
  ------------------
  |  Branch (329:11): [True: 8, False: 205]
  ------------------
  330|      8|			time->year -= 1;
  331|      8|			time->month += 12;
  332|      8|		}
  333|       |
  334|    205|		while ( time->month > 12 ) {
  ------------------
  |  Branch (334:11): [True: 0, False: 205]
  ------------------
  335|      0|			time->year += 1;
  336|      0|			time->month -= 12;
  337|      0|		}
  338|       |
  339|    211|		while ( time->day < 1 ) {
  ------------------
  |  Branch (339:11): [True: 6, False: 205]
  ------------------
  340|      6|			time->month -= 1;
  341|      6|			if ( time->month < 1 ) {
  ------------------
  |  Branch (341:9): [True: 0, False: 6]
  ------------------
  342|      0|				time->year -= 1;
  343|      0|				time->month += 12;
  344|      0|			}
  345|      6|			time->day += DaysInMonth ( time->year, time->month );
  346|      6|		}
  347|       |
  348|    205|		while ( time->day > DaysInMonth ( time->year, time->month ) ) {
  ------------------
  |  Branch (348:11): [True: 0, False: 205]
  ------------------
  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|    205|	}
  358|       |
  359|    343|}	// AdjustTimeOverflow
XMPUtils.cpp:_ZL11DaysInMonthii:
  195|    506|{
  196|       |
  197|    506|	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|    506|	int days = daysInMonth [ month ];
  201|    506|	if ( (month == 2) && IsLeapYear ( year ) ) days += 1;
  ------------------
  |  Branch (201:7): [True: 109, False: 397]
  |  Branch (201:23): [True: 40, False: 69]
  ------------------
  202|       |
  203|    506|	return days;
  204|       |
  205|    506|}	// DaysInMonth
XMPUtils.cpp:_ZL10IsLeapYearl:
  176|    109|{
  177|       |	// This code uses the Gregorian calendar algorithm:
  178|       |	// https://en.wikipedia.org/wiki/Leap_year#Algorithm
  179|       |
  180|    109|	if ( (year % 4) != 0 ) return false;	// Not a multiple of 4.
  ------------------
  |  Branch (180:7): [True: 50, False: 59]
  ------------------
  181|     59|	if ( (year % 100) != 0 ) return true;	// A multiple of 4 but not a multiple of 100.
  ------------------
  |  Branch (181:7): [True: 30, False: 29]
  ------------------
  182|     29|	if ( (year % 400) == 0 ) return true;	// A multiple of 400.
  ------------------
  |  Branch (182:7): [True: 10, False: 19]
  ------------------
  183|       |
  184|     19|	return false;							// A multiple of 100 but not a multiple of 400.
  185|       |
  186|     29|}	// IsLeapYear

