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

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

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

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

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|  1.27k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.27k|    setMsg(1);
  245|  1.27k|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|  1.27k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.27k|  std::basic_ostringstream<charT> os;
  155|  1.27k|  os << arg;
  156|  1.27k|  return os.str();
  157|  1.27k|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  4.72k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  4.72k|  std::basic_ostringstream<charT> os;
  155|  4.72k|  os << arg;
  156|  4.72k|  return os.str();
  157|  4.72k|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|    365|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    365|    setMsg(1);
  245|    365|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    365|std::basic_string<charT> toBasicString(const T& arg) {
  154|    365|  std::basic_ostringstream<charT> os;
  155|    365|  os << arg;
  156|    365|  return os.str();
  157|    365|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|  1.99k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.99k|    setMsg(1);
  245|  1.99k|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  1.99k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.99k|  std::basic_ostringstream<charT> os;
  155|  1.99k|  os << arg;
  156|  1.99k|  return os.str();
  157|  1.99k|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|  4.72k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  4.72k|    setMsg(1);
  245|  4.72k|  }
_ZN5Exiv25ErrorC2IA13_cEENS_9ErrorCodeERKT_:
  243|      1|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|      1|    setMsg(1);
  245|      1|  }
_ZN5Exiv213toBasicStringIcA13_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|      1|std::basic_string<charT> toBasicString(const T& arg) {
  154|      1|  std::basic_ostringstream<charT> os;
  155|      1|  os << arg;
  156|      1|  return os.str();
  157|      1|}
_ZN5Exiv213toBasicStringIcPKcEENSt3__112basic_stringIT_NS3_11char_traitsIS5_EENS3_9allocatorIS5_EEEERKT0_:
  153|    110|std::basic_string<charT> toBasicString(const T& arg) {
  154|    110|  std::basic_ostringstream<charT> os;
  155|    110|  os << arg;
  156|    110|  return os.str();
  157|    110|}
_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEjEENS_9ErrorCodeERKT_RKT0_:
  250|      2|      code_(code), arg1_(toBasicString<char>(arg1)), arg2_(toBasicString<char>(arg2)) {
  251|      2|    setMsg(2);
  252|      2|  }
_ZN5Exiv213toBasicStringIcjEENSt3__112basic_stringIT_NS1_11char_traitsIS3_EENS1_9allocatorIS3_EEEERKT0_:
  153|      2|std::basic_string<charT> toBasicString(const T& arg) {
  154|      2|  std::basic_ostringstream<charT> os;
  155|      2|  os << arg;
  156|      2|  return os.str();
  157|      2|}
_ZN5Exiv25ErrorC2IPKcEENS_9ErrorCodeERKT_:
  243|    110|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    110|    setMsg(1);
  245|    110|  }

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  10.2M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  15.5M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   444k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  158|  6.06M|  [[nodiscard]] auto begin() noexcept {
  159|  6.06M|    return pData_.begin();
  160|  6.06M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  77.3k|  [[nodiscard]] auto end() noexcept {
  163|  77.3k|    return pData_.end();
  164|  77.3k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  38.8k|  [[nodiscard]] auto begin() const noexcept {
  167|  38.8k|    return pData_.begin();
  168|  38.8k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  38.7k|  [[nodiscard]] auto end() const noexcept {
  171|  38.7k|    return pData_.end();
  172|  38.7k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  8.79M|  [[nodiscard]] size_t size() const {
  175|  8.79M|    return pData_.size();
  176|  8.79M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  89.1k|  [[nodiscard]] bool empty() const {
  208|  89.1k|    return pData_.empty();
  209|  89.1k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.48M|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  21.4k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  76.8k|const T* find(T (&src)[N], const K& key) {
  461|  76.8k|  static_assert(N > 0, "Passed zero length find");
  462|  76.8k|  auto rc = std::find(src, src + N, key);
  463|  76.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 76.8k]
  ------------------
  464|  76.8k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  95.0k|std::string toString(const T& arg) {
  480|  95.0k|  return toStringHelper(arg, std::is_integral<T>());
  481|  95.0k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  95.0k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  95.0k|  return std::to_string(arg);
  470|  95.0k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  56.3M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  56.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 1.01M, False: 55.3M]
  ------------------
  242|  1.01M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|  1.01M|  }
  244|  55.3M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  56.3M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|   472k|const T* find(T (&src)[N], const K& key) {
  461|   472k|  static_assert(N > 0, "Passed zero length find");
  462|   472k|  auto rc = std::find(src, src + N, key);
  463|   472k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 467k, False: 4.76k]
  ------------------
  464|   472k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  21.1M|const T* find(T (&src)[N], const K& key) {
  461|  21.1M|  static_assert(N > 0, "Passed zero length find");
  462|  21.1M|  auto rc = std::find(src, src + N, key);
  463|  21.1M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.74M, False: 15.4M]
  ------------------
  464|  21.1M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     30|T stringTo(const std::string& s, bool& ok) {
  496|     30|  std::istringstream is(s);
  497|     30|  T tmp = T();
  498|     30|  ok = static_cast<bool>(is >> tmp);
  499|     30|  std::string rest;
  500|     30|  is >> std::skipws >> rest;
  501|     30|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 0, False: 30]
  ------------------
  502|      0|    ok = false;
  503|     30|  return tmp;
  504|     30|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  22.1k|std::string toString(const T& arg) {
  480|  22.1k|  return toStringHelper(arg, std::is_integral<T>());
  481|  22.1k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  22.1k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  22.1k|  return std::to_string(arg);
  470|  22.1k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.69k|std::string toString(const T& arg) {
  480|  3.69k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.69k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  3.69k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  3.69k|  return std::to_string(arg);
  470|  3.69k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   163k|std::string toString(const T& arg) {
  480|   163k|  return toStringHelper(arg, std::is_integral<T>());
  481|   163k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   163k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   163k|  return std::to_string(arg);
  470|   163k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.20k|std::string toString(const T& arg) {
  480|  3.20k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.20k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  3.20k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  3.20k|  std::ostringstream os;
  475|  3.20k|  os << arg;
  476|  3.20k|  return os.str();
  477|  3.20k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   152k|std::string toString(const T& arg) {
  480|   152k|  return toStringHelper(arg, std::is_integral<T>());
  481|   152k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   152k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   152k|  std::ostringstream os;
  475|   152k|  os << arg;
  476|   152k|  return os.str();
  477|   152k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  30.4k|std::string toString(const T& arg) {
  480|  30.4k|  return toStringHelper(arg, std::is_integral<T>());
  481|  30.4k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  30.4k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  30.4k|  return std::to_string(arg);
  470|  30.4k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|  1.34k|const T* find(T (&src)[N], const K& key) {
  461|  1.34k|  static_assert(N > 0, "Passed zero length find");
  462|  1.34k|  auto rc = std::find(src, src + N, key);
  463|  1.34k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 871, False: 477]
  ------------------
  464|  1.34k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|    829|const T* find(T (&src)[N], const K& key) {
  461|    829|  static_assert(N > 0, "Passed zero length find");
  462|    829|  auto rc = std::find(src, src + N, key);
  463|    829|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 389, False: 440]
  ------------------
  464|    829|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|    956|const T* find(T (&src)[N], const K& key) {
  461|    956|  static_assert(N > 0, "Passed zero length find");
  462|    956|  auto rc = std::find(src, src + N, key);
  463|    956|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 804, False: 152]
  ------------------
  464|    956|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|   128k|const T* find(T (&src)[N], const K& key) {
  461|   128k|  static_assert(N > 0, "Passed zero length find");
  462|   128k|  auto rc = std::find(src, src + N, key);
  463|   128k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.95k, False: 126k]
  ------------------
  464|   128k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  3.78k|const T* find(T (&src)[N], const K& key) {
  461|  3.78k|  static_assert(N > 0, "Passed zero length find");
  462|  3.78k|  auto rc = std::find(src, src + N, key);
  463|  3.78k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.95k, False: 1.82k]
  ------------------
  464|  3.78k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  6.16k|const T* find(T (&src)[N], const K& key) {
  461|  6.16k|  static_assert(N > 0, "Passed zero length find");
  462|  6.16k|  auto rc = std::find(src, src + N, key);
  463|  6.16k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.93k, False: 2.23k]
  ------------------
  464|  6.16k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  8.51k|const T* find(T (&src)[N], const K& key) {
  461|  8.51k|  static_assert(N > 0, "Passed zero length find");
  462|  8.51k|  auto rc = std::find(src, src + N, key);
  463|  8.51k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 7.74k, False: 769]
  ------------------
  464|  8.51k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  2.47k|std::string toString(const T& arg) {
  480|  2.47k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.47k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  2.47k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  2.47k|  std::ostringstream os;
  475|  2.47k|  os << arg;
  476|  2.47k|  return os.str();
  477|  2.47k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  1.86k|std::string toString(const T& arg) {
  480|  1.86k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.86k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  1.86k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  1.86k|  return std::to_string(arg);
  470|  1.86k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   532k|std::string toString(const T& arg) {
  480|   532k|  return toStringHelper(arg, std::is_integral<T>());
  481|   532k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   532k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   532k|  std::ostringstream os;
  475|   532k|  os << arg;
  476|   532k|  return os.str();
  477|   532k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.07k|const T* find(T (&src)[N], const K& key) {
  461|  1.07k|  static_assert(N > 0, "Passed zero length find");
  462|  1.07k|  auto rc = std::find(src, src + N, key);
  463|  1.07k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 865, False: 210]
  ------------------
  464|  1.07k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  9.56k|const T* find(T (&src)[N], const K& key) {
  461|  9.56k|  static_assert(N > 0, "Passed zero length find");
  462|  9.56k|  auto rc = std::find(src, src + N, key);
  463|  9.56k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 7.00k, False: 2.56k]
  ------------------
  464|  9.56k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  9.56k|const T* find(T (&src)[N], const K& key) {
  461|  9.56k|  static_assert(N > 0, "Passed zero length find");
  462|  9.56k|  auto rc = std::find(src, src + N, key);
  463|  9.56k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 8.24k, False: 1.31k]
  ------------------
  464|  9.56k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  5.58k|const T* find(T (&src)[N], const K& key) {
  461|  5.58k|  static_assert(N > 0, "Passed zero length find");
  462|  5.58k|  auto rc = std::find(src, src + N, key);
  463|  5.58k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.45k, False: 3.12k]
  ------------------
  464|  5.58k|}
_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: 88.4k, False: 14.8k]
  ------------------
  464|   103k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  31.0k|const T* find(T (&src)[N], const K& key) {
  461|  31.0k|  static_assert(N > 0, "Passed zero length find");
  462|  31.0k|  auto rc = std::find(src, src + N, key);
  463|  31.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 10.7k, False: 20.2k]
  ------------------
  464|  31.0k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  4.90k|const T* find(T (&src)[N], const K& key) {
  461|  4.90k|  static_assert(N > 0, "Passed zero length find");
  462|  4.90k|  auto rc = std::find(src, src + N, key);
  463|  4.90k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.64k, False: 1.25k]
  ------------------
  464|  4.90k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  4.88k|const T* find(T (&src)[N], const K& key) {
  461|  4.88k|  static_assert(N > 0, "Passed zero length find");
  462|  4.88k|  auto rc = std::find(src, src + N, key);
  463|  4.88k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.60k, False: 2.27k]
  ------------------
  464|  4.88k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|  1.18k|const T* find(T (&src)[N], const K& key) {
  461|  1.18k|  static_assert(N > 0, "Passed zero length find");
  462|  1.18k|  auto rc = std::find(src, src + N, key);
  463|  1.18k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 597, False: 583]
  ------------------
  464|  1.18k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   126k|const T* find(T (&src)[N], const K& key) {
  461|   126k|  static_assert(N > 0, "Passed zero length find");
  462|   126k|  auto rc = std::find(src, src + N, key);
  463|   126k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 102k, False: 24.9k]
  ------------------
  464|   126k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|  90.6k|const T* find(T (&src)[N], const K& key) {
  461|  90.6k|  static_assert(N > 0, "Passed zero length find");
  462|  90.6k|  auto rc = std::find(src, src + N, key);
  463|  90.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 84.4k, False: 6.17k]
  ------------------
  464|  90.6k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  5.20k|const T* find(T (&src)[N], const K& key) {
  461|  5.20k|  static_assert(N > 0, "Passed zero length find");
  462|  5.20k|  auto rc = std::find(src, src + N, key);
  463|  5.20k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 767, False: 4.43k]
  ------------------
  464|  5.20k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  5.47k|const T* find(T (&src)[N], const K& key) {
  461|  5.47k|  static_assert(N > 0, "Passed zero length find");
  462|  5.47k|  auto rc = std::find(src, src + N, key);
  463|  5.47k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.05k, False: 3.41k]
  ------------------
  464|  5.47k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  10.3M|const T* find(T (&src)[N], const K& key) {
  461|  10.3M|  static_assert(N > 0, "Passed zero length find");
  462|  10.3M|  auto rc = std::find(src, src + N, key);
  463|  10.3M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 10.3M]
  ------------------
  464|  10.3M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  7.35M|const T* find(T (&src)[N], const K& key) {
  461|  7.35M|  static_assert(N > 0, "Passed zero length find");
  462|  7.35M|  auto rc = std::find(src, src + N, key);
  463|  7.35M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 7.35M]
  ------------------
  464|  7.35M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  5.45M|const T* find(T (&src)[N], const K& key) {
  461|  5.45M|  static_assert(N > 0, "Passed zero length find");
  462|  5.45M|  auto rc = std::find(src, src + N, key);
  463|  5.45M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.43M, False: 16.8k]
  ------------------
  464|  5.45M|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  8.96k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|   147k|const T* find(T (&src)[N], const K& key) {
  461|   147k|  static_assert(N > 0, "Passed zero length find");
  462|   147k|  auto rc = std::find(src, src + N, key);
  463|   147k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 57.1k, False: 90.1k]
  ------------------
  464|   147k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|  1.45M|const T* find(T (&src)[N], const K& key) {
  461|  1.45M|  static_assert(N > 0, "Passed zero length find");
  462|  1.45M|  auto rc = std::find(src, src + N, key);
  463|  1.45M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 48, False: 1.45M]
  ------------------
  464|  1.45M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  22.1k|const T* find(T (&src)[N], const K& key) {
  461|  22.1k|  static_assert(N > 0, "Passed zero length find");
  462|  22.1k|  auto rc = std::find(src, src + N, key);
  463|  22.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.25k, False: 16.8k]
  ------------------
  464|  22.1k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  460|  11.1k|const T* find(T (&src)[N], const K& key) {
  461|  11.1k|  static_assert(N > 0, "Passed zero length find");
  462|  11.1k|  auto rc = std::find(src, src + N, key);
  463|  11.1k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 11.1k]
  ------------------
  464|  11.1k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|  2.52k|const T* find(T (&src)[N], const K& key) {
  461|  2.52k|  static_assert(N > 0, "Passed zero length find");
  462|  2.52k|  auto rc = std::find(src, src + N, key);
  463|  2.52k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 312, False: 2.21k]
  ------------------
  464|  2.52k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    433|T stringTo(const std::string& s, bool& ok) {
  496|    433|  std::istringstream is(s);
  497|    433|  T tmp = T();
  498|    433|  ok = static_cast<bool>(is >> tmp);
  499|    433|  std::string rest;
  500|    433|  is >> std::skipws >> rest;
  501|    433|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 191, False: 242]
  ------------------
  502|    191|    ok = false;
  503|    433|  return tmp;
  504|    433|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|    206|const T* find(T (&src)[N], const K& key) {
  461|    206|  static_assert(N > 0, "Passed zero length find");
  462|    206|  auto rc = std::find(src, src + N, key);
  463|    206|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 196, False: 10]
  ------------------
  464|    206|}

_ZNK5Exiv25Value6typeIdEv:
   85|  17.1M|  TypeId typeId() const {
   86|  17.1M|    return type_;
   87|  17.1M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  13.5M|  UniquePtr clone() const {
   94|  13.5M|    return UniquePtr(clone_());
   95|  13.5M|  }
_ZNK5Exiv25Value2okEv:
  181|  23.4k|  bool ok() const {
  182|  23.4k|    return ok_;
  183|  23.4k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  57.0k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  57.0k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 36.3k, False: 20.6k]
  ------------------
  797|  36.3k|      return str1.size() > str2.size();
  798|       |
  799|  20.6k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  20.6k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  57.0k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   292k|inline TypeId getType<uint16_t>() {
 1084|   292k|  return unsignedShort;
 1085|   292k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  7.24k|inline TypeId getType<uint32_t>() {
 1089|  7.24k|  return unsignedLong;
 1090|  7.24k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  11.6k|inline TypeId getType<URational>() {
 1094|  11.6k|  return unsignedRational;
 1095|  11.6k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|   314k|inline TypeId getType<int16_t>() {
 1099|   314k|  return signedShort;
 1100|   314k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  46.0k|inline TypeId getType<int32_t>() {
 1104|  46.0k|  return signedLong;
 1105|  46.0k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  13.3k|inline TypeId getType<Rational>() {
 1109|  13.3k|  return signedRational;
 1110|  13.3k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  9.37k|inline TypeId getType<float>() {
 1114|  9.37k|  return tiffFloat;
 1115|  9.37k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  15.7k|inline TypeId getType<double>() {
 1119|  15.7k|  return tiffDouble;
 1120|  15.7k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  1.61M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  1.61M|  return getUShort(buf, byteOrder);
 1316|  1.61M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  7.36M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  7.36M|  return getULong(buf, byteOrder);
 1321|  7.36M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|  1.03M|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|  1.03M|  return getURational(buf, byteOrder);
 1326|  1.03M|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|  1.57M|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|  1.57M|  return getShort(buf, byteOrder);
 1331|  1.57M|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   554k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   554k|  return getLong(buf, byteOrder);
 1336|   554k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|  6.52M|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|  6.52M|  return getRational(buf, byteOrder);
 1341|  6.52M|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|   470k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|   470k|  return getFloat(buf, byteOrder);
 1346|   470k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|  1.09M|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|  1.09M|  return getDouble(buf, byteOrder);
 1351|  1.09M|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  1.06M|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  1.06M|  return us2Data(buf, t, byteOrder);
 1374|  1.06M|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  4.72M|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  4.72M|  return ul2Data(buf, t, byteOrder);
 1382|  4.72M|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   935k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   935k|  return ur2Data(buf, t, byteOrder);
 1390|   935k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|  1.39M|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|  1.39M|  return s2Data(buf, t, byteOrder);
 1398|  1.39M|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   306k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   306k|  return l2Data(buf, t, byteOrder);
 1406|   306k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|  6.12M|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|  6.12M|  return r2Data(buf, t, byteOrder);
 1414|  6.12M|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|   194k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|   194k|  return f2Data(buf, t, byteOrder);
 1422|   194k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   584k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   584k|  return d2Data(buf, t, byteOrder);
 1430|   584k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  4.27k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  4.27k|  return float_to_integer_helper<int64_t>(n);
 1550|  4.27k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  25.8k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  25.8k|  return float_to_integer_helper<uint32_t>(n);
 1555|  25.8k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  9.54k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  9.54k|  return float_to_integer_helper<int64_t>(n);
 1560|  9.54k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  14.8k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  14.8k|  return float_to_integer_helper<uint32_t>(n);
 1564|  14.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  3.75k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  3.75k|  return rational_to_integer_helper<int64_t>(n);
 1569|  3.75k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  10.5k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  10.5k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  10.5k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  1.23k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  1.23k|  return rational_to_integer_helper<int64_t>(n);
 1578|  1.23k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  7.83k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  7.83k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  7.83k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  4.27k|  I float_to_integer_helper(size_t n) const {
 1213|  4.27k|    const auto v = value_.at(n);
 1214|  4.27k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.47k, False: 801]
  ------------------
 1215|  3.47k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.48k, False: 995]
  ------------------
 1216|  2.48k|      return static_cast<I>(std::lround(v));
 1217|  2.48k|    }
 1218|  1.79k|    return 0;
 1219|  4.27k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  25.8k|  I float_to_integer_helper(size_t n) const {
 1213|  25.8k|    const auto v = value_.at(n);
 1214|  25.8k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 21.0k, False: 4.76k]
  ------------------
 1215|  21.0k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 15.0k, False: 6.06k]
  ------------------
 1216|  15.0k|      return static_cast<I>(std::lround(v));
 1217|  15.0k|    }
 1218|  10.8k|    return 0;
 1219|  25.8k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  9.54k|  I float_to_integer_helper(size_t n) const {
 1213|  9.54k|    const auto v = value_.at(n);
 1214|  9.54k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 7.98k, False: 1.55k]
  ------------------
 1215|  7.98k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 6.11k, False: 1.87k]
  ------------------
 1216|  6.11k|      return static_cast<I>(std::lround(v));
 1217|  6.11k|    }
 1218|  3.43k|    return 0;
 1219|  9.54k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  14.8k|  I float_to_integer_helper(size_t n) const {
 1213|  14.8k|    const auto v = value_.at(n);
 1214|  14.8k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 13.4k, False: 1.38k]
  ------------------
 1215|  13.4k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 11.5k, False: 1.96k]
  ------------------
 1216|  11.5k|      return static_cast<I>(std::lround(v));
 1217|  11.5k|    }
 1218|  3.34k|    return 0;
 1219|  14.8k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  3.75k|  I rational_to_integer_helper(size_t n) const {
 1224|  3.75k|    auto a = value_.at(n).first;
 1225|  3.75k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  3.75k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.48k, False: 2.26k]
  ------------------
 1229|  1.48k|      return 0;
 1230|  1.48k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  2.26k|#ifdef __cpp_if_constexpr
 1234|  2.26k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  2.26k|      const auto imin = std::numeric_limits<I>::min();
 1240|  2.26k|      const auto imax = std::numeric_limits<I>::max();
 1241|  2.26k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 2.26k]
  |  Branch (1241:23): [True: 0, False: 2.26k]
  |  Branch (1241:35): [True: 0, False: 2.26k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  2.26k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  2.26k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  3.75k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  10.5k|  I rational_to_integer_helper(size_t n) const {
 1224|  10.5k|    auto a = value_.at(n).first;
 1225|  10.5k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  10.5k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 2.15k, False: 8.44k]
  ------------------
 1229|  2.15k|      return 0;
 1230|  2.15k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  8.44k|#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|  8.44k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  8.44k|      const auto imax = std::numeric_limits<I>::max();
 1257|  8.44k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 2.94k, False: 5.50k]
  ------------------
 1258|  2.94k|        return 0;
 1259|  2.94k|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  5.50k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  5.50k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  5.50k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 5.50k]
  |  Branch (1263:25): [True: 0, False: 5.50k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  5.50k|    }
 1267|       |
 1268|  5.50k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  10.5k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  1.23k|  I rational_to_integer_helper(size_t n) const {
 1224|  1.23k|    auto a = value_.at(n).first;
 1225|  1.23k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  1.23k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 340, False: 899]
  ------------------
 1229|    340|      return 0;
 1230|    340|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|    899|#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|    899|    } 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|    899|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|    899|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 899]
  |  Branch (1251:23): [True: 0, False: 899]
  ------------------
 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|    899|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  1.23k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  7.83k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.83k|    auto a = value_.at(n).first;
 1225|  7.83k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.83k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 859, False: 6.97k]
  ------------------
 1229|    859|      return 0;
 1230|    859|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.97k|#ifdef __cpp_if_constexpr
 1234|  6.97k|    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|  6.97k|      const auto imin = std::numeric_limits<I>::min();
 1240|  6.97k|      const auto imax = std::numeric_limits<I>::max();
 1241|  6.97k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 6.97k]
  |  Branch (1241:23): [True: 0, False: 6.97k]
  |  Branch (1241:35): [True: 0, False: 6.97k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  6.97k|#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|  6.97k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.83k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   292k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   292k|}
_ZN5Exiv25ValueD2Ev:
   43|  17.3M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   289k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   289k|  value_.clear();
 1469|   289k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   289k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 289k, False: 0]
  |  Branch (1470:17): [True: 551, False: 288k]
  ------------------
 1471|    551|    len = (len / ts) * ts;
 1472|  1.90M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.61M, False: 289k]
  ------------------
 1473|  1.61M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.61M|  }
 1475|   289k|  return 0;
 1476|   289k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  3.07k|int ValueType<T>::read(const std::string& buf) {
 1480|  3.07k|  std::istringstream is(buf);
 1481|  3.07k|  T tmp;
 1482|  3.07k|  ValueList val;
 1483|  6.87k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 3.80k, False: 3.07k]
  ------------------
 1484|  3.80k|    val.push_back(tmp);
 1485|  3.07k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 5, False: 3.06k]
  ------------------
 1486|      5|    return 1;
 1487|  3.06k|  value_ = std::move(val);
 1488|  3.06k|  return 0;
 1489|  3.07k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  1.91k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.91k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.41k, False: 501]
  ------------------
 1651|  1.41k|    pDataArea_ = Blob(buf, buf + len);
 1652|    501|  else
 1653|    501|    pDataArea_.clear();
 1654|  1.91k|  return 0;
 1655|  1.91k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|   245k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|   245k|  size_t offset = 0;
 1494|  1.06M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.06M, False: 245k]
  ------------------
 1495|  1.06M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.06M|  }
 1497|   245k|  return offset;
 1498|   245k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|  1.06M|size_t ValueType<T>::count() const {
 1502|  1.06M|  return value_.size();
 1503|  1.06M|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|  2.15M|size_t ValueType<T>::size() const {
 1507|  2.15M|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.15M|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    732|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    732|  auto end = value_.end();
 1518|    732|  auto i = value_.begin();
 1519|  8.63k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 7.89k, False: 732]
  ------------------
 1520|  7.89k|    os << std::setprecision(15) << *i;
 1521|  7.89k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 7.39k, False: 502]
  ------------------
 1522|  7.39k|      os << " ";
 1523|  7.89k|  }
 1524|    732|  return os;
 1525|    732|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   210k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   210k|  ok_ = true;
 1537|   210k|  return static_cast<int64_t>(value_.at(n));
 1538|   210k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   244k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   244k|  ok_ = true;
 1542|   244k|  return static_cast<uint32_t>(value_.at(n));
 1543|   244k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  25.7k|size_t ValueType<T>::sizeDataArea() const {
 1640|  25.7k|  return pDataArea_.size();
 1641|  25.7k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|  1.06k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.06k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.06k|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   746k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   746k|  return new ValueType<T>(*this);
 1513|   746k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   746k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   746k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 3.06k, False: 743k]
  ------------------
 1449|  3.06k|    pDataArea_ = rhs.pDataArea_;
 1450|   746k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  11.1M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|   213k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   213k|  value_.clear();
 1469|   213k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   213k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 213k, False: 0]
  |  Branch (1470:17): [True: 113, False: 213k]
  ------------------
 1471|    113|    len = (len / ts) * ts;
 1472|  7.58M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 7.36M, False: 213k]
  ------------------
 1473|  7.36M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  7.36M|  }
 1475|   213k|  return 0;
 1476|   213k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|  1.54k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.54k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.11k, False: 427]
  ------------------
 1651|  1.11k|    pDataArea_ = Blob(buf, buf + len);
 1652|    427|  else
 1653|    427|    pDataArea_.clear();
 1654|  1.54k|  return 0;
 1655|  1.54k|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|   199k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|   199k|  size_t offset = 0;
 1494|  4.72M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 4.72M, False: 199k]
  ------------------
 1495|  4.72M|    offset += toData(buf + offset, val, byteOrder);
 1496|  4.72M|  }
 1497|   199k|  return offset;
 1498|   199k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   703k|size_t ValueType<T>::count() const {
 1502|   703k|  return value_.size();
 1503|   703k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|  2.21M|size_t ValueType<T>::size() const {
 1507|  2.21M|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.21M|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  5.57k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  5.57k|  auto end = value_.end();
 1518|  5.57k|  auto i = value_.begin();
 1519|  28.9k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 23.3k, False: 5.57k]
  ------------------
 1520|  23.3k|    os << std::setprecision(15) << *i;
 1521|  23.3k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 18.0k, False: 5.34k]
  ------------------
 1522|  18.0k|      os << " ";
 1523|  23.3k|  }
 1524|  5.57k|  return os;
 1525|  5.57k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  10.2k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  10.2k|  ok_ = true;
 1537|  10.2k|  return static_cast<int64_t>(value_.at(n));
 1538|  10.2k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|   106k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   106k|  ok_ = true;
 1542|   106k|  return static_cast<uint32_t>(value_.at(n));
 1543|   106k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  11.0k|size_t ValueType<T>::sizeDataArea() const {
 1640|  11.0k|  return pDataArea_.size();
 1641|  11.0k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    760|DataBuf ValueType<T>::dataArea() const {
 1645|    760|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    760|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   607k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   607k|  return new ValueType<T>(*this);
 1513|   607k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   607k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   607k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.40k, False: 605k]
  ------------------
 1449|  1.40k|    pDataArea_ = rhs.pDataArea_;
 1450|   607k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  11.6k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  10.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  10.9k|  value_.clear();
 1469|  10.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  10.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 10.9k, False: 0]
  |  Branch (1470:17): [True: 0, False: 10.9k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  1.04M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.03M, False: 10.9k]
  ------------------
 1473|  1.03M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.03M|  }
 1475|  10.9k|  return 0;
 1476|  10.9k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|  1.71k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.71k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.00k, False: 711]
  ------------------
 1651|  1.00k|    pDataArea_ = Blob(buf, buf + len);
 1652|    711|  else
 1653|    711|    pDataArea_.clear();
 1654|  1.71k|  return 0;
 1655|  1.71k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  8.17k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  8.17k|  size_t offset = 0;
 1494|   935k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 935k, False: 8.17k]
  ------------------
 1495|   935k|    offset += toData(buf + offset, val, byteOrder);
 1496|   935k|  }
 1497|  8.17k|  return offset;
 1498|  8.17k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  39.3k|size_t ValueType<T>::count() const {
 1502|  39.3k|  return value_.size();
 1503|  39.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  30.3k|size_t ValueType<T>::size() const {
 1507|  30.3k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  30.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    790|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    790|  auto end = value_.end();
 1518|    790|  auto i = value_.begin();
 1519|  3.27k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 2.48k, False: 790]
  ------------------
 1520|  2.48k|    os << std::setprecision(15) << *i;
 1521|  2.48k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.90k, False: 583]
  ------------------
 1522|  1.90k|      os << " ";
 1523|  2.48k|  }
 1524|    790|  return os;
 1525|    790|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  8.52k|size_t ValueType<T>::sizeDataArea() const {
 1640|  8.52k|  return pDataArea_.size();
 1641|  8.52k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    225|DataBuf ValueType<T>::dataArea() const {
 1645|    225|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    225|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  32.7k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  32.7k|  return new ValueType<T>(*this);
 1513|  32.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  32.7k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  32.7k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.45k, False: 31.2k]
  ------------------
 1449|  1.45k|    pDataArea_ = rhs.pDataArea_;
 1450|  32.7k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|   314k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   314k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|   302k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   302k|  value_.clear();
 1469|   302k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   302k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 302k, False: 0]
  |  Branch (1470:17): [True: 62, False: 302k]
  ------------------
 1471|     62|    len = (len / ts) * ts;
 1472|  1.87M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.57M, False: 302k]
  ------------------
 1473|  1.57M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.57M|  }
 1475|   302k|  return 0;
 1476|   302k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  12.2k|int ValueType<T>::read(const std::string& buf) {
 1480|  12.2k|  std::istringstream is(buf);
 1481|  12.2k|  T tmp;
 1482|  12.2k|  ValueList val;
 1483|  65.2k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 53.0k, False: 12.2k]
  ------------------
 1484|  53.0k|    val.push_back(tmp);
 1485|  12.2k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 12.2k]
  ------------------
 1486|      0|    return 1;
 1487|  12.2k|  value_ = std::move(val);
 1488|  12.2k|  return 0;
 1489|  12.2k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|  1.32k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.32k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 735, False: 592]
  ------------------
 1651|    735|    pDataArea_ = Blob(buf, buf + len);
 1652|    592|  else
 1653|    592|    pDataArea_.clear();
 1654|  1.32k|  return 0;
 1655|  1.32k|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|   272k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|   272k|  size_t offset = 0;
 1494|  1.39M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.39M, False: 272k]
  ------------------
 1495|  1.39M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.39M|  }
 1497|   272k|  return offset;
 1498|   272k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|   957k|size_t ValueType<T>::count() const {
 1502|   957k|  return value_.size();
 1503|   957k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  2.08M|size_t ValueType<T>::size() const {
 1507|  2.08M|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  2.08M|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    685|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    685|  auto end = value_.end();
 1518|    685|  auto i = value_.begin();
 1519|  9.15k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 8.46k, False: 685]
  ------------------
 1520|  8.46k|    os << std::setprecision(15) << *i;
 1521|  8.46k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 7.99k, False: 473]
  ------------------
 1522|  7.99k|      os << " ";
 1523|  8.46k|  }
 1524|    685|  return os;
 1525|    685|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  24.3k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  24.3k|  ok_ = true;
 1537|  24.3k|  return static_cast<int64_t>(value_.at(n));
 1538|  24.3k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   362k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   362k|  ok_ = true;
 1542|   362k|  return static_cast<uint32_t>(value_.at(n));
 1543|   362k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  8.18k|size_t ValueType<T>::sizeDataArea() const {
 1640|  8.18k|  return pDataArea_.size();
 1641|  8.18k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    249|DataBuf ValueType<T>::dataArea() const {
 1645|    249|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    249|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|   770k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   770k|  return new ValueType<T>(*this);
 1513|   770k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|   770k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   770k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 709, False: 769k]
  ------------------
 1449|    709|    pDataArea_ = rhs.pDataArea_;
 1450|   770k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  46.0k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  46.0k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  46.0k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  46.0k|  value_.clear();
 1469|  46.0k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  46.0k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 46.0k, False: 0]
  |  Branch (1470:17): [True: 188, False: 45.8k]
  ------------------
 1471|    188|    len = (len / ts) * ts;
 1472|   600k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 554k, False: 46.0k]
  ------------------
 1473|   554k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   554k|  }
 1475|  46.0k|  return 0;
 1476|  46.0k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|  1.55k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.55k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 943, False: 614]
  ------------------
 1651|    943|    pDataArea_ = Blob(buf, buf + len);
 1652|    614|  else
 1653|    614|    pDataArea_.clear();
 1654|  1.55k|  return 0;
 1655|  1.55k|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  16.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  16.3k|  size_t offset = 0;
 1494|   306k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 306k, False: 16.3k]
  ------------------
 1495|   306k|    offset += toData(buf + offset, val, byteOrder);
 1496|   306k|  }
 1497|  16.3k|  return offset;
 1498|  16.3k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   197k|size_t ValueType<T>::count() const {
 1502|   197k|  return value_.size();
 1503|   197k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   114k|size_t ValueType<T>::size() const {
 1507|   114k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   114k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    695|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    695|  auto end = value_.end();
 1518|    695|  auto i = value_.begin();
 1519|  4.93k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.24k, False: 695]
  ------------------
 1520|  4.24k|    os << std::setprecision(15) << *i;
 1521|  4.24k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.75k, False: 490]
  ------------------
 1522|  3.75k|      os << " ";
 1523|  4.24k|  }
 1524|    695|  return os;
 1525|    695|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  23.9k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  23.9k|  ok_ = true;
 1537|  23.9k|  return static_cast<int64_t>(value_.at(n));
 1538|  23.9k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  43.8k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  43.8k|  ok_ = true;
 1542|  43.8k|  return static_cast<uint32_t>(value_.at(n));
 1543|  43.8k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  22.8k|size_t ValueType<T>::sizeDataArea() const {
 1640|  22.8k|  return pDataArea_.size();
 1641|  22.8k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|  1.05k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.05k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.05k|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   120k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   120k|  return new ValueType<T>(*this);
 1513|   120k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   120k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   120k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.61k, False: 118k]
  ------------------
 1449|  1.61k|    pDataArea_ = rhs.pDataArea_;
 1450|   120k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  13.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  13.3k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  13.3k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  13.3k|  value_.clear();
 1469|  13.3k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  13.3k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 13.3k, False: 0]
  |  Branch (1470:17): [True: 0, False: 13.3k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  6.53M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 6.52M, False: 13.3k]
  ------------------
 1473|  6.52M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  6.52M|  }
 1475|  13.3k|  return 0;
 1476|  13.3k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|  1.50k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.50k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.09k, False: 409]
  ------------------
 1651|  1.09k|    pDataArea_ = Blob(buf, buf + len);
 1652|    409|  else
 1653|    409|    pDataArea_.clear();
 1654|  1.50k|  return 0;
 1655|  1.50k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  9.69k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  9.69k|  size_t offset = 0;
 1494|  6.12M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 6.12M, False: 9.69k]
  ------------------
 1495|  6.12M|    offset += toData(buf + offset, val, byteOrder);
 1496|  6.12M|  }
 1497|  9.69k|  return offset;
 1498|  9.69k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  56.8k|size_t ValueType<T>::count() const {
 1502|  56.8k|  return value_.size();
 1503|  56.8k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  36.2k|size_t ValueType<T>::size() const {
 1507|  36.2k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  36.2k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    586|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    586|  auto end = value_.end();
 1518|    586|  auto i = value_.begin();
 1519|  7.11k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 6.52k, False: 586]
  ------------------
 1520|  6.52k|    os << std::setprecision(15) << *i;
 1521|  6.52k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 6.14k, False: 385]
  ------------------
 1522|  6.14k|      os << " ";
 1523|  6.52k|  }
 1524|    586|  return os;
 1525|    586|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  6.93k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.93k|  return pDataArea_.size();
 1641|  6.93k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|     99|DataBuf ValueType<T>::dataArea() const {
 1645|     99|  return {pDataArea_.data(), pDataArea_.size()};
 1646|     99|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  37.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  37.2k|  return new ValueType<T>(*this);
 1513|  37.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  37.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  37.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.15k, False: 36.0k]
  ------------------
 1449|  1.15k|    pDataArea_ = rhs.pDataArea_;
 1450|  37.2k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  9.37k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  9.37k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  9.37k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  9.37k|  value_.clear();
 1469|  9.37k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  9.37k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 9.37k, False: 0]
  |  Branch (1470:17): [True: 0, False: 9.37k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   479k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 470k, False: 9.37k]
  ------------------
 1473|   470k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   470k|  }
 1475|  9.37k|  return 0;
 1476|  9.37k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.37k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.37k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 768, False: 606]
  ------------------
 1651|    768|    pDataArea_ = Blob(buf, buf + len);
 1652|    606|  else
 1653|    606|    pDataArea_.clear();
 1654|  1.37k|  return 0;
 1655|  1.37k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  6.20k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.20k|  size_t offset = 0;
 1494|   194k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 194k, False: 6.20k]
  ------------------
 1495|   194k|    offset += toData(buf + offset, val, byteOrder);
 1496|   194k|  }
 1497|  6.20k|  return offset;
 1498|  6.20k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  52.5k|size_t ValueType<T>::count() const {
 1502|  52.5k|  return value_.size();
 1503|  52.5k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  22.0k|size_t ValueType<T>::size() const {
 1507|  22.0k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  22.0k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    547|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    547|  auto end = value_.end();
 1518|    547|  auto i = value_.begin();
 1519|  7.06k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 6.51k, False: 547]
  ------------------
 1520|  6.51k|    os << std::setprecision(15) << *i;
 1521|  6.51k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 6.17k, False: 344]
  ------------------
 1522|  6.17k|      os << " ";
 1523|  6.51k|  }
 1524|    547|  return os;
 1525|    547|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  13.3k|size_t ValueType<T>::sizeDataArea() const {
 1640|  13.3k|  return pDataArea_.size();
 1641|  13.3k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    207|DataBuf ValueType<T>::dataArea() const {
 1645|    207|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    207|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  32.1k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  32.1k|  return new ValueType<T>(*this);
 1513|  32.1k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  32.1k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  32.1k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 936, False: 31.2k]
  ------------------
 1449|    936|    pDataArea_ = rhs.pDataArea_;
 1450|  32.1k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  15.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  15.7k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  15.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  15.7k|  value_.clear();
 1469|  15.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  15.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 15.7k, False: 0]
  |  Branch (1470:17): [True: 0, False: 15.7k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  1.11M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.09M, False: 15.7k]
  ------------------
 1473|  1.09M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.09M|  }
 1475|  15.7k|  return 0;
 1476|  15.7k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|  1.17k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.17k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 528, False: 650]
  ------------------
 1651|    528|    pDataArea_ = Blob(buf, buf + len);
 1652|    650|  else
 1653|    650|    pDataArea_.clear();
 1654|  1.17k|  return 0;
 1655|  1.17k|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  5.36k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.36k|  size_t offset = 0;
 1494|   584k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 584k, False: 5.36k]
  ------------------
 1495|   584k|    offset += toData(buf + offset, val, byteOrder);
 1496|   584k|  }
 1497|  5.36k|  return offset;
 1498|  5.36k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  44.9k|size_t ValueType<T>::count() const {
 1502|  44.9k|  return value_.size();
 1503|  44.9k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  21.5k|size_t ValueType<T>::size() const {
 1507|  21.5k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  21.5k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    510|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    510|  auto end = value_.end();
 1518|    510|  auto i = value_.begin();
 1519|  4.42k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 3.91k, False: 510]
  ------------------
 1520|  3.91k|    os << std::setprecision(15) << *i;
 1521|  3.91k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 3.61k, False: 306]
  ------------------
 1522|  3.61k|      os << " ";
 1523|  3.91k|  }
 1524|    510|  return os;
 1525|    510|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  9.85k|size_t ValueType<T>::sizeDataArea() const {
 1640|  9.85k|  return pDataArea_.size();
 1641|  9.85k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    484|DataBuf ValueType<T>::dataArea() const {
 1645|    484|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    484|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  40.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  40.5k|  return new ValueType<T>(*this);
 1513|  40.5k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  40.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  40.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 244, False: 40.3k]
  ------------------
 1449|    244|    pDataArea_ = rhs.pDataArea_;
 1450|  40.5k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|  1.53M|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  7.24k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  7.24k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  27.3k|  [[nodiscard]] bool usePacket() const {
  218|  27.3k|    return usePacket_;
  219|  27.3k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  86.8k|  bool usePacket(bool b) {
  223|  86.8k|    bool r = usePacket_;
  224|  86.8k|    usePacket_ = b;
  225|  86.8k|    return r;
  226|  86.8k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  78.8k|  void setPacket(std::string xmpPacket) {
  229|  78.8k|    xmpPacket_ = std::move(xmpPacket);
  230|  78.8k|    usePacket(false);
  231|  78.8k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  261|  96.4k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  262|  96.4k|    return nsBindings_;
  263|  96.4k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  90.8k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  396|  55.5k|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|  55.5k|    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  55.5k|  return *this;
  406|  55.5k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  56.5k|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|  56.5k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  56.5k|  return *this;
  406|  56.5k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   152k|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|   152k|    setValue(Exiv2::toString(value));
  405|   152k|  return *this;
  406|   152k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  16.3k|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|  16.3k|    setValue(Exiv2::toString(value));
  405|  16.3k|  return *this;
  406|  16.3k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  22.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|  22.1k|    setValue(Exiv2::toString(value));
  405|  22.1k|  return *this;
  406|  22.1k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  396|  2.47k|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.47k|    setValue(Exiv2::toString(value));
  405|  2.47k|  return *this;
  406|  2.47k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  1.86k|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.86k|    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.86k|  return *this;
  406|  1.86k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|  1.86k|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|  1.86k|    setValue(Exiv2::toString(value));
  405|  1.86k|  return *this;
  406|  1.86k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  3.20k|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.20k|    setValue(Exiv2::toString(value));
  405|  3.20k|  return *this;
  406|  3.20k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    490|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|    490|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    490|  return *this;
  406|    490|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|  95.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|       |    setValue(&value);
  403|       |  else
  404|  95.0k|    setValue(Exiv2::toString(value));
  405|  95.0k|  return *this;
  406|  95.0k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  3.69k|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.69k|    setValue(Exiv2::toString(value));
  405|  3.69k|  return *this;
  406|  3.69k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   152k|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|   152k|    setValue(Exiv2::toString(value));
  405|   152k|  return *this;
  406|   152k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  40.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|  40.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|  40.8k|  return *this;
  406|  40.8k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   158k|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|   158k|    setValue(Exiv2::toString(value));
  405|   158k|  return *this;
  406|   158k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|     47|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|     47|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|     47|  return *this;
  406|     47|}

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

_ZN5Exiv27BasicIoD2Ev:
   60|   128k|BasicIo::~BasicIo() = default;
_ZN5Exiv27BasicIo11readOrThrowEPhmNS_9ErrorCodeE:
   62|  3.58M|void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
   63|  3.58M|  const size_t nread = read(buf, rcount);
   64|  3.58M|  Internal::enforce(nread == rcount, err);
   65|  3.58M|  Internal::enforce(!error(), err);
   66|  3.58M|}
_ZN5Exiv27BasicIo11seekOrThrowElNS0_8PositionENS_9ErrorCodeE:
   68|  80.6k|void BasicIo::seekOrThrow(int64_t offset, Position pos, ErrorCode err) {
   69|  80.6k|  const int r = seek(offset, pos);
   70|  80.6k|  Internal::enforce(r == 0, err);
   71|  80.6k|}
_ZN5Exiv25MemIo4ImplC2EPKhm:
  627|  79.0k|MemIo::Impl::Impl(const byte* data, size_t size) : data_(const_cast<byte*>(data)), size_(size) {
  628|  79.0k|}
_ZN5Exiv25MemIo4Impl7reserveEm:
  681|  5.77M|void MemIo::Impl::reserve(size_t wcount) {
  682|  5.77M|  const size_t need = wcount + idx_;
  683|  5.77M|  size_t blockSize = 32 * 1024;  // 32768
  684|  5.77M|  const size_t maxBlockSize = 4 * 1024 * 1024;
  685|       |
  686|  5.77M|  if (!isMalloced_) {
  ------------------
  |  Branch (686:7): [True: 36.1k, False: 5.74M]
  ------------------
  687|       |    // Minimum size for 1st block
  688|  36.1k|    auto size = std::max<size_t>(blockSize * (1 + need / blockSize), size_);
  689|  36.1k|    auto data = static_cast<byte*>(std::malloc(size));
  690|  36.1k|    if (!data) {
  ------------------
  |  Branch (690:9): [True: 0, False: 36.1k]
  ------------------
  691|      0|      throw Error(ErrorCode::kerMallocFailed);
  692|      0|    }
  693|  36.1k|    if (data_) {
  ------------------
  |  Branch (693:9): [True: 0, False: 36.1k]
  ------------------
  694|      0|      std::memcpy(data, data_, size_);
  695|      0|    }
  696|  36.1k|    data_ = data;
  697|  36.1k|    sizeAlloced_ = size;
  698|  36.1k|    isMalloced_ = true;
  699|  36.1k|  }
  700|       |
  701|  5.77M|  if (need > size_) {
  ------------------
  |  Branch (701:7): [True: 5.03M, False: 743k]
  ------------------
  702|  5.03M|    if (need > sizeAlloced_) {
  ------------------
  |  Branch (702:9): [True: 22.0k, False: 5.01M]
  ------------------
  703|  22.0k|      blockSize = std::min(2 * sizeAlloced_, maxBlockSize);
  704|       |      // Allocate in blocks
  705|  22.0k|      size_t want = blockSize * (1 + need / blockSize);
  706|  22.0k|      data_ = static_cast<byte*>(std::realloc(data_, want));
  707|  22.0k|      if (!data_) {
  ------------------
  |  Branch (707:11): [True: 0, False: 22.0k]
  ------------------
  708|      0|        throw Error(ErrorCode::kerMallocFailed);
  709|      0|      }
  710|  22.0k|      sizeAlloced_ = want;
  711|  22.0k|    }
  712|  5.03M|    size_ = need;
  713|  5.03M|  }
  714|  5.77M|}
_ZN5Exiv25MemIoC2Ev:
  716|  49.5k|MemIo::MemIo() : p_(std::make_unique<Impl>()) {
  717|  49.5k|}
_ZN5Exiv25MemIoC2EPKhm:
  719|  79.0k|MemIo::MemIo(const byte* data, size_t size) : p_(std::make_unique<Impl>(data, size)) {
  720|  79.0k|}
_ZN5Exiv25MemIoD2Ev:
  722|   128k|MemIo::~MemIo() {
  723|   128k|  if (p_->isMalloced_) {
  ------------------
  |  Branch (723:7): [True: 35.7k, False: 92.8k]
  ------------------
  724|  35.7k|    std::free(p_->data_);
  725|  35.7k|  }
  726|   128k|}
_ZN5Exiv25MemIo5writeEPKhm:
  728|  5.71M|size_t MemIo::write(const byte* data, size_t wcount) {
  729|  5.71M|  p_->reserve(wcount);
  730|  5.71M|  if (data) {
  ------------------
  |  Branch (730:7): [True: 4.97M, False: 742k]
  ------------------
  731|  4.97M|    std::memcpy(&p_->data_[p_->idx_], data, wcount);
  732|  4.97M|  }
  733|  5.71M|  p_->idx_ += wcount;
  734|  5.71M|  return wcount;
  735|  5.71M|}
_ZN5Exiv25MemIo8transferERNS_7BasicIoE:
  737|  24.1k|void MemIo::transfer(BasicIo& src) {
  738|  24.1k|  if (auto memIo = dynamic_cast<MemIo*>(&src)) {
  ------------------
  |  Branch (738:12): [True: 24.1k, False: 0]
  ------------------
  739|       |    // Optimization if src is another instance of MemIo
  740|  24.1k|    if (p_->isMalloced_) {
  ------------------
  |  Branch (740:9): [True: 415, False: 23.7k]
  ------------------
  741|    415|      std::free(p_->data_);
  742|    415|    }
  743|  24.1k|    p_->idx_ = 0;
  744|  24.1k|    p_->data_ = memIo->p_->data_;
  745|  24.1k|    p_->size_ = memIo->p_->size_;
  746|  24.1k|    p_->isMalloced_ = memIo->p_->isMalloced_;
  747|  24.1k|    memIo->p_->idx_ = 0;
  748|  24.1k|    memIo->p_->data_ = nullptr;
  749|  24.1k|    memIo->p_->size_ = 0;
  750|  24.1k|    memIo->p_->isMalloced_ = false;
  751|  24.1k|  } 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|  24.1k|  if (error() || src.error())
  ------------------
  |  Branch (760:7): [True: 0, False: 24.1k]
  |  Branch (760:18): [True: 0, False: 24.1k]
  ------------------
  761|      0|    throw Error(ErrorCode::kerMemoryTransferFailed, strError());
  762|  24.1k|}
_ZN5Exiv25MemIo4putbEh:
  782|  60.0k|int MemIo::putb(byte data) {
  783|  60.0k|  p_->reserve(1);
  784|  60.0k|  p_->data_[p_->idx_++] = data;
  785|  60.0k|  return data;
  786|  60.0k|}
_ZN5Exiv25MemIo4seekElNS_7BasicIo8PositionE:
  788|  2.04M|int MemIo::seek(int64_t offset, Position pos) {
  789|  2.04M|  int64_t newIdx = 0;
  790|       |
  791|  2.04M|  switch (pos) {
  ------------------
  |  Branch (791:11): [True: 2.04M, False: 0]
  ------------------
  792|  1.51M|    case BasicIo::cur:
  ------------------
  |  Branch (792:5): [True: 1.51M, False: 538k]
  ------------------
  793|  1.51M|      newIdx = p_->idx_ + offset;
  794|  1.51M|      break;
  795|   538k|    case BasicIo::beg:
  ------------------
  |  Branch (795:5): [True: 538k, False: 1.51M]
  ------------------
  796|   538k|      newIdx = offset;
  797|   538k|      break;
  798|    354|    case BasicIo::end:
  ------------------
  |  Branch (798:5): [True: 354, False: 2.04M]
  ------------------
  799|    354|      newIdx = p_->size_ + offset;
  800|    354|      break;
  801|  2.04M|  }
  802|       |
  803|  2.04M|  if (newIdx < 0)
  ------------------
  |  Branch (803:7): [True: 0, False: 2.04M]
  ------------------
  804|      0|    return 1;
  805|       |
  806|  2.04M|  if (newIdx > static_cast<int64_t>(p_->size_)) {
  ------------------
  |  Branch (806:7): [True: 10.2k, False: 2.03M]
  ------------------
  807|  10.2k|    p_->eof_ = true;
  808|  10.2k|    return 1;
  809|  10.2k|  }
  810|       |
  811|  2.03M|  p_->idx_ = static_cast<size_t>(newIdx);
  812|  2.03M|  p_->eof_ = false;
  813|  2.03M|  return 0;
  814|  2.04M|}
_ZN5Exiv25MemIo4mmapEb:
  816|   136k|byte* MemIo::mmap(bool /*isWriteable*/) {
  817|   136k|  return p_->data_;
  818|   136k|}
_ZNK5Exiv25MemIo4tellEv:
  824|  1.49M|size_t MemIo::tell() const {
  825|  1.49M|  return p_->idx_;
  826|  1.49M|}
_ZNK5Exiv25MemIo4sizeEv:
  828|  1.14M|size_t MemIo::size() const {
  829|  1.14M|  return p_->size_;
  830|  1.14M|}
_ZN5Exiv25MemIo4openEv:
  832|   314k|int MemIo::open() {
  833|   314k|  p_->idx_ = 0;
  834|   314k|  p_->eof_ = false;
  835|   314k|  return 0;
  836|   314k|}
_ZNK5Exiv25MemIo6isopenEv:
  838|   244k|bool MemIo::isopen() const {
  839|   244k|  return true;
  840|   244k|}
_ZN5Exiv25MemIo5closeEv:
  842|   241k|int MemIo::close() {
  843|   241k|  return 0;
  844|   241k|}
_ZN5Exiv25MemIo4readEm:
  846|   352k|DataBuf MemIo::read(size_t rcount) {
  847|   352k|  DataBuf buf(rcount);
  848|   352k|  size_t readCount = read(buf.data(), buf.size());
  849|   352k|  buf.resize(readCount);
  850|   352k|  return buf;
  851|   352k|}
_ZN5Exiv25MemIo4readEPhm:
  853|  5.95M|size_t MemIo::read(byte* buf, size_t rcount) {
  854|  5.95M|  const auto avail = std::max<size_t>(p_->size_ - p_->idx_, 0);
  855|  5.95M|  const auto allow = std::min<size_t>(rcount, avail);
  856|  5.95M|  if (allow > 0) {
  ------------------
  |  Branch (856:7): [True: 5.65M, False: 300k]
  ------------------
  857|  5.65M|    std::memcpy(buf, &p_->data_[p_->idx_], allow);
  858|  5.65M|  }
  859|  5.95M|  p_->idx_ += allow;
  860|  5.95M|  if (rcount > avail) {
  ------------------
  |  Branch (860:7): [True: 27.6k, False: 5.92M]
  ------------------
  861|  27.6k|    p_->eof_ = true;
  862|  27.6k|  }
  863|  5.95M|  return allow;
  864|  5.95M|}
_ZN5Exiv25MemIo4getbEv:
  866|  10.0M|int MemIo::getb() {
  867|  10.0M|  if (p_->idx_ >= p_->size_) {
  ------------------
  |  Branch (867:7): [True: 2.14k, False: 10.0M]
  ------------------
  868|  2.14k|    p_->eof_ = true;
  869|  2.14k|    return EOF;
  870|  2.14k|  }
  871|  10.0M|  return p_->data_[p_->idx_++];
  872|  10.0M|}
_ZNK5Exiv25MemIo5errorEv:
  874|  6.02M|int MemIo::error() const {
  875|  6.02M|  return 0;
  876|  6.02M|}
_ZNK5Exiv25MemIo3eofEv:
  878|  1.92M|bool MemIo::eof() const {
  879|  1.92M|  return p_->eof_;
  880|  1.92M|}
_ZNK5Exiv25MemIo4pathEv:
  882|  23.6k|const std::string& MemIo::path() const noexcept {
  883|  23.6k|  static std::string _path{"MemIo"};
  884|  23.6k|  return _path;
  885|  23.6k|}
_ZN5Exiv25MemIo16populateFakeDataEv:
  887|    349|void MemIo::populateFakeData() {
  888|    349|}
_ZN5Exiv25MemIo4ImplC2Ev:
  607|  49.5k|  Impl() = default;                     //!< Default constructor

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

_ZN5Exiv28BmpImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   27|    288|    Image(ImageType::bmp, mdNone, std::move(io), params) {
   28|    288|}
_ZN5Exiv28BmpImage12readMetadataEv:
   47|    278|void BmpImage::readMetadata() {
   48|       |#ifdef EXIV2_DEBUG_MESSAGES
   49|       |  std::cerr << "Exiv2::BmpImage::readMetadata: Reading Windows bitmap file " << io_->path() << "\n";
   50|       |#endif
   51|    278|  if (io_->open() != 0) {
  ------------------
  |  Branch (51:7): [True: 0, False: 278]
  ------------------
   52|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   53|      0|  }
   54|    278|  IoCloser closer(*io_);
   55|       |
   56|       |  // Ensure that this is the correct image type
   57|    278|  if (!isBmpType(*io_, false)) {
  ------------------
  |  Branch (57:7): [True: 0, False: 278]
  ------------------
   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|    278|  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|    278|  byte buf[26];
   96|    278|  if (io_->read(buf, sizeof(buf)) == sizeof(buf)) {
  ------------------
  |  Branch (96:7): [True: 278, False: 0]
  ------------------
   97|    278|    const uint32_t headerSize = getULong(buf + 14, littleEndian);
   98|    278|    if (headerSize == 12) {
  ------------------
  |  Branch (98:9): [True: 29, False: 249]
  ------------------
   99|       |      // OS/2 1.x / Windows 2.x BITMAPCOREHEADER: width and height are 16-bit fields.
  100|     29|      pixelWidth_ = getUShort(buf + 18, littleEndian);
  101|     29|      pixelHeight_ = getUShort(buf + 20, littleEndian);
  102|    249|    } else {
  103|    249|      pixelWidth_ = getULong(buf + 18, littleEndian);
  104|    249|      pixelHeight_ = getULong(buf + 22, littleEndian);
  105|    249|    }
  106|    278|  }
  107|    278|}
_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|    288|Image::UniquePtr newBmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  117|    288|  auto image = std::make_unique<BmpImage>(std::move(io), params);
  118|    288|  if (!image->good()) {
  ------------------
  |  Branch (118:7): [True: 10, False: 278]
  ------------------
  119|     10|    return nullptr;
  120|     10|  }
  121|    278|  return image;
  122|    288|}
_ZN5Exiv29isBmpTypeERNS_7BasicIoEb:
  124|  24.1k|bool isBmpType(BasicIo& iIo, bool advance) {
  125|  24.1k|  const int32_t len = 2;
  126|  24.1k|  const std::array<byte, len> BmpImageId{'B', 'M'};
  127|  24.1k|  std::array<byte, len> buf;
  128|  24.1k|  iIo.read(buf.data(), len);
  129|  24.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 24.1k]
  |  Branch (129:22): [True: 561, False: 23.6k]
  ------------------
  130|    561|    return false;
  131|    561|  }
  132|  23.6k|  bool matched = buf == BmpImageId;
  133|  23.6k|  if (!advance || !matched) {
  ------------------
  |  Branch (133:7): [True: 23.6k, False: 0]
  |  Branch (133:19): [True: 0, False: 0]
  ------------------
  134|  23.6k|    iIo.seek(-len, BasicIo::cur);
  135|  23.6k|  }
  136|  23.6k|  return matched;
  137|  24.1k|}

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   261k|  static constexpr auto tagList() {
   39|   261k|    return tagInfo_;
   40|   261k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|   100k|  static constexpr auto tagListCs() {
   43|   100k|    return tagInfoCs_;
   44|   100k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  6.50k|  static constexpr auto tagListSi() {
   47|  6.50k|    return tagInfoSi_;
   48|  6.50k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|    948|  static constexpr auto tagListCf() {
   55|    948|    return tagInfoCf_;
   56|    948|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.46k|  static constexpr auto tagListPi() {
   59|  1.46k|    return tagInfoPi_;
   60|  1.46k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    465|  static constexpr auto tagListTi() {
   63|    465|    return tagInfoTi_;
   64|    465|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|    232|  static constexpr auto tagListFi() {
   67|    232|    return tagInfoFi_;
   68|    232|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    776|  static constexpr auto tagListPa() {
   51|    776|    return tagInfoPa_;
   52|    776|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|   136k|  static constexpr auto tagListPr() {
   71|   136k|    return tagInfoPr_;
   72|   136k|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    331|  static constexpr auto tagListVigCor2() {
  135|    331|    return tagInfoVigCor2_;
  136|    331|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    309|  static constexpr auto tagListLiOp() {
  139|    309|    return tagInfoLiOp_;
  140|    309|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    247|  static constexpr auto tagListAfMiAdj() {
  127|    247|    return tagInfoAfMiAdj_;
  128|    247|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|    502|  static constexpr auto tagListLe() {
  143|    502|    return tagInfoLe_;
  144|    502|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    235|  static constexpr auto tagListAm() {
  147|    235|    return tagInfoAm_;
  148|    235|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    321|  static constexpr auto tagListFil() {
  155|    321|    return tagInfoFil_;
  156|    321|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    528|  static constexpr auto tagListMe() {
  151|    528|    return tagInfoMe_;
  152|    528|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    400|  static constexpr auto tagListHdr() {
  159|    400|    return tagInfoHdr_;
  160|    400|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    200|  static constexpr auto tagListAfC() {
  163|    200|    return tagInfoAfC_;
  164|    200|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    339|  static constexpr auto tagListRawB() {
  167|    339|    return tagInfoRawB_;
  168|    339|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  7.17k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  7.17k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  7.08k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  7.08k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  6.83k|void Converter::cnvToXmp() {
  503|   853k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 853k, False: 6.83k]
  ------------------
  504|   853k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 704k, False: 148k]
  |  Branch (504:37): [True: 353k, False: 351k]
  |  Branch (504:52): [True: 148k, False: 351k]
  |  Branch (504:79): [True: 74.0k, False: 74.3k]
  ------------------
  505|   427k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   427k|    }
  507|   853k|  }
  508|  6.83k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  7.42k|void Converter::cnvFromXmp() {
  511|   934k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 934k, False: 7.42k]
  ------------------
  512|   934k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 771k, False: 163k]
  |  Branch (512:37): [True: 385k, False: 385k]
  |  Branch (512:52): [True: 163k, False: 385k]
  |  Branch (512:79): [True: 81.6k, False: 81.6k]
  ------------------
  513|   467k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   467k|    }
  515|   934k|  }
  516|  7.42k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  6.73k|void Converter::cnvNone(const char*, const char*) {
  519|  6.73k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  8.83k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  8.83k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  8.83k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 8.83k, False: 0]
  ------------------
  524|  8.83k|    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.51k|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|  1.51k|  auto pos = iptcData_->findKey(IptcKey(to));
  533|  1.51k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 1.51k, False: 0]
  ------------------
  534|  1.51k|    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.25k|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|  1.25k|  auto pos = xmpData_->findKey(XmpKey(to));
  545|  1.25k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 1.25k]
  ------------------
  546|      0|    return true;
  547|  1.25k|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 1.25k]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|  1.25k|  xmpData_->erase(pos);
  550|  1.25k|  return true;
  551|  1.25k|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   306k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   306k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   306k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 305k, False: 550]
  ------------------
  556|   305k|    return;
  557|    550|  std::string value = pos->toString();
  558|    550|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 550]
  ------------------
  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|    550|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 550]
  ------------------
  565|      0|    return;
  566|    550|  (*xmpData_)[to] = value;
  567|    550|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 550]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    550|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  3.37k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  3.37k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  3.37k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 3.37k, False: 0]
  ------------------
  574|  3.37k|    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|  3.37k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  3.37k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  3.37k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 3.37k, False: 0]
  ------------------
  599|  3.37k|    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|  13.5k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  13.5k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  13.5k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 13.4k, False: 184]
  ------------------
  619|  13.4k|    return;
  620|    184|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 184]
  ------------------
  621|      0|    return;
  622|    184|  int year = 0;
  623|    184|  int month = 0;
  624|    184|  int day = 0;
  625|    184|  int hour = 0;
  626|    184|  int min = 0;
  627|    184|  int sec = 0;
  628|    184|  std::string subsec;
  629|       |
  630|    184|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 184, False: 0]
  ------------------
  631|    184|    std::string value = pos->toString();
  632|    184|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 184]
  ------------------
  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|    184|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 184]
  ------------------
  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|    184|  } 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|    184|  const char* subsecTag = nullptr;
  711|    184|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 10, False: 174]
  ------------------
  712|     10|    subsecTag = "Exif.Photo.SubSecTime";
  713|    174|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 18, False: 156]
  ------------------
  714|     18|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|    156|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 156, False: 0]
  ------------------
  716|    156|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|    156|  }
  718|       |
  719|    184|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 184, False: 0]
  ------------------
  720|    184|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    184|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 30, False: 154]
  ------------------
  722|     30|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 30, False: 0]
  ------------------
  723|     30|        std::string ss = subsec_pos->toString();
  724|     30|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 30, False: 0]
  ------------------
  725|     30|          bool ok = false;
  726|     30|          stringTo<long>(ss, ok);
  727|     30|          if (ok)
  ------------------
  |  Branch (727:15): [True: 30, False: 0]
  ------------------
  728|     30|            subsec = std::string(".") + ss;
  729|     30|        }
  730|     30|      }
  731|     30|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 30]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     30|    }
  734|    184|  }
  735|       |
  736|    184|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 184]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    184|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    184|#define stringFormat std::format
  ------------------
  740|    184|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 184]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    184|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  6.75k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  6.75k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  6.75k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 6.75k, False: 0]
  ------------------
  747|  6.75k|    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|  3.37k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  3.37k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  3.37k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 3.37k, False: 0]
  ------------------
  764|  3.37k|    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|  3.37k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  3.37k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  3.37k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 3.37k, False: 0]
  |  Branch (780:7): [True: 3.37k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  3.37k|    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|  13.5k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  13.5k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  13.5k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 13.5k, False: 0]
  ------------------
  805|  13.5k|    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|  const auto ref = refPos->toString();
  822|      0|  if (ref.empty()) {
  ------------------
  |  Branch (822:7): [True: 0, False: 0]
  ------------------
  823|      0|#ifndef SUPPRESS_WARNINGS
  824|      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()
  ------------------
  825|      0|#endif
  826|      0|    return;
  827|      0|  }
  828|      0|  double deg[3];
  829|      0|  for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (829:19): [True: 0, False: 0]
  ------------------
  830|      0|    const auto [z, d] = pos->toRational(i);
  831|      0|    if (d == 0) {
  ------------------
  |  Branch (831:9): [True: 0, False: 0]
  ------------------
  832|      0|#ifndef SUPPRESS_WARNINGS
  833|      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()
  ------------------
  834|      0|#endif
  835|      0|      return;
  836|      0|    }
  837|       |    // Hack: Need Value::toDouble
  838|      0|    deg[i] = static_cast<double>(z) / d;
  839|      0|  }
  840|      0|  double min = (deg[0] * 60.0) + deg[1] + (deg[2] / 60.0);
  841|      0|  auto ideg = static_cast<int>(min / 60.0);
  842|      0|  min -= ideg * 60;
  843|      0|  (*xmpData_)[to] = stringFormat("{},{:.7f}{}", ideg, min, ref.front());
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  844|       |
  845|      0|  if (erase_)
  ------------------
  |  Branch (845:7): [True: 0, False: 0]
  ------------------
  846|      0|    exifData_->erase(pos);
  847|      0|  if (erase_)
  ------------------
  |  Branch (847:7): [True: 0, False: 0]
  ------------------
  848|      0|    exifData_->erase(refPos);
  849|      0|}
_ZN5Exiv29Converter11cnvXmpValueEPKcS2_:
  851|   333k|void Converter::cnvXmpValue(const char* from, const char* to) {
  852|   333k|  auto pos = xmpData_->findKey(XmpKey(from));
  853|   333k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (853:7): [True: 333k, False: 829]
  ------------------
  854|   333k|    return;
  855|    829|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (855:7): [True: 0, False: 829]
  ------------------
  856|      0|    return;
  857|    829|  std::string value;
  858|    829|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (858:7): [True: 274, False: 555]
  ------------------
  859|    274|#ifndef SUPPRESS_WARNINGS
  860|    274|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    274|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 274]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    274|  LogMsg(LogMsg::warn).os()
  ------------------
  861|    274|#endif
  862|    274|    return;
  863|    274|  }
  864|       |  // Todo: Escape non-ASCII characters in XMP text values
  865|    555|  ExifKey key(to);
  866|    555|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (866:33): [True: 550, False: 5]
  ------------------
  867|    550|    exifData_->add(ed);
  868|    550|  }
  869|    555|  if (erase_)
  ------------------
  |  Branch (869:7): [True: 0, False: 555]
  ------------------
  870|      0|    xmpData_->erase(pos);
  871|    555|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  873|  3.71k|void Converter::cnvXmpComment(const char* from, const char* to) {
  874|  3.71k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (874:7): [True: 0, False: 3.71k]
  ------------------
  875|      0|    return;
  876|  3.71k|  auto pos = xmpData_->findKey(XmpKey(from));
  877|  3.71k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (877:7): [True: 3.71k, False: 0]
  ------------------
  878|  3.71k|    return;
  879|      0|  std::string value;
  880|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (880:7): [True: 0, False: 0]
  ------------------
  881|      0|#ifndef SUPPRESS_WARNINGS
  882|      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()
  ------------------
  883|      0|#endif
  884|      0|    return;
  885|      0|  }
  886|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  887|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  888|      0|  if (erase_)
  ------------------
  |  Branch (888:7): [True: 0, False: 0]
  ------------------
  889|      0|    xmpData_->erase(pos);
  890|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  892|  3.71k|void Converter::cnvXmpArray(const char* from, const char* to) {
  893|  3.71k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (893:7): [True: 0, False: 3.71k]
  ------------------
  894|      0|    return;
  895|  3.71k|  auto pos = xmpData_->findKey(XmpKey(from));
  896|  3.71k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (896:7): [True: 3.71k, False: 0]
  ------------------
  897|  3.71k|    return;
  898|      0|  std::string array;
  899|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (899:22): [True: 0, False: 0]
  ------------------
  900|      0|    std::string value = pos->toString(i);
  901|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|#ifndef SUPPRESS_WARNINGS
  903|      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()
  ------------------
  904|      0|#endif
  905|      0|      return;
  906|      0|    }
  907|      0|    array += value;
  908|      0|    if (i != pos->count() - 1)
  ------------------
  |  Branch (908:9): [True: 0, False: 0]
  ------------------
  909|      0|      array += " ";
  910|      0|  }
  911|      0|  (*exifData_)[to] = array;
  912|      0|  if (erase_)
  ------------------
  |  Branch (912:7): [True: 0, False: 0]
  ------------------
  913|      0|    xmpData_->erase(pos);
  914|      0|}
_ZN5Exiv29Converter10cnvXmpDateEPKcS2_:
  916|  14.8k|void Converter::cnvXmpDate(const char* from, const char* to) {
  917|  14.8k|  auto pos = xmpData_->findKey(XmpKey(from));
  918|  14.8k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (918:7): [True: 14.2k, False: 553]
  ------------------
  919|  14.2k|    return;
  920|    553|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (920:7): [True: 0, False: 553]
  ------------------
  921|      0|    return;
  922|    553|#ifdef EXV_HAVE_XMP_TOOLKIT
  923|    553|  std::string value = pos->toString();
  924|    553|  if (!pos->value().ok()) {
  ------------------
  |  Branch (924:7): [True: 0, False: 553]
  ------------------
  925|      0|#ifndef SUPPRESS_WARNINGS
  926|      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()
  ------------------
  927|      0|#endif
  928|      0|    return;
  929|      0|  }
  930|    553|  XMP_DateTime datetime;
  931|    553|  try {
  932|    553|    SXMPUtils::ConvertToDate(value, &datetime);
  933|    553|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (933:9): [True: 189, False: 364]
  ------------------
  934|    189|      SXMPUtils::ConvertToLocalTime(&datetime);
  935|       |
  936|    189|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    189|#define stringFormat std::format
  ------------------
  937|    189|                                      datetime.hour, datetime.minute, datetime.second);
  938|       |
  939|    189|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (939:11): [True: 30, False: 159]
  ------------------
  940|     30|        const char* subsecTag = nullptr;
  941|     30|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (941:13): [True: 3, False: 27]
  ------------------
  942|      3|          subsecTag = "Exif.Photo.SubSecTime";
  943|     27|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (943:20): [True: 5, False: 22]
  ------------------
  944|      5|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  945|     22|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (945:20): [True: 22, False: 0]
  ------------------
  946|     22|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  947|     22|        }
  948|     30|        if (subsecTag) {
  ------------------
  |  Branch (948:13): [True: 30, False: 0]
  ------------------
  949|     30|          prepareExifTarget(subsecTag, true);
  950|     30|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  951|     30|        }
  952|     30|      }
  953|    364|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  954|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  955|       |
  956|    364|      URational rhour(datetime.hour, 1);
  957|    364|      URational rmin(datetime.minute, 1);
  958|    364|      URational rsec(datetime.second, 1);
  959|    364|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (959:11): [True: 0, False: 364]
  ------------------
  960|      0|        if (datetime.second != 0) {
  ------------------
  |  Branch (960:13): [True: 0, False: 0]
  ------------------
  961|       |          // Add the seconds to rmin so that the ns fit into rsec
  962|      0|          rmin.second = 60;
  963|      0|          rmin.first *= 60;
  964|      0|          rmin.first += datetime.second;
  965|      0|        }
  966|      0|        rsec.second = 1000000000;
  967|      0|        rsec.first = datetime.nanoSecond;
  968|      0|      }
  969|       |
  970|    364|      std::ostringstream array;
  971|    364|      array << rhour << " " << rmin << " " << rsec;
  972|    364|      (*exifData_)[to] = array.str();
  973|       |
  974|    364|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  975|    364|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  976|    364|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    364|#define stringFormat std::format
  ------------------
  977|    364|    }
  978|    553|  }
  979|    553|#ifndef SUPPRESS_WARNINGS
  980|    553|  catch (const XMP_Error& e) {
  981|    369|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    369|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 369]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    369|  LogMsg(LogMsg::warn).os()
  ------------------
  982|    369|    return;
  983|    369|  }
  984|       |#else
  985|       |  catch (const XMP_Error&) {
  986|       |    return;
  987|       |  }
  988|       |#endif  // SUPPRESS_WARNINGS
  989|       |
  990|    184|  if (erase_)
  ------------------
  |  Branch (990:7): [True: 0, False: 184]
  ------------------
  991|      0|    xmpData_->erase(pos);
  992|       |#else
  993|       |#ifndef SUPPRESS_WARNINGS
  994|       |  EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  995|       |#endif
  996|       |#endif  // !EXV_HAVE_XMP_TOOLKIT
  997|    184|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  999|  7.42k|void Converter::cnvXmpVersion(const char* from, const char* to) {
 1000|  7.42k|  auto pos = xmpData_->findKey(XmpKey(from));
 1001|  7.42k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1001:7): [True: 7.42k, False: 0]
  ------------------
 1002|  7.42k|    return;
 1003|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1003:7): [True: 0, False: 0]
  ------------------
 1004|      0|    return;
 1005|      0|  std::string value = pos->toString();
 1006|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (1006:7): [True: 0, False: 0]
  |  Branch (1006:29): [True: 0, False: 0]
  ------------------
 1007|      0|#ifndef SUPPRESS_WARNINGS
 1008|      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()
  ------------------
 1009|      0|#endif
 1010|      0|    return;
 1011|      0|  }
 1012|       |
 1013|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1014|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1015|      0|  if (erase_)
  ------------------
  |  Branch (1015:7): [True: 0, False: 0]
  ------------------
 1016|      0|    xmpData_->erase(pos);
 1017|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1019|  3.71k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1020|  3.71k|  auto pos = xmpData_->findKey(XmpKey(from));
 1021|  3.71k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1021:7): [True: 3.71k, False: 0]
  ------------------
 1022|  3.71k|    return;
 1023|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1023:7): [True: 0, False: 0]
  ------------------
 1024|      0|    return;
 1025|      0|  std::string value = pos->toString();
 1026|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1026:7): [True: 0, False: 0]
  ------------------
 1027|      0|#ifndef SUPPRESS_WARNINGS
 1028|      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()
  ------------------
 1029|      0|#endif
 1030|      0|    return;
 1031|      0|  }
 1032|       |
 1033|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1034|      0|  (*exifData_)[to] = value;
 1035|      0|  if (erase_)
  ------------------
  |  Branch (1035:7): [True: 0, False: 0]
  ------------------
 1036|      0|    xmpData_->erase(pos);
 1037|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1039|  3.71k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1040|  3.71k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1041|  3.71k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1041:7): [True: 3.71k, False: 0]
  ------------------
 1042|  3.71k|    return;
 1043|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1043:7): [True: 0, False: 0]
  ------------------
 1044|      0|    return;
 1045|      0|  unsigned short value = 0;
 1046|       |
 1047|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1047:7): [True: 0, False: 0]
  |  Branch (1047:7): [True: 0, False: 0]
  |  Branch (1047:33): [True: 0, False: 0]
  ------------------
 1048|      0|    auto fired = pos->toUint32();
 1049|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1049:9): [True: 0, False: 0]
  ------------------
 1050|      0|      value |= fired & 1;
 1051|      0|#ifndef SUPPRESS_WARNINGS
 1052|      0|    else
 1053|      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()
  ------------------
 1054|      0|                  << " to " << to << "\n";
 1055|      0|#endif
 1056|      0|  }
 1057|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Return"));
 1058|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1058:7): [True: 0, False: 0]
  |  Branch (1058:7): [True: 0, False: 0]
  |  Branch (1058:33): [True: 0, False: 0]
  ------------------
 1059|      0|    auto ret = pos->toUint32();
 1060|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1060:9): [True: 0, False: 0]
  ------------------
 1061|      0|      value |= (ret & 3) << 1;
 1062|      0|#ifndef SUPPRESS_WARNINGS
 1063|      0|    else
 1064|      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()
  ------------------
 1065|      0|                  << " to " << to << "\n";
 1066|      0|#endif
 1067|      0|  }
 1068|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Mode"));
 1069|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1069:7): [True: 0, False: 0]
  |  Branch (1069:7): [True: 0, False: 0]
  |  Branch (1069:33): [True: 0, False: 0]
  ------------------
 1070|      0|    auto mode = pos->toUint32();
 1071|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1071:9): [True: 0, False: 0]
  ------------------
 1072|      0|      value |= (mode & 3) << 3;
 1073|      0|#ifndef SUPPRESS_WARNINGS
 1074|      0|    else
 1075|      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()
  ------------------
 1076|      0|                  << " to " << to << "\n";
 1077|      0|#endif
 1078|      0|  }
 1079|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Function"));
 1080|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1080:7): [True: 0, False: 0]
  |  Branch (1080:7): [True: 0, False: 0]
  |  Branch (1080:33): [True: 0, False: 0]
  ------------------
 1081|      0|    auto function = pos->toUint32();
 1082|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1082:9): [True: 0, False: 0]
  ------------------
 1083|      0|      value |= (function & 1) << 5;
 1084|      0|#ifndef SUPPRESS_WARNINGS
 1085|      0|    else
 1086|      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()
  ------------------
 1087|      0|                  << " to " << to << "\n";
 1088|      0|#endif
 1089|      0|  }
 1090|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:RedEyeMode"));
 1091|      0|  if (pos != xmpData_->end()) {
  ------------------
  |  Branch (1091:7): [True: 0, False: 0]
  ------------------
 1092|      0|    if (pos->count() > 0) {
  ------------------
  |  Branch (1092:9): [True: 0, False: 0]
  ------------------
 1093|      0|      auto red = pos->toUint32();
 1094|      0|      if (pos->value().ok())
  ------------------
  |  Branch (1094:11): [True: 0, False: 0]
  ------------------
 1095|      0|        value |= (red & 1) << 6;
 1096|      0|#ifndef SUPPRESS_WARNINGS
 1097|      0|      else
 1098|      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()
  ------------------
 1099|      0|                    << " to " << to << "\n";
 1100|      0|#endif
 1101|      0|    }
 1102|      0|    if (erase_)
  ------------------
  |  Branch (1102:9): [True: 0, False: 0]
  ------------------
 1103|      0|      xmpData_->erase(pos);
 1104|      0|  }
 1105|       |
 1106|      0|  (*exifData_)[to] = value;
 1107|      0|}
_ZN5Exiv29Converter14cnvXmpGPSCoordEPKcS2_:
 1109|  14.8k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1110|  14.8k|  auto pos = xmpData_->findKey(XmpKey(from));
 1111|  14.8k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1111:7): [True: 14.8k, False: 0]
  ------------------
 1112|  14.8k|    return;
 1113|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1113:7): [True: 0, False: 0]
  ------------------
 1114|      0|    return;
 1115|      0|  std::string value = pos->toString();
 1116|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1116:7): [True: 0, False: 0]
  ------------------
 1117|      0|#ifndef SUPPRESS_WARNINGS
 1118|      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()
  ------------------
 1119|      0|#endif
 1120|      0|    return;
 1121|      0|  }
 1122|      0|  if (value.empty()) {
  ------------------
  |  Branch (1122:7): [True: 0, False: 0]
  ------------------
 1123|      0|#ifndef SUPPRESS_WARNINGS
 1124|      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()
  ------------------
 1125|      0|#endif
 1126|      0|    return;
 1127|      0|  }
 1128|       |
 1129|      0|  double deg = 0.0;
 1130|      0|  double min = 0.0;
 1131|      0|  double sec = 0.0;
 1132|      0|  char ref = value.back();
 1133|      0|  char sep1 = '\0';
 1134|      0|  char sep2 = '\0';
 1135|       |
 1136|      0|  value.pop_back();
 1137|       |
 1138|      0|  std::istringstream in(value);
 1139|       |
 1140|      0|  in >> deg >> sep1 >> min >> sep2;
 1141|       |
 1142|      0|  if (sep2 == ',') {
  ------------------
  |  Branch (1142:7): [True: 0, False: 0]
  ------------------
 1143|      0|    in >> sec;
 1144|      0|  } else {
 1145|      0|    sec = (min - static_cast<int>(min)) * 60.0;
 1146|      0|    min = static_cast<double>(static_cast<int>(min));
 1147|      0|  }
 1148|       |
 1149|      0|  if (in.bad() || (ref != 'N' && ref != 'S' && ref != 'E' && ref != 'W') || sep1 != ',' || !in.eof()) {
  ------------------
  |  Branch (1149:7): [True: 0, False: 0]
  |  Branch (1149:20): [True: 0, False: 0]
  |  Branch (1149:34): [True: 0, False: 0]
  |  Branch (1149:48): [True: 0, False: 0]
  |  Branch (1149:62): [True: 0, False: 0]
  |  Branch (1149:77): [True: 0, False: 0]
  |  Branch (1149:92): [True: 0, False: 0]
  ------------------
 1150|      0|#ifndef SUPPRESS_WARNINGS
 1151|      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()
  ------------------
 1152|      0|#endif
 1153|      0|    return;
 1154|      0|  }
 1155|       |
 1156|      0|  Rational rdeg = floatToRationalCast(static_cast<float>(deg));
 1157|      0|  Rational rmin = floatToRationalCast(static_cast<float>(min));
 1158|      0|  Rational rsec = floatToRationalCast(static_cast<float>(sec));
 1159|       |
 1160|      0|  std::ostringstream array;
 1161|      0|  array << rdeg << " " << rmin << " " << rsec;
 1162|      0|  (*exifData_)[to] = array.str();
 1163|       |
 1164|      0|  prepareExifTarget((std::string(to) + "Ref").c_str(), true);
 1165|      0|  char ref_str[2] = {ref, 0};
 1166|      0|  (*exifData_)[std::string(to) + "Ref"] = ref_str;
 1167|       |
 1168|      0|  if (erase_)
  ------------------
  |  Branch (1168:7): [True: 0, False: 0]
  ------------------
 1169|      0|    xmpData_->erase(pos);
 1170|      0|}
_ZN5Exiv29Converter12cnvIptcValueEPKcS2_:
 1172|  67.3k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1173|  67.3k|  auto pos = iptcData_->findKey(IptcKey(from));
 1174|  67.3k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1174:7): [True: 66.8k, False: 522]
  ------------------
 1175|  66.8k|    return;
 1176|    522|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1176:7): [True: 0, False: 522]
  ------------------
 1177|      0|    return;
 1178|  14.7k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1178:10): [True: 14.2k, False: 522]
  ------------------
 1179|  14.2k|    if (pos->key() == from) {
  ------------------
  |  Branch (1179:9): [True: 8.10k, False: 6.12k]
  ------------------
 1180|  8.10k|      std::string value = pos->toString();
 1181|  8.10k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1181:11): [True: 0, False: 8.10k]
  ------------------
 1182|      0|#ifndef SUPPRESS_WARNINGS
 1183|      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()
  ------------------
 1184|      0|#endif
 1185|      0|        ++pos;
 1186|      0|        continue;
 1187|      0|      }
 1188|  8.10k|      if (iptcCharset_)
  ------------------
  |  Branch (1188:11): [True: 8.10k, False: 0]
  ------------------
 1189|  8.10k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1190|  8.10k|      (*xmpData_)[to] = value;
 1191|  8.10k|      if (erase_) {
  ------------------
  |  Branch (1191:11): [True: 0, False: 8.10k]
  ------------------
 1192|      0|        pos = iptcData_->erase(pos);
 1193|      0|        continue;
 1194|      0|      }
 1195|  8.10k|    }
 1196|  14.2k|    ++pos;
 1197|  14.2k|  }
 1198|    522|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1200|  81.6k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1201|  81.6k|  auto pos = xmpData_->findKey(XmpKey(from));
 1202|  81.6k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1202:7): [True: 80.1k, False: 1.51k]
  ------------------
 1203|  80.1k|    return;
 1204|  1.51k|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1204:7): [True: 0, False: 1.51k]
  ------------------
 1205|      0|    return;
 1206|       |
 1207|  1.51k|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1207:7): [True: 451, False: 1.06k]
  |  Branch (1207:35): [True: 819, False: 247]
  ------------------
 1208|  1.27k|    std::string value;
 1209|  1.27k|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1209:9): [True: 294, False: 976]
  ------------------
 1210|    294|#ifndef SUPPRESS_WARNINGS
 1211|    294|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    294|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 294]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    294|  LogMsg(LogMsg::warn).os()
  ------------------
 1212|    294|#endif
 1213|    294|      return;
 1214|    294|    }
 1215|    976|    (*iptcData_)[to] = value;
 1216|    976|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1217|    976|    if (erase_)
  ------------------
  |  Branch (1217:9): [True: 0, False: 976]
  ------------------
 1218|      0|      xmpData_->erase(pos);
 1219|    976|    return;
 1220|  1.27k|  }
 1221|       |
 1222|    247|  size_t count = pos->count();
 1223|    247|  bool added = false;
 1224|  10.1k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1224:22): [True: 9.93k, False: 247]
  ------------------
 1225|  9.93k|    std::string value = pos->toString(i);
 1226|  9.93k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1226:9): [True: 0, False: 9.93k]
  ------------------
 1227|      0|#ifndef SUPPRESS_WARNINGS
 1228|      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()
  ------------------
 1229|      0|#endif
 1230|      0|      continue;
 1231|      0|    }
 1232|  9.93k|    IptcKey key(to);
 1233|  9.93k|    Iptcdatum id(key);
 1234|  9.93k|    id.setValue(value);
 1235|  9.93k|    iptcData_->add(id);
 1236|  9.93k|    added = true;
 1237|  9.93k|  }
 1238|    247|  if (added)
  ------------------
  |  Branch (1238:7): [True: 234, False: 13]
  ------------------
 1239|    234|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1240|    247|  if (erase_)
  ------------------
  |  Branch (1240:7): [True: 0, False: 247]
  ------------------
 1241|      0|    xmpData_->erase(pos);
 1242|    247|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1323|  3.46k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1324|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1325|       |  /// effect
 1326|  3.46k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1327|  3.46k|  converter.cnvToXmp();
 1328|  3.46k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1337|  3.71k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1338|  3.71k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1339|  3.71k|  converter.cnvFromXmp();
 1340|  3.71k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1354|  3.37k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1355|  3.37k|  if (!iptcCharset)
  ------------------
  |  Branch (1355:7): [True: 3.37k, False: 0]
  ------------------
 1356|  3.37k|    iptcCharset = iptcData.detectCharset();
 1357|  3.37k|  if (!iptcCharset)
  ------------------
  |  Branch (1357:7): [True: 0, False: 3.37k]
  ------------------
 1358|      0|    iptcCharset = "ISO-8859-1";
 1359|       |
 1360|  3.37k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1361|  3.37k|  converter.cnvToXmp();
 1362|  3.37k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1375|  3.71k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1376|  3.71k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1377|  3.71k|  converter.cnvFromXmp();
 1378|  3.71k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1387|  21.8k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1388|  21.8k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1388:7): [True: 8.10k, False: 13.7k]
  ------------------
 1389|  8.10k|    return true;  // nothing to do
 1390|  13.7k|#ifdef EXV_HAVE_ICONV
 1391|  13.7k|  return convertStringCharsetIconv(str, from, to);
 1392|       |#elif defined _WIN32
 1393|       |  return convertStringCharsetWindows(str, from, to);
 1394|       |#else
 1395|       |#ifndef SUPPRESS_WARNINGS
 1396|       |  EXV_WARNING << "Charset conversion required but no character mapping functionality available.\n";
 1397|       |#endif
 1398|       |  return false;
 1399|       |#endif
 1400|  21.8k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1409|  13.7k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1410|  13.7k|  if (from == to)
  ------------------
  |  Branch (1410:7): [True: 0, False: 13.7k]
  ------------------
 1411|      0|    return true;  // nothing to do
 1412|       |
 1413|  13.7k|  bool ret = true;
 1414|  13.7k|  auto cd = iconv_open(to.data(), from.data());
 1415|  13.7k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1415:7): [True: 0, False: 13.7k]
  ------------------
 1416|      0|#ifndef SUPPRESS_WARNINGS
 1417|      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()
  ------------------
 1418|      0|#endif
 1419|      0|    return false;
 1420|      0|  }
 1421|  13.7k|  std::string outstr;
 1422|       |#ifdef WINICONV_CONST
 1423|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1424|       |#else
 1425|  13.7k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1426|  13.7k|#endif
 1427|  13.7k|  size_t inbytesleft = str.length();
 1428|  25.3k|  while (inbytesleft) {
  ------------------
  |  Branch (1428:10): [True: 18.2k, False: 7.07k]
  ------------------
 1429|  18.2k|    char outbuf[256];
 1430|  18.2k|    char* outptr = outbuf;
 1431|  18.2k|    size_t outbytesleft = sizeof(outbuf);
 1432|  18.2k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1433|  18.2k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1434|  18.2k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1434:9): [True: 12.3k, False: 5.96k]
  |  Branch (1434:53): [True: 6.65k, False: 5.66k]
  ------------------
 1435|  6.65k|#ifndef SUPPRESS_WARNINGS
 1436|  6.65k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  6.65k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.65k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.65k|  LogMsg(LogMsg::warn).os()
  ------------------
 1437|  6.65k|#endif
 1438|  6.65k|      ret = false;
 1439|  6.65k|      break;
 1440|  6.65k|    }
 1441|  11.6k|    outstr.append(std::string(outbuf, outbytesProduced));
 1442|  11.6k|  }
 1443|       |
 1444|  13.7k|  if (cd)
  ------------------
  |  Branch (1444:7): [True: 13.7k, False: 0]
  ------------------
 1445|  13.7k|    iconv_close(cd);
 1446|       |
 1447|  13.7k|  if (ret)
  ------------------
  |  Branch (1447:7): [True: 7.07k, False: 6.65k]
  ------------------
 1448|  7.07k|    str = std::move(outstr);
 1449|  13.7k|  return ret;
 1450|  13.7k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1599|  2.09k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1600|  2.09k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1600:7): [True: 850, False: 1.24k]
  ------------------
 1601|       |    // get the default language entry without x-default qualifier
 1602|    850|    value = pos->toString(0);
 1603|    850|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1603:9): [True: 843, False: 7]
  |  Branch (1603:31): [True: 275, False: 568]
  ------------------
 1604|       |      // If there is no default but exactly one entry, take that
 1605|       |      // without the qualifier
 1606|    275|      value = pos->toString();
 1607|    275|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1607:11): [True: 275, False: 0]
  |  Branch (1607:32): [True: 275, False: 0]
  ------------------
 1608|    275|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1609|    275|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1609:13): [True: 275, False: 0]
  ------------------
 1610|    275|          value = value.substr(first_space_pos + 1);
 1611|    275|        } else {
 1612|      0|          value.clear();
 1613|      0|        }
 1614|    275|      }
 1615|    275|    }
 1616|  1.24k|  } else {
 1617|  1.24k|    value = pos->toString();
 1618|  1.24k|  }
 1619|  2.09k|  return pos->value().ok();
 1620|  2.09k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  77.3k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  77.3k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  77.3k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  77.3k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 77.3k]
  |  Branch (18:17): [True: 0, False: 77.3k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  77.3k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 4.54k, False: 72.8k]
  |  Branch (22:26): [True: 4.43k, False: 117]
  ------------------
   23|  4.43k|    setByteOrder(littleEndian);
   24|  72.9k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 30.4k, False: 42.4k]
  |  Branch (24:33): [True: 30.2k, False: 175]
  ------------------
   25|  30.2k|    setByteOrder(bigEndian);
   26|  42.6k|  } else {
   27|  42.6k|    return false;
   28|  42.6k|  }
   29|  34.7k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 22.2k, False: 12.4k]
  ------------------
   30|  22.2k|    return false;
   31|  12.4k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  12.4k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 10.0k, False: 2.42k]
  ------------------
   33|  10.0k|    return false;
   34|  2.42k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  2.42k|  return true;
   37|  12.4k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    141|DataBuf Cr2Header::write() const {
   40|    141|  DataBuf buf(16);
   41|    141|  switch (byteOrder()) {
   42|     83|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 83, False: 58]
  ------------------
   43|     83|      buf.write_uint8(0, 'I');
   44|     83|      break;
   45|     58|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 58, False: 83]
  ------------------
   46|     58|      buf.write_uint8(0, 'M');
   47|     58|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 141]
  ------------------
   49|      0|      break;
   50|    141|  }
   51|    141|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    141|  buf.write_uint16(2, tag(), byteOrder());
   54|    141|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    141|  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|    141|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    141|  return buf;
   59|    141|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  19.5k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  19.5k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 1.06k, False: 18.5k]
  |  Branch (63:33): [True: 974, False: 17.5k]
  ------------------
   64|  2.04k|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  17.5k|  return isTiffImageTag(tag, group);
   67|  19.5k|}

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

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

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

_ZN5Exiv28Internal13CiffComponentC2Ett:
  124|    639|CiffComponent::CiffComponent(uint16_t tag, uint16_t dir) : dir_(dir), tag_(tag) {
  125|    639|}
_ZN5Exiv28Internal13CiffComponent3addENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  127|  58.5k|const CiffComponent::UniquePtr& CiffComponent::add(UniquePtr component) {
  128|  58.5k|  return doAdd(std::move(component));
  129|  58.5k|}
_ZN5Exiv28Internal13CiffDirectory5doAddENSt3__110unique_ptrINS0_13CiffComponentENS2_14default_deleteIS4_EEEE:
  135|  58.5k|const CiffComponent::UniquePtr& CiffDirectory::doAdd(UniquePtr component) {
  136|  58.5k|  return components_.emplace_back(std::move(component));
  137|  58.5k|}  // CiffDirectory::doAdd
_ZN5Exiv28Internal10CiffHeader4readEPKhm:
  141|  1.74k|void CiffHeader::read(const byte* pData, size_t size) {
  142|  1.74k|  if (size < 14)
  ------------------
  |  Branch (142:7): [True: 0, False: 1.74k]
  ------------------
  143|      0|    throw Error(ErrorCode::kerNotACrwImage);
  144|       |
  145|  1.74k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (145:7): [True: 1.25k, False: 496]
  |  Branch (145:26): [True: 1.25k, False: 0]
  ------------------
  146|  1.25k|    byteOrder_ = littleEndian;
  147|  1.25k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (147:14): [True: 496, False: 0]
  |  Branch (147:33): [True: 496, False: 0]
  ------------------
  148|    496|    byteOrder_ = bigEndian;
  149|    496|  } else {
  150|      0|    throw Error(ErrorCode::kerNotACrwImage);
  151|      0|  }
  152|  1.74k|  offset_ = getULong(pData + 2, byteOrder_);
  153|  1.74k|  if (offset_ < 14 || offset_ > size)
  ------------------
  |  Branch (153:7): [True: 71, False: 1.67k]
  |  Branch (153:23): [True: 127, False: 1.55k]
  ------------------
  154|    198|    throw Error(ErrorCode::kerNotACrwImage);
  155|  1.55k|  if (std::memcmp(pData + 6, signature(), 8) != 0) {
  ------------------
  |  Branch (155:7): [True: 0, False: 1.55k]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotACrwImage);
  157|      0|  }
  158|       |
  159|  1.55k|  pPadding_.clear();
  160|  1.55k|  if (offset_ > 14) {
  ------------------
  |  Branch (160:7): [True: 1.19k, False: 352]
  ------------------
  161|  1.19k|    pPadding_.resize(offset_ - 14);
  162|  1.19k|    padded_ = offset_ - 14;
  163|  1.19k|    std::copy_n(pData + 14, padded_, pPadding_.begin());
  164|  1.19k|  }
  165|       |
  166|  1.55k|  pRootDir_ = std::make_unique<CiffDirectory>();
  167|  1.55k|  pRootDir_->readDirectory(pData + offset_, size - offset_, byteOrder_);
  168|  1.55k|}  // CiffHeader::read
_ZN5Exiv28Internal13CiffComponent4readEPKhmjNS_9ByteOrderE:
  170|  58.5k|void CiffComponent::read(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  171|  58.5k|  doRead(pData, size, start, byteOrder);
  172|  58.5k|}
_ZN5Exiv28Internal13CiffComponent6doReadEPKhmjNS_9ByteOrderE:
  174|  58.5k|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|  58.5k|  enforce(size >= 10 && start <= size - 10, ErrorCode::kerNotACrwImage);
  ------------------
  |  Branch (176:11): [True: 58.5k, False: 0]
  |  Branch (176:25): [True: 58.5k, False: 0]
  ------------------
  177|  58.5k|  tag_ = getUShort(pData + start, byteOrder);
  178|       |
  179|  58.5k|  DataLocId dl = dataLocation();
  180|       |
  181|  58.5k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (181:7): [True: 7.85k, False: 50.6k]
  ------------------
  182|  7.85k|    size_ = getULong(pData + start + 2, byteOrder);
  183|  7.85k|    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|  7.85k|    if (offset_ < start) {
  ------------------
  |  Branch (190:9): [True: 6.65k, False: 1.19k]
  ------------------
  191|       |      // Sub-region is before in memory.
  192|  6.65k|      enforce(size_ <= start - offset_, ErrorCode::kerOffsetOutOfRange);
  193|  6.65k|    } else {
  194|       |      // Sub-region is after in memory.
  195|  1.19k|      enforce(offset_ >= start + 10, ErrorCode::kerOffsetOutOfRange);
  196|  1.19k|      enforce(offset_ <= size, ErrorCode::kerOffsetOutOfRange);
  197|  1.19k|      enforce(size_ <= size - offset_, ErrorCode::kerOffsetOutOfRange);
  198|  1.19k|    }
  199|  7.85k|  }
  200|  58.5k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (200:7): [True: 50.5k, False: 7.92k]
  ------------------
  201|  50.5k|    size_ = 8;
  202|  50.5k|    offset_ = start + 2;
  203|  50.5k|  }
  204|  58.5k|  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|  58.5k|}  // CiffComponent::doRead
_ZN5Exiv28Internal13CiffDirectory6doReadEPKhmjNS_9ByteOrderE:
  212|  2.12k|void CiffDirectory::doRead(const byte* pData, size_t size, uint32_t start, ByteOrder byteOrder) {
  213|  2.12k|  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.12k|  if (this->offset() + this->size() > size)
  ------------------
  |  Branch (217:7): [True: 0, False: 2.12k]
  ------------------
  218|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
  219|       |
  220|  2.12k|  readDirectory(pData + offset(), this->size(), byteOrder);
  221|       |#ifdef EXIV2_DEBUG_MESSAGES
  222|       |  std::cout << "<---- 0x" << std::hex << tag() << "\n";
  223|       |#endif
  224|  2.12k|}  // CiffDirectory::doRead
_ZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderE:
  226|  3.63k|void CiffDirectory::readDirectory(const byte* pData, size_t size, ByteOrder byteOrder) {
  227|  3.63k|  if (size < 4)
  ------------------
  |  Branch (227:7): [True: 79, False: 3.55k]
  ------------------
  228|     79|    throw Error(ErrorCode::kerCorruptedMetadata);
  229|  3.55k|  uint32_t o = getULong(pData + size - 4, byteOrder);
  230|  3.55k|  if (o > size - 2)
  ------------------
  |  Branch (230:7): [True: 103, False: 3.45k]
  ------------------
  231|    103|    throw Error(ErrorCode::kerCorruptedMetadata);
  232|  3.45k|  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.45k|  o += 2;
  237|  3.45k|  if (count * 10u > size - o)
  ------------------
  |  Branch (237:7): [True: 93, False: 3.35k]
  ------------------
  238|     93|    throw Error(ErrorCode::kerCorruptedMetadata);
  239|       |
  240|  61.8k|  for (uint16_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (240:24): [True: 58.5k, False: 3.35k]
  ------------------
  241|  58.5k|    uint16_t tag = getUShort(pData + o, byteOrder);
  242|  58.5k|    auto m = [this, tag]() -> UniquePtr {
  243|  58.5k|      if (this->typeId(tag) == TypeId::directory)
  244|  58.5k|        return std::make_unique<CiffDirectory>();
  245|  58.5k|      return std::make_unique<CiffEntry>();
  246|  58.5k|    }();
  247|  58.5k|    m->setDir(this->tag());
  248|  58.5k|    m->read(pData, size, o, byteOrder);
  249|  58.5k|    add(std::move(m));
  250|  58.5k|    o += 10;
  251|  58.5k|  }
  252|  3.35k|}  // CiffDirectory::readDirectory
_ZNK5Exiv28Internal10CiffHeader6decodeERNS_5ImageE:
  254|    452|void CiffHeader::decode(Image& image) const {
  255|       |  // Nothing to decode from the header itself, just add correct byte order
  256|    452|  if (pRootDir_)
  ------------------
  |  Branch (256:7): [True: 452, False: 0]
  ------------------
  257|    452|    pRootDir_->decode(image, byteOrder_);
  258|    452|}
_ZNK5Exiv28Internal13CiffComponent6decodeERNS_5ImageENS_9ByteOrderE:
  260|  9.81k|void CiffComponent::decode(Image& image, ByteOrder byteOrder) const {
  261|  9.81k|  doDecode(image, byteOrder);
  262|  9.81k|}
_ZNK5Exiv28Internal9CiffEntry8doDecodeERNS_5ImageENS_9ByteOrderE:
  264|  8.35k|void CiffEntry::doDecode(Image& image, ByteOrder byteOrder) const {
  265|  8.35k|  CrwMap::decode(*this, image, byteOrder);
  266|  8.35k|}  // CiffEntry::doDecode
_ZNK5Exiv28Internal13CiffDirectory8doDecodeERNS_5ImageENS_9ByteOrderE:
  268|  1.45k|void CiffDirectory::doDecode(Image& image, ByteOrder byteOrder) const {
  269|  9.36k|  for (auto&& component : components_) {
  ------------------
  |  Branch (269:25): [True: 9.36k, False: 1.45k]
  ------------------
  270|  9.36k|    component->decode(image, byteOrder);
  271|  9.36k|  }
  272|  1.45k|}  // CiffDirectory::doDecode
_ZNK5Exiv28Internal10CiffHeader5writeERNSt3__16vectorIhNS2_9allocatorIhEEEE:
  274|    311|void CiffHeader::write(Blob& blob) const {
  275|    311|  if (byteOrder_ == littleEndian) {
  ------------------
  |  Branch (275:7): [True: 290, False: 21]
  ------------------
  276|    290|    blob.push_back('I');
  277|    290|    blob.push_back('I');
  278|    290|  } else {
  279|     21|    blob.push_back('M');
  280|     21|    blob.push_back('M');
  281|     21|  }
  282|    311|  uint32_t o = 2;
  283|    311|  byte buf[4];
  284|    311|  ul2Data(buf, offset_, byteOrder_);
  285|    311|  append(blob, buf, 4);
  286|    311|  o += 4;
  287|    311|  append(blob, signature_, 8);
  288|    311|  o += 8;
  289|       |  // Pad as needed
  290|    311|  if (!pPadding_.empty()) {
  ------------------
  |  Branch (290:7): [True: 293, False: 18]
  ------------------
  291|    293|    append(blob, pPadding_.data(), padded_);
  292|    293|  } else {
  293|     18|    for (uint32_t i = o; i < offset_; ++i) {
  ------------------
  |  Branch (293:26): [True: 0, False: 18]
  ------------------
  294|      0|      blob.push_back(0);
  295|      0|      ++o;
  296|      0|    }
  297|     18|  }
  298|    311|  if (pRootDir_) {
  ------------------
  |  Branch (298:7): [True: 311, False: 0]
  ------------------
  299|    311|    pRootDir_->write(blob, byteOrder_, offset_);
  300|    311|  }
  301|    311|}
_ZN5Exiv28Internal13CiffComponent5writeERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  303|  9.75k|size_t CiffComponent::write(Blob& blob, ByteOrder byteOrder, size_t offset) {
  304|  9.75k|  return doWrite(blob, byteOrder, offset);
  305|  9.75k|}
_ZN5Exiv28Internal9CiffEntry7doWriteERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  307|  8.17k|size_t CiffEntry::doWrite(Blob& blob, ByteOrder /*byteOrder*/, size_t offset) {
  308|  8.17k|  return writeValueData(blob, offset);
  309|  8.17k|}
_ZN5Exiv28Internal13CiffComponent14writeValueDataERNSt3__16vectorIhNS2_9allocatorIhEEEEm:
  311|  8.17k|size_t CiffComponent::writeValueData(Blob& blob, size_t offset) {
  312|  8.17k|  if (dataLocation() == DataLocId::valueData) {
  ------------------
  |  Branch (312:7): [True: 2.89k, False: 5.28k]
  ------------------
  313|       |#ifdef EXIV2_DEBUG_MESSAGES
  314|       |    std::cout << "  Data for tag 0x" << std::hex << tagId() << ", " << std::dec << size_ << " Bytes\n";
  315|       |#endif
  316|  2.89k|    offset_ = offset;
  317|  2.89k|    append(blob, pData_, size_);
  318|  2.89k|    offset += size_;
  319|       |    // Pad the value to an even number of bytes
  320|  2.89k|    if (size_ % 2 == 1) {
  ------------------
  |  Branch (320:9): [True: 211, False: 2.68k]
  ------------------
  321|    211|      blob.push_back(0);
  322|    211|      ++offset;
  323|    211|    }
  324|  2.89k|  }
  325|  8.17k|  return offset;
  326|  8.17k|}
_ZN5Exiv28Internal13CiffDirectory7doWriteERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderEm:
  328|  1.57k|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.57k|  size_t dirOffset = 0;
  334|       |
  335|       |  // Value data
  336|  9.44k|  for (auto&& component : components_) {
  ------------------
  |  Branch (336:25): [True: 9.44k, False: 1.57k]
  ------------------
  337|  9.44k|    dirOffset = component->write(blob, byteOrder, dirOffset);
  338|  9.44k|  }
  339|  1.57k|  const auto dirStart = static_cast<uint32_t>(dirOffset);
  340|       |
  341|       |  // Number of directory entries
  342|  1.57k|  byte buf[4];
  343|  1.57k|  us2Data(buf, static_cast<uint16_t>(components_.size()), byteOrder);
  344|  1.57k|  append(blob, buf, 2);
  345|  1.57k|  dirOffset += 2;
  346|       |
  347|       |  // Directory entries
  348|  9.44k|  for (auto&& component : components_) {
  ------------------
  |  Branch (348:25): [True: 9.44k, False: 1.57k]
  ------------------
  349|  9.44k|    component->writeDirEntry(blob, byteOrder);
  350|  9.44k|    dirOffset += 10;
  351|  9.44k|  }
  352|       |
  353|       |  // Offset of directory
  354|  1.57k|  ul2Data(buf, dirStart, byteOrder);
  355|  1.57k|  append(blob, buf, 4);
  356|  1.57k|  dirOffset += 4;
  357|       |
  358|       |  // Update directory entry
  359|  1.57k|  setOffset(offset);
  360|  1.57k|  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.57k|  return offset + dirOffset;
  367|  1.57k|}  // CiffDirectory::doWrite
_ZNK5Exiv28Internal13CiffComponent13writeDirEntryERNSt3__16vectorIhNS2_9allocatorIhEEEENS_9ByteOrderE:
  369|  9.44k|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.44k|  byte buf[4];
  375|       |
  376|  9.44k|  DataLocId dl = dataLocation();
  377|       |
  378|  9.44k|  if (dl == DataLocId::valueData) {
  ------------------
  |  Branch (378:7): [True: 3.95k, False: 5.48k]
  ------------------
  379|  3.95k|    us2Data(buf, tag_, byteOrder);
  380|  3.95k|    append(blob, buf, 2);
  381|       |
  382|  3.95k|    ul2Data(buf, static_cast<uint32_t>(size_), byteOrder);
  383|  3.95k|    append(blob, buf, 4);
  384|       |
  385|  3.95k|    ul2Data(buf, static_cast<uint32_t>(offset_), byteOrder);
  386|  3.95k|    append(blob, buf, 4);
  387|  3.95k|  }
  388|       |
  389|  9.44k|  if (dl == DataLocId::directoryData) {
  ------------------
  |  Branch (389:7): [True: 5.48k, False: 3.95k]
  ------------------
  390|       |    // Only 8 bytes fit in the directory entry
  391|       |
  392|  5.48k|    us2Data(buf, tag_, byteOrder);
  393|  5.48k|    append(blob, buf, 2);
  394|       |    // Copy value instead of size and offset
  395|  5.48k|    append(blob, pData_, size_);
  396|       |    // Pad with 0s
  397|  5.91k|    for (size_t i = size_; i < 8; ++i) {
  ------------------
  |  Branch (397:28): [True: 430, False: 5.48k]
  ------------------
  398|    430|      blob.push_back(0);
  399|    430|    }
  400|  5.48k|  }
  401|  9.44k|}  // CiffComponent::writeDirEntry
_ZN5Exiv28Internal13CiffComponent8setValueEONS_7DataBufE:
  427|    363|void CiffComponent::setValue(DataBuf&& buf) {
  428|    363|  storage_ = std::move(buf);
  429|    363|  pData_ = storage_.c_data();
  430|    363|  size_ = storage_.size();
  431|    363|  if (size_ > 8 && dataLocation() == DataLocId::directoryData) {
  ------------------
  |  Branch (431:7): [True: 122, False: 241]
  |  Branch (431:20): [True: 5, False: 117]
  ------------------
  432|      5|    tag_ &= 0x3fff;
  433|      5|  }
  434|    363|}
_ZN5Exiv28Internal13CiffComponent6typeIdEt:
  436|  60.9k|TypeId CiffComponent::typeId(uint16_t tag) {
  437|  60.9k|  switch (tag & 0x3800) {
  ------------------
  |  Branch (437:11): [True: 60.0k, False: 888]
  ------------------
  438|  4.67k|    case 0x0000:
  ------------------
  |  Branch (438:5): [True: 4.67k, False: 56.2k]
  ------------------
  439|  4.67k|      return unsignedByte;
  440|  2.61k|    case 0x0800:
  ------------------
  |  Branch (440:5): [True: 2.61k, False: 58.2k]
  ------------------
  441|  2.61k|      return asciiString;
  442|  7.13k|    case 0x1000:
  ------------------
  |  Branch (442:5): [True: 7.13k, False: 53.7k]
  ------------------
  443|  7.13k|      return unsignedShort;
  444|  41.6k|    case 0x1800:
  ------------------
  |  Branch (444:5): [True: 41.6k, False: 19.3k]
  ------------------
  445|  41.6k|      return unsignedLong;
  446|  1.86k|    case 0x2000:
  ------------------
  |  Branch (446:5): [True: 1.86k, False: 59.0k]
  ------------------
  447|  1.86k|      return undefined;
  448|    584|    case 0x2800:
  ------------------
  |  Branch (448:5): [True: 584, False: 60.3k]
  ------------------
  449|  2.12k|    case 0x3000:
  ------------------
  |  Branch (449:5): [True: 1.53k, False: 59.3k]
  ------------------
  450|  2.12k|      return directory;
  451|  60.9k|  }
  452|    888|  return invalidTypeId;
  453|  60.9k|}  // CiffComponent::typeId
_ZN5Exiv28Internal13CiffComponent12dataLocationEt:
  455|  76.2k|DataLocId CiffComponent::dataLocation(uint16_t tag) {
  456|  76.2k|  switch (tag & 0xc000) {
  457|  14.8k|    case 0x0000:
  ------------------
  |  Branch (457:5): [True: 14.8k, False: 61.4k]
  ------------------
  458|  14.8k|      return DataLocId::valueData;
  459|  61.3k|    case 0x4000:
  ------------------
  |  Branch (459:5): [True: 61.3k, False: 14.9k]
  ------------------
  460|  61.3k|      return DataLocId::directoryData;
  461|     79|    default:
  ------------------
  |  Branch (461:5): [True: 79, False: 76.1k]
  ------------------
  462|     79|      throw Error(ErrorCode::kerCorruptedMetadata);
  463|  76.2k|  }
  464|  76.2k|}  // CiffComponent::dataLocation
_ZNK5Exiv28Internal10CiffHeader13findComponentEtt:
  471|  1.08k|CiffComponent* CiffHeader::findComponent(uint16_t crwTagId, uint16_t crwDir) const {
  472|  1.08k|  if (!pRootDir_)
  ------------------
  |  Branch (472:7): [True: 0, False: 1.08k]
  ------------------
  473|      0|    return nullptr;
  474|  1.08k|  return pRootDir_->findComponent(crwTagId, crwDir);
  475|  1.08k|}  // CiffHeader::findComponent
_ZN5Exiv28Internal13CiffComponent13findComponentEtt:
  477|  28.6k|CiffComponent* CiffComponent::findComponent(uint16_t crwTagId, uint16_t crwDir) {
  478|  28.6k|  return doFindComponent(crwTagId, crwDir);
  479|  28.6k|}  // CiffComponent::findComponent
_ZN5Exiv28Internal13CiffComponent15doFindComponentEtt:
  481|  24.3k|CiffComponent* CiffComponent::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  482|  24.3k|  if (tagId() == crwTagId && dir() == crwDir) {
  ------------------
  |  Branch (482:7): [True: 172, False: 24.1k]
  |  Branch (482:30): [True: 53, False: 119]
  ------------------
  483|     53|    return this;
  484|     53|  }
  485|  24.2k|  return nullptr;
  486|  24.3k|}  // CiffComponent::doFindComponent
_ZN5Exiv28Internal13CiffDirectory15doFindComponentEtt:
  488|  4.30k|CiffComponent* CiffDirectory::doFindComponent(uint16_t crwTagId, uint16_t crwDir) {
  489|  27.5k|  for (auto&& component : components_) {
  ------------------
  |  Branch (489:25): [True: 27.5k, False: 4.21k]
  ------------------
  490|  27.5k|    if (auto cc = component->findComponent(crwTagId, crwDir))
  ------------------
  |  Branch (490:14): [True: 85, False: 27.4k]
  ------------------
  491|     85|      return cc;
  492|  27.5k|  }
  493|  4.21k|  return nullptr;
  494|  4.30k|}  // CiffDirectory::doFindComponent
_ZN5Exiv28Internal10CiffHeader3addEttONS_7DataBufE:
  496|    359|void CiffHeader::add(uint16_t crwTagId, uint16_t crwDir, DataBuf&& buf) {
  497|    359|  CrwDirs crwDirs;
  498|    359|  CrwMap::loadStack(crwDirs, crwDir);
  499|    359|  crwDirs.pop();
  500|    359|  if (!pRootDir_) {
  ------------------
  |  Branch (500:7): [True: 0, False: 359]
  ------------------
  501|      0|    pRootDir_ = std::make_unique<CiffDirectory>();
  502|      0|  }
  503|    359|  if (const auto& child = pRootDir_->add(crwDirs, crwTagId)) {
  ------------------
  |  Branch (503:19): [True: 359, False: 0]
  ------------------
  504|    359|    child->setValue(std::move(buf));
  505|    359|  }
  506|    359|}  // CiffHeader::add
_ZN5Exiv28Internal13CiffComponent3addERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  508|  1.02k|const CiffComponent::UniquePtr& CiffComponent::add(CrwDirs& crwDirs, uint16_t crwTagId) {
  509|  1.02k|  return doAdd(crwDirs, crwTagId);
  510|  1.02k|}  // CiffComponent::add
_ZN5Exiv28Internal13CiffDirectory5doAddERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  516|  1.02k|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|  1.02k|  if (!crwDirs.empty()) {
  ------------------
  |  Branch (529:7): [True: 670, False: 359]
  ------------------
  530|    670|    auto dir = crwDirs.top();
  531|    670|    crwDirs.pop();
  532|       |    // Find the directory
  533|    670|    for (const auto& c : components_)
  ------------------
  |  Branch (533:24): [True: 2.34k, False: 328]
  ------------------
  534|  2.34k|      if (c->tag() == dir.dir) {
  ------------------
  |  Branch (534:11): [True: 342, False: 2.00k]
  ------------------
  535|       |        // Recursive call to next lower level directory
  536|    342|        return c->add(crwDirs, crwTagId);
  537|    342|      }
  538|       |
  539|       |    // Directory doesn't exist yet, add it
  540|    328|    auto m = std::make_unique<CiffDirectory>(dir.dir, dir.parent);
  541|    328|    return add(std::move(m))->add(crwDirs, crwTagId);
  542|    670|  }
  543|       |
  544|       |  // Find the tag
  545|    359|  for (const auto& c : components_)
  ------------------
  |  Branch (545:22): [True: 395, False: 311]
  ------------------
  546|    395|    if (c->tagId() == crwTagId) {
  ------------------
  |  Branch (546:9): [True: 48, False: 347]
  ------------------
  547|     48|      return c;
  548|     48|    }
  549|       |
  550|       |  // Tag doesn't exist yet, add it
  551|    311|  auto m = std::make_unique<CiffEntry>(crwTagId, tag());
  552|    311|  return add(std::move(m));
  553|    359|}  // CiffDirectory::doAdd
_ZNK5Exiv28Internal10CiffHeader6removeEtt:
  555|  7.38k|void CiffHeader::remove(uint16_t crwTagId, uint16_t crwDir) const {
  556|  7.38k|  if (pRootDir_) {
  ------------------
  |  Branch (556:7): [True: 7.38k, False: 0]
  ------------------
  557|  7.38k|    CrwDirs crwDirs;
  558|  7.38k|    CrwMap::loadStack(crwDirs, crwDir);
  559|  7.38k|    crwDirs.pop();
  560|  7.38k|    pRootDir_->remove(crwDirs, crwTagId);
  561|  7.38k|  }
  562|  7.38k|}  // CiffHeader::remove
_ZN5Exiv28Internal13CiffComponent6removeERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  564|  12.2k|void CiffComponent::remove(CrwDirs& crwDirs, uint16_t crwTagId) {
  565|  12.2k|  doRemove(crwDirs, crwTagId);
  566|  12.2k|}  // CiffComponent::remove
_ZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  572|  12.2k|void CiffDirectory::doRemove(CrwDirs& crwDirs, uint16_t crwTagId) {
  573|  12.2k|  if (!crwDirs.empty()) {
  ------------------
  |  Branch (573:7): [True: 10.2k, False: 1.96k]
  ------------------
  574|  10.2k|    auto dir = crwDirs.top();
  575|  10.2k|    crwDirs.pop();
  576|       |    // Find the directory
  577|  10.2k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == dir.dir; });
  578|  10.2k|    if (it != components_.end()) {
  ------------------
  |  Branch (578:9): [True: 4.82k, False: 5.41k]
  ------------------
  579|       |      // Recursive call to next lower level directory
  580|  4.82k|      (*it)->remove(crwDirs, crwTagId);
  581|  4.82k|      if ((*it)->empty())
  ------------------
  |  Branch (581:11): [True: 28, False: 4.79k]
  ------------------
  582|     28|        components_.erase(it);
  583|  4.82k|    }
  584|  10.2k|  } else {
  585|       |    // Find the tag
  586|  1.96k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == crwTagId; });
  587|  1.96k|    if (it != components_.end()) {
  ------------------
  |  Branch (587:9): [True: 15, False: 1.95k]
  ------------------
  588|     15|      components_.erase(it);
  589|     15|    }
  590|  1.96k|  }
  591|  12.2k|}  // CiffDirectory::doRemove
_ZNK5Exiv28Internal13CiffComponent5emptyEv:
  593|  4.82k|bool CiffComponent::empty() const {
  594|  4.82k|  return doEmpty();
  595|  4.82k|}
_ZNK5Exiv28Internal13CiffDirectory7doEmptyEv:
  601|  4.82k|bool CiffDirectory::doEmpty() const {
  602|  4.82k|  return components_.empty();
  603|  4.82k|}
_ZN5Exiv28Internal6CrwMap6decodeERKNS0_13CiffComponentERNS_5ImageENS_9ByteOrderE:
  605|  8.35k|void CrwMap::decode(const CiffComponent& ciffComponent, Image& image, ByteOrder byteOrder) {
  606|  8.35k|  const CrwMapping* cmi = crwMapping(ciffComponent.dir(), ciffComponent.tagId());
  607|  8.35k|  if (cmi && cmi->toExif_) {
  ------------------
  |  Branch (607:7): [True: 1.51k, False: 6.84k]
  |  Branch (607:14): [True: 1.51k, False: 0]
  ------------------
  608|  1.51k|    cmi->toExif_(ciffComponent, cmi, image, byteOrder);
  609|  1.51k|  }
  610|  8.35k|}  // CrwMap::decode
_ZN5Exiv28Internal6CrwMap10crwMappingEtt:
  612|  8.35k|const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {
  613|   164k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (613:19): [True: 164k, False: 6.84k]
  ------------------
  614|   164k|    if (crw.crwDir_ == crwDir && crw.crwTagId_ == crwTagId) {
  ------------------
  |  Branch (614:9): [True: 30.5k, False: 134k]
  |  Branch (614:34): [True: 1.51k, False: 29.0k]
  ------------------
  615|  1.51k|      return &crw;
  616|  1.51k|    }
  617|   164k|  }
  618|  6.84k|  return nullptr;
  619|  8.35k|}  // CrwMap::crwMapping
_ZN5Exiv28Internal6CrwMap12decode0x0805ERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  622|     80|                          ByteOrder /*byteOrder*/) {
  623|     80|  auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
  624|     80|  image.setComment(s);
  625|     80|}  // CrwMap::decode0x0805
_ZN5Exiv28Internal6CrwMap12decode0x080aERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  628|     86|                          ByteOrder byteOrder) {
  629|     86|  if (ciffComponent.typeId() != asciiString)
  ------------------
  |  Branch (629:7): [True: 0, False: 86]
  ------------------
  630|      0|    return;
  631|       |
  632|       |  // Make
  633|     86|  ExifKey key1("Exif.Image.Make");
  634|     86|  auto value1 = Value::create(ciffComponent.typeId());
  635|     86|  uint32_t i = 0;
  636|    451|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (636:10): [True: 418, False: 33]
  ------------------
  637|    418|    ++i;
  638|    418|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (638:9): [True: 53, False: 365]
  ------------------
  639|     53|      break;
  640|     53|    }
  641|    418|  }
  642|     86|  value1->read(ciffComponent.pData(), i, byteOrder);
  643|     86|  image.exifData().add(key1, value1.get());
  644|       |
  645|       |  // Model
  646|     86|  ExifKey key2("Exif.Image.Model");
  647|     86|  auto value2 = Value::create(ciffComponent.typeId());
  648|     86|  uint32_t j = i;
  649|    254|  while (i < ciffComponent.size()) {
  ------------------
  |  Branch (649:10): [True: 199, False: 55]
  ------------------
  650|    199|    ++i;
  651|    199|    if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (651:9): [True: 31, False: 168]
  ------------------
  652|     31|      break;
  653|     31|    }
  654|    199|  }
  655|     86|  value2->read(ciffComponent.pData() + j, i - j, byteOrder);
  656|     86|  image.exifData().add(key2, value2.get());
  657|     86|}  // CrwMap::decode0x080a
_ZN5Exiv28Internal6CrwMap11decodeArrayERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  660|    847|                         ByteOrder byteOrder) {
  661|    847|  if (ciffComponent.typeId() != unsignedShort) {
  ------------------
  |  Branch (661:7): [True: 0, False: 847]
  ------------------
  662|      0|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  663|      0|    return;
  664|      0|  }
  665|       |
  666|    847|  int64_t aperture = 0;
  667|    847|  int64_t shutterSpeed = 0;
  668|       |
  669|    847|  auto ifdId = [pCrwMapping] {
  670|    847|    if (pCrwMapping->tag_ == 0x0001)
  671|    847|      return IfdId::canonCsId;
  672|    847|    if (pCrwMapping->tag_ == 0x0004)
  673|    847|      return IfdId::canonSiId;
  674|    847|    if (pCrwMapping->tag_ == 0x000f)
  675|    847|      return IfdId::canonCfId;
  676|    847|    if (pCrwMapping->tag_ == 0x0012)
  677|    847|      return IfdId::canonPiId;
  678|    847|    return IfdId::ifdIdNotSet;
  679|    847|  }();
  680|       |
  681|    847|  std::string groupName(Internal::groupName(ifdId));
  682|    847|  const size_t component_size = ciffComponent.size();
  683|    847|  enforce(component_size % 2 == 0, ErrorCode::kerCorruptedMetadata);
  684|    847|  enforce(component_size / 2 <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()),
  685|    847|          ErrorCode::kerCorruptedMetadata);
  686|    847|  const auto num_components = static_cast<uint16_t>(component_size / 2);
  687|    847|  uint16_t c = 1;
  688|  9.79k|  while (c < num_components) {
  ------------------
  |  Branch (688:10): [True: 8.94k, False: 847]
  ------------------
  689|  8.94k|    uint16_t n = 1;
  690|  8.94k|    ExifKey key(c, groupName);
  691|  8.94k|    UShortValue value;
  692|  8.94k|    if (ifdId == IfdId::canonCsId && c == 23 && component_size >= 52)
  ------------------
  |  Branch (692:9): [True: 1.32k, False: 7.62k]
  |  Branch (692:38): [True: 37, False: 1.28k]
  |  Branch (692:49): [True: 20, False: 17]
  ------------------
  693|     20|      n = 3;
  694|  8.94k|    value.read(ciffComponent.pData() + (c * 2), n * 2, byteOrder);
  695|  8.94k|    image.exifData().add(key, &value);
  696|  8.94k|    if (ifdId == IfdId::canonSiId && c == 21)
  ------------------
  |  Branch (696:9): [True: 5.77k, False: 3.17k]
  |  Branch (696:38): [True: 182, False: 5.58k]
  ------------------
  697|    182|      aperture = value.toInt64();
  698|  8.94k|    if (ifdId == IfdId::canonSiId && c == 22)
  ------------------
  |  Branch (698:9): [True: 5.77k, False: 3.17k]
  |  Branch (698:38): [True: 182, False: 5.58k]
  ------------------
  699|    182|      shutterSpeed = value.toInt64();
  700|  8.94k|    c += n;
  701|  8.94k|  }
  702|       |
  703|    847|  if (ifdId == IfdId::canonSiId) {
  ------------------
  |  Branch (703:7): [True: 346, False: 501]
  ------------------
  704|       |    // Exif.Photo.FNumber
  705|    346|    float f = fnumber(canonEv(aperture));
  706|    346|    auto [r, s] = floatToRationalCast(f);
  707|    346|    auto ur = URational(r, s);
  708|    346|    URationalValue fn;
  709|    346|    fn.value_.push_back(ur);
  710|    346|    image.exifData().add(ExifKey("Exif.Photo.FNumber"), &fn);
  711|       |
  712|       |    // Exif.Photo.ExposureTime
  713|    346|    ur = exposureTime(canonEv(shutterSpeed));
  714|    346|    URationalValue et;
  715|    346|    et.value_.push_back(ur);
  716|    346|    image.exifData().add(ExifKey("Exif.Photo.ExposureTime"), &et);
  717|    346|  }
  718|    847|}  // CrwMap::decodeArray
_ZN5Exiv28Internal6CrwMap12decode0x180eERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  721|     23|                          ByteOrder byteOrder) {
  722|     23|  if (ciffComponent.size() < 8 || ciffComponent.typeId() != unsignedLong) {
  ------------------
  |  Branch (722:7): [True: 10, False: 13]
  |  Branch (722:35): [True: 0, False: 13]
  ------------------
  723|     10|    decodeBasic(ciffComponent, pCrwMapping, image, byteOrder);
  724|     10|    return;
  725|     10|  }
  726|     13|  ULongValue v;
  727|     13|  v.read(ciffComponent.pData(), 8, byteOrder);
  728|     13|  time_t t = v.value_.at(0);
  729|     13|  std::tm r;
  730|       |#ifdef _WIN32
  731|       |  auto tm = localtime_s(&r, &t) ? nullptr : &r;
  732|       |#else
  733|     13|  auto tm = localtime_r(&t, &r);
  734|     13|#endif
  735|     13|  if (!tm)
  ------------------
  |  Branch (735:7): [True: 0, False: 13]
  ------------------
  736|      0|    return;
  737|     13|  const size_t m = 20;
  738|     13|  char s[m];
  739|     13|  std::strftime(s, m, "%Y:%m:%d %T", tm);
  740|       |
  741|     13|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  742|     13|  AsciiValue value;
  743|     13|  value.read(s);
  744|     13|  image.exifData().add(key, &value);
  745|     13|}  // 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|     63|                          ByteOrder /*byteOrder*/) {
  772|     63|  ExifThumb exifThumb(image.exifData());
  773|     63|  exifThumb.setJpegThumbnail(ciffComponent.pData(), ciffComponent.size());
  774|     63|}  // CrwMap::decode0x2008
_ZN5Exiv28Internal6CrwMap11decodeBasicERKNS0_13CiffComponentEPKNS0_10CrwMappingERNS_5ImageENS_9ByteOrderE:
  777|    429|                         ByteOrder byteOrder) {
  778|       |  // create a key and value pair
  779|    429|  ExifKey key(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_));
  780|    429|  Value::UniquePtr value;
  781|    429|  if (ciffComponent.typeId() != directory) {
  ------------------
  |  Branch (781:7): [True: 429, False: 0]
  ------------------
  782|    429|    value = Value::create(ciffComponent.typeId());
  783|    429|    size_t size = 0;
  784|    429|    if (pCrwMapping->size_ != 0) {
  ------------------
  |  Branch (784:9): [True: 13, False: 416]
  ------------------
  785|     13|      size = pCrwMapping->size_;  // size in the mapping table overrides all
  786|    416|    } else if (ciffComponent.typeId() == asciiString) {
  ------------------
  |  Branch (786:16): [True: 100, False: 316]
  ------------------
  787|       |      // determine size from the data, by looking for the first 0
  788|    100|      uint32_t i = 0;
  789|    679|      while (i < ciffComponent.size()) {
  ------------------
  |  Branch (789:14): [True: 628, False: 51]
  ------------------
  790|    628|        ++i;
  791|    628|        if (ciffComponent.pData()[i - 1] == '\0') {
  ------------------
  |  Branch (791:13): [True: 49, False: 579]
  ------------------
  792|     49|          break;
  793|     49|        }
  794|    628|      }
  795|    100|      size = i;
  796|    316|    } else {
  797|       |      // by default, use the size from the directory entry
  798|    316|      size = ciffComponent.size();
  799|    316|    }
  800|    429|    enforce(size <= ciffComponent.size(), ErrorCode::kerCorruptedMetadata);
  801|    429|    value->read(ciffComponent.pData(), size, byteOrder);
  802|    429|  }
  803|       |  // Add metadatum to exif data
  804|    429|  image.exifData().add(key, value.get());
  805|    429|}  // CrwMap::decodeBasic
_ZN5Exiv28Internal6CrwMap9loadStackERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEt:
  807|  7.74k|void CrwMap::loadStack(CrwDirs& crwDirs, uint16_t crwDir) {
  808|  61.9k|  for (auto&& crw : crwSubDir_) {
  ------------------
  |  Branch (808:19): [True: 61.9k, False: 7.74k]
  ------------------
  809|  61.9k|    auto&& [dir, parent] = crw;
  810|  61.9k|    if (dir == crwDir) {
  ------------------
  |  Branch (810:9): [True: 22.2k, False: 39.6k]
  ------------------
  811|  22.2k|      crwDirs.push(crw);
  812|  22.2k|      crwDir = parent;
  813|  22.2k|    }
  814|  61.9k|  }
  815|  7.74k|}  // CrwMap::loadStack
_ZN5Exiv28Internal6CrwMap6encodeERNS0_10CiffHeaderERKNS_5ImageE:
  817|    317|void CrwMap::encode(CiffHeader& pHead, const Image& image) {
  818|  6.95k|  for (auto&& crw : crwMapping_) {
  ------------------
  |  Branch (818:19): [True: 6.95k, False: 317]
  ------------------
  819|  6.95k|    if (crw.fromExif_) {
  ------------------
  |  Branch (819:9): [True: 6.95k, False: 0]
  ------------------
  820|  6.95k|      crw.fromExif_(image, crw, pHead);
  821|  6.95k|    }
  822|  6.95k|  }
  823|    317|}  // CrwMap::encode
_ZN5Exiv28Internal6CrwMap11encodeBasicERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  825|  5.20k|void CrwMap::encodeBasic(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  826|       |  // Determine the source Exif metadatum
  827|  5.20k|  ExifKey ek(pCrwMapping.tag_, Internal::groupName(pCrwMapping.ifdId_));
  828|  5.20k|  auto ed = image.exifData().findKey(ek);
  829|       |
  830|       |  // Set the new value or remove the entry
  831|  5.20k|  if (ed != image.exifData().end() && ed->size() > 0) {
  ------------------
  |  Branch (831:7): [True: 134, False: 5.06k]
  |  Branch (831:7): [True: 118, False: 5.08k]
  |  Branch (831:39): [True: 118, False: 16]
  ------------------
  832|    118|    DataBuf buf(ed->size());
  833|    118|    ed->copy(buf.data(), pHead.byteOrder());
  834|    118|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  835|  5.08k|  } else {
  836|  5.08k|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  837|  5.08k|  }
  838|  5.20k|}  // CrwMap::encodeBasic
_ZN5Exiv28Internal6CrwMap12encode0x0805ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  840|    317|void CrwMap::encode0x0805(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  841|    317|  std::string comment = image.comment();
  842|       |
  843|    317|  auto cc = pHead.findComponent(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  844|    317|  if (!comment.empty()) {
  ------------------
  |  Branch (844:7): [True: 22, False: 295]
  ------------------
  845|     22|    auto size = comment.size();
  846|     22|    if (cc && cc->size() > size)
  ------------------
  |  Branch (846:9): [True: 22, False: 0]
  |  Branch (846:15): [True: 8, False: 14]
  ------------------
  847|      8|      size = cc->size();
  848|     22|    DataBuf buf(size);
  849|     22|    std::move(comment.begin(), comment.end(), buf.begin());
  850|     22|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  851|    295|  } else {
  852|    295|    if (cc) {
  ------------------
  |  Branch (852:9): [True: 4, False: 291]
  ------------------
  853|       |      // Just delete the value, do not remove the tag
  854|      4|      DataBuf buf(cc->size());
  855|      4|      cc->setValue(std::move(buf));
  856|      4|    }
  857|    295|  }
  858|    317|}  // CrwMap::encode0x0805
_ZN5Exiv28Internal6CrwMap12encode0x080aERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  860|    317|void CrwMap::encode0x080a(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  861|    317|  const ExifKey k1("Exif.Image.Make");
  862|    317|  const ExifKey k2("Exif.Image.Model");
  863|    317|  const auto ed1 = image.exifData().findKey(k1);
  864|    317|  const auto ed2 = image.exifData().findKey(k2);
  865|    317|  const auto edEnd = image.exifData().end();
  866|       |
  867|    317|  size_t size{0};
  868|    317|  if (ed1 != edEnd)
  ------------------
  |  Branch (868:7): [True: 23, False: 294]
  ------------------
  869|     23|    size += ed1->size();
  870|    317|  if (ed2 != edEnd)
  ------------------
  |  Branch (870:7): [True: 23, False: 294]
  ------------------
  871|     23|    size += ed2->size();
  872|    317|  if (size != 0) {
  ------------------
  |  Branch (872:7): [True: 23, False: 294]
  ------------------
  873|     23|    DataBuf buf(size);
  874|     23|    size_t pos{0};
  875|     23|    if (ed1 != edEnd) {
  ------------------
  |  Branch (875:9): [True: 23, False: 0]
  ------------------
  876|     23|      ed1->copy(buf.data(), pHead.byteOrder());
  877|     23|      pos += ed1->size();
  878|     23|    }
  879|     23|    if (ed2 != edEnd) {
  ------------------
  |  Branch (879:9): [True: 23, False: 0]
  ------------------
  880|     23|      ed2->copy(buf.data(pos), pHead.byteOrder());
  881|     23|      pos += ed2->size();
  882|     23|    }
  883|     23|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  884|    294|  } else {
  885|    294|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  886|    294|  }
  887|    317|}
_ZN5Exiv28Internal6CrwMap11encodeArrayERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  889|  1.26k|void CrwMap::encodeArray(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  890|  1.26k|  auto ifdId = [=] {
  891|  1.26k|    switch (pCrwMapping.tag_) {
  892|  1.26k|      case 0x0001:
  893|  1.26k|        return IfdId::canonCsId;
  894|  1.26k|      case 0x0004:
  895|  1.26k|        return IfdId::canonSiId;
  896|  1.26k|      case 0x000f:
  897|  1.26k|        return IfdId::canonCfId;
  898|  1.26k|      case 0x0012:
  899|  1.26k|        return IfdId::canonPiId;
  900|  1.26k|    }
  901|  1.26k|    return IfdId::ifdIdNotSet;
  902|  1.26k|  }();
  903|  1.26k|  DataBuf buf = packIfdId(image.exifData(), ifdId, pHead.byteOrder());
  904|  1.26k|  if (buf.empty()) {
  ------------------
  |  Branch (904:7): [True: 1.09k, False: 176]
  ------------------
  905|       |    // Try the undecoded tag
  906|  1.09k|    encodeBasic(image, pCrwMapping, pHead);
  907|  1.09k|  }
  908|  1.26k|  if (!buf.empty()) {
  ------------------
  |  Branch (908:7): [True: 176, False: 1.09k]
  ------------------
  909|       |    // Write the number of shorts to the beginning of buf
  910|    176|    buf.write_uint16(0, static_cast<uint16_t>(buf.size()), pHead.byteOrder());
  911|    176|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  912|  1.09k|  } else {
  913|  1.09k|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  914|  1.09k|  }
  915|  1.26k|}  // CrwMap::encodeArray
_ZN5Exiv28Internal6CrwMap12encode0x180eERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  917|    317|void CrwMap::encode0x180e(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  918|    317|  time_t t = 0;
  919|    317|  const ExifKey key(pCrwMapping.tag_, Internal::groupName(pCrwMapping.ifdId_));
  920|    317|  if (auto ed = image.exifData().findKey(key); ed != image.exifData().end()) {
  ------------------
  |  Branch (920:48): [True: 11, False: 306]
  ------------------
  921|     11|    std::tm tm = {};
  922|     11|    if (exifTime(ed->toString().c_str(), &tm) == 0) {
  ------------------
  |  Branch (922:9): [True: 7, False: 4]
  ------------------
  923|      7|      t = ::mktime(&tm);
  924|      7|    }
  925|     11|  }
  926|    317|  if (t != 0) {
  ------------------
  |  Branch (926:7): [True: 6, False: 311]
  ------------------
  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|    311|  } else {
  931|    311|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  932|    311|  }
  933|    317|}  // CrwMap::encode0x180e
_ZN5Exiv28Internal6CrwMap12encode0x1810ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  935|    317|void CrwMap::encode0x1810(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  936|    317|  const ExifKey kX("Exif.Photo.PixelXDimension");
  937|    317|  const ExifKey kY("Exif.Photo.PixelYDimension");
  938|    317|  const ExifKey kO("Exif.Image.Orientation");
  939|    317|  const ExifData& exivData = image.exifData();
  940|    317|  const auto edX = exivData.findKey(kX);
  941|    317|  const auto edY = exivData.findKey(kY);
  942|    317|  const auto edO = exivData.findKey(kO);
  943|    317|  const auto edEnd = exivData.end();
  944|       |
  945|    317|  auto cc = pHead.findComponent(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  946|    317|  if (edX != edEnd || edY != edEnd || edO != edEnd) {
  ------------------
  |  Branch (946:7): [True: 6, False: 311]
  |  Branch (946:23): [True: 0, False: 311]
  |  Branch (946:39): [True: 0, False: 311]
  ------------------
  947|      6|    size_t size = 28;
  948|      6|    if (cc) {
  ------------------
  |  Branch (948:9): [True: 6, False: 0]
  ------------------
  949|      6|      if (cc->size() < size)
  ------------------
  |  Branch (949:11): [True: 6, False: 0]
  ------------------
  950|      6|        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|    311|  } else {
  969|    311|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  970|    311|  }
  971|    317|}  // CrwMap::encode0x1810
_ZN5Exiv28Internal6CrwMap12encode0x2008ERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderE:
  973|    311|void CrwMap::encode0x2008(const Image& image, const CrwMapping& pCrwMapping, CiffHeader& pHead) {
  974|    311|  ExifThumbC exifThumb(image.exifData());
  975|    311|  DataBuf buf = exifThumb.copy();
  976|    311|  if (!buf.empty()) {
  ------------------
  |  Branch (976:7): [True: 14, False: 297]
  ------------------
  977|     14|    pHead.add(pCrwMapping.crwTagId_, pCrwMapping.crwDir_, std::move(buf));
  978|    297|  } else {
  979|    297|    pHead.remove(pCrwMapping.crwTagId_, pCrwMapping.crwDir_);
  980|    297|  }
  981|    311|}  // CrwMap::encode0x2008
_ZN5Exiv28Internal9packIfdIdERKNS_8ExifDataENS_5IfdIdENS_9ByteOrderE:
  985|  1.26k|DataBuf packIfdId(const ExifData& exifData, IfdId ifdId, ByteOrder byteOrder) {
  986|  1.26k|  const uint16_t size = 1024;
  987|  1.26k|  DataBuf buf(size);
  988|       |
  989|  1.26k|  uint16_t len = 0;
  990|       |
  991|  41.1k|  for (auto&& exif : exifData) {
  ------------------
  |  Branch (991:20): [True: 41.1k, False: 1.26k]
  ------------------
  992|  41.1k|    if (exif.ifdId() != ifdId)
  ------------------
  |  Branch (992:9): [True: 32.2k, False: 8.91k]
  ------------------
  993|  32.2k|      continue;
  994|  8.91k|    const size_t s = Safe::add<size_t>(exif.tag() * 2, exif.size());
  995|  8.91k|    enforce(s <= static_cast<size_t>(std::numeric_limits<uint16_t>::max()), ErrorCode::kerCorruptedMetadata);
  996|  8.91k|    if (s <= size) {
  ------------------
  |  Branch (996:9): [True: 8.91k, False: 0]
  ------------------
  997|  8.91k|      len = std::max(len, static_cast<uint16_t>(s));
  998|  8.91k|      exif.copy(buf.data(exif.tag() * 2), byteOrder);
  999|  8.91k|    } 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|  8.91k|  }
 1003|       |  // Round the size to make it even.
 1004|  1.26k|  buf.resize(len + (len % 2));
 1005|  1.26k|  return buf;
 1006|  1.26k|}
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory13readDirectoryEPKhmNS_9ByteOrderEENK3$_0clEv:
  242|  58.5k|    auto m = [this, tag]() -> UniquePtr {
  243|  58.5k|      if (this->typeId(tag) == TypeId::directory)
  ------------------
  |  Branch (243:11): [True: 2.12k, False: 56.3k]
  ------------------
  244|  2.12k|        return std::make_unique<CiffDirectory>();
  245|  56.3k|      return std::make_unique<CiffEntry>();
  246|  58.5k|    }();
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEtENK3$_0clINS2_10unique_ptrINS0_13CiffComponentENS2_14default_deleteISE_EEEEEEDaRKT_:
  577|  77.1k|    auto it = std::find_if(components_.begin(), components_.end(), [=](const auto& c) { return c->tag() == dir.dir; });
crwimage_int.cpp:_ZZN5Exiv28Internal13CiffDirectory8doRemoveERNSt3__15stackINS0_9CrwSubDirENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEtENK3$_1clINS2_10unique_ptrINS0_13CiffComponentENS2_14default_deleteISE_EEEEEEDaRKT_:
  586|  5.71k|    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|    847|  auto ifdId = [pCrwMapping] {
  670|    847|    if (pCrwMapping->tag_ == 0x0001)
  ------------------
  |  Branch (670:9): [True: 224, False: 623]
  ------------------
  671|    224|      return IfdId::canonCsId;
  672|    623|    if (pCrwMapping->tag_ == 0x0004)
  ------------------
  |  Branch (672:9): [True: 350, False: 273]
  ------------------
  673|    350|      return IfdId::canonSiId;
  674|    273|    if (pCrwMapping->tag_ == 0x000f)
  ------------------
  |  Branch (674:9): [True: 157, False: 116]
  ------------------
  675|    157|      return IfdId::canonCfId;
  676|    116|    if (pCrwMapping->tag_ == 0x0012)
  ------------------
  |  Branch (676:9): [True: 116, False: 0]
  ------------------
  677|    116|      return IfdId::canonPiId;
  678|      0|    return IfdId::ifdIdNotSet;
  679|    116|  }();
crwimage_int.cpp:_ZZN5Exiv28Internal6CrwMap11encodeArrayERKNS_5ImageERKNS0_10CrwMappingERNS0_10CiffHeaderEENK3$_0clEv:
  890|  1.26k|  auto ifdId = [=] {
  891|  1.26k|    switch (pCrwMapping.tag_) {
  ------------------
  |  Branch (891:13): [True: 1.26k, False: 0]
  ------------------
  892|    317|      case 0x0001:
  ------------------
  |  Branch (892:7): [True: 317, False: 951]
  ------------------
  893|    317|        return IfdId::canonCsId;
  894|    317|      case 0x0004:
  ------------------
  |  Branch (894:7): [True: 317, False: 951]
  ------------------
  895|    317|        return IfdId::canonSiId;
  896|    317|      case 0x000f:
  ------------------
  |  Branch (896:7): [True: 317, False: 951]
  ------------------
  897|    317|        return IfdId::canonCfId;
  898|    317|      case 0x0012:
  ------------------
  |  Branch (898:7): [True: 317, False: 951]
  ------------------
  899|    317|        return IfdId::canonPiId;
  900|  1.26k|    }
  901|      0|    return IfdId::ifdIdNotSet;
  902|  1.26k|  }();

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  10.9k|  [[nodiscard]] const byte* pData() const {
  214|  10.9k|    return pData_;
  215|  10.9k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  7.37k|  [[nodiscard]] size_t size() const {
  204|  7.37k|    return size_;
  205|  7.37k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  37.0k|  static auto signature() {
  419|  37.0k|    return signature_;
  420|  37.0k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  58.5k|  void setDir(uint16_t dir) {
  147|  58.5k|    dir_ = dir;
  148|  58.5k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  8.53k|  [[nodiscard]] uint16_t dir() const {
  184|  8.53k|    return dir_;
  185|  8.53k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|   143k|  [[nodiscard]] uint16_t tag() const {
  189|   143k|    return tag_;
  190|   143k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  4.16k|  [[nodiscard]] size_t offset() const {
  209|  4.16k|    return offset_;
  210|  4.16k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  33.0k|  [[nodiscard]] uint16_t tagId() const {
  219|  33.0k|    return tag_ & 0x3fff;
  220|  33.0k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  2.40k|  [[nodiscard]] TypeId typeId() const {
  224|  2.40k|    return typeId(tag_);
  225|  2.40k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  76.2k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  76.2k|    return dataLocation(tag_);
  230|  76.2k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.57k|  void setSize(size_t size) {
  254|  1.57k|    size_ = size;
  255|  1.57k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.57k|  void setOffset(size_t offset) {
  258|  1.57k|    offset_ = offset;
  259|  1.57k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.61k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.61k|    return byteOrder_;
  446|  1.61k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  60.0k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  60.6k|  virtual ~CiffComponent() = default;

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   231k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   231k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 177k, False: 53.4k]
  |  Branch (378:31): [True: 39.5k, False: 138k]
  ------------------
  379|  39.5k|    return -1;
  380|   191k|  const DataSet* dataSet = records_[recordId];
  381|   191k|  int idx;
  382|  4.27M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 4.09M, False: 180k]
  ------------------
  383|  4.09M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 11.7k, False: 4.08M]
  ------------------
  384|  11.7k|      return -1;
  385|  4.09M|  }
  386|   180k|  return idx;
  387|   191k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  84.3k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  84.3k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 79.7k, False: 4.58k]
  |  Branch (390:31): [True: 0, False: 79.7k]
  ------------------
  391|      0|    return -1;
  392|  84.3k|  const DataSet* dataSet = records_[recordId];
  393|  84.3k|  int idx;
  394|  2.41M|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 2.33M, False: 84.3k]
  ------------------
  395|  2.33M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 2.33M]
  ------------------
  396|      0|      return -1;
  397|  2.33M|  }
  398|  84.3k|  return idx;
  399|  84.3k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  53.5k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  53.5k|  int idx = dataSetIdx(number, recordId);
  403|  53.5k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 17.0k, False: 36.5k]
  ------------------
  404|  17.0k|    return unknownDataSet.type_;
  405|  36.5k|  return records_[recordId][idx].type_;
  406|  53.5k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|   126k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|   126k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 109k, False: 17.0k]
  ------------------
  410|   109k|    return records_[recordId][idx].name_;
  411|       |
  412|  17.0k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  17.0k|#define stringFormat std::format
  ------------------
  413|   126k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  51.6k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  51.6k|  int idx = dataSetIdx(number, recordId);
  438|  51.6k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 17.0k, False: 34.5k]
  ------------------
  439|  17.0k|    return unknownDataSet.repeatable_;
  440|  34.5k|  return records_[recordId][idx].repeatable_;
  441|  51.6k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  84.3k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  84.3k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 84.3k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  84.3k|    return records_[recordId][idx].number_;
  447|  84.3k|  }
  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|   126k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|   126k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 20.5k, False: 105k]
  |  Branch (454:31): [True: 92.3k, False: 13.1k]
  ------------------
  455|   112k|    return recordInfo_[recordId].name_;
  456|   112k|  }
  457|       |
  458|  13.1k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  13.1k|#define stringFormat std::format
  ------------------
  459|   126k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  84.3k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  84.3k|  uint16_t i;
  470|  88.9k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 88.9k, False: 0]
  ------------------
  471|  88.9k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 84.3k, False: 4.58k]
  ------------------
  472|  84.3k|      break;
  473|  88.9k|  }
  474|  84.3k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 84.3k]
  ------------------
  475|      0|    if (!isHex(recordName, 4, "0x"))
  ------------------
  |  Branch (475:9): [True: 0, False: 0]
  ------------------
  476|      0|      throw Error(ErrorCode::kerInvalidRecord, recordName);
  477|      0|    i = static_cast<uint16_t>(std::stoi(recordName, nullptr, 16));
  478|      0|  }
  479|  84.3k|  return i;
  480|  84.3k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  84.3k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  84.3k|  decomposeKey();
  492|  84.3k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  41.7k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  41.7k|  makeKey();
  496|  41.7k|}
_ZNK5Exiv27IptcKey3keyEv:
  498|  14.2k|std::string IptcKey::key() const {
  499|  14.2k|  return key_;
  500|  14.2k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   515k|uint16_t IptcKey::tag() const {
  523|   515k|  return tag_;
  524|   515k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   680k|uint16_t IptcKey::record() const {
  531|   680k|  return record_;
  532|   680k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   444k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   444k|  return UniquePtr(clone_());
  536|   444k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   444k|IptcKey* IptcKey::clone_() const {
  539|   444k|  return new IptcKey(*this);
  540|   444k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  84.3k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  84.3k|  auto posDot1 = key_.find('.');
  545|  84.3k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  84.3k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 84.3k]
  |  Branch (547:39): [True: 0, False: 84.3k]
  ------------------
  548|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  549|      0|  }
  550|       |
  551|       |  // Get the family name, record name and dataSet name parts of the key
  552|  84.3k|  const std::string familyName = key_.substr(0, posDot1);
  553|  84.3k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 84.3k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  84.3k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  84.3k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  84.3k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  84.3k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  84.3k|  recordName = IptcDataSets::recordName(recId);
  565|  84.3k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  84.3k|  tag_ = dataSet;
  568|  84.3k|  record_ = recId;
  569|  84.3k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  84.3k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  41.7k|void IptcKey::makeKey() {
  573|  41.7k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  41.7k|         IptcDataSets::dataSetName(tag_, record_);
  575|  41.7k|}

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

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

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

_ZN5Exiv29ExifdatumC2ERKNS_7ExifKeyEPKNS_5ValueE:
  157|  2.29M|Exifdatum::Exifdatum(const ExifKey& key, const Value* pValue) : key_(key.clone()) {
  158|  2.29M|  if (pValue)
  ------------------
  |  Branch (158:7): [True: 2.28M, False: 9.49k]
  ------------------
  159|  2.28M|    value_ = pValue->clone();
  160|  2.29M|}
_ZN5Exiv29ExifdatumC2ERKS0_:
  162|  7.04M|Exifdatum::Exifdatum(const Exifdatum& rhs) {
  163|  7.04M|  if (rhs.key_)
  ------------------
  |  Branch (163:7): [True: 7.04M, False: 0]
  ------------------
  164|  7.04M|    key_ = rhs.key_->clone();  // deep copy
  165|  7.04M|  if (rhs.value_)
  ------------------
  |  Branch (165:7): [True: 7.04M, False: 0]
  ------------------
  166|  7.04M|    value_ = rhs.value_->clone();  // deep copy
  167|  7.04M|}
_ZN5Exiv29ExifdatumD2Ev:
  169|  9.34M|Exifdatum::~Exifdatum() = default;
_ZNK5Exiv29Exifdatum5valueEv:
  203|  43.5k|const Value& Exifdatum::value() const {
  204|  43.5k|  if (!value_)
  ------------------
  |  Branch (204:7): [True: 0, False: 43.5k]
  ------------------
  205|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  206|  43.5k|  return *value_;
  207|  43.5k|}
_ZN5Exiv29ExifdatumaSERKS0_:
  209|  14.4k|Exifdatum& Exifdatum::operator=(const Exifdatum& rhs) {
  210|  14.4k|  if (this == &rhs)
  ------------------
  |  Branch (210:7): [True: 0, False: 14.4k]
  ------------------
  211|      0|    return *this;
  212|       |
  213|  14.4k|  key_.reset();
  214|  14.4k|  if (rhs.key_)
  ------------------
  |  Branch (214:7): [True: 14.4k, False: 0]
  ------------------
  215|  14.4k|    key_ = rhs.key_->clone();  // deep copy
  216|       |
  217|  14.4k|  value_.reset();
  218|  14.4k|  if (rhs.value_)
  ------------------
  |  Branch (218:7): [True: 14.4k, False: 0]
  ------------------
  219|  14.4k|    value_ = rhs.value_->clone();  // deep copy
  220|       |
  221|  14.4k|  return *this;
  222|  14.4k|}  // Exifdatum::operator=
_ZN5Exiv29ExifdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  224|  6.28k|Exifdatum& Exifdatum::operator=(const std::string& value) {
  225|  6.28k|  setValue(value);
  226|  6.28k|  return *this;
  227|  6.28k|}
_ZN5Exiv29ExifdatumaSERKt:
  229|     63|Exifdatum& Exifdatum::operator=(const uint16_t& value) {
  230|     63|  return Exiv2::setValue(*this, value);
  231|     63|}
_ZN5Exiv29ExifdatumaSERKj:
  233|  7.22k|Exifdatum& Exifdatum::operator=(const uint32_t& value) {
  234|  7.22k|  return Exiv2::setValue(*this, value);
  235|  7.22k|}
_ZN5Exiv29ExifdatumaSERKNS_5ValueE:
  253|  15.3k|Exifdatum& Exifdatum::operator=(const Value& value) {
  254|  15.3k|  setValue(&value);
  255|  15.3k|  return *this;
  256|  15.3k|}
_ZN5Exiv29Exifdatum8setValueEPKNS_5ValueE:
  258|  15.3k|void Exifdatum::setValue(const Value* pValue) {
  259|  15.3k|  value_.reset();
  260|  15.3k|  if (pValue)
  ------------------
  |  Branch (260:7): [True: 15.3k, False: 0]
  ------------------
  261|  15.3k|    value_ = pValue->clone();
  262|  15.3k|}
_ZN5Exiv29Exifdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  264|  6.83k|int Exifdatum::setValue(const std::string& value) {
  265|  6.83k|  if (!value_) {
  ------------------
  |  Branch (265:7): [True: 3.86k, False: 2.97k]
  ------------------
  266|  3.86k|    TypeId type = key_->defaultTypeId();
  267|  3.86k|    value_ = Value::create(type);
  268|  3.86k|  }
  269|  6.83k|  return value_->read(value);
  270|  6.83k|}
_ZNK5Exiv29Exifdatum11setDataAreaEPKhm:
  272|     63|int Exifdatum::setDataArea(const byte* buf, size_t len) const {
  273|     63|  return value_ ? value_->setDataArea(buf, len) : -1;
  ------------------
  |  Branch (273:10): [True: 63, False: 0]
  ------------------
  274|     63|}
_ZNK5Exiv29Exifdatum3keyEv:
  276|  93.6M|std::string Exifdatum::key() const {
  277|  93.6M|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (277:10): [True: 93.6M, False: 0]
  ------------------
  278|  93.6M|}
_ZNK5Exiv29Exifdatum9groupNameEv:
  284|  3.40M|std::string Exifdatum::groupName() const {
  285|  3.40M|  return key_ ? key_->groupName() : "";
  ------------------
  |  Branch (285:10): [True: 3.40M, False: 0]
  ------------------
  286|  3.40M|}
_ZNK5Exiv29Exifdatum7tagNameEv:
  288|    459|std::string Exifdatum::tagName() const {
  289|    459|  return key_ ? key_->tagName() : "";
  ------------------
  |  Branch (289:10): [True: 459, False: 0]
  ------------------
  290|    459|}
_ZNK5Exiv29Exifdatum3tagEv:
  300|  9.70M|uint16_t Exifdatum::tag() const {
  301|  9.70M|  return key_ ? key_->tag() : 0xffff;
  ------------------
  |  Branch (301:10): [True: 9.70M, False: 0]
  ------------------
  302|  9.70M|}
_ZNK5Exiv29Exifdatum5ifdIdEv:
  304|  14.8M|IfdId Exifdatum::ifdId() const {
  305|  14.8M|  return key_ ? key_->ifdId() : IfdId::ifdIdNotSet;
  ------------------
  |  Branch (305:10): [True: 14.8M, False: 0]
  ------------------
  306|  14.8M|}
_ZNK5Exiv29Exifdatum3idxEv:
  312|  4.39M|int Exifdatum::idx() const {
  313|  4.39M|  return key_ ? key_->idx() : 0;
  ------------------
  |  Branch (313:10): [True: 4.39M, False: 0]
  ------------------
  314|  4.39M|}
_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|  1.11k|TypeId Exifdatum::typeId() const {
  321|  1.11k|  return value_ ? value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 1.11k, False: 0]
  ------------------
  322|  1.11k|}
_ZNK5Exiv29Exifdatum8typeSizeEv:
  328|    153|size_t Exifdatum::typeSize() const {
  329|    153|  return TypeInfo::typeSize(typeId());
  330|    153|}
_ZNK5Exiv29Exifdatum5countEv:
  332|  4.81M|size_t Exifdatum::count() const {
  333|  4.81M|  return value_ ? value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 4.81M, False: 0]
  ------------------
  334|  4.81M|}
_ZNK5Exiv29Exifdatum4sizeEv:
  336|  9.55M|size_t Exifdatum::size() const {
  337|  9.55M|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (337:10): [True: 9.55M, False: 0]
  ------------------
  338|  9.55M|}
_ZNK5Exiv29Exifdatum8toStringEv:
  340|  28.4k|std::string Exifdatum::toString() const {
  341|  28.4k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 28.4k, False: 0]
  ------------------
  342|  28.4k|}
_ZNK5Exiv29Exifdatum7toInt64Em:
  348|   326k|int64_t Exifdatum::toInt64(size_t n) const {
  349|   326k|  return value_ ? value_->toInt64(n) : -1;
  ------------------
  |  Branch (349:10): [True: 326k, False: 0]
  ------------------
  350|   326k|}
_ZNK5Exiv29Exifdatum8getValueEv:
  360|  3.20M|Value::UniquePtr Exifdatum::getValue() const {
  361|  3.20M|  return value_ ? value_->clone() : nullptr;
  ------------------
  |  Branch (361:10): [True: 3.20M, False: 0]
  ------------------
  362|  3.20M|}
_ZNK5Exiv29Exifdatum12sizeDataAreaEv:
  364|    933|size_t Exifdatum::sizeDataArea() const {
  365|    933|  return value_ ? value_->sizeDataArea() : 0;
  ------------------
  |  Branch (365:10): [True: 933, False: 0]
  ------------------
  366|    933|}
_ZNK5Exiv29Exifdatum8dataAreaEv:
  368|  1.18k|DataBuf Exifdatum::dataArea() const {
  369|  1.18k|  return value_ ? value_->dataArea() : DataBuf(nullptr, 0);
  ------------------
  |  Branch (369:10): [True: 1.18k, False: 0]
  ------------------
  370|  1.18k|}
_ZN5Exiv210ExifThumbCC2ERKNS_8ExifDataE:
  372|    374|ExifThumbC::ExifThumbC(const ExifData& exifData) : exifData_(exifData) {
  373|    374|}
_ZNK5Exiv210ExifThumbC4copyEv:
  375|    311|DataBuf ExifThumbC::copy() const {
  376|    311|  auto thumbnail = Thumbnail::create(exifData_);
  377|    311|  if (!thumbnail)
  ------------------
  |  Branch (377:7): [True: 286, False: 25]
  ------------------
  378|    286|    return {};
  379|     25|  return thumbnail->copy(exifData_);
  380|    311|}
_ZN5Exiv29ExifThumbC2ERNS_8ExifDataE:
  411|     63|ExifThumb::ExifThumb(ExifData& exifData) : ExifThumbC(exifData), exifData_(exifData) {
  412|     63|}
_ZN5Exiv29ExifThumb16setJpegThumbnailEPKhm:
  435|     63|void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
  436|     63|  exifData_["Exif.Thumbnail.Compression"] = std::uint16_t{6};
  437|     63|  Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
  438|     63|  format = 0U;
  439|     63|  format.setDataArea(buf, size);
  440|     63|  exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
  441|     63|}
_ZN5Exiv28ExifDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  447|  35.8k|Exifdatum& ExifData::operator[](const std::string& key) {
  448|  35.8k|  ExifKey exifKey(key);
  449|  35.8k|  auto pos = findKey(exifKey);
  450|  35.8k|  if (pos == end()) {
  ------------------
  |  Branch (450:7): [True: 8.94k, False: 26.9k]
  ------------------
  451|  8.94k|    return exifMetadata_.emplace_back(exifKey);
  452|  8.94k|  }
  453|  26.9k|  return *pos;
  454|  35.8k|}
_ZN5Exiv28ExifData3addERKNS_7ExifKeyEPKNS_5ValueE:
  456|  2.28M|void ExifData::add(const ExifKey& key, const Value* pValue) {
  457|  2.28M|  add(Exifdatum(key, pValue));
  458|  2.28M|}
_ZN5Exiv28ExifData3addERKNS_9ExifdatumE:
  460|  2.50M|void ExifData::add(const Exifdatum& exifdatum) {
  461|       |  // allow duplicates
  462|  2.50M|  exifMetadata_.push_back(exifdatum);
  463|  2.50M|}
_ZNK5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  465|   812k|ExifData::const_iterator ExifData::findKey(const ExifKey& key) const {
  466|   812k|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  467|   812k|}
_ZN5Exiv28ExifData7findKeyERKNS_7ExifKeyE:
  469|  1.00M|ExifData::iterator ExifData::findKey(const ExifKey& key) {
  470|  1.00M|  return std::find_if(exifMetadata_.begin(), exifMetadata_.end(), FindExifdatumByKey(key.key()));
  471|  1.00M|}
_ZN5Exiv28ExifData5clearEv:
  473|  68.5k|void ExifData::clear() {
  474|  68.5k|  exifMetadata_.clear();
  475|  68.5k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEES5_:
  485|  96.3k|ExifData::iterator ExifData::erase(ExifData::iterator beg, ExifData::iterator end) {
  486|  96.3k|  return exifMetadata_.erase(beg, end);
  487|  96.3k|}
_ZN5Exiv28ExifData5eraseENSt3__115__list_iteratorINS_9ExifdatumEPvEE:
  489|  49.1k|ExifData::iterator ExifData::erase(ExifData::iterator pos) {
  490|  49.1k|  return exifMetadata_.erase(pos);
  491|  49.1k|}
_ZN5Exiv212DecodeParamsC2Em:
  493|  54.0k|DecodeParams::DecodeParams(size_t max_recursion_depth) : max_recursion_depth_(max_recursion_depth) {
  494|  54.0k|}
_ZN5Exiv210ExifParser6decodeERNS_8ExifDataEPKhmRKNS_12DecodeParamsE:
  496|    591|ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size, const DecodeParams& dp) {
  497|    591|  IptcData iptcData;
  498|    591|  XmpData xmpData;
  499|    591|  ByteOrder bo = TiffParser::decode(exifData, iptcData, xmpData, pData, size, dp);
  500|    591|#ifndef SUPPRESS_WARNINGS
  501|    591|  if (!iptcData.empty()) {
  ------------------
  |  Branch (501:7): [True: 50, False: 541]
  ------------------
  502|     50|    EXV_WARNING << "Ignoring IPTC information encoded in the Exif data.\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()
  ------------------
  503|     50|  }
  504|    591|  if (!xmpData.empty()) {
  ------------------
  |  Branch (504:7): [True: 1, False: 590]
  ------------------
  505|      1|    EXV_WARNING << "Ignoring XMP information encoded in the Exif data.\n";
  ------------------
  |  |  138|      1|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      1|  LogMsg(LogMsg::warn).os()
  ------------------
  506|      1|  }
  507|    591|#endif
  508|    591|  return bo;
  509|    591|}
_ZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataE:
  515|  6.34k|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|  6.34k|  static constexpr auto filteredIfd0Tags = std::array{
  519|  6.34k|      "Exif.Image.PhotometricInterpretation",
  520|  6.34k|      "Exif.Image.StripOffsets",
  521|  6.34k|      "Exif.Image.RowsPerStrip",
  522|  6.34k|      "Exif.Image.StripByteCounts",
  523|  6.34k|      "Exif.Image.JPEGInterchangeFormat",
  524|  6.34k|      "Exif.Image.JPEGInterchangeFormatLength",
  525|  6.34k|      "Exif.Image.SubIFDs",
  526|       |      // Issue 981.  Never allow manufactured data to be written
  527|  6.34k|      "Exif.Canon.AFInfoSize",
  528|  6.34k|      "Exif.Canon.AFAreaMode",
  529|  6.34k|      "Exif.Canon.AFNumPoints",
  530|  6.34k|      "Exif.Canon.AFValidPoints",
  531|  6.34k|      "Exif.Canon.AFCanonImageWidth",
  532|  6.34k|      "Exif.Canon.AFCanonImageHeight",
  533|  6.34k|      "Exif.Canon.AFImageWidth",
  534|  6.34k|      "Exif.Canon.AFImageHeight",
  535|  6.34k|      "Exif.Canon.AFAreaWidths",
  536|  6.34k|      "Exif.Canon.AFAreaHeights",
  537|  6.34k|      "Exif.Canon.AFXPositions",
  538|  6.34k|      "Exif.Canon.AFYPositions",
  539|  6.34k|      "Exif.Canon.AFPointsInFocus",
  540|  6.34k|      "Exif.Canon.AFPointsSelected",
  541|  6.34k|      "Exif.Canon.AFPointsUnusable",
  542|  6.34k|      "Exif.Canon.AFFineRotation",
  543|  6.34k|  };
  544|   146k|  for (auto&& filteredIfd0Tag : filteredIfd0Tags) {
  ------------------
  |  Branch (544:31): [True: 146k, False: 6.34k]
  ------------------
  545|   146k|    auto pos = exifData.findKey(ExifKey(filteredIfd0Tag));
  546|   146k|    if (pos != exifData.end()) {
  ------------------
  |  Branch (546:9): [True: 479, False: 145k]
  ------------------
  547|       |#ifdef EXIV2_DEBUG_MESSAGES
  548|       |      std::cerr << "Warning: Exif tag " << pos->key() << " not encoded\n";
  549|       |#endif
  550|    479|      exifData.erase(pos);
  551|    479|    }
  552|   146k|  }
  553|       |
  554|       |  // Delete IFDs which do not occur in JPEGs
  555|  6.34k|  static constexpr auto filteredIfds = std::array{
  556|  6.34k|      IfdId::subImage1Id, IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id,
  557|  6.34k|      IfdId::subImage6Id, IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id, IfdId::subThumb1Id,
  558|  6.34k|      IfdId::panaRawId,   IfdId::ifd2Id,      IfdId::ifd3Id,
  559|  6.34k|  };
  560|  82.5k|  for (auto&& filteredIfd : filteredIfds) {
  ------------------
  |  Branch (560:27): [True: 82.5k, False: 6.34k]
  ------------------
  561|       |#ifdef EXIV2_DEBUG_MESSAGES
  562|       |    std::cerr << "Warning: Exif IFD " << filteredIfd << " not encoded\n";
  563|       |#endif
  564|  82.5k|    eraseIfd(exifData, filteredIfd);
  565|  82.5k|  }
  566|       |
  567|       |  // IPTC and XMP are stored elsewhere, not in the Exif APP1 segment.
  568|  6.34k|  IptcData emptyIptc;
  569|  6.34k|  XmpData emptyXmp;
  570|       |
  571|       |  // Encode and check if the result fits into a JPEG Exif APP1 segment
  572|  6.34k|  MemIo mio1;
  573|  6.34k|  TiffHeader header(byteOrder, 0x00000008, false);
  574|  6.34k|  WriteMethod wm = TiffParserWorker::encode(mio1, pData, size, exifData, emptyIptc, emptyXmp, Tag::root,
  575|  6.34k|                                            TiffMapping::findEncoder, &header, nullptr);
  576|  6.34k|  if (mio1.size() <= 65527) {
  ------------------
  |  Branch (576:7): [True: 3.13k, False: 3.21k]
  ------------------
  577|  3.13k|    append(blob, mio1.mmap(), mio1.size());
  578|  3.13k|    return wm;
  579|  3.13k|  }
  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|  3.21k|  static constexpr auto filteredPvTags = std::array{
  587|  3.21k|      std::pair(pttLen, "Exif.Minolta.ThumbnailLength"),
  588|  3.21k|      std::pair(pttTag, "Exif.Minolta.ThumbnailOffset"),
  589|  3.21k|      std::pair(pttLen, "Exif.Minolta.Thumbnail"),
  590|  3.21k|      std::pair(pttLen, "Exif.NikonPreview.JPEGInterchangeFormatLength"),
  591|  3.21k|      std::pair(pttIfd, "NikonPreview"),
  592|  3.21k|      std::pair(pttLen, "Exif.Olympus.ThumbnailLength"),
  593|  3.21k|      std::pair(pttTag, "Exif.Olympus.ThumbnailOffset"),
  594|  3.21k|      std::pair(pttLen, "Exif.Olympus.ThumbnailImage"),
  595|  3.21k|      std::pair(pttLen, "Exif.Olympus.Thumbnail"),
  596|  3.21k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailLength"),
  597|  3.21k|      std::pair(pttTag, "Exif.Olympus2.ThumbnailOffset"),
  598|  3.21k|      std::pair(pttLen, "Exif.Olympus2.ThumbnailImage"),
  599|  3.21k|      std::pair(pttLen, "Exif.Olympus2.Thumbnail"),
  600|  3.21k|      std::pair(pttLen, "Exif.OlympusCs.PreviewImageLength"),
  601|  3.21k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageStart"),
  602|  3.21k|      std::pair(pttTag, "Exif.OlympusCs.PreviewImageValid"),
  603|  3.21k|      std::pair(pttLen, "Exif.Pentax.PreviewLength"),
  604|  3.21k|      std::pair(pttTag, "Exif.Pentax.PreviewOffset"),
  605|  3.21k|      std::pair(pttTag, "Exif.Pentax.PreviewResolution"),
  606|  3.21k|      std::pair(pttLen, "Exif.PentaxDng.PreviewLength"),
  607|  3.21k|      std::pair(pttTag, "Exif.PentaxDng.PreviewOffset"),
  608|  3.21k|      std::pair(pttTag, "Exif.PentaxDng.PreviewResolution"),
  609|  3.21k|      std::pair(pttLen, "Exif.SamsungPreview.JPEGInterchangeFormatLength"),
  610|  3.21k|      std::pair(pttIfd, "SamsungPreview"),
  611|  3.21k|      std::pair(pttLen, "Exif.Thumbnail.StripByteCounts"),
  612|  3.21k|      std::pair(pttIfd, "Thumbnail"),
  613|  3.21k|      std::pair(pttLen, "Exif.Thumbnail.JPEGInterchangeFormatLength"),
  614|  3.21k|      std::pair(pttIfd, "Thumbnail"),
  615|  3.21k|  };
  616|  3.21k|  bool delTags = false;
  617|  89.7k|  for (auto&& [ptt, key] : filteredPvTags) {
  ------------------
  |  Branch (617:26): [True: 89.7k, False: 3.20k]
  ------------------
  618|  89.7k|    switch (ptt) {
  ------------------
  |  Branch (618:13): [True: 89.7k, False: 0]
  ------------------
  619|  48.0k|      case pttLen: {
  ------------------
  |  Branch (619:7): [True: 48.0k, False: 41.6k]
  ------------------
  620|  48.0k|        delTags = false;
  621|  48.0k|        if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end() && sumToLong(*pos) > 32768) {
  ------------------
  |  Branch (621:56): [True: 1.34k, False: 46.7k]
  |  Branch (621:56): [True: 58, False: 48.0k]
  |  Branch (621:81): [True: 58, False: 1.28k]
  ------------------
  622|     58|          delTags = true;
  623|     58|#ifndef SUPPRESS_WARNINGS
  624|     58|          EXV_WARNING << "Exif tag " << pos->key() << " not encoded\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()
  ------------------
  625|     58|#endif
  626|     58|          exifData.erase(pos);
  627|     58|        }
  628|  48.0k|        break;
  629|      0|      }
  630|  28.8k|      case pttTag: {
  ------------------
  |  Branch (630:7): [True: 28.8k, False: 60.9k]
  ------------------
  631|  28.8k|        if (delTags) {
  ------------------
  |  Branch (631:13): [True: 74, False: 28.7k]
  ------------------
  632|     74|          if (auto pos = exifData.findKey(ExifKey(key)); pos != exifData.end()) {
  ------------------
  |  Branch (632:58): [True: 11, False: 63]
  ------------------
  633|     11|#ifndef SUPPRESS_WARNINGS
  634|     11|            EXV_WARNING << "Exif tag " << pos->key() << " not encoded\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  635|     11|#endif
  636|     11|            exifData.erase(pos);
  637|     11|          }
  638|     74|        }
  639|  28.8k|        break;
  640|      0|      }
  641|  12.8k|      case pttIfd:
  ------------------
  |  Branch (641:7): [True: 12.8k, False: 76.9k]
  ------------------
  642|  12.8k|        if (delTags) {
  ------------------
  |  Branch (642:13): [True: 6, False: 12.8k]
  ------------------
  643|      6|#ifndef SUPPRESS_WARNINGS
  644|      6|          EXV_WARNING << "Exif IFD " << key << " not encoded\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()
  ------------------
  645|      6|#endif
  646|      6|          eraseIfd(exifData, Internal::groupId(key));
  647|      6|        }
  648|  12.8k|        break;
  649|  89.7k|    }
  650|  89.7k|  }
  651|       |
  652|       |  // Delete unknown tags larger than 4kB and known tags larger than 20kB.
  653|  3.20k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  654|  3.20k|  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|  3.20k|  MemIo mio2;
  658|  3.20k|  wm = TiffParserWorker::encode(mio2, pData, size, exifData, emptyIptc, emptyXmp, Tag::root, TiffMapping::findEncoder,
  659|  3.20k|                                &header, nullptr);
  660|  3.20k|  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|  3.20k|  return wm;
  669|       |
  670|  3.21k|}  // ExifParser::encode
exif.cpp:_ZNK12_GLOBAL__N_118FindExifdatumByKeyclERKN5Exiv29ExifdatumE:
   45|  93.5M|  bool operator()(const Exiv2::Exifdatum& exifdatum) const {
   46|  93.5M|    return key_ == exifdatum.key();
   47|  93.5M|  }
exif.cpp:_ZN12_GLOBAL__N_118FindExifdatumByKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   39|  1.81M|  explicit FindExifdatumByKey(std::string key) : key_(std::move(key)) {
   40|  1.81M|  }
exif.cpp:_ZZN5Exiv210ExifParser6encodeERNSt3__16vectorIhNS1_9allocatorIhEEEEPKhmNS_9ByteOrderERNS_8ExifDataEENK3$_0clINS_9ExifdatumEEEDaRKT_:
  653|   913k|  auto f = [](const auto& tag) { return (tag.size() > 4096 && tag.tagName().starts_with("0x")) || tag.size() > 20480; };
  ------------------
  |  Branch (653:42): [True: 459, False: 913k]
  |  Branch (653:63): [True: 258, False: 201]
  |  Branch (653:99): [True: 25, False: 913k]
  ------------------
exif.cpp:_ZN12_GLOBAL__N_19Thumbnail6createERKN5Exiv28ExifDataE:
  678|    311|Thumbnail::UniquePtr Thumbnail::create(const Exiv2::ExifData& exifData) {
  679|    311|  const Exiv2::ExifKey k1("Exif.Thumbnail.Compression");
  680|    311|  auto pos = exifData.findKey(k1);
  681|    311|  if (pos != exifData.end()) {
  ------------------
  |  Branch (681:7): [True: 25, False: 286]
  ------------------
  682|     25|    if (pos->count() == 0)
  ------------------
  |  Branch (682:9): [True: 0, False: 25]
  ------------------
  683|      0|      return nullptr;
  684|     25|    if (pos->toInt64() == 6)
  ------------------
  |  Branch (684:9): [True: 25, False: 0]
  ------------------
  685|     25|      return std::make_unique<JpegThumbnail>();
  686|      0|    return std::make_unique<TiffThumbnail>();
  687|     25|  }
  688|       |
  689|    286|  const Exiv2::ExifKey k2("Exif.Thumbnail.JPEGInterchangeFormat");
  690|    286|  pos = exifData.findKey(k2);
  691|    286|  if (pos != exifData.end())
  ------------------
  |  Branch (691:7): [True: 0, False: 286]
  ------------------
  692|      0|    return std::make_unique<JpegThumbnail>();
  693|    286|  return nullptr;
  694|    286|}
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailC2Ev:
   67|     25|  Thumbnail() = default;
exif.cpp:_ZN12_GLOBAL__N_19ThumbnailD2Ev:
   69|     25|  virtual ~Thumbnail() = default;
exif.cpp:_ZNK12_GLOBAL__N_113JpegThumbnail4copyERKN5Exiv28ExifDataE:
  729|     25|Exiv2::DataBuf JpegThumbnail::copy(const Exiv2::ExifData& exifData) const {
  730|     25|  Exiv2::ExifKey key("Exif.Thumbnail.JPEGInterchangeFormat");
  731|     25|  auto format = exifData.findKey(key);
  732|     25|  if (format == exifData.end())
  ------------------
  |  Branch (732:7): [True: 0, False: 25]
  ------------------
  733|      0|    return {};
  734|     25|  return format->dataArea();
  735|     25|}
exif.cpp:_ZN12_GLOBAL__N_19sumToLongERKN5Exiv29ExifdatumE:
  737|  1.34k|int64_t sumToLong(const Exiv2::Exifdatum& md) {
  738|  1.34k|  int64_t sum = 0;
  739|   200k|  for (size_t i = 0; i < md.count(); ++i) {
  ------------------
  |  Branch (739:22): [True: 198k, False: 1.34k]
  ------------------
  740|   198k|    sum = Safe::add(sum, md.toInt64(i));
  741|   198k|  }
  742|  1.34k|  return sum;
  743|  1.34k|}
exif.cpp:_ZN12_GLOBAL__N_18eraseIfdERN5Exiv28ExifDataENS0_5IfdIdE:
  745|  82.5k|void eraseIfd(Exiv2::ExifData& ed, Exiv2::IfdId ifdId) {
  746|  82.5k|  ed.erase(std::remove_if(ed.begin(), ed.end(), Exiv2::FindExifdatum(ifdId)), ed.end());
  747|  82.5k|}
_ZN5Exiv28setValueItEERNS_9ExifdatumES2_RKT_:
  150|     63|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|     63|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|     63|  v->value_.push_back(value);
  153|     63|  exifDatum.value_ = std::move(v);
  154|     63|  return exifDatum;
  155|     63|}
_ZN5Exiv28setValueIjEERNS_9ExifdatumES2_RKT_:
  150|  7.22k|Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) {
  151|  7.22k|  auto v = std::make_unique<Exiv2::ValueType<T>>();
  152|  7.22k|  v->value_.push_back(value);
  153|  7.22k|  exifDatum.value_ = std::move(v);
  154|  7.22k|  return exifDatum;
  155|  7.22k|}

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

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

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

_ZN5Exiv215ImageCtorParamsC2Ebm:
  141|  76.9k|    create_(create), max_recursion_depth_(max_recursion_depth) {
  142|  76.9k|}
_ZN5Exiv25ImageC2ENS_9ImageTypeEtNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsE:
  145|  76.9k|    io_(std::move(io)),
  146|  76.9k|    max_recursion_depth_(params.max_recursion_depth()),
  147|  76.9k|    imageType_(type),
  148|  76.9k|    supportedMetadata_(supportedMetadata) {
  149|  76.9k|}
_ZN5Exiv25ImageD2Ev:
  151|  76.9k|Image::~Image() = default;
_ZN5Exiv25Image19isBigEndianPlatformEv:
  189|  1.45k|bool Image::isBigEndianPlatform() {
  190|  1.45k|  return std::endian::native == std::endian::big;
  191|  1.45k|}
_ZN5Exiv25Image8byteSwapEjb:
  213|  5.83k|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|  5.83k|  uint32_t result = 0;
  220|  5.83k|  result |= (value & 0x000000FFU) << 24;
  221|  5.83k|  result |= (value & 0x0000FF00U) << 8;
  222|  5.83k|  result |= (value & 0x00FF0000U) >> 8;
  223|  5.83k|  result |= (value & 0xFF000000U) >> 24;
  224|  5.83k|  return bSwap ? result : value;
  ------------------
  |  Branch (224:10): [True: 0, False: 5.83k]
  ------------------
  225|  5.83k|#endif
  226|  5.83k|}
_ZN5Exiv25Image13clearMetadataEv:
  545|  67.0k|void Image::clearMetadata() {
  546|  67.0k|  clearExifData();
  547|  67.0k|  clearIptcData();
  548|  67.0k|  clearXmpPacket();
  549|  67.0k|  clearXmpData();
  550|  67.0k|  clearComment();
  551|  67.0k|  clearIccProfile();
  552|  67.0k|}
_ZN5Exiv25Image8exifDataEv:
  554|  21.5k|ExifData& Image::exifData() {
  555|  21.5k|  return exifData_;
  556|  21.5k|}
_ZN5Exiv25Image8iptcDataEv:
  558|  7.23k|IptcData& Image::iptcData() {
  559|  7.23k|  return iptcData_;
  560|  7.23k|}
_ZN5Exiv25Image7xmpDataEv:
  562|  31.3k|XmpData& Image::xmpData() {
  563|  31.3k|  return xmpData_;
  564|  31.3k|}
_ZN5Exiv25Image9xmpPacketEv:
  566|    627|std::string& Image::xmpPacket() {
  567|       |  // Serialize the current XMP
  568|    627|  if (!xmpData_.empty() && !writeXmpFromPacket()) {
  ------------------
  |  Branch (568:7): [True: 0, False: 627]
  |  Branch (568:28): [True: 0, False: 0]
  ------------------
  569|      0|    XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting);
  570|      0|  }
  571|    627|  return xmpPacket_;
  572|    627|}
_ZN5Exiv25Image13clearExifDataEv:
  594|  67.0k|void Image::clearExifData() {
  595|  67.0k|  exifData_.clear();
  596|  67.0k|}
_ZN5Exiv25Image11setExifDataERKNS_8ExifDataE:
  598|    417|void Image::setExifData(const ExifData& exifData) {
  599|    417|  exifData_ = exifData;
  600|    417|}
_ZN5Exiv25Image13clearIptcDataEv:
  602|  67.0k|void Image::clearIptcData() {
  603|  67.0k|  iptcData_.clear();
  604|  67.0k|}
_ZN5Exiv25Image11setIptcDataERKNS_8IptcDataE:
  606|    417|void Image::setIptcData(const IptcData& iptcData) {
  607|    417|  iptcData_ = iptcData;
  608|    417|}
_ZN5Exiv25Image14clearXmpPacketEv:
  610|  67.0k|void Image::clearXmpPacket() {
  611|  67.0k|  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|  67.0k|  xmpData_.setPacket(std::string());
  617|  67.0k|  writeXmpFromPacket(true);
  618|  67.0k|}
_ZN5Exiv25Image12clearXmpDataEv:
  628|  67.0k|void Image::clearXmpData() {
  629|  67.0k|  xmpData_.clear();
  630|  67.0k|  writeXmpFromPacket(false);
  631|  67.0k|}
_ZN5Exiv25Image10setXmpDataERKNS_7XmpDataE:
  633|    417|void Image::setXmpData(const XmpData& xmpData) {
  634|    417|  xmpData_ = xmpData;
  635|    417|  writeXmpFromPacket(false);
  636|    417|}
_ZN5Exiv25Image18writeXmpFromPacketEb:
  639|   134k|void Image::writeXmpFromPacket(bool flag) {
  640|   134k|  writeXmpFromPacket_ = flag;
  641|   134k|}
_ZN5Exiv25Image12clearCommentEv:
  647|  67.0k|void Image::clearComment() {
  648|  67.0k|  comment_.erase();
  649|  67.0k|}
_ZN5Exiv25Image10setCommentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  651|    273|void Image::setComment(const std::string& comment) {
  652|    273|  comment_ = comment;
  653|    273|}
_ZN5Exiv25Image13setIccProfileEONS_7DataBufEb:
  655|    350|void Image::setIccProfile(Exiv2::DataBuf&& iccProfile, bool bTestValid) {
  656|    350|  iccProfile_ = std::move(iccProfile);
  657|    350|  if (bTestValid) {
  ------------------
  |  Branch (657:7): [True: 350, False: 0]
  ------------------
  658|    350|    checkIccProfile();
  659|    350|  }
  660|    350|}
_ZN5Exiv25Image16appendIccProfileEPKhmb:
  662|  5.57k|void Image::appendIccProfile(const uint8_t* bytes, size_t size, bool bTestValid) {
  663|  5.57k|  if (size == 0) {
  ------------------
  |  Branch (663:7): [True: 232, False: 5.33k]
  ------------------
  664|    232|    return;
  665|    232|  }
  666|  5.33k|  const size_t start = iccProfile_.size();
  667|  5.33k|  iccProfile_.resize(Safe::add(start, size));
  668|  5.33k|  memcpy(iccProfile_.data(start), bytes, size);
  669|  5.33k|  if (bTestValid) {
  ------------------
  |  Branch (669:7): [True: 77, False: 5.26k]
  ------------------
  670|     77|    checkIccProfile();
  671|     77|  }
  672|  5.33k|}
_ZNK5Exiv25Image15checkIccProfileEv:
  674|    427|void Image::checkIccProfile() const {
  675|    427|  if (iccProfile_.size() < sizeof(long)) {
  ------------------
  |  Branch (675:7): [True: 56, False: 371]
  ------------------
  676|     56|    throw Error(ErrorCode::kerInvalidIccProfile);
  677|     56|  }
  678|    371|  const size_t size = iccProfile_.read_uint32(0, bigEndian);
  679|    371|  if (size != iccProfile_.size()) {
  ------------------
  |  Branch (679:7): [True: 79, False: 292]
  ------------------
  680|     79|    throw Error(ErrorCode::kerInvalidIccProfile);
  681|     79|  }
  682|    371|}
_ZN5Exiv25Image15clearIccProfileEv:
  684|  67.0k|void Image::clearIccProfile() {
  685|  67.0k|  iccProfile_.reset();
  686|  67.0k|}
_ZN5Exiv25Image12setByteOrderENS_9ByteOrderE:
  688|  40.4k|void Image::setByteOrder(ByteOrder byteOrder) {
  689|  40.4k|  byteOrder_ = byteOrder;
  690|  40.4k|}
_ZNK5Exiv25Image9byteOrderEv:
  692|  7.48k|ByteOrder Image::byteOrder() const {
  693|  7.48k|  return byteOrder_;
  694|  7.48k|}
_ZNK5Exiv25Image10pixelWidthEv:
  696|  4.82k|uint32_t Image::pixelWidth() const {
  697|  4.82k|  return pixelWidth_;
  698|  4.82k|}
_ZNK5Exiv25Image11pixelHeightEv:
  700|  4.82k|uint32_t Image::pixelHeight() const {
  701|  4.82k|  return pixelHeight_;
  702|  4.82k|}
_ZNK5Exiv25Image8exifDataEv:
  704|   811k|const ExifData& Image::exifData() const {
  705|   811k|  return exifData_;
  706|   811k|}
_ZNK5Exiv25Image7xmpDataEv:
  712|  19.8k|const XmpData& Image::xmpData() const {
  713|  19.8k|  return xmpData_;
  714|  19.8k|}
_ZNK5Exiv25Image7commentEv:
  716|  1.45k|std::string Image::comment() const {
  717|  1.45k|  return comment_;
  718|  1.45k|}
_ZNK5Exiv25Image2ioEv:
  724|   112k|BasicIo& Image::io() const {
  725|   112k|  return *io_;
  726|   112k|}
_ZNK5Exiv25Image18writeXmpFromPacketEv:
  728|  25.1k|bool Image::writeXmpFromPacket() const {
  729|  25.1k|  return writeXmpFromPacket_;
  730|  25.1k|}
_ZNK5Exiv25Image14nativePreviewsEv:
  732|  81.1k|const NativePreviewList& Image::nativePreviews() const {
  733|  81.1k|  return nativePreviews_;
  734|  81.1k|}
_ZNK5Exiv25Image4goodEv:
  736|  76.4k|bool Image::good() const {
  737|  76.4k|  if (io_->open() != 0)
  ------------------
  |  Branch (737:7): [True: 0, False: 76.4k]
  ------------------
  738|      0|    return false;
  739|  76.4k|  IoCloser closer(*io_);
  740|  76.4k|  return ImageFactory::checkType(imageType_, *io_, false);
  741|  76.4k|}
_ZN5Exiv212ImageFactory9checkTypeENS_9ImageTypeERNS_7BasicIoEb:
  791|  76.4k|bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
  792|  76.4k|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (792:12): [True: 76.4k, False: 0]
  ------------------
  793|  76.4k|    return r->isThisType_(io, advance);
  794|      0|  return false;
  795|  76.4k|}
_ZN5Exiv212ImageFactory4openEPKhm:
  877|  78.5k|Image::UniquePtr ImageFactory::open(const byte* data, size_t size) {
  878|  78.5k|  auto image = open(std::make_unique<MemIo>(data, size));  // may throw
  879|  78.5k|  if (!image)
  ------------------
  |  Branch (879:7): [True: 2.34k, False: 76.1k]
  ------------------
  880|  2.34k|    throw Error(ErrorCode::kerMemoryContainsUnknownImageType);
  881|  76.1k|  return image;
  882|  78.5k|}
_ZN5Exiv212ImageFactory4openENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEE:
  884|  78.5k|Image::UniquePtr ImageFactory::open(BasicIo::UniquePtr io) {
  885|  78.5k|  if (io->open() != 0) {
  ------------------
  |  Branch (885:7): [True: 0, False: 78.5k]
  ------------------
  886|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io->path(), strError());
  887|      0|  }
  888|  1.31M|  for (const auto& r : registry) {
  ------------------
  |  Branch (888:22): [True: 1.31M, False: 2.52k]
  ------------------
  889|  1.31M|    if (r.isThisType_(*io, false)) {
  ------------------
  |  Branch (889:9): [True: 76.0k, False: 1.23M]
  ------------------
  890|  76.0k|      return r.newInstance_(std::move(io), ImageCtorParams(false, 1000));
  891|  76.0k|    }
  892|  1.31M|  }
  893|  2.52k|  return nullptr;
  894|  78.5k|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeE:
  913|    417|Image::UniquePtr ImageFactory::create(ImageType type) {
  914|    417|  auto image = create(type, std::make_unique<MemIo>());
  915|    417|  if (!image)
  ------------------
  |  Branch (915:7): [True: 0, False: 417]
  ------------------
  916|      0|    throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
  917|    417|  return image;
  918|    417|}
_ZN5Exiv212ImageFactory6createENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  920|    417|Image::UniquePtr ImageFactory::create(ImageType type, BasicIo::UniquePtr io) {
  921|       |  // BasicIo instance does not need to be open
  922|    417|  if (type == ImageType::none)
  ------------------
  |  Branch (922:7): [True: 0, False: 417]
  ------------------
  923|      0|    return {};
  924|    417|  if (auto r = Exiv2::find(registry, type))
  ------------------
  |  Branch (924:12): [True: 417, False: 0]
  ------------------
  925|    417|    return r->newInstance_(std::move(io), ImageCtorParams(true, 1000));
  926|      0|  return {};
  927|    417|}
_ZN5Exiv26appendERNSt3__16vectorIhNS0_9allocatorIhEEEEPKhm:
  932|   123k|void append(Blob& blob, const byte* buf, size_t len) {
  933|   123k|  if (len != 0) {
  ------------------
  |  Branch (933:7): [True: 98.3k, False: 24.8k]
  ------------------
  934|  98.3k|    Blob::size_type size = blob.size();
  935|  98.3k|    if (blob.capacity() - size < len) {
  ------------------
  |  Branch (935:9): [True: 8.51k, False: 89.8k]
  ------------------
  936|  8.51k|      blob.reserve(size + 65536);
  937|  8.51k|    }
  938|  98.3k|    blob.resize(size + len);
  939|  98.3k|    std::copy_n(buf, len, blob.begin() + size);
  940|  98.3k|  }
  941|   123k|}  // append
image.cpp:_ZNK12_GLOBAL__N_18RegistryeqERKN5Exiv29ImageTypeE:
   66|  1.25M|  bool operator==(const ImageType& imageType) const {
   67|  1.25M|    return imageType == imageType_;
   68|  1.25M|  }

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

_ZN5Exiv28Jp2ImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  101|  2.71k|    Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io), params) {
  102|  2.71k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (102:7): [True: 0, False: 2.71k]
  |  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.71k|}
_ZN5Exiv28Jp2Image12readMetadataEv:
  135|  2.69k|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.69k|  if (io_->open() != 0) {
  ------------------
  |  Branch (139:7): [True: 0, False: 2.69k]
  ------------------
  140|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  141|      0|  }
  142|  2.69k|  IoCloser closer(*io_);
  143|  2.69k|  if (!isJp2Type(*io_, false)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 2.69k]
  ------------------
  144|      0|    throw Error(ErrorCode::kerNotAnImage, "JPEG-2000");
  145|      0|  }
  146|       |
  147|  2.69k|  Internal::Jp2BoxHeader box = {0, 0};
  148|  2.69k|  Internal::Jp2BoxHeader subBox = {0, 0};
  149|  2.69k|  Internal::Jp2ImageHeaderBox ihdr = {0, 0, 0, 0, 0, 0, 0};
  150|  2.69k|  Internal::Jp2UuidBox uuid = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  151|  2.69k|  size_t boxesCount = 0;
  152|  2.69k|  const size_t boxem = 1000;  // boxes max
  153|  2.69k|  uint32_t lastBoxTypeRead = 0;
  154|  2.69k|  bool boxSignatureFound = false;
  155|  2.69k|  bool boxFileTypeFound = false;
  156|       |
  157|  34.6k|  while (io_->read(reinterpret_cast<byte*>(&box), boxHSize) == boxHSize) {
  ------------------
  |  Branch (157:10): [True: 33.9k, False: 682]
  ------------------
  158|  33.9k|    boxes_check(boxesCount++, boxem);
  159|  33.9k|    const size_t position = io_->tell();
  160|  33.9k|    box.length = getULong(reinterpret_cast<byte*>(&box.length), bigEndian);
  161|  33.9k|    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|  33.9k|    Internal::enforce(box.length <= boxHSize + io_->size() - io_->tell(), ErrorCode::kerCorruptedMetadata);
  167|       |
  168|  33.9k|    if (box.length == 0)
  ------------------
  |  Branch (168:9): [True: 515, False: 33.4k]
  ------------------
  169|    515|      return;
  170|       |
  171|  33.4k|    if (box.length == 1) {
  ------------------
  |  Branch (171:9): [True: 49, False: 33.3k]
  ------------------
  172|       |      /// \todo In this case, the real box size is given in XLBox (bytes 8-15)
  173|     49|    }
  174|       |
  175|  33.4k|    switch (box.type) {
  176|  2.77k|      case kJp2BoxType::Signature: {
  ------------------
  |  Branch (176:7): [True: 2.77k, False: 30.6k]
  ------------------
  177|  2.77k|        if (boxSignatureFound)  // Only one is allowed
  ------------------
  |  Branch (177:13): [True: 79, False: 2.69k]
  ------------------
  178|     79|          throw Error(ErrorCode::kerCorruptedMetadata);
  179|  2.69k|        boxSignatureFound = true;
  180|  2.69k|        break;
  181|  2.77k|      }
  182|    496|      case kJp2BoxType::FileTypeBox: {
  ------------------
  |  Branch (182:7): [True: 496, False: 32.9k]
  ------------------
  183|       |        // This box shall immediately follow the JPEG 2000 Signature box
  184|    496|        if (boxFileTypeFound || lastBoxTypeRead != kJp2BoxType::Signature) {  // Only one is allowed
  ------------------
  |  Branch (184:13): [True: 10, False: 486]
  |  Branch (184:33): [True: 38, False: 448]
  ------------------
  185|     48|          throw Error(ErrorCode::kerCorruptedMetadata);
  186|     48|        }
  187|    448|        boxFileTypeFound = true;
  188|    448|        Internal::enforce(box.length >= boxHSize, ErrorCode::kerCorruptedMetadata);
  189|    448|        Blob boxData(box.length - boxHSize);
  190|    448|        io_->readOrThrow(boxData.data(), boxData.size(), ErrorCode::kerCorruptedMetadata);
  191|    448|        if (!Internal::isValidBoxFileType(boxData))
  ------------------
  |  Branch (191:13): [True: 387, False: 61]
  ------------------
  192|    387|          throw Error(ErrorCode::kerCorruptedMetadata);
  193|     61|        brand_ = getULong(boxData.data(), bigEndian);
  194|     61|        break;
  195|    448|      }
  196|  7.81k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (196:7): [True: 7.81k, False: 25.6k]
  ------------------
  197|       |#ifdef EXIV2_DEBUG_MESSAGES
  198|       |        std::cout << "Exiv2::Jp2Image::readMetadata: JP2Header box found\n";
  199|       |#endif
  200|  7.81k|        size_t restore = io_->tell();
  201|       |
  202|   142k|        while (io_->read(reinterpret_cast<byte*>(&subBox), boxHSize) == boxHSize && subBox.length) {
  ------------------
  |  Branch (202:16): [True: 138k, False: 3.53k]
  |  Branch (202:85): [True: 134k, False: 3.98k]
  ------------------
  203|   134k|          boxes_check(boxesCount++, boxem);
  204|   134k|          subBox.length = getULong(reinterpret_cast<byte*>(&subBox.length), bigEndian);
  205|   134k|          subBox.type = getULong(reinterpret_cast<byte*>(&subBox.type), bigEndian);
  206|   134k|          if (subBox.length > io_->size()) {
  ------------------
  |  Branch (206:15): [True: 146, False: 134k]
  ------------------
  207|    146|            throw Error(ErrorCode::kerCorruptedMetadata);
  208|    146|          }
  209|       |#ifdef EXIV2_DEBUG_MESSAGES
  210|       |          std::cout << "Exiv2::Jp2Image::readMetadata: "
  211|       |                    << "subBox = " << toAscii(subBox.type) << " length = " << subBox.length << '\n';
  212|       |#endif
  213|   134k|          if (subBox.type == kJp2BoxType::ColorSpec && subBox.length != 15) {
  ------------------
  |  Branch (213:15): [True: 257, False: 134k]
  |  Branch (213:56): [True: 201, False: 56]
  ------------------
  214|       |#ifdef EXIV2_DEBUG_MESSAGES
  215|       |            std::cout << "Exiv2::Jp2Image::readMetadata: "
  216|       |                      << "Color data found" << '\n';
  217|       |#endif
  218|       |
  219|    201|            const size_t pad = 3;  // 3 padding bytes 2 0 0
  220|    201|            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|    201|            if (data_length > io_->size() - io_->tell()) {
  ------------------
  |  Branch (222:17): [True: 22, False: 179]
  ------------------
  223|     22|              throw Error(ErrorCode::kerCorruptedMetadata);
  224|     22|            }
  225|    179|            DataBuf data(data_length);
  226|    179|            io_->read(data.data(), data.size());
  227|    179|            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|    179|            if (iccLength > data.size() - pad) {
  ------------------
  |  Branch (230:17): [True: 49, False: 130]
  ------------------
  231|     49|              throw Error(ErrorCode::kerCorruptedMetadata);
  232|     49|            }
  233|    130|            DataBuf icc(iccLength);
  234|    130|            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|    130|            setIccProfile(std::move(icc));
  245|    130|          }
  246|       |
  247|   134k|          if (subBox.type == kJp2BoxType::ImageHeader) {
  ------------------
  |  Branch (247:15): [True: 105, False: 134k]
  ------------------
  248|    105|            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|    105|            ihdr.imageHeight = getULong(reinterpret_cast<byte*>(&ihdr.imageHeight), bigEndian);
  253|    105|            ihdr.imageWidth = getULong(reinterpret_cast<byte*>(&ihdr.imageWidth), bigEndian);
  254|    105|            ihdr.componentCount = getShort(reinterpret_cast<byte*>(&ihdr.componentCount), bigEndian);
  255|    105|            Internal::enforce(ihdr.c == 7, ErrorCode::kerCorruptedMetadata);
  256|       |
  257|    105|            pixelWidth_ = ihdr.imageWidth;
  258|    105|            pixelHeight_ = ihdr.imageHeight;
  259|    105|          }
  260|       |
  261|   134k|          io_->seek(restore, BasicIo::beg);
  262|   134k|          if (io_->seek(subBox.length, BasicIo::cur) != 0) {
  ------------------
  |  Branch (262:15): [True: 75, False: 134k]
  ------------------
  263|     75|            throw Error(ErrorCode::kerCorruptedMetadata);
  264|     75|          }
  265|   134k|          restore = io_->tell();
  266|   134k|        }
  267|  7.52k|        break;
  268|  7.81k|      }
  269|       |
  270|  9.70k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (270:7): [True: 9.70k, False: 23.7k]
  ------------------
  271|       |#ifdef EXIV2_DEBUG_MESSAGES
  272|       |        std::cout << "Exiv2::Jp2Image::readMetadata: UUID box found" << '\n';
  273|       |#endif
  274|       |
  275|  9.70k|        if (io_->read(reinterpret_cast<byte*>(&uuid), sizeof(uuid)) == sizeof(uuid)) {
  ------------------
  |  Branch (275:13): [True: 9.70k, False: 6]
  ------------------
  276|  9.70k|          DataBuf rawData;
  277|  9.70k|          size_t bufRead;
  278|  9.70k|          bool bIsExif = uuid.uuid == kJp2UuidExif;
  279|  9.70k|          bool bIsIPTC = uuid.uuid == kJp2UuidIptc;
  280|  9.70k|          bool bIsXMP = uuid.uuid == kJp2UuidXmp;
  281|       |
  282|  9.70k|          if (bIsExif) {
  ------------------
  |  Branch (282:15): [True: 1.96k, False: 7.74k]
  ------------------
  283|       |#ifdef EXIV2_DEBUG_MESSAGES
  284|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Exif data found" << '\n';
  285|       |#endif
  286|  1.96k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  287|  1.96k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  288|  1.96k|            bufRead = io_->read(rawData.data(), rawData.size());
  289|  1.96k|            if (io_->error())
  ------------------
  |  Branch (289:17): [True: 0, False: 1.96k]
  ------------------
  290|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  291|  1.96k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (291:17): [True: 0, False: 1.96k]
  ------------------
  292|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  293|       |
  294|  1.96k|            if (rawData.size() > 8)  // "II*\0long"
  ------------------
  |  Branch (294:17): [True: 1.52k, False: 439]
  ------------------
  295|  1.52k|            {
  296|       |              // Find the position of Exif header in bytes array.
  297|  1.52k|              const char a = rawData.read_uint8(0);
  298|  1.52k|              const char b = rawData.read_uint8(1);
  299|  1.52k|              const size_t notfound = std::numeric_limits<size_t>::max();
  300|  1.52k|              size_t pos = (a == b && (a == 'I' || a == 'M')) ? 0 : notfound;
  ------------------
  |  Branch (300:29): [True: 1.27k, False: 242]
  |  Branch (300:40): [True: 4, False: 1.27k]
  |  Branch (300:52): [True: 785, False: 490]
  ------------------
  301|       |
  302|       |              // #1242  Forgive having Exif\0\0 in rawData.pData_
  303|  1.52k|              std::array<byte, 6> exifHeader{0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
  304|   102k|              for (size_t i = 0; pos == notfound && i < (rawData.size() - exifHeader.size()); i++) {
  ------------------
  |  Branch (304:34): [True: 101k, False: 1.40k]
  |  Branch (304:53): [True: 101k, False: 113]
  ------------------
  305|   101k|                if (rawData.cmpBytes(i, exifHeader.data(), exifHeader.size()) == 0) {
  ------------------
  |  Branch (305:21): [True: 619, False: 100k]
  ------------------
  306|    619|                  pos = i + sizeof(exifHeader);
  307|    619|#ifndef SUPPRESS_WARNINGS
  308|    619|                  EXV_WARNING << "Reading non-standard UUID-EXIF_bad box in " << io_->path() << '\n';
  ------------------
  |  |  138|    619|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 619]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    619|  LogMsg(LogMsg::warn).os()
  ------------------
  309|    619|#endif
  310|    619|                }
  311|   101k|              }
  312|       |
  313|       |              // If found it, store only these data at from this place.
  314|  1.52k|              if (pos != notfound) {
  ------------------
  |  Branch (314:19): [True: 1.40k, False: 113]
  ------------------
  315|       |#ifdef EXIV2_DEBUG_MESSAGES
  316|       |                std::cout << "Exiv2::Jp2Image::readMetadata: Exif header found at position " << pos << '\n';
  317|       |#endif
  318|  1.40k|                const DecodeParams dp(max_recursion_depth_);
  319|  1.40k|                ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), rawData.c_data(pos),
  320|  1.40k|                                                  rawData.size() - pos, dp);
  321|  1.40k|                setByteOrder(bo);
  322|  1.40k|              }
  323|  1.52k|            } else {
  324|    439|#ifndef SUPPRESS_WARNINGS
  325|    439|              EXV_WARNING << "Failed to decode Exif metadata." << '\n';
  ------------------
  |  |  138|    439|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 439]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    439|  LogMsg(LogMsg::warn).os()
  ------------------
  326|    439|#endif
  327|    439|              exifData_.clear();
  328|    439|            }
  329|  1.96k|          }
  330|       |
  331|  9.70k|          if (bIsIPTC) {
  ------------------
  |  Branch (331:15): [True: 2.36k, False: 7.33k]
  ------------------
  332|       |#ifdef EXIV2_DEBUG_MESSAGES
  333|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Iptc data found" << '\n';
  334|       |#endif
  335|  2.36k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  336|  2.36k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  337|  2.36k|            bufRead = io_->read(rawData.data(), rawData.size());
  338|  2.36k|            if (io_->error())
  ------------------
  |  Branch (338:17): [True: 0, False: 2.36k]
  ------------------
  339|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  340|  2.36k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (340:17): [True: 0, False: 2.36k]
  ------------------
  341|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  342|       |
  343|  2.36k|            if (IptcParser::decode(iptcData_, rawData.c_data(), rawData.size())) {
  ------------------
  |  Branch (343:17): [True: 1.29k, False: 1.07k]
  ------------------
  344|  1.29k|#ifndef SUPPRESS_WARNINGS
  345|  1.29k|              EXV_WARNING << "Failed to decode IPTC metadata." << '\n';
  ------------------
  |  |  138|  1.29k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.29k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.29k|  LogMsg(LogMsg::warn).os()
  ------------------
  346|  1.29k|#endif
  347|  1.29k|              iptcData_.clear();
  348|  1.29k|            }
  349|  2.36k|          }
  350|       |
  351|  9.70k|          if (bIsXMP) {
  ------------------
  |  Branch (351:15): [True: 2.00k, False: 7.69k]
  ------------------
  352|       |#ifdef EXIV2_DEBUG_MESSAGES
  353|       |            std::cout << "Exiv2::Jp2Image::readMetadata: Xmp data found" << '\n';
  354|       |#endif
  355|  2.00k|            Internal::enforce(box.length >= boxHSize + sizeof(uuid), ErrorCode::kerCorruptedMetadata);
  356|  2.00k|            rawData.alloc(box.length - (boxHSize + sizeof(uuid)));
  357|  2.00k|            bufRead = io_->read(rawData.data(), rawData.size());
  358|  2.00k|            if (io_->error())
  ------------------
  |  Branch (358:17): [True: 0, False: 2.00k]
  ------------------
  359|      0|              throw Error(ErrorCode::kerFailedToReadImageData);
  360|  2.00k|            if (bufRead != rawData.size())
  ------------------
  |  Branch (360:17): [True: 0, False: 2.00k]
  ------------------
  361|      0|              throw Error(ErrorCode::kerInputDataReadFailed);
  362|  2.00k|            xmpPacket_.assign(rawData.c_str(), rawData.size());
  363|       |
  364|  2.00k|            if (auto idx = xmpPacket_.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (364:59): [True: 405, False: 1.60k]
  |  Branch (364:87): [True: 395, False: 10]
  ------------------
  365|    395|#ifndef SUPPRESS_WARNINGS
  366|    395|              EXV_WARNING << "Removing " << static_cast<uint32_t>(idx)
  ------------------
  |  |  138|    395|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 395]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    395|  LogMsg(LogMsg::warn).os()
  ------------------
  367|      0|                          << " characters from the beginning of the XMP packet" << '\n';
  368|    395|#endif
  369|    395|              xmpPacket_ = xmpPacket_.substr(idx);
  370|    395|            }
  371|       |
  372|  2.00k|            const DecodeParams dp(max_recursion_depth_);
  373|  2.00k|            if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (373:17): [True: 674, False: 1.33k]
  |  Branch (373:40): [True: 564, False: 110]
  ------------------
  374|    564|#ifndef SUPPRESS_WARNINGS
  375|    564|              EXV_WARNING << "Failed to decode XMP metadata." << '\n';
  ------------------
  |  |  138|    564|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 564]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    564|  LogMsg(LogMsg::warn).os()
  ------------------
  376|    564|#endif
  377|    564|            }
  378|  2.00k|          }
  379|  9.70k|        }
  380|  9.70k|        break;
  381|  9.70k|      }
  382|       |
  383|  12.1k|      default:
  ------------------
  |  Branch (383:7): [True: 12.1k, False: 21.2k]
  ------------------
  384|  12.1k|        break;
  385|  33.4k|    }
  386|  31.9k|    lastBoxTypeRead = box.type;
  387|       |
  388|       |    // Move to the next box.
  389|  31.9k|    io_->seek(static_cast<int64_t>(position - boxHSize + box.length), BasicIo::beg);
  390|  31.9k|    if (io_->error())
  ------------------
  |  Branch (390:9): [True: 0, False: 31.9k]
  ------------------
  391|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  392|  31.9k|  }
  393|       |
  394|  2.69k|}  // Jp2Image::readMetadata
_ZN5Exiv28Jp2Image13writeMetadataEv:
  588|  1.03k|void Jp2Image::writeMetadata() {
  589|  1.03k|  if (io_->open() != 0) {
  ------------------
  |  Branch (589:7): [True: 0, False: 1.03k]
  ------------------
  590|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  591|      0|  }
  592|  1.03k|  IoCloser closer(*io_);
  593|  1.03k|  MemIo tempIo;
  594|       |
  595|  1.03k|  doWriteMetadata(tempIo);  // may throw
  596|  1.03k|  io_->close();
  597|  1.03k|  io_->transfer(tempIo);  // may throw
  598|       |
  599|  1.03k|}  // Jp2Image::writeMetadata
_ZN5Exiv28Jp2Image15encodeJp2HeaderERKNS_7DataBufERS1_:
  601|  6.74k|void Jp2Image::encodeJp2Header(const DataBuf& boxBuf, DataBuf& outBuf) {
  602|  6.74k|  DataBuf output(boxBuf.size() + iccProfile_.size() + 100);  // allocate sufficient space
  603|  6.74k|  size_t outlen = boxHSize;                                  // now many bytes have we written to output?
  604|  6.74k|  size_t inlen = boxHSize;                                   // how many bytes have we read from boxBuf?
  605|  6.74k|  Internal::enforce(boxHSize <= output.size(), ErrorCode::kerCorruptedMetadata);
  606|  6.74k|  uint32_t length = getULong(boxBuf.c_data(0), bigEndian);
  607|  6.74k|  Internal::enforce(length <= output.size(), ErrorCode::kerCorruptedMetadata);
  608|  6.74k|  uint32_t count = boxHSize;
  609|  6.74k|  bool bWroteColor = false;
  610|       |
  611|  7.01k|  while (count < length && !bWroteColor) {
  ------------------
  |  Branch (611:10): [True: 281, False: 6.73k]
  |  Branch (611:28): [True: 265, False: 16]
  ------------------
  612|    265|    Internal::enforce(boxHSize <= length - count, ErrorCode::kerCorruptedMetadata);
  613|    265|    Internal::Jp2BoxHeader subBox;
  614|    265|    std::memcpy(&subBox, boxBuf.c_data(count), boxHSize);
  615|    265|    Internal::Jp2BoxHeader newBox = subBox;
  616|       |
  617|    265|    if (count < length) {
  ------------------
  |  Branch (617:9): [True: 263, False: 2]
  ------------------
  618|    263|      subBox.length = getULong(boxBuf.c_data(count), bigEndian);
  619|    263|      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|    263|      Internal::enforce(subBox.length > 0, ErrorCode::kerCorruptedMetadata);
  625|    263|      Internal::enforce(subBox.length <= length - count, ErrorCode::kerCorruptedMetadata);
  626|    263|      count += subBox.length;
  627|    263|      newBox.type = subBox.type;
  628|    263|    } else {
  629|      2|      subBox.length = 0;
  630|      2|      newBox.type = kJp2BoxType::ColorSpec;
  631|      2|      count = length;
  632|      2|    }
  633|       |
  634|    265|    size_t newlen = subBox.length;
  635|    265|    if (newBox.type == kJp2BoxType::ColorSpec) {
  ------------------
  |  Branch (635:9): [True: 16, False: 249]
  ------------------
  636|     16|      bWroteColor = true;
  637|     16|      if (!iccProfileDefined()) {
  ------------------
  |  Branch (637:11): [True: 6, False: 10]
  ------------------
  638|      6|        const char* pad = "\x01\x00\x00\x00\x00\x00\x10\x00\x00\x05\x1cuuid";
  639|      6|        uint32_t psize = 15;
  640|      6|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  641|      6|        ul2Data(reinterpret_cast<byte*>(&newBox.length), psize, bigEndian);
  642|      6|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  643|      6|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  644|      6|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  645|     10|      } else {
  646|     10|        const char* pad = "\x02\x00\x00";
  647|     10|        uint32_t psize = 3;
  648|     10|        newlen = sizeof(newBox) + psize + iccProfile_.size();
  649|     10|        Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  650|     10|        ul2Data(reinterpret_cast<byte*>(&newBox.length), static_cast<uint32_t>(newlen), bigEndian);
  651|     10|        ul2Data(reinterpret_cast<byte*>(&newBox.type), newBox.type, bigEndian);
  652|     10|        std::memcpy(output.data(outlen), &newBox, sizeof(newBox));
  653|     10|        std::memcpy(output.data(outlen) + sizeof(newBox), pad, psize);
  654|     10|        std::copy(iccProfile_.begin(), iccProfile_.end(), output.begin() + outlen + sizeof(newBox) + psize);
  655|     10|      }
  656|    249|    } else {
  657|    249|      Internal::enforce(newlen <= output.size() - outlen, ErrorCode::kerCorruptedMetadata);
  658|    249|      std::copy_n(boxBuf.begin() + inlen, subBox.length, output.begin() + outlen);
  659|    249|    }
  660|       |
  661|    265|    outlen += newlen;
  662|    265|    inlen += subBox.length;
  663|    265|  }
  664|       |
  665|       |  // allocate the correct number of bytes, copy the data and update the box header
  666|  6.74k|  outBuf.alloc(outlen);
  667|  6.74k|  std::copy_n(output.begin(), outlen, outBuf.begin());
  668|  6.74k|  ul2Data(outBuf.data(0), static_cast<uint32_t>(outlen), bigEndian);
  669|  6.74k|  ul2Data(outBuf.data(4), kJp2BoxType::Header, bigEndian);
  670|  6.74k|}
_ZN5Exiv28Jp2Image15doWriteMetadataERNS_7BasicIoE:
  672|  1.03k|void Jp2Image::doWriteMetadata(BasicIo& outIo) {
  673|  1.03k|  if (!io_->isopen())
  ------------------
  |  Branch (673:7): [True: 0, False: 1.03k]
  ------------------
  674|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  675|  1.03k|  if (!outIo.isopen())
  ------------------
  |  Branch (675:7): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|  if (!isJp2Type(*io_, true)) {
  ------------------
  |  Branch (684:7): [True: 0, False: 1.03k]
  ------------------
  685|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  686|      0|  }
  687|       |
  688|       |  // Write JPEG2000 Signature (This is the 1st box)
  689|  1.03k|  if (outIo.write(Jp2Signature.data(), Jp2Signature.size()) != 12)
  ------------------
  |  Branch (689:7): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|  Internal::Jp2BoxHeader box = {0, 0};
  697|       |
  698|  1.03k|  std::array<byte, 4> boxDataSize;
  699|  1.03k|  std::array<byte, 4> boxUUIDtype;
  700|  1.03k|  DataBuf bheaderBuf(8);
  701|       |
  702|  20.9k|  while (io_->tell() < io_->size()) {
  ------------------
  |  Branch (702:10): [True: 20.2k, False: 656]
  ------------------
  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|  20.2k|    io_->readOrThrow(bheaderBuf.data(), bheaderBuf.size(), ErrorCode::kerInputDataReadFailed);
  709|       |
  710|       |    // Decode box header.
  711|  20.2k|    box.length = bheaderBuf.read_uint32(0, bigEndian);
  712|  20.2k|    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|  20.2k|    if (box.length == 0) {
  ------------------
  |  Branch (719:9): [True: 416, False: 19.8k]
  ------------------
  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|    416|      box.length = static_cast<uint32_t>(io_->size() - io_->tell() + 8);
  726|    416|    }
  727|  20.2k|    if (box.length < 8) {
  ------------------
  |  Branch (727:9): [True: 6, False: 20.2k]
  ------------------
  728|       |      // box is broken, so there is nothing we can do here
  729|      6|      throw Error(ErrorCode::kerCorruptedMetadata);
  730|      6|    }
  731|       |
  732|       |    // Prevent a malicious file from causing a large memory allocation.
  733|  20.2k|    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|  20.2k|    DataBuf boxBuf(box.length);                                       // Box header (8 bytes) + box data.
  737|  20.2k|    std::copy(bheaderBuf.begin(), bheaderBuf.end(), boxBuf.begin());  // Copy header.
  738|  20.2k|    io_->readOrThrow(boxBuf.data(8), box.length - 8, ErrorCode::kerInputDataReadFailed);  // Extract box data.
  739|       |
  740|  20.2k|    switch (box.type) {
  741|  6.74k|      case kJp2BoxType::Header: {
  ------------------
  |  Branch (741:7): [True: 6.74k, False: 13.5k]
  ------------------
  742|  6.74k|        DataBuf newBuf;
  743|  6.74k|        encodeJp2Header(boxBuf, newBuf);
  744|       |#ifdef EXIV2_DEBUG_MESSAGES
  745|       |        std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write JP2Header box (length: " << box.length << ")\n";
  746|       |#endif
  747|  6.74k|        if (outIo.write(newBuf.data(), newBuf.size()) != newBuf.size())
  ------------------
  |  Branch (747:13): [True: 0, False: 6.74k]
  ------------------
  748|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  749|       |
  750|       |        // Write all updated metadata here, just after JP2Header.
  751|       |
  752|  6.74k|        if (!exifData_.empty()) {
  ------------------
  |  Branch (752:13): [True: 6.03k, False: 717]
  ------------------
  753|       |          // Update Exif data to a new UUID box
  754|       |
  755|  6.03k|          Blob blob;
  756|  6.03k|          ExifParser::encode(blob, littleEndian, exifData_);
  757|  6.03k|          if (!blob.empty()) {
  ------------------
  |  Branch (757:15): [True: 5.98k, False: 49]
  ------------------
  758|  5.98k|            DataBuf rawExif(blob.size());
  759|  5.98k|            std::copy(blob.begin(), blob.end(), rawExif.begin());
  760|       |
  761|  5.98k|            DataBuf boxData(8 + 16 + rawExif.size());
  762|  5.98k|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  763|  5.98k|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  764|  5.98k|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  765|  5.98k|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  766|  5.98k|            std::copy(kJp2UuidExif.begin(), kJp2UuidExif.end(), boxData.begin() + 8);
  767|  5.98k|            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.98k|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (773:17): [True: 0, False: 5.98k]
  ------------------
  774|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  775|  5.98k|          }
  776|  6.03k|        }
  777|       |
  778|  6.74k|        if (!iptcData_.empty()) {
  ------------------
  |  Branch (778:13): [True: 539, False: 6.20k]
  ------------------
  779|       |          // Update Iptc data to a new UUID box
  780|       |
  781|    539|          DataBuf rawIptc = IptcParser::encode(iptcData_);
  782|    539|          if (!rawIptc.empty()) {
  ------------------
  |  Branch (782:15): [True: 539, False: 0]
  ------------------
  783|    539|            DataBuf boxData(8 + 16 + rawIptc.size());
  784|    539|            ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  785|    539|            ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  786|    539|            std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  787|    539|            std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  788|    539|            std::copy(kJp2UuidIptc.begin(), kJp2UuidIptc.end(), boxData.begin() + 8);
  789|    539|            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|    539|            if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (795:17): [True: 0, False: 539]
  ------------------
  796|      0|              throw Error(ErrorCode::kerImageWriteFailed);
  797|    539|          }
  798|    539|        }
  799|       |
  800|  6.74k|        if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (800:13): [True: 6.73k, False: 18]
  |  Branch (800:38): [True: 4, False: 6.72k]
  ------------------
  801|      4|#ifndef SUPPRESS_WARNINGS
  802|      4|          EXV_ERROR << "Failed to encode XMP metadata." << '\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()
  ------------------
  803|      4|#endif
  804|      4|        }
  805|  6.74k|        if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (805:13): [True: 365, False: 6.38k]
  ------------------
  806|       |          // Update Xmp data to a new UUID box
  807|       |
  808|    365|          DataBuf xmp(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size());
  809|    365|          DataBuf boxData(8 + 16 + xmp.size());
  810|    365|          ul2Data(boxDataSize.data(), static_cast<uint32_t>(boxData.size()), bigEndian);
  811|    365|          ul2Data(boxUUIDtype.data(), kJp2BoxType::Uuid, bigEndian);
  812|    365|          std::copy(boxDataSize.begin(), boxDataSize.end(), boxData.begin());
  813|    365|          std::copy(boxUUIDtype.begin(), boxUUIDtype.end(), boxData.begin() + 4);
  814|    365|          std::copy(kJp2UuidXmp.begin(), kJp2UuidXmp.end(), boxData.begin() + 8);
  815|    365|          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|    365|          if (outIo.write(boxData.c_data(), boxData.size()) != boxData.size())
  ------------------
  |  Branch (821:15): [True: 0, False: 365]
  ------------------
  822|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  823|    365|        }
  824|       |
  825|  6.74k|        break;
  826|  6.74k|      }
  827|       |
  828|  6.74k|      case kJp2BoxType::Uuid: {
  ------------------
  |  Branch (828:7): [True: 2.67k, False: 17.6k]
  ------------------
  829|  2.67k|        Internal::enforce(boxBuf.size() >= 24, ErrorCode::kerCorruptedMetadata);
  830|  2.67k|        if (boxBuf.cmpBytes(8, kJp2UuidExif.data(), 16) == 0) {
  ------------------
  |  Branch (830:13): [True: 912, False: 1.75k]
  ------------------
  831|       |#ifdef EXIV2_DEBUG_MESSAGES
  832|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Exif Uuid box" << '\n';
  833|       |#endif
  834|  1.75k|        } else if (boxBuf.cmpBytes(8, kJp2UuidIptc.data(), 16) == 0) {
  ------------------
  |  Branch (834:20): [True: 375, False: 1.38k]
  ------------------
  835|       |#ifdef EXIV2_DEBUG_MESSAGES
  836|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Iptc Uuid box" << '\n';
  837|       |#endif
  838|  1.38k|        } else if (boxBuf.cmpBytes(8, kJp2UuidXmp.data(), 16) == 0) {
  ------------------
  |  Branch (838:20): [True: 577, False: 807]
  ------------------
  839|       |#ifdef EXIV2_DEBUG_MESSAGES
  840|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: strip Xmp Uuid box" << '\n';
  841|       |#endif
  842|    807|        } else {
  843|       |#ifdef EXIV2_DEBUG_MESSAGES
  844|       |          std::cout << "Exiv2::Jp2Image::doWriteMetadata: write Uuid box (length: " << box.length << ")" << '\n';
  845|       |#endif
  846|    807|          if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (846:15): [True: 0, False: 807]
  ------------------
  847|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  848|    807|        }
  849|  2.67k|        break;
  850|  2.67k|      }
  851|       |
  852|  10.5k|      default: {
  ------------------
  |  Branch (852:7): [True: 10.5k, False: 9.77k]
  ------------------
  853|       |#ifdef EXIV2_DEBUG_MESSAGES
  854|       |        std::cout << "Exiv2::Jp2Image::doWriteMetadata: write box (length: " << box.length << ")" << '\n';
  855|       |#endif
  856|  10.5k|        if (outIo.write(boxBuf.c_data(), boxBuf.size()) != boxBuf.size())
  ------------------
  |  Branch (856:13): [True: 0, False: 10.5k]
  ------------------
  857|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  858|       |
  859|  10.5k|        break;
  860|  10.5k|      }
  861|  20.2k|    }
  862|  20.2k|  }
  863|       |
  864|       |#ifdef EXIV2_DEBUG_MESSAGES
  865|       |  std::cout << "Exiv2::Jp2Image::doWriteMetadata: EOF" << '\n';
  866|       |#endif
  867|       |
  868|  1.03k|}  // Jp2Image::doWriteMetadata
_ZN5Exiv214newJp2InstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  872|  2.71k|Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  873|  2.71k|  auto image = std::make_unique<Jp2Image>(std::move(io), params);
  874|  2.71k|  if (!image->good()) {
  ------------------
  |  Branch (874:7): [True: 18, False: 2.69k]
  ------------------
  875|     18|    return nullptr;
  876|     18|  }
  877|  2.69k|  return image;
  878|  2.71k|}
_ZN5Exiv29isJp2TypeERNS_7BasicIoEb:
  880|  29.7k|bool isJp2Type(BasicIo& iIo, bool advance) {
  881|  29.7k|  std::array<byte, Jp2Signature.size()> buf;
  882|  29.7k|  const size_t bytesRead = iIo.read(buf.data(), Jp2Signature.size());
  883|  29.7k|  if (iIo.error() || iIo.eof() || bytesRead != Jp2Signature.size()) {
  ------------------
  |  Branch (883:7): [True: 0, False: 29.7k]
  |  Branch (883:22): [True: 561, False: 29.2k]
  |  Branch (883:35): [True: 0, False: 29.2k]
  ------------------
  884|    561|    return false;
  885|    561|  }
  886|  29.2k|  bool matched = buf == Jp2Signature;
  887|  29.2k|  if (!advance || !matched) {
  ------------------
  |  Branch (887:7): [True: 28.1k, False: 1.03k]
  |  Branch (887:19): [True: 0, False: 1.03k]
  ------------------
  888|  28.1k|    iIo.seek(-static_cast<int64_t>(Jp2Signature.size()), BasicIo::cur);  // Return to original position
  889|  28.1k|  }
  890|  29.2k|  return matched;
  891|  29.7k|}
jp2image.cpp:_ZN5Exiv212_GLOBAL__N_111boxes_checkEmm:
   89|   168k|void boxes_check(size_t b, size_t m) {
   90|   168k|  if (b > m) {
  ------------------
  |  Branch (90:7): [True: 2, False: 168k]
  ------------------
   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|   168k|}

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    412|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|    412|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 77, False: 335]
  |  Branch (15:29): [True: 69, False: 266]
  ------------------
   16|    146|    return false;
   17|    146|  }
   18|       |
   19|    266|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    266|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    266|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    266|  bool clWithRightBrand = false;
   24|  4.49k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 4.28k, False: 210]
  ------------------
   25|  4.28k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  4.28k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 1.86k, False: 2.42k]
  |  Branch (26:31): [True: 27, False: 1.83k]
  |  Branch (26:66): [True: 549, False: 3.71k]
  |  Branch (26:87): [True: 29, False: 520]
  ------------------
   27|     56|      clWithRightBrand = true;
   28|     56|      break;
   29|     56|    }
   30|  4.28k|  }
   31|    266|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 62, False: 204]
  |  Branch (31:32): [True: 25, False: 37]
  ------------------
   32|    412|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  3.35k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  3.35k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 3.35k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  3.35k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  2.39M|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  2.39M|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|  7.15M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 4.76M, False: 2.39M]
  ------------------
  138|  4.76M|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 1.69k, False: 4.76M]
  ------------------
  139|  1.69k|      throw Error(err);
  140|  4.76M|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  2.86M|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 473k, False: 2.39M]
  ------------------
  144|   473k|  }
  145|  2.39M|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 446, False: 2.39M]
  ------------------
  146|    446|    throw Error(err);
  147|       |
  148|  2.39M|  return static_cast<byte>(c);
  149|  2.39M|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  3.35k|void JpegBase::readMetadata() {
  152|  3.35k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  3.35k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 3.35k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  3.35k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  3.35k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 445, False: 2.90k]
  ------------------
  159|    445|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 445]
  |  Branch (159:25): [True: 0, False: 445]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|    445|    throw Error(ErrorCode::kerNotAJpeg);
  162|    445|  }
  163|  2.90k|  clearMetadata();
  164|  2.90k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  2.90k|  Blob psBlob;
  166|  2.90k|  bool foundCompletePsData = false;
  167|  2.90k|  bool foundExifData = false;
  168|  2.90k|  bool foundXmpData = false;
  169|  2.90k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  2.90k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|   473k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 473k, False: 349]
  |  Branch (174:28): [True: 472k, False: 281]
  |  Branch (174:46): [True: 472k, False: 13]
  ------------------
  175|   472k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|   472k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|   472k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 90.6k, False: 382k]
  ------------------
  181|  90.6k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  90.6k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  90.6k|    }
  184|       |
  185|   472k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 4.76k, False: 467k]
  ------------------
  186|  4.76k|      sof_encoding_process_ = itSofMarker->label_;
  187|  4.76k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 3.22k, False: 1.54k]
  |  Branch (187:24): [True: 2.79k, False: 431]
  ------------------
  188|  2.79k|        num_color_components_ = *buf.c_data(7);
  189|  2.79k|      }
  190|  4.76k|    }
  191|       |
  192|   472k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 469k, False: 3.68k]
  |  Branch (192:27): [True: 1.84k, False: 467k]
  |  Branch (192:46): [True: 1.57k, False: 276]
  ------------------
  193|  1.57k|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 275, False: 1.29k]
  ------------------
  194|    275|      const DecodeParams dp(max_recursion_depth_);
  195|    275|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8, dp);
  196|    275|      setByteOrder(bo);
  197|    275|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (197:11): [True: 190, False: 85]
  |  Branch (197:23): [True: 0, False: 190]
  ------------------
  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|    275|      --search;
  204|    275|      foundExifData = true;
  205|   472k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (205:16): [True: 471k, False: 662]
  |  Branch (205:33): [True: 1.59k, False: 470k]
  |  Branch (205:52): [True: 1.25k, False: 339]
  ------------------
  206|  1.25k|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (206:19): [True: 69, False: 1.18k]
  ------------------
  207|     69|      xmpPacket_.assign(buf.c_str(31), size - 31);
  208|     69|      const DecodeParams dp(max_recursion_depth_);
  209|     69|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (209:11): [True: 66, False: 3]
  |  Branch (209:34): [True: 27, False: 39]
  ------------------
  210|     27|#ifndef SUPPRESS_WARNINGS
  211|     27|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     27|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 27]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     27|  LogMsg(LogMsg::warn).os()
  ------------------
  212|     27|#endif
  213|     27|      }
  214|     69|      --search;
  215|     69|      foundXmpData = true;
  216|   472k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (216:16): [True: 470k, False: 1.81k]
  |  Branch (216:40): [True: 73.3k, False: 397k]
  ------------------
  217|  73.3k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (217:16): [True: 73.0k, False: 300]
  ------------------
  218|  73.0k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (218:19): [True: 48.8k, False: 24.1k]
  ------------------
  219|       |#ifdef EXIV2_DEBUG_MESSAGES
  220|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  221|       |#endif
  222|  48.8k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (222:11): [True: 26.0k, False: 22.8k]
  ------------------
  223|  26.0k|        append(psBlob, buf.c_data(16), size - 16);
  224|  26.0k|      }
  225|       |      // Check whether psBlob is complete
  226|  48.8k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (226:11): [True: 48.0k, False: 844]
  |  Branch (226:30): [True: 183, False: 47.8k]
  ------------------
  227|    183|        --search;
  228|    183|        foundCompletePsData = true;
  229|    183|      }
  230|   423k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (230:16): [True: 964, False: 422k]
  |  Branch (230:34): [True: 426, False: 538]
  ------------------
  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|    426|      comment_.assign(buf.c_str(2), size - 2);
  235|  9.63k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (235:14): [True: 9.34k, False: 288]
  |  Branch (235:35): [True: 9.20k, False: 138]
  ------------------
  236|  9.20k|        comment_.pop_back();
  237|  9.20k|      }
  238|    426|      --search;
  239|   423k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (239:16): [True: 19.0k, False: 404k]
  |  Branch (239:35): [True: 6.69k, False: 12.3k]
  ------------------
  240|  6.69k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (240:19): [True: 5.79k, False: 902]
  ------------------
  241|  5.79k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (241:11): [True: 148, False: 5.64k]
  ------------------
  242|    148|        rc = 8;
  243|    148|        break;
  244|    148|      }
  245|       |      // ICC profile
  246|  5.64k|      if (!foundIccData) {
  ------------------
  |  Branch (246:11): [True: 214, False: 5.43k]
  ------------------
  247|    214|        foundIccData = true;
  248|    214|        --search;
  249|    214|      }
  250|  5.64k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  251|  5.64k|      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|  5.64k|      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|  5.64k|      size_t icc_size = size - 2 - 14;
  263|  5.64k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (263:11): [True: 539, False: 5.10k]
  |  Branch (263:25): [True: 337, False: 202]
  ------------------
  264|    337|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  265|    337|        icc_size = s;
  266|    337|      }
  267|       |
  268|  5.64k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  269|   417k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (269:16): [True: 395k, False: 21.3k]
  |  Branch (269:37): [True: 942, False: 394k]
  ------------------
  270|       |      // We hit a SOFn (start-of-frame) marker
  271|    942|      if (size < 8) {
  ------------------
  |  Branch (271:11): [True: 143, False: 799]
  ------------------
  272|    143|        rc = 7;
  273|    143|        break;
  274|    143|      }
  275|    799|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  276|    799|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  277|    799|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (277:11): [True: 434, False: 365]
  ------------------
  278|    434|        --search;
  279|    799|    }
  280|       |
  281|       |    // Read the beginning of the next segment
  282|   472k|    try {
  283|   472k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  284|   472k|    } catch (const Error&) {
  285|  1.34k|      rc = 5;
  286|  1.34k|      break;
  287|  1.34k|    }
  288|   472k|  }  // while there are segments to process
  289|       |
  290|  2.27k|  if (!psBlob.empty()) {
  ------------------
  |  Branch (290:7): [True: 387, False: 1.88k]
  ------------------
  291|       |    // Find actual IPTC data within the psBlob
  292|    387|    Blob iptcBlob;
  293|    387|    const byte* record = nullptr;
  294|    387|    uint32_t sizeIptc = 0;
  295|    387|    uint32_t sizeHdr = 0;
  296|    387|    const byte* pCur = psBlob.data();
  297|    387|    const byte* pEnd = pCur + psBlob.size();
  298|  14.0k|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (298:12): [True: 13.9k, False: 89]
  |  Branch (298:27): [True: 13.6k, False: 298]
  ------------------
  299|       |#ifdef EXIV2_DEBUG_MESSAGES
  300|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  301|       |#endif
  302|  13.6k|      if (sizeIptc) {
  ------------------
  |  Branch (302:11): [True: 972, False: 12.7k]
  ------------------
  303|    972|        append(iptcBlob, record + sizeHdr, sizeIptc);
  304|    972|      }
  305|  13.6k|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  306|  13.6k|    }
  307|    387|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (307:9): [True: 142, False: 245]
  |  Branch (307:30): [True: 78, False: 64]
  ------------------
  308|     78|#ifndef SUPPRESS_WARNINGS
  309|     78|      EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     78|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 78]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     78|  LogMsg(LogMsg::warn).os()
  ------------------
  310|     78|#endif
  311|     78|      iptcData_.clear();
  312|     78|    }
  313|    387|  }
  314|       |
  315|  2.27k|  if (rc != 0) {
  ------------------
  |  Branch (315:7): [True: 1.63k, False: 643]
  ------------------
  316|  1.63k|#ifndef SUPPRESS_WARNINGS
  317|  1.63k|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|  1.63k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.63k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.63k|  LogMsg(LogMsg::warn).os()
  ------------------
  318|  1.63k|#endif
  319|  1.63k|  }
  320|  2.27k|}  // JpegBase::readMetadata
_ZN5Exiv28JpegBase13writeMetadataEv:
  578|  1.03k|void JpegBase::writeMetadata() {
  579|  1.03k|  if (io_->open() != 0) {
  ------------------
  |  Branch (579:7): [True: 0, False: 1.03k]
  ------------------
  580|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  581|      0|  }
  582|  1.03k|  IoCloser closer(*io_);
  583|  1.03k|  MemIo tempIo;
  584|       |
  585|  1.03k|  doWriteMetadata(tempIo);  // may throw
  586|  1.03k|  io_->close();
  587|  1.03k|  io_->transfer(tempIo);  // may throw
  588|  1.03k|}
_ZN5Exiv28JpegBase15readNextSegmentEh:
  590|  1.92M|DataBuf JpegBase::readNextSegment(byte marker) {
  591|  1.92M|  const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  592|       |
  593|       |  // Read the rest of the segment if not empty.
  594|  1.92M|  DataBuf buf(size);
  595|  1.92M|  if (size > 0) {
  ------------------
  |  Branch (595:7): [True: 143k, False: 1.77M]
  ------------------
  596|   143k|    std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  597|   143k|    if (size > 2) {
  ------------------
  |  Branch (597:9): [True: 132k, False: 11.5k]
  ------------------
  598|   132k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  599|   132k|    }
  600|   143k|  }
  601|  1.92M|  return buf;
  602|  1.92M|}
_ZN5Exiv28JpegBase15doWriteMetadataERNS_7BasicIoE:
  604|  1.03k|void JpegBase::doWriteMetadata(BasicIo& outIo) {
  605|  1.03k|  if (!io_->isopen())
  ------------------
  |  Branch (605:7): [True: 0, False: 1.03k]
  ------------------
  606|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  607|  1.03k|  if (!outIo.isopen())
  ------------------
  |  Branch (607:7): [True: 0, False: 1.03k]
  ------------------
  608|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  609|       |
  610|       |  // Ensure that this is the correct image type
  611|  1.03k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (611:7): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|  static const size_t notfound = std::numeric_limits<size_t>::max();
  619|       |
  620|  1.03k|  const size_t seek = io_->tell();
  621|  1.03k|  size_t count = 0;
  622|  1.03k|  size_t search = 0;
  623|  1.03k|  size_t insertPos = 0;
  624|  1.03k|  size_t comPos = 0;
  625|  1.03k|  size_t skipApp1Exif = notfound;
  626|  1.03k|  size_t skipApp1Xmp = notfound;
  627|  1.03k|  bool foundCompletePsData = false;
  628|  1.03k|  bool foundIccData = false;
  629|  1.03k|  std::vector<size_t> skipApp13Ps3;
  630|  1.03k|  std::vector<size_t> skipApp2Icc;
  631|  1.03k|  size_t skipCom = notfound;
  632|  1.03k|  Blob psBlob;
  633|  1.03k|  DataBuf rawExif;
  634|  1.03k|  xmpData().usePacket(writeXmpFromPacket());
  635|       |
  636|       |  // Write image header
  637|  1.03k|  if (writeHeader(outIo))
  ------------------
  |  Branch (637:7): [True: 0, False: 1.03k]
  ------------------
  638|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  639|       |
  640|       |  // Read section marker
  641|  1.03k|  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.15M|  while (marker != sos_ && marker != eoi_ && search < 6) {
  ------------------
  |  Branch (646:10): [True: 1.15M, False: 783]
  |  Branch (646:28): [True: 1.15M, False: 234]
  |  Branch (646:46): [True: 1.15M, False: 17]
  ------------------
  647|  1.15M|    DataBuf buf = readNextSegment(marker);
  648|       |
  649|  1.15M|    if (marker == app0_) {
  ------------------
  |  Branch (649:9): [True: 1.24k, False: 1.15M]
  ------------------
  650|  1.24k|      insertPos = count + 1;
  651|  1.15M|    } else if (skipApp1Exif == notfound && marker == app1_ &&
  ------------------
  |  Branch (651:16): [True: 1.09M, False: 63.9k]
  |  Branch (651:44): [True: 1.54k, False: 1.08M]
  ------------------
  652|  1.54k|               buf.size() >= 8 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (652:16): [True: 1.34k, False: 201]
  ------------------
  653|  1.34k|               buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (653:16): [True: 113, False: 1.22k]
  ------------------
  654|    113|      skipApp1Exif = count;
  655|    113|      ++search;
  656|    113|      if (buf.size() > 8) {
  ------------------
  |  Branch (656:11): [True: 96, False: 17]
  ------------------
  657|     96|        rawExif.alloc(buf.size() - 8);
  658|     96|        std::copy_n(buf.begin() + 8, rawExif.size(), rawExif.begin());
  659|     96|      }
  660|  1.15M|    } else if (skipApp1Xmp == notfound && marker == app1_ &&
  ------------------
  |  Branch (660:16): [True: 1.15M, False: 456]
  |  Branch (660:43): [True: 1.47k, False: 1.15M]
  ------------------
  661|  1.47k|               buf.size() >= 31 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (661:16): [True: 1.20k, False: 262]
  ------------------
  662|  1.20k|               buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (662:16): [True: 66, False: 1.14k]
  ------------------
  663|     66|      skipApp1Xmp = count;
  664|     66|      ++search;
  665|  1.15M|    } else if (marker == app2_ && buf.size() >= 13 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (665:16): [True: 19.2k, False: 1.13M]
  |  Branch (665:35): [True: 13.1k, False: 6.16k]
  ------------------
  666|  13.1k|               buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (666:16): [True: 5.01k, False: 8.10k]
  ------------------
  667|  5.01k|      skipApp2Icc.push_back(count);
  668|  5.01k|      if (!foundIccData) {
  ------------------
  |  Branch (668:11): [True: 149, False: 4.86k]
  ------------------
  669|    149|        ++search;
  670|    149|        foundIccData = true;
  671|    149|      }
  672|  1.14M|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (672:16): [True: 1.14M, False: 1.35k]
  |  Branch (672:40): [True: 73.2k, False: 1.07M]
  ------------------
  673|  73.2k|               buf.size() >= 16 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (673:16): [True: 72.9k, False: 291]
  ------------------
  674|  72.9k|               buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (674:16): [True: 48.8k, False: 24.1k]
  ------------------
  675|       |#ifdef EXIV2_DEBUG_MESSAGES
  676|       |      std::cerr << "Found APP13 Photoshop PS3 segment\n";
  677|       |#endif
  678|  48.8k|      skipApp13Ps3.push_back(count);
  679|       |      // Append to psBlob
  680|  48.8k|      append(psBlob, buf.c_data(16), buf.size() - 16);
  681|       |      // Check whether psBlob is complete
  682|  48.8k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (682:11): [True: 47.7k, False: 1.13k]
  |  Branch (682:30): [True: 63, False: 47.6k]
  ------------------
  683|     63|        foundCompletePsData = true;
  684|     63|      }
  685|  1.10M|    } else if (marker == com_ && skipCom == notfound) {
  ------------------
  |  Branch (685:16): [True: 574, False: 1.10M]
  |  Branch (685:34): [True: 121, False: 453]
  ------------------
  686|       |      // Jpegs can have multiple comments, but for now only handle
  687|       |      // the first one (most jpegs only have one anyway).
  688|    121|      skipCom = count;
  689|    121|      ++search;
  690|    121|    }
  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.15M|    if (comPos == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (697:9): [True: 829k, False: 326k]
  |  Branch (697:24): [True: 278, False: 829k]
  ------------------
  698|    278|      comPos = count;
  699|    278|      ++search;
  700|    278|    }
  701|  1.15M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  702|  1.15M|    ++count;
  703|  1.15M|  }
  704|       |
  705|  1.03k|  if (!foundCompletePsData && !psBlob.empty())
  ------------------
  |  Branch (705:7): [True: 304, False: 730]
  |  Branch (705:31): [True: 15, False: 289]
  ------------------
  706|     15|    throw Error(ErrorCode::kerNoImageInInputData);
  707|  1.01k|  search += skipApp13Ps3.size() + skipApp2Icc.size();
  708|       |
  709|  1.01k|  if (comPos == 0) {
  ------------------
  |  Branch (709:7): [True: 307, False: 712]
  ------------------
  710|    307|    if (marker == eoi_)
  ------------------
  |  Branch (710:9): [True: 213, False: 94]
  ------------------
  711|    213|      comPos = count;
  712|     94|    else
  713|     94|      comPos = insertPos;
  714|    307|    ++search;
  715|    307|  }
  716|  1.01k|  if (!exifData_.empty())
  ------------------
  |  Branch (716:7): [True: 62, False: 957]
  ------------------
  717|     62|    ++search;
  718|  1.01k|  if (!writeXmpFromPacket() && !xmpData_.empty())
  ------------------
  |  Branch (718:7): [True: 338, False: 681]
  |  Branch (718:32): [True: 31, False: 307]
  ------------------
  719|     31|    ++search;
  720|  1.01k|  if (writeXmpFromPacket() && !xmpPacket_.empty())
  ------------------
  |  Branch (720:7): [True: 0, False: 1.01k]
  |  Branch (720:31): [True: 0, False: 0]
  ------------------
  721|      0|    ++search;
  722|  1.01k|  if (foundCompletePsData || !iptcData_.empty())
  ------------------
  |  Branch (722:7): [True: 730, False: 289]
  |  Branch (722:30): [True: 0, False: 289]
  ------------------
  723|     49|    ++search;
  724|  1.01k|  if (!comment_.empty())
  ------------------
  |  Branch (724:7): [True: 29, False: 990]
  ------------------
  725|     29|    ++search;
  726|       |
  727|  1.01k|  io_->seekOrThrow(seek, BasicIo::beg, ErrorCode::kerNoImageInInputData);
  728|  1.01k|  count = 0;
  729|  1.01k|  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|   766k|  while (marker != sos_ && search > 0) {
  ------------------
  |  Branch (735:10): [True: 766k, False: 779]
  |  Branch (735:28): [True: 766k, False: 26]
  ------------------
  736|   766k|    DataBuf buf = readNextSegment(marker);
  737|       |
  738|   766k|    if (insertPos == count) {
  ------------------
  |  Branch (738:9): [True: 330, False: 765k]
  ------------------
  739|       |      // Write Exif data first so that - if there is no app0 - we
  740|       |      // create "Exif images" according to the Exif standard.
  741|    330|      if (!exifData_.empty()) {
  ------------------
  |  Branch (741:11): [True: 62, False: 268]
  ------------------
  742|     62|        Blob blob;
  743|     62|        ByteOrder bo = byteOrder();
  744|     62|        if (bo == invalidByteOrder) {
  ------------------
  |  Branch (744:13): [True: 0, False: 62]
  ------------------
  745|      0|          bo = littleEndian;
  746|      0|          setByteOrder(bo);
  747|      0|        }
  748|     62|        const byte* pExifData = rawExif.c_data();
  749|     62|        size_t exifSize = rawExif.size();
  750|     62|        if (ExifParser::encode(blob, pExifData, exifSize, bo, exifData_) == wmIntrusive) {
  ------------------
  |  Branch (750:13): [True: 52, False: 10]
  ------------------
  751|     52|          pExifData = !blob.empty() ? blob.data() : nullptr;
  ------------------
  |  Branch (751:23): [True: 50, False: 2]
  ------------------
  752|     52|          exifSize = blob.size();
  753|     52|        }
  754|     62|        if (exifSize > 0) {
  ------------------
  |  Branch (754:13): [True: 59, False: 3]
  ------------------
  755|     59|          std::array<byte, 10> tmpBuf;
  756|       |          // Write APP1 marker, size of APP1 field, Exif id and Exif data
  757|     59|          tmpBuf[0] = 0xff;
  758|     59|          tmpBuf[1] = app1_;
  759|       |
  760|     59|          if (exifSize > 0xffff - 8)
  ------------------
  |  Branch (760:15): [True: 1, False: 58]
  ------------------
  761|      1|            throw Error(ErrorCode::kerTooLargeJpegSegment, "Exif");
  762|     58|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(exifSize + 8), bigEndian);
  763|     58|          std::copy(exifId_.begin(), exifId_.end(), tmpBuf.begin() + 4);
  764|     58|          if (outIo.write(tmpBuf.data(), 10) != 10)
  ------------------
  |  Branch (764:15): [True: 0, False: 58]
  ------------------
  765|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  766|       |
  767|       |          // Write new Exif data buffer
  768|     58|          if (outIo.write(pExifData, exifSize) != exifSize)
  ------------------
  |  Branch (768:15): [True: 0, False: 58]
  ------------------
  769|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  770|     58|          if (outIo.error())
  ------------------
  |  Branch (770:15): [True: 0, False: 58]
  ------------------
  771|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  772|     58|          --search;
  773|     58|        }
  774|     62|      }
  775|    329|      if (!writeXmpFromPacket() &&
  ------------------
  |  Branch (775:11): [True: 328, False: 1]
  ------------------
  776|    328|          XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {
  ------------------
  |  Branch (776:11): [True: 0, False: 328]
  ------------------
  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|    329|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (781:11): [True: 31, False: 298]
  ------------------
  782|     31|        std::array<byte, 33> tmpBuf;
  783|       |        // Write APP1 marker, size of APP1 field, XMP id and XMP packet
  784|     31|        tmpBuf[0] = 0xff;
  785|     31|        tmpBuf[1] = app1_;
  786|       |
  787|     31|        if (xmpPacket_.size() > 0xffff - 31)
  ------------------
  |  Branch (787:13): [True: 0, False: 31]
  ------------------
  788|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "XMP");
  789|     31|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(xmpPacket_.size() + 31), bigEndian);
  790|     31|        std::copy(xmpId_.begin(), xmpId_.end(), tmpBuf.begin() + 4);
  791|     31|        if (outIo.write(tmpBuf.data(), 33) != 33)
  ------------------
  |  Branch (791:13): [True: 0, False: 31]
  ------------------
  792|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  793|       |
  794|       |        // Write new XMP packet
  795|     31|        if (outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (795:13): [True: 0, False: 31]
  ------------------
  796|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  797|     31|        if (outIo.error())
  ------------------
  |  Branch (797:13): [True: 0, False: 31]
  ------------------
  798|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  799|     31|        --search;
  800|     31|      }
  801|       |
  802|    329|      if (iccProfileDefined()) {
  ------------------
  |  Branch (802:11): [True: 26, False: 303]
  ------------------
  803|     26|        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|     26|        tmpBuf[0] = 0xff;
  807|     26|        tmpBuf[1] = app2_;
  808|       |
  809|     26|        const size_t chunk_size = (256 * 256) - 40;  // leave bytes for marker, header and padding
  810|     26|        size_t size = iccProfile_.size();
  811|     26|        if (size >= 255 * chunk_size)
  ------------------
  |  Branch (811:13): [True: 0, False: 26]
  ------------------
  812|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "IccProfile");
  813|     26|        const size_t chunks = 1 + ((size - 1) / chunk_size);
  814|     80|        for (size_t chunk = 0; chunk < chunks; chunk++) {
  ------------------
  |  Branch (814:32): [True: 54, False: 26]
  ------------------
  815|     54|          auto bytes = std::min<size_t>(size, chunk_size);  // bytes to write
  816|     54|          size -= bytes;
  817|       |
  818|       |          // write JPEG marker (2 bytes)
  819|     54|          if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (819:15): [True: 0, False: 54]
  ------------------
  820|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Marker
  821|       |          // write length (2 bytes).  length includes the 2 bytes for the length
  822|     54|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(2 + 14 + bytes), bigEndian);
  823|     54|          if (outIo.write(tmpBuf.data() + 2, 2) != 2)
  ------------------
  |  Branch (823:15): [True: 0, False: 54]
  ------------------
  824|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Length
  825|       |
  826|       |          // write the ICC_PROFILE header (14 bytes)
  827|     54|          uint8_t pad[2];
  828|     54|          pad[0] = static_cast<uint8_t>(chunk + 1);
  829|     54|          pad[1] = static_cast<uint8_t>(chunks);
  830|     54|          outIo.write(reinterpret_cast<const byte*>(iccId_), 12);
  831|     54|          outIo.write(reinterpret_cast<const byte*>(pad), 2);
  832|     54|          if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes)
  ------------------
  |  Branch (832:15): [True: 0, False: 54]
  ------------------
  833|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  834|     54|          if (outIo.error())
  ------------------
  |  Branch (834:15): [True: 0, False: 54]
  ------------------
  835|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  836|     54|        }
  837|     26|        --search;
  838|     26|      }
  839|       |
  840|    329|      if (foundCompletePsData || !iptcData_.empty()) {
  ------------------
  |  Branch (840:11): [True: 50, False: 279]
  |  Branch (840:34): [True: 0, False: 279]
  ------------------
  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|     49|        DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
  844|     49|        const size_t maxChunkSize = 0xffff - 16;
  845|     49|        const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
  ------------------
  |  Branch (845:34): [True: 3, False: 46]
  ------------------
  846|     49|        const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);
  ------------------
  |  Branch (846:32): [True: 3, False: 46]
  ------------------
  847|    105|        while (chunkStart < chunkEnd) {
  ------------------
  |  Branch (847:16): [True: 56, False: 49]
  ------------------
  848|       |          // Determine size of next chunk
  849|     56|          size_t chunkSize = (chunkEnd + 1 - chunkStart);
  850|     56|          if (chunkSize > maxChunkSize) {
  ------------------
  |  Branch (850:15): [True: 15, False: 41]
  ------------------
  851|     15|            chunkSize = maxChunkSize;
  852|       |            // Don't break at a valid IRB boundary
  853|     15|            const auto writtenSize = chunkStart - newPsData.c_data();
  854|     15|            if (Photoshop::valid(newPsData.c_data(), writtenSize + chunkSize)) {
  ------------------
  |  Branch (854:17): [True: 0, False: 15]
  ------------------
  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|     15|          }
  860|       |
  861|       |          // Write APP13 marker, chunk size, and ps3Id
  862|     56|          std::array<byte, 18> tmpBuf;
  863|     56|          tmpBuf[0] = 0xff;
  864|     56|          tmpBuf[1] = app13_;
  865|     56|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(chunkSize + 16), bigEndian);
  866|     56|          std::copy_n(Photoshop::ps3Id_, 14, tmpBuf.begin() + 4);
  867|     56|          if (outIo.write(tmpBuf.data(), 18) != 18)
  ------------------
  |  Branch (867:15): [True: 0, False: 56]
  ------------------
  868|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  869|     56|          if (outIo.error())
  ------------------
  |  Branch (869:15): [True: 0, False: 56]
  ------------------
  870|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  871|       |
  872|       |          // Write next chunk of the Photoshop IRB data buffer
  873|     56|          if (outIo.write(chunkStart, chunkSize) != chunkSize)
  ------------------
  |  Branch (873:15): [True: 0, False: 56]
  ------------------
  874|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  875|     56|          if (outIo.error())
  ------------------
  |  Branch (875:15): [True: 0, False: 56]
  ------------------
  876|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  877|       |
  878|     56|          chunkStart += chunkSize;
  879|     56|        }
  880|     49|        --search;
  881|     49|      }
  882|    329|    }
  883|   766k|    if (comPos == count) {
  ------------------
  |  Branch (883:9): [True: 326, False: 765k]
  ------------------
  884|    326|      if (!comment_.empty()) {
  ------------------
  |  Branch (884:11): [True: 29, False: 297]
  ------------------
  885|     29|        std::array<byte, 4> tmpBuf;
  886|       |        // Write COM marker, size of comment, and string
  887|     29|        tmpBuf[0] = 0xff;
  888|     29|        tmpBuf[1] = com_;
  889|       |
  890|     29|        if (comment_.length() > 0xffff - 3)
  ------------------
  |  Branch (890:13): [True: 1, False: 28]
  ------------------
  891|      1|          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|    325|      --search;
  905|    325|    }
  906|   766k|    if (marker == eoi_) {
  ------------------
  |  Branch (906:9): [True: 212, False: 765k]
  ------------------
  907|    212|      break;
  908|    212|    }
  909|   765k|    if (skipApp1Exif == count || skipApp1Xmp == count ||
  ------------------
  |  Branch (909:9): [True: 101, False: 765k]
  |  Branch (909:9): [True: 15.8k, False: 749k]
  |  Branch (909:34): [True: 53, False: 765k]
  ------------------
  910|   765k|        std::find(skipApp13Ps3.begin(), skipApp13Ps3.end(), count) != skipApp13Ps3.end() ||
  ------------------
  |  Branch (910:9): [True: 12.6k, False: 752k]
  ------------------
  911|   752k|        std::find(skipApp2Icc.begin(), skipApp2Icc.end(), count) != skipApp2Icc.end() || skipCom == count) {
  ------------------
  |  Branch (911:9): [True: 2.95k, False: 750k]
  |  Branch (911:90): [True: 57, False: 749k]
  ------------------
  912|  15.8k|      --search;
  913|   749k|    } else {
  914|   749k|      std::array<byte, 2> tmpBuf;
  915|       |      // Write marker and a copy of the segment.
  916|   749k|      tmpBuf[0] = 0xff;
  917|   749k|      tmpBuf[1] = marker;
  918|   749k|      if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (918:11): [True: 0, False: 749k]
  ------------------
  919|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  920|   749k|      if (outIo.write(buf.c_data(), buf.size()) != buf.size())
  ------------------
  |  Branch (920:11): [True: 0, False: 749k]
  ------------------
  921|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  922|   749k|      if (outIo.error())
  ------------------
  |  Branch (922:11): [True: 0, False: 749k]
  ------------------
  923|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  924|   749k|    }
  925|       |
  926|       |    // Next marker
  927|   765k|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  928|   765k|    ++count;
  929|   765k|  }
  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|  1.01k|  io_->populateFakeData();
  934|       |
  935|       |  // Write the final marker, then copy rest of the Io.
  936|  1.01k|  byte tmpBuf[2];
  937|  1.01k|  tmpBuf[0] = 0xff;
  938|  1.01k|  tmpBuf[1] = marker;
  939|  1.01k|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (939:7): [True: 0, False: 1.01k]
  ------------------
  940|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  941|       |
  942|  1.01k|  DataBuf buf(4096);
  943|  1.01k|  size_t readSize = io_->read(buf.data(), buf.size());
  944|  1.42k|  while (readSize != 0) {
  ------------------
  |  Branch (944:10): [True: 405, False: 1.01k]
  ------------------
  945|    405|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (945:9): [True: 0, False: 405]
  ------------------
  946|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  947|    405|    readSize = io_->read(buf.data(), buf.size());
  948|    405|  }
  949|  1.01k|  if (outIo.error())
  ------------------
  |  Branch (949:7): [True: 0, False: 1.01k]
  ------------------
  950|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  951|       |
  952|  1.01k|}  // JpegBase::doWriteMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  971|  3.22k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  972|  3.22k|}
_ZNK5Exiv29JpegImage11writeHeaderERNS_7BasicIoE:
  978|  1.02k|int JpegImage::writeHeader(BasicIo& outIo) const {
  979|       |  // Jpeg header
  980|  1.02k|  byte tmpBuf[2];
  981|  1.02k|  tmpBuf[0] = 0xff;
  982|  1.02k|  tmpBuf[1] = soi_;
  983|  1.02k|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (983:7): [True: 0, False: 1.02k]
  ------------------
  984|      0|    return 4;
  985|  1.02k|  if (outIo.error())
  ------------------
  |  Branch (985:7): [True: 0, False: 1.02k]
  ------------------
  986|      0|    return 4;
  987|  1.02k|  return 0;
  988|  1.02k|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  990|  4.25k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  991|  4.25k|  return isJpegType(iIo, advance);
  992|  4.25k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  994|  2.72k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  995|  2.72k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  996|  2.72k|  if (!image->good()) {
  ------------------
  |  Branch (996:7): [True: 0, False: 2.72k]
  ------------------
  997|      0|    return nullptr;
  998|      0|  }
  999|  2.72k|  return image;
 1000|  2.72k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1002|  85.5k|bool isJpegType(BasicIo& iIo, bool advance) {
 1003|  85.5k|  bool result = true;
 1004|  85.5k|  byte tmpBuf[2];
 1005|  85.5k|  iIo.read(tmpBuf, 2);
 1006|  85.5k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1006:7): [True: 0, False: 85.5k]
  |  Branch (1006:22): [True: 102, False: 85.4k]
  ------------------
 1007|    102|    return false;
 1008|       |
 1009|  85.4k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1009:7): [True: 75.6k, False: 9.78k]
  |  Branch (1009:28): [True: 525, False: 9.25k]
  ------------------
 1010|  76.1k|    result = false;
 1011|  76.1k|  }
 1012|  85.4k|  if (!advance || !result)
  ------------------
  |  Branch (1012:7): [True: 81.1k, False: 4.25k]
  |  Branch (1012:19): [True: 445, False: 3.80k]
  ------------------
 1013|  81.6k|    iIo.seek(-2, BasicIo::cur);
 1014|  85.4k|  return result;
 1015|  85.5k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1018|    132|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1019|    132|}
_ZNK5Exiv28ExvImage11writeHeaderERNS_7BasicIoE:
 1025|      5|int ExvImage::writeHeader(BasicIo& outIo) const {
 1026|       |  // Exv header
 1027|      5|  auto tmpBuf = std::array<byte, 7>{0xff, 0x01};
 1028|      5|  std::copy_n(exiv2Id_, 5, tmpBuf.begin() + 2);
 1029|      5|  if (outIo.write(tmpBuf.data(), 7) != 7)
  ------------------
  |  Branch (1029:7): [True: 0, False: 5]
  ------------------
 1030|      0|    return 4;
 1031|      5|  if (outIo.error())
  ------------------
  |  Branch (1031:7): [True: 0, False: 5]
  ------------------
 1032|      0|    return 4;
 1033|      5|  return 0;
 1034|      5|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1036|    137|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1037|    137|  return isExvType(iIo, advance);
 1038|    137|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1040|    132|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1041|    132|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1042|    132|  if (!image->good())
  ------------------
  |  Branch (1042:7): [True: 0, False: 132]
  ------------------
 1043|      0|    return nullptr;
 1044|    132|  return image;
 1045|    132|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1047|  76.0k|bool isExvType(BasicIo& iIo, bool advance) {
 1048|  76.0k|  bool result = true;
 1049|  76.0k|  byte tmpBuf[7];
 1050|  76.0k|  iIo.read(tmpBuf, 7);
 1051|  76.0k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1051:7): [True: 0, False: 76.0k]
  |  Branch (1051:22): [True: 181, False: 75.9k]
  ------------------
 1052|    181|    return false;
 1053|       |
 1054|  75.9k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1054:7): [True: 75.2k, False: 659]
  |  Branch (1054:28): [True: 171, False: 488]
  |  Branch (1054:49): [True: 87, False: 401]
  ------------------
 1055|  75.5k|    result = false;
 1056|  75.5k|  }
 1057|  75.9k|  if (!advance || !result)
  ------------------
  |  Branch (1057:7): [True: 75.7k, False: 137]
  |  Branch (1057:19): [True: 0, False: 137]
  ------------------
 1058|  75.7k|    iIo.seek(-7, BasicIo::cur);
 1059|  75.9k|  return result;
 1060|  76.0k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  2.39M|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  2.39M|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  2.39M|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  2.39M|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 249k, False: 2.14M]
  ------------------
  107|   249k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|   249k|    size = getUShort(buf.data(), bigEndian);
  109|   249k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|   249k|  }
  111|  2.39M|  return {buf, size};
  112|  2.39M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  1.22M|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  1.22M|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 361, False: 1.22M]
  |  Branch (92:38): [True: 859, False: 1.22M]
  ------------------
   93|  1.22M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  2.45M|constexpr bool inRange(int lo, int value, int hi) {
   88|  2.45M|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 2.44M, False: 5.47k]
  |  Branch (88:25): [True: 1.22k, False: 2.44M]
  ------------------
   89|  2.45M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  2.39M|bool markerHasLength(byte m) {
   99|  2.39M|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 2.37M, False: 17.1k]
  |  Branch (99:44): [True: 2.14M, False: 232k]
  ------------------
  100|  2.39M|  return !markerWithoutLength;
  101|  2.39M|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.68k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.68k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  3.68k|std::string MatroskaVideo::mimeType() const {
  604|  3.68k|  return "video/matroska";
  605|  3.68k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  607|  1.95k|void MatroskaVideo::writeMetadata() {
  608|  1.95k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.68k|void MatroskaVideo::readMetadata() {
  611|  3.68k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.68k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.68k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.68k]
  ------------------
  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.68k|  IoCloser closer(*io_);
  622|  3.68k|  clearMetadata();
  623|  3.68k|  continueTraversing_ = true;
  624|  3.68k|  height_ = width_ = 1;
  625|       |
  626|  3.68k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.68k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|   133k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 129k, False: 3.68k]
  ------------------
  630|   129k|    decodeBlock();
  631|       |
  632|  3.68k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.68k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|   129k|void MatroskaVideo::decodeBlock() {
  636|   129k|  byte buf[8];
  637|   129k|  io_->read(buf, 1);
  638|       |
  639|   129k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 439, False: 129k]
  ------------------
  640|    439|    continueTraversing_ = false;
  641|    439|    return;
  642|    439|  }
  643|       |
  644|   129k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|   129k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 128k, False: 504]
  ------------------
  646|   128k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|   129k|  auto tag_id = returnTagValue(buf, block_size);
  649|   129k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|   129k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.95k, False: 127k]
  ------------------
  652|  1.95k|    continueTraversing_ = false;
  653|  1.95k|    return;
  654|  1.95k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|   127k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 594, False: 126k]
  |  Branch (658:27): [True: 1, False: 126k]
  ------------------
  659|      4|    continueTraversing_ = false;
  660|      4|    return;
  661|      4|  }
  662|       |
  663|   127k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|   127k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|   127k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 126k, False: 762]
  ------------------
  667|   126k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|   127k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|   127k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 76.2k, False: 51.0k]
  |  Branch (670:29): [True: 76.2k, False: 0]
  ------------------
  671|  76.2k|    return;
  672|       |
  673|  51.0k|  const size_t bufMaxSize = 200;
  674|       |
  675|  51.0k|#ifndef SUPPRESS_WARNINGS
  676|  51.0k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 49.2k, False: 1.76k]
  |  Branch (676:28): [True: 188, False: 49.0k]
  ------------------
  677|    188|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    188|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 188]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    188|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    188|  }
  680|  51.0k|#endif
  681|  51.0k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 1.76k, False: 49.2k]
  |  Branch (681:27): [True: 188, False: 49.0k]
  ------------------
  682|  1.18k|    io_->seek(size, BasicIo::cur);
  683|  1.18k|    return;
  684|  1.18k|  }
  685|       |
  686|  49.8k|  DataBuf buf2(bufMaxSize + 1);
  687|  49.8k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  49.8k|  switch (tag->_type) {
  689|  10.8k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 10.8k, False: 38.9k]
  ------------------
  690|  10.8k|      decodeInternalTags(tag, buf2.data());
  691|  10.8k|      break;
  692|  3.22k|    case String:
  ------------------
  |  Branch (692:5): [True: 3.22k, False: 46.5k]
  ------------------
  693|  3.22k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 49.8k]
  ------------------
  694|  3.22k|      decodeStringTags(tag, buf2.data());
  695|  3.22k|      break;
  696|  13.0k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 13.0k, False: 36.7k]
  ------------------
  697|  16.7k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 3.68k, False: 46.1k]
  ------------------
  698|  16.7k|      decodeIntegerTags(tag, buf2.data());
  699|  16.7k|      break;
  700|  14.5k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 14.5k, False: 35.2k]
  ------------------
  701|  14.5k|      decodeBooleanTags(tag, buf2.data());
  702|  14.5k|      break;
  703|  1.35k|    case Date:
  ------------------
  |  Branch (703:5): [True: 1.35k, False: 48.4k]
  ------------------
  704|  1.35k|      decodeDateTags(tag, buf2.data(), size);
  705|  1.35k|      break;
  706|  2.22k|    case Float:
  ------------------
  |  Branch (706:5): [True: 2.22k, False: 47.5k]
  ------------------
  707|  2.22k|      decodeFloatTags(tag, buf2.data());
  708|  2.22k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 49.8k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 49.8k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 49.8k]
  ------------------
  714|      0|      break;
  715|  49.8k|  }
  716|  49.8k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  10.8k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  10.8k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  10.8k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 331, False: 10.4k]
  ------------------
  721|    331|    return;
  722|       |
  723|  10.4k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  10.4k|    switch (tag->_id) {
  725|  10.4k|      case Xmp_video_VideoScanTpye:
  726|  10.4k|        return Exiv2::find(videoScanType, key);
  727|  10.4k|      case Xmp_audio_ChannelType:
  728|  10.4k|        return Exiv2::find(audioChannels, key);
  729|  10.4k|      case Xmp_video_ContentCompressAlgo:
  730|  10.4k|        return Exiv2::find(compressionAlgorithm, key);
  731|  10.4k|      case Xmp_video_ContentEncryptAlgo:
  732|  10.4k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  10.4k|      case Xmp_video_ContentSignAlgo_1:
  734|  10.4k|      case Xmp_video_ContentSignAlgo_2:
  735|  10.4k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  10.4k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  10.4k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  10.4k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  10.4k|      case Xmp_video_ContentEncodingType:
  740|  10.4k|        return Exiv2::find(encodingType, key);
  741|  10.4k|      case Xmp_video_DisplayUnit:
  742|  10.4k|        return Exiv2::find(displayUnit, key);
  743|  10.4k|      case Xmp_video_AspectRatioType:
  744|  10.4k|        return Exiv2::find(aspectRatioType, key);
  745|  10.4k|      case Xmp_video_PhysicalEquivalent:
  746|  10.4k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  10.4k|      case Xmp_video_TranslateCodec:
  748|  10.4k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  10.4k|      case Video_Audio_CodecID:
  750|  10.4k|        return Exiv2::find(trackCodec, key);
  751|  10.4k|      case Video_Audio_CodecName:
  752|  10.4k|        return Exiv2::find(codecInfo, key);
  753|  10.4k|      case CodecDownloadURL:
  754|  10.4k|      case CodecInfoURL:
  755|  10.4k|        return Exiv2::find(codecDownloadUrl, key);
  756|  10.4k|    }
  757|  10.4k|    return nullptr;
  758|  10.4k|  }();
  759|  10.4k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 2.98k, False: 7.51k]
  ------------------
  760|  2.98k|    xmpData_[tag->_label] = internalMt->_label;
  761|  7.51k|  } else {
  762|  7.51k|    xmpData_[tag->_label] = key;
  763|  7.51k|  }
  764|  10.4k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  3.22k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  3.22k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 753, False: 2.47k]
  ------------------
  768|    753|    track_count_++;
  769|    753|    xmpData_[tag->_label] = track_count_;
  770|  2.47k|  } else {
  771|  2.47k|    xmpData_[tag->_label] = buf;
  772|  2.47k|  }
  773|  3.22k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  16.7k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  16.7k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  16.7k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 14.2k, False: 2.47k]
  ------------------
  778|  14.2k|    return;
  779|       |
  780|  2.47k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 1.09k, False: 1.38k]
  |  Branch (780:40): [True: 317, False: 1.06k]
  ------------------
  781|  1.41k|    width_ = value;
  782|  2.47k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 498, False: 1.97k]
  |  Branch (782:41): [True: 315, False: 1.66k]
  ------------------
  783|    813|    height_ = value;
  784|  2.47k|  xmpData_[tag->_label] = value;
  785|  2.47k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  14.5k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  14.5k|  const MatroskaTag* internalMt = nullptr;
  789|  14.5k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  14.5k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 4.58k, False: 9.95k]
  ------------------
  791|  4.58k|    return;
  792|       |
  793|  9.95k|  switch (tag->_id) {
  794|  5.30k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 5.30k, False: 4.65k]
  ------------------
  795|  5.30k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 335, False: 4.96k]
  ------------------
  796|    335|        stream_ = f->_id;
  797|    335|      }
  798|  5.30k|      break;
  799|    599|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 599, False: 9.35k]
  ------------------
  800|    599|      internalMt = Exiv2::find(trackEnable, key);
  801|    599|      break;
  802|  1.07k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 1.07k, False: 8.88k]
  ------------------
  803|  1.07k|      internalMt = Exiv2::find(defaultOn, key);
  804|  1.07k|      break;
  805|    954|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 954, False: 8.99k]
  ------------------
  806|    954|      internalMt = Exiv2::find(trackForced, key);
  807|    954|      break;
  808|    470|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 470, False: 9.48k]
  ------------------
  809|    470|      internalMt = Exiv2::find(trackLacing, key);
  810|    470|      break;
  811|    781|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 781, False: 9.17k]
  ------------------
  812|    781|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|    781|      break;
  814|    740|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 740, False: 9.21k]
  ------------------
  815|    740|      internalMt = Exiv2::find(codecSettings, key);
  816|    740|      break;
  817|     36|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 36, False: 9.91k]
  ------------------
  818|     36|      internalMt = tag;
  819|     36|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 9.95k]
  ------------------
  821|      0|      break;
  822|  9.95k|  }
  823|       |
  824|  9.95k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.82k, False: 8.12k]
  ------------------
  825|  1.82k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.82k|  }
  827|  9.95k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  1.35k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  1.35k|  int64_t duration_in_ms = 0;
  831|  1.35k|  uint64_t value;
  832|  1.35k|  switch (tag->_id) {
  833|    873|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 873, False: 478]
  ------------------
  834|    873|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 458, False: 415]
  ------------------
  835|    458|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    458|      } else {
  837|    415|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    415|      }
  839|    873|      xmpData_[tag->_label] = duration_in_ms;
  840|    873|      break;
  841|    239|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 239, False: 1.11k]
  ------------------
  842|    239|      value = getULongLong(buf, bigEndian);
  843|    239|      if (!value)
  ------------------
  |  Branch (843:11): [True: 36, False: 203]
  ------------------
  844|     36|        return;
  845|    203|      duration_in_ms = value / 1000000000;
  846|    203|      xmpData_[tag->_label] = duration_in_ms;
  847|    203|      break;
  848|       |
  849|    239|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 239, False: 1.11k]
  ------------------
  850|    239|      value = getULongLong(buf, bigEndian);
  851|    239|      if (!value)
  ------------------
  |  Branch (851:11): [True: 23, False: 216]
  ------------------
  852|     23|        return;
  853|    216|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    216|      xmpData_[tag->_label] = time_code_scale_;
  855|    216|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 1.35k]
  ------------------
  857|      0|      break;
  858|  1.35k|  }
  859|  1.35k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  2.22k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  2.22k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  2.22k|  switch (tag->_id) {
  865|    904|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 904, False: 1.32k]
  ------------------
  866|    981|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 77, False: 2.14k]
  ------------------
  867|    981|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|    981|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 2.22k]
  ------------------
  870|  1.24k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 1.24k, False: 981]
  ------------------
  871|  1.24k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  1.24k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 61, False: 1.18k]
  ------------------
  873|     61|        return;
  874|  1.18k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 786, False: 398]
  ------------------
  875|    786|        double frame_rate = 0;
  876|    786|        switch (stream_) {
  877|    316|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 316, False: 470]
  ------------------
  878|    316|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|    316|            break;
  880|    139|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 139, False: 647]
  ------------------
  881|    139|            frame_rate = static_cast<double>(key) / 1000;
  882|    139|            break;
  883|    331|          default:
  ------------------
  |  Branch (883:11): [True: 331, False: 455]
  ------------------
  884|    331|            break;
  885|    786|        }
  886|    786|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 455, False: 331]
  ------------------
  887|    455|          xmpData_[internalMt->_label] = frame_rate;
  888|    786|      } else
  889|    398|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|  1.18k|    } break;
  891|  1.18k|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.22k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  2.22k|  }
  895|  2.22k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   255k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   255k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 217k, False: 38.7k]
  ------------------
  899|   217k|    return 1;
  900|  38.7k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 18.7k, False: 20.0k]
  ------------------
  901|  18.7k|    return 2;
  902|  20.0k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 5.48k, False: 14.5k]
  ------------------
  903|  5.48k|    return 3;
  904|  14.5k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 8.65k, False: 5.87k]
  ------------------
  905|  8.65k|    return 4;
  906|  5.87k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 2.22k, False: 3.64k]
  ------------------
  907|  2.22k|    return 5;
  908|  3.64k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 245, False: 3.40k]
  ------------------
  909|    245|    return 6;
  910|  3.40k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 440, False: 2.96k]
  ------------------
  911|    440|    return 7;
  912|  2.96k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.32k, False: 641]
  ------------------
  913|  2.32k|    return 8;
  914|    641|  return 0;
  915|  2.96k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.68k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.68k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.68k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.68k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.68k|  return image;
  923|  3.68k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  17.3k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  17.3k|  bool result = true;
  927|  17.3k|  byte tmpBuf[4];
  928|  17.3k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  17.3k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 17.3k]
  |  Branch (930:22): [True: 561, False: 16.8k]
  ------------------
  931|    561|    return false;
  932|       |
  933|  16.8k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 5.56k, False: 11.2k]
  |  Branch (933:28): [True: 69, False: 11.1k]
  |  Branch (933:49): [True: 72, False: 11.1k]
  |  Branch (933:70): [True: 67, False: 11.0k]
  ------------------
  934|  5.77k|    result = false;
  935|  5.77k|  }
  936|       |
  937|  16.8k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 16.8k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  16.8k|    iIo.seek(0, BasicIo::beg);
  939|  16.8k|  return result;
  940|  17.3k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   255k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   255k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 255k, False: 641]
  |  Branch (583:23): [True: 255k, False: 0]
  ------------------
  584|       |
  585|   255k|  size_t b0 = buf[0] & (0xff >> size);
  586|   255k|  size_t tag = b0 << ((size - 1) * 8);
  587|   340k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 84.3k, False: 255k]
  ------------------
  588|  84.3k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  84.3k|  }
  590|       |
  591|   255k|  return tag;
  592|   255k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  10.4k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  10.4k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 10.4k, False: 0]
  ------------------
  725|    681|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 681, False: 9.81k]
  ------------------
  726|    681|        return Exiv2::find(videoScanType, key);
  727|    979|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 979, False: 9.51k]
  ------------------
  728|    979|        return Exiv2::find(audioChannels, key);
  729|    369|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 369, False: 10.1k]
  ------------------
  730|    369|        return Exiv2::find(compressionAlgorithm, key);
  731|    829|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 829, False: 9.66k]
  ------------------
  732|    829|        return Exiv2::find(encryptionAlgorithm, key);
  733|    111|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 111, False: 10.3k]
  ------------------
  734|    962|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 851, False: 9.64k]
  ------------------
  735|    962|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|     73|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 73, False: 10.4k]
  ------------------
  737|    601|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 528, False: 9.96k]
  ------------------
  738|    601|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    810|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 810, False: 9.68k]
  ------------------
  740|    810|        return Exiv2::find(encodingType, key);
  741|    956|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 956, False: 9.53k]
  ------------------
  742|    956|        return Exiv2::find(displayUnit, key);
  743|    637|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 637, False: 9.85k]
  ------------------
  744|    637|        return Exiv2::find(aspectRatioType, key);
  745|  3.21k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 3.21k, False: 7.27k]
  ------------------
  746|  3.21k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    144|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 144, False: 10.3k]
  ------------------
  748|    144|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 10.4k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    148|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 148, False: 10.3k]
  ------------------
  752|    148|        return Exiv2::find(codecInfo, key);
  753|      0|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 0, False: 10.4k]
  ------------------
  754|    162|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 162, False: 10.3k]
  ------------------
  755|    162|        return Exiv2::find(codecDownloadUrl, key);
  756|  10.4k|    }
  757|      0|    return nullptr;
  758|  10.4k|  }();

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

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

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

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

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|   138k|  static constexpr auto tagList() {
   34|   138k|    return tagInfo_;
   35|   138k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  87.9k|  static constexpr auto tagListCs() {
   38|  87.9k|    return tagInfoCs_;
   39|  87.9k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    469|  static constexpr auto tagListEq() {
   42|    469|    return tagInfoEq_;
   43|    469|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|  2.76k|  static constexpr auto tagListRd() {
   46|  2.76k|    return tagInfoRd_;
   47|  2.76k|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    497|  static constexpr auto tagListRd2() {
   50|    497|    return tagInfoRd2_;
   51|    497|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    738|  static constexpr auto tagListIp() {
   54|    738|    return tagInfoIp_;
   55|    738|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    683|  static constexpr auto tagListFi() {
   58|    683|    return tagInfoFi_;
   59|    683|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|  3.14k|  static constexpr auto tagListFe() {
   62|  3.14k|    return tagInfoFe_;
   63|  3.14k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    626|  static constexpr auto tagListRi() {
   66|    626|    return tagInfoRi_;
   67|    626|  }

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

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

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

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

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

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

_ZN5Exiv28Internal8PngChunk15decodeIHDRChunkERKNS_7DataBufEPjS5_:
   45|     69|void PngChunk::decodeIHDRChunk(const DataBuf& data, uint32_t* outWidth, uint32_t* outHeight) {
   46|       |  // Extract image width and height from IHDR chunk.
   47|     69|  *outWidth = data.read_uint32(0, bigEndian);
   48|     69|  *outHeight = data.read_uint32(4, bigEndian);
   49|     69|}
_ZN5Exiv28Internal8PngChunk14decodeTXTChunkEPNS_5ImageERKNS_7DataBufENS1_12TxtChunkTypeERKNS_12DecodeParamsE:
   51|  14.2k|void PngChunk::decodeTXTChunk(Image* pImage, const DataBuf& data, TxtChunkType type, const DecodeParams& dp) {
   52|  14.2k|  DataBuf key = keyTXTChunk(data);
   53|  14.2k|  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|  14.2k|  if (!key.empty())
  ------------------
  |  Branch (58:7): [True: 12.5k, False: 1.69k]
  ------------------
   59|  12.5k|    parseChunkContent(pImage, key.c_data(), key.size(), arr, dp);
   60|  14.2k|}
_ZN5Exiv28Internal8PngChunk11keyTXTChunkERKNS_7DataBufEb:
   71|  19.4k|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|  19.4k|  const size_t offset = stripHeader ? 8ul : 0ul;
  ------------------
  |  Branch (73:25): [True: 5.20k, False: 14.2k]
  ------------------
   74|  19.4k|  if (data.size() <= offset)
  ------------------
  |  Branch (74:7): [True: 74, False: 19.3k]
  ------------------
   75|     74|    throw Error(ErrorCode::kerFailedToReadImageData);
   76|       |
   77|  19.3k|  auto it = std::find(data.begin() + offset, data.end(), 0);
   78|  19.3k|  if (it == data.end())
  ------------------
  |  Branch (78:7): [True: 76, False: 19.2k]
  ------------------
   79|     76|    throw Error(ErrorCode::kerFailedToReadImageData);
   80|       |
   81|  19.2k|  return {data.c_data() + offset, std::distance(data.begin(), it) - offset};
   82|  19.3k|}
_ZN5Exiv28Internal8PngChunk13parseTXTChunkERKNS_7DataBufEmNS1_12TxtChunkTypeE:
   84|  14.0k|DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkType type) {
   85|  14.0k|  DataBuf arr;
   86|       |
   87|  14.0k|  if (type == zTXt_Chunk) {
  ------------------
  |  Branch (87:7): [True: 544, False: 13.5k]
  ------------------
   88|    544|    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|    544|    if (*data.c_data(keysize + 1) != 0x00) {
  ------------------
  |  Branch (93:9): [True: 79, False: 465]
  ------------------
   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|     79|      throw Error(ErrorCode::kerFailedToReadImageData);
   99|     79|    }
  100|       |
  101|       |    // compressed string after the compression technique spec
  102|    465|    size_t compressedTextSize = data.size() - keysize - nullSeparators;
  103|    465|    if (compressedTextSize) {
  ------------------
  |  Branch (103:9): [True: 294, False: 171]
  ------------------
  104|    294|      const byte* compressedText = data.c_data(keysize + nullSeparators);
  105|    294|      enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
  106|       |
  107|    294|      zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
  108|    294|    }
  109|  13.5k|  } else if (type == tEXt_Chunk) {
  ------------------
  |  Branch (109:14): [True: 7.49k, False: 6.03k]
  ------------------
  110|  7.49k|    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|  7.49k|    size_t textsize = data.size() - keysize - 1;
  115|  7.49k|    if (textsize) {
  ------------------
  |  Branch (115:9): [True: 4.98k, False: 2.51k]
  ------------------
  116|  4.98k|      const byte* text = data.c_data(keysize + 1);
  117|       |
  118|  4.98k|      arr = DataBuf(text, textsize);
  119|  4.98k|    }
  120|  7.49k|  } else if (type == iTXt_Chunk) {
  ------------------
  |  Branch (120:14): [True: 6.03k, False: 0]
  ------------------
  121|  6.03k|    enforce(data.size() > Safe::add(keysize, std::size_t{3}), ErrorCode::kerCorruptedMetadata);
  122|  6.03k|    const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
  123|  6.03k|    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|  6.03k|    const byte compressionFlag = data.read_uint8(keysize + 1);
  129|       |    // we get the compression method after the compression flag
  130|  6.03k|    const byte compressionMethod = data.read_uint8(keysize + 2);
  131|       |
  132|  6.03k|    enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (132:13): [True: 5.47k, False: 566]
  |  Branch (132:40): [True: 369, False: 197]
  ------------------
  133|  6.03k|    if (compressionFlag == 0x01)
  ------------------
  |  Branch (133:9): [True: 369, False: 5.66k]
  ------------------
  134|    369|      enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
  135|       |
  136|       |    // language description string after the compression technique spec
  137|  6.03k|    const size_t languageTextMaxSize = data.size() - keysize - 3;
  138|  6.03k|    std::string languageText = string_from_unterminated(data.c_str(keysize + 3), languageTextMaxSize);
  139|  6.03k|    const size_t languageTextSize = languageText.size();
  140|       |
  141|  6.03k|    enforce(data.size() >= Safe::add(Safe::add(keysize, std::size_t{4}), languageTextSize),
  142|  6.03k|            ErrorCode::kerCorruptedMetadata);
  143|       |    // translated keyword string after the language description
  144|  6.03k|    std::string translatedKeyText = string_from_unterminated(data.c_str(keysize + 3 + languageTextSize + 1),
  145|  6.03k|                                                             data.size() - (keysize + 3 + languageTextSize + 1));
  146|  6.03k|    const size_t translatedKeyTextSize = translatedKeyText.size();
  147|       |
  148|  6.03k|    enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, size_t{1})) <= data.size(),
  149|  6.03k|            ErrorCode::kerCorruptedMetadata);
  150|       |
  151|  6.03k|    const auto textsize =
  152|  6.03k|        static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
  153|  6.03k|    if (textsize) {
  ------------------
  |  Branch (153:9): [True: 5.50k, False: 535]
  ------------------
  154|  5.50k|      const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
  155|       |
  156|  5.50k|      if (compressionFlag == 0x00) {
  ------------------
  |  Branch (156:11): [True: 5.21k, False: 291]
  ------------------
  157|       |        // then it's an uncompressed iTXt chunk
  158|       |#ifdef EXIV2_DEBUG_MESSAGES
  159|       |        std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
  160|       |#endif
  161|  5.21k|        arr = DataBuf(text, textsize);
  162|  5.21k|      } 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|    291|        zlibUncompress(text, textsize, arr);
  170|    291|      }
  171|  5.50k|    }
  172|  6.03k|  } 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|  14.0k|  return arr;
  180|  14.0k|}
_ZN5Exiv28Internal8PngChunk17parseChunkContentEPNS_5ImageEPKhmRKNS_7DataBufERKNS_12DecodeParamsE:
  183|  12.5k|                                 const DecodeParams& dp) {
  184|       |  // We look if an ImageMagick EXIF raw profile exist.
  185|       |
  186|  12.5k|  if (keySize >= 21 &&
  ------------------
  |  Branch (186:7): [True: 4.37k, False: 8.15k]
  ------------------
  187|  4.37k|      (memcmp("Raw profile type exif", key, 21) == 0 || memcmp("Raw profile type APP1", key, 21) == 0) &&
  ------------------
  |  Branch (187:8): [True: 22, False: 4.35k]
  |  Branch (187:57): [True: 964, False: 3.39k]
  ------------------
  188|    986|      pImage->exifData().empty()) {
  ------------------
  |  Branch (188:7): [True: 976, False: 10]
  ------------------
  189|    976|    DataBuf exifData = readRawProfile(arr, false);
  190|    976|    size_t length = exifData.size();
  191|       |
  192|    976|    if (length >= 4) {  // length should have at least the size of TIFF header
  ------------------
  |  Branch (192:9): [True: 715, False: 261]
  ------------------
  193|       |      // Find the position of TIFF header in bytes array.
  194|       |      // Forgives the absence of the expected Exif\0 APP1 prefix.
  195|    715|      const std::array<byte, 4> tiffHeaderLE{0x49, 0x49, 0x2A, 0x00};  // "II*\0"
  196|    715|      const std::array<byte, 4> tiffHeaderBE{0x4D, 0x4D, 0x00, 0x2A};  // "MM\0*"
  197|    715|      size_t pos = std::numeric_limits<size_t>::max();
  198|       |
  199|       |      /// \todo Find substring inside an string
  200|  1.11k|      for (size_t i = 0; i < length - tiffHeaderLE.size(); i++) {
  ------------------
  |  Branch (200:26): [True: 396, False: 715]
  ------------------
  201|    396|        if (0 == exifData.cmpBytes(i, tiffHeaderLE.data(), tiffHeaderLE.size()) ||
  ------------------
  |  Branch (201:13): [True: 0, False: 396]
  ------------------
  202|    396|            0 == exifData.cmpBytes(i, tiffHeaderBE.data(), tiffHeaderBE.size())) {
  ------------------
  |  Branch (202:13): [True: 0, False: 396]
  ------------------
  203|      0|          pos = i;
  204|      0|          break;
  205|      0|        }
  206|    396|      }
  207|       |
  208|       |      // If found it, store only these data at from this place.
  209|       |
  210|    715|      if (pos != std::numeric_limits<size_t>::max()) {
  ------------------
  |  Branch (210:11): [True: 0, False: 715]
  ------------------
  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|    715|      } else {
  218|    715|#ifndef SUPPRESS_WARNINGS
  219|    715|        EXV_WARNING << "Failed to decode Exif metadata.\n";
  ------------------
  |  |  138|    715|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 715]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    715|  LogMsg(LogMsg::warn).os()
  ------------------
  220|    715|#endif
  221|    715|        pImage->exifData().clear();
  222|    715|      }
  223|    715|    }
  224|    976|  }
  225|       |
  226|       |  // We look if an ImageMagick IPTC raw profile exist.
  227|       |
  228|  12.5k|  if (keySize >= 21 && memcmp("Raw profile type iptc", key, 21) == 0 && pImage->iptcData().empty()) {
  ------------------
  |  Branch (228:7): [True: 4.36k, False: 8.17k]
  |  Branch (228:24): [True: 1.82k, False: 2.53k]
  |  Branch (228:73): [True: 1.79k, False: 28]
  ------------------
  229|  1.79k|    DataBuf psData = readRawProfile(arr, false);
  230|  1.79k|    if (!psData.empty()) {
  ------------------
  |  Branch (230:9): [True: 93, False: 1.70k]
  ------------------
  231|     93|      Blob iptcBlob;
  232|     93|      const byte* record = nullptr;
  233|     93|      uint32_t sizeIptc = 0;
  234|     93|      uint32_t sizeHdr = 0;
  235|       |
  236|     93|      const byte* pEnd = psData.c_data(psData.size() - 1);
  237|     93|      const byte* pCur = psData.c_data();
  238|     93|      while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (238:14): [True: 54, False: 39]
  |  Branch (238:29): [True: 0, False: 54]
  ------------------
  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|     93|      if (!iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (248:11): [True: 0, False: 93]
  |  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|     93|      if (iptcBlob.empty() && IptcParser::decode(pImage->iptcData(), psData.c_data(), psData.size())) {
  ------------------
  |  Branch (255:11): [True: 93, False: 0]
  |  Branch (255:31): [True: 11, False: 82]
  ------------------
  256|     11|#ifndef SUPPRESS_WARNINGS
  257|     11|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     11|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 11]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     11|  LogMsg(LogMsg::warn).os()
  ------------------
  258|     11|#endif
  259|     11|        pImage->clearIptcData();
  260|     11|      }
  261|     93|    }  // if (psData.size() > 0)
  262|  1.79k|  }
  263|       |
  264|       |  // We look if an ImageMagick XMP raw profile exist.
  265|       |
  266|  12.5k|  if (keySize >= 20 && memcmp("Raw profile type xmp", key, 20) == 0 && pImage->xmpData().empty()) {
  ------------------
  |  Branch (266:7): [True: 5.03k, False: 7.49k]
  |  Branch (266:24): [True: 890, False: 4.14k]
  |  Branch (266:72): [True: 879, False: 11]
  ------------------
  267|    879|    DataBuf xmpBuf = readRawProfile(arr, false);
  268|    879|    size_t length = xmpBuf.size();
  269|       |
  270|    879|    if (length > 0) {
  ------------------
  |  Branch (270:9): [True: 127, False: 752]
  ------------------
  271|    127|      std::string& xmpPacket = pImage->xmpPacket();
  272|    127|      xmpPacket.assign(xmpBuf.c_str(), length);
  273|    127|      if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (273:52): [True: 115, False: 12]
  |  Branch (273:80): [True: 81, False: 34]
  ------------------
  274|     81|#ifndef SUPPRESS_WARNINGS
  275|     81|        EXV_WARNING << "Removing " << idx << " characters from the beginning of the XMP packet\n";
  ------------------
  |  |  138|     81|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 81]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     81|  LogMsg(LogMsg::warn).os()
  ------------------
  276|     81|#endif
  277|     81|        xmpPacket = xmpPacket.substr(idx);
  278|     81|      }
  279|    127|      if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (279:11): [True: 127, False: 0]
  ------------------
  280|    127|#ifndef SUPPRESS_WARNINGS
  281|    127|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    127|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 127]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    127|  LogMsg(LogMsg::warn).os()
  ------------------
  282|    127|#endif
  283|    127|      }
  284|    127|    }
  285|    879|  }
  286|       |
  287|       |  // We look if an Adobe XMP string exist.
  288|       |
  289|  12.5k|  if (keySize >= 17 && memcmp("XML:com.adobe.xmp", key, 17) == 0 && pImage->xmpData().empty() && !arr.empty()) {
  ------------------
  |  Branch (289:7): [True: 9.19k, False: 3.34k]
  |  Branch (289:24): [True: 1.23k, False: 7.96k]
  |  Branch (289:69): [True: 1.16k, False: 71]
  |  Branch (289:98): [True: 487, False: 675]
  ------------------
  290|    487|    std::string& xmpPacket = pImage->xmpPacket();
  291|    487|    xmpPacket.assign(arr.c_str(), arr.size());
  292|    487|    if (auto idx = xmpPacket.find_first_of('<'); idx != std::string::npos && idx > 0) {
  ------------------
  |  Branch (292:50): [True: 327, False: 160]
  |  Branch (292:78): [True: 245, False: 82]
  ------------------
  293|    245|#ifndef SUPPRESS_WARNINGS
  294|    245|      EXV_WARNING << "Removing " << idx << " characters "
  ------------------
  |  |  138|    245|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 245]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    245|  LogMsg(LogMsg::warn).os()
  ------------------
  295|      0|                  << "from the beginning of the XMP packet\n";
  296|    245|#endif
  297|    245|      xmpPacket = xmpPacket.substr(idx);
  298|    245|    }
  299|    487|    if (XmpParser::decode(pImage->xmpData(), xmpPacket, dp)) {
  ------------------
  |  Branch (299:9): [True: 443, False: 44]
  ------------------
  300|    443|#ifndef SUPPRESS_WARNINGS
  301|    443|      EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    443|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 443]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    443|  LogMsg(LogMsg::warn).os()
  ------------------
  302|    443|#endif
  303|    443|    }
  304|    487|  }
  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.5k|  if (keySize >= 11 && memcmp("Description", key, 11) == 0 && pImage->comment().empty()) {
  ------------------
  |  Branch (309:7): [True: 9.88k, False: 2.65k]
  |  Branch (309:7): [True: 193, False: 12.3k]
  |  Branch (309:24): [True: 1.10k, False: 8.78k]
  |  Branch (309:63): [True: 193, False: 909]
  ------------------
  310|    193|    pImage->setComment(std::string(arr.c_str(), arr.size()));
  311|    193|  }
  312|       |
  313|  12.5k|}  // PngChunk::parseChunkContent
_ZN5Exiv28Internal8PngChunk17makeMetadataChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_10MetadataIdE:
  315|  4.85k|std::string PngChunk::makeMetadataChunk(std::string_view metadata, MetadataId type) {
  316|  4.85k|  std::string rawProfile;
  317|       |
  318|  4.85k|  switch (type) {
  ------------------
  |  Branch (318:11): [True: 4.85k, False: 0]
  ------------------
  319|  2.00k|    case mdComment:
  ------------------
  |  Branch (319:5): [True: 2.00k, False: 2.84k]
  ------------------
  320|  2.00k|      return makeUtf8TxtChunk("Description", metadata, true);
  321|    550|    case mdIptc:
  ------------------
  |  Branch (321:5): [True: 550, False: 4.30k]
  ------------------
  322|    550|      rawProfile = writeRawProfile(metadata, "iptc");
  323|    550|      return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
  324|  2.29k|    case mdXmp:
  ------------------
  |  Branch (324:5): [True: 2.29k, False: 2.55k]
  ------------------
  325|  2.29k|      return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
  326|      0|    case mdExif:
  ------------------
  |  Branch (326:5): [True: 0, False: 4.85k]
  ------------------
  327|      0|    case mdIccProfile:
  ------------------
  |  Branch (327:5): [True: 0, False: 4.85k]
  ------------------
  328|      0|    case mdNone:
  ------------------
  |  Branch (328:5): [True: 0, False: 4.85k]
  ------------------
  329|      0|      return {};
  330|  4.85k|  }
  331|       |
  332|      0|  return {};
  333|       |
  334|  4.85k|}  // PngChunk::makeMetadataChunk
_ZN5Exiv28Internal8PngChunk14zlibUncompressEPKhjRNS_7DataBufE:
  336|    585|void PngChunk::zlibUncompress(const byte* compressedText, unsigned int compressedTextSize, DataBuf& arr) {
  337|    585|  uLongf uncompressedLen = compressedTextSize * 2;  // just a starting point
  338|    585|  int zlibResult = Z_BUF_ERROR;
  339|    585|  int dos = 0;
  340|       |
  341|  1.49k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (341:10): [True: 1.24k, False: 246]
  ------------------
  342|  1.24k|    arr.alloc(uncompressedLen);
  343|  1.24k|    zlibResult = uncompress(arr.data(), &uncompressedLen, compressedText, compressedTextSize);
  344|  1.24k|    if (zlibResult == Z_OK) {
  ------------------
  |  Branch (344:9): [True: 246, False: 1.00k]
  ------------------
  345|    246|      arr.resize(uncompressedLen);
  346|  1.00k|    } else if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (346:16): [True: 664, False: 338]
  ------------------
  347|       |      // the uncompressedArray needs to be larger
  348|    664|      uncompressedLen *= 2;
  349|       |      // DoS protection. can't be bigger than 64k
  350|    664|      if (uncompressedLen > 131072) {
  ------------------
  |  Branch (350:11): [True: 2, False: 662]
  ------------------
  351|      2|        if (++dos > 1)
  ------------------
  |  Branch (351:13): [True: 1, False: 1]
  ------------------
  352|      1|          break;
  353|      1|        uncompressedLen = 131072;
  354|      1|      }
  355|    664|    } else {
  356|       |      // something bad happened
  357|    338|      throw Error(ErrorCode::kerFailedToReadImageData);
  358|    338|    }
  359|  1.24k|  }
  360|       |
  361|    247|  if (zlibResult != Z_OK) {
  ------------------
  |  Branch (361:7): [True: 1, False: 246]
  ------------------
  362|      1|    throw Error(ErrorCode::kerFailedToReadImageData);
  363|      1|  }
  364|    247|}  // PngChunk::zlibUncompress
_ZN5Exiv28Internal8PngChunk12zlibCompressENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  366|  2.55k|std::string PngChunk::zlibCompress(std::string_view text) {
  367|  2.55k|  auto compressedLen = static_cast<uLongf>(text.size() * 2);  // just a starting point
  368|  2.55k|  int zlibResult = Z_BUF_ERROR;
  369|       |
  370|  2.55k|  DataBuf arr;
  371|  5.50k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (371:10): [True: 2.94k, False: 2.55k]
  ------------------
  372|  2.94k|    arr.resize(compressedLen);
  373|  2.94k|    zlibResult = compress2(arr.data(), &compressedLen, reinterpret_cast<const Bytef*>(text.data()),
  374|  2.94k|                           static_cast<uLong>(text.size()), Z_BEST_COMPRESSION);
  375|       |
  376|  2.94k|    switch (zlibResult) {
  377|  2.55k|      case Z_OK:
  ------------------
  |  Branch (377:7): [True: 2.55k, False: 387]
  ------------------
  378|  2.55k|        arr.resize(compressedLen);
  379|  2.55k|        break;
  380|    387|      case Z_BUF_ERROR:
  ------------------
  |  Branch (380:7): [True: 387, False: 2.55k]
  ------------------
  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|    387|        compressedLen *= 2;
  386|       |        // DoS protection. Cap max compressed size
  387|    387|        if (compressedLen > 131072)
  ------------------
  |  Branch (387:13): [True: 0, False: 387]
  ------------------
  388|      0|          throw Error(ErrorCode::kerFailedToReadImageData);
  389|    387|        break;
  390|    387|      default:
  ------------------
  |  Branch (390:7): [True: 0, False: 2.94k]
  ------------------
  391|       |        // Something bad happened
  392|      0|        throw Error(ErrorCode::kerFailedToReadImageData);
  393|  2.94k|    }
  394|  2.94k|  }
  395|       |
  396|  2.55k|  return {arr.c_str(), arr.size()};
  397|       |
  398|  2.55k|}  // PngChunk::zlibCompress
_ZN5Exiv28Internal8PngChunk17makeAsciiTxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  400|    550|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|    550|  auto chunkData = std::string(keyword) + '\0';
  413|    550|  std::string chunkType;
  414|    550|  if (compress) {
  ------------------
  |  Branch (414:7): [True: 550, False: 0]
  ------------------
  415|    550|    chunkData += '\0' + zlibCompress(text);
  416|    550|    chunkType = "zTXt";
  417|    550|  } else {
  418|      0|    chunkData += text;
  419|      0|    chunkType = "tEXt";
  420|      0|  }
  421|       |  // Determine length of the chunk data
  422|    550|  byte length[4];
  423|    550|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  424|       |  // Calculate CRC on chunk type and chunk data
  425|    550|  std::string crcData = chunkType + chunkData;
  426|    550|  uLong tmp = crc32(0L, Z_NULL, 0);
  427|    550|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  428|    550|  byte crc[4];
  429|    550|  ul2Data(crc, tmp, bigEndian);
  430|       |  // Assemble the chunk
  431|    550|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  432|    550|         std::string(reinterpret_cast<const char*>(crc), 4);
  433|       |
  434|    550|}  // PngChunk::makeAsciiTxtChunk
_ZN5Exiv28Internal8PngChunk16makeUtf8TxtChunkENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEES6_b:
  436|  4.30k|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|  4.30k|  auto chunkData = std::string(keyword);
  447|  4.30k|  if (compress) {
  ------------------
  |  Branch (447:7): [True: 2.00k, False: 2.29k]
  ------------------
  448|  2.00k|    static const char flags[] = {0x00, 0x01, 0x00, 0x00, 0x00};
  449|  2.00k|    chunkData += std::string(flags, 5) + zlibCompress(text);
  450|  2.29k|  } else {
  451|  2.29k|    static const char flags[] = {0x00, 0x00, 0x00, 0x00, 0x00};
  452|  2.29k|    chunkData += std::string(flags, 5);
  453|  2.29k|    chunkData += text;
  454|  2.29k|  }
  455|       |  // Determine length of the chunk data
  456|  4.30k|  byte length[4];
  457|  4.30k|  ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
  458|       |  // Calculate CRC on chunk type and chunk data
  459|  4.30k|  std::string chunkType = "iTXt";
  460|  4.30k|  std::string crcData = chunkType + chunkData;
  461|  4.30k|  uLong tmp = crc32(0L, Z_NULL, 0);
  462|  4.30k|  tmp = crc32(tmp, reinterpret_cast<const Bytef*>(crcData.data()), static_cast<uInt>(crcData.size()));
  463|  4.30k|  byte crc[4];
  464|  4.30k|  ul2Data(crc, tmp, bigEndian);
  465|       |  // Assemble the chunk
  466|  4.30k|  return std::string(reinterpret_cast<const char*>(length), 4) + chunkType + chunkData +
  467|  4.30k|         std::string(reinterpret_cast<const char*>(crc), 4);
  468|       |
  469|  4.30k|}  // PngChunk::makeUtf8TxtChunk
_ZN5Exiv28Internal8PngChunk14readRawProfileERKNS_7DataBufEb:
  471|  3.65k|DataBuf PngChunk::readRawProfile(const DataBuf& text, bool iTXt) {
  472|  3.65k|  DataBuf info;
  473|  3.65k|  if (text.size() <= 1) {
  ------------------
  |  Branch (473:7): [True: 211, False: 3.44k]
  ------------------
  474|    211|    return info;
  475|    211|  }
  476|       |
  477|  3.44k|  const unsigned char unhex[103] = {
  478|  3.44k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  479|  3.44k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 0,
  480|  3.44k|      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15,
  481|  3.44k|  };
  482|       |
  483|  3.44k|  if (iTXt) {
  ------------------
  |  Branch (483:7): [True: 0, False: 3.44k]
  ------------------
  484|      0|    info.alloc(text.size());
  485|      0|    std::copy(text.begin(), text.end(), info.begin());
  486|      0|    return info;
  487|      0|  }
  488|       |
  489|  3.44k|  const char* sp = text.c_str(1);                 // current byte (space pointer)
  490|  3.44k|  const char* eot = text.c_str(text.size() - 1);  // end of text
  491|       |
  492|  3.44k|  if (sp >= eot) {
  ------------------
  |  Branch (492:7): [True: 28, False: 3.41k]
  ------------------
  493|     28|    return info;
  494|     28|  }
  495|       |
  496|       |  // Look for newline
  497|  26.5k|  while (*sp != '\n') {
  ------------------
  |  Branch (497:10): [True: 23.6k, False: 2.80k]
  ------------------
  498|  23.6k|    sp++;
  499|  23.6k|    if (sp == eot) {
  ------------------
  |  Branch (499:9): [True: 604, False: 23.0k]
  ------------------
  500|    604|      return info;
  501|    604|    }
  502|  23.6k|  }
  503|  2.80k|  sp++;  // step over '\n'
  504|  2.80k|  if (sp == eot) {
  ------------------
  |  Branch (504:7): [True: 45, False: 2.76k]
  ------------------
  505|     45|    return info;
  506|     45|  }
  507|       |
  508|       |  // Look for length
  509|  9.45k|  while (*sp == '\0' || *sp == ' ' || *sp == '\n') {
  ------------------
  |  Branch (509:10): [True: 3.86k, False: 5.59k]
  |  Branch (509:25): [True: 2.21k, False: 3.37k]
  |  Branch (509:39): [True: 638, False: 2.73k]
  ------------------
  510|  6.71k|    sp++;
  511|  6.71k|    if (sp == eot) {
  ------------------
  |  Branch (511:9): [True: 25, False: 6.68k]
  ------------------
  512|     25|      return info;
  513|     25|    }
  514|  6.71k|  }
  515|       |
  516|       |  // Parse the length.
  517|  2.73k|  size_t length = 0;
  518|  5.58k|  while ('0' <= *sp && *sp <= '9') {
  ------------------
  |  Branch (518:10): [True: 4.46k, False: 1.11k]
  |  Branch (518:24): [True: 2.86k, False: 1.60k]
  ------------------
  519|       |    // Compute the new length using unsigned long, so that we can check for overflow.
  520|  2.86k|    const size_t newlength = (10 * length) + (*sp - '0');
  521|  2.86k|    length = newlength;
  522|  2.86k|    sp++;
  523|  2.86k|    if (sp == eot) {
  ------------------
  |  Branch (523:9): [True: 19, False: 2.84k]
  ------------------
  524|     19|      return info;
  525|     19|    }
  526|  2.86k|  }
  527|  2.72k|  sp++;  // step over '\n'
  528|  2.72k|  if (sp == eot) {
  ------------------
  |  Branch (528:7): [True: 644, False: 2.07k]
  ------------------
  529|    644|    return info;
  530|    644|  }
  531|       |
  532|  2.07k|  enforce(length <= static_cast<size_t>(eot - sp) / 2, Exiv2::ErrorCode::kerCorruptedMetadata);
  533|       |
  534|       |  // Allocate space
  535|  2.07k|  if (length == 0) {
  ------------------
  |  Branch (535:7): [True: 919, False: 1.15k]
  ------------------
  536|       |#ifdef EXIV2_DEBUG_MESSAGES
  537|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: invalid profile length\n";
  538|       |#endif
  539|    919|  }
  540|  2.07k|  info.alloc(length);
  541|  2.07k|  if (info.size() != length) {
  ------------------
  |  Branch (541:7): [True: 0, False: 2.07k]
  ------------------
  542|       |#ifdef EXIV2_DEBUG_MESSAGES
  543|       |    std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: cannot allocate memory\n";
  544|       |#endif
  545|      0|    return info;
  546|      0|  }
  547|       |
  548|  2.07k|  if (info.empty())  // Early return
  ------------------
  |  Branch (548:7): [True: 919, False: 1.15k]
  ------------------
  549|    919|    return info;
  550|       |
  551|       |  // Copy profile, skipping white space and column 1 "=" signs
  552|  1.15k|  unsigned char* dp = info.data();  // decode pointer
  553|  1.15k|  size_t nibbles = length * 2;
  554|       |
  555|  14.1k|  for (size_t i = 0; i < nibbles; i++) {
  ------------------
  |  Branch (555:22): [True: 13.0k, False: 1.11k]
  ------------------
  556|  13.0k|    enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  557|  29.7k|    while (*sp < '0' || (*sp > '9' && *sp < 'a') || *sp > 'f') {
  ------------------
  |  Branch (557:12): [True: 8.20k, False: 21.5k]
  |  Branch (557:26): [True: 11.4k, False: 10.1k]
  |  Branch (557:39): [True: 4.84k, False: 6.57k]
  |  Branch (557:53): [True: 3.74k, False: 12.9k]
  ------------------
  558|  16.7k|      if (*sp == '\0') {
  ------------------
  |  Branch (558:11): [True: 46, False: 16.6k]
  ------------------
  559|       |#ifdef EXIV2_DEBUG_MESSAGES
  560|       |        std::cerr << "Exiv2::PngChunk::readRawProfile: Unable To Copy Raw Profile: ran out of data\n";
  561|       |#endif
  562|     46|        return {};
  563|     46|      }
  564|       |
  565|  16.6k|      sp++;
  566|  16.6k|      enforce(sp < eot, Exiv2::ErrorCode::kerCorruptedMetadata);
  567|  16.6k|    }
  568|       |
  569|  13.0k|    if (i % 2 == 0)
  ------------------
  |  Branch (569:9): [True: 6.50k, False: 6.49k]
  ------------------
  570|  6.50k|      *dp = static_cast<unsigned char>(16 * unhex[static_cast<size_t>(*sp++)]);
  571|  6.49k|    else
  572|  6.49k|      (*dp++) += unhex[static_cast<size_t>(*sp++)];
  573|  13.0k|  }
  574|       |
  575|  1.11k|  return info;
  576|       |
  577|  1.15k|}  // PngChunk::readRawProfile
_ZN5Exiv28Internal8PngChunk15writeRawProfileENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPKc:
  579|    550|std::string PngChunk::writeRawProfile(std::string_view profileData, const char* profileType) {
  580|    550|  static const byte hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  581|       |
  582|    550|  auto ss = stringFormat("\n{}\n{:08}", profileType, profileData.size());
  ------------------
  |  |   18|    550|#define stringFormat std::format
  ------------------
  583|    550|  auto sp = reinterpret_cast<const byte*>(profileData.data());
  584|   382k|  for (std::string::size_type i = 0; i < profileData.size(); ++i) {
  ------------------
  |  Branch (584:38): [True: 382k, False: 550]
  ------------------
  585|   382k|    if (i % 36 == 0)
  ------------------
  |  Branch (585:9): [True: 10.8k, False: 371k]
  ------------------
  586|  10.8k|      ss += '\n';
  587|   382k|    ss += hex[*sp >> 4 & 0x0fU];
  588|   382k|    ss += hex[*sp++ & 0x0fU];
  589|   382k|  }
  590|    550|  ss += '\n';
  591|    550|  return ss;
  592|       |
  593|    550|}  // PngChunk::writeRawProfile

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  3.18k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  3.18k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 417, False: 2.77k]
  |  Branch (57:26): [True: 417, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    417|    IoCloser closer(*io_);
   62|    417|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 417]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    417|  }
   68|  3.18k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  2.77k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  2.77k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 2.77k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  2.77k|  IoCloser closer(*io_);
  400|  2.77k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 2.77k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  2.77k|  clearMetadata();
  404|       |
  405|  2.77k|  const size_t imgSize = io_->size();
  406|  2.77k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|  2.77k|  const DecodeParams dp(max_recursion_depth_);
  408|       |
  409|  34.5k|  while (!io_->eof()) {
  ------------------
  |  Branch (409:10): [True: 32.8k, False: 1.63k]
  ------------------
  410|  32.8k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  411|       |
  412|       |    // Decode chunk data length.
  413|  32.8k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  414|  32.8k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (414:9): [True: 508, False: 32.3k]
  ------------------
  415|    508|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  416|    508|    }
  417|       |
  418|  32.3k|    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|  32.3k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (425:9): [True: 488, False: 31.8k]
  |  Branch (425:32): [True: 4.53k, False: 27.3k]
  |  Branch (425:55): [True: 7.50k, False: 19.8k]
  |  Branch (425:78): [True: 546, False: 19.2k]
  ------------------
  426|  20.2k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (426:9): [True: 330, False: 18.9k]
  |  Branch (426:32): [True: 6.17k, False: 12.7k]
  |  Branch (426:55): [True: 859, False: 11.9k]
  ------------------
  427|  20.2k|      DataBuf chunkData(chunkLength);
  428|  20.2k|      if (chunkLength > 0) {
  ------------------
  |  Branch (428:11): [True: 15.2k, False: 4.97k]
  ------------------
  429|  15.2k|        readChunk(chunkData, *io_);  // Extract chunk data.
  430|  15.2k|      }
  431|       |
  432|  20.2k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (432:11): [True: 287, False: 19.9k]
  ------------------
  433|    287|        return;  // Last chunk found: we stop parsing.
  434|    287|      }
  435|  19.9k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (435:11): [True: 4.53k, False: 15.4k]
  |  Branch (435:34): [True: 69, False: 4.46k]
  ------------------
  436|     69|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  437|  19.8k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (437:18): [True: 7.50k, False: 12.3k]
  ------------------
  438|  7.50k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk, dp);
  439|  12.3k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (439:18): [True: 546, False: 11.8k]
  ------------------
  440|    546|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk, dp);
  441|  11.8k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (441:18): [True: 6.17k, False: 5.65k]
  ------------------
  442|  6.17k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk, dp);
  443|  6.17k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (443:18): [True: 330, False: 5.32k]
  ------------------
  444|    330|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size(), dp);
  445|    330|        setByteOrder(bo);
  446|  5.32k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (446:18): [True: 859, False: 4.46k]
  ------------------
  447|       |        // The ICC profile name can vary from 1-79 characters.
  448|    859|        uint32_t iccOffset = 0;
  449|  7.38k|        do {
  450|  7.38k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (450:19): [True: 7.38k, False: 1]
  |  Branch (450:37): [True: 7.36k, False: 19]
  ------------------
  451|  7.38k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (451:18): [True: 6.52k, False: 859]
  ------------------
  452|       |
  453|    859|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  454|    859|        ++iccOffset;  // +1 = 'compressed' flag
  455|    859|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  456|       |
  457|    859|        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|    859|      }
  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|  19.9k|      chunkLength = 0;
  467|  19.9k|    }
  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|  32.0k|    io_->seek(chunkLength + 4, BasicIo::cur);
  474|  32.0k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (474:9): [True: 1.63k, False: 30.4k]
  |  Branch (474:25): [True: 342, False: 30.1k]
  ------------------
  475|    342|      throw Error(ErrorCode::kerFailedToReadImageData);
  476|    342|    }
  477|  32.0k|  }
  478|  2.77k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  480|    681|void PngImage::writeMetadata() {
  481|    681|  if (io_->open() != 0) {
  ------------------
  |  Branch (481:7): [True: 0, False: 681]
  ------------------
  482|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  483|      0|  }
  484|    681|  IoCloser closer(*io_);
  485|    681|  MemIo tempIo;
  486|       |
  487|    681|  doWriteMetadata(tempIo);  // may throw
  488|    681|  io_->close();
  489|    681|  io_->transfer(tempIo);  // may throw
  490|       |
  491|    681|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  493|    681|void PngImage::doWriteMetadata(BasicIo& outIo) {
  494|    681|  if (!io_->isopen())
  ------------------
  |  Branch (494:7): [True: 0, False: 681]
  ------------------
  495|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  496|    681|  if (!outIo.isopen())
  ------------------
  |  Branch (496:7): [True: 0, False: 681]
  ------------------
  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|    681|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (504:7): [True: 0, False: 681]
  ------------------
  505|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  506|      0|  }
  507|       |
  508|       |  // Write PNG Signature.
  509|    681|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (509:7): [True: 0, False: 681]
  ------------------
  510|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  511|       |
  512|    681|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  513|       |
  514|  19.3k|  while (!io_->eof()) {
  ------------------
  |  Branch (514:10): [True: 19.3k, False: 2]
  ------------------
  515|       |    // Read chunk header.
  516|  19.3k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  517|  19.3k|    if (io_->error())
  ------------------
  |  Branch (517:9): [True: 0, False: 19.3k]
  ------------------
  518|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  519|  19.3k|    if (bufRead != 8)
  ------------------
  |  Branch (519:9): [True: 0, False: 19.3k]
  ------------------
  520|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  521|       |
  522|       |    // Decode chunk data length.
  523|       |
  524|  19.3k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  525|  19.3k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (525:9): [True: 0, False: 19.3k]
  ------------------
  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|  19.3k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  531|  19.3k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  532|  19.3k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  533|  19.3k|    if (io_->error())
  ------------------
  |  Branch (533:9): [True: 0, False: 19.3k]
  ------------------
  534|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  535|  19.3k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (535:9): [True: 126, False: 19.2k]
  ------------------
  536|    126|      throw Error(ErrorCode::kerInputDataReadFailed);
  537|       |
  538|  19.2k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  539|       |
  540|  19.2k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (540:9): [True: 553, False: 18.6k]
  ------------------
  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|    553|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (545:11): [True: 0, False: 553]
  ------------------
  546|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  547|    553|      return;
  548|    553|    }
  549|  18.6k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (549:9): [True: 81, False: 18.6k]
  |  Branch (549:30): [True: 111, False: 18.4k]
  ------------------
  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|  18.4k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (556:16): [True: 4.23k, False: 14.2k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  559|       |#endif
  560|  4.23k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (560:11): [True: 0, False: 4.23k]
  ------------------
  561|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  562|       |
  563|       |      // Write all updated metadata here, just after IHDR.
  564|  4.23k|      if (!comment_.empty()) {
  ------------------
  |  Branch (564:11): [True: 2.00k, False: 2.22k]
  ------------------
  565|       |        // Update Comment data to a new PNG chunk
  566|  2.00k|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  567|  2.00k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (567:13): [True: 0, False: 2.00k]
  ------------------
  568|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  569|      0|        }
  570|  2.00k|      }
  571|       |
  572|  4.23k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (572:11): [True: 238, False: 3.99k]
  ------------------
  573|       |        // Update Exif data to a new PNG chunk
  574|    238|        Blob blob;
  575|    238|        ExifParser::encode(blob, littleEndian, exifData_);
  576|    238|        if (!blob.empty()) {
  ------------------
  |  Branch (576:13): [True: 202, False: 36]
  ------------------
  577|    202|          byte length[4];
  578|    202|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  579|       |
  580|       |          // calculate CRC
  581|    202|          uLong tmp = crc32(0L, Z_NULL, 0);
  582|    202|          tmp = crc32(tmp, typeExif, 4);
  583|    202|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  584|    202|          byte crc[4];
  585|    202|          ul2Data(crc, tmp, bigEndian);
  586|       |
  587|    202|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (587:15): [True: 0, False: 202]
  |  Branch (587:46): [True: 0, False: 202]
  ------------------
  588|    202|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (588:15): [True: 0, False: 202]
  |  Branch (588:71): [True: 0, False: 202]
  ------------------
  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|    202|        }
  596|    238|      }
  597|       |
  598|  4.23k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (598:11): [True: 550, False: 3.68k]
  ------------------
  599|       |        // Update IPTC data to a new PNG chunk
  600|    550|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  601|    550|        if (!newPsData.empty()) {
  ------------------
  |  Branch (601:13): [True: 550, False: 0]
  ------------------
  602|    550|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  603|    550|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  604|    550|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (604:15): [True: 0, False: 550]
  ------------------
  605|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  606|      0|          }
  607|    550|        }
  608|    550|      }
  609|       |
  610|  4.23k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (610:11): [True: 728, False: 3.50k]
  ------------------
  611|    728|        DataBuf compressed;
  612|    728|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  613|    728|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (613:13): [True: 728, False: 0]
  ------------------
  614|    728|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  615|    728|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  616|    728|          byte length[4];
  617|    728|          ul2Data(length, chunkLength, bigEndian);
  618|       |
  619|       |          // calculate CRC
  620|    728|          uLong tmp = crc32(0L, Z_NULL, 0);
  621|    728|          tmp = crc32(tmp, typeICCP, 4);
  622|    728|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  623|    728|          tmp = crc32(tmp, nullComp, 2);
  624|    728|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  625|    728|          byte crc[4];
  626|    728|          ul2Data(crc, tmp, bigEndian);
  627|       |
  628|    728|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (628:15): [True: 0, False: 728]
  |  Branch (628:46): [True: 0, False: 728]
  ------------------
  629|    728|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (629:15): [True: 0, False: 728]
  ------------------
  630|    728|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (630:15): [True: 0, False: 728]
  ------------------
  631|    728|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (631:15): [True: 0, False: 728]
  |  Branch (631:91): [True: 0, False: 728]
  ------------------
  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|    728|        }
  639|    728|      }
  640|       |
  641|  4.23k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (641:11): [True: 4.23k, False: 2]
  |  Branch (641:36): [True: 46, False: 4.18k]
  ------------------
  642|     46|#ifndef SUPPRESS_WARNINGS
  643|     46|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     46|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 46]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     46|  LogMsg(LogMsg::error).os()
  ------------------
  644|     46|#endif
  645|     46|      }
  646|  4.23k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (646:11): [True: 2.29k, False: 1.94k]
  ------------------
  647|       |        // Update XMP data to a new PNG chunk
  648|  2.29k|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  649|  2.29k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (649:13): [True: 0, False: 2.29k]
  ------------------
  650|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  651|      0|        }
  652|  2.29k|      }
  653|  14.2k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (653:16): [True: 3.15k, False: 11.1k]
  |  Branch (653:37): [True: 82, False: 11.0k]
  |  Branch (653:58): [True: 1.96k, False: 9.05k]
  ------------------
  654|  5.20k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  655|  5.20k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (655:11): [True: 5.01k, False: 196]
  |  Branch (655:28): [True: 17, False: 4.99k]
  |  Branch (655:69): [True: 80, False: 4.91k]
  ------------------
  656|  4.91k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (656:28): [True: 716, False: 4.19k]
  |  Branch (656:69): [True: 28, False: 4.16k]
  ------------------
  657|  4.16k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (657:28): [True: 703, False: 3.46k]
  |  Branch (657:65): [True: 1.30k, False: 2.16k]
  ------------------
  658|       |#ifdef EXIV2_DEBUG_MESSAGES
  659|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  660|       |                  << '\n';
  661|       |#endif
  662|  2.85k|      } else {
  663|       |#ifdef EXIV2_DEBUG_MESSAGES
  664|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  665|       |                  << '\n';
  666|       |#endif
  667|  2.35k|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (667:13): [True: 0, False: 2.35k]
  ------------------
  668|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  669|  2.35k|      }
  670|  9.05k|    } 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|  9.05k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (676:11): [True: 0, False: 9.05k]
  ------------------
  677|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  678|  9.05k|    }
  679|  18.6k|  }
  680|       |
  681|    681|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  685|  3.18k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  686|  3.18k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  687|  3.18k|  if (!image->good()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 3.18k]
  ------------------
  688|      0|    return nullptr;
  689|      0|  }
  690|  3.18k|  return image;
  691|  3.18k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  693|  47.9k|bool isPngType(BasicIo& iIo, bool advance) {
  694|  47.9k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (694:7): [True: 0, False: 47.9k]
  |  Branch (694:22): [True: 348, False: 47.5k]
  ------------------
  695|    348|    throw Error(ErrorCode::kerInputDataReadFailed);
  696|    348|  }
  697|  47.5k|  const int32_t len = 8;
  698|  47.5k|  std::array<byte, len> buf;
  699|  47.5k|  iIo.read(buf.data(), len);
  700|  47.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (700:7): [True: 0, False: 47.5k]
  |  Branch (700:22): [True: 0, False: 47.5k]
  ------------------
  701|      0|    return false;
  702|      0|  }
  703|  47.5k|  bool rc = buf == pngSignature;
  704|  47.5k|  if (!advance || !rc) {
  ------------------
  |  Branch (704:7): [True: 44.1k, False: 3.45k]
  |  Branch (704:19): [True: 0, False: 3.45k]
  ------------------
  705|  44.1k|    iIo.seek(-len, BasicIo::cur);
  706|  44.1k|  }
  707|       |
  708|  47.5k|  return rc;
  709|  47.5k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    817|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    817|  uLongf uncompressedLen = length;  // just a starting point
   76|    817|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.78k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 964, False: 817]
  ------------------
   79|    964|    result.alloc(uncompressedLen);
   80|    964|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    964|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 49, False: 915]
  |  Branch (82:31): [True: 10, False: 39]
  ------------------
   83|     10|      result.reset();
   84|       |
   85|     10|      result.alloc(uncompressedLen);
   86|     10|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|     10|    }
   88|    964|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 147, False: 817]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    147|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    147|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 147]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    147|      else
   96|    147|        uncompressedLen *= 2;
   97|    147|    }
   98|    964|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    817|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  48.1k|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|  48.1k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  48.1k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 48.1k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  48.1k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 201, False: 47.9k]
  ------------------
  388|    201|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|    201|  }
  390|  48.1k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    728|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    728|  uLongf compressedLen = length;  // just a starting point
  105|    728|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|  2.18k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 1.45k, False: 728]
  ------------------
  108|  1.45k|    result.alloc(compressedLen);
  109|  1.45k|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|  1.45k|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 728, False: 728]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|    728|      result.reset();
  113|    728|      compressedLen *= 2;
  114|    728|    } else {
  115|    728|      result.reset();
  116|    728|      result.alloc(compressedLen);
  117|    728|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    728|    }
  119|  1.45k|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    728|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  26.7k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  26.7k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  26.7k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  26.7k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|  4.21k|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|  4.21k|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|  4.21k|const byte* PreviewImage::pData() const {
 1018|  4.21k|  return preview_.c_data();
 1019|  4.21k|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|  4.21k|uint32_t PreviewImage::size() const {
 1022|  4.21k|  return static_cast<uint32_t>(preview_.size());
 1023|  4.21k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  20.2k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  20.2k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  20.2k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  20.2k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   704k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 684k, False: 20.2k]
  ------------------
 1052|   684k|    auto loader = Loader::create(id, image_);
 1053|   684k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 43.0k, False: 641k]
  |  Branch (1053:19): [True: 23.9k, False: 19.0k]
  ------------------
 1054|  23.9k|      PreviewProperties props = loader->getProperties();
 1055|  23.9k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  23.9k|      props.size_ = buf.size();         //     update the size
 1057|  23.9k|      list.push_back(std::move(props));
 1058|  23.9k|    }
 1059|   684k|  }
 1060|  20.2k|  std::sort(list.begin(), list.end(),
 1061|  20.2k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  20.2k|  return list;
 1064|  20.2k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|  4.21k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|  4.21k|  auto loader = Loader::create(properties.id_, image_);
 1068|  4.21k|  DataBuf buf;
 1069|  4.21k|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 4.21k, False: 0]
  ------------------
 1070|  4.21k|    buf = loader->getData();
 1071|  4.21k|  }
 1072|       |
 1073|  4.21k|  return {properties, std::move(buf)};
 1074|  4.21k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|  1.39M|PreviewId Loader::getNumLoaders() {
  351|  1.39M|  return PreviewId{std::size(loaderList_)};
  352|  1.39M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  81.1k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  81.1k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  81.1k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  81.1k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  81.1k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 81.1k]
  |  Branch (355:21): [True: 81.1k, False: 0]
  ------------------
  356|  81.1k|    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|   648k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   648k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  23.9k|PreviewProperties Loader::getProperties() const {
  347|  23.9k|  return {"", "", size_, width_, height_, id_};
  348|  23.9k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  3.18k|  virtual bool readDimensions() {
   78|  3.18k|    return true;
   79|  3.18k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   648k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   713k|  [[nodiscard]] virtual bool valid() const {
   67|   713k|    return valid_;
   68|   713k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|   243k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|   243k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|   243k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|   243k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|   243k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 933, False: 242k]
  ------------------
  557|    933|    size_ = pos->sizeDataArea();  // indirect data
  558|    933|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 933, False: 0]
  |  Branch (558:23): [True: 840, False: 93]
  ------------------
  559|    840|      size_ = pos->size();  // direct data
  560|    933|  }
  561|       |
  562|   243k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 242k, False: 839]
  ------------------
  563|   242k|    return;
  564|       |
  565|    839|  valid_ = true;
  566|    839|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|    319|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|    319|  PreviewProperties prop = Loader::getProperties();
  574|    319|  prop.mimeType_ = "image/jpeg";
  575|    319|  prop.extension_ = ".jpg";
  576|    319|  return prop;
  577|    319|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|  1.15k|DataBuf LoaderExifDataJpeg::getData() const {
  580|  1.15k|  DataBuf buf;
  581|       |
  582|  1.15k|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 1.15k]
  ------------------
  583|      0|    return buf;
  584|       |
  585|  1.15k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 1.15k, False: 0]
  ------------------
  586|  1.15k|    buf = pos->dataArea();  // indirect data
  587|       |
  588|  1.15k|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 1.15k, False: 0]
  ------------------
  589|  1.15k|      buf = DataBuf(pos->size());
  590|  1.15k|      pos->copy(buf.data(), invalidByteOrder);
  591|  1.15k|    }
  592|       |
  593|  1.15k|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|  1.15k|    return buf;
  595|  1.15k|  }
  596|       |
  597|      0|  return buf;
  598|  1.15k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  600|    541|bool LoaderExifDataJpeg::readDimensions() {
  601|    541|  if (!valid())
  ------------------
  |  Branch (601:7): [True: 0, False: 541]
  ------------------
  602|      0|    return false;
  603|       |
  604|    541|  DataBuf buf = getData();
  605|    541|  if (buf.empty())
  ------------------
  |  Branch (605:7): [True: 0, False: 541]
  ------------------
  606|      0|    return false;
  607|       |
  608|    541|  try {
  609|    541|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  610|    541|    if (!image)
  ------------------
  |  Branch (610:9): [True: 0, False: 541]
  ------------------
  611|      0|      return false;
  612|    541|    image->readMetadata();
  613|       |
  614|    541|    width_ = image->pixelWidth();
  615|    541|    height_ = image->pixelHeight();
  616|    541|  } catch (const Error& /* error */) {
  617|    222|    return false;
  618|    222|  }
  619|       |
  620|    319|  return true;
  621|    541|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|   141k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|   141k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|   141k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|   141k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|   141k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|   141k|  size_t offsetCount = 0;
  628|   141k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|   141k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 121k, False: 20.0k]
  ------------------
  632|   121k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|   121k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 115k, False: 5.73k]
  ------------------
  634|   115k|      return;
  635|  5.73k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 5.73k, False: 0]
  |  Branch (635:9): [True: 785, False: 4.94k]
  |  Branch (635:39): [True: 785, False: 4.94k]
  ------------------
  636|    785|      return;
  637|  5.73k|  }
  638|       |
  639|  25.0k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  25.0k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 3.98k, False: 21.0k]
  ------------------
  641|  3.98k|    offsetTag_ = "StripOffsets";
  642|  3.98k|    sizeTag_ = "StripByteCounts";
  643|  3.98k|    offsetCount = pos->value().count();
  644|  21.0k|  } else {
  645|  21.0k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  21.0k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 20.2k, False: 763]
  ------------------
  647|  20.2k|      return;
  648|    763|    offsetTag_ = "TileOffsets";
  649|    763|    sizeTag_ = "TileByteCounts";
  650|    763|    offsetCount = pos->value().count();
  651|    763|  }
  652|       |
  653|  4.75k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  4.75k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 219, False: 4.53k]
  ------------------
  655|    219|    return;
  656|  4.53k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 73, False: 4.45k]
  ------------------
  657|     73|    return;
  658|  28.2k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 23.8k, False: 4.45k]
  ------------------
  659|  23.8k|    size_ += pos->toUint32(i);
  660|  23.8k|  }
  661|       |
  662|  4.45k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 181, False: 4.27k]
  ------------------
  663|    181|    return;
  664|       |
  665|  4.27k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  4.27k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 4.05k, False: 221]
  |  Branch (666:7): [True: 3.87k, False: 404]
  |  Branch (666:32): [True: 3.87k, False: 183]
  ------------------
  667|  3.87k|    width_ = pos->toUint32();
  668|  3.87k|  }
  669|       |
  670|  4.27k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  4.27k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 3.83k, False: 447]
  |  Branch (671:7): [True: 3.74k, False: 538]
  |  Branch (671:32): [True: 3.74k, False: 91]
  ------------------
  672|  3.74k|    height_ = pos->toUint32();
  673|  3.74k|  }
  674|       |
  675|  4.27k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 466, False: 3.81k]
  |  Branch (675:22): [True: 335, False: 3.47k]
  ------------------
  676|    711|    return;
  677|       |
  678|  3.56k|  valid_ = true;
  679|  3.56k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  3.18k|PreviewProperties LoaderTiff::getProperties() const {
  686|  3.18k|  PreviewProperties prop = Loader::getProperties();
  687|  3.18k|  prop.mimeType_ = "image/tiff";
  688|  3.18k|  prop.extension_ = ".tif";
  689|  3.18k|  return prop;
  690|  3.18k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  3.47k|DataBuf LoaderTiff::getData() const {
  693|  3.47k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  3.47k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   172k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 172k, False: 3.47k]
  ------------------
  699|   172k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 48.5k, False: 124k]
  ------------------
  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|  48.5k|      uint16_t tag = pos.tag();
  708|  48.5k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 44.7k, False: 3.71k]
  |  Branch (708:28): [True: 44.6k, False: 139]
  |  Branch (708:45): [True: 25.4k, False: 19.2k]
  ------------------
  709|  25.4k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|  25.4k|      }
  711|  48.5k|    }
  712|   172k|  }
  713|       |
  714|  3.47k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  3.47k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 3.47k, False: 0]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  3.47k|    BasicIo& io = image_.io();
  719|       |
  720|  3.47k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 3.47k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  3.47k|    IoCloser closer(io);
  724|       |
  725|  3.47k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  3.47k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  3.47k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 3.47k, False: 0]
  ------------------
  730|  3.47k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 2.84k, False: 628]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  2.84k|        uint32_t offset = dataValue.toUint32(0);
  733|  2.84k|        uint32_t size = sizes.toUint32(0);
  734|  2.84k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 490, False: 2.35k]
  ------------------
  735|    490|          dataValue.setDataArea(base + offset, size);
  736|  2.84k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    628|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    628|        DataBuf buf(size_);
  740|    628|        uint32_t idxBuf = 0;
  741|  8.05k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 7.42k, False: 628]
  ------------------
  742|  7.42k|          uint32_t offset = dataValue.toUint32(i);
  743|  7.42k|          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.42k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  7.42k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 3.45k, False: 3.97k]
  |  Branch (750:28): [True: 1.06k, False: 2.38k]
  ------------------
  751|  1.06k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|  1.06k|          }
  753|       |
  754|  7.42k|          idxBuf += size;
  755|  7.42k|        }
  756|    628|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    628|      }
  758|  3.47k|    }
  759|  3.47k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  3.47k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 0, False: 3.47k]
  |  Branch (762:7): [True: 0, False: 3.47k]
  |  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.47k|  MemIo mio;
  768|  3.47k|  IptcData emptyIptc;
  769|  3.47k|  XmpData emptyXmp;
  770|  3.47k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  3.47k|  return {mio.mmap(), mio.size()};
  772|  3.47k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|   162k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|   162k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|   162k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|   162k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|   162k|  const ExifData& exifData = image_.exifData();
  469|   162k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|   162k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 45.0k, False: 117k]
  |  Branch (470:7): [True: 44.5k, False: 118k]
  |  Branch (470:32): [True: 44.5k, False: 484]
  ------------------
  471|  44.5k|    offset_ = pos->toUint32();
  472|  44.5k|  }
  473|       |
  474|   162k|  size_ = 0;
  475|   162k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|   162k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 44.4k, False: 118k]
  |  Branch (476:7): [True: 44.2k, False: 118k]
  |  Branch (476:32): [True: 44.2k, False: 279]
  ------------------
  477|  44.2k|    size_ = pos->toUint32();
  478|  44.2k|  }
  479|       |
  480|   162k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 118k, False: 44.1k]
  |  Branch (480:23): [True: 867, False: 43.2k]
  ------------------
  481|   119k|    return;
  482|       |
  483|  43.5k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 0, False: 43.5k]
  ------------------
  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|  43.5k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 370, False: 43.1k]
  ------------------
  491|    370|    return;
  492|       |
  493|  43.1k|  valid_ = true;
  494|  43.1k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  20.4k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  20.4k|  PreviewProperties prop = Loader::getProperties();
  502|  20.4k|  prop.mimeType_ = "image/jpeg";
  503|  20.4k|  prop.extension_ = ".jpg";
  504|  20.4k|  return prop;
  505|  20.4k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  24.1k|DataBuf LoaderExifJpeg::getData() const {
  508|  24.1k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 24.1k]
  ------------------
  509|      0|    return {};
  510|  24.1k|  BasicIo& io = image_.io();
  511|       |
  512|  24.1k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 24.1k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  24.1k|  IoCloser closer(io);
  516|       |
  517|  24.1k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  24.1k|  return {base + offset_, size_};
  520|  24.1k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  39.2k|bool LoaderExifJpeg::readDimensions() {
  523|  39.2k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 39.2k]
  ------------------
  524|      0|    return false;
  525|  39.2k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 39.2k]
  |  Branch (525:17): [True: 0, False: 39.2k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  39.2k|  BasicIo& io = image_.io();
  529|       |
  530|  39.2k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 39.2k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  39.2k|  IoCloser closer(io);
  534|  39.2k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  39.2k|  try {
  537|  39.2k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  39.2k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 39.2k]
  ------------------
  539|      0|      return false;
  540|  39.2k|    image->readMetadata();
  541|       |
  542|  39.2k|    width_ = image->pixelWidth();
  543|  39.2k|    height_ = image->pixelHeight();
  544|  39.2k|  } catch (const Error& /* error */) {
  545|  18.7k|#ifndef SUPPRESS_WARNINGS
  546|  18.7k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  18.7k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 18.7k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  18.7k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  18.7k|#endif
  548|  18.7k|    return false;
  549|  18.7k|  }
  550|       |
  551|  20.4k|  return true;
  552|  39.2k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  19.8k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  19.8k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  19.8k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  19.8k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  19.8k|  (void)parIdx;
  776|       |
  777|  19.8k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  19.8k|  std::string prefix = "xmpGImg";
  780|  19.8k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 0, False: 19.8k]
  ------------------
  781|      0|    prefix = "xapGImg";
  782|      0|  }
  783|       |
  784|  19.8k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  19.8k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 19.8k, False: 0]
  ------------------
  786|  19.8k|    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|   688k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   688k|  Loader::UniquePtr loader;
  330|   688k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 688k]
  |  Branch (330:17): [True: 0, False: 688k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   688k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 60.4k, False: 628k]
  |  Branch (333:7): [True: 39.8k, False: 648k]
  |  Branch (333:41): [True: 39.8k, False: 20.5k]
  ------------------
  334|  39.8k|    return loader;
  335|       |
  336|   648k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   648k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 601k, False: 47.5k]
  ------------------
  338|   601k|    loader = nullptr;
  339|       |
  340|   648k|  return loader;
  341|   688k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  15.9k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  3.32M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  3.32M|  return ns_ == ns.ns_;
 4941|  3.32M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|   110M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|   110M|  return prefix_ == prefix.prefix_;
 4945|   110M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.63M|std::mutex& XmpProperties::getMutex() {
 4953|  2.63M|  static std::mutex m;
 4954|  2.63M|  return m;
 4955|  2.63M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.88M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  76.4M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 76.4M, False: 2.83M]
  ------------------
 4965|  76.4M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 53.5k, False: 76.3M]
  ------------------
 4966|  53.5k|      return &p;
 4967|  76.4M|  }
 4968|  2.83M|  return nullptr;
 4969|  2.88M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     37|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     37|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 37]
  ------------------
 4978|      0|    return;
 4979|     37|  std::string ns2 = ns;
 4980|     37|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 12, False: 25]
  |  Branch (4980:28): [True: 10, False: 2]
  ------------------
 4981|     10|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     37|  auto it = nsRegistry_.find(ns2);
 4985|     37|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 37]
  |  Branch (4985:7): [True: 0, False: 37]
  |  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|     37|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 37]
  ------------------
 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|     37|  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|     37|  XmpNsInfo xn;
 5005|     37|  auto c = new char[ns2.size() + 1];
 5006|     37|  std::strcpy(c, ns2.c_str());
 5007|     37|  xn.ns_ = c;
 5008|     37|  c = new char[prefix.size() + 1];
 5009|     37|  std::strcpy(c, prefix.c_str());
 5010|     37|  xn.prefix_ = c;
 5011|     37|  xn.xmpPropertyInfo_ = nullptr;
 5012|     37|  xn.desc_ = "";
 5013|     37|  nsRegistry_[ns2] = xn;
 5014|     37|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     37|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     37|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     37|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     74|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     74|  auto i = nsRegistry_.find(ns);
 5027|     74|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 37, False: 37]
  ------------------
 5028|     37|    delete[] i->second.prefix_;
 5029|     37|    delete[] i->second.ns_;
 5030|     37|    nsRegistry_.erase(i);
 5031|     37|  }
 5032|     74|}
_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|     38|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 37, False: 1]
  ------------------
 5046|     37|    auto kill = i++;
 5047|     37|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     37|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   157k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   157k|  std::string ns2 = ns;
 5058|   157k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 32.3k, False: 125k]
  |  Branch (5058:28): [True: 20.7k, False: 11.5k]
  ------------------
 5059|  20.7k|    ns2 += '/';
 5060|       |
 5061|   157k|  auto i = nsRegistry_.find(ns2);
 5062|   157k|  std::string p;
 5063|   157k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 10.1k, False: 147k]
  ------------------
 5064|  10.1k|    p = i->second.prefix_;
 5065|   147k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 90.1k, False: 57.1k]
  ------------------
 5066|  90.1k|    p = std::string(xn->prefix_);
 5067|   157k|  return p;
 5068|   157k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.42M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.42M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 48.1k, False: 1.37M]
  ------------------
 5077|  48.1k|    return xn->ns_;
 5078|  1.37M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.42M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  10.7k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  10.7k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  10.7k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 5.47k, False: 5.31k]
  |  Branch (5083:59): [True: 5.28k, False: 37]
  ------------------
 5084|  10.7k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  74.3k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  74.3k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  74.3k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 72.2k, False: 2.12k]
  ------------------
 5114|  74.3k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  74.3k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  74.3k|  std::string prefix = key.groupName();
 5123|  74.3k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  74.3k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 74.3k]
  ------------------
 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|  74.3k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 74.3k, False: 0]
  ------------------
 5138|  9.76M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 9.75M, False: 2.12k]
  ------------------
 5139|  9.75M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 72.2k, False: 9.68M]
  ------------------
 5140|  72.2k|        return pl + j;
 5141|  72.2k|      }
 5142|  9.75M|    }
 5143|  74.3k|  }
 5144|  2.12k|  return nullptr;
 5145|  74.3k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  74.3k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  74.3k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  74.3k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.45M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.45M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.45M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.45M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.45M, False: 0]
  ------------------
 5175|  1.45M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.45M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 11, False: 1.45M]
  ------------------
 5177|     11|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.45M|  return xn;
 5179|  1.45M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   143k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   143k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 143k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   143k|  property_ = property;
 5256|   143k|  prefix_ = prefix;
 5257|   143k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   513k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   513k|  p_->decomposeKey(key);
 5261|   513k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   766k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   766k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   766k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   143k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   143k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.98M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   563k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   563k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   563k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   563k|  return UniquePtr(clone_());
 5288|   563k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   563k|XmpKey* XmpKey::clone_() const {
 5291|   563k|  return new XmpKey(*this);
 5292|   563k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  28.3M|std::string XmpKey::key() const {
 5295|  28.3M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  28.3M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|   170k|std::string XmpKey::groupName() const {
 5303|   170k|  return p_->prefix_;
 5304|   170k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|   294k|std::string XmpKey::tagName() const {
 5307|   294k|  return p_->property_;
 5308|   294k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5335|   513k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5336|   513k|  XmpProperties::XmpLock lock;
 5337|   513k|  decomposeKeyUnlocked(key, lock);
 5338|   513k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5340|  1.28M|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.28M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5342:7): [True: 310, False: 1.27M]
  ------------------
 5343|    310|    throw Error(ErrorCode::kerInvalidKey, key);
 5344|  1.27M|  std::string::size_type pos1 = key.find('.');
 5345|  1.27M|  std::string::size_type pos0 = pos1 + 1;
 5346|  1.27M|  pos1 = key.find('.', pos0);
 5347|  1.27M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5347:7): [True: 0, False: 1.27M]
  ------------------
 5348|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5349|  1.27M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5350|  1.27M|  if (prefix.empty())
  ------------------
  |  Branch (5350:7): [True: 0, False: 1.27M]
  ------------------
 5351|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5352|  1.27M|  std::string property = key.substr(pos1 + 1);
 5353|  1.27M|  if (property.empty())
  ------------------
  |  Branch (5353:7): [True: 0, False: 1.27M]
  ------------------
 5354|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5355|       |
 5356|       |  // Validate prefix unlocked (must hold lock)
 5357|  1.27M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5357:7): [True: 0, False: 1.27M]
  ------------------
 5358|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5359|       |
 5360|  1.27M|  property_ = std::move(property);
 5361|  1.27M|  prefix_ = std::move(prefix);
 5362|  1.27M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|  1.28M|  Impl() = default;                                                                             //!< Default constructor

_ZN5Exiv28PsdImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  103|  1.96k|    Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io), params) {
  104|  1.96k|}  // PsdImage::PsdImage
_ZN5Exiv28PsdImage12readMetadataEv:
  115|  1.89k|void PsdImage::readMetadata() {
  116|       |#ifdef EXIV2_DEBUG_MESSAGES
  117|       |  std::cerr << "Exiv2::PsdImage::readMetadata: Reading Photoshop file " << io_->path() << "\n";
  118|       |#endif
  119|  1.89k|  if (io_->open() != 0) {
  ------------------
  |  Branch (119:7): [True: 0, False: 1.89k]
  ------------------
  120|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  121|      0|  }
  122|  1.89k|  IoCloser closer(*io_);
  123|       |  // Ensure that this is the correct image type
  124|  1.89k|  if (!isPsdType(*io_, false)) {
  ------------------
  |  Branch (124:7): [True: 0, False: 1.89k]
  ------------------
  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.89k|  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.89k|  byte buf[26];
  147|  1.89k|  if (io_->read(buf, 26) != 26) {
  ------------------
  |  Branch (147:7): [True: 0, False: 1.89k]
  ------------------
  148|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  149|      0|  }
  150|  1.89k|  pixelWidth_ = getLong(buf + 18, bigEndian);
  151|  1.89k|  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.89k|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (155:7): [True: 0, False: 1.89k]
  ------------------
  156|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  157|      0|  }
  158|       |
  159|       |  // skip it
  160|  1.89k|  if (io_->seek(getULong(buf, bigEndian), BasicIo::cur)) {
  ------------------
  |  Branch (160:7): [True: 83, False: 1.80k]
  ------------------
  161|     83|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  162|     83|  }
  163|       |
  164|       |  // after the color data section, comes a list of resource blocks, preceded by the total byte size
  165|  1.80k|  if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (165:7): [True: 39, False: 1.76k]
  ------------------
  166|     39|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  167|     39|  }
  168|  1.76k|  uint32_t resourcesLength = getULong(buf, bigEndian);
  169|  1.76k|  Internal::enforce(resourcesLength < io_->size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  170|       |
  171|  3.51k|  while (resourcesLength > 0) {
  ------------------
  |  Branch (171:10): [True: 2.55k, False: 956]
  ------------------
  172|  2.55k|    Internal::enforce(resourcesLength >= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  173|  2.55k|    resourcesLength -= 8;
  174|  2.55k|    if (io_->read(buf, 8) != 8) {
  ------------------
  |  Branch (174:9): [True: 83, False: 2.47k]
  ------------------
  175|     83|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  176|     83|    }
  177|       |
  178|  2.47k|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (178:9): [True: 706, False: 1.77k]
  ------------------
  179|    706|      break;  // bad resource type
  180|    706|    }
  181|  1.77k|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  182|  1.77k|    uint32_t resourceNameLength = buf[6] & ~1;
  183|       |
  184|       |    // skip the resource name, plus any padding
  185|  1.77k|    Internal::enforce(resourceNameLength <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  186|  1.77k|    resourcesLength -= resourceNameLength;
  187|  1.77k|    io_->seek(resourceNameLength, BasicIo::cur);
  188|       |
  189|       |    // read resource size
  190|  1.77k|    Internal::enforce(resourcesLength >= 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  191|  1.77k|    resourcesLength -= 4;
  192|  1.77k|    if (io_->read(buf, 4) != 4) {
  ------------------
  |  Branch (192:9): [True: 23, False: 1.74k]
  ------------------
  193|     23|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  194|     23|    }
  195|  1.74k|    uint32_t resourceSize = getULong(buf, bigEndian);
  196|  1.74k|    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.74k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  204|  1.74k|    readResourceBlock(resourceId, resourceSize);
  205|  1.74k|    resourceSize = (resourceSize + 1) & ~1;  // pad to even
  206|  1.74k|    Internal::enforce(resourceSize <= resourcesLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  207|  1.74k|    resourcesLength -= resourceSize;
  208|  1.74k|    io_->seek(curOffset + resourceSize, BasicIo::beg);
  209|  1.74k|  }
  210|       |
  211|  1.76k|}  // PsdImage::readMetadata
_ZN5Exiv28PsdImage17readResourceBlockEtj:
  213|  1.35k|void PsdImage::readResourceBlock(uint16_t resourceId, uint32_t resourceSize) {
  214|  1.35k|  switch (resourceId) {
  215|    223|    case kPhotoshopResourceID::IPTC_NAA: {
  ------------------
  |  Branch (215:5): [True: 223, False: 1.13k]
  ------------------
  216|    223|      DataBuf rawIPTC(resourceSize);
  217|    223|      io_->read(rawIPTC.data(), rawIPTC.size());
  218|    223|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (218:11): [True: 0, False: 223]
  |  Branch (218:27): [True: 19, False: 204]
  ------------------
  219|     19|        throw Error(ErrorCode::kerFailedToReadImageData);
  220|    204|      if (IptcParser::decode(iptcData_, rawIPTC.c_data(), rawIPTC.size())) {
  ------------------
  |  Branch (220:11): [True: 41, False: 163]
  ------------------
  221|     41|#ifndef SUPPRESS_WARNINGS
  222|     41|        EXV_WARNING << "Failed to decode IPTC metadata.\n";
  ------------------
  |  |  138|     41|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 41]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     41|  LogMsg(LogMsg::warn).os()
  ------------------
  223|     41|#endif
  224|     41|        iptcData_.clear();
  225|     41|      }
  226|    204|      break;
  227|    223|    }
  228|       |
  229|    154|    case kPhotoshopResourceID::ExifInfo: {
  ------------------
  |  Branch (229:5): [True: 154, False: 1.19k]
  ------------------
  230|    154|      DataBuf rawExif(resourceSize);
  231|    154|      io_->read(rawExif.data(), rawExif.size());
  232|    154|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (232:11): [True: 0, False: 154]
  |  Branch (232:27): [True: 7, False: 147]
  ------------------
  233|      7|        throw Error(ErrorCode::kerFailedToReadImageData);
  234|    147|      const DecodeParams dp(max_recursion_depth_);
  235|    147|      ByteOrder bo = ExifParser::decode(exifData_, rawExif.c_data(), rawExif.size(), dp);
  236|    147|      setByteOrder(bo);
  237|    147|      if (!rawExif.empty() && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (237:11): [True: 7, False: 140]
  |  Branch (237:31): [True: 0, False: 7]
  ------------------
  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|    147|      break;
  244|    154|    }
  245|       |
  246|    117|    case kPhotoshopResourceID::XMPPacket: {
  ------------------
  |  Branch (246:5): [True: 117, False: 1.23k]
  ------------------
  247|    117|      DataBuf xmpPacket(resourceSize);
  248|    117|      io_->read(xmpPacket.data(), xmpPacket.size());
  249|    117|      if (io_->error() || io_->eof())
  ------------------
  |  Branch (249:11): [True: 0, False: 117]
  |  Branch (249:27): [True: 20, False: 97]
  ------------------
  250|     20|        throw Error(ErrorCode::kerFailedToReadImageData);
  251|     97|      xmpPacket_.assign(xmpPacket.c_str(), xmpPacket.size());
  252|     97|      const DecodeParams dp(max_recursion_depth_);
  253|     97|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (253:11): [True: 56, False: 41]
  |  Branch (253:34): [True: 52, False: 4]
  ------------------
  254|     52|#ifndef SUPPRESS_WARNINGS
  255|     52|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     52|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 52]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     52|  LogMsg(LogMsg::warn).os()
  ------------------
  256|     52|#endif
  257|     52|      }
  258|     97|      break;
  259|    117|    }
  260|       |
  261|       |    // - PS 4.0 preview data is fetched from ThumbnailResource
  262|       |    // - PS >= 5.0 preview data is fetched from ThumbnailResource2
  263|    274|    case kPhotoshopResourceID::ThumbnailResource:
  ------------------
  |  Branch (263:5): [True: 274, False: 1.07k]
  ------------------
  264|    320|    case kPhotoshopResourceID::ThumbnailResource2: {
  ------------------
  |  Branch (264:5): [True: 46, False: 1.30k]
  ------------------
  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|    320|      byte buf[28];
  282|    320|      if (io_->read(buf, 28) != 28) {
  ------------------
  |  Branch (282:11): [True: 19, False: 301]
  ------------------
  283|     19|        throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  284|     19|      }
  285|    301|      NativePreview nativePreview;
  286|    301|      nativePreview.position_ = io_->tell();
  287|    301|      nativePreview.size_ = getLong(buf + 20, bigEndian);  // compressedsize
  288|    301|      nativePreview.width_ = getLong(buf + 4, bigEndian);
  289|    301|      nativePreview.height_ = getLong(buf + 8, bigEndian);
  290|    301|      const uint32_t format = getLong(buf + 0, bigEndian);
  291|       |
  292|    301|      Internal::enforce(nativePreview.size_ <= static_cast<size_t>(std::numeric_limits<long>::max()),
  293|    301|                        Exiv2::ErrorCode::kerCorruptedMetadata);
  294|       |
  295|    301|      if (nativePreview.size_ > 0 && nativePreview.position_ > 0) {
  ------------------
  |  Branch (295:11): [True: 187, False: 114]
  |  Branch (295:38): [True: 187, False: 0]
  ------------------
  296|    187|        io_->seek(static_cast<long>(nativePreview.size_), BasicIo::cur);
  297|    187|        if (io_->error() || io_->eof())
  ------------------
  |  Branch (297:13): [True: 0, False: 187]
  |  Branch (297:29): [True: 53, False: 134]
  ------------------
  298|     53|          throw Error(ErrorCode::kerFailedToReadImageData);
  299|       |
  300|       |        // unsupported format of native preview
  301|    134|        if (format != 1)
  ------------------
  |  Branch (301:13): [True: 116, False: 18]
  ------------------
  302|    116|          break;
  303|     18|        nativePreview.filter_ = "";
  304|     18|        nativePreview.mimeType_ = "image/jpeg";
  305|     18|        nativePreviews_.push_back(std::move(nativePreview));
  306|     18|      }
  307|    132|      break;
  308|    301|    }
  309|       |
  310|    539|    default:
  ------------------
  |  Branch (310:5): [True: 539, False: 814]
  ------------------
  311|    539|      break;
  312|  1.35k|  }
  313|  1.35k|}  // PsdImage::readResourceBlock
_ZN5Exiv28PsdImage13writeMetadataEv:
  315|    151|void PsdImage::writeMetadata() {
  316|    151|  if (io_->open() != 0) {
  ------------------
  |  Branch (316:7): [True: 0, False: 151]
  ------------------
  317|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  318|      0|  }
  319|    151|  IoCloser closer(*io_);
  320|    151|  MemIo tempIo;
  321|       |
  322|    151|  doWriteMetadata(tempIo);  // may throw
  323|    151|  io_->close();
  324|    151|  io_->transfer(tempIo);  // may throw
  325|       |
  326|    151|}  // PsdImage::writeMetadata
_ZN5Exiv28PsdImage15doWriteMetadataERNS_7BasicIoE:
  328|    151|void PsdImage::doWriteMetadata(BasicIo& outIo) {
  329|    151|  if (!io_->isopen())
  ------------------
  |  Branch (329:7): [True: 0, False: 151]
  ------------------
  330|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  331|    151|  if (!outIo.isopen())
  ------------------
  |  Branch (331:7): [True: 0, False: 151]
  ------------------
  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|    151|  if (!isPsdType(*io_, true)) {
  ------------------
  |  Branch (340:7): [True: 0, False: 151]
  ------------------
  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|    151|  io_->seek(0, BasicIo::beg);  // rewind
  347|       |
  348|    151|  DataBuf lbuf(4096);
  349|    151|  byte buf[8];
  350|       |
  351|       |  // Get Photoshop header from original file
  352|    151|  byte psd_head[26];
  353|    151|  if (io_->read(psd_head, 26) != 26)
  ------------------
  |  Branch (353:7): [True: 0, False: 151]
  ------------------
  354|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  355|       |
  356|       |  // Write Photoshop header data out to new PSD file
  357|    151|  if (outIo.write(psd_head, 26) != 26)
  ------------------
  |  Branch (357:7): [True: 0, False: 151]
  ------------------
  358|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  359|       |
  360|       |  // Read colorDataLength from original PSD
  361|    151|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (361:7): [True: 0, False: 151]
  ------------------
  362|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  363|       |
  364|    151|  uint32_t colorDataLength = getULong(buf, bigEndian);
  365|       |
  366|       |  // Write colorDataLength
  367|    151|  ul2Data(buf, colorDataLength, bigEndian);
  368|    151|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (368:7): [True: 0, False: 151]
  ------------------
  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|    151|  size_t readTotal = 0;
  375|    287|  while (readTotal < colorDataLength) {
  ------------------
  |  Branch (375:10): [True: 136, False: 151]
  ------------------
  376|    136|    auto toRead = std::min<size_t>(colorDataLength - readTotal, lbuf.size());
  377|    136|    if (io_->read(lbuf.data(), toRead) != toRead)
  ------------------
  |  Branch (377:9): [True: 0, False: 136]
  ------------------
  378|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  379|    136|    readTotal += toRead;
  380|    136|    if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (380:9): [True: 0, False: 136]
  ------------------
  381|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  382|    136|  }
  383|    151|  if (outIo.error())
  ------------------
  |  Branch (383:7): [True: 0, False: 151]
  ------------------
  384|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  385|       |
  386|    151|  const size_t resLenOffset = io_->tell();  // remember for later update
  387|       |
  388|       |  // Read length of all resource blocks from original PSD
  389|    151|  if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (389:7): [True: 0, False: 151]
  ------------------
  390|      0|    throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  391|       |
  392|    151|  uint32_t oldResLength = getULong(buf, bigEndian);
  393|    151|  uint32_t newResLength = 0;
  394|       |
  395|       |  // Write oldResLength (will be updated later)
  396|    151|  ul2Data(buf, oldResLength, bigEndian);
  397|    151|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (397:7): [True: 0, False: 151]
  ------------------
  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|    151|  bool iptcDone = false;
  409|    151|  bool exifDone = false;
  410|    151|  bool xmpDone = false;
  411|    366|  while (oldResLength > 0) {
  ------------------
  |  Branch (411:10): [True: 333, False: 33]
  ------------------
  412|    333|    if (io_->read(buf, 8) != 8)
  ------------------
  |  Branch (412:9): [True: 0, False: 333]
  ------------------
  413|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  414|       |
  415|       |    // read resource type and ID
  416|    333|    uint32_t resourceType = getULong(buf, bigEndian);
  417|       |
  418|    333|    if (!Photoshop::isIrb(buf)) {
  ------------------
  |  Branch (418:9): [True: 104, False: 229]
  ------------------
  419|    104|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");  // bad resource type
  420|    104|    }
  421|    229|    uint16_t resourceId = getUShort(buf + 4, bigEndian);
  422|    229|    uint32_t resourceNameLength = buf[6];
  423|    229|    uint32_t adjResourceNameLen = resourceNameLength & ~1;
  424|    229|    unsigned char resourceNameFirstChar = buf[7];
  425|       |
  426|       |    // read rest of resource name, plus any padding
  427|    229|    DataBuf resName(256);
  428|    229|    if (io_->read(resName.data(), adjResourceNameLen) != adjResourceNameLen)
  ------------------
  |  Branch (428:9): [True: 4, False: 225]
  ------------------
  429|      4|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  430|       |
  431|       |    // read resource size (actual length w/o padding!)
  432|    225|    if (io_->read(buf, 4) != 4)
  ------------------
  |  Branch (432:9): [True: 0, False: 225]
  ------------------
  433|      0|      throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  434|       |
  435|    225|    uint32_t resourceSize = getULong(buf, bigEndian);
  436|    225|    uint32_t pResourceSize = (resourceSize + 1) & ~1;  // padded resource size
  437|    225|    const size_t curOffset = io_->tell();
  438|       |
  439|       |    // Write IPTC_NAA resource block
  440|    225|    if (resourceId >= kPhotoshopResourceID::IPTC_NAA && !iptcDone) {
  ------------------
  |  Branch (440:9): [True: 191, False: 34]
  |  Branch (440:57): [True: 98, False: 93]
  ------------------
  441|     98|      newResLength += writeIptcData(iptcData_, outIo);
  442|     98|      iptcDone = true;
  443|     98|    }
  444|       |
  445|       |    // Write ExifInfo resource block
  446|    127|    else if (resourceId >= kPhotoshopResourceID::ExifInfo && !exifDone) {
  ------------------
  |  Branch (446:14): [True: 53, False: 74]
  |  Branch (446:62): [True: 24, False: 29]
  ------------------
  447|     24|      newResLength += writeExifData(exifData_, outIo);
  448|     24|      exifDone = true;
  449|     24|    }
  450|       |
  451|       |    // Write XMPpacket resource block
  452|    103|    else if (resourceId >= kPhotoshopResourceID::XMPPacket && !xmpDone) {
  ------------------
  |  Branch (452:14): [True: 26, False: 77]
  |  Branch (452:63): [True: 17, False: 9]
  ------------------
  453|     17|      newResLength += writeXmpData(xmpData_, outIo);
  454|     17|      xmpDone = true;
  455|     17|    }
  456|       |
  457|       |    // Copy all other resource blocks
  458|    225|    if (resourceId != kPhotoshopResourceID::IPTC_NAA && resourceId != kPhotoshopResourceID::ExifInfo &&
  ------------------
  |  Branch (458:9): [True: 172, False: 53]
  |  Branch (458:57): [True: 157, False: 15]
  ------------------
  459|    157|        resourceId != kPhotoshopResourceID::XMPPacket) {
  ------------------
  |  Branch (459:9): [True: 140, False: 17]
  ------------------
  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|    140|      ul2Data(buf, resourceType, bigEndian);
  467|    140|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (467:11): [True: 0, False: 140]
  ------------------
  468|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  469|    140|      us2Data(buf, resourceId, bigEndian);
  470|    140|      if (outIo.write(buf, 2) != 2)
  ------------------
  |  Branch (470:11): [True: 0, False: 140]
  ------------------
  471|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  472|       |      // Write resource name as Pascal string
  473|    140|      buf[0] = resourceNameLength & 0x00ff;
  474|    140|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (474:11): [True: 0, False: 140]
  ------------------
  475|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  476|    140|      buf[0] = resourceNameFirstChar;
  477|    140|      if (outIo.write(buf, 1) != 1)
  ------------------
  |  Branch (477:11): [True: 0, False: 140]
  ------------------
  478|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  479|    140|      if (outIo.write(resName.c_data(), adjResourceNameLen) != static_cast<size_t>(adjResourceNameLen))
  ------------------
  |  Branch (479:11): [True: 0, False: 140]
  ------------------
  480|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  481|    140|      ul2Data(buf, resourceSize, bigEndian);
  482|    140|      if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (482:11): [True: 0, False: 140]
  ------------------
  483|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  484|       |
  485|    140|      readTotal = 0;
  486|    239|      while (readTotal < pResourceSize) {
  ------------------
  |  Branch (486:14): [True: 109, False: 130]
  ------------------
  487|       |        /// \todo almost same code as in lines 403-410. Factor out & reuse!
  488|    109|        auto toRead = std::min<size_t>(pResourceSize - readTotal, lbuf.size());
  489|    109|        if (io_->read(lbuf.data(), toRead) != toRead) {
  ------------------
  |  Branch (489:13): [True: 10, False: 99]
  ------------------
  490|     10|          throw Error(ErrorCode::kerNotAnImage, "Photoshop");
  491|     10|        }
  492|     99|        readTotal += toRead;
  493|     99|        if (outIo.write(lbuf.c_data(), toRead) != toRead)
  ------------------
  |  Branch (493:13): [True: 0, False: 99]
  ------------------
  494|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  495|     99|      }
  496|    130|      if (outIo.error())
  ------------------
  |  Branch (496:11): [True: 0, False: 130]
  ------------------
  497|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  498|    130|      newResLength += pResourceSize + adjResourceNameLen + 12;
  499|    130|    }
  500|       |
  501|    215|    io_->seek(curOffset + pResourceSize, BasicIo::beg);
  502|    215|    oldResLength -= (12 + adjResourceNameLen + pResourceSize);
  503|    215|  }
  504|       |
  505|       |  // Append IPTC_NAA resource block, if not yet written
  506|     33|  if (!iptcDone) {
  ------------------
  |  Branch (506:7): [True: 26, False: 7]
  ------------------
  507|     26|    newResLength += writeIptcData(iptcData_, outIo);
  508|     26|    iptcDone = true;
  509|     26|  }
  510|       |
  511|       |  // Append ExifInfo resource block, if not yet written
  512|     33|  if (!exifDone) {
  ------------------
  |  Branch (512:7): [True: 31, False: 2]
  ------------------
  513|     31|    newResLength += writeExifData(exifData_, outIo);
  514|     31|  }
  515|       |
  516|       |  // Append XmpPacket resource block, if not yet written
  517|     33|  if (!xmpDone) {
  ------------------
  |  Branch (517:7): [True: 32, False: 1]
  ------------------
  518|     32|    newResLength += writeXmpData(xmpData_, outIo);
  519|     32|  }
  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|     33|  io_->populateFakeData();
  524|       |
  525|       |  // Copy remaining data
  526|     33|  size_t readSize = io_->read(lbuf.data(), lbuf.size());
  527|    434|  while (readSize != 0) {
  ------------------
  |  Branch (527:10): [True: 401, False: 33]
  ------------------
  528|    401|    if (outIo.write(lbuf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (528:9): [True: 0, False: 401]
  ------------------
  529|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  530|    401|    readSize = io_->read(lbuf.data(), lbuf.size());
  531|    401|  }
  532|     33|  if (outIo.error())
  ------------------
  |  Branch (532:7): [True: 0, False: 33]
  ------------------
  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|     33|  outIo.seek(resLenOffset, BasicIo::beg);
  540|     33|  ul2Data(buf, newResLength, bigEndian);
  541|     33|  if (outIo.write(buf, 4) != 4)
  ------------------
  |  Branch (541:7): [True: 0, False: 33]
  ------------------
  542|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  543|       |
  544|     33|}  // PsdImage::doWriteMetadata
_ZN5Exiv28PsdImage13writeIptcDataERKNS_8IptcDataERNS_7BasicIoE:
  546|    124|uint32_t PsdImage::writeIptcData(const IptcData& iptcData, BasicIo& out) {
  547|    124|  uint32_t resLength = 0;
  548|    124|  byte buf[8];
  549|       |
  550|    124|  if (!iptcData.empty()) {
  ------------------
  |  Branch (550:7): [True: 18, False: 106]
  ------------------
  551|     18|    DataBuf rawIptc = IptcParser::encode(iptcData);
  552|     18|    if (!rawIptc.empty()) {
  ------------------
  |  Branch (552:9): [True: 18, 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|     18|      if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_[0]), 4) != 4)
  ------------------
  |  Branch (557:11): [True: 0, False: 18]
  ------------------
  558|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  559|     18|      us2Data(buf, kPhotoshopResourceID::IPTC_NAA, bigEndian);
  560|     18|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (560:11): [True: 0, False: 18]
  ------------------
  561|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  562|     18|      us2Data(buf, 0, bigEndian);  // NULL resource name
  563|     18|      if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (563:11): [True: 0, False: 18]
  ------------------
  564|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  565|     18|      ul2Data(buf, static_cast<uint32_t>(rawIptc.size()), bigEndian);
  566|     18|      if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (566:11): [True: 0, False: 18]
  ------------------
  567|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  568|       |      // Write encoded Iptc data
  569|     18|      if (out.write(rawIptc.c_data(), rawIptc.size()) != rawIptc.size())
  ------------------
  |  Branch (569:11): [True: 0, False: 18]
  ------------------
  570|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  571|     18|      resLength += static_cast<uint32_t>(rawIptc.size()) + 12;
  572|     18|      if (rawIptc.size() & 1)  // even padding
  ------------------
  |  Branch (572:11): [True: 14, False: 4]
  ------------------
  573|     14|      {
  574|     14|        buf[0] = 0;
  575|     14|        if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (575:13): [True: 0, False: 14]
  ------------------
  576|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  577|     14|        resLength++;
  578|     14|      }
  579|     18|    }
  580|     18|  }
  581|    124|  return resLength;
  582|    124|}  // PsdImage::writeIptcData
_ZN5Exiv28PsdImage13writeExifDataERNS_8ExifDataERNS_7BasicIoE:
  584|     55|uint32_t PsdImage::writeExifData(ExifData& exifData, BasicIo& out) {
  585|     55|  uint32_t resLength = 0;
  586|     55|  byte buf[8];
  587|       |
  588|     55|  if (!exifData.empty()) {
  ------------------
  |  Branch (588:7): [True: 2, False: 53]
  ------------------
  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|     55|  return resLength;
  627|     55|}  // PsdImage::writeExifData
_ZNK5Exiv28PsdImage12writeXmpDataERKNS_7XmpDataERNS_7BasicIoE:
  629|     49|uint32_t PsdImage::writeXmpData(const XmpData& xmpData, BasicIo& out) const {
  630|     49|  std::string xmpPacket;
  631|     49|  uint32_t resLength = 0;
  632|     49|  byte buf[8];
  633|       |
  634|       |#ifdef EXIV2_DEBUG_MESSAGES
  635|       |  std::cerr << "writeXmpFromPacket(): " << writeXmpFromPacket() << "\n";
  636|       |#endif
  637|       |  //        writeXmpFromPacket(true);
  638|     49|  if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket, xmpData) > 1) {
  ------------------
  |  Branch (638:7): [True: 49, False: 0]
  |  Branch (638:32): [True: 0, False: 49]
  ------------------
  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|     49|  if (!xmpPacket.empty()) {
  ------------------
  |  Branch (644:7): [True: 4, False: 45]
  ------------------
  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|      4|    if (out.write(reinterpret_cast<const byte*>(Photoshop::irbId_[0]), 4) != 4)
  ------------------
  |  Branch (649:9): [True: 0, False: 4]
  ------------------
  650|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  651|      4|    us2Data(buf, kPhotoshopResourceID::XMPPacket, bigEndian);
  652|      4|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (652:9): [True: 0, False: 4]
  ------------------
  653|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  654|      4|    us2Data(buf, 0, bigEndian);  // NULL resource name
  655|      4|    if (out.write(buf, 2) != 2)
  ------------------
  |  Branch (655:9): [True: 0, False: 4]
  ------------------
  656|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  657|      4|    ul2Data(buf, static_cast<uint32_t>(xmpPacket.size()), bigEndian);
  658|      4|    if (out.write(buf, 4) != 4)
  ------------------
  |  Branch (658:9): [True: 0, False: 4]
  ------------------
  659|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  660|       |    // Write XMPPacket
  661|      4|    if (out.write(reinterpret_cast<const byte*>(xmpPacket.data()), xmpPacket.size()) != xmpPacket.size())
  ------------------
  |  Branch (661:9): [True: 0, False: 4]
  ------------------
  662|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  663|      4|    if (out.error())
  ------------------
  |  Branch (663:9): [True: 0, False: 4]
  ------------------
  664|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  665|      4|    resLength += static_cast<uint32_t>(xmpPacket.size()) + 12;
  666|      4|    if (xmpPacket.size() & 1)  // even padding
  ------------------
  |  Branch (666:9): [True: 3, False: 1]
  ------------------
  667|      3|    {
  668|      3|      buf[0] = 0;
  669|      3|      if (out.write(buf, 1) != 1)
  ------------------
  |  Branch (669:11): [True: 0, False: 3]
  ------------------
  670|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  671|      3|      resLength++;
  672|      3|    }
  673|      4|  }
  674|     49|  return resLength;
  675|     49|}  // PsdImage::writeXmpData
_ZN5Exiv214newPsdInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  679|  1.96k|Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  680|  1.96k|  auto image = std::make_unique<PsdImage>(std::move(io), params);
  681|  1.96k|  if (!image->good()) {
  ------------------
  |  Branch (681:7): [True: 78, False: 1.89k]
  ------------------
  682|     78|    return nullptr;
  683|     78|  }
  684|  1.89k|  return image;
  685|  1.96k|}
_ZN5Exiv29isPsdTypeERNS_7BasicIoEb:
  687|  29.6k|bool isPsdType(BasicIo& iIo, bool advance) {
  688|  29.6k|  const int32_t len = 6;
  689|  29.6k|  const std::array<byte, len> PsdHeader{'8', 'B', 'P', 'S', 0, 1};
  690|  29.6k|  std::array<byte, len> buf;
  691|  29.6k|  iIo.read(buf.data(), len);
  692|  29.6k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (692:7): [True: 0, False: 29.6k]
  |  Branch (692:22): [True: 580, False: 29.0k]
  ------------------
  693|    580|    return false;
  694|    580|  }
  695|  29.0k|  bool matched = buf == PsdHeader;
  696|  29.0k|  if (!advance || !matched) {
  ------------------
  |  Branch (696:7): [True: 28.8k, False: 151]
  |  Branch (696:19): [True: 0, False: 151]
  ------------------
  697|  28.8k|    iIo.seek(-len, BasicIo::cur);
  698|  28.8k|  }
  699|       |
  700|  29.0k|  return matched;
  701|  29.6k|}

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  6.50k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  6.50k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  6.47k|std::string QuickTimeVideo::mimeType() const {
  544|  6.47k|  return "video/quicktime";
  545|  6.47k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  547|    411|void QuickTimeVideo::writeMetadata() {
  548|    411|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  6.47k|void QuickTimeVideo::readMetadata() {
  551|  6.47k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 6.47k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  6.47k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 6.47k]
  ------------------
  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|  6.47k|  IoCloser closer(*io_);
  562|  6.47k|  clearMetadata();
  563|  6.47k|  continueTraversing_ = true;
  564|  6.47k|  height_ = width_ = 1;
  565|       |
  566|  6.47k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  6.47k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  70.5k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 64.0k, False: 6.47k]
  ------------------
  570|  64.0k|    decodeBlock(0);
  571|       |
  572|  6.47k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  6.47k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  76.5k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  76.5k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  76.5k|  const long bufMinSize = 4;
  579|  76.5k|  DataBuf buf(bufMinSize + 1);
  580|  76.5k|  uint64_t size = 0;
  581|  76.5k|  buf.data()[4] = '\0';
  582|       |
  583|  76.5k|  io_->read(buf.data(), 4);
  584|  76.5k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 640, False: 75.9k]
  ------------------
  585|    640|    continueTraversing_ = false;
  586|    640|    return;
  587|    640|  }
  588|       |
  589|  75.9k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  75.9k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  75.9k|  size_t hdrsize = 8;
  595|       |
  596|  75.9k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 306, False: 75.6k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    306|    DataBuf data(8);
  599|    306|    hdrsize += 8;
  600|    306|    io_->readOrThrow(data.data(), data.size());
  601|    306|    size = data.read_uint64(0, bigEndian);
  602|  75.6k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 597, False: 75.0k]
  |  Branch (602:27): [True: 254, False: 343]
  ------------------
  603|    254|    size = buf.read_uint32(0, bigEndian);
  604|    254|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|    254|  }
  606|       |
  607|  75.9k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  75.9k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  75.9k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  610|       |
  611|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  612|  75.9k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  75.9k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 9.79k, False: 66.1k]
  ------------------
  614|  9.79k|    discard(newsize);
  615|  9.79k|    return;
  616|  9.79k|  }
  617|  66.1k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  66.1k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  63.0k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  63.0k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  63.0k|  assert(buf.size() > 4);
  631|       |
  632|  63.0k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 63.0k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  63.0k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 10.2k, False: 52.7k]
  ------------------
  636|  10.2k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  52.7k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 3.49k, False: 49.2k]
  ------------------
  638|  3.49k|    fileTypeDecoder(size);
  639|       |
  640|  49.2k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 6.32k, False: 42.9k]
  ------------------
  641|  6.32k|    setMediaStream(size);
  642|       |
  643|  42.9k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 303, False: 42.6k]
  ------------------
  644|    303|    movieHeaderDecoder(size);
  645|       |
  646|  42.6k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 831, False: 41.8k]
  ------------------
  647|    831|    trackHeaderDecoder(size);
  648|       |
  649|  41.8k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 1.64k, False: 40.1k]
  ------------------
  650|  1.64k|    mediaHeaderDecoder(size);
  651|       |
  652|  40.1k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 5.47k, False: 34.6k]
  ------------------
  653|  5.47k|    handlerDecoder(size);
  654|       |
  655|  34.6k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 5.78k, False: 28.9k]
  ------------------
  656|  5.78k|    videoHeaderDecoder(size);
  657|       |
  658|  28.9k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 8.35k, False: 20.5k]
  ------------------
  659|  8.35k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  20.5k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 1.93k, False: 18.6k]
  ------------------
  662|  1.93k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  18.6k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 1.40k, False: 17.2k]
  ------------------
  665|  1.40k|    sampleDesc(size);
  666|       |
  667|  17.2k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 1.49k, False: 15.7k]
  ------------------
  668|  1.49k|    timeToSampleDecoder();
  669|       |
  670|  15.7k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 1.89k, False: 13.8k]
  ------------------
  671|  1.89k|    previewTagDecoder(size);
  672|       |
  673|  13.8k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 1.27k, False: 12.5k]
  ------------------
  674|  1.27k|    trackApertureTagDecoder(size);
  675|       |
  676|  12.5k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 622, False: 11.9k]
  ------------------
  677|    622|    keysTagDecoder(size);
  678|       |
  679|  11.9k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 257, False: 11.6k]
  ------------------
  680|    257|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 138, False: 119]
  ------------------
  681|    138|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    119|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 53, False: 66]
  ------------------
  683|     53|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|     66|    else
  685|     66|      discard(size);
  686|    257|  }
  687|       |
  688|  11.6k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 496, False: 11.1k]
  ------------------
  689|    496|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 122, False: 374]
  ------------------
  690|    122|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    374|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 307, False: 67]
  ------------------
  692|    307|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|     67|    else
  694|     67|      discard(size);
  695|    496|  }
  696|       |
  697|  11.1k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 194, False: 10.9k]
  ------------------
  698|    194|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|    194|  }
  700|       |
  701|  10.9k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 943, False: 10.0k]
  ------------------
  702|    943|    io_->readOrThrow(buf.data(), 4);
  703|    943|    io_->readOrThrow(buf.data(), 4);
  704|    943|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|    943|  }
  706|       |
  707|  10.0k|  else {
  708|  10.0k|    discard(size);
  709|  10.0k|  }
  710|  63.0k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  19.9k|void QuickTimeVideo::discard(size_t size) {
  713|  19.9k|  size_t cur_pos = io_->tell();
  714|  19.9k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  19.9k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|  1.89k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|  1.89k|  DataBuf buf(5);
  719|  1.89k|  size_t cur_pos = io_->tell();
  720|  1.89k|  io_->readOrThrow(buf.data(), 4);
  721|  1.89k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|  1.89k|  io_->readOrThrow(buf.data(), 2);
  723|  1.89k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|  1.89k|  io_->readOrThrow(buf.data(), 4);
  726|  1.89k|  buf.write_uint8(4, 0);  // nul-terminate string
  727|  1.89k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 34, False: 1.86k]
  ------------------
  728|     34|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|  1.86k|  else
  730|  1.86k|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|  1.89k|  io_->seek(cur_pos + size, BasicIo::beg);
  733|  1.89k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    622|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    622|  DataBuf buf(5);
  737|    622|  size_t cur_pos = io_->tell();
  738|    622|  io_->readOrThrow(buf.data(), 4);
  739|    622|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    622|  io_->readOrThrow(buf.data(), 2);
  741|    622|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    622|  io_->readOrThrow(buf.data(), 4);
  744|    622|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    622|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 58, False: 564]
  ------------------
  746|     58|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    564|  else
  748|    564|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    622|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    622|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|  1.27k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|  1.27k|  DataBuf buf(4);
  755|  1.27k|  DataBuf buf2(2);
  756|  1.27k|  size_t cur_pos = io_->tell();
  757|  1.27k|  byte n = 3;
  758|       |
  759|  5.10k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 3.82k, False: 1.27k]
  ------------------
  760|  3.82k|    io_->seek(4L, BasicIo::cur);
  761|  3.82k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  3.82k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 21, False: 3.80k]
  ------------------
  764|     21|      io_->seek(4L, BasicIo::cur);
  765|     21|      io_->readOrThrow(buf.data(), 2);
  766|     21|      io_->readOrThrow(buf2.data(), 2);
  767|     21|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|     21|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     21|#define stringFormat std::format
  ------------------
  769|     21|      io_->readOrThrow(buf.data(), 2);
  770|     21|      io_->readOrThrow(buf2.data(), 2);
  771|     21|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|     21|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     21|#define stringFormat std::format
  ------------------
  773|     21|    }
  774|       |
  775|  3.80k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 488, False: 3.32k]
  ------------------
  776|    488|      io_->seek(4L, BasicIo::cur);
  777|    488|      io_->readOrThrow(buf.data(), 2);
  778|    488|      io_->readOrThrow(buf2.data(), 2);
  779|    488|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|    488|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    488|#define stringFormat std::format
  ------------------
  781|    488|      io_->readOrThrow(buf.data(), 2);
  782|    488|      io_->readOrThrow(buf2.data(), 2);
  783|    488|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|    488|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    488|#define stringFormat std::format
  ------------------
  785|    488|    }
  786|       |
  787|  3.32k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 20, False: 3.30k]
  ------------------
  788|     20|      io_->seek(4L, BasicIo::cur);
  789|     20|      io_->readOrThrow(buf.data(), 2);
  790|     20|      io_->readOrThrow(buf2.data(), 2);
  791|     20|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     20|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     20|#define stringFormat std::format
  ------------------
  793|     20|      io_->readOrThrow(buf.data(), 2);
  794|     20|      io_->readOrThrow(buf2.data(), 2);
  795|     20|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     20|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     20|#define stringFormat std::format
  ------------------
  797|     20|    }
  798|  3.82k|  }
  799|  1.27k|  io_->seek(cur_pos + size, BasicIo::beg);
  800|  1.27k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|  1.60k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|  1.60k|  size_t cur_pos = io_->tell();
  804|  1.60k|  DataBuf buf(49);
  805|  1.60k|  DataBuf buf2(4);
  806|       |
  807|  1.60k|  io_->readOrThrow(buf.data(), 4);
  808|  1.60k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 1.21k, False: 396]
  ------------------
  809|  1.21k|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|  1.21k|    io_->readOrThrow(buf.data(), 24);
  812|  1.21k|    buf.write_uint8(24, 0);  // nul-terminate string
  813|  1.21k|    xmpData_["Xmp.video.Make"] = buf.data();
  814|  1.21k|    io_->readOrThrow(buf.data(), 14);
  815|  1.21k|    buf.write_uint8(14, 0);  // nul-terminate string
  816|  1.21k|    xmpData_["Xmp.video.Model"] = buf.data();
  817|  1.21k|    io_->readOrThrow(buf.data(), 4);
  818|  1.21k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.21k|#define stringFormat std::format
  ------------------
  819|  1.21k|    io_->readOrThrow(buf.data(), 4);
  820|  1.21k|    io_->readOrThrow(buf2.data(), 4);
  821|  1.21k|    xmpData_["Xmp.video.FNumber"] =
  822|  1.21k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|  1.21k|    io_->readOrThrow(buf.data(), 4);
  824|  1.21k|    io_->readOrThrow(buf2.data(), 4);
  825|  1.21k|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|  1.21k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|  1.21k|    io_->readOrThrow(buf.data(), 10);
  828|  1.21k|    io_->readOrThrow(buf.data(), 4);
  829|  1.21k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 210, False: 1.00k]
  ------------------
  830|    210|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    210|#define _(String) (String)
  ------------------
  831|  1.21k|    io_->readOrThrow(buf.data(), 4);
  832|  1.21k|    io_->readOrThrow(buf2.data(), 4);
  833|  1.21k|    xmpData_["Xmp.video.FocalLength"] =
  834|  1.21k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|  1.21k|    io_->seek(95L, BasicIo::cur);
  836|  1.21k|    io_->readOrThrow(buf.data(), 48);
  837|  1.21k|    buf.write_uint8(48, 0);
  838|  1.21k|    xmpData_["Xmp.video.Software"] = buf.data();
  839|  1.21k|    io_->readOrThrow(buf.data(), 4);
  840|  1.21k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|  1.21k|  }
  842|       |
  843|  1.60k|  io_->seek(cur_pos + size, BasicIo::beg);
  844|  1.60k|}  // 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.5k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 11.1k, False: 5.43k]
  |  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: 1.56k, False: 9.56k]
  ------------------
  864|  1.56k|      break;
  865|  9.56k|    size_internal -= size;
  866|  9.56k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  9.56k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 34, False: 9.52k]
  ------------------
  869|     34|      buf.data()[0] = ' ';
  870|  9.56k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  9.56k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  9.56k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 1.73k, False: 7.83k]
  ------------------
  875|  1.73k|      break;
  876|       |
  877|  7.83k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 356, False: 7.47k]
  |  Branch (877:40): [True: 15, False: 7.46k]
  ------------------
  878|    371|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  7.46k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 1.87k, False: 5.59k]
  ------------------
  881|  1.87k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  5.59k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 1.60k, False: 3.98k]
  ------------------
  884|  1.60k|      CameraTagsDecoder(size - 8);
  885|       |
  886|  3.98k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 27, False: 3.95k]
  |  Branch (886:45): [True: 257, False: 3.69k]
  |  Branch (886:76): [True: 11, False: 3.68k]
  ------------------
  887|  3.68k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 10, False: 3.67k]
  |  Branch (887:45): [True: 364, False: 3.31k]
  ------------------
  888|    669|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    669|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    669|#define _(String) (String)
  ------------------
  890|    669|    }
  891|       |
  892|  3.31k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 109, False: 3.20k]
  |  Branch (892:45): [True: 0, False: 3.20k]
  ------------------
  893|    109|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|    109|      io_->readOrThrow(buf.data(), 2);
  895|    109|      buf.data()[2] = '\0';
  896|    109|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|    109|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 37, False: 72]
  ------------------
  899|     37|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     37|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     37|#define _(String) (String)
  ------------------
  900|     72|      else
  901|     72|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     72|#define _(String) (String)
  ------------------
  902|    109|    }
  903|       |
  904|  3.20k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 546, False: 2.65k]
  ------------------
  905|    546|      io_->readOrThrow(buf.data(), 4);
  906|    546|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    546|#define _(String) (String)
  ------------------
  907|    546|    }
  908|       |
  909|  2.65k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 282, False: 2.37k]
  ------------------
  910|    282|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  7.83k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  7.83k|  }
  914|       |
  915|  8.72k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  8.72k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.87k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.87k|  size_t cur_pos = io_->tell();
  920|  1.87k|  DataBuf buf(201);
  921|  1.87k|  DataBuf buf2(4 + 1);
  922|  1.87k|  uint32_t TagID = 0;
  923|  1.87k|  uint16_t dataLength = 0;
  924|  1.87k|  uint16_t dataType = 2;
  925|  1.87k|  const TagDetails* td;
  926|  1.87k|  const TagDetails* td2;
  927|       |
  928|   105k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 103k, False: 1.87k]
  ------------------
  929|   103k|    io_->readOrThrow(buf.data(), 4);
  930|   103k|    TagID = buf.read_uint32(0, bigEndian);
  931|   103k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   103k|    io_->readOrThrow(buf.data(), 2);
  934|   103k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   103k|    std::memset(buf.data(), 0x0, buf.size());
  937|   103k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   103k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 5.17k, False: 98.5k]
  ------------------
  940|  5.17k|      size_t local_pos = io_->tell();
  941|  5.17k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  5.17k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  5.17k|      io_->readOrThrow(buf.data(), 4);
  945|  5.17k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  5.17k|      io_->readOrThrow(buf.data(), 20);
  947|  5.17k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  5.17k|      io_->readOrThrow(buf.data(), 20);
  949|  5.17k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  5.17k|      io_->readOrThrow(buf.data(), 4);
  951|  5.17k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  5.17k|      io_->readOrThrow(buf.data(), 1);
  954|  5.17k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  5.17k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 2.85k, False: 2.31k]
  ------------------
  956|  2.85k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.85k|#define _(String) (String)
  ------------------
  957|  2.31k|      else
  958|  2.31k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  5.17k|      io_->readOrThrow(buf.data(), 1);
  961|  5.17k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  5.17k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 3.44k, False: 1.72k]
  ------------------
  963|  3.44k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.44k|#define _(String) (String)
  ------------------
  964|       |
  965|  5.17k|      io_->readOrThrow(buf.data(), 1);
  966|  5.17k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  5.17k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 3.52k, False: 1.65k]
  ------------------
  968|  3.52k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  3.52k|#define _(String) (String)
  ------------------
  969|  1.65k|      else
  970|  1.65k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  5.17k|      io_->readOrThrow(buf.data(), 1);
  973|  5.17k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  5.17k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 3.20k, False: 1.96k]
  ------------------
  975|  3.20k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  3.20k|#define _(String) (String)
  ------------------
  976|  1.96k|      else
  977|  1.96k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  5.17k|      io_->readOrThrow(buf.data(), 1);
  980|  5.17k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  5.17k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 3.54k, False: 1.62k]
  ------------------
  982|  3.54k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  3.54k|#define _(String) (String)
  ------------------
  983|  1.62k|      else
  984|  1.62k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  5.17k|      io_->readOrThrow(buf.data(), 1);
  987|  5.17k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  5.17k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 2.80k, False: 2.36k]
  ------------------
  989|  2.80k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  2.80k|#define _(String) (String)
  ------------------
  990|  2.36k|      else
  991|  2.36k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  5.17k|      io_->readOrThrow(buf.data(), 1);
  994|  5.17k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  5.17k|      io_->readOrThrow(buf.data(), 1);
  997|  5.17k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  5.17k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 1.25k, False: 3.91k]
  ------------------
  999|  1.25k|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.25k|#define _(String) (String)
  ------------------
 1000|  3.91k|      else
 1001|  3.91k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  5.17k|      io_->readOrThrow(buf.data(), 1);
 1004|  5.17k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  5.17k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 2.27k, False: 2.89k]
  ------------------
 1006|  2.27k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  2.27k|#define _(String) (String)
  ------------------
 1007|  2.89k|      else
 1008|  2.89k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  5.17k|      io_->readOrThrow(buf.data(), 1);
 1011|  5.17k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  5.17k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  5.17k|    }
 1015|       |
 1016|  98.5k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 1.20k, False: 97.3k]
  ------------------
 1017|  1.20k|      size_t local_pos = io_->tell();
 1018|  1.20k|      dataLength = buf.read_uint16(0, bigEndian);
 1019|  1.20k|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|  1.20k|      io_->readOrThrow(buf.data(), 2);
 1022|  1.20k|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|  1.20k|      io_->readOrThrow(buf.data(), 1);
 1024|  1.20k|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|  1.20k|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 583, False: 618]
  ------------------
 1026|    583|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    583|#define _(String) (String)
  ------------------
 1027|       |
 1028|  1.20k|      io_->readOrThrow(buf.data(), 1);
 1029|  1.20k|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|  1.20k|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 913, False: 288]
  ------------------
 1031|    913|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    913|#define _(String) (String)
  ------------------
 1032|       |
 1033|  1.20k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|  1.20k|    }
 1035|       |
 1036|  97.3k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 2.11k, False: 95.2k]
  |  Branch (1036:31): [True: 450, False: 94.8k]
  ------------------
 1037|  1.88k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.88k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.88k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 1.01k, False: 876]
  ------------------
 1042|  1.01k|#ifndef SUPPRESS_WARNINGS
 1043|  1.01k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|  1.01k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.01k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.01k|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|  1.01k|#endif
 1046|  1.01k|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|  1.01k|        buf.data()[0] = '\0';
 1048|  1.01k|      } else {
 1049|    876|        io_->readOrThrow(buf.data(), dataLength);
 1050|    876|        buf.data()[dataLength] = '\0';
 1051|    876|      }
 1052|       |
 1053|  1.88k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 766, False: 1.12k]
  ------------------
 1054|    766|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    766|#define _(String) (String)
  ------------------
 1055|    766|      }
 1056|  95.4k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 1.37k, False: 94.1k]
  ------------------
 1057|  1.37k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  1.37k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  1.37k|      io_->readOrThrow(buf.data(), 4);
 1060|  1.37k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 600, False: 774]
  ------------------
 1061|    600|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    600|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  1.37k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 498, False: 876]
  |  Branch (1064:31): [True: 502, False: 374]
  ------------------
 1065|    998|#ifndef SUPPRESS_WARNINGS
 1066|    998|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    998|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 998]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    998|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    998|#endif
 1069|    998|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    998|      } else
 1071|    376|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  94.1k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 2.87k, False: 91.2k]
  ------------------
 1073|  2.87k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  2.87k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  2.87k|      io_->readOrThrow(buf.data(), 2);
 1076|  2.87k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 1.47k, False: 1.40k]
  ------------------
 1077|  1.47k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.47k|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  2.87k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 2.17k, False: 702]
  |  Branch (1080:31): [True: 515, False: 187]
  ------------------
 1081|  2.68k|#ifndef SUPPRESS_WARNINGS
 1082|  2.68k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.68k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.68k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.68k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  2.68k|#endif
 1085|  2.68k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  2.68k|      } else
 1087|    190|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  91.2k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 1.12k, False: 90.1k]
  ------------------
 1089|  1.12k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  1.12k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  1.12k|      io_->readOrThrow(buf.data(), 4);
 1092|  1.12k|      io_->readOrThrow(buf2.data(), 4);
 1093|  1.12k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 383, False: 742]
  ------------------
 1094|    383|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    383|#define _(String) (String)
  ------------------
 1095|    383|            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.12k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 353, False: 772]
  |  Branch (1098:31): [True: 434, False: 338]
  ------------------
 1099|    779|#ifndef SUPPRESS_WARNINGS
 1100|    779|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    779|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 779]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    779|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    779|#endif
 1103|    779|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    779|      } else
 1105|    346|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  90.1k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.81k, False: 88.3k]
  ------------------
 1107|  1.81k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.81k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.81k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.81k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.81k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 536, False: 1.27k]
  ------------------
 1112|    536|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    536|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    536|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.81k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 838, False: 972]
  |  Branch (1115:31): [True: 394, False: 578]
  ------------------
 1116|  1.23k|#ifndef SUPPRESS_WARNINGS
 1117|  1.23k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.23k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.23k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.23k|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|  1.23k|#endif
 1120|  1.23k|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|  1.23k|      } else
 1122|    579|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.81k|    }
 1124|   103k|  }
 1125|       |
 1126|  1.87k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.87k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  6.32k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  6.32k|  size_t current_position = io_->tell();
 1131|  6.32k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  6.32k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 6.32k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  6.32k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  73.0k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 73.0k, False: 0]
  |  Branch (1136:25): [True: 71.3k, False: 1.75k]
  ------------------
 1137|  71.3k|    io_->readOrThrow(buf.data(), 4);
 1138|  71.3k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 4.57k, False: 66.7k]
  ------------------
 1139|  4.57k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 618, False: 3.95k]
  ------------------
 1140|    618|        break;
 1141|  3.95k|      io_->readOrThrow(buf.data(), 4);
 1142|  3.95k|      io_->readOrThrow(buf.data(), 4);
 1143|  3.95k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  3.95k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 66, False: 3.89k]
  ------------------
 1146|     66|        currentStream_ = Video;
 1147|  3.89k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 770, False: 3.12k]
  ------------------
 1148|    770|        currentStream_ = Audio;
 1149|  3.12k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 138, False: 2.98k]
  ------------------
 1150|    138|        currentStream_ = Hint;
 1151|  2.98k|      else
 1152|  2.98k|        currentStream_ = GenMediaHeader;
 1153|  3.95k|      break;
 1154|  4.57k|    }
 1155|  71.3k|  }
 1156|       |
 1157|  6.32k|  io_->seek(current_position, BasicIo::beg);
 1158|  6.32k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|  1.49k|void QuickTimeVideo::timeToSampleDecoder() {
 1161|  1.49k|  DataBuf buf(4 + 1);
 1162|  1.49k|  io_->readOrThrow(buf.data(), 4);
 1163|  1.49k|  io_->readOrThrow(buf.data(), 4);
 1164|  1.49k|  uint64_t totalframes = 0;
 1165|  1.49k|  uint64_t timeOfFrames = 0;
 1166|  1.49k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  3.79k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 2.30k, False: 1.49k]
  ------------------
 1169|  2.30k|    io_->readOrThrow(buf.data(), 4);
 1170|  2.30k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  2.30k|    totalframes = Safe::add(totalframes, temp);
 1172|  2.30k|    io_->readOrThrow(buf.data(), 4);
 1173|  2.30k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  2.30k|  }
 1175|  1.49k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 237, False: 1.25k]
  ------------------
 1176|    237|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 19, False: 218]
  ------------------
 1177|     19|      timeOfFrames = 1;
 1178|    237|    xmpData_["Xmp.video.FrameRate"] =
 1179|    237|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    237|  }
 1181|  1.49k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.40k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.40k|  DataBuf buf(100);
 1185|  1.40k|  size_t cur_pos = io_->tell();
 1186|  1.40k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.40k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.40k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|  86.6k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 85.6k, False: 994]
  ------------------
 1191|  85.6k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 46.7k, False: 38.8k]
  ------------------
 1192|  46.7k|      imageDescDecoder();
 1193|  38.8k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 38.4k, False: 414]
  ------------------
 1194|  38.4k|      audioDescDecoder();
 1195|    414|    else
 1196|    414|      break;
 1197|  85.6k|  }
 1198|  1.40k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.40k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  38.4k|void QuickTimeVideo::audioDescDecoder() {
 1202|  38.4k|  DataBuf buf(40);
 1203|  38.4k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  38.4k|  buf.data()[4] = '\0';
 1205|  38.4k|  io_->readOrThrow(buf.data(), 4);
 1206|  38.4k|  size_t size = 82;
 1207|       |
 1208|  38.4k|  const TagVocabulary* td;
 1209|       |
 1210|   806k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 767k, False: 38.3k]
  ------------------
 1211|   767k|    io_->readOrThrow(buf.data(), 4);
 1212|   767k|    switch (i) {
 1213|  38.4k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 38.4k, False: 729k]
  ------------------
 1214|  38.4k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  38.4k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 878, False: 37.5k]
  ------------------
 1216|    878|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    878|#define _(String) (String)
  ------------------
 1217|  37.5k|        else
 1218|  37.5k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  38.4k|        break;
 1220|  38.4k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 38.4k, False: 729k]
  ------------------
 1221|  38.4k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  38.4k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 1.31k, False: 37.1k]
  ------------------
 1223|  1.31k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.31k|#define _(String) (String)
  ------------------
 1224|  38.4k|        break;
 1225|  38.4k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 38.4k, False: 729k]
  ------------------
 1226|  38.4k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  38.4k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  38.4k|        break;
 1229|  38.4k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 38.4k, False: 729k]
  ------------------
 1230|  38.4k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  38.4k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  38.4k|        break;
 1233|   613k|      default:
  ------------------
  |  Branch (1233:7): [True: 613k, False: 153k]
  ------------------
 1234|   613k|        break;
 1235|   767k|    }
 1236|   767k|  }
 1237|  38.3k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  38.3k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  46.7k|void QuickTimeVideo::imageDescDecoder() {
 1241|  46.7k|  DataBuf buf(40);
 1242|  46.7k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  46.7k|  buf.data()[4] = '\0';
 1244|  46.7k|  io_->readOrThrow(buf.data(), 4);
 1245|  46.7k|  size_t size = 82;
 1246|       |
 1247|  46.7k|  const TagVocabulary* td;
 1248|       |
 1249|   560k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 513k, False: 46.6k]
  ------------------
 1250|   513k|    io_->readOrThrow(buf.data(), 4);
 1251|   513k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   513k|    switch (i) {
 1254|  46.7k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 46.7k, False: 467k]
  ------------------
 1255|  46.7k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  46.7k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 608, False: 46.1k]
  ------------------
 1257|    608|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    608|#define _(String) (String)
  ------------------
 1258|  46.1k|        else
 1259|  46.1k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  46.7k|        break;
 1261|  46.7k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 46.7k, False: 467k]
  ------------------
 1262|  46.7k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  46.7k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 1.50k, False: 45.2k]
  ------------------
 1264|  1.50k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.50k|#define _(String) (String)
  ------------------
 1265|  46.7k|        break;
 1266|  46.7k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 46.7k, False: 467k]
  ------------------
 1267|  46.7k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  46.7k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  46.7k|        break;
 1270|  46.6k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 46.6k, False: 467k]
  ------------------
 1271|  46.6k|        xmpData_["Xmp.video.XResolution"] =
 1272|  46.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  46.6k|        break;
 1274|  46.6k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 46.6k, False: 467k]
  ------------------
 1275|  46.6k|        xmpData_["Xmp.video.YResolution"] =
 1276|  46.6k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  46.6k|        io_->readOrThrow(buf.data(), 3);
 1278|  46.6k|        size -= 3;
 1279|  46.6k|        break;
 1280|  46.6k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 46.6k, False: 467k]
  ------------------
 1281|  46.6k|        io_->readOrThrow(buf.data(), 32);
 1282|  46.6k|        size -= 32;
 1283|  46.6k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  46.6k|        break;
 1285|   233k|      default:
  ------------------
  |  Branch (1285:7): [True: 233k, False: 280k]
  ------------------
 1286|   233k|        break;
 1287|   513k|    }
 1288|   513k|  }
 1289|  46.6k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  46.6k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  46.6k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  1.93k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  1.93k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  1.93k|  DataBuf buf(4 + 1);
 1296|  1.93k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.93k|  io_->readOrThrow(buf.data(), 4);
 1298|  1.93k|  uint32_t noOfEntries;
 1299|       |
 1300|  1.93k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  4.20k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 2.44k, False: 1.76k]
  |  Branch (1302:43): [True: 2.27k, False: 171]
  ------------------
 1303|  2.27k|    decodeBlock(recursion_depth + 1);
 1304|  2.27k|  }
 1305|  1.93k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  5.78k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  5.78k|  DataBuf buf(3);
 1309|  5.78k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  5.78k|  buf.data()[2] = '\0';
 1311|  5.78k|  currentStream_ = Video;
 1312|       |
 1313|  5.78k|  const TagDetails* td;
 1314|       |
 1315|  31.5k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 25.7k, False: 5.78k]
  ------------------
 1316|  25.7k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  25.7k|    switch (i) {
 1319|  5.20k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 5.20k, False: 20.5k]
  ------------------
 1320|  5.20k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  5.20k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 4.43k, False: 767]
  ------------------
 1322|  4.43k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  4.43k|#define _(String) (String)
  ------------------
 1323|  5.20k|        break;
 1324|  5.20k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 5.20k, False: 20.5k]
  ------------------
 1325|  5.20k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  5.20k|        break;
 1327|  15.3k|      default:
  ------------------
  |  Branch (1327:7): [True: 15.3k, False: 10.4k]
  ------------------
 1328|  15.3k|        break;
 1329|  25.7k|    }
 1330|  25.7k|  }
 1331|  5.78k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  5.78k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  5.47k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  5.47k|  size_t cur_pos = io_->tell();
 1336|  5.47k|  DataBuf buf(5);
 1337|  5.47k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  5.47k|  buf.data()[4] = '\0';
 1339|       |
 1340|  5.47k|  const TagVocabulary* tv;
 1341|       |
 1342|  32.8k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 27.3k, False: 5.46k]
  ------------------
 1343|  27.3k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  27.3k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 16.4k, False: 10.9k]
  ------------------
 1346|  5.47k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 5.47k, False: 21.8k]
  ------------------
 1347|  5.47k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  5.47k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 3.08k, False: 2.38k]
  ------------------
 1349|  3.08k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 349, False: 2.74k]
  ------------------
 1350|    349|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    349|#define _(String) (String)
  ------------------
 1351|  2.74k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 992, False: 1.74k]
  ------------------
 1352|    992|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    992|#define _(String) (String)
  ------------------
 1353|  3.08k|        }
 1354|  5.47k|        break;
 1355|  5.47k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 5.47k, False: 21.9k]
  ------------------
 1356|  5.47k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  5.47k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 3.41k, False: 2.05k]
  ------------------
 1358|  3.41k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 432, False: 2.98k]
  ------------------
 1359|    432|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    432|#define _(String) (String)
  ------------------
 1360|  2.98k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 1.25k, False: 1.73k]
  ------------------
 1361|  1.25k|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.25k|#define _(String) (String)
  ------------------
 1362|  3.41k|        }
 1363|  5.47k|        break;
 1364|  5.47k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 5.47k, False: 21.9k]
  ------------------
 1365|  5.47k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  5.47k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 3.35k, False: 2.11k]
  ------------------
 1367|  3.35k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 290, False: 3.06k]
  ------------------
 1368|    290|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    290|#define _(String) (String)
  ------------------
 1369|  3.06k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 1.02k, False: 2.04k]
  ------------------
 1370|  1.02k|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|  1.02k|#define _(String) (String)
  ------------------
 1371|  3.35k|        }
 1372|  5.47k|        break;
 1373|  27.3k|    }
 1374|  27.3k|  }
 1375|  5.46k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  5.46k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  3.49k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  3.49k|  DataBuf buf(5);
 1380|  3.49k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  3.49k|  buf.data()[4] = '\0';
 1382|  3.49k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  3.49k|  const TagVocabulary* td;
 1384|       |
 1385|  21.4k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 17.9k, False: 3.49k]
  ------------------
 1386|  17.9k|    io_->readOrThrow(buf.data(), 4);
 1387|  17.9k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  17.9k|    switch (i) {
 1390|  3.41k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 3.41k, False: 14.5k]
  ------------------
 1391|  3.41k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 3.07k, False: 339]
  ------------------
 1392|  3.07k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  3.07k|#define _(String) (String)
  ------------------
 1393|  3.41k|        break;
 1394|  1.17k|      case 1:
  ------------------
  |  Branch (1394:7): [True: 1.17k, False: 16.7k]
  ------------------
 1395|  1.17k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|  1.17k|        break;
 1397|  13.3k|      default:
  ------------------
  |  Branch (1397:7): [True: 13.3k, False: 4.59k]
  ------------------
 1398|  13.3k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 935, False: 12.4k]
  ------------------
 1399|    935|          v->read(_(td->label_));
  ------------------
  |  |   40|    935|#define _(String) (String)
  ------------------
 1400|  12.4k|        else
 1401|  12.4k|          v->read(Exiv2::toString(buf.data()));
 1402|  13.3k|        break;
 1403|  17.9k|    }
 1404|  17.9k|  }
 1405|  3.49k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  3.49k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  3.49k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|  1.64k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|  1.64k|  DataBuf buf(5);
 1411|  1.64k|  std::memset(buf.data(), 0x0, buf.size());
 1412|  1.64k|  buf.data()[4] = '\0';
 1413|  1.64k|  int64_t time_scale = 1;
 1414|       |
 1415|  10.5k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 8.89k, False: 1.64k]
  ------------------
 1416|  8.89k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  8.89k|    switch (i) {
 1419|  1.35k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 1.35k, False: 7.53k]
  ------------------
 1420|  1.35k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 213, False: 1.14k]
  ------------------
 1421|    213|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|  1.14k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 522, False: 621]
  ------------------
 1423|    522|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|  1.35k|        break;
 1425|  1.34k|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 1.34k, False: 7.54k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|  1.34k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 207, False: 1.14k]
  ------------------
 1428|    207|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|  1.14k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 521, False: 619]
  ------------------
 1430|    521|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|  1.34k|        break;
 1432|  1.26k|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 1.26k, False: 7.63k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|  1.26k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 166, False: 1.09k]
  ------------------
 1435|    166|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|  1.09k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 521, False: 575]
  ------------------
 1437|    521|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|  1.26k|        break;
 1439|  1.26k|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 1.26k, False: 7.63k]
  ------------------
 1440|  1.26k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 166, False: 1.09k]
  ------------------
 1441|    166|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|  1.09k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 520, False: 574]
  ------------------
 1443|    520|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|  1.26k|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|  1.26k|        mdhdTimeScale_ = time_scale;
 1446|  1.26k|        break;
 1447|  1.25k|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 1.25k, False: 7.63k]
  ------------------
 1448|  1.25k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 166, False: 1.09k]
  ------------------
 1449|    166|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 166, False: 0]
  ------------------
 1450|  1.09k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 520, False: 573]
  ------------------
 1451|    520|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 520, False: 0]
  ------------------
 1452|  1.25k|        break;
 1453|  1.25k|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 1.25k, False: 7.63k]
  ------------------
 1454|  1.25k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 166, False: 1.09k]
  ------------------
 1455|    166|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|  1.09k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 520, False: 573]
  ------------------
 1457|    520|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|  1.25k|        break;
 1459|       |
 1460|  1.14k|      default:
  ------------------
  |  Branch (1460:7): [True: 1.14k, False: 7.74k]
  ------------------
 1461|  1.14k|        break;
 1462|  8.89k|    }
 1463|  8.89k|  }
 1464|  1.64k|  io_->readOrThrow(buf.data(), size % 4);
 1465|  1.64k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|    831|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|    831|  DataBuf buf(5);
 1469|    831|  std::memset(buf.data(), 0x0, buf.size());
 1470|    831|  buf.data()[4] = '\0';
 1471|    831|  int64_t temp = 0;
 1472|       |
 1473|  15.6k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 14.8k, False: 831]
  ------------------
 1474|  14.8k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  14.8k|    switch (i) {
 1477|    697|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 697, False: 14.1k]
  ------------------
 1478|    697|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 51, False: 646]
  ------------------
 1479|     51|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|    646|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 377, False: 269]
  ------------------
 1481|    377|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    697|        break;
 1483|    696|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 696, False: 14.1k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|    696|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 51, False: 645]
  ------------------
 1486|     51|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|    645|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 377, False: 268]
  ------------------
 1488|    377|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    696|        break;
 1490|    694|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 694, False: 14.1k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|    694|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 51, False: 643]
  ------------------
 1493|     51|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|    643|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 377, False: 266]
  ------------------
 1495|    377|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    694|        break;
 1497|    692|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 692, False: 14.1k]
  ------------------
 1498|    692|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 51, False: 641]
  ------------------
 1499|     51|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|    641|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 377, False: 264]
  ------------------
 1501|    377|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    692|        break;
 1503|    689|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 689, False: 14.1k]
  ------------------
 1504|    689|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 50, False: 639]
  ------------------
 1505|     50|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 50, False: 0]
  ------------------
 1506|    639|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 377, False: 262]
  ------------------
 1507|    377|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 377, False: 0]
  ------------------
 1508|    689|        break;
 1509|    688|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 688, False: 14.1k]
  ------------------
 1510|    688|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 50, False: 638]
  ------------------
 1511|     50|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|    638|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 377, False: 261]
  ------------------
 1513|    377|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    688|        break;
 1515|    688|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 688, False: 14.1k]
  ------------------
 1516|    688|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 50, False: 638]
  ------------------
 1517|     50|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|    638|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 377, False: 261]
  ------------------
 1519|    377|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    688|        break;
 1521|    682|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 682, False: 14.1k]
  ------------------
 1522|    682|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 49, False: 633]
  ------------------
 1523|     49|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|     49|          xmpData_["Xmp.video.Width"] = temp;
 1525|     49|          width_ = temp;
 1526|     49|        }
 1527|    682|        break;
 1528|    682|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 682, False: 14.1k]
  ------------------
 1529|    682|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 49, False: 633]
  ------------------
 1530|     49|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|     49|          xmpData_["Xmp.video.Height"] = temp;
 1532|     49|          height_ = temp;
 1533|     49|        }
 1534|    682|        break;
 1535|  8.60k|      default:
  ------------------
  |  Branch (1535:7): [True: 8.60k, False: 6.20k]
  ------------------
 1536|  8.60k|        break;
 1537|  14.8k|    }
 1538|  14.8k|  }
 1539|    831|  io_->readOrThrow(buf.data(), size % 4);
 1540|    831|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|    303|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|    303|  DataBuf buf(5);
 1544|    303|  std::memset(buf.data(), 0x0, buf.size());
 1545|    303|  buf.data()[4] = '\0';
 1546|       |
 1547|  3.32k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 3.02k, False: 303]
  ------------------
 1548|  3.02k|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|  3.02k|    switch (i) {
 1551|    284|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 284, False: 2.73k]
  ------------------
 1552|    284|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|    284|        break;
 1554|    283|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 283, False: 2.73k]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|    283|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|    283|        break;
 1558|    130|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 130, False: 2.89k]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|    130|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|    130|        break;
 1562|    128|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 128, False: 2.89k]
  ------------------
 1563|    128|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|    128|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|    128|        break;
 1566|    125|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 125, False: 2.89k]
  ------------------
 1567|    125|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 125, False: 0]
  ------------------
 1568|    125|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|    125|        }
 1570|    125|        break;
 1571|    125|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 125, False: 2.89k]
  ------------------
 1572|    125|        xmpData_["Xmp.video.PreferredRate"] =
 1573|    125|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|    125|        break;
 1575|    125|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 125, False: 2.89k]
  ------------------
 1576|    125|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|    125|        break;
 1578|     46|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 46, False: 2.97k]
  ------------------
 1579|     46|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     46|        break;
 1581|     45|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 45, False: 2.97k]
  ------------------
 1582|     45|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     45|        break;
 1584|     45|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 45, False: 2.97k]
  ------------------
 1585|     45|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     45|        break;
 1587|     44|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 44, False: 2.97k]
  ------------------
 1588|     44|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     44|        break;
 1590|     43|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 43, False: 2.97k]
  ------------------
 1591|     43|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     43|        break;
 1593|     43|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 43, False: 2.97k]
  ------------------
 1594|     43|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     43|        break;
 1596|     43|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 43, False: 2.97k]
  ------------------
 1597|     43|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|     43|        break;
 1599|  1.51k|      default:
  ------------------
  |  Branch (1599:7): [True: 1.51k, False: 1.50k]
  ------------------
 1600|  1.51k|        break;
 1601|  3.02k|    }
 1602|  3.02k|  }
 1603|    303|  io_->readOrThrow(buf.data(), size % 4);
 1604|    303|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  6.50k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  6.50k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  6.50k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 27, False: 6.47k]
  ------------------
 1609|     27|    return nullptr;
 1610|     27|  }
 1611|  6.47k|  return image;
 1612|  6.50k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  33.5k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  33.5k|  auto buf = DataBuf(12 + 1);
 1616|  33.5k|  iIo.read(buf.data(), 12);
 1617|  33.5k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  33.5k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 33.5k]
  |  Branch (1619:22): [True: 561, False: 33.0k]
  ------------------
 1620|    561|    return false;
 1621|    561|  }
 1622|  33.0k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  33.0k|  bool matched = false;
 1625|       |
 1626|   244k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 244k, False: 9.22k]
  ------------------
 1627|   244k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   244k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 23.8k, False: 220k]
  ------------------
 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|  23.8k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 19.4k, False: 4.34k]
  ------------------
 1633|  19.4k|        matched = true;
 1634|  19.4k|      }
 1635|  23.8k|      break;
 1636|  23.8k|    }
 1637|   244k|  }
 1638|       |
 1639|  33.0k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 33.0k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  33.0k|    iIo.seek(0L, BasicIo::beg);
 1641|  33.0k|  }
 1642|       |
 1643|  33.0k|  return matched;
 1644|  33.5k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   135k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   135k|  const char ignoreList[13][5] = {
  505|   135k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   135k|  };
  507|       |
  508|   135k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.71M, False: 125k]
  ------------------
  509|  1.71M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 9.79k, False: 1.70M]
  ------------------
  510|  9.79k|      return true;
  511|       |
  512|   125k|  return false;
  513|   135k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  63.0k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  63.0k|  const char ignoreList[8][5] = {
  524|  63.0k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  63.0k|  };
  526|       |
  527|  63.0k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 480k, False: 52.7k]
  ------------------
  528|   480k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 10.2k, False: 470k]
  ------------------
  529|  10.2k|      return true;
  530|       |
  531|  52.7k|  return false;
  532|  63.0k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.82M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.82M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.82M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.82M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  3.34M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  2.02k|static std::string readString(BasicIo& io, size_t size) {
  621|  2.02k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  2.02k|  Exiv2::DataBuf str(size + 1);
  623|  2.02k|  io.readOrThrow(str.data(), size);
  624|  2.02k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  2.02k|  return Exiv2::toString(str.data());
  626|  2.02k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  365|  1.79k|    Image(ImageType::riff, mdNone, std::move(io), params) {
  366|  1.79k|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  368|  1.79k|std::string RiffVideo::mimeType() const {
  369|  1.79k|  return "video/riff";
  370|  1.79k|}
_ZN5Exiv29RiffVideo13writeMetadataEv:
  372|     30|void RiffVideo::writeMetadata() {
  373|     30|}  // RiffVideo::writeMetadata
_ZN5Exiv29RiffVideo12readMetadataEv:
  375|  1.79k|void RiffVideo::readMetadata() {
  376|  1.79k|  if (io_->open() != 0)
  ------------------
  |  Branch (376:7): [True: 0, False: 1.79k]
  ------------------
  377|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  378|       |
  379|       |  // Ensure that this is the correct image type
  380|  1.79k|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (380:7): [True: 0, False: 1.79k]
  ------------------
  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.79k|  IoCloser closer(*io_);
  387|  1.79k|  clearMetadata();
  388|       |
  389|  1.79k|  xmpData_["Xmp.video.FileSize"] = io_->size();
  390|  1.79k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  391|       |
  392|  1.79k|  HeaderReader header(io_);
  393|  1.79k|  xmpData_["Xmp.video.Container"] = header.getId();
  394|       |
  395|  1.79k|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  396|       |
  397|  1.79k|  decodeBlocks();
  398|  1.79k|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  400|  77.4k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  401|  77.4k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  402|  77.4k|  id_ = readStringTag(io);
  403|  77.4k|  size_ = readDWORDTag(io);
  404|  77.4k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  406|   754k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  407|   754k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (407:7): [True: 695k, False: 59.7k]
  ------------------
  408|   695k|    return false;
  409|       |
  410|  59.7k|  return Internal::upper(str1) == str2;
  411|   754k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  413|  4.78k|void RiffVideo::readList(const HeaderReader& header_) {
  414|  4.78k|  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|  4.78k|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (421:7): [True: 4.36k, False: 419]
  ------------------
  422|  4.36k|    readInfoListChunk(header_.getSize());
  423|    419|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (423:12): [True: 15, False: 404]
  ------------------
  424|     15|    readMoviList(header_.getSize());
  425|     15|  }
  426|  4.78k|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  428|  70.6k|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|  70.6k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (435:7): [True: 690, False: 69.9k]
  ------------------
  436|    690|    readAviHeader();
  437|  69.9k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (437:12): [True: 1.27k, False: 68.6k]
  ------------------
  438|  1.27k|    readStreamHeader();
  439|  68.6k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (439:12): [True: 1.41k, False: 67.2k]
  ------------------
  440|  1.41k|    readStreamFormat(header_.getSize());
  441|  67.2k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (441:12): [True: 539, False: 66.6k]
  ------------------
  442|    539|    streamType_ = Audio;
  443|    539|    readStreamFormat(header_.getSize());
  444|  66.6k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (444:14): [True: 38, False: 66.6k]
  ------------------
  445|     38|    readStreamData(header_.getSize());
  446|  66.6k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (446:12): [True: 82, False: 66.5k]
  ------------------
  447|     82|    StreamName(header_.getSize());
  448|  66.5k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (448:12): [True: 469, False: 66.1k]
  ------------------
  449|    469|    readVPRPChunk(header_.getSize());
  450|  66.1k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (450:12): [True: 292, False: 65.8k]
  ------------------
  451|    292|    readIndexChunk(header_.getSize());
  452|  65.8k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (452:12): [True: 1.10k, False: 64.7k]
  ------------------
  453|  1.10k|    readDataChunk(header_.getSize());
  454|  64.7k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (454:12): [True: 319, False: 64.3k]
  ------------------
  455|    319|    readJunk(header_.getSize());
  456|  64.3k|  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|  64.3k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  463|  64.3k|  }
  464|  70.6k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  466|  1.79k|void RiffVideo::decodeBlocks() {
  467|  75.6k|  do {
  468|  75.6k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (468:35): [True: 4.78k, False: 70.8k]
  ------------------
  469|  4.78k|      readList(header);
  470|  70.8k|    } else {
  471|  70.8k|      readChunk(header);
  472|  70.8k|    }
  473|  75.6k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (473:12): [True: 73.9k, False: 1.71k]
  |  Branch (473:27): [True: 73.8k, False: 82]
  ------------------
  474|  1.79k|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  476|    690|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|    690|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  497|    690|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  498|    690|  double frame_rate = 1000000. / TimeBetweenFrames;
  499|       |
  500|    690|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  501|       |
  502|    690|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  503|    690|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  504|       |
  505|    690|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  506|    690|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  507|       |
  508|    690|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  509|    690|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  510|       |
  511|    690|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  512|       |
  513|    690|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  514|       |
  515|    690|  uint32_t width = readDWORDTag(io_);
  516|    690|  xmpData_["Xmp.video.Width"] = width;
  517|       |
  518|    690|  uint32_t height = readDWORDTag(io_);
  519|    690|  xmpData_["Xmp.video.Height"] = height;
  520|       |
  521|    690|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  522|    690|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  523|       |
  524|    690|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  525|       |
  526|    690|  fillDuration(frame_rate, frame_count);
  527|    690|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  529|  1.27k|void RiffVideo::readStreamHeader() {
  530|  1.27k|  std::string stream = readStringTag(io_);
  531|  1.27k|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (531:17): [True: 293, False: 979]
  ------------------
  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.27k|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  556|       |
  557|  1.27k|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  558|  1.27k|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  559|       |
  560|  1.27k|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  561|       |
  562|  1.27k|  if (divisor) {
  ------------------
  |  Branch (562:7): [True: 984, False: 288]
  ------------------
  563|    984|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  564|    984|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (564:14): [True: 187, False: 797]
  ------------------
  565|    984|  }
  566|  1.27k|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  567|       |
  568|  1.27k|  if (divisor) {
  ------------------
  |  Branch (568:7): [True: 961, False: 311]
  ------------------
  569|    961|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  570|    961|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (570:14): [True: 187, False: 774]
  ------------------
  571|    961|  }
  572|       |
  573|  1.27k|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  574|       |
  575|  1.27k|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (575:12): [True: 291, False: 981]
  ------------------
  576|       |
  577|  1.27k|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (577:12): [True: 289, False: 983]
  ------------------
  578|  1.27k|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  579|  1.27k|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  581|  1.95k|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|  1.95k|  if (streamType_ == Video) {
  ------------------
  |  Branch (612:7): [True: 247, False: 1.70k]
  ------------------
  613|    247|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  614|    247|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  615|    247|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  616|    247|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  617|    247|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  618|    247|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  619|    247|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  620|    247|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  621|    247|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (621:18): [True: 186, False: 61]
  ------------------
  622|    186|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  623|     61|    else
  624|     61|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  625|    247|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (625:18): [True: 193, False: 54]
  ------------------
  626|    193|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  627|     54|    else
  628|     54|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  629|  1.70k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (629:14): [True: 1.67k, False: 34]
  ------------------
  630|  1.67k|    uint16_t format_tag = readWORDTag(io_);
  631|  1.67k|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (631:67): [True: 1.11k, False: 560]
  ------------------
  632|  1.11k|      xmpData_["Xmp.audio.Compressor"] = it->second;
  633|    560|    else
  634|    560|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  635|       |
  636|  1.67k|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  637|  1.67k|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  638|  1.67k|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  639|  1.67k|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  640|  1.67k|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  641|  1.67k|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (641:9): [True: 96, False: 1.57k]
  ------------------
  642|     96|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  643|  1.67k|  } else {
  644|     34|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  645|     34|  }
  646|  1.95k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  648|     38|void RiffVideo::readStreamData(uint64_t size_) const {
  649|     38|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  650|     38|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  652|     82|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|     82|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  655|     82|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  657|  4.36k|void RiffVideo::readInfoListChunk(uint64_t size_) {
  658|  4.36k|  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|  4.36k|  std::map<std::string, std::string> table;
  663|  14.1k|  while (current_size < size_) {
  ------------------
  |  Branch (663:10): [True: 9.77k, False: 4.36k]
  ------------------
  664|  9.77k|    std::string type = readStringTag(io_);
  665|  9.77k|    size_t size = readDWORDTag(io_);
  666|  9.77k|    std::string content = readStringTag(io_, size);
  667|  9.77k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
  ------------------
  |  Branch (667:50): [True: 5.79k, False: 3.98k]
  ------------------
  668|       |      // Check that it isn't a duplicate.
  669|  5.79k|      Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
  670|  5.79k|      table[it->second] = content;
  671|  5.79k|    }
  672|  9.77k|    current_size += DWORD * 2;
  673|  9.77k|    current_size += size;
  674|  9.77k|  }
  675|       |  // Copy the elements from the temporary table to xmpData_.
  676|  5.60k|  for (const auto& it : table) {
  ------------------
  |  Branch (676:23): [True: 5.60k, False: 4.36k]
  ------------------
  677|  5.60k|    xmpData_[it.first] = it.second;
  678|  5.60k|  }
  679|  4.36k|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  681|     15|void RiffVideo::readMoviList(uint64_t size_) const {
  682|     15|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  683|     15|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  685|    469|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|    469|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  709|    469|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  711|    292|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|    292|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|    292|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  731|  1.10k|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|  1.10k|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  743|  1.10k|  if (size_ % 2 != 0)
  ------------------
  |  Branch (743:7): [True: 588, False: 515]
  ------------------
  744|    588|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  745|  1.10k|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  747|    319|void RiffVideo::readJunk(uint64_t size_) const {
  748|    319|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  749|    319|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  751|  2.34k|std::string RiffVideo::getStreamType(uint32_t stream) {
  752|  2.34k|  if (stream == 1)
  ------------------
  |  Branch (752:7): [True: 188, False: 2.15k]
  ------------------
  753|    188|    return "Mono";
  754|  2.15k|  if (stream == 2)
  ------------------
  |  Branch (754:7): [True: 672, False: 1.48k]
  ------------------
  755|    672|    return "Stereo";
  756|  1.48k|  if (stream == 5)
  ------------------
  |  Branch (756:7): [True: 107, False: 1.37k]
  ------------------
  757|    107|    return "5.1 Surround Sound";
  758|  1.37k|  if (stream == 7)
  ------------------
  |  Branch (758:7): [True: 255, False: 1.11k]
  ------------------
  759|    255|    return "7.1 Surround Sound";
  760|  1.11k|  return "Mono";
  761|  1.37k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  763|    599|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  764|    599|  if (frame_rate == 0)
  ------------------
  |  Branch (764:7): [True: 0, False: 599]
  ------------------
  765|      0|    return;
  766|       |
  767|    599|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  768|    599|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  769|    599|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  770|    599|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|  1.79k|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|  1.79k|  auto image = std::make_unique<RiffVideo>(std::move(io), params);
  774|  1.79k|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 1.79k]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|  1.79k|  return image;
  778|  1.79k|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  780|  15.4k|bool isRiffType(BasicIo& iIo, bool advance) {
  781|  15.4k|  constexpr int len = 4;
  782|  15.4k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  783|  15.4k|  std::array<byte, len> buf;
  784|  15.4k|  iIo.read(buf.data(), len);
  785|  15.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 15.4k]
  |  Branch (785:22): [True: 561, False: 14.8k]
  ------------------
  786|    561|    return false;
  787|    561|  }
  788|  14.8k|  bool matched = buf == RiffVideoId;
  789|  14.8k|  if (!advance || !matched) {
  ------------------
  |  Branch (789:7): [True: 14.8k, False: 0]
  |  Branch (789:19): [True: 0, False: 0]
  ------------------
  790|  14.8k|    iIo.seek(-1 * len, BasicIo::cur);
  791|  14.8k|  }
  792|  14.8k|  return matched;
  793|  15.4k|}

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  9.45k|  static constexpr auto tagList() {
   30|  9.45k|    return tagInfo_;
   31|  9.45k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|  9.34k|  static constexpr auto tagListCs() {
   34|  9.34k|    return tagInfoCs_;
   35|  9.34k|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|  4.30k|  static constexpr auto tagListCs2() {
   38|  4.30k|    return tagInfoCs2_;
   39|  4.30k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  40.7k|  static constexpr auto tagListFp() {
   42|  40.7k|    return tagInfoFp_;
   43|  40.7k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  1.82k|  static constexpr auto tagListSonyMisc1() {
   46|  1.82k|    return tagInfoSonyMisc1_;
   47|  1.82k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  9.93k|  static constexpr auto tagListSonyMisc2b() {
   50|  9.93k|    return tagInfoSonyMisc2b_;
   51|  9.93k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  92.1k|  static constexpr auto tagListSonyMisc3c() {
   54|  92.1k|    return tagInfoSonyMisc3c_;
   55|  92.1k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   708k|  static constexpr auto tagListSonySInfo1() {
   58|   708k|    return tagInfoSonySInfo1_;
   59|   708k|  }
_ZN5Exiv28Internal13SonyMakerNote12tagList2010eEv:
   61|    555|  static constexpr auto tagList2010e() {
   62|    555|    return tagInfo2010e_;
   63|    555|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  2.69M|const TagInfo* ifdTagList() {
 1779|  2.69M|  return ifdTagInfo;
 1780|  2.69M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   494k|const TagInfo* exifTagList() {
 2217|   494k|  return exifTagInfo;
 2218|   494k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   233k|const TagInfo* gpsTagList() {
 2433|   233k|  return gpsTagInfo;
 2434|   233k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  75.0k|const TagInfo* iopTagList() {
 2508|  75.0k|  return iopTagInfo;
 2509|  75.0k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  25.7k|const TagInfo* mnTagList() {
 2524|  25.7k|  return mnTagInfo;
 2525|  25.7k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.78M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.78M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.78M, False: 0]
  ------------------
 2529|  1.78M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.78M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  4.10M|bool isExifIfd(IfdId ifdId) {
 2534|  4.10M|  switch (ifdId) {
 2535|   545k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 545k, False: 3.56M]
  ------------------
 2536|   795k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 250k, False: 3.85M]
  ------------------
 2537|   923k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 127k, False: 3.97M]
  ------------------
 2538|   995k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 71.4k, False: 4.03M]
  ------------------
 2539|  1.08M|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 86.6k, False: 4.02M]
  ------------------
 2540|  1.12M|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 41.5k, False: 4.06M]
  ------------------
 2541|  1.12M|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 360, False: 4.10M]
  ------------------
 2542|  1.12M|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 4.10M]
  ------------------
 2543|  1.45M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 332k, False: 3.77M]
  ------------------
 2544|  1.68M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 224k, False: 3.88M]
  ------------------
 2545|  1.85M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 176k, False: 3.93M]
  ------------------
 2546|  1.99M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 142k, False: 3.96M]
  ------------------
 2547|  2.01M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 17.4k, False: 4.08M]
  ------------------
 2548|  2.03M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 13.6k, False: 4.09M]
  ------------------
 2549|  2.05M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 19.3k, False: 4.08M]
  ------------------
 2550|  2.05M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 7.47k, False: 4.09M]
  ------------------
 2551|  2.06M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 10.1k, False: 4.09M]
  ------------------
 2552|  2.12M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 59.9k, False: 4.04M]
  ------------------
 2553|  2.31M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 191k, False: 3.91M]
  ------------------
 2554|  2.31M|      return true;
 2555|  1.78M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.78M, False: 2.31M]
  ------------------
 2556|  1.78M|      return false;
 2557|  4.10M|  }
 2558|  4.10M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  5.88M|const TagInfo* tagList(IfdId ifdId) {
 2569|  5.88M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 5.88M, False: 0]
  ------------------
 2570|  5.88M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 5.88M, False: 0]
  ------------------
 2571|  5.88M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  5.88M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  4.10M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  4.10M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 4.10M, False: 0]
  ------------------
 2577|  4.10M|    int idx = 0;
 2578|   251M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 249M, False: 2.00M]
  ------------------
 2579|   249M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 2.09M, False: 247M]
  ------------------
 2580|  2.09M|        break;
 2581|   249M|    }
 2582|  4.10M|    return ti + idx;
 2583|  4.10M|  }
 2584|      0|  return nullptr;
 2585|  4.10M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|  1.77M|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|  1.77M|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 1.77M]
  ------------------
 2589|      0|    return nullptr;
 2590|  1.77M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 1.77M, False: 0]
  ------------------
 2591|  82.5M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 82.4M, False: 64.8k]
  ------------------
 2592|  82.4M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 1.71M, False: 80.7M]
  ------------------
 2593|  1.71M|        return ti + idx;
 2594|  1.71M|      }
 2595|  82.4M|    }
 2596|  1.77M|  }
 2597|  64.8k|  return nullptr;
 2598|  1.77M|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  7.33M|IfdId groupId(const std::string& groupName) {
 2601|  7.33M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 7.33M, False: 0]
  ------------------
 2602|  7.33M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  7.33M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  2.69M|const char* groupName(IfdId ifdId) {
 2613|  2.69M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 2.69M, False: 0]
  ------------------
 2614|  2.69M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  2.69M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    346|float fnumber(float apertureValue) {
 2648|    346|  float result = std::exp2(apertureValue / 2.F);
 2649|    346|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 10, False: 336]
  ------------------
 2650|     10|    result = 3.5F;
 2651|     10|  }
 2652|    346|  return result;
 2653|    346|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    346|URational exposureTime(float shutterSpeedValue) {
 2656|    346|  URational ur(1, 1);
 2657|    346|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    346|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 175, False: 171]
  ------------------
 2659|    175|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    175|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 92, False: 83]
  ------------------
 2662|     92|      ur.second = static_cast<uint32_t>(x);
 2663|     92|    }
 2664|    175|  } else {
 2665|    171|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    171|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 171, False: 0]
  |  Branch (2667:19): [True: 171, False: 0]
  ------------------
 2668|    171|      ur.first = static_cast<uint32_t>(x);
 2669|    171|    }
 2670|    171|  }
 2671|    346|  return ur;
 2672|    346|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|  1.77M|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|  1.77M|  auto ti = tagInfo(tagName, ifdId);
 2676|  1.77M|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 1.71M, False: 64.8k]
  |  Branch (2676:13): [True: 1.71M, False: 0]
  ------------------
 2677|  1.71M|    return ti->tag_;
 2678|  64.8k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 64.8k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  64.8k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  64.8k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  15.3k|const TagInfo* tagList(const std::string& groupName) {
 3295|  15.3k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  15.3k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 15.3k]
  |  Branch (3296:14): [True: 0, False: 15.3k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  15.3k|  return ii->tagList_();
 3300|  15.3k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   58|  27.2M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   59|  27.2M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (59:11): [True: 27.2M, False: 0]
  |  Branch (59:27): [True: 0, False: 0]
  |  Branch (59:58): [True: 5.45M, False: 21.7M]
  |  Branch (59:86): [True: 24.4k, False: 21.7M]
  ------------------
   60|  5.48M|         key.g_ == group_;
  ------------------
  |  Branch (60:10): [True: 16.8k, False: 5.46M]
  ------------------
   61|  27.2M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   64|  28.8k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   65|  28.8k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (65:7): [True: 9.54k, False: 19.3k]
  |  Branch (65:20): [True: 0, False: 19.3k]
  ------------------
   66|  9.54k|    wroteHeader_ = true;
   67|  28.8k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   69|  4.09M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   70|  4.09M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (70:7): [True: 18.9k, False: 4.07M]
  |  Branch (70:24): [True: 18.9k, False: 0]
  ------------------
   71|  18.9k|    io_.write(pHeader_, size_);
   72|  18.9k|    wroteHeader_ = true;
   73|  18.9k|  }
   74|  4.09M|  return io_.write(pData, wcount);
   75|  4.09M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   77|  59.6k|int IoWrapper::putb(byte data) {
   78|  59.6k|  if (!wroteHeader_) {
  ------------------
  |  Branch (78:7): [True: 0, False: 59.6k]
  ------------------
   79|      0|    io_.write(pHeader_, size_);
   80|      0|    wroteHeader_ = true;
   81|      0|  }
   82|  59.6k|  return io_.putb(data);
   83|  59.6k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   85|     38|void IoWrapper::setTarget(int id, size_t target) {
   86|     38|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (86:7): [True: 0, False: 38]
  ------------------
   87|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   88|      0|  }
   89|     38|  if (pow_)
  ------------------
  |  Branch (89:7): [True: 27, False: 11]
  ------------------
   90|     27|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   91|     38|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   93|   269k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   94|   269k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   97|  70.3k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   98|  70.3k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
  102|  23.0k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
  103|  23.0k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
  105|  23.0k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
  109|  25.7k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
  110|  25.7k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
  114|  6.99k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
  115|  6.99k|    cfgSelFct_(cfgSelFct),
  116|  6.99k|    arraySet_(arraySet),
  117|  6.99k|    setSize_(setSize) {
  118|       |  // We'll figure out the correct cfg later
  119|  6.99k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  135|  11.8M|    TiffComponent(tag, group), tiffType_(tiffType) {
  136|  11.8M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  138|  11.9M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  141|  46.4k|    TiffComponent(rhs),
  142|  46.4k|    tiffType_(rhs.tiffType_),
  143|  46.4k|    count_(rhs.count_),
  144|  46.4k|    offset_(rhs.offset_),
  145|  46.4k|    size_(rhs.size_),
  146|  46.4k|    pData_(rhs.pData_),
  147|  46.4k|    idx_(rhs.idx_),
  148|  46.4k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (148:13): [True: 12.1k, False: 34.2k]
  ------------------
  149|  46.4k|    storage_(rhs.storage_) {
  150|  46.4k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  155|    153|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  156|    153|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  159|   132k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  160|   132k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  165|   139k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  166|   139k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  169|  49.3k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  170|  49.3k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  172|  49.3k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  174|  46.4k|TiffComponent::UniquePtr TiffComponent::clone() const {
  175|  46.4k|  return UniquePtr(doClone());
  176|  46.4k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  178|  36.4k|TiffEntry* TiffEntry::doClone() const {
  179|  36.4k|  return new TiffEntry(*this);
  180|  36.4k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  182|    407|TiffDataEntry* TiffDataEntry::doClone() const {
  183|    407|  return new TiffDataEntry(*this);
  184|    407|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  186|  3.02k|TiffImageEntry* TiffImageEntry::doClone() const {
  187|  3.02k|  return new TiffImageEntry(*this);
  188|  3.02k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  190|  6.38k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  191|  6.38k|  return new TiffSizeEntry(*this);
  192|  6.38k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  198|    153|TiffSubIfd* TiffSubIfd::doClone() const {
  199|    153|  return new TiffSubIfd(*this);
  200|    153|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  222|  19.5M|int TiffEntryBase::idx() const {
  223|  19.5M|  return idx_;
  224|  19.5M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  226|  1.28M|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  227|  1.28M|  storage_ = std::move(buf);
  228|  1.28M|  pData_ = storage_->data();
  229|  1.28M|  size_ = storage_->size();
  230|  1.28M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  232|  3.46M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  233|  3.46M|  pData_ = pData;
  234|  3.46M|  size_ = size;
  235|  3.46M|  storage_ = std::move(storage);
  236|  3.46M|  if (!pData_)
  ------------------
  |  Branch (236:7): [True: 0, False: 3.46M]
  ------------------
  237|      0|    size_ = 0;
  238|  3.46M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  240|  3.19M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  241|  3.19M|  if (!value)
  ------------------
  |  Branch (241:7): [True: 0, False: 3.19M]
  ------------------
  242|      0|    return;
  243|  3.19M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (243:39): [True: 1.28M, False: 1.91M]
  ------------------
  244|  1.28M|    auto d = std::make_shared<DataBuf>(newSize);
  245|  1.28M|    setData(std::move(d));
  246|  1.28M|  }
  247|  3.19M|  if (pData_) {
  ------------------
  |  Branch (247:7): [True: 1.29M, False: 1.89M]
  ------------------
  248|  1.29M|    memset(pData_, 0x0, size_);
  249|  1.29M|  }
  250|  3.19M|  size_ = value->copy(pData_, byteOrder);
  251|  3.19M|  setValue(std::move(value));
  252|  3.19M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  254|  6.73M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  255|  6.73M|  if (!value)
  ------------------
  |  Branch (255:7): [True: 0, False: 6.73M]
  ------------------
  256|      0|    return;
  257|  6.73M|  tiffType_ = toTiffType(value->typeId());
  258|  6.73M|  count_ = value->count();
  259|  6.73M|  pValue_ = std::move(value);
  260|  6.73M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  262|  18.4k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  263|  18.4k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (263:7): [True: 2.11k, False: 16.3k]
  |  Branch (263:20): [True: 1.18k, False: 15.2k]
  ------------------
  264|  3.29k|#ifndef SUPPRESS_WARNINGS
  265|  3.29k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  3.29k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 3.29k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  3.29k|  LogMsg(LogMsg::warn).os()
  ------------------
  266|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  267|  3.29k|#endif
  268|  3.29k|    return;
  269|  3.29k|  }
  270|  15.2k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (270:7): [True: 683, False: 14.5k]
  ------------------
  271|    683|#ifndef SUPPRESS_WARNINGS
  272|    683|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    683|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 683]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    683|  LogMsg(LogMsg::warn).os()
  ------------------
  273|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  274|    683|#endif
  275|    683|    return;
  276|    683|  }
  277|  14.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (277:7): [True: 1.11k, False: 13.4k]
  ------------------
  278|  1.11k|#ifndef SUPPRESS_WARNINGS
  279|  1.11k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.11k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.11k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.11k|  LogMsg(LogMsg::warn).os()
  ------------------
  280|      0|                << tag() << ": Size and data offset entries have different"
  281|      0|                << " number of components, ignoring them.\n";
  282|  1.11k|#endif
  283|  1.11k|    return;
  284|  1.11k|  }
  285|  13.4k|  size_t size = 0;
  286|  32.7k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (286:22): [True: 19.3k, False: 13.4k]
  ------------------
  287|  19.3k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  288|  19.3k|  }
  289|  13.4k|  const size_t offset = pValue()->toUint32(0);
  290|  13.4k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (290:7): [True: 847, False: 12.5k]
  |  Branch (290:26): [True: 617, False: 11.9k]
  |  Branch (290:54): [True: 18, False: 11.9k]
  ------------------
  291|  1.48k|#ifndef SUPPRESS_WARNINGS
  292|  1.48k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.48k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.48k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.48k|  LogMsg(LogMsg::warn).os()
  ------------------
  293|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  294|  1.48k|#endif
  295|  1.48k|    return;
  296|  1.48k|  }
  297|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  298|       |  // Until then we check: last offset + last size - first offset == size?
  299|  11.9k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (299:7): [True: 188, False: 11.7k]
  ------------------
  300|    188|#ifndef SUPPRESS_WARNINGS
  301|    188|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    188|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 188]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    188|  LogMsg(LogMsg::warn).os()
  ------------------
  302|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  303|    188|#endif
  304|    188|    return;
  305|    188|  }
  306|  11.7k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  307|  11.7k|  sizeDataArea_ = size;
  308|  11.7k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  309|  11.7k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  311|  95.2k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  312|  95.2k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (312:7): [True: 6.83k, False: 88.4k]
  |  Branch (312:20): [True: 13.5k, False: 74.8k]
  ------------------
  313|  20.4k|#ifndef SUPPRESS_WARNINGS
  314|  20.4k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  20.4k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 20.4k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  20.4k|  LogMsg(LogMsg::warn).os()
  ------------------
  315|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  316|  20.4k|#endif
  317|  20.4k|    return;
  318|  20.4k|  }
  319|  74.8k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (319:7): [True: 8.86k, False: 65.9k]
  ------------------
  320|  8.86k|#ifndef SUPPRESS_WARNINGS
  321|  8.86k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  8.86k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.86k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.86k|  LogMsg(LogMsg::warn).os()
  ------------------
  322|      0|                << tag() << ": Size and data offset entries have different"
  323|      0|                << " number of components, ignoring them.\n";
  324|  8.86k|#endif
  325|  8.86k|    return;
  326|  8.86k|  }
  327|  12.7M|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (327:22): [True: 12.6M, False: 65.9k]
  ------------------
  328|  12.6M|    const size_t offset = pValue()->toUint32(i);
  329|  12.6M|    const size_t size = pSize->toUint32(i);
  330|       |
  331|  12.6M|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (331:9): [True: 103k, False: 12.5M]
  |  Branch (331:28): [True: 68.9k, False: 12.4M]
  |  Branch (331:56): [True: 116, False: 12.4M]
  ------------------
  332|   172k|#ifndef SUPPRESS_WARNINGS
  333|   172k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|   172k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 172k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|   172k|  LogMsg(LogMsg::warn).os()
  ------------------
  334|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  335|   172k|#endif
  336|  12.4M|    } else if (size != 0) {
  ------------------
  |  Branch (336:16): [True: 11.2M, False: 1.27M]
  ------------------
  337|  11.2M|      const byte* pStrip = pData + baseOffset + offset;
  338|  11.2M|      strips_.emplace_back(pStrip, size);
  339|  11.2M|    }
  340|  12.6M|  }
  341|  65.9k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  343|  10.5k|size_t TiffIfdMakernote::ifdOffset() const {
  344|  10.5k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.70k, False: 6.86k]
  ------------------
  345|  3.70k|    return 0;
  346|  6.86k|  return pHeader_->ifdOffset();
  347|  10.5k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  349|  39.1k|ByteOrder TiffIfdMakernote::byteOrder() const {
  350|  39.1k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (350:7): [True: 7.29k, False: 31.8k]
  |  Branch (350:20): [True: 26.7k, False: 5.16k]
  ------------------
  351|  34.0k|    return imageByteOrder_;
  352|  34.0k|  }
  353|  5.16k|  return pHeader_->byteOrder();
  354|  39.1k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  356|  6.06k|size_t TiffIfdMakernote::mnOffset() const {
  357|  6.06k|  return mnOffset_;
  358|  6.06k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  360|  21.5k|size_t TiffIfdMakernote::baseOffset() const {
  361|  21.5k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 4.32k, False: 17.2k]
  ------------------
  362|  4.32k|    return 0;
  363|  17.2k|  return pHeader_->baseOffset(mnOffset_);
  364|  21.5k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  366|  11.9k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  367|  11.9k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 3.70k, False: 8.22k]
  ------------------
  368|  3.70k|    return true;
  369|  8.22k|  return pHeader_->read(pData, size, byteOrder);
  370|  11.9k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  372|  8.83k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  373|  8.83k|  if (pHeader_)
  ------------------
  |  Branch (373:7): [True: 8.21k, False: 624]
  ------------------
  374|  8.21k|    pHeader_->setByteOrder(byteOrder);
  375|  8.83k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  377|   132k|size_t TiffIfdMakernote::sizeHeader() const {
  378|   132k|  if (!pHeader_)
  ------------------
  |  Branch (378:7): [True: 8.01k, False: 124k]
  ------------------
  379|  8.01k|    return 0;
  380|   124k|  return pHeader_->size();
  381|   132k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  383|  11.0k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  384|  11.0k|  if (!pHeader_)
  ------------------
  |  Branch (384:7): [True: 615, False: 10.4k]
  ------------------
  385|    615|    return 0;
  386|  10.4k|  return pHeader_->write(ioWrapper, byteOrder);
  387|  11.0k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  389|  7.25M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  390|  7.25M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  391|  7.25M|  return count_ * TypeInfo::typeSize(typeId);
  392|  7.25M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  394|  2.07M|bool TiffBinaryArray::initialize(IfdId group) {
  395|  2.07M|  if (arrayCfg_)
  ------------------
  |  Branch (395:7): [True: 2.07M, False: 1.56k]
  ------------------
  396|  2.07M|    return true;  // Not a complex array or already initialized
  397|       |
  398|  4.89k|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (398:24): [True: 4.89k, False: 0]
  ------------------
  399|  4.89k|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (399:9): [True: 1.56k, False: 3.32k]
  ------------------
  400|  1.56k|      arrayCfg_ = &arraySet_[idx].cfg_;
  401|  1.56k|      arrayDef_ = arraySet_[idx].def_;
  402|  1.56k|      defSize_ = arraySet_[idx].defSize_;
  403|  1.56k|      return true;
  404|  1.56k|    }
  405|  4.89k|  }
  406|      0|  return false;
  407|  1.56k|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  409|  4.92k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  410|  4.92k|  if (!cfgSelFct_)
  ------------------
  |  Branch (410:7): [True: 2.32k, False: 2.59k]
  ------------------
  411|  2.32k|    return true;  // Not a complex array
  412|       |
  413|  2.59k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  414|  2.59k|  if (idx > -1) {
  ------------------
  |  Branch (414:7): [True: 1.56k, False: 1.03k]
  ------------------
  415|  1.56k|    arrayCfg_ = &arraySet_[idx].cfg_;
  416|  1.56k|    arrayDef_ = arraySet_[idx].def_;
  417|  1.56k|    defSize_ = arraySet_[idx].defSize_;
  418|  1.56k|  }
  419|  2.59k|  return idx > -1;
  420|  4.92k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  422|  16.6k|void TiffBinaryArray::iniOrigDataBuf() {
  423|  16.6k|  origData_ = const_cast<byte*>(pData());
  424|  16.6k|  origSize_ = TiffEntryBase::doSize();
  425|  16.6k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  427|     20|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  428|     20|  if (origSize_ != size)
  ------------------
  |  Branch (428:7): [True: 0, False: 20]
  ------------------
  429|      0|    return false;
  430|     20|  if (origData_ == pData)
  ------------------
  |  Branch (430:7): [True: 12, False: 8]
  ------------------
  431|     12|    return true;
  432|      8|  std::memcpy(origData_, pData, origSize_);
  433|      8|  return true;
  434|     20|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  436|  2.23M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  437|  2.23M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  438|  2.23M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  439|  2.23M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  440|  2.23M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  441|  2.23M|  if (!tp)
  ------------------
  |  Branch (441:7): [True: 0, False: 2.23M]
  ------------------
  442|      0|    return 0;
  443|       |  // The assertion typically fails if a component is not configured in
  444|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  445|  2.23M|  tp->setStart(pData() + idx);
  446|  2.23M|  auto s = storage();
  447|  2.23M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  448|  2.23M|  tp->setElDef(def);
  449|  2.23M|  tp->setElByteOrder(cfg()->byteOrder_);
  450|  2.23M|  addChild(std::move(tc));
  451|  2.23M|  return sz;
  452|  2.23M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  455|  21.9M|                                      TiffComponent::UniquePtr object) {
  456|  21.9M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  457|  21.9M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  460|  3.20M|                                        TiffComponent::UniquePtr /*object*/) {
  461|  3.20M|  return this;
  462|  3.20M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  465|  8.67M|                                        TiffComponent::UniquePtr object) {
  466|  8.67M|  tiffPath.pop();
  467|  8.67M|  const TiffPathItem tpi = tiffPath.top();
  468|       |
  469|  8.67M|  TiffComponent* tc = nullptr;
  470|       |  // Try to use an existing component if there is still at least one
  471|       |  // composite tag on the stack or the tag to add is the MakerNote tag.
  472|       |  // This is used to prevent duplicate entries. Sub-IFDs also, but the > 1
  473|       |  // condition takes care of them, see below.
  474|  8.67M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (474:7): [True: 7.50M, False: 1.17M]
  |  Branch (474:31): [True: 548, False: 1.17M]
  |  Branch (474:62): [True: 474, False: 74]
  ------------------
  475|  7.50M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (475:9): [True: 28.4k, False: 7.47M]
  ------------------
  476|  28.4k|      tc = pNext_.get();
  477|  7.47M|    } else {
  478|  39.5M|      for (auto&& component : components_) {
  ------------------
  |  Branch (478:29): [True: 39.5M, False: 34.6k]
  ------------------
  479|  39.5M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (479:13): [True: 7.60M, False: 31.9M]
  |  Branch (479:46): [True: 7.43M, False: 161k]
  ------------------
  480|  7.43M|          tc = component.get();
  481|  7.43M|          break;
  482|  7.43M|        }
  483|  39.5M|      }
  484|  7.47M|    }
  485|  7.50M|  }
  486|       |
  487|  8.67M|  if (tc)
  ------------------
  |  Branch (487:7): [True: 7.46M, False: 1.21M]
  ------------------
  488|  7.46M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  489|       |
  490|  1.21M|  auto atc = [&] {
  491|  1.21M|    if (tiffPath.size() == 1 && object) {
  492|  1.21M|      return std::move(object);
  493|  1.21M|    }
  494|  1.21M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  495|  1.21M|  }();
  496|       |
  497|       |  // Prevent dangling sub-IFD tags: Do not add a sub-IFD component without children.
  498|       |  // Todo: How to check before creating the component?
  499|  1.21M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (499:7): [True: 1.17M, False: 35.7k]
  |  Branch (499:31): [True: 16.5k, False: 1.15M]
  ------------------
  500|  16.5k|    return nullptr;
  501|       |
  502|  1.19M|  tc = [&] {
  503|  1.19M|    if (tpi.extendedTag() == Tag::next)
  504|  1.19M|      return this->addNext(std::move(atc));
  505|  1.19M|    return this->addChild(std::move(atc));
  506|  1.19M|  }();
  507|  1.19M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  508|  1.21M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  511|  2.79M|                                     TiffComponent::UniquePtr object) {
  512|  2.79M|  const TiffPathItem tpi1 = tiffPath.top();
  513|  2.79M|  tiffPath.pop();
  514|  2.79M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (514:7): [True: 0, False: 2.79M]
  ------------------
  515|       |    // If the last element in the path is the sub-IFD tag itself we're done.
  516|       |    // But that shouldn't happen - see TiffDirectory::doAddPath
  517|      0|    return this;
  518|      0|  }
  519|  2.79M|  const TiffPathItem tpi2 = tiffPath.top();
  520|  2.79M|  tiffPath.push(tpi1);
  521|  2.79M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (521:24): [True: 3.01M, False: 20.2k]
  ------------------
  522|  3.01M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (522:9): [True: 2.77M, False: 233k]
  ------------------
  523|  2.77M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  524|       |
  525|  20.2k|  auto tc = [&] {
  526|  20.2k|    if (tiffPath.size() == 1 && object) {
  527|  20.2k|      return addChild(std::move(object));
  528|  20.2k|    }
  529|  20.2k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  530|  20.2k|  }();
  531|  20.2k|  setCount(ifds_.size());
  532|  20.2k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  533|  2.79M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  2.62M|                                      TiffComponent::UniquePtr object) {
  537|  2.62M|  const TiffPathItem tpi1 = tiffPath.top();
  538|  2.62M|  tiffPath.pop();
  539|  2.62M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (539:7): [True: 17.7k, False: 2.60M]
  ------------------
  540|       |    // If the last element in the path is the makernote tag itself we're done
  541|  17.7k|    return this;
  542|  17.7k|  }
  543|  2.60M|  const TiffPathItem tpi2 = tiffPath.top();
  544|  2.60M|  tiffPath.push(tpi1);
  545|  2.60M|  if (!mn_) {
  ------------------
  |  Branch (545:7): [True: 11.1k, False: 2.59M]
  ------------------
  546|  11.1k|    mnGroup_ = tpi2.group();
  547|  11.1k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  548|  11.1k|  }
  549|  2.60M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  550|  2.62M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  553|  2.60M|                                           TiffComponent::UniquePtr object) {
  554|  2.60M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  555|  2.60M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  558|  2.07M|                                          TiffComponent::UniquePtr object) {
  559|  2.07M|  pRoot_ = pRoot;
  560|  2.07M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (560:7): [True: 6.63k, False: 2.07M]
  ------------------
  561|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  562|  6.63k|    return this;
  563|  6.63k|  }
  564|  2.07M|  tiffPath.pop();
  565|  2.07M|  const TiffPathItem tpi = tiffPath.top();
  566|       |  // Initialize the binary array (if it is a complex array)
  567|  2.07M|  initialize(tpi.group());
  568|       |  // Todo: Duplicates are not allowed!
  569|       |  // To allow duplicate entries, we only check if the new component already
  570|       |  // exists if there is still at least one composite tag on the stack
  571|  2.07M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (571:7): [True: 0, False: 2.07M]
  ------------------
  572|      0|    for (const auto& element : elements_)
  ------------------
  |  Branch (572:30): [True: 0, False: 0]
  ------------------
  573|      0|      if (element->tag() == tpi.tag() && element->group() == tpi.group())
  ------------------
  |  Branch (573:11): [True: 0, False: 0]
  |  Branch (573:42): [True: 0, False: 0]
  ------------------
  574|      0|        return element->addPath(tag, tiffPath, pRoot, std::move(object));
  575|      0|  }
  576|       |
  577|  2.07M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (577:7): [True: 2.07M, False: 0]
  |  Branch (577:31): [True: 0, False: 2.07M]
  ------------------
  578|      0|    auto tc = addChild(std::move(object));
  579|      0|    setCount(elements_.size());
  580|      0|    return tc->addPath(tag, tiffPath, pRoot, nullptr);
  581|      0|  }
  582|       |
  583|  2.07M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  584|  2.07M|  setCount(elements_.size());
  585|  2.07M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  586|  2.07M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  588|  12.0M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  589|  12.0M|  return doAddChild(std::move(tiffComponent));
  590|  12.0M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  596|  7.57M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  597|  7.57M|  return components_.emplace_back(std::move(tiffComponent)).get();
  598|  7.57M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  600|   176k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  601|   176k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  602|   176k|  if (!d)
  ------------------
  |  Branch (602:7): [True: 0, False: 176k]
  ------------------
  603|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  604|       |
  605|   176k|  return ifds_.emplace_back(std::move(d)).get();
  606|   176k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  619|  4.31M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  620|  4.31M|  setDecoded(true);
  621|  4.31M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  622|  4.31M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  624|  4.32k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  625|  4.32k|  return doAddNext(std::move(tiffComponent));
  626|  4.32k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  632|  4.32k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  633|  4.32k|  if (hasNext_) {
  ------------------
  |  Branch (633:7): [True: 4.32k, False: 0]
  ------------------
  634|  4.32k|    pNext_ = std::move(tiffComponent);
  635|  4.32k|    return pNext_.get();
  636|  4.32k|  }
  637|      0|  return nullptr;
  638|  4.32k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  651|  87.0M|void TiffComponent::accept(TiffVisitor& visitor) {
  652|  87.0M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (652:7): [True: 87.0M, False: 25.0k]
  ------------------
  653|  87.0M|    doAccept(visitor);  // one for NVI :)
  654|  87.0M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  656|  54.0M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  657|  54.0M|  visitor.visitEntry(this);
  658|  54.0M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  660|   192k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  661|   192k|  visitor.visitDataEntry(this);
  662|   192k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  664|  2.72M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  665|  2.72M|  visitor.visitImageEntry(this);
  666|  2.72M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  668|  3.86M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  669|  3.86M|  visitor.visitSizeEntry(this);
  670|  3.86M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  672|  2.52M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  673|  2.52M|  visitor.visitDirectory(this);
  674|  62.4M|  for (auto&& component : components_) {
  ------------------
  |  Branch (674:25): [True: 62.4M, False: 2.09M]
  ------------------
  675|  62.4M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (675:9): [True: 425k, False: 62.0M]
  ------------------
  676|   425k|      break;
  677|  62.0M|    component->accept(visitor);
  678|  62.0M|  }
  679|  2.52M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (679:7): [True: 2.07M, False: 446k]
  ------------------
  680|  2.07M|    visitor.visitDirectoryNext(this);
  681|  2.52M|  if (pNext_)
  ------------------
  |  Branch (681:7): [True: 74.0k, False: 2.45M]
  ------------------
  682|  74.0k|    pNext_->accept(visitor);
  683|  2.52M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (683:7): [True: 2.05M, False: 469k]
  ------------------
  684|  2.05M|    visitor.visitDirectoryEnd(this);
  685|  2.52M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  687|   440k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  688|   440k|  visitor.visitSubIfd(this);
  689|  1.94M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (689:19): [True: 1.94M, False: 327k]
  ------------------
  690|  1.94M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:9): [True: 112k, False: 1.83M]
  ------------------
  691|   112k|      break;
  692|  1.83M|    ifd->accept(visitor);
  693|  1.83M|  }
  694|   440k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  696|   246k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  697|   246k|  visitor.visitMnEntry(this);
  698|   246k|  if (mn_)
  ------------------
  |  Branch (698:7): [True: 114k, False: 132k]
  ------------------
  699|   114k|    mn_->accept(visitor);
  700|   246k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (700:7): [True: 2.48k, False: 244k]
  ------------------
  701|  2.48k|    mn_ = nullptr;
  702|  2.48k|  }
  703|       |
  704|   246k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  706|   105k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  707|   105k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (707:7): [True: 105k, False: 0]
  ------------------
  708|   105k|    visitor.visitIfdMakernote(this);
  709|   105k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (709:7): [True: 103k, False: 1.82k]
  ------------------
  710|   103k|    ifd_.accept(visitor);
  711|   105k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (711:7): [True: 103k, False: 1.82k]
  |  Branch (711:52): [True: 83.1k, False: 20.2k]
  ------------------
  712|  83.1k|    visitor.visitIfdMakernoteEnd(this);
  713|   105k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  715|   197k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  716|   197k|  visitor.visitBinaryArray(this);
  717|  22.3M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (717:23): [True: 22.3M, False: 195k]
  ------------------
  718|  22.3M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (718:9): [True: 1.76k, False: 22.3M]
  ------------------
  719|  1.76k|      break;
  720|  22.3M|    element->accept(visitor);
  721|  22.3M|  }
  722|   197k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (722:7): [True: 181k, False: 15.8k]
  ------------------
  723|   181k|    visitor.visitBinaryArrayEnd(this);
  724|   197k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  726|  22.7M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  727|  22.7M|  visitor.visitBinaryElement(this);
  728|  22.7M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  730|  3.20M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  731|  3.20M|  doEncode(encoder, datum);
  732|  3.20M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  734|  2.07M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  735|  2.07M|  encoder.encodeBinaryElement(this, datum);
  736|  2.07M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  738|  6.72k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  739|  6.72k|  encoder.encodeBinaryArray(this, datum);
  740|  6.72k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  742|  6.72k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  743|  6.72k|  encoder.encodeDataEntry(this, datum);
  744|  6.72k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  746|  1.06M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  747|  1.06M|  encoder.encodeTiffEntry(this, datum);
  748|  1.06M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  750|  18.2k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  751|  18.2k|  encoder.encodeImageEntry(this, datum);
  752|  18.2k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  754|  18.0k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  755|  18.0k|  encoder.encodeMnEntry(this, datum);
  756|  18.0k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  758|  18.2k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  759|  18.2k|  encoder.encodeSizeEntry(this, datum);
  760|  18.2k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  762|  1.41k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  763|  1.41k|  encoder.encodeSubIfd(this, datum);
  764|  1.41k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  766|  3.03M|size_t TiffComponent::count() const {
  767|  3.03M|  return doCount();
  768|  3.03M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  770|   439k|size_t TiffDirectory::doCount() const {
  771|   439k|  return components_.size();
  772|   439k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  774|  2.55M|size_t TiffEntryBase::doCount() const {
  775|  2.55M|  return count_;
  776|  2.55M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  778|  51.6k|size_t TiffMnEntry::doCount() const {
  779|  51.6k|  if (!mn_) {
  ------------------
  |  Branch (779:7): [True: 29.5k, False: 22.0k]
  ------------------
  780|  29.5k|    return TiffEntryBase::doCount();
  781|  29.5k|  }
  782|  22.0k|#ifndef SUPPRESS_WARNINGS
  783|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  784|       |  // Makernote in bytes
  785|  22.0k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (785:7): [True: 4.51k, False: 17.5k]
  |  Branch (785:36): [True: 4.42k, False: 90]
  |  Branch (785:68): [True: 4.33k, False: 86]
  ------------------
  786|  4.33k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  4.33k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.33k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.33k|  LogMsg(LogMsg::error).os()
  ------------------
                  EXV_ERROR << stringFormat(
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  787|      0|        "Makernote entry 0x{:04x} has incorrect Exif (TIFF) type {}. (Expected signed or unsigned byte.)\n", tag(),
  788|      0|        static_cast<uint16_t>(tiffType()));
  789|  4.33k|  }
  790|  22.0k|#endif
  791|  22.0k|  return mn_->size();
  792|  51.6k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  798|  32.2k|size_t TiffBinaryArray::doCount() const {
  799|  32.2k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (799:7): [True: 2.32k, False: 29.9k]
  |  Branch (799:17): [True: 10.7k, False: 19.1k]
  ------------------
  800|  13.1k|    return TiffEntryBase::doCount();
  801|       |
  802|  19.1k|  if (elements_.empty())
  ------------------
  |  Branch (802:7): [True: 0, False: 19.1k]
  ------------------
  803|      0|    return 0;
  804|       |
  805|  19.1k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  806|  19.1k|  size_t typeSize = TypeInfo::typeSize(typeId);
  807|  19.1k|  if (0 == typeSize) {
  ------------------
  |  Branch (807:7): [True: 148, False: 18.9k]
  ------------------
  808|    148|#ifndef SUPPRESS_WARNINGS
  809|    148|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|    148|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 148]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    148|  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
  ------------------
  810|      0|                                groupName(group()), tag(), static_cast<uint16_t>(tiffType()));
  811|    148|#endif
  812|    148|    typeSize = 1;
  813|    148|  }
  814|       |
  815|  19.1k|  return size() / typeSize;
  816|  19.1k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  818|  1.68k|size_t TiffBinaryElement::doCount() const {
  819|  1.68k|  return elDef_.count_;
  820|  1.68k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  823|  3.29M|                            size_t& imageIdx) {
  824|  3.29M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  825|  3.29M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  828|  51.0k|                              size_t& imageIdx) {
  829|  51.0k|  bool isRootDir = (imageIdx == std::string::npos);
  830|       |
  831|       |  // Number of components to write
  832|  51.0k|  const size_t compCount = count();
  833|  51.0k|  if (compCount > 0xffff)
  ------------------
  |  Branch (833:7): [True: 0, False: 51.0k]
  ------------------
  834|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  835|       |
  836|       |  // Size of next IFD, if any
  837|  51.0k|  size_t sizeNext = 0;
  838|  51.0k|  if (pNext_)
  ------------------
  |  Branch (838:7): [True: 1.18k, False: 49.8k]
  ------------------
  839|  1.18k|    sizeNext = pNext_->size();
  840|       |
  841|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  842|  51.0k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (842:7): [True: 1.13k, False: 49.9k]
  |  Branch (842:25): [True: 404, False: 731]
  ------------------
  843|    404|    return 0;
  844|       |
  845|       |  // Include image bytes in the preflight; no classic TIFF output may wrap its offsets.
  846|  50.6k|  const auto outputSize = addTiffSize(size(), isRootDir ? sizeImage() : 0);
  ------------------
  |  Branch (846:47): [True: 18.9k, False: 31.6k]
  ------------------
  847|  50.6k|  enforce(offset <= std::numeric_limits<uint32_t>::max() && outputSize <= std::numeric_limits<uint32_t>::max() - offset,
  ------------------
  |  Branch (847:11): [True: 50.6k, False: 0]
  |  Branch (847:61): [True: 50.6k, False: 0]
  ------------------
  848|  50.6k|          ErrorCode::kerOffsetOutOfRange);
  849|       |
  850|       |  // Remember the offset of the CR2 RAW IFD
  851|  50.6k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (851:7): [True: 38, False: 50.6k]
  ------------------
  852|       |#ifdef EXIV2_DEBUG_MESSAGES
  853|       |    std::cerr << "Directory " << groupName(group()) << " offset is 0x" << std::setw(8) << std::setfill('0') << std::hex
  854|       |              << offset << std::dec << "\n";
  855|       |#endif
  856|     38|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  857|     38|  }
  858|       |  // Size of all directory entries, without values and additional data
  859|  50.6k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (859:50): [True: 50.3k, False: 299]
  ------------------
  860|       |
  861|       |  // TIFF standard requires IFD entries to be sorted in ascending order by tag.
  862|       |  // Not sorting makernote directories sometimes preserves them better.
  863|  50.6k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (863:7): [True: 34.1k, False: 16.4k]
  ------------------
  864|  34.1k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  865|  34.1k|  }
  866|       |  // Size of IFD values and additional data
  867|  50.6k|  size_t sizeValue = 0;
  868|  50.6k|  size_t sizeData = 0;
  869|  1.17M|  for (auto&& component : components_) {
  ------------------
  |  Branch (869:25): [True: 1.17M, False: 50.6k]
  ------------------
  870|  1.17M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (870:40): [True: 150k, False: 1.02M]
  ------------------
  871|   150k|      sizeValue = addTiffSize(sizeValue, alignedTiffSize(sv));
  872|   150k|    }
  873|       |    // Also add the size of data, but only if needed
  874|  1.17M|    if (isRootDir) {
  ------------------
  |  Branch (874:9): [True: 498k, False: 674k]
  ------------------
  875|   498k|      auto sd = component->sizeData();
  876|   498k|      sizeData = addTiffSize(sizeData, alignedTiffSize(sd));
  877|   498k|    }
  878|  1.17M|  }
  879|       |
  880|  50.6k|  size_t idx = 0;                             // Current IFD index / bytes written
  881|  50.6k|  valueIdx = sizeDir;                         // Offset to the current IFD value
  882|  50.6k|  dataIdx = addTiffSize(sizeDir, sizeValue);  // Offset to the entry's data area
  883|  50.6k|  if (isRootDir) {                            // Absolute offset to the image data
  ------------------
  |  Branch (883:7): [True: 18.9k, False: 31.6k]
  ------------------
  884|  18.9k|    imageIdx = alignedTiffSize(addTiffSize(addTiffSize(offset, dataIdx), addTiffSize(sizeData, sizeNext)));
  885|  18.9k|  }
  886|       |
  887|       |  // 1st: Write the IFD, a) Number of directory entries
  888|  50.6k|  byte buf[4];
  889|  50.6k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  890|  50.6k|  ioWrapper.write(buf, 2);
  891|  50.6k|  idx += 2;
  892|       |  // b) Directory entries - may contain pointers to the value or data
  893|  1.16M|  for (auto&& component : components_) {
  ------------------
  |  Branch (893:25): [True: 1.16M, False: 50.6k]
  ------------------
  894|  1.16M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  895|  1.16M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (895:40): [True: 149k, False: 1.01M]
  ------------------
  896|   149k|      valueIdx = addTiffSize(valueIdx, alignedTiffSize(sv));
  897|   149k|    }
  898|  1.16M|    auto sd = component->sizeData();
  899|  1.16M|    dataIdx = addTiffSize(dataIdx, alignedTiffSize(sd));
  900|  1.16M|  }
  901|       |  // c) Pointer to the next IFD
  902|  50.6k|  if (hasNext_) {
  ------------------
  |  Branch (902:7): [True: 50.1k, False: 526]
  ------------------
  903|  50.1k|    memset(buf, 0x0, 4);
  904|  50.1k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (904:9): [True: 1.18k, False: 48.9k]
  |  Branch (904:19): [True: 1.18k, False: 1]
  ------------------
  905|  1.18k|      l2Data(buf, tiffOffset(addTiffSize(offset, dataIdx)), byteOrder);
  906|  1.18k|    }
  907|  50.1k|    ioWrapper.write(buf, 4);
  908|  50.1k|    idx += 4;
  909|  50.1k|  }
  910|       |
  911|       |  // 2nd: Write IFD values - may contain pointers to additional data
  912|  50.6k|  valueIdx = sizeDir;
  913|  50.6k|  dataIdx = addTiffSize(sizeDir, sizeValue);
  914|  1.15M|  for (auto&& component : components_) {
  ------------------
  |  Branch (914:25): [True: 1.15M, False: 50.6k]
  ------------------
  915|  1.15M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (915:40): [True: 146k, False: 1.01M]
  ------------------
  916|   146k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  917|   146k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  918|   146k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (918:11): [True: 26.2k, False: 120k]
  ------------------
  919|  26.2k|        ioWrapper.putb(0x0);  // Align value to word boundary
  920|  26.2k|        sv += 1;
  921|  26.2k|      }
  922|   146k|      idx = addTiffSize(idx, sv);
  923|   146k|      valueIdx = addTiffSize(valueIdx, sv);
  924|   146k|    }
  925|  1.15M|    auto sd = component->sizeData();
  926|  1.15M|    dataIdx = addTiffSize(dataIdx, alignedTiffSize(sd));
  927|  1.15M|  }
  928|       |
  929|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  930|  50.6k|  dataIdx = addTiffSize(sizeDir, sizeValue);
  931|  50.6k|  idx = addTiffSize(idx, writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx));
  932|       |
  933|       |  // 4th: Write next-IFD
  934|  50.6k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (934:7): [True: 1.16k, False: 49.4k]
  |  Branch (934:17): [True: 1.16k, False: 1]
  ------------------
  935|  1.16k|    idx = addTiffSize(idx, pNext_->write(ioWrapper, byteOrder, addTiffSize(offset, idx), std::string::npos,
  936|  1.16k|                                         std::string::npos, imageIdx));
  937|  1.16k|  }
  938|       |
  939|       |  // 5th, at the root directory level only: write image data
  940|  50.6k|  if (isRootDir) {
  ------------------
  |  Branch (940:7): [True: 18.2k, False: 32.3k]
  ------------------
  941|  18.2k|    idx = addTiffSize(idx, writeImage(ioWrapper, byteOrder));
  942|  18.2k|  }
  943|       |
  944|  50.6k|  return idx;
  945|  51.0k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  948|  1.16M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  949|  1.16M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  950|  1.16M|  if (!pDirEntry)
  ------------------
  |  Branch (950:7): [True: 0, False: 1.16M]
  ------------------
  951|      0|    return 0;
  952|  1.16M|  enforce(pDirEntry->count() <= std::numeric_limits<uint32_t>::max(), ErrorCode::kerImageWriteFailed);
  953|  1.16M|  byte buf[8];
  954|  1.16M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  955|  1.16M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  956|  1.16M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  957|  1.16M|  ioWrapper.write(buf, 8);
  958|  1.16M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (958:7): [True: 149k, False: 1.01M]
  ------------------
  959|   149k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  960|   149k|    ul2Data(buf, tiffOffset(pDirEntry->offset()), byteOrder);
  961|   149k|    ioWrapper.write(buf, 4);
  962|  1.01M|  } else {
  963|  1.01M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  964|  1.01M|#ifndef SUPPRESS_WARNINGS
  965|  1.01M|    if (len > 4) {
  ------------------
  |  Branch (965:9): [True: 9, False: 1.01M]
  ------------------
  966|      9|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|      9|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 9]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      9|  LogMsg(LogMsg::error).os()
  ------------------
  967|      9|    }
  968|  1.01M|#endif
  969|  1.01M|    if (len < 4) {
  ------------------
  |  Branch (969:9): [True: 988k, False: 30.0k]
  ------------------
  970|   988k|      memset(buf, 0x0, 4);
  971|   988k|      ioWrapper.write(buf, 4 - len);
  972|   988k|    }
  973|  1.01M|  }
  974|  1.16M|  return 12;
  975|  1.16M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  978|  1.10M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  979|  1.10M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (979:7): [True: 28.4k, False: 1.07M]
  |  Branch (979:19): [True: 904k, False: 174k]
  ------------------
  980|   932k|    return 0;
  981|       |
  982|   174k|  DataBuf buf(pValue_->size());
  983|   174k|  pValue_->copy(buf.data(), byteOrder);
  984|   174k|  ioWrapper.write(buf.c_data(), buf.size());
  985|   174k|  return buf.size();
  986|  1.10M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  988|   103k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  989|   103k|  size_t rc = 0;
  990|   103k|  switch (tiffType) {
  991|  2.33k|    case ttUnsignedShort:
  ------------------
  |  Branch (991:5): [True: 2.33k, False: 101k]
  ------------------
  992|  5.24k|    case ttSignedShort:
  ------------------
  |  Branch (992:5): [True: 2.91k, False: 101k]
  ------------------
  993|  5.24k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (993:11): [True: 31, False: 5.21k]
  ------------------
  994|     31|        throw Error(ErrorCode::kerOffsetOutOfRange);
  995|  5.21k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  996|  5.21k|      break;
  997|  92.1k|    case ttUnsignedLong:
  ------------------
  |  Branch (997:5): [True: 92.1k, False: 11.7k]
  ------------------
  998|  98.2k|    case ttSignedLong:
  ------------------
  |  Branch (998:5): [True: 6.03k, False: 97.9k]
  ------------------
  999|  98.2k|      if (offset > std::numeric_limits<uint32_t>::max())
  ------------------
  |  Branch (999:11): [True: 14, False: 98.2k]
  ------------------
 1000|     14|        throw Error(ErrorCode::kerOffsetOutOfRange);
 1001|  98.2k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
 1002|  98.2k|      break;
 1003|    517|    default:
  ------------------
  |  Branch (1003:5): [True: 517, False: 103k]
  ------------------
 1004|    517|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
 1005|   103k|  }
 1006|   103k|  return rc;
 1007|   103k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1010|  4.73k|                              size_t dataIdx, size_t& /*imageIdx*/) {
 1011|  4.73k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (1011:7): [True: 324, False: 4.41k]
  |  Branch (1011:20): [True: 1.84k, False: 2.57k]
  ------------------
 1012|  2.16k|    return 0;
 1013|       |
 1014|  2.57k|  DataBuf buf(pValue()->size());
 1015|  2.57k|  size_t idx = 0;
 1016|  2.57k|  const size_t prevOffset = pValue()->toUint32(0);
 1017|  22.2k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (1017:22): [True: 19.6k, False: 2.57k]
  ------------------
 1018|  19.6k|    const size_t iOffset = pValue()->toUint32(i);
 1019|  19.6k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1020|  19.6k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1021|  19.6k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1022|  19.6k|  }
 1023|  2.57k|  ioWrapper.write(buf.c_data(), buf.size());
 1024|  2.57k|  return buf.size();
 1025|  4.73k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1028|  16.7k|                               size_t dataIdx, size_t& imageIdx) {
 1029|  16.7k|  size_t o2 = imageIdx;
 1030|       |  // For makernotes, write TIFF image data to the data area
 1031|  16.7k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1031:7): [True: 90, False: 16.6k]
  ------------------
 1032|     90|    o2 = Safe::add<size_t>(offset, dataIdx);
 1033|       |#ifdef EXIV2_DEBUG_MESSAGES
 1034|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1035|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1036|       |#endif
 1037|  16.7k|  DataBuf buf(strips_.size() * 4);
 1038|  16.7k|  size_t idx = 0;
 1039|  64.3k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1039:29): [True: 64.3k, False: 16.7k]
  ------------------
 1040|  64.3k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1041|       |    // Align strip data to word boundary
 1042|  64.3k|    const auto sz = Safe::add(off, off & 1);
 1043|  64.3k|    o2 = Safe::add(o2, sz);
 1044|  64.3k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1044:9): [True: 63.5k, False: 716]
  ------------------
 1045|  63.5k|      imageIdx = Safe::add(imageIdx, sz);
 1046|  64.3k|  }
 1047|  16.7k|  ioWrapper.write(buf.c_data(), buf.size());
 1048|  16.7k|  return buf.size();
 1049|  16.7k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1052|  16.0k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1053|  16.0k|  DataBuf buf(ifds_.size() * 4);
 1054|  16.0k|  size_t idx = 0;
 1055|       |  // Sort IFDs by group, needed if image data tags were copied first
 1056|  16.0k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1057|  20.0k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1057:19): [True: 20.0k, False: 16.0k]
  ------------------
 1058|  20.0k|    idx += writeOffset(buf.data(idx), addTiffSize(offset, dataIdx), tiffType(), byteOrder);
 1059|  20.0k|    dataIdx = addTiffSize(dataIdx, ifd->size());
 1060|  20.0k|  }
 1061|  16.0k|  ioWrapper.write(buf.c_data(), buf.size());
 1062|  16.0k|  return buf.size();
 1063|  16.0k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1066|  25.5k|                            size_t& imageIdx) {
 1067|  25.5k|  if (!mn_) {
  ------------------
  |  Branch (1067:7): [True: 14.5k, False: 11.0k]
  ------------------
 1068|  14.5k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1069|  14.5k|  }
 1070|  11.0k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1071|  25.5k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1074|  11.0k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1075|  11.0k|  mnOffset_ = offset;
 1076|  11.0k|  setImageByteOrder(byteOrder);
 1077|  11.0k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1078|  11.0k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1079|  11.0k|                    imageIdx);
 1080|  11.0k|  return len;
 1081|  11.0k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1084|  16.0k|                                size_t dataIdx, size_t& imageIdx) {
 1085|  16.0k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1085:7): [True: 1.14k, False: 14.8k]
  |  Branch (1085:17): [True: 5.31k, False: 9.54k]
  ------------------
 1086|  6.46k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1087|  9.54k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1087:7): [True: 1.51k, False: 8.03k]
  ------------------
 1088|  1.51k|    byteOrder = cfg()->byteOrder_;
 1089|       |  // Tags must be sorted in ascending order
 1090|  9.54k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1091|  9.54k|  size_t idx = 0;
 1092|  9.54k|  MemIo mio;  // memory stream in which to store data
 1093|  9.54k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1094|       |  // Some array entries need to have the size in the first element
 1095|  9.54k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1095:7): [True: 344, False: 9.19k]
  ------------------
 1096|    344|    byte buf[4];
 1097|    344|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1098|    344|    switch (elSize) {
 1099|    152|      case 2:
  ------------------
  |  Branch (1099:7): [True: 152, False: 192]
  ------------------
 1100|    152|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1101|    152|        break;
 1102|    192|      case 4:
  ------------------
  |  Branch (1102:7): [True: 192, False: 152]
  ------------------
 1103|    192|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1104|    192|        break;
 1105|      0|      default:
  ------------------
  |  Branch (1105:7): [True: 0, False: 344]
  ------------------
 1106|      0|        break;
 1107|    344|    }
 1108|    344|    mioWrapper.write(buf, elSize);
 1109|    344|  }
 1110|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1111|  2.06M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1111:23): [True: 2.06M, False: 9.54k]
  ------------------
 1112|       |    // Skip the manufactured tag, if it exists
 1113|  2.06M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1113:9): [True: 237k, False: 1.82M]
  |  Branch (1113:28): [True: 346, False: 237k]
  ------------------
 1114|    346|      continue;
 1115|  2.06M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1116|  2.06M|    idx += fillGap(mioWrapper, idx, newIdx);
 1117|  2.06M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1118|  2.06M|  }
 1119|  9.54k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1119:7): [True: 7.60k, False: 1.93k]
  |  Branch (1119:29): [True: 7.60k, False: 0]
  ------------------
 1120|  7.60k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1121|  7.60k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1122|  7.60k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1123|  7.60k|  }
 1124|       |
 1125|  9.54k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1125:7): [True: 1.43k, False: 8.10k]
  ------------------
 1126|       |    // Select sonyTagEncipher
 1127|  1.43k|    CryptFct cryptFct = cfg()->cryptFct_;
 1128|  1.43k|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1128:9): [True: 253, False: 1.18k]
  ------------------
 1129|    253|      cryptFct = sonyTagEncipher;
 1130|    253|    }
 1131|  1.43k|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1132|  1.43k|    if (!buf.empty()) {
  ------------------
  |  Branch (1132:9): [True: 431, False: 1.00k]
  ------------------
 1133|    431|      mio.seek(0, Exiv2::BasicIo::beg);
 1134|    431|      mio.write(buf.c_data(), buf.size());
 1135|    431|    }
 1136|  1.43k|  }
 1137|  9.54k|  ioWrapper.write(mio.mmap(), mio.size());
 1138|       |
 1139|  9.54k|  return idx;
 1140|  9.54k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1143|  2.06M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1144|  2.06M|  auto pv = pValue();
 1145|  2.06M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1145:7): [True: 0, False: 2.06M]
  |  Branch (1145:14): [True: 991k, False: 1.07M]
  ------------------
 1146|   991k|    return 0;
 1147|  1.07M|  DataBuf buf(pv->size());
 1148|  1.07M|  pv->copy(buf.data(), byteOrder);
 1149|  1.07M|  ioWrapper.write(buf.c_data(), buf.size());
 1150|  1.07M|  return buf.size();
 1151|  2.06M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1154|  1.20M|                                size_t& imageIdx) const {
 1155|  1.20M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1156|  1.20M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1159|  49.8k|                                  size_t& imageIdx) const {
 1160|  49.8k|  size_t len = 0;
 1161|  1.15M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1161:25): [True: 1.15M, False: 49.8k]
  ------------------
 1162|  1.15M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1163|  1.15M|  }
 1164|  49.8k|  return len;
 1165|  49.8k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1168|  1.11M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1169|  1.11M|  return 0;
 1170|  1.11M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1173|  16.2k|                                   size_t& /*imageIdx*/) const {
 1174|  16.2k|  size_t len = 0;
 1175|       |  // For makernotes, write TIFF image data to the data area
 1176|  16.2k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1176:7): [True: 87, False: 16.1k]
  ------------------
 1177|     87|    len = writeImage(ioWrapper, byteOrder);
 1178|     87|  }
 1179|  16.2k|  return len;
 1180|  16.2k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1183|  4.07k|                                  size_t& /*imageIdx*/) const {
 1184|  4.07k|  if (!pValue())
  ------------------
  |  Branch (1184:7): [True: 287, False: 3.79k]
  ------------------
 1185|    287|    return 0;
 1186|       |
 1187|  3.79k|  DataBuf buf = pValue()->dataArea();
 1188|  3.79k|  if (!buf.empty())
  ------------------
  |  Branch (1188:7): [True: 983, False: 2.80k]
  ------------------
 1189|    983|    ioWrapper.write(buf.c_data(), buf.size());
 1190|       |  // Align data to word boundary
 1191|  3.79k|  size_t align = (buf.size() & 1);
 1192|  3.79k|  if (align)
  ------------------
  |  Branch (1192:7): [True: 675, False: 3.11k]
  ------------------
 1193|    675|    ioWrapper.putb(0x0);
 1194|       |
 1195|  3.79k|  return buf.size() + align;
 1196|  4.07k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1199|  16.0k|                               size_t& imageIdx) const {
 1200|  16.0k|  size_t len = 0;
 1201|  19.5k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1201:19): [True: 19.5k, False: 16.0k]
  ------------------
 1202|  19.5k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1203|  19.5k|  }
 1204|       |  // Align data to word boundary
 1205|  16.0k|  size_t align = (len & 1);
 1206|  16.0k|  if (align)
  ------------------
  |  Branch (1206:7): [True: 0, False: 16.0k]
  ------------------
 1207|      0|    ioWrapper.putb(0x0);
 1208|       |
 1209|  16.0k|  return len + align;
 1210|  16.0k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1217|   643k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1218|   643k|  return doWriteImage(ioWrapper, byteOrder);
 1219|   643k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1221|  32.5k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1222|  32.5k|  size_t len = 0;
 1223|  32.5k|  const TiffComponent* pSubIfd = nullptr;
 1224|   611k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1224:30): [True: 611k, False: 32.5k]
  ------------------
 1225|   611k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1225:9): [True: 2.06k, False: 609k]
  ------------------
 1226|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1227|  2.06k|#ifndef SUPPRESS_WARNINGS
 1228|  2.06k|      if (pSubIfd) {
  ------------------
  |  Branch (1228:11): [True: 606, False: 1.45k]
  ------------------
 1229|    606|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    606|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 606]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    606|  LogMsg(LogMsg::error).os()
  ------------------
 1230|    606|      }
 1231|  2.06k|#endif
 1232|  2.06k|      pSubIfd = component.get();
 1233|  2.06k|      continue;
 1234|  2.06k|    }
 1235|   609k|    len += component->writeImage(ioWrapper, byteOrder);
 1236|   609k|  }
 1237|  32.5k|  if (pSubIfd) {
  ------------------
  |  Branch (1237:7): [True: 1.42k, False: 31.1k]
  ------------------
 1238|  1.42k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1239|  1.42k|  }
 1240|  32.5k|  if (pNext_) {
  ------------------
  |  Branch (1240:7): [True: 852, False: 31.7k]
  ------------------
 1241|    852|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1242|    852|  }
 1243|  32.5k|  return len;
 1244|  32.5k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1246|   586k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1247|   586k|  return 0;
 1248|   586k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1250|  10.1k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1251|  10.1k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1252|  10.1k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1253|  10.1k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1263|  14.6k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1264|  14.6k|  if (!pValue())
  ------------------
  |  Branch (1264:7): [True: 297, False: 14.3k]
  ------------------
 1265|    297|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1266|       |
 1267|  14.3k|  size_t len = pValue()->sizeDataArea();
 1268|  14.3k|  if (len > 0) {
  ------------------
  |  Branch (1268:7): [True: 574, False: 13.7k]
  ------------------
 1269|       |#ifdef EXIV2_DEBUG_MESSAGES
 1270|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1271|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1272|       |#endif
 1273|    574|    DataBuf buf = pValue()->dataArea();
 1274|    574|    ioWrapper.write(buf.c_data(), buf.size());
 1275|    574|    size_t align = len & 1;  // Align image data to word boundary
 1276|    574|    if (align)
  ------------------
  |  Branch (1276:9): [True: 299, False: 275]
  ------------------
 1277|    299|      ioWrapper.putb(0x0);
 1278|    574|    len += align;
 1279|  13.7k|  } else {
 1280|       |#ifdef EXIV2_DEBUG_MESSAGES
 1281|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1282|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1283|       |#endif
 1284|  13.7k|    len = 0;
 1285|  57.7k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1285:24): [True: 57.7k, False: 13.7k]
  ------------------
 1286|  57.7k|      ioWrapper.write(f, s);
 1287|  57.7k|      len += s;
 1288|  57.7k|      size_t align = s & 1;  // Align strip data to word boundary
 1289|  57.7k|      if (align)
  ------------------
  |  Branch (1289:11): [True: 32.4k, False: 25.2k]
  ------------------
 1290|  32.4k|        ioWrapper.putb(0x0);
 1291|  57.7k|      len += align;
 1292|  57.7k|    }
 1293|  13.7k|  }
 1294|       |#ifdef EXIV2_DEBUG_MESSAGES
 1295|       |  std::cerr << ", len = " << len << " bytes\n";
 1296|       |#endif
 1297|  14.3k|  return len;
 1298|  14.6k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1300|  24.6M|size_t TiffComponent::size() const {
 1301|  24.6M|  return doSize();
 1302|  24.6M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1304|   388k|size_t TiffDirectory::doSize() const {
 1305|   388k|  size_t compCount = count();
 1306|   388k|  enforce(compCount <= 0xffff, ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
 1307|       |  // Size of the directory, without values and additional data
 1308|   388k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1308:40): [True: 384k, False: 4.21k]
  ------------------
 1309|       |  // Size of IFD values and data
 1310|  9.73M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1310:25): [True: 9.73M, False: 388k]
  ------------------
 1311|  9.73M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1311:40): [True: 1.09M, False: 8.64M]
  ------------------
 1312|  1.09M|      len = addTiffSize(len, alignedTiffSize(sv));
 1313|  1.09M|    }
 1314|  9.73M|    auto sd = component->sizeData();
 1315|  9.73M|    len = addTiffSize(len, alignedTiffSize(sd));
 1316|  9.73M|  }
 1317|       |  // Size of next-IFD, if any
 1318|   388k|  size_t sizeNext = 0;
 1319|   388k|  if (pNext_) {
  ------------------
  |  Branch (1319:7): [True: 2.77k, False: 386k]
  ------------------
 1320|  2.77k|    sizeNext = pNext_->size();
 1321|  2.77k|    len = addTiffSize(len, sizeNext);
 1322|  2.77k|  }
 1323|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1324|   388k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1324:7): [True: 2.81k, False: 386k]
  |  Branch (1324:25): [True: 1.10k, False: 1.70k]
  ------------------
 1325|  1.10k|    len = 0;
 1326|   388k|  return len;
 1327|   388k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1329|  20.6M|size_t TiffEntryBase::doSize() const {
 1330|  20.6M|  return size_;
 1331|  20.6M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1333|   160k|size_t TiffImageEntry::doSize() const {
 1334|   160k|  return strips_.size() * 4;
 1335|   160k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1337|   163k|size_t TiffSubIfd::doSize() const {
 1338|   163k|  return ifds_.size() * 4;
 1339|   163k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1341|   198k|size_t TiffMnEntry::doSize() const {
 1342|   198k|  if (!mn_) {
  ------------------
  |  Branch (1342:7): [True: 88.1k, False: 110k]
  ------------------
 1343|  88.1k|    return TiffEntryBase::doSize();
 1344|  88.1k|  }
 1345|   110k|  return mn_->size();
 1346|   198k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1348|   132k|size_t TiffIfdMakernote::doSize() const {
 1349|   132k|  return addTiffSize(sizeHeader(), ifd_.size());
 1350|   132k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1352|   309k|size_t TiffBinaryArray::doSize() const {
 1353|   309k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1353:7): [True: 20.8k, False: 288k]
  |  Branch (1353:17): [True: 96.9k, False: 191k]
  ------------------
 1354|   117k|    return TiffEntryBase::doSize();
 1355|       |
 1356|   191k|  if (elements_.empty())
  ------------------
  |  Branch (1356:7): [True: 0, False: 191k]
  ------------------
 1357|      0|    return 0;
 1358|       |
 1359|       |  // Remaining assumptions:
 1360|       |  // - array elements don't "overlap"
 1361|       |  // - no duplicate tags in the array
 1362|   191k|  size_t idx = 0;
 1363|   191k|  size_t sz = cfg()->tagStep();
 1364|  41.6M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1364:23): [True: 41.6M, False: 191k]
  ------------------
 1365|  41.6M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1365:9): [True: 9.67M, False: 31.9M]
  ------------------
 1366|  9.67M|      idx = element->tag();
 1367|  9.67M|      sz = element->size();
 1368|  9.67M|    }
 1369|  41.6M|  }
 1370|   191k|  idx *= cfg()->tagStep();
 1371|   191k|  idx += sz;
 1372|       |
 1373|   191k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1373:7): [True: 152k, False: 39.2k]
  |  Branch (1373:29): [True: 152k, False: 0]
  ------------------
 1374|   152k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1375|   152k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1376|   152k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1377|   152k|  }
 1378|   191k|  return idx;
 1379|       |
 1380|   191k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1382|  9.67M|size_t TiffBinaryElement::doSize() const {
 1383|  9.67M|  if (!pValue())
  ------------------
  |  Branch (1383:7): [True: 0, False: 9.67M]
  ------------------
 1384|      0|    return 0;
 1385|  9.67M|  return pValue()->size();
 1386|  9.67M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1388|  12.5M|size_t TiffComponent::sizeData() const {
 1389|  12.5M|  return doSizeData();
 1390|  12.5M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1396|  12.2M|size_t TiffEntryBase::doSizeData() const {
 1397|  12.2M|  return 0;
 1398|  12.2M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1400|   134k|size_t TiffImageEntry::doSizeData() const {
 1401|   134k|  size_t len = 0;
 1402|       |  // For makernotes, TIFF image data is written to the data area
 1403|   134k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1403:7): [True: 2.78k, False: 131k]
  ------------------
 1404|  2.78k|    len = sizeImage();
 1405|  2.78k|  }
 1406|   134k|  return len;
 1407|   134k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1409|  58.6k|size_t TiffDataEntry::doSizeData() const {
 1410|  58.6k|  if (!pValue())
  ------------------
  |  Branch (1410:7): [True: 1.94k, False: 56.6k]
  ------------------
 1411|  1.94k|    return 0;
 1412|  56.6k|  return pValue()->sizeDataArea();
 1413|  58.6k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1415|   141k|size_t TiffSubIfd::doSizeData() const {
 1416|   141k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, addTiffSize, std::mem_fn(&TiffSubIfd::size));
 1417|   141k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1423|  1.39M|size_t TiffComponent::sizeImage() const {
 1424|  1.39M|  return doSizeImage();
 1425|  1.39M|}
_ZNK5Exiv28Internal13TiffDirectory11doSizeImageEv:
 1427|  70.9k|size_t TiffDirectory::doSizeImage() const {
 1428|  70.9k|  size_t len = pNext_ ? pNext_->sizeImage() : 0;
  ------------------
  |  Branch (1428:16): [True: 2.45k, False: 68.4k]
  ------------------
 1429|  70.9k|  return std::transform_reduce(components_.begin(), components_.end(), len, addTiffSize,
 1430|  70.9k|                               std::mem_fn(&TiffDirectory::sizeImage));
 1431|  70.9k|}
_ZNK5Exiv28Internal10TiffSubIfd11doSizeImageEv:
 1433|  21.3k|size_t TiffSubIfd::doSizeImage() const {
 1434|  21.3k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, addTiffSize, std::mem_fn(&TiffSubIfd::sizeImage));
 1435|  21.3k|}  // TiffSubIfd::doSizeImage
_ZNK5Exiv28Internal13TiffEntryBase11doSizeImageEv:
 1441|  1.25M|size_t TiffEntryBase::doSizeImage() const {
 1442|  1.25M|  return 0;
 1443|  1.25M|}  // TiffEntryBase::doSizeImage
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1445|  43.7k|size_t TiffImageEntry::doSizeImage() const {
 1446|  43.7k|  if (!pValue())
  ------------------
  |  Branch (1446:7): [True: 2.37k, False: 41.3k]
  ------------------
 1447|  2.37k|    return 0;
 1448|  41.3k|  auto len = pValue()->sizeDataArea();
 1449|  41.3k|  if (len != 0)
  ------------------
  |  Branch (1449:7): [True: 1.25k, False: 40.0k]
  ------------------
 1450|  1.25k|    return len;
 1451|       |
 1452|  40.0k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, addTiffSize,
 1453|  40.0k|                               [](const auto& s) { return s.second; });
 1454|  41.3k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1471|  15.8M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1472|  15.8M|  auto ti = static_cast<TypeId>(tiffType);
 1473|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1474|  15.8M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1474:22): [True: 8.18k, False: 15.8M]
  ------------------
 1475|  8.18k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1475:9): [True: 6.45k, False: 1.73k]
  ------------------
 1476|  6.45k|      ti = comment;
 1477|  6.45k|    }
 1478|  8.18k|  }
 1479|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1480|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1481|  15.8M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1481:7): [True: 5.76M, False: 10.1M]
  ------------------
 1482|  5.76M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1482:9): [True: 5.65k, False: 5.76M]
  |  Branch (1482:26): [True: 1.21k, False: 4.44k]
  |  Branch (1482:58): [True: 2.90k, False: 5.76M]
  |  Branch (1482:75): [True: 18, False: 2.89k]
  ------------------
 1483|  1.23k|    ti = Exiv2::signedByte;
 1484|  1.23k|  }
 1485|  15.8M|  return ti;
 1486|  15.8M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1488|  6.73M|TiffType toTiffType(TypeId typeId) {
 1489|  6.73M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1489:7): [True: 0, False: 6.73M]
  ------------------
 1490|      0|#ifndef SUPPRESS_WARNINGS
 1491|      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()
  ------------------
 1492|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1493|      0|#endif
 1494|      0|    return ttUndefined;
 1495|      0|  }
 1496|  6.73M|  return static_cast<TiffType>(typeId);
 1497|  6.73M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1499|  38.5M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1500|  38.5M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1500:7): [True: 29.9M, False: 8.59M]
  ------------------
 1501|  29.9M|    return lhs->tag() < rhs->tag();
 1502|  8.59M|  return lhs->idx() < rhs->idx();
 1503|  38.5M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1505|  7.06M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1506|  7.06M|  return std::make_unique<TiffEntry>(tag, group);
 1507|  7.06M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1509|  49.3k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1510|  49.3k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1511|  49.3k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1513|  4.37M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1514|  4.37M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1515|  4.37M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  490|  1.21M|  auto atc = [&] {
  491|  1.21M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (491:9): [True: 1.17M, False: 35.7k]
  |  Branch (491:33): [True: 45.5k, False: 1.13M]
  ------------------
  492|  45.5k|      return std::move(object);
  493|  45.5k|    }
  494|  1.16M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  495|  1.21M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  502|  1.19M|  tc = [&] {
  503|  1.19M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (503:9): [True: 1.26k, False: 1.19M]
  ------------------
  504|  1.26k|      return this->addNext(std::move(atc));
  505|  1.19M|    return this->addChild(std::move(atc));
  506|  1.19M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  525|  20.2k|  auto tc = [&] {
  526|  20.2k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (526:9): [True: 0, False: 20.2k]
  |  Branch (526:33): [True: 0, False: 0]
  ------------------
  527|      0|      return addChild(std::move(object));
  528|      0|    }
  529|  20.2k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  530|  20.2k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_111addTiffSizeEmm:
   38|  44.3M|size_t addTiffSize(size_t lhs, size_t rhs) {
   39|  44.3M|  Exiv2::Internal::enforce(rhs <= std::numeric_limits<size_t>::max() - lhs, Exiv2::ErrorCode::kerArithmeticOverflow);
   40|  44.3M|  return lhs + rhs;
   41|  44.3M|}
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_115alignedTiffSizeEm:
   44|  13.9M|size_t alignedTiffSize(size_t size) {
   45|  13.9M|  return addTiffSize(size, size & 1);
   46|  13.9M|}
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_110tiffOffsetEm:
   49|   150k|uint32_t tiffOffset(size_t offset) {
   50|   150k|  Exiv2::Internal::enforce(offset <= std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerOffsetOutOfRange);
   51|   150k|  return static_cast<uint32_t>(offset);
   52|   150k|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1056|  4.59k|  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_:
 1252|  13.4k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1453|  14.1M|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1456|  94.9k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1457|  94.9k|  const TagInfo* tags = [=] {
 1458|  94.9k|    if (group == IfdId::gpsId)
 1459|  94.9k|      return Internal::gpsTagList();
 1460|  94.9k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1461|  94.9k|  }();
 1462|  94.9k|  if (tags)
  ------------------
  |  Branch (1462:7): [True: 9.14k, False: 85.7k]
  ------------------
 1463|   284k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1463:26): [True: 283k, False: 960]
  ------------------
 1464|   283k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1464:11): [True: 8.18k, False: 275k]
  ------------------
 1465|  8.18k|        return tags + idx;
 1466|  86.7k|  return nullptr;
 1467|  94.9k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1457|  94.9k|  const TagInfo* tags = [=] {
 1458|  94.9k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1458:9): [True: 7.15k, False: 87.7k]
  ------------------
 1459|  7.15k|      return Internal::gpsTagList();
 1460|  87.7k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1460:12): [True: 1.99k, False: 85.7k]
  ------------------
 1461|  94.9k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1522|  2.07M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1523|  2.07M|  if (curr < tobe) {
  ------------------
  |  Branch (1523:7): [True: 324k, False: 1.75M]
  ------------------
 1524|   324k|    Exiv2::DataBuf buf(tobe - curr);
 1525|   324k|    ioWrapper.write(buf.c_data(), buf.size());
 1526|   324k|    return tobe - curr;
 1527|   324k|  }
 1528|  1.75M|  return 0;
 1529|  2.07M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  13.9M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  13.9M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  39.5M|  [[nodiscard]] uint16_t tag() const {
   82|  39.5M|    return static_cast<uint16_t>(extendedTag_);
   83|  39.5M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  13.1M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  13.1M|    return extendedTag_;
   87|  13.1M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  15.9M|  [[nodiscard]] IfdId group() const {
   90|  15.9M|    return group_;
   91|  15.9M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  12.1M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  12.1M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  8.84M|  void setStart(const byte* pStart) {
  217|  8.84M|    pStart_ = const_cast<byte*>(pStart);
  218|  8.84M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   329M|  [[nodiscard]] uint16_t tag() const {
  241|   329M|    return tag_;
  242|   329M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  44.5M|  [[nodiscard]] IfdId group() const {
  245|  44.5M|    return group_;
  246|  44.5M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  9.08M|  [[nodiscard]] byte* start() const {
  249|  9.08M|    return pStart_;
  250|  9.08M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  3.67M|  void setOffset(size_t offset) {
  417|  3.67M|    offset_ = offset;
  418|  3.67M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.39M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.39M|    return tiffType_;
  460|  1.39M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|   149k|  [[nodiscard]] size_t offset() const {
  466|   149k|    return offset_;
  467|   149k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  4.70M|  [[nodiscard]] const byte* pData() const {
  477|  4.70M|    return pData_;
  478|  4.70M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  57.4M|  [[nodiscard]] const Value* pValue() const {
  481|  57.4M|    return pValue_.get();
  482|  57.4M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  2.09M|  void setCount(size_t count) {
  498|  2.09M|    count_ = count;
  499|  2.09M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  3.52M|  void setIdx(int idx) {
  502|  3.52M|    idx_ = idx;
  503|  3.52M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  2.23M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  2.23M|    return storage_;
  542|  2.23M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|   108k|  [[nodiscard]] uint16_t szTag() const {
  624|   108k|    return szTag_;
  625|   108k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|   108k|  [[nodiscard]] IfdId szGroup() const {
  628|   108k|    return szGroup_;
  629|   108k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|   122k|  [[nodiscard]] uint16_t dtTag() const {
  790|   122k|    return dtTag_;
  791|   122k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|   122k|  [[nodiscard]] IfdId dtGroup() const {
  794|   122k|    return dtGroup_;
  795|   122k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  62.2k|  [[nodiscard]] bool hasNext() const {
  843|  62.2k|    return hasNext_;
  844|  62.2k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  22.9k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  22.9k|    imageByteOrder_ = byteOrder;
 1108|  22.9k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  8.58M|  bool operator==(size_t idx) const {
 1218|  8.58M|    return idx_ == idx;
 1219|  8.58M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  4.85M|  [[nodiscard]] size_t tagStep() const {
 1235|  4.85M|    return elDefaultDef_.size(0, group_);
 1236|  4.85M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  4.31M|  void setDecoded(bool decoded) {
 1311|  4.31M|    decoded_ = decoded;
 1312|  4.31M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  14.4M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  14.4M|    return arrayCfg_;
 1320|  14.4M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   323k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   323k|    return arrayDef_;
 1324|   323k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|   163k|  [[nodiscard]] size_t defSize() const {
 1327|   163k|    return defSize_;
 1328|   163k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   341k|  [[nodiscard]] bool decoded() const {
 1331|   341k|    return decoded_;
 1332|   341k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  2.23M|  void setElDef(const ArrayDef& def) {
 1405|  2.23M|    elDef_ = def;
 1406|  2.23M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  2.23M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  2.23M|    elByteOrder_ = byteOrder;
 1412|  2.23M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  2.29M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  2.29M|    return &elDef_;
 1422|  2.29M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  2.30M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  2.30M|    return elByteOrder_;
 1428|  2.30M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  41.1k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  41.1k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  41.1k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     27|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     27|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     27|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    242|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    242|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    242|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    169|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    169|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    169|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    404|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    404|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    404|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     79|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     79|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     79|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  17.5k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  17.5k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  17.5k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  19.0k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  19.0k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  19.0k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.27k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.27k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.27k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.36k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.36k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.36k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    797|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    797|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    797|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.39k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.39k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.39k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  8.86k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  8.86k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  8.86k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  13.1k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  13.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  13.1k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.63k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.63k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.63k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  6.97k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  6.97k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  6.97k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.34k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.34k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.34k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.27k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.27k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.27k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    536|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    536|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    536|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  23.3k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  23.3k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  23.3k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  24.4k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  24.4k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  24.4k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.29k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.29k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.29k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.80k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.80k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.80k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    585|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    585|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    585|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.13k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.13k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.13k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  18.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  18.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  18.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  21.4k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  21.4k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  21.4k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.25k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.25k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.25k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.74k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.74k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.74k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    562|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    562|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    562|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    668|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    668|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    668|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  18.7k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  18.7k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  18.7k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__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_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    445|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    445|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    445|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    357|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    357|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    357|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    496|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    496|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    496|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    896|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    896|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    896|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  7.37k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  7.37k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  7.37k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.15k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.15k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.15k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    851|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    851|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    851|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    270|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    270|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    270|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    433|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    433|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    433|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    542|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    542|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    542|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.90k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.90k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.90k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.40k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.40k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.40k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    677|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    677|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    677|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    307|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    307|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    307|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    259|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    259|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    259|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    280|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    280|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    280|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.97k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.97k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.97k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.82k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.82k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.82k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    850|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    850|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    850|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    339|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    339|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    339|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    270|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    270|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    270|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    450|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    450|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    450|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  5.69k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  5.69k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  5.69k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.97k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.97k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.97k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    408|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    408|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    408|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__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_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    222|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    222|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    222|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    387|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    387|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    387|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    417|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    417|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    417|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    856|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    856|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    856|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    372|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    372|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    372|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    227|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    227|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    227|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    204|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    204|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    204|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    207|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    207|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    207|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    370|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    370|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    370|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.11k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.11k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.11k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    325|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    325|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    325|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    616|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    616|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    616|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    448|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    448|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    448|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    201|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    201|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    201|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    396|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    396|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    396|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    901|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    901|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    901|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  15.7k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  15.7k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  15.7k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  14.5k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  14.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  14.5k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    756|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    756|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    756|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__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_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    200|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    200|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    200|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     74|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     74|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     74|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    220|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    220|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    220|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    254|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    254|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    254|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    213|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    213|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    213|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    254|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    254|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    254|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    208|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    208|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    208|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    269|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    269|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    269|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    285|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    285|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    285|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    206|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    206|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    206|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    237|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    237|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    237|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     70|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     70|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     70|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_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|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    260|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    260|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    260|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  2.88k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  2.88k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  2.88k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.62k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.62k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.62k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    291|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    291|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    291|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.56k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.56k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.56k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    396|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    396|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    396|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    123|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    123|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    123|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    303|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    303|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    303|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    622|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    622|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    622|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    331|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    331|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    331|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    161|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    161|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    161|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    770|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    770|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    770|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    147|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    147|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    147|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    750|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    750|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    750|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    496|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    496|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    496|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    460|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    460|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    460|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  9.00k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  9.00k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  9.00k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.91k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.91k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.91k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.81k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.81k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.81k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    673|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    673|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    673|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    305|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    305|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    305|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.79k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.79k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.79k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.79k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    713|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    713|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    713|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    465|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    465|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    465|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    365|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    365|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    365|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    284|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    284|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    284|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    273|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    273|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    273|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     83|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     83|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     83|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     83|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    281|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    281|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    281|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     94|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     94|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     94|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     82|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     82|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     82|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     71|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     71|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     71|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     99|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     99|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     99|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     99|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     66|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     66|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     66|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  2.54k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  2.54k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  2.54k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    203|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    203|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    203|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    149|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    149|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    149|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     75|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     75|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     75|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    177|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    177|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    177|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    430|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    430|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    430|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    187|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    187|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    187|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    187|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    330|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    330|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    330|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    330|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.69k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.69k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.69k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.69k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    498|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    498|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    498|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    498|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    540|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    540|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    540|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    540|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  1.04k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  1.04k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  1.04k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  1.04k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  1.13k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  1.13k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  1.13k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  1.13k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    378|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    378|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    378|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    378|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    700|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    700|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    700|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    700|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    571|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    571|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    571|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    571|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    256|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    256|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    256|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    256|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    143|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    143|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    143|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    143|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    371|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    371|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    371|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    226|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    226|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    226|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    897|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    897|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    897|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    474|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    474|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    474|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    319|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    319|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    319|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    561|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    561|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    561|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  6.60k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  6.60k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  6.60k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  6.60k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    901|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    901|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    901|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.49k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.49k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.49k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    523|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    523|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    523|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    307|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    307|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    307|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    307|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  1.23k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  1.23k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  1.23k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  1.23k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    289|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    289|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    289|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    289|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    743|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    743|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    743|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    743|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    154|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    154|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    154|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    154|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  2.06k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  2.06k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  2.06k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  2.06k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    200|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    200|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    200|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    200|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    166|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    166|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    166|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    395|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    395|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    395|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    395|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    148|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    148|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    148|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     55|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     55|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     55|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    100|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    100|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    100|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    100|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     99|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     99|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     99|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     43|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     43|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     43|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     63|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     63|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     63|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     63|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    268|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    268|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    268|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    268|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    156|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    156|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    156|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     54|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     54|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     54|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    105|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    105|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    105|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    105|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  20.2k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  20.2k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  20.2k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  12.1M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   269k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  70.5k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  32.7k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   31|  14.7M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   32|  14.7M|  return ifdId_ == md.ifdId();
   33|  14.7M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1993|  2.25M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1994|  2.25M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1995|  2.25M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1995:12): [True: 9.19k, False: 2.24M]
  ------------------
 1996|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1997|  9.19k|    decoderFct = td->decoderFct_;
 1998|  9.19k|  }
 1999|  2.25M|  return decoderFct;
 2000|  2.25M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2002|  3.20M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2003|  3.20M|  EncoderFct encoderFct = nullptr;
 2004|  3.20M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2004:12): [True: 7.66k, False: 3.19M]
  ------------------
 2005|       |    // Returns 0 if no special encoder function is found
 2006|  7.66k|    encoderFct = td->encoderFct_;
 2007|  7.66k|  }
 2008|  3.20M|  return encoderFct;
 2009|  3.20M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2011|  12.3M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2012|  12.3M|  auto tag = static_cast<uint16_t>(extendedTag);
 2013|  12.3M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2014|       |  // If the lookup failed then try again with Tag::all.
 2015|  12.3M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2015:7): [True: 11.8M, False: 537k]
  ------------------
 2016|  11.8M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2017|  11.8M|  }
 2018|  12.3M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2018:7): [True: 11.9M, False: 428k]
  |  Branch (2018:7): [True: 11.9M, False: 471k]
  |  Branch (2018:37): [True: 11.9M, False: 42.8k]
  ------------------
 2019|  11.9M|    return i->second(tag, group);
 2020|  11.9M|  }
 2021|       |#ifdef EXIV2_DEBUG_MESSAGES
 2022|       |  if (i == tiffGroupTable_.end())
 2023|       |    std::cerr << "Warning: No TIFF structure entry found for ";
 2024|       |  else
 2025|       |    std::cerr << "Warning: No TIFF component creator found for ";
 2026|       |  std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0') << std::hex << std::right << extendedTag
 2027|       |            << ", group " << groupName(group) << "\n";
 2028|       |#endif
 2029|   471k|  return nullptr;
 2030|  12.3M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2032|  3.24M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2033|  3.24M|  TiffPath ret;
 2034|  13.9M|  while (true) {
  ------------------
  |  Branch (2034:10): [True: 13.9M, Folded]
  ------------------
 2035|  13.9M|    ret.emplace(extendedTag, group);
 2036|  13.9M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2037|  13.9M|    assert(ts != tiffTreeTable_.end());
 2038|  13.9M|    extendedTag = ts->second.second;
 2039|  13.9M|    group = ts->second.first;
 2040|  13.9M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2040:9): [True: 3.24M, False: 10.7M]
  ------------------
 2041|  3.24M|      break;
 2042|  3.24M|    }
 2043|  13.9M|  }
 2044|  3.24M|  return ret;
 2045|  3.24M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2049|  35.9k|                                   TiffHeaderBase* pHeader) {
 2050|       |  // Create standard TIFF header if necessary
 2051|  35.9k|  std::unique_ptr<TiffHeaderBase> ph;
 2052|  35.9k|  if (!pHeader) {
  ------------------
  |  Branch (2052:7): [True: 14.8k, False: 21.0k]
  ------------------
 2053|  14.8k|    ph = std::make_unique<TiffHeader>();
 2054|  14.8k|    pHeader = ph.get();
 2055|  14.8k|  }
 2056|       |
 2057|  35.9k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2057:12): [True: 34.6k, False: 1.27k]
  ------------------
 2058|  34.6k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2059|  34.6k|    rootDir->accept(decoder);
 2060|  34.6k|  }
 2061|  35.9k|  return pHeader->byteOrder();
 2062|       |
 2063|  35.9k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2068|  20.1k|                                     OffsetWriter* pOffsetWriter) {
 2069|       |  /*
 2070|       |     1) parse the binary image, if one is provided, and
 2071|       |     2) build and validate the replacement layout before any source bytes change
 2072|       |     3) attempt updating the parsed tree in-place ("non-intrusive writing")
 2073|       |     4) else, write the replacement tree ("intrusive writing")
 2074|       |   */
 2075|  20.1k|  WriteMethod writeMethod = wmIntrusive;
 2076|  20.1k|  auto parsedTree = parse(pData, size, root, pHeader);
 2077|  20.1k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2078|  20.1k|  auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2079|  20.1k|  if (parsedTree) {
  ------------------
  |  Branch (2079:7): [True: 7.27k, False: 12.8k]
  ------------------
 2080|  7.27k|    TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2081|  7.27k|    parsedTree->accept(copier);
 2082|  7.27k|  }
 2083|       |  // The replacement encoder keeps the source tree alive for both write strategies.
 2084|  20.1k|  auto sourceTree = parsedTree.get();
 2085|  20.1k|  TiffEncoder replacement(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, primaryGroups, pHeader,
 2086|  20.1k|                          findEncoderFct);
 2087|  20.1k|  replacement.add(createdTree.get(), std::move(parsedTree), root);
 2088|  20.1k|  const size_t limit = std::numeric_limits<uint32_t>::max();
 2089|  20.1k|  const size_t metadataSize = createdTree->size();
 2090|  20.1k|  enforce(pHeader->size() <= limit && metadataSize <= limit - pHeader->size() &&
  ------------------
  |  Branch (2090:11): [True: 20.0k, False: 25]
  |  Branch (2090:39): [True: 20.0k, False: 0]
  ------------------
 2091|  20.0k|              createdTree->sizeImage() <= limit - pHeader->size() - metadataSize,
  ------------------
  |  Branch (2091:15): [True: 20.0k, False: 0]
  ------------------
 2092|  20.1k|          ErrorCode::kerOffsetOutOfRange);
 2093|       |
 2094|  20.1k|  if (sourceTree) {
  ------------------
  |  Branch (2094:7): [True: 7.24k, False: 12.8k]
  ------------------
 2095|       |    // Attempt to update existing TIFF components based on metadata entries
 2096|  7.24k|    TiffEncoder encoder(exifData, iptcData, xmpData, sourceTree, false, primaryGroups, pHeader, findEncoderFct);
 2097|  7.24k|    sourceTree->accept(encoder);
 2098|  7.24k|    if (!encoder.dirty())
  ------------------
  |  Branch (2098:9): [True: 761, False: 6.48k]
  ------------------
 2099|    761|      writeMethod = wmNonIntrusive;
 2100|  7.24k|  }
 2101|  20.1k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2101:7): [True: 19.3k, False: 786]
  ------------------
 2102|       |    // Write binary representation from the composite tree
 2103|  19.3k|    DataBuf header = pHeader->write();
 2104|  19.3k|    auto tempIo = MemIo();
 2105|  19.3k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2106|  19.3k|    auto imageIdx(std::string::npos);
 2107|  19.3k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2108|  19.3k|    if (pOffsetWriter)
  ------------------
  |  Branch (2108:9): [True: 114, False: 19.2k]
  ------------------
 2109|    114|      pOffsetWriter->writeOffsets(tempIo);
 2110|  19.3k|    io.transfer(tempIo);  // may throw
 2111|  19.3k|#ifndef SUPPRESS_WARNINGS
 2112|  19.3k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  19.3k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 19.3k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  19.3k|  LogMsg(LogMsg::info).os()
  ------------------
 2113|  19.3k|#endif
 2114|  19.3k|  }
 2115|    786|#ifndef SUPPRESS_WARNINGS
 2116|    786|  else {
 2117|    786|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    786|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 786]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    786|  LogMsg(LogMsg::info).os()
  ------------------
 2118|    786|  }
 2119|  20.1k|#endif
 2120|  20.1k|  return writeMethod;
 2121|  20.1k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2124|  56.0k|                                                 TiffHeaderBase* pHeader) {
 2125|  56.0k|  TiffComponent::UniquePtr rootDir;
 2126|  56.0k|  if (!pData || size == 0)
  ------------------
  |  Branch (2126:7): [True: 13.2k, False: 42.7k]
  |  Branch (2126:17): [True: 0, False: 42.7k]
  ------------------
 2127|  13.2k|    return rootDir;
 2128|  42.7k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2128:7): [True: 360, False: 42.4k]
  |  Branch (2128:38): [True: 447, False: 41.9k]
  ------------------
 2129|    807|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2130|    807|  }
 2131|  41.9k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2132|  41.9k|  if (rootDir) {
  ------------------
  |  Branch (2132:7): [True: 41.9k, False: 0]
  ------------------
 2133|  41.9k|    rootDir->setStart(pData + pHeader->offset());
 2134|  41.9k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2135|  41.9k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2136|  41.9k|    rootDir->accept(reader);
 2137|  41.9k|    reader.postProcess();
 2138|  41.9k|  }
 2139|  41.9k|  return rootDir;
 2140|       |
 2141|  42.7k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2143|  20.1k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2144|  20.1k|  PrimaryGroups ret;
 2145|  20.1k|  if (!pSourceDir)
  ------------------
  |  Branch (2145:7): [True: 12.8k, False: 7.27k]
  ------------------
 2146|  12.8k|    return ret;
 2147|       |
 2148|  7.27k|  static constexpr auto imageGroups = std::array{
 2149|  7.27k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2150|  7.27k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2151|  7.27k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2152|  7.27k|  };
 2153|       |
 2154|  94.5k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2154:24): [True: 94.5k, False: 7.27k]
  ------------------
 2155|  94.5k|    TiffFinder finder(0x00fe, imageGroup);
 2156|  94.5k|    pSourceDir->accept(finder);
 2157|  94.5k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2158|  94.5k|    if (!te)
  ------------------
  |  Branch (2158:9): [True: 93.1k, False: 1.41k]
  ------------------
 2159|  93.1k|      continue;
 2160|  1.41k|    const Value* pV = te->pValue();
 2161|  1.41k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2161:9): [True: 1.11k, False: 297]
  |  Branch (2161:15): [True: 988, False: 128]
  |  Branch (2161:47): [True: 960, False: 28]
  |  Branch (2161:67): [True: 824, False: 136]
  ------------------
 2162|    824|      ret.push_back(te->group());
 2163|    824|    }
 2164|  1.41k|  }
 2165|  7.27k|  return ret;
 2166|  20.1k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2169|   712k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2170|   712k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2172|   582k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2173|   582k|  if (!pData || size < 8)
  ------------------
  |  Branch (2173:7): [True: 0, False: 582k]
  |  Branch (2173:17): [True: 119, False: 582k]
  ------------------
 2174|    119|    return false;
 2175|       |
 2176|   582k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2176:7): [True: 13.1k, False: 569k]
  |  Branch (2176:26): [True: 12.2k, False: 909]
  ------------------
 2177|  12.2k|    byteOrder_ = littleEndian;
 2178|   569k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2178:14): [True: 243k, False: 326k]
  |  Branch (2178:33): [True: 242k, False: 1.43k]
  ------------------
 2179|   242k|    byteOrder_ = bigEndian;
 2180|   327k|  } else {
 2181|   327k|    return false;
 2182|   327k|  }
 2183|   254k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2184|   254k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2184:7): [True: 254k, False: 41]
  |  Branch (2184:19): [True: 254k, False: 69]
  |  Branch (2184:33): [True: 105k, False: 149k]
  ------------------
 2185|   105k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2186|   149k|  tag_ = t;
 2187|   149k|  offset_ = getULong(pData + 4, byteOrder_);
 2188|       |
 2189|   149k|  return true;
 2190|   254k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2192|  20.1k|DataBuf TiffHeaderBase::write() const {
 2193|  20.1k|  DataBuf buf(8);
 2194|  20.1k|  switch (byteOrder_) {
  ------------------
  |  Branch (2194:11): [True: 20.1k, False: 0]
  ------------------
 2195|  13.7k|    case littleEndian:
  ------------------
  |  Branch (2195:5): [True: 13.7k, False: 6.38k]
  ------------------
 2196|  13.7k|      buf.write_uint8(0, 'I');
 2197|  13.7k|      break;
 2198|  6.38k|    case bigEndian:
  ------------------
  |  Branch (2198:5): [True: 6.38k, False: 13.7k]
  ------------------
 2199|  6.38k|      buf.write_uint8(0, 'M');
 2200|  6.38k|      break;
 2201|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2201:5): [True: 0, False: 20.1k]
  ------------------
 2202|      0|      break;
 2203|  20.1k|  }
 2204|  20.1k|  buf.write_uint8(1, buf.read_uint8(0));
 2205|  20.1k|  buf.write_uint16(2, tag_, byteOrder_);
 2206|  20.1k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2207|  20.1k|  return buf;
 2208|  20.1k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2226|   177k|ByteOrder TiffHeaderBase::byteOrder() const {
 2227|   177k|  return byteOrder_;
 2228|   177k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2230|  35.8k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2231|  35.8k|  byteOrder_ = byteOrder;
 2232|  35.8k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2234|  85.5k|uint32_t TiffHeaderBase::offset() const {
 2235|  85.5k|  return offset_;
 2236|  85.5k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2238|  13.5k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2239|  13.5k|  offset_ = offset;
 2240|  13.5k|}
_ZNK5Exiv28Internal14TiffHeaderBase4sizeEv:
 2242|  60.2k|uint32_t TiffHeaderBase::size() const {
 2243|  60.2k|  return size_;
 2244|  60.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2246|  37.3k|uint16_t TiffHeaderBase::tag() const {
 2247|  37.3k|  return tag_;
 2248|  37.3k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2250|  1.27k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2251|  1.27k|  return false;
 2252|  1.27k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2332|  4.16M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2333|  4.16M|  const bool result = isTiffImageTagLookup(tag, group);
 2334|       |#ifdef EXIV2_DEBUG_MESSAGES
 2335|       |  if (result) {
 2336|       |    ExifKey key(tag, groupName(group));
 2337|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2338|       |  } else {
 2339|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2340|       |  }
 2341|       |#endif
 2342|  4.16M|  return result;
 2343|  4.16M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2346|   470k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2347|   470k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2349|  4.22M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2350|  4.22M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2350:7): [True: 64.1k, False: 4.16M]
  ------------------
 2351|       |#ifdef EXIV2_DEBUG_MESSAGES
 2352|       |    std::cerr << "No image tags in this image\n";
 2353|       |#endif
 2354|  64.1k|    return false;
 2355|  64.1k|  }
 2356|       |#ifdef EXIV2_DEBUG_MESSAGES
 2357|       |  ExifKey key(tag, groupName(group));
 2358|       |#endif
 2359|       |  // If there are primary groups and none matches group, we're done
 2360|  4.16M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2360:7): [True: 58.9k, False: 4.10M]
  |  Branch (2360:7): [True: 22.5k, False: 4.13M]
  ------------------
 2361|  58.9k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2361:7): [True: 22.5k, False: 36.4k]
  ------------------
 2362|       |#ifdef EXIV2_DEBUG_MESSAGES
 2363|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2364|       |#endif
 2365|  22.5k|    return false;
 2366|  22.5k|  }
 2367|       |  // All tags of marked primary groups other than IFD0 are considered
 2368|       |  // image tags. That should take care of NEFs until we know better.
 2369|  4.13M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2369:7): [True: 36.4k, False: 4.10M]
  |  Branch (2369:34): [True: 35.3k, False: 1.06k]
  ------------------
 2370|       |#ifdef EXIV2_DEBUG_MESSAGES
 2371|       |    ExifKey key(tag, groupName(group));
 2372|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2373|       |#endif
 2374|  35.3k|    return true;
 2375|  35.3k|  }
 2376|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2377|  4.10M|  return isTiffImageTag(tag, group);
 2378|  4.13M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2380|    152|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2381|    152|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2382|    152|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2384|     27|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2385|     27|  auto it = offsetList_.find(id);
 2386|     27|  if (it != offsetList_.end())
  ------------------
  |  Branch (2386:7): [True: 27, False: 0]
  ------------------
 2387|     27|    it->second.target_ = target;
 2388|     27|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2390|    114|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2391|    114|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2391:29): [True: 114, False: 114]
  ------------------
 2392|    114|    io.seek(off.origin_, BasicIo::beg);
 2393|    114|    byte buf[4] = {0, 0, 0, 0};
 2394|    114|    l2Data(buf, off.target_, off.byteOrder_);
 2395|    114|    io.write(buf, 4);
 2396|    114|  }
 2397|    114|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2254|  4.16M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2255|  4.16M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2255:7): [True: 3.76M, False: 400k]
  ------------------
 2256|  3.76M|    return false;
 2257|  3.76M|  }
 2258|       |  //! List of TIFF image tags
 2259|   400k|  switch (tag) {
 2260|    718|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2260:5): [True: 718, False: 400k]
  ------------------
 2261|  1.68k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2261:5): [True: 971, False: 400k]
  ------------------
 2262|  11.3k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2262:5): [True: 9.66k, False: 391k]
  ------------------
 2263|  16.6k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2263:5): [True: 5.28k, False: 395k]
  ------------------
 2264|  17.3k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2264:5): [True: 719, False: 400k]
  ------------------
 2265|  17.7k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2265:5): [True: 351, False: 400k]
  ------------------
 2266|  17.9k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2266:5): [True: 225, False: 400k]
  ------------------
 2267|  18.0k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2267:5): [True: 128, False: 400k]
  ------------------
 2268|  21.9k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2268:5): [True: 3.86k, False: 397k]
  ------------------
 2269|  22.1k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2269:5): [True: 200, False: 400k]
  ------------------
 2270|  22.4k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2270:5): [True: 364, False: 400k]
  ------------------
 2271|  26.3k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2271:5): [True: 3.81k, False: 397k]
  ------------------
 2272|  26.6k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2272:5): [True: 354, False: 400k]
  ------------------
 2273|  27.1k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2273:5): [True: 445, False: 400k]
  ------------------
 2274|  27.3k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2274:5): [True: 236, False: 400k]
  ------------------
 2275|  27.4k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2275:5): [True: 71, False: 400k]
  ------------------
 2276|  27.4k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2276:5): [True: 74, False: 400k]
  ------------------
 2277|  27.5k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2277:5): [True: 75, False: 400k]
  ------------------
 2278|  27.7k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2278:5): [True: 146, False: 400k]
  ------------------
 2279|  27.8k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2279:5): [True: 184, False: 400k]
  ------------------
 2280|  27.9k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2280:5): [True: 83, False: 400k]
  ------------------
 2281|  28.4k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2281:5): [True: 457, False: 400k]
  ------------------
 2282|  28.5k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2282:5): [True: 109, False: 400k]
  ------------------
 2283|  28.6k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2283:5): [True: 67, False: 400k]
  ------------------
 2284|  28.7k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2284:5): [True: 94, False: 400k]
  ------------------
 2285|  28.8k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2285:5): [True: 148, False: 400k]
  ------------------
 2286|  29.0k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2286:5): [True: 229, False: 400k]
  ------------------
 2287|  29.1k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2287:5): [True: 68, False: 400k]
  ------------------
 2288|  29.1k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2288:5): [True: 44, False: 400k]
  ------------------
 2289|  29.8k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2289:5): [True: 626, False: 400k]
  ------------------
 2290|  30.7k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2290:5): [True: 900, False: 400k]
  ------------------
 2291|  30.8k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2291:5): [True: 84, False: 400k]
  ------------------
 2292|  31.1k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2292:5): [True: 321, False: 400k]
  ------------------
 2293|  31.1k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2293:5): [True: 75, False: 400k]
  ------------------
 2294|  31.3k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2294:5): [True: 140, False: 400k]
  ------------------
 2295|  31.4k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2295:5): [True: 153, False: 400k]
  ------------------
 2296|  31.5k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2296:5): [True: 71, False: 400k]
  ------------------
 2297|  31.7k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2297:5): [True: 155, False: 400k]
  ------------------
 2298|  31.8k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2298:5): [True: 115, False: 400k]
  ------------------
 2299|  32.1k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2299:5): [True: 283, False: 400k]
  ------------------
 2300|  32.1k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2300:5): [True: 86, False: 400k]
  ------------------
 2301|  32.2k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2301:5): [True: 91, False: 400k]
  ------------------
 2302|  32.4k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2302:5): [True: 124, False: 400k]
  ------------------
 2303|  32.4k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2303:5): [True: 83, False: 400k]
  ------------------
 2304|  32.5k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2304:5): [True: 70, False: 400k]
  ------------------
 2305|  32.7k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2305:5): [True: 144, False: 400k]
  ------------------
 2306|  33.7k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2306:5): [True: 1.05k, False: 399k]
  ------------------
 2307|  40.6k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2307:5): [True: 6.89k, False: 394k]
  ------------------
 2308|  46.6k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2308:5): [True: 6.01k, False: 394k]
  ------------------
 2309|  47.3k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2309:5): [True: 642, False: 400k]
  ------------------
 2310|  47.3k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2310:5): [True: 74, False: 400k]
  ------------------
 2311|  47.5k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2311:5): [True: 120, False: 400k]
  ------------------
 2312|  47.6k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2312:5): [True: 85, False: 400k]
  ------------------
 2313|  47.7k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2313:5): [True: 124, False: 400k]
  ------------------
 2314|  47.7k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2314:5): [True: 62, False: 400k]
  ------------------
 2315|  47.8k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2315:5): [True: 83, False: 400k]
  ------------------
 2316|  47.9k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2316:5): [True: 76, False: 400k]
  ------------------
 2317|  48.0k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2317:5): [True: 71, False: 400k]
  ------------------
 2318|  48.3k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2318:5): [True: 330, False: 400k]
  ------------------
 2319|  48.4k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2319:5): [True: 72, False: 400k]
  ------------------
 2320|  48.4k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2320:5): [True: 21, False: 400k]
  ------------------
 2321|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2322|  48.5k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2322:5): [True: 83, False: 400k]
  ------------------
 2323|  48.6k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2323:5): [True: 112, False: 400k]
  ------------------
 2324|  48.7k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2324:5): [True: 78, False: 400k]
  ------------------
 2325|  48.7k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2325:5): [True: 71, False: 400k]
  ------------------
 2326|  48.7k|      return true;
 2327|   352k|    default:
  ------------------
  |  Branch (2327:5): [True: 352k, False: 48.7k]
  ------------------
 2328|   352k|      return false;
 2329|   400k|  }
 2330|   400k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   96|  21.1M|size_t TypeInfo::typeSize(TypeId typeId) {
   97|  21.1M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (97:12): [True: 15.4M, False: 5.74M]
  ------------------
   98|  15.4M|    return tit->size_;
   99|  5.74M|  return 0;
  100|  21.1M|}
_ZN5Exiv27DataBufC2Em:
  102|  6.25M|DataBuf::DataBuf(size_t size) : pData_(size) {
  103|  6.25M|}
_ZN5Exiv27DataBufC2EPKhm:
  105|   100k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
  106|   100k|}
_ZN5Exiv27DataBuf5allocEm:
  108|  46.3k|void DataBuf::alloc(size_t size) {
  109|  46.3k|  pData_.resize(size);
  110|  46.3k|}
_ZN5Exiv27DataBuf6resizeEm:
  112|   365k|void DataBuf::resize(size_t size) {
  113|   365k|  pData_.resize(size);
  114|   365k|}
_ZN5Exiv27DataBuf5resetEv:
  116|  68.6k|void DataBuf::reset() {
  117|  68.6k|  pData_.clear();
  118|  68.6k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  120|  2.88M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  121|  2.88M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (121:7): [True: 0, False: 2.88M]
  ------------------
  122|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  123|      0|  }
  124|  2.88M|  return pData_[offset];
  125|  2.88M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  127|   842k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  128|   842k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 842k]
  ------------------
  129|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  130|      0|  }
  131|   842k|  pData_[offset] = x;
  132|   842k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  134|   557k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  135|   557k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 557k]
  |  Branch (135:28): [True: 2, False: 557k]
  ------------------
  136|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  137|      2|  }
  138|   557k|  return getUShort(&pData_[offset], byteOrder);
  139|   557k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  141|  20.5k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  142|  20.5k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 20.5k]
  |  Branch (142:28): [True: 0, False: 20.5k]
  ------------------
  143|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  144|      0|  }
  145|  20.5k|  us2Data(&pData_[offset], x, byteOrder);
  146|  20.5k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  148|   459k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  149|   459k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (149:7): [True: 1, False: 459k]
  |  Branch (149:28): [True: 1, False: 459k]
  ------------------
  150|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  151|      2|  }
  152|   459k|  return getULong(&pData_[offset], byteOrder);
  153|   459k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  155|  20.4k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  156|  20.4k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (156:7): [True: 0, False: 20.4k]
  |  Branch (156:28): [True: 0, False: 20.4k]
  ------------------
  157|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  158|      0|  }
  159|  20.4k|  ul2Data(&pData_[offset], x, byteOrder);
  160|  20.4k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  162|  13.8k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  163|  13.8k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (163:7): [True: 0, False: 13.8k]
  |  Branch (163:28): [True: 0, False: 13.8k]
  ------------------
  164|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  165|      0|  }
  166|  13.8k|  return getULongLong(&pData_[offset], byteOrder);
  167|  13.8k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  176|   723k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  177|   723k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (177:7): [True: 0, False: 723k]
  |  Branch (177:34): [True: 0, False: 723k]
  ------------------
  178|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  179|      0|  }
  180|   723k|  return memcmp(&pData_[offset], buf, bufsize);
  181|   723k|}
_ZN5Exiv27DataBuf4dataEm:
  183|  7.59M|byte* Exiv2::DataBuf::data(size_t offset) {
  184|  7.59M|  return const_cast<byte*>(c_data(offset));
  185|  7.59M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  187|  10.2M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  188|  10.2M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (188:7): [True: 761k, False: 9.52M]
  |  Branch (188:25): [True: 32.2k, False: 9.49M]
  ------------------
  189|   793k|    return nullptr;
  190|   793k|  }
  191|  9.49M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (191:7): [True: 0, False: 9.49M]
  ------------------
  192|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  193|      0|  }
  194|  9.49M|  return &pData_[offset];
  195|  9.49M|}
_ZNK5Exiv27DataBuf5c_strEm:
  197|  60.1k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  198|  60.1k|  return reinterpret_cast<const char*>(c_data(offset));
  199|  60.1k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  220|  6.52k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  221|  6.52k|  return os << r.first << "/" << r.second;
  222|  6.52k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  249|  2.48k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  250|  2.48k|  return os << r.first << "/" << r.second;
  251|  2.48k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  257|  56.3M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  258|  56.3M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  259|  56.3M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  261|  58.9M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  262|  58.9M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (262:7): [True: 707k, False: 58.2M]
  ------------------
  263|   707k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  264|   707k|  }
  265|  58.2M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  266|  58.9M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  268|  57.6k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  269|  57.6k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (269:7): [True: 13.2k, False: 44.4k]
  ------------------
  270|  13.2k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  271|  13.2k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  272|  13.2k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  273|  13.2k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  274|  13.2k|  }
  275|  44.4k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  276|  44.4k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  277|  44.4k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  278|  44.4k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  279|  57.6k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  281|  1.03M|URational getURational(const byte* buf, ByteOrder byteOrder) {
  282|  1.03M|  uint32_t nominator = getULong(buf, byteOrder);
  283|  1.03M|  uint32_t denominator = getULong(buf + 4, byteOrder);
  284|  1.03M|  return {nominator, denominator};
  285|  1.03M|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  287|  1.57M|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  288|  1.57M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (288:7): [True: 6.35k, False: 1.57M]
  ------------------
  289|  6.35k|    return buf[1] << 8 | buf[0];
  290|  6.35k|  }
  291|  1.57M|  return buf[0] << 8 | buf[1];
  292|  1.57M|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  294|  13.6M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  295|  13.6M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (295:7): [True: 6.29k, False: 13.6M]
  ------------------
  296|  6.29k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  297|  6.29k|  }
  298|  13.6M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  299|  13.6M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  301|  6.52M|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  302|  6.52M|  int32_t nominator = getLong(buf, byteOrder);
  303|  6.52M|  int32_t denominator = getLong(buf + 4, byteOrder);
  304|  6.52M|  return {nominator, denominator};
  305|  6.52M|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  307|   474k|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|   474k|#ifdef __cpp_lib_bit_cast
  312|   474k|  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|   474k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  323|  1.09M|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|  1.09M|#ifdef __cpp_lib_bit_cast
  328|  1.09M|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (328:7): [True: 123k, False: 973k]
  ------------------
  329|   123k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  330|   123k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  331|   123k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  332|   123k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  333|   973k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  334|   973k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  335|   973k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  336|   973k|                               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|  1.09M|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  358|  3.54M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  359|  3.54M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (359:7): [True: 2.08M, False: 1.45M]
  ------------------
  360|  2.08M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  361|  2.08M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  362|  2.08M|  } else {
  363|  1.45M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  364|  1.45M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  365|  1.45M|  }
  366|  3.54M|  return 2;
  367|  3.54M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  369|  8.18M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  370|  8.18M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (370:7): [True: 1.64M, False: 6.53M]
  ------------------
  371|  1.64M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  372|  1.64M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  373|  1.64M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  374|  1.64M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  375|  6.53M|  } else {
  376|  6.53M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  377|  6.53M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  378|  6.53M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  379|  6.53M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  380|  6.53M|  }
  381|  8.18M|  return 4;
  382|  8.18M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  399|   935k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  400|   935k|  size_t o = ul2Data(buf, l.first, byteOrder);
  401|   935k|  o += ul2Data(buf + o, l.second, byteOrder);
  402|   935k|  return o;
  403|   935k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  405|  1.39M|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  406|  1.39M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (406:7): [True: 18.0k, False: 1.37M]
  ------------------
  407|  18.0k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  408|  18.0k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  409|  1.37M|  } else {
  410|  1.37M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  411|  1.37M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  412|  1.37M|  }
  413|  1.39M|  return 2;
  414|  1.39M|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  416|  12.6M|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  417|  12.6M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (417:7): [True: 105k, False: 12.5M]
  ------------------
  418|   105k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  419|   105k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  420|   105k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  421|   105k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  422|  12.5M|  } else {
  423|  12.5M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  424|  12.5M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  425|  12.5M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  426|  12.5M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  427|  12.5M|  }
  428|  12.6M|  return 4;
  429|  12.6M|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  431|  6.12M|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  432|  6.12M|  size_t o = l2Data(buf, l.first, byteOrder);
  433|  6.12M|  o += l2Data(buf + o, l.second, byteOrder);
  434|  6.12M|  return o;
  435|  6.12M|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  437|   194k|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|   194k|#ifdef __cpp_lib_bit_cast
  442|   194k|  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|   194k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  453|   584k|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|   584k|  union {
  458|   584k|    uint64_t ull_;
  459|   584k|    double d_;
  460|   584k|  } u;
  461|   584k|  u.d_ = d;
  462|   584k|  uint64_t m = 0xff;
  463|   584k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (463:7): [True: 126k, False: 457k]
  ------------------
  464|   126k|    buf[0] = static_cast<byte>(u.ull_ & m);
  465|   126k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  466|   126k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  467|   126k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   126k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  469|   126k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  470|   126k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  471|   126k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  472|   457k|  } else {
  473|   457k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  474|   457k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  475|   457k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  476|   457k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  477|   457k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  478|   457k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  479|   457k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  480|   457k|    buf[7] = static_cast<byte>(u.ull_ & m);
  481|   457k|  }
  482|   584k|  return 8;
  483|   584k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  512|  64.8k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  513|  64.8k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (513:7): [True: 0, False: 64.8k]
  ------------------
  514|      0|    return false;
  515|  64.8k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (515:7): [True: 64.8k, False: 0]
  |  Branch (515:19): [True: 0, False: 64.8k]
  ------------------
  516|      0|    return false;
  517|       |
  518|  64.8k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  519|  64.8k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  521|     11|int exifTime(const char* buf, tm* tm) {
  522|     11|  int rc = 1;
  523|     11|  int year = 0;
  524|     11|  int mon = 0;
  525|     11|  int mday = 0;
  526|     11|  int hour = 0;
  527|     11|  int min = 0;
  528|     11|  int sec = 0;
  529|     11|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (529:7): [True: 7, False: 4]
  ------------------
  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|     11|  return rc;
  539|     11|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  673|    346|Rational floatToRationalCast(float f) {
  674|       |  // Convert f to double because it simplifies the range checks
  675|       |  // below. (All int values can be losslessly converted to double, but
  676|       |  // sometimes get rounded when converted to float.)
  677|    346|  const double d = f;
  678|       |  // Beware: primitive conversion algorithm
  679|    346|  int32_t den;
  680|    346|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (680:7): [True: 219, False: 127]
  ------------------
  681|    219|    den = 1000000;
  682|    219|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (682:14): [True: 27, False: 100]
  ------------------
  683|     27|    den = 10000;
  684|    100|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (684:14): [True: 23, False: 77]
  ------------------
  685|     23|    den = 100;
  686|     77|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (686:14): [True: 21, False: 56]
  ------------------
  687|     21|    den = 1;
  688|     56|  } else {
  689|     56|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (689:13): [True: 56, False: 0]
  ------------------
  690|     56|  }
  691|    290|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  692|    290|  const int32_t g = std::gcd(nom, den);
  693|       |
  694|    290|  return {nom / g, den / g};
  695|    346|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   44|   213M|  bool operator==(Exiv2::TypeId typeId) const {
   45|   213M|    return typeId_ == typeId;
   46|   213M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   20|  6.24M|Value::Value(TypeId typeId) : type_(typeId) {
   21|  6.24M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   23|  3.69M|Value::UniquePtr Value::create(TypeId typeId) {
   24|  3.69M|  switch (typeId) {
   25|      0|    case invalidTypeId:
  ------------------
  |  Branch (25:5): [True: 0, False: 3.69M]
  ------------------
   26|  4.06k|    case signedByte:
  ------------------
  |  Branch (26:5): [True: 4.06k, False: 3.69M]
  ------------------
   27|  1.62M|    case unsignedByte:
  ------------------
  |  Branch (27:5): [True: 1.62M, False: 2.07M]
  ------------------
   28|  1.62M|      return std::make_unique<DataValue>(typeId);
   29|  40.6k|    case asciiString:
  ------------------
  |  Branch (29:5): [True: 40.6k, False: 3.65M]
  ------------------
   30|  40.6k|      return std::make_unique<AsciiValue>();
   31|   283k|    case unsignedShort:
  ------------------
  |  Branch (31:5): [True: 283k, False: 3.41M]
  ------------------
   32|   283k|      return std::make_unique<ValueType<uint16_t>>();
   33|   188k|    case unsignedLong:
  ------------------
  |  Branch (33:5): [True: 188k, False: 3.50M]
  ------------------
   34|   213k|    case tiffIfd:
  ------------------
  |  Branch (34:5): [True: 25.2k, False: 3.67M]
  ------------------
   35|   213k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   36|  10.9k|    case unsignedRational:
  ------------------
  |  Branch (36:5): [True: 10.9k, False: 3.68M]
  ------------------
   37|  10.9k|      return std::make_unique<ValueType<URational>>();
   38|  78.7k|    case undefined:
  ------------------
  |  Branch (38:5): [True: 78.7k, False: 3.61M]
  ------------------
   39|  78.7k|      return std::make_unique<DataValue>();
   40|   314k|    case signedShort:
  ------------------
  |  Branch (40:5): [True: 314k, False: 3.38M]
  ------------------
   41|   314k|      return std::make_unique<ValueType<int16_t>>();
   42|  46.0k|    case signedLong:
  ------------------
  |  Branch (42:5): [True: 46.0k, False: 3.65M]
  ------------------
   43|  46.0k|      return std::make_unique<ValueType<int32_t>>();
   44|  13.3k|    case signedRational:
  ------------------
  |  Branch (44:5): [True: 13.3k, False: 3.68M]
  ------------------
   45|  13.3k|      return std::make_unique<ValueType<Rational>>();
   46|  9.37k|    case tiffFloat:
  ------------------
  |  Branch (46:5): [True: 9.37k, False: 3.68M]
  ------------------
   47|  9.37k|      return std::make_unique<ValueType<float>>();
   48|  15.7k|    case tiffDouble:
  ------------------
  |  Branch (48:5): [True: 15.7k, False: 3.68M]
  ------------------
   49|  15.7k|      return std::make_unique<ValueType<double>>();
   50|  46.2k|    case string:
  ------------------
  |  Branch (50:5): [True: 46.2k, False: 3.65M]
  ------------------
   51|  46.2k|      return std::make_unique<StringValue>();
   52|  6.80k|    case date:
  ------------------
  |  Branch (52:5): [True: 6.80k, False: 3.68M]
  ------------------
   53|  6.80k|      return std::make_unique<DateValue>();
   54|  12.2k|    case time:
  ------------------
  |  Branch (54:5): [True: 12.2k, False: 3.68M]
  ------------------
   55|  12.2k|      return std::make_unique<TimeValue>();
   56|  6.18k|    case comment:
  ------------------
  |  Branch (56:5): [True: 6.18k, False: 3.69M]
  ------------------
   57|  6.18k|      return std::make_unique<CommentValue>();
   58|  73.2k|    case xmpText:
  ------------------
  |  Branch (58:5): [True: 73.2k, False: 3.62M]
  ------------------
   59|  73.2k|      return std::make_unique<XmpTextValue>();
   60|      8|    case xmpBag:
  ------------------
  |  Branch (60:5): [True: 8, False: 3.69M]
  ------------------
   61|  3.90k|    case xmpSeq:
  ------------------
  |  Branch (61:5): [True: 3.90k, False: 3.69M]
  ------------------
   62|  3.90k|    case xmpAlt:
  ------------------
  |  Branch (62:5): [True: 0, False: 3.69M]
  ------------------
   63|  3.90k|      return std::make_unique<XmpArrayValue>(typeId);
   64|    713|    case langAlt:
  ------------------
  |  Branch (64:5): [True: 713, False: 3.69M]
  ------------------
   65|    713|      return std::make_unique<LangAltValue>();
   66|   895k|    default:
  ------------------
  |  Branch (66:5): [True: 895k, False: 2.80M]
  ------------------
   67|   895k|      return std::make_unique<DataValue>(typeId);
   68|  3.69M|  }
   69|  3.69M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   71|    712|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   72|    712|  return -1;
   73|    712|}
_ZNK5Exiv25Value8toStringEv:
   75|   223k|std::string Value::toString() const {
   76|   223k|  std::ostringstream os;
   77|   223k|  write(os);
   78|   223k|  ok_ = !os.fail();
   79|   223k|  return os.str();
   80|   223k|}
_ZNK5Exiv25Value8toStringEm:
   82|   151k|std::string Value::toString(size_t /*n*/) const {
   83|   151k|  return toString();
   84|   151k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   86|  28.8k|size_t Value::sizeDataArea() const {
   87|  28.8k|  return 0;
   88|  28.8k|}
_ZNK5Exiv25Value8dataAreaEv:
   90|  1.87k|DataBuf Value::dataArea() const {
   91|  1.87k|  return {nullptr, 0};
   92|  1.87k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   94|  2.59M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   95|  2.59M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   97|     13|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   98|     13|  read(buf, len, byteOrder);
   99|     13|}
_ZNK5Exiv29DataValue5countEv:
  101|  23.5M|size_t DataValue::count() const {
  102|  23.5M|  return size();
  103|  23.5M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  105|  2.59M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  106|       |  // byteOrder not needed
  107|  2.59M|  value_.assign(buf, buf + len);
  108|  2.59M|  return 0;
  109|  2.59M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  123|  3.63M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  124|       |  // byteOrder not needed
  125|  3.63M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  126|  3.63M|}
_ZNK5Exiv29DataValue4sizeEv:
  128|  41.4M|size_t DataValue::size() const {
  129|  41.4M|  return value_.size();
  130|  41.4M|}
_ZNK5Exiv29DataValue6clone_Ev:
  132|  10.0M|DataValue* DataValue::clone_() const {
  133|  10.0M|  return new DataValue(*this);
  134|  10.0M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  136|  2.98k|std::ostream& DataValue::write(std::ostream& os) const {
  137|  2.98k|  if (!value_.empty()) {
  ------------------
  |  Branch (137:7): [True: 2.25k, False: 727]
  ------------------
  138|  2.25k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  139|  2.25k|    os << static_cast<int>(value_.back());
  140|  2.25k|  }
  141|  2.98k|  return os;
  142|  2.98k|}
_ZNK5Exiv29DataValue7toInt64Em:
  149|   228k|int64_t DataValue::toInt64(size_t n) const {
  150|   228k|  ok_ = true;
  151|   228k|  return value_.at(n);
  152|   228k|}
_ZNK5Exiv29DataValue8toUint32Em:
  154|  24.7M|uint32_t DataValue::toUint32(size_t n) const {
  155|  24.7M|  ok_ = true;
  156|  24.7M|  return value_.at(n);
  157|  24.7M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  173|  11.6k|int StringValueBase::read(const std::string& buf) {
  174|  11.6k|  value_ = buf;
  175|  11.6k|  return 0;
  176|  11.6k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  178|  77.8k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  179|       |  // byteOrder not needed
  180|  77.8k|  if (buf)
  ------------------
  |  Branch (180:7): [True: 77.8k, False: 0]
  ------------------
  181|  77.8k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  182|  77.8k|  return 0;
  183|  77.8k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  185|  91.4k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  186|  91.4k|  if (value_.empty())
  ------------------
  |  Branch (186:7): [True: 41.9k, False: 49.4k]
  ------------------
  187|  41.9k|    return 0;
  188|       |  // byteOrder not needed
  189|  49.4k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  190|  91.4k|}
_ZNK5Exiv215StringValueBase5countEv:
  192|   133k|size_t StringValueBase::count() const {
  193|   133k|  return size();
  194|   133k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  196|   412k|size_t StringValueBase::size() const {
  197|   412k|  return value_.size();
  198|   412k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  200|  8.96k|std::ostream& StringValueBase::write(std::ostream& os) const {
  201|  8.96k|  return os << value_;
  202|  8.96k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  204|  1.35k|int64_t StringValueBase::toInt64(size_t n) const {
  205|  1.35k|  ok_ = true;
  206|  1.35k|  return static_cast<signed char>(value_.at(n));
  207|  1.35k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  209|  5.99k|uint32_t StringValueBase::toUint32(size_t n) const {
  210|  5.99k|  ok_ = true;
  211|  5.99k|  return static_cast<unsigned char>(value_.at(n));
  212|  5.99k|}
_ZN5Exiv211StringValueC2Ev:
  224|  46.2k|StringValue::StringValue() : StringValueBase(string) {
  225|  46.2k|}
_ZNK5Exiv211StringValue6clone_Ev:
  230|   410k|StringValue* StringValue::clone_() const {
  231|   410k|  return new StringValue(*this);
  232|   410k|}
_ZN5Exiv210AsciiValueC2Ev:
  234|  40.6k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  235|  40.6k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  240|  6.83k|int AsciiValue::read(const std::string& buf) {
  241|  6.83k|  value_ = buf;
  242|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  243|  6.83k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (243:7): [True: 7, False: 6.83k]
  |  Branch (243:25): [True: 6.83k, False: 0]
  ------------------
  244|  6.83k|    value_ += '\0';
  245|  6.83k|  }
  246|  6.83k|  return 0;
  247|  6.83k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  249|   135k|AsciiValue* AsciiValue::clone_() const {
  250|   135k|  return new AsciiValue(*this);
  251|   135k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  253|  42.5k|std::ostream& AsciiValue::write(std::ostream& os) const {
  254|       |  // Write only up to the first '\0' (if any)
  255|  42.5k|  std::string::size_type pos = value_.find_first_of('\0');
  256|  42.5k|  if (pos == std::string::npos)
  ------------------
  |  Branch (256:7): [True: 6.82k, False: 35.7k]
  ------------------
  257|  6.82k|    pos = value_.size();
  258|  42.5k|  return os << value_.substr(0, pos);
  259|  42.5k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  286|  5.45k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  287|  5.45k|  int i = 0;
  288|  21.6k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (288:10): [True: 19.7k, False: 1.95k]
  |  Branch (288:10): [True: 16.2k, False: 5.45k]
  |  Branch (288:58): [True: 16.2k, False: 3.50k]
  ------------------
  289|  16.2k|  }
  290|  5.45k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (290:10): [True: 1.95k, False: 3.50k]
  ------------------
  291|  5.45k|}
_ZN5Exiv212CommentValueC2Ev:
  293|  6.18k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  294|  6.18k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  330|  6.18k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  331|  6.18k|  byteOrder_ = byteOrder;
  332|  6.18k|  return StringValueBase::read(buf, len, byteOrder);
  333|  6.18k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  335|  6.06k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  336|  6.06k|  std::string c = value_;
  337|  6.06k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (337:7): [True: 2.57k, False: 3.49k]
  ------------------
  338|  2.57k|    c = value_.substr(8);
  339|  2.57k|    [[maybe_unused]] const size_t sz = c.size();
  340|  2.57k|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (340:9): [True: 113, False: 2.45k]
  |  Branch (340:39): [True: 0, False: 113]
  ------------------
  341|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  342|  2.57k|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (342:16): [True: 2.45k, False: 113]
  |  Branch (342:43): [True: 292, False: 2.16k]
  ------------------
  343|    292|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  344|    292|    }
  345|  2.57k|    c = value_.substr(0, 8) + c;
  346|  2.57k|  }
  347|  6.06k|  if (c.empty())
  ------------------
  |  Branch (347:7): [True: 433, False: 5.63k]
  ------------------
  348|    433|    return 0;
  349|  5.63k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  350|  6.06k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  382|  6.06k|CommentValue::CharsetId CommentValue::charsetId() const {
  383|  6.06k|  CharsetId charsetId = undefined;
  384|  6.06k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (384:7): [True: 5.45k, False: 610]
  ------------------
  385|  5.45k|    const std::string code = value_.substr(0, 8);
  386|  5.45k|    charsetId = CharsetInfo::charsetIdByCode(code);
  387|  5.45k|  }
  388|  6.06k|  return charsetId;
  389|  6.06k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  411|  16.6k|CommentValue* CommentValue::clone_() const {
  412|  16.6k|  return new CommentValue(*this);
  413|  16.6k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  415|  21.3k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  416|  21.3k|  xmpArrayType_ = xmpArrayType;
  417|  21.3k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  419|  13.1k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  420|  13.1k|  xmpStruct_ = xmpStruct;
  421|  13.1k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  423|   427k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  424|   427k|  return xmpArrayType_;
  425|   427k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  427|  19.0k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  428|  19.0k|  XmpArrayType xa = xaNone;
  429|  19.0k|  switch (typeId) {
  430|    486|    case xmpAlt:
  ------------------
  |  Branch (430:5): [True: 486, False: 18.5k]
  ------------------
  431|    486|      xa = xaAlt;
  432|    486|      break;
  433|    364|    case xmpBag:
  ------------------
  |  Branch (433:5): [True: 364, False: 18.6k]
  ------------------
  434|    364|      xa = xaBag;
  435|    364|      break;
  436|  6.14k|    case xmpSeq:
  ------------------
  |  Branch (436:5): [True: 6.14k, False: 12.8k]
  ------------------
  437|  6.14k|      xa = xaSeq;
  438|  6.14k|      break;
  439|  12.0k|    default:
  ------------------
  |  Branch (439:5): [True: 12.0k, False: 6.99k]
  ------------------
  440|  12.0k|      break;
  441|  19.0k|  }
  442|  19.0k|  return xa;
  443|  19.0k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  445|   437k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  446|   437k|  return xmpStruct_;
  447|   437k|}
_ZN5Exiv212XmpTextValueC2Ev:
  469|   213k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  470|   213k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  476|   825k|int XmpTextValue::read(const std::string& buf) {
  477|       |  // support a type=Alt,Bag,Seq,Struct indicator
  478|   825k|  std::string b = buf;
  479|   825k|  std::string type;
  480|   825k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (480:7): [True: 4.15k, False: 821k]
  ------------------
  481|  4.15k|    std::string::size_type pos = buf.find_first_of(' ');
  482|  4.15k|    type = buf.substr(5, pos - 5);
  483|       |    // Strip quotes (so you can also specify the type without quotes)
  484|  4.15k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (484:9): [True: 3.88k, False: 264]
  |  Branch (484:26): [True: 2.87k, False: 1.01k]
  ------------------
  485|  2.87k|      type = type.substr(1);
  486|  4.15k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (486:9): [True: 3.75k, False: 398]
  |  Branch (486:26): [True: 2.46k, False: 1.29k]
  ------------------
  487|  2.46k|      type.pop_back();
  488|  4.15k|    b.clear();
  489|  4.15k|    if (pos != std::string::npos)
  ------------------
  |  Branch (489:9): [True: 1.97k, False: 2.17k]
  ------------------
  490|  1.97k|      b = buf.substr(pos + 1);
  491|  4.15k|  }
  492|   825k|  if (!type.empty()) {
  ------------------
  |  Branch (492:7): [True: 3.75k, False: 821k]
  ------------------
  493|  3.75k|    if (type == "Alt") {
  ------------------
  |  Branch (493:9): [True: 104, False: 3.64k]
  ------------------
  494|    104|      setXmpArrayType(XmpValue::xaAlt);
  495|  3.64k|    } else if (type == "Bag") {
  ------------------
  |  Branch (495:16): [True: 88, False: 3.56k]
  ------------------
  496|     88|      setXmpArrayType(XmpValue::xaBag);
  497|  3.56k|    } else if (type == "Seq") {
  ------------------
  |  Branch (497:16): [True: 2.15k, False: 1.41k]
  ------------------
  498|  2.15k|      setXmpArrayType(XmpValue::xaSeq);
  499|  2.15k|    } else if (type == "Struct") {
  ------------------
  |  Branch (499:16): [True: 547, False: 863]
  ------------------
  500|    547|      setXmpStruct();
  501|    863|    } else {
  502|    863|      throw Error(ErrorCode::kerInvalidXmpText, type);
  503|    863|    }
  504|  3.75k|  }
  505|   824k|  value_ = std::move(b);
  506|   824k|  return 0;
  507|   825k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  513|  93.3k|size_t XmpTextValue::size() const {
  514|  93.3k|  std::ostringstream os;
  515|  93.3k|  write(os);
  516|  93.3k|  return os.str().size();
  517|  93.3k|}
_ZNK5Exiv212XmpTextValue5countEv:
  519|  93.3k|size_t XmpTextValue::count() const {
  520|  93.3k|  return size();
  521|  93.3k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  523|   251k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  524|   251k|  bool del = false;
  525|   251k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (525:7): [True: 2.84k, False: 248k]
  ------------------
  526|  2.84k|    switch (xmpArrayType()) {
  ------------------
  |  Branch (526:13): [True: 2.84k, False: 0]
  ------------------
  527|    146|      case XmpValue::xaAlt:
  ------------------
  |  Branch (527:7): [True: 146, False: 2.70k]
  ------------------
  528|    146|        os << "type=\"Alt\"";
  529|    146|        break;
  530|     24|      case XmpValue::xaBag:
  ------------------
  |  Branch (530:7): [True: 24, False: 2.82k]
  ------------------
  531|     24|        os << "type=\"Bag\"";
  532|     24|        break;
  533|  2.67k|      case XmpValue::xaSeq:
  ------------------
  |  Branch (533:7): [True: 2.67k, False: 170]
  ------------------
  534|  2.67k|        os << "type=\"Seq\"";
  535|  2.67k|        break;
  536|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (536:7): [True: 0, False: 2.84k]
  ------------------
  537|      0|        break;  // just to suppress the warning
  538|  2.84k|    }
  539|  2.84k|    del = true;
  540|   248k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (540:14): [True: 8.24k, False: 240k]
  ------------------
  541|  8.24k|    switch (xmpStruct()) {
  ------------------
  |  Branch (541:13): [True: 8.24k, False: 0]
  ------------------
  542|  8.24k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (542:7): [True: 8.24k, False: 0]
  ------------------
  543|  8.24k|        os << "type=\"Struct\"";
  544|  8.24k|        break;
  545|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (545:7): [True: 0, False: 8.24k]
  ------------------
  546|      0|        break;  // just to suppress the warning
  547|  8.24k|    }
  548|  8.24k|    del = true;
  549|  8.24k|  }
  550|   251k|  if (del && !value_.empty())
  ------------------
  |  Branch (550:7): [True: 11.0k, False: 240k]
  |  Branch (550:14): [True: 1.49k, False: 9.59k]
  ------------------
  551|  1.49k|    os << " ";
  552|   251k|  return os << value_;
  553|   251k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  571|   501k|XmpTextValue* XmpTextValue::clone_() const {
  572|   501k|  return new XmpTextValue(*this);
  573|   501k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  575|  6.43k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  576|  6.43k|  setXmpArrayType(xmpArrayType(typeId));
  577|  6.43k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  37.4k|int XmpArrayValue::read(const std::string& buf) {
  580|  37.4k|  if (!buf.empty())
  ------------------
  |  Branch (580:7): [True: 33.4k, False: 3.95k]
  ------------------
  581|  33.4k|    value_.push_back(buf);
  582|  37.4k|  return 0;
  583|  37.4k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  589|  16.1k|size_t XmpArrayValue::count() const {
  590|  16.1k|  return value_.size();
  591|  16.1k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  593|    218|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  594|    218|  if (!value_.empty()) {
  ------------------
  |  Branch (594:7): [True: 212, False: 6]
  ------------------
  595|    212|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  596|    212|    os << value_.back();
  597|    212|  }
  598|    218|  return os;
  599|    218|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  601|  38.2k|std::string XmpArrayValue::toString(size_t n) const {
  602|  38.2k|  ok_ = true;
  603|  38.2k|  return value_.at(n);
  604|  38.2k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  622|  12.0k|XmpArrayValue* XmpArrayValue::clone_() const {
  623|  12.0k|  return new XmpArrayValue(*this);
  624|  12.0k|}
_ZN5Exiv212LangAltValueC2Ev:
  626|  2.27k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  627|  2.27k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  633|    767|int LangAltValue::read(const std::string& buf) {
  634|    767|  std::string b = buf;
  635|    767|  std::string lang = "x-default";
  636|    767|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (636:7): [True: 195, False: 572]
  ------------------
  637|    195|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  638|       |
  639|    195|    const std::string::size_type pos = buf.find_first_of(' ');
  640|    195|    if (pos == std::string::npos) {
  ------------------
  |  Branch (640:9): [True: 53, False: 142]
  ------------------
  641|     53|      lang = buf.substr(5);
  642|    142|    } else {
  643|    142|      lang = buf.substr(5, pos - 5);
  644|    142|    }
  645|    195|    if (lang.empty())
  ------------------
  |  Branch (645:9): [True: 3, False: 192]
  ------------------
  646|      3|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  647|       |    // Strip quotes (so you can also specify the language without quotes)
  648|    192|    if (lang.front() == '"') {
  ------------------
  |  Branch (648:9): [True: 39, False: 153]
  ------------------
  649|     39|      lang = lang.substr(1);
  650|       |
  651|     39|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (651:11): [True: 1, False: 38]
  |  Branch (651:27): [True: 22, False: 16]
  ------------------
  652|     23|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  653|       |
  654|     16|      lang.pop_back();
  655|     16|    }
  656|       |
  657|    169|    if (lang.empty())
  ------------------
  |  Branch (657:9): [True: 1, False: 168]
  ------------------
  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|    168|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (661:55): [True: 89, False: 79]
  ------------------
  662|     89|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  663|     89|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (663:11): [True: 51, False: 38]
  |  Branch (663:38): [True: 15, False: 23]
  ------------------
  664|     66|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  665|     89|    }
  666|       |
  667|    102|    b.clear();
  668|    102|    if (pos != std::string::npos)
  ------------------
  |  Branch (668:9): [True: 89, False: 13]
  ------------------
  669|     89|      b = buf.substr(pos + 1);
  670|    102|  }
  671|       |
  672|    674|  value_[lang] = std::move(b);
  673|    674|  return 0;
  674|    767|}
_ZNK5Exiv212LangAltValue5countEv:
  680|    843|size_t LangAltValue::count() const {
  681|    843|  return value_.size();
  682|    843|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  684|    275|std::ostream& LangAltValue::write(std::ostream& os) const {
  685|    275|  bool first = true;
  686|       |
  687|       |  // Write the default entry first
  688|    275|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (688:42): [True: 0, False: 275]
  ------------------
  689|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  690|      0|    first = false;
  691|      0|  }
  692|       |
  693|       |  // Write the others
  694|    275|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (694:30): [True: 275, False: 275]
  ------------------
  695|    275|    if (lang != "x-default") {
  ------------------
  |  Branch (695:9): [True: 275, False: 0]
  ------------------
  696|    275|      if (!first)
  ------------------
  |  Branch (696:11): [True: 0, False: 275]
  ------------------
  697|      0|        os << ", ";
  698|    275|      os << "lang=\"" << lang << "\" " << s;
  699|    275|      first = false;
  700|    275|    }
  701|    275|  }
  702|    275|  return os;
  703|    275|}
_ZNK5Exiv212LangAltValue8toStringEm:
  705|    850|std::string LangAltValue::toString(size_t /*n*/) const {
  706|    850|  return toString("x-default");
  707|    850|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  709|    850|std::string LangAltValue::toString(const std::string& qualifier) const {
  710|    850|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (710:40): [True: 7, False: 843]
  ------------------
  711|      7|    ok_ = true;
  712|      7|    return i->second;
  713|      7|  }
  714|    843|  ok_ = false;
  715|    843|  return "";
  716|    850|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  738|  3.66k|LangAltValue* LangAltValue::clone_() const {
  739|  3.66k|  return new LangAltValue(*this);
  740|  3.66k|}
_ZN5Exiv29DateValueC2Ev:
  742|  6.80k|DateValue::DateValue() : Value(date) {
  743|  6.80k|  date_ = {};
  744|  6.80k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  750|  6.27k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  751|  6.27k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  752|  6.27k|  return read(str);
  753|  6.27k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  755|  6.80k|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|  6.80k|  size_t monthPos = 0;
  759|  6.80k|  size_t dayPos = 0;
  760|       |
  761|  6.80k|  auto printWarning = [] {
  762|  6.80k|#ifndef SUPPRESS_WARNINGS
  763|  6.80k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  764|  6.80k|#endif
  765|  6.80k|  };
  766|       |
  767|  6.80k|  if (buf.size() < 8) {
  ------------------
  |  Branch (767:7): [True: 1.02k, False: 5.77k]
  ------------------
  768|  1.02k|    printWarning();
  769|  1.02k|    return 1;
  770|  1.02k|  }
  771|       |
  772|  5.77k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (772:8): [True: 3.50k, False: 2.26k]
  |  Branch (772:28): [True: 1.77k, False: 1.72k]
  |  Branch (772:45): [True: 532, False: 1.24k]
  |  Branch (772:63): [True: 2.25k, False: 2.98k]
  ------------------
  773|  2.78k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (773:9): [True: 532, False: 2.25k]
  ------------------
  774|    532|      monthPos = 5;
  775|    532|      dayPos = 8;
  776|  2.25k|    } else {
  777|  2.25k|      monthPos = 4;
  778|  2.25k|      dayPos = 6;
  779|  2.25k|    }
  780|       |
  781|  2.78k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  2.78k|      for (size_t i = start; i < start + count; ++i) {
  783|  2.78k|        if (!std::isdigit(buf[i])) {
  784|  2.78k|          printWarning();
  785|  2.78k|          return 1;
  786|  2.78k|        }
  787|  2.78k|      }
  788|  2.78k|      dest = std::stoul(buf.substr(start, count));
  789|  2.78k|      return 0;
  790|  2.78k|    };
  791|       |
  792|  2.78k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (792:9): [True: 783, False: 2.00k]
  |  Branch (792:42): [True: 699, False: 1.30k]
  |  Branch (792:83): [True: 349, False: 952]
  ------------------
  793|  1.83k|      printWarning();
  794|  1.83k|      return 1;
  795|  1.83k|    }
  796|       |
  797|    952|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (797:9): [True: 251, False: 701]
  |  Branch (797:29): [True: 150, False: 551]
  ------------------
  798|    401|      date_.month = 0;
  799|    401|      date_.day = 0;
  800|    401|      printWarning();
  801|    401|      return 1;
  802|    401|    }
  803|    551|    return 0;
  804|    952|  }
  805|  2.98k|  printWarning();
  806|  2.98k|  return 1;
  807|  5.77k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  813|    922|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|    922|  auto out = reinterpret_cast<char*>(buf);
  818|    922|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|    922|#define stringFormatTo std::format_to
  ------------------
  819|       |
  820|    922|  return it - out;
  821|    922|}
_ZNK5Exiv29DateValue4sizeEv:
  831|  1.84k|size_t DateValue::size() const {
  832|  1.84k|  return 8;
  833|  1.84k|}
_ZNK5Exiv29DateValue6clone_Ev:
  835|  7.00k|DateValue* DateValue::clone_() const {
  836|  7.00k|  return new DateValue(*this);
  837|  7.00k|}
_ZN5Exiv29TimeValueC2Ev:
  878|  12.2k|TimeValue::TimeValue() : Value(time) {
  879|  12.2k|  time_ = {};
  880|  12.2k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  886|  12.2k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  887|  12.2k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  888|  12.2k|  return read(str);
  889|  12.2k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  891|  12.2k|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|  12.2k|  auto printWarning = [] {
  897|  12.2k|#ifndef SUPPRESS_WARNINGS
  898|  12.2k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  899|  12.2k|#endif
  900|  12.2k|    return 1;
  901|  12.2k|  };
  902|       |
  903|  12.2k|  if (buf.size() < 2)
  ------------------
  |  Branch (903:7): [True: 1.30k, False: 10.9k]
  ------------------
  904|  1.30k|    return printWarning();
  905|       |
  906|  10.9k|  for (auto c : buf)
  ------------------
  |  Branch (906:15): [True: 148k, False: 8.02k]
  ------------------
  907|   148k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (907:9): [True: 143k, False: 4.68k]
  |  Branch (907:21): [True: 137k, False: 6.45k]
  |  Branch (907:33): [True: 131k, False: 6.37k]
  |  Branch (907:45): [True: 130k, False: 981]
  |  Branch (907:57): [True: 2.87k, False: 127k]
  ------------------
  908|  2.87k|      return printWarning();
  909|       |
  910|  8.02k|  size_t mpos;
  911|  8.02k|  size_t spos;
  912|  8.02k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (912:7): [True: 3.19k, False: 4.82k]
  ------------------
  913|  3.19k|    mpos = 3;
  914|  3.19k|    spos = 6;
  915|  4.82k|  } else {
  916|  4.82k|    mpos = 2;
  917|  4.82k|    spos = 4;
  918|  4.82k|  }
  919|       |
  920|  8.02k|  try {
  921|  8.02k|    auto hi = std::stoi(buf.substr(0, 2));
  922|  8.02k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (922:9): [True: 330, False: 7.69k]
  |  Branch (922:19): [True: 129, False: 7.56k]
  ------------------
  923|    310|      return printWarning();
  924|  7.71k|    time_.hour = hi;
  925|  7.71k|    if (buf.size() > 3) {
  ------------------
  |  Branch (925:9): [True: 7.17k, False: 537]
  ------------------
  926|  7.17k|      auto mi = std::stoi(buf.substr(mpos, 2));
  927|  7.17k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (927:11): [True: 228, False: 6.94k]
  |  Branch (927:21): [True: 223, False: 6.72k]
  ------------------
  928|    352|        return printWarning();
  929|  6.82k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  930|  6.82k|    } else {
  931|    537|      time_.minute = 0;
  932|    537|    }
  933|  7.36k|    if (buf.size() > 5) {
  ------------------
  |  Branch (933:9): [True: 4.67k, False: 2.68k]
  ------------------
  934|  4.67k|      auto si = std::stoi(buf.substr(spos, 2));
  935|  4.67k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (935:11): [True: 184, False: 4.49k]
  |  Branch (935:21): [True: 207, False: 4.28k]
  ------------------
  936|    307|        return printWarning();
  937|  4.36k|      time_.second = std::stoi(buf.substr(spos, 2));
  938|  4.36k|    } else {
  939|  2.68k|      time_.second = 0;
  940|  2.68k|    }
  941|       |
  942|  7.05k|    auto fpos = buf.find('+');
  943|  7.05k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (943:9): [True: 3.64k, False: 3.41k]
  ------------------
  944|  3.64k|      fpos = buf.find('-');
  945|       |
  946|  7.05k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (946:9): [True: 6.19k, False: 862]
  ------------------
  947|  6.19k|      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|  6.19k|      const bool negative = format.at(0) == '-';
  953|  6.19k|      auto posColon = format.find(':');
  954|  6.19k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (954:11): [True: 3.95k, False: 2.23k]
  ------------------
  955|       |        // Extended format
  956|  3.95k|        auto tzhi = std::stoi(format.substr(0, 3));
  957|  3.95k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (957:13): [True: 620, False: 3.33k]
  |  Branch (957:27): [True: 140, False: 3.19k]
  ------------------
  958|    592|          return printWarning();
  959|  3.36k|        time_.tzHour = tzhi;
  960|  3.36k|        if (format.size() > 3) {
  ------------------
  |  Branch (960:13): [True: 2.84k, False: 517]
  ------------------
  961|  2.84k|          int minute = std::stoi(format.substr(3));
  962|  2.84k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (962:15): [True: 880, False: 1.96k]
  |  Branch (962:29): [True: 482, False: 1.48k]
  ------------------
  963|    522|            return printWarning();
  964|  2.32k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (964:28): [True: 674, False: 1.64k]
  ------------------
  965|  2.32k|        }
  966|  3.36k|      } else {
  967|       |        // Basic format
  968|  2.23k|        auto tzhi = std::stoi(format.substr(0, posColon));
  969|  2.23k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (969:13): [True: 623, False: 1.61k]
  |  Branch (969:27): [True: 79, False: 1.53k]
  ------------------
  970|    460|          return printWarning();
  971|  1.77k|        time_.tzHour = tzhi;
  972|  1.77k|        int minute = std::stoi(format.substr(posColon + 1));
  973|  1.77k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (973:13): [True: 830, False: 948]
  |  Branch (973:27): [True: 369, False: 579]
  ------------------
  974|    535|          return printWarning();
  975|  1.24k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (975:26): [True: 148, False: 1.09k]
  ------------------
  976|  1.24k|      }
  977|  6.19k|    }
  978|  7.05k|  } catch (std::exception&) {
  979|       |    // std::stoi might throw an exception if the syntax is invalid.
  980|  2.00k|    return printWarning();
  981|  2.00k|  }
  982|  2.94k|  return 0;
  983|  8.02k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  990|    619|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|    619|  char plusMinus = '+';
  994|    619|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (994:7): [True: 167, False: 452]
  |  Branch (994:27): [True: 80, False: 372]
  ------------------
  995|    247|    plusMinus = '-';
  996|       |
  997|    619|  auto out = reinterpret_cast<char*>(buf);
  998|    619|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    619|#define stringFormatTo std::format_to
  ------------------
  999|    619|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
 1000|       |
 1001|    619|  auto wrote = static_cast<size_t>(it - out);
 1002|    619|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
 1003|    619|  return wrote;
 1004|    619|}
_ZNK5Exiv29TimeValue4sizeEv:
 1014|  1.23k|size_t TimeValue::size() const {
 1015|  1.23k|  return 11;
 1016|  1.23k|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1018|  5.64k|TimeValue* TimeValue::clone_() const {
 1019|  5.64k|  return new TimeValue(*this);
 1020|  5.64k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  761|  8.08k|  auto printWarning = [] {
  762|  8.08k|#ifndef SUPPRESS_WARNINGS
  763|  8.08k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  8.08k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 8.08k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  8.08k|  LogMsg(LogMsg::warn).os()
  ------------------
  764|  8.08k|#endif
  765|  8.08k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  781|  6.08k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  20.2k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (782:30): [True: 16.0k, False: 4.25k]
  ------------------
  783|  16.0k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (783:13): [True: 1.83k, False: 14.1k]
  ------------------
  784|  1.83k|          printWarning();
  785|  1.83k|          return 1;
  786|  1.83k|        }
  787|  16.0k|      }
  788|  4.25k|      dest = std::stoul(buf.substr(start, count));
  789|  4.25k|      return 0;
  790|  6.08k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  896|  9.26k|  auto printWarning = [] {
  897|  9.26k|#ifndef SUPPRESS_WARNINGS
  898|  9.26k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  9.26k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9.26k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  9.26k|  LogMsg(LogMsg::warn).os()
  ------------------
  899|  9.26k|#endif
  900|  9.26k|    return 1;
  901|  9.26k|  };

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

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  263|   249k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  264|   249k|  if (pValue)
  ------------------
  |  Branch (264:7): [True: 147k, False: 102k]
  ------------------
  265|   147k|    value_ = pValue->clone();
  266|   249k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  268|   310k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  269|   310k|  if (rhs.key_)
  ------------------
  |  Branch (269:7): [True: 310k, False: 0]
  ------------------
  270|   310k|    key_ = rhs.key_->clone();  // deep copy
  271|   310k|  if (rhs.value_)
  ------------------
  |  Branch (271:7): [True: 310k, False: 0]
  ------------------
  272|   310k|    value_ = rhs.value_->clone();  // deep copy
  273|   310k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  275|  3.31k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  276|  3.31k|  if (this == &rhs)
  ------------------
  |  Branch (276:7): [True: 0, False: 3.31k]
  ------------------
  277|      0|    return *this;
  278|  3.31k|  key_.reset();
  279|  3.31k|  if (rhs.key_)
  ------------------
  |  Branch (279:7): [True: 3.31k, False: 0]
  ------------------
  280|  3.31k|    key_ = rhs.key_->clone();  // deep copy
  281|  3.31k|  value_.reset();
  282|  3.31k|  if (rhs.value_)
  ------------------
  |  Branch (282:7): [True: 3.31k, False: 0]
  ------------------
  283|  3.31k|    value_ = rhs.value_->clone();  // deep copy
  284|  3.31k|  return *this;
  285|  3.31k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  287|   249k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  288|   249k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  290|   310k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  291|   310k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  293|  3.31k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  294|  3.31k|  if (this == &rhs)
  ------------------
  |  Branch (294:7): [True: 0, False: 3.31k]
  ------------------
  295|      0|    return *this;
  296|  3.31k|  *p_ = *rhs.p_;
  297|  3.31k|  return *this;
  298|  3.31k|}
_ZN5Exiv28XmpdatumD2Ev:
  300|   560k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  302|  27.0M|std::string Xmpdatum::key() const {
  303|  27.0M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (303:10): [True: 27.0M, False: 0]
  ------------------
  304|  27.0M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  310|  96.4k|std::string Xmpdatum::groupName() const {
  311|  96.4k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (311:10): [True: 96.4k, False: 0]
  ------------------
  312|  96.4k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  314|   220k|std::string Xmpdatum::tagName() const {
  315|   220k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (315:10): [True: 220k, False: 0]
  ------------------
  316|   220k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  330|   478k|TypeId Xmpdatum::typeId() const {
  331|   478k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (331:10): [True: 478k, False: 0]
  ------------------
  332|   478k|}
_ZNK5Exiv28Xmpdatum5countEv:
  342|   110k|size_t Xmpdatum::count() const {
  343|   110k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (343:10): [True: 110k, False: 0]
  ------------------
  344|   110k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  350|  3.71k|std::string Xmpdatum::toString() const {
  351|  3.71k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (351:10): [True: 3.71k, False: 0]
  ------------------
  352|  3.71k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  354|   190k|std::string Xmpdatum::toString(size_t n) const {
  355|   190k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (355:10): [True: 190k, False: 0]
  ------------------
  356|   190k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  374|   262k|const Value& Xmpdatum::value() const {
  375|   262k|  if (!p_->value_)
  ------------------
  |  Branch (375:7): [True: 0, False: 262k]
  ------------------
  376|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  377|   262k|  return *p_->value_;
  378|   262k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  388|  55.5k|void Xmpdatum::setValue(const Value* pValue) {
  389|  55.5k|  p_->value_.reset();
  390|  55.5k|  if (pValue)
  ------------------
  |  Branch (390:7): [True: 55.5k, False: 0]
  ------------------
  391|  55.5k|    p_->value_ = pValue->clone();
  392|  55.5k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  394|   707k|int Xmpdatum::setValue(const std::string& value) {
  395|   707k|  XmpProperties::XmpLock lock;
  396|   707k|  if (!p_->value_) {
  ------------------
  |  Branch (396:7): [True: 74.3k, False: 632k]
  ------------------
  397|  74.3k|    TypeId type = xmpText;
  398|  74.3k|    if (p_->key_) {
  ------------------
  |  Branch (398:9): [True: 74.3k, False: 0]
  ------------------
  399|  74.3k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  400|  74.3k|    }
  401|  74.3k|    p_->value_ = Value::create(type);
  402|  74.3k|  }
  403|   707k|  return p_->value_->read(value);
  404|   707k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  406|   766k|Xmpdatum& XmpData::operator[](const std::string& key) {
  407|   766k|  XmpProperties::XmpLock lock;
  408|   766k|  XmpKey xmpKey(key, lock);
  409|   766k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  410|   766k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (410:7): [True: 102k, False: 664k]
  ------------------
  411|   102k|    return xmpMetadata_.emplace_back(xmpKey);
  412|   102k|  }
  413|   664k|  return *pos;
  414|   766k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  416|  3.49k|int XmpData::add(const XmpKey& key, const Value* value) {
  417|  3.49k|  XmpProperties::XmpLock lock;
  418|  3.49k|  return addUnlocked(key, value, lock);
  419|  3.49k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  421|   147k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  422|   147k|  xmpMetadata_.emplace_back(key, value);
  423|   147k|  return 0;
  424|   147k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  436|  39.6k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  437|  39.6k|  XmpProperties::XmpLock lock;
  438|  39.6k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  439|  39.6k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  441|   470k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  442|   470k|  XmpProperties::XmpLock lock;
  443|   470k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  444|   470k|}
_ZN5Exiv27XmpData5clearEv:
  446|  72.3k|void XmpData::clear() {
  447|  72.3k|  XmpProperties::XmpLock lock;
  448|  72.3k|  clearUnlocked(lock);
  449|  72.3k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  451|  83.3k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  452|  83.3k|  xmpMetadata_.clear();
  453|  83.3k|  nsBindings_.clear();
  454|  83.3k|}
_ZNK5Exiv27XmpData5beginEv:
  465|  5.89k|XmpData::const_iterator XmpData::begin() const {
  466|  5.89k|  return xmpMetadata_.begin();
  467|  5.89k|}
_ZNK5Exiv27XmpData3endEv:
  469|  45.5k|XmpData::const_iterator XmpData::end() const {
  470|  45.5k|  return xmpMetadata_.end();
  471|  45.5k|}
_ZNK5Exiv27XmpData5emptyEv:
  473|  3.64k|bool XmpData::empty() const {
  474|  3.64k|  XmpProperties::XmpLock lock;
  475|  3.64k|  return emptyUnlocked(lock);
  476|  3.64k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  478|  47.3k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  479|  47.3k|  return xmpMetadata_.empty();
  480|  47.3k|}
_ZN5Exiv27XmpData5beginEv:
  491|  10.5k|XmpData::iterator XmpData::begin() {
  492|  10.5k|  return xmpMetadata_.begin();
  493|  10.5k|}
_ZN5Exiv27XmpData3endEv:
  495|   481k|XmpData::iterator XmpData::end() {
  496|   481k|  return xmpMetadata_.end();
  497|   481k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  499|  1.25k|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  500|  1.25k|  XmpProperties::XmpLock lock;
  501|  1.25k|  return xmpMetadata_.erase(pos);
  502|  1.25k|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  548|   209k|void xmpToolkitEnsureInitialized() {
  549|   209k|  static XmpToolkitLifetimeManager instance;
  550|   209k|  (void)instance;
  551|   209k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  553|   154k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  554|   154k|  xmpToolkitEnsureInitialized();
  555|   154k|  try {
  556|   154k|    std::string existingPrefix;
  557|   154k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (557:9): [True: 154k, False: 9]
  ------------------
  558|   154k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (558:11): [True: 154k, False: 0]
  |  Branch (558:38): [True: 154k, False: 0]
  ------------------
  559|   154k|        existingPrefix.pop_back();
  560|   154k|      }
  561|   154k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (561:11): [True: 154k, False: 587]
  ------------------
  562|       |        // Already registered correctly, skip overhead
  563|   154k|        return;
  564|   154k|      }
  565|   154k|    }
  566|       |
  567|    596|    SXMPMeta::DeleteNamespace(ns.c_str());
  568|       |#ifdef EXV_ADOBE_XMPSDK
  569|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  570|       |#else
  571|    596|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  572|    596|#endif
  573|    596|  } catch (const XMP_Error& /* e */) {
  574|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  575|      0|  }
  576|   154k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS_12DecodeParamsE:
  673|  11.7k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket, const DecodeParams& dp) {
  674|  11.7k|  try {
  675|  11.7k|    xmpData.setPacket(xmpPacket);
  676|  11.7k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (676:9): [True: 736, False: 11.0k]
  ------------------
  677|    736|      xmpData.clear();
  678|    736|      return 0;
  679|    736|    }
  680|       |
  681|       |    // Acquire Giant Lock
  682|  11.0k|    XmpProperties::XmpLock lock;
  683|  11.0k|    try {
  684|  11.0k|      xmpToolkitEnsureInitialized();
  685|  11.0k|    } 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|  11.0k|    xmpData.clearUnlocked(lock);
  693|       |
  694|       |    // Make sure the unterminated substring is used
  695|  11.0k|    size_t len = xmpPacket.size();
  696|  49.7k|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (696:12): [True: 49.6k, False: 91]
  |  Branch (696:23): [True: 38.7k, False: 10.9k]
  ------------------
  697|  38.7k|      --len;
  698|       |
  699|  11.0k|    XMLValidator::check(xmpPacket.data(), len, dp);
  700|  11.0k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  701|  11.0k|    SXMPIterator iter(meta);
  702|  11.0k|    std::string schemaNs;
  703|  11.0k|    std::string propPath;
  704|  11.0k|    std::string propValue;
  705|  11.0k|    XMP_OptionBits opt = 0;
  706|   168k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (706:12): [True: 157k, False: 11.0k]
  ------------------
  707|   157k|      printNode(schemaNs, propPath, propValue, opt);
  708|   157k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (708:11): [True: 0, False: 157k]
  ------------------
  709|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  710|      0|      }
  711|   157k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (711:11): [True: 13.4k, False: 143k]
  ------------------
  712|       |        // Register unknown namespaces with Exiv2
  713|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  714|  13.4k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  715|  13.4k|        if (prefix.empty()) {
  ------------------
  |  Branch (715:13): [True: 10.7k, False: 2.66k]
  ------------------
  716|  10.7k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (716:15): [True: 0, False: 10.7k]
  ------------------
  717|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  718|  10.7k|          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|  10.7k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (726:15): [True: 37, False: 10.7k]
  ------------------
  727|     37|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  728|  10.7k|        }
  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|  13.4k|        xmpData.nsBindings_[prefix] = schemaNs;
  734|  13.4k|        continue;
  735|  13.4k|      }
  736|   143k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  737|   143k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (737:11): [True: 1.55k, False: 142k]
  ------------------
  738|       |        // Read Lang Alt property
  739|  1.55k|        auto val = std::make_unique<LangAltValue>();
  740|  1.55k|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  741|  12.4k|        while (count-- > 0) {
  ------------------
  |  Branch (741:16): [True: 10.8k, False: 1.55k]
  ------------------
  742|       |          // Get the text
  743|  10.8k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  744|  10.8k|          printNode(schemaNs, propPath, propValue, opt);
  745|  10.8k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (745:15): [True: 0, False: 10.8k]
  |  Branch (745:28): [True: 0, False: 10.8k]
  |  Branch (745:54): [True: 2, False: 10.8k]
  ------------------
  746|      2|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  747|      2|          }
  748|  10.8k|          std::string text = propValue;
  749|       |          // Get the language qualifier
  750|  10.8k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  751|  10.8k|          printNode(schemaNs, propPath, propValue, opt);
  752|  10.8k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (752:15): [True: 0, False: 10.8k]
  |  Branch (752:15): [True: 0, False: 10.8k]
  |  Branch (752:28): [True: 0, False: 10.8k]
  |  Branch (752:54): [True: 0, False: 10.8k]
  ------------------
  753|  10.8k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (753:15): [True: 0, False: 10.8k]
  ------------------
  754|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  755|      0|          }
  756|  10.8k|          val->value_[propValue] = std::move(text);
  757|  10.8k|        }
  758|  1.55k|        xmpData.addUnlocked(*key, val.get(), lock);
  759|  1.55k|        continue;
  760|  1.55k|      }
  761|   142k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (761:11): [True: 3.08k, False: 139k]
  |  Branch (761:35): [True: 3.08k, False: 0]
  |  Branch (761:66): [True: 3.08k, False: 0]
  ------------------
  762|       |        // Check if all elements are simple
  763|  3.08k|        bool simpleArray = true;
  764|  3.08k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  765|  3.08k|        std::string aSchemaNs;
  766|  3.08k|        std::string aPropPath;
  767|  3.08k|        std::string aPropValue;
  768|  3.08k|        XMP_OptionBits aOpt = 0;
  769|  22.7k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (769:16): [True: 20.2k, False: 2.52k]
  ------------------
  770|  20.2k|          if (propPath == aPropPath)
  ------------------
  |  Branch (770:15): [True: 3.08k, False: 17.1k]
  ------------------
  771|  3.08k|            continue;
  772|  17.1k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (772:15): [True: 290, False: 16.8k]
  |  Branch (772:42): [True: 271, False: 16.5k]
  |  Branch (772:73): [True: 0, False: 16.5k]
  ------------------
  773|  17.1k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (773:15): [True: 0, False: 16.5k]
  |  Branch (773:41): [True: 0, False: 16.5k]
  ------------------
  774|    561|            simpleArray = false;
  775|    561|            break;
  776|    561|          }
  777|  17.1k|        }
  778|  3.08k|        if (simpleArray) {
  ------------------
  |  Branch (778:13): [True: 2.52k, False: 561]
  ------------------
  779|       |          // Read the array into an XmpArrayValue
  780|  2.52k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  781|  2.52k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  782|  18.2k|          while (count-- > 0) {
  ------------------
  |  Branch (782:18): [True: 15.7k, False: 2.52k]
  ------------------
  783|  15.7k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  784|  15.7k|            printNode(schemaNs, propPath, propValue, opt);
  785|  15.7k|            val->read(propValue);
  786|  15.7k|          }
  787|  2.52k|          xmpData.addUnlocked(*key, val.get(), lock);
  788|  2.52k|          continue;
  789|  2.52k|        }
  790|  3.08k|      }
  791|       |
  792|   139k|      auto val = std::make_unique<XmpTextValue>();
  793|   139k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (793:11): [True: 12.0k, False: 127k]
  |  Branch (793:36): [True: 561, False: 127k]
  ------------------
  794|       |        // Create a metadatum with only XMP options
  795|  12.6k|        val->setXmpArrayType(xmpArrayType(opt));
  796|  12.6k|        val->setXmpStruct(xmpStruct(opt));
  797|  12.6k|        xmpData.addUnlocked(*key, val.get(), lock);
  798|  12.6k|        continue;
  799|  12.6k|      }
  800|   127k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (800:11): [True: 127k, False: 0]
  |  Branch (800:36): [True: 0, False: 0]
  ------------------
  801|   127k|        val->read(propValue);
  802|   127k|        xmpData.addUnlocked(*key, val.get(), lock);
  803|   127k|        continue;
  804|   127k|      }
  805|       |      // Don't let any node go by unnoticed
  806|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  807|   127k|    }  // iterate through all XMP nodes
  808|       |
  809|  11.0k|    return 0;
  810|  11.0k|  }
  811|  11.7k|#ifndef SUPPRESS_WARNINGS
  812|  11.7k|  catch (const Error& e) {
  813|    118|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (813:9): [True: 0, False: 118]
  ------------------
  814|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  815|      0|    }
  816|    118|    throw;
  817|  4.54k|  } catch (const XMP_Error& e) {
  818|  4.54k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  4.54k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 4.54k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  4.54k|  LogMsg(LogMsg::error).os()
  ------------------
  819|  4.54k|    xmpData.clear();
  820|  4.54k|    return 3;
  821|  4.54k|  }
  822|       |#else
  823|       |  catch (const XMP_Error&) {
  824|       |    xmpData.clear();
  825|       |    return 3;
  826|       |  }
  827|       |#endif  // SUPPRESS_WARNINGS
  828|  11.7k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  842|  43.6k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  843|  43.6k|  try {
  844|       |    // Acquire Giant Lock
  845|  43.6k|    XmpProperties::XmpLock lock;
  846|  43.6k|    try {
  847|  43.6k|      xmpToolkitEnsureInitialized();
  848|  43.6k|    } 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|  43.6k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (855:9): [True: 37.7k, False: 5.89k]
  ------------------
  856|  37.7k|      xmpPacket.clear();
  857|  37.7k|      return 0;
  858|  37.7k|    }  // 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|   154k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (860:33): [True: 154k, False: 5.89k]
  ------------------
  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|   154k|      registerNsImpl(xmp, uri.prefix_);
  866|   154k|    }
  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|  5.89k|    SXMPMeta meta;
  876|  96.4k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (876:26): [True: 96.4k, False: 5.89k]
  ------------------
  877|  96.4k|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  878|  96.4k|      XMP_OptionBits options = 0;
  879|       |
  880|  96.4k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (880:11): [True: 1.27k, False: 95.1k]
  ------------------
  881|       |        // Encode Lang Alt property
  882|  1.27k|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  883|  1.27k|        if (!la)
  ------------------
  |  Branch (883:13): [True: 0, False: 1.27k]
  ------------------
  884|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  885|       |
  886|  1.27k|        int idx = 1;
  887|  5.49k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (887:40): [True: 5.49k, False: 1.27k]
  ------------------
  888|  5.49k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (888:15): [True: 5.35k, False: 143]
  ------------------
  889|  5.35k|            printNode(ns, xmp.tagName(), specs, 0);
  890|  5.35k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  891|  5.35k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  892|  5.35k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  893|  5.35k|          }
  894|  5.49k|        }
  895|  1.27k|        continue;
  896|  1.27k|      }
  897|       |
  898|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  899|  95.1k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  900|  95.1k|      if (!val)
  ------------------
  |  Branch (900:11): [True: 0, False: 95.1k]
  ------------------
  901|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  902|  95.1k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  903|  95.1k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (903:11): [True: 176, False: 94.9k]
  |  Branch (903:37): [True: 1.41k, False: 93.5k]
  |  Branch (903:63): [True: 182, False: 93.3k]
  ------------------
  904|  1.77k|        printNode(ns, xmp.tagName(), "", options);
  905|  1.77k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  906|  15.9k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (906:30): [True: 14.1k, False: 1.77k]
  ------------------
  907|  14.1k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  908|  14.1k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  909|  14.1k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  910|  14.1k|        }
  911|  1.77k|        continue;
  912|  1.77k|      }
  913|  93.3k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (913:11): [True: 93.3k, False: 0]
  ------------------
  914|  93.3k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  915|  93.3k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (915:13): [True: 8.14k, False: 85.2k]
  |  Branch (915:33): [True: 7.34k, False: 77.9k]
  |  Branch (915:72): [True: 2.28k, False: 75.6k]
  ------------------
  916|  17.7k|          printNode(ns, xmp.tagName(), "", options);
  917|  17.7k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  918|  75.6k|        } else {
  919|  75.6k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  920|  75.6k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  921|  75.6k|        }
  922|  93.3k|        continue;
  923|  93.3k|      }
  924|       |      // Don't let any Xmpdatum go by unnoticed
  925|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  926|  93.3k|    }
  927|  5.89k|    std::string tmpPacket;
  928|  5.89k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  929|  5.89k|                           padding);  // throws
  930|  5.89k|    xmpPacket = std::move(tmpPacket);
  931|       |
  932|  5.89k|    return 0;
  933|  5.89k|  }
  934|  43.6k|#ifndef SUPPRESS_WARNINGS
  935|  43.6k|  catch (const Error& /* e */) {
  936|      0|    throw;
  937|    252|  } catch (const XMP_Error& e) {
  938|    252|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    252|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 252]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    252|  LogMsg(LogMsg::error).os()
  ------------------
  939|    252|    return 3;
  940|    252|  }
  941|       |#else
  942|       |  catch (const XMP_Error&) {
  943|       |    return 3;
  944|       |  }
  945|       |#endif  // SUPPRESS_WARNINGS
  946|  43.6k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1108|   143k|                                                      const XmpProperties::XmpLock& lock) {
 1109|   143k|  std::string property;
 1110|   143k|  std::string::size_type idx = propPath.find(':');
 1111|   143k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1111:7): [True: 0, False: 143k]
  ------------------
 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|   143k|  property = propPath.substr(idx + 1);
 1116|   143k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1117|   143k|  if (prefix.empty()) {
  ------------------
  |  Branch (1117:7): [True: 46.3k, False: 97.6k]
  ------------------
 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|  46.3k|    std::string toolkitPrefix;
 1123|  46.3k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1123:9): [True: 46.3k, False: 0]
  ------------------
 1124|  46.3k|      toolkitPrefix.pop_back();
 1125|  46.3k|      prefix = std::move(toolkitPrefix);
 1126|  46.3k|    }
 1127|  46.3k|  }
 1128|   143k|  if (prefix.empty()) {
  ------------------
  |  Branch (1128:7): [True: 0, False: 143k]
  ------------------
 1129|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1130|      0|  }
 1131|   143k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1132|   143k|}  // makeXmpKey
_ZN5Exiv29XmpParser16resolveNamespaceERKNS_7XmpDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 1135|  96.4k|                                               const XmpProperties::XmpLock& lock) {
 1136|  96.4k|  const auto& nsBindings = xmpData.nsBindings();
 1137|  96.4k|  const auto binding = nsBindings.find(prefix);
 1138|  96.4k|  return binding != nsBindings.end() ? binding->second : XmpProperties::nsUnlocked(prefix, lock);
  ------------------
  |  Branch (1138:10): [True: 95.6k, False: 824]
  ------------------
 1139|  96.4k|}  // resolveNamespace
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  213|  26.8M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  214|  26.8M|    return key_ == xmpdatum.key();
  215|  26.8M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  207|  1.27M|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  208|  1.27M|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcmRKN5Exiv212DecodeParamsE:
   67|  11.0k|  static void check(const char* buf, size_t buflen, const DecodeParams& dp) {
   68|  11.0k|    XMLValidator validator(dp.max_recursion_depth());
   69|  11.0k|    validator.check_internal(buf, buflen);
   70|  11.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Em:
   79|  11.0k|      max_recursion_depth_(max_recursion_depth), parser_(XML_ParserCreateNS(nullptr, '@')) {
   80|  11.0k|    if (!parser_) {
  ------------------
  |  Branch (80:9): [True: 0, False: 11.0k]
  ------------------
   81|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   82|      0|    }
   83|  11.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  114|  11.0k|  void check_internal(const char* buf, size_t buflen) {
  115|  11.0k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (115:9): [True: 0, False: 11.0k]
  ------------------
  116|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  117|      0|    }
  118|       |
  119|  11.0k|    XML_SetUserData(parser_, this);
  120|  11.0k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  121|  11.0k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  122|  11.0k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  123|       |
  124|  11.0k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (124:9): [True: 2.68k, False: 8.34k]
  ------------------
  125|  2.68k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  126|  2.68k|    }
  127|       |
  128|  11.0k|    if (haserror_) {
  ------------------
  |  Branch (128:9): [True: 2.68k, False: 8.34k]
  ------------------
  129|  2.68k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  130|  2.68k|    }
  131|  11.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  170|   135k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  171|   135k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  172|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  133|   135k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  134|   135k|    if (element_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (134:9): [True: 10.2k, False: 125k]
  ------------------
  135|  10.2k|      setError("Too deeply nested");
  136|  10.2k|    }
  137|   135k|    ++element_depth_;
  138|   135k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  176|   107k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  177|   107k|    static_cast<XMLValidator*>(userData)->endElement(name);
  178|   107k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  140|   107k|  void endElement(const XML_Char*) noexcept {
  141|   107k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (141:9): [True: 107k, False: 0]
  ------------------
  142|   107k|      --element_depth_;
  143|   107k|    } else {
  144|      0|      setError("Negative depth");
  145|      0|    }
  146|   107k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  182|  59.3k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  183|  59.3k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  184|  59.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  148|  59.3k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  149|  59.3k|    if (namespace_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (149:9): [True: 225, False: 59.1k]
  ------------------
  150|    225|      setError("Too deeply nested");
  151|    225|    }
  152|  59.3k|    ++namespace_depth_;
  153|  59.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  188|  50.7k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  189|  50.7k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  190|  50.7k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  155|  50.7k|  void endNamespace(const XML_Char*) noexcept {
  156|  50.7k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (156:9): [True: 50.7k, False: 0]
  ------------------
  157|  50.7k|      --namespace_depth_;
  158|  50.7k|    } else {
  159|      0|      setError("Negative depth");
  160|      0|    }
  161|  50.7k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  193|     44|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  194|     44|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  195|     44|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  163|     44|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  164|       |    // DOCTYPE is used for XXE attacks.
  165|     44|    setError("DOCTYPE not supported");
  166|     44|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   89|  13.2k|  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|  13.2k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   99|  13.2k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
  100|  13.2k|#endif
  101|       |
  102|  13.2k|#ifndef SUPPRESS_WARNINGS
  103|  13.2k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  13.2k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 13.2k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  13.2k|  LogMsg(LogMsg::info).os()
  ------------------
  104|  13.2k|#endif
  105|       |    // If this is the first error, then save it.
  106|  13.2k|    if (!haserror_) {
  ------------------
  |  Branch (106:9): [True: 2.68k, False: 10.5k]
  ------------------
  107|  2.68k|      haserror_ = true;
  108|  2.68k|      errmsg_ = msg;
  109|  2.68k|      errlinenum_ = errlinenum;
  110|  2.68k|      errcolnum_ = errcolnum;
  111|  2.68k|    }
  112|  13.2k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   85|  11.0k|  ~XMLValidator() {
   86|  11.0k|    XML_ParserFree(parser_);
   87|  11.0k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  965|  12.6k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  966|  12.6k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  967|  12.6k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (967:7): [True: 12.0k, False: 561]
  ------------------
  968|  12.0k|    var = Exiv2::XmpValue::xsStruct;
  969|  12.0k|  }
  970|  12.6k|  return var;
  971|  12.6k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  973|  95.1k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  974|  95.1k|  XMP_OptionBits var(0);
  975|  95.1k|  switch (xs) {
  ------------------
  |  Branch (975:11): [True: 95.1k, False: 0]
  ------------------
  976|  87.8k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (976:5): [True: 87.8k, False: 7.34k]
  ------------------
  977|  87.8k|      break;
  978|  7.34k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (978:5): [True: 7.34k, False: 87.8k]
  ------------------
  979|  7.34k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  980|  7.34k|      break;
  981|  95.1k|  }
  982|  95.1k|  return var;
  983|  95.1k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  985|  15.1k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  986|  15.1k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  987|  15.1k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (987:7): [True: 3.08k, False: 12.0k]
  ------------------
  988|  3.08k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (988:9): [True: 486, False: 2.59k]
  ------------------
  989|    486|      typeId = Exiv2::xmpAlt;
  990|  2.59k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (990:14): [True: 2.24k, False: 356]
  ------------------
  991|  2.24k|      typeId = Exiv2::xmpSeq;
  992|    356|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (992:14): [True: 356, False: 0]
  ------------------
  993|    356|      typeId = Exiv2::xmpBag;
  994|  3.08k|  }
  995|  15.1k|  return typeId;
  996|  15.1k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  998|  12.6k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  999|  12.6k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
 1000|  12.6k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
 1002|  95.1k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
 1003|  95.1k|  XMP_OptionBits var(0);
 1004|  95.1k|  switch (xat) {
  ------------------
  |  Branch (1004:11): [True: 95.1k, False: 0]
  ------------------
 1005|  91.1k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (1005:5): [True: 91.1k, False: 4.06k]
  ------------------
 1006|  91.1k|      break;
 1007|    230|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (1007:5): [True: 230, False: 94.9k]
  ------------------
 1008|    230|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1009|    230|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
 1010|    230|      break;
 1011|  3.63k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (1011:5): [True: 3.63k, False: 91.5k]
  ------------------
 1012|  3.63k|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1013|  3.63k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
 1014|  3.63k|      break;
 1015|    194|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (1015:5): [True: 194, False: 94.9k]
  ------------------
 1016|    194|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1017|    194|      break;
 1018|  95.1k|  }
 1019|  95.1k|  return var;
 1020|  95.1k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
 1026|  5.64k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
 1027|  5.64k|  XMP_OptionBits var(0);
 1028|  5.64k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (1028:7): [True: 2.11k, False: 3.53k]
  ------------------
 1029|  2.11k|    var |= kXMP_OmitPacketWrapper;
 1030|  5.64k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (1030:7): [True: 0, False: 5.64k]
  ------------------
 1031|      0|    var |= kXMP_ReadOnlyPacket;
 1032|  5.64k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1032:7): [True: 5.64k, False: 0]
  ------------------
 1033|  5.64k|    var |= kXMP_UseCompactFormat;
 1034|  5.64k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1034:7): [True: 0, False: 5.64k]
  ------------------
 1035|      0|    var |= kXMP_IncludeThumbnailPad;
 1036|  5.64k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1036:7): [True: 0, False: 5.64k]
  ------------------
 1037|      0|    var |= kXMP_ExactPacketLength;
 1038|  5.64k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1038:7): [True: 0, False: 5.64k]
  ------------------
 1039|      0|    var |= kXMP_WriteAliasComments;
 1040|  5.64k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1040:7): [True: 31, False: 5.61k]
  ------------------
 1041|     31|    var |= kXMP_OmitAllFormatting;
 1042|  5.64k|  return var;
 1043|  5.64k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1101|   309k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1102|   309k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  256|   560k|  ~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.78k|    Image(ImageType::xmp, mdXmp, std::move(io), params) {
   31|  3.78k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (31:7): [True: 0, False: 3.78k]
  |  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.78k|}  // XmpSidecar::XmpSidecar
_ZN5Exiv210XmpSidecar12readMetadataEv:
   46|  3.78k|void XmpSidecar::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   49|       |#endif
   50|  3.78k|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 3.78k]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|  3.78k|  IoCloser closer(*io_);
   54|       |  // Ensure that this is the correct image type
   55|  3.78k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.78k]
  ------------------
   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.78k|  std::string xmpPacket;
   62|  3.78k|  const long len = 64 * 1024;
   63|  3.78k|  auto buf = std::make_unique<byte[]>(len);
   64|  8.52k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (64:15): [True: 4.74k, False: 3.78k]
  ------------------
   65|  4.74k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   66|  4.74k|  }
   67|  3.78k|  if (io_->error())
  ------------------
  |  Branch (67:7): [True: 0, False: 3.78k]
  ------------------
   68|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   69|  3.78k|  clearMetadata();
   70|  3.78k|  xmpPacket_ = std::move(xmpPacket);
   71|  3.78k|  const DecodeParams dp(max_recursion_depth_);
   72|  3.78k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (72:7): [True: 3.77k, False: 1]
  |  Branch (72:30): [True: 495, False: 3.28k]
  ------------------
   73|    495|#ifndef SUPPRESS_WARNINGS
   74|    495|    EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|    495|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 495]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    495|  LogMsg(LogMsg::warn).os()
  ------------------
   75|    495|#endif
   76|    495|  }
   77|       |
   78|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   79|  29.0k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (79:24): [True: 29.0k, False: 3.78k]
  ------------------
   80|  29.0k|    std::string key(xmp.key());
   81|  29.0k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (81:9): [True: 1.89k, False: 27.1k]
  ------------------
   82|  1.89k|      dates_[key] = xmp.value().toString();
   83|  1.89k|    }
   84|  29.0k|  }
   85|       |
   86|  3.78k|  copyXmpToIptc(xmpData_, iptcData_);
   87|  3.78k|  copyXmpToExif(xmpData_, exifData_);
   88|  3.78k|}  // XmpSidecar::readMetadata
_ZN5Exiv210XmpSidecar13writeMetadataEv:
   94|  3.47k|void XmpSidecar::writeMetadata() {
   95|  3.47k|  if (io_->open() != 0) {
  ------------------
  |  Branch (95:7): [True: 0, False: 3.47k]
  ------------------
   96|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   97|      0|  }
   98|  3.47k|  IoCloser closer(*io_);
   99|       |
  100|  3.47k|  if (!writeXmpFromPacket()) {
  ------------------
  |  Branch (100:7): [True: 3.47k, False: 0]
  ------------------
  101|       |    // #589 copy XMP tags
  102|  3.47k|    Exiv2::XmpData copy;
  103|  28.9k|    for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (103:26): [True: 28.9k, False: 3.47k]
  ------------------
  104|  28.9k|      if (!matchi(xmp.key(), "exif") && !matchi(xmp.key(), "iptc")) {
  ------------------
  |  Branch (104:11): [True: 28.0k, False: 944]
  |  Branch (104:11): [True: 27.9k, False: 1.03k]
  |  Branch (104:41): [True: 27.9k, False: 88]
  ------------------
  105|  27.9k|        copy[xmp.key()] = xmp.value();
  106|  27.9k|      }
  107|  28.9k|    }
  108|       |
  109|       |    // run the converters
  110|  3.47k|    copyExifToXmp(exifData_, xmpData_);
  111|  3.47k|    copyIptcToXmp(iptcData_, xmpData_);
  112|       |
  113|       |    // #1112 - restore dates if they lost their TZ info
  114|  3.47k|    for (const auto& [sKey, value_orig] : dates_) {
  ------------------
  |  Branch (114:41): [True: 1.88k, False: 3.47k]
  ------------------
  115|  1.88k|      Exiv2::XmpKey key(sKey);
  116|  1.88k|      if (xmpData_.findKey(key) != xmpData_.end()) {
  ------------------
  |  Branch (116:11): [True: 1.88k, False: 1]
  ------------------
  117|  1.88k|        std::string value_now(xmpData_[sKey].value().toString());
  118|       |        // std::cout << key << " -> " << value_now << " => " << value_orig << '\n';
  119|  1.88k|        if (Internal::contains(value_orig, value_now.substr(0, 10))) {
  ------------------
  |  Branch (119:13): [True: 1.69k, False: 184]
  ------------------
  120|  1.69k|          xmpData_[sKey] = value_orig;
  121|  1.69k|        }
  122|  1.88k|      }
  123|  1.88k|    }
  124|       |
  125|       |    // #589 - restore tags which were modified by the converters
  126|  27.5k|    for (const auto& xmp : copy) {
  ------------------
  |  Branch (126:26): [True: 27.5k, False: 3.47k]
  ------------------
  127|  27.5k|      xmpData_[xmp.key()] = xmp.value();
  128|  27.5k|    }
  129|       |
  130|  3.47k|    if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::omitPacketWrapper | XmpParser::useCompactFormat) > 1) {
  ------------------
  |  Branch (130:9): [True: 118, False: 3.35k]
  ------------------
  131|    118|#ifndef SUPPRESS_WARNINGS
  132|    118|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|    118|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 118]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    118|  LogMsg(LogMsg::error).os()
  ------------------
  133|    118|#endif
  134|    118|    }
  135|  3.47k|  }
  136|  3.47k|  if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (136:7): [True: 2.22k, False: 1.24k]
  ------------------
  137|  2.22k|    if (!xmpPacket_.starts_with("<?xml")) {
  ------------------
  |  Branch (137:9): [True: 2.22k, False: 5]
  ------------------
  138|  2.22k|      xmpPacket_ = xmlHeader + xmpPacket_ + xmlFooter;
  139|  2.22k|    }
  140|  2.22k|    MemIo tempIo;
  141|       |
  142|       |    // Write XMP packet
  143|  2.22k|    if (tempIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (143:9): [True: 0, False: 2.22k]
  ------------------
  144|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  145|  2.22k|    if (tempIo.error())
  ------------------
  |  Branch (145:9): [True: 0, False: 2.22k]
  ------------------
  146|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  147|  2.22k|    io_->close();
  148|  2.22k|    io_->transfer(tempIo);  // may throw
  149|  2.22k|  }
  150|  3.47k|}  // XmpSidecar::writeMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  154|  3.78k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  155|  3.78k|  auto image = std::make_unique<XmpSidecar>(std::move(io), params);
  156|  3.78k|  if (!image->good()) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.78k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  3.78k|  return image;
  160|  3.78k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  162|  37.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|  37.2k|  const int32_t len = 80;
  171|  37.2k|  byte buf[len];
  172|  37.2k|  iIo.read(buf, xmlHdrCnt + 1);
  173|  37.2k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (173:7): [True: 476, False: 36.8k]
  |  Branch (173:20): [True: 3, False: 473]
  ------------------
  174|      3|    return true;
  175|      3|  }
  176|  37.2k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (176:7): [True: 0, False: 37.2k]
  |  Branch (176:22): [True: 473, False: 36.8k]
  ------------------
  177|    473|    return false;
  178|    473|  }
  179|  36.8k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  180|  36.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (180:7): [True: 0, False: 36.8k]
  |  Branch (180:22): [True: 107, False: 36.7k]
  ------------------
  181|    107|    return false;
  182|    107|  }
  183|       |  // Skip leading BOM
  184|  36.7k|  int32_t start = 0;
  185|  36.7k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (185:7): [True: 223, False: 36.4k]
  ------------------
  186|    223|    start = 3;
  187|    223|  }
  188|  36.7k|  bool rc = false;
  189|  36.7k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  190|  36.7k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (190:7): [True: 226, False: 36.4k]
  ------------------
  191|       |    // Forward to the next tag
  192|    226|    auto it = std::find(head.begin() + 5, head.end(), '<');
  193|    226|    if (it != head.end())
  ------------------
  |  Branch (193:9): [True: 191, False: 35]
  ------------------
  194|    191|      head = head.substr(std::distance(head.begin(), it));
  195|    226|  }
  196|  36.7k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (196:7): [True: 3.98k, False: 32.7k]
  |  Branch (196:40): [True: 7.35k, False: 25.3k]
  ------------------
  197|  11.3k|    rc = true;
  198|  11.3k|  }
  199|  36.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (199:7): [True: 36.7k, False: 0]
  |  Branch (199:19): [True: 0, False: 0]
  ------------------
  200|  36.7k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  201|  36.7k|  }
  202|  36.7k|  return rc;
  203|  36.8k|}
xmpsidecar.cpp:_ZN5Exiv2L6matchiERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKc:
   90|  56.9k|static bool matchi(const std::string& key, const char* substr) {
   91|  56.9k|  return Internal::contains(Internal::lower(key), substr);
   92|  56.9k|}

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  7.52k|{
  625|  7.52k|	IgnoreParam(options);
  ------------------
  |  |  117|  7.52k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  7.52k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  7.52k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  7.52k|{
  647|       |
  648|  7.52k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     40|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 40, False: 7.48k]
  ------------------
  649|  7.48k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  7.48k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  7.48k|{
  664|  7.48k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  7.48k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  7.48k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  7.48k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  35.0k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 27.5k, False: 7.48k]
  ------------------
  670|  27.5k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 20.0k, False: 7.52k]
  ------------------
  671|  7.52k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  7.52k|	}
  673|       |
  674|  7.48k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  13.2k|{
  695|  13.2k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  13.2k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 5.71k, False: 7.51k]
  |  Branch (696:45): [True: 16, False: 5.69k]
  ------------------
  697|     16|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     16|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  13.2k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 7.51k, False: 5.69k]
  |  Branch (700:21): [True: 181, False: 7.33k]
  ------------------
  701|    181|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    181|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  13.0k|	} else {
  703|  13.0k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  13.0k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  13.0k|	}
  706|       |
  707|  13.2k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   273k|{
  265|   273k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   273k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 272k, False: 837]
  |  Branch (269:28): [True: 88.1k, False: 184k]
  ------------------
  270|       |
  271|  88.1k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 54.4k, False: 33.6k]
  ------------------
  272|  54.4k|			term = kRDFTerm_li;
  273|  54.4k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 20, False: 33.6k]
  ------------------
  274|     20|			term = kRDFTerm_parseType;
  275|  33.6k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 7.54k, False: 26.0k]
  ------------------
  276|  7.54k|			term = kRDFTerm_Description;
  277|  26.0k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.25k, False: 24.8k]
  ------------------
  278|  1.25k|			term = kRDFTerm_about;
  279|  24.8k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 74, False: 24.7k]
  ------------------
  280|     74|			term = kRDFTerm_resource;
  281|  24.7k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 28, False: 24.7k]
  ------------------
  282|     28|			term = kRDFTerm_RDF;
  283|  24.7k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 212, False: 24.4k]
  ------------------
  284|    212|			term = kRDFTerm_ID;
  285|  24.4k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 121, False: 24.3k]
  ------------------
  286|    121|			term = kRDFTerm_nodeID;
  287|  24.3k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 10, False: 24.3k]
  ------------------
  288|     10|			term = kRDFTerm_datatype;
  289|  24.3k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 20, False: 24.3k]
  ------------------
  290|     20|			term = kRDFTerm_aboutEach;
  291|  24.3k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 10, False: 24.3k]
  ------------------
  292|     10|			term = kRDFTerm_aboutEachPrefix;
  293|  24.3k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 22, False: 24.3k]
  ------------------
  294|     22|			term = kRDFTerm_bagID;
  295|     22|		}
  296|       |
  297|  88.1k|	}
  298|       |
  299|   273k|	return term;
  300|       |
  301|   273k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  13.0k|{
  732|  13.0k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  13.0k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  13.0k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  38.1k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 25.4k, False: 12.6k]
  ------------------
  738|       |
  739|  25.4k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  25.4k|		switch ( attrTerm ) {
  742|       |
  743|    116|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 116, False: 25.3k]
  ------------------
  744|    185|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 69, False: 25.4k]
  ------------------
  745|  1.44k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.25k, False: 24.2k]
  ------------------
  746|       |
  747|  1.44k|				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: 1.42k]
  ------------------
  748|  1.42k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.42k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.32k, False: 98]
  |  Branch (750:24): [True: 1.24k, False: 78]
  ------------------
  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.24k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.24k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.24k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.11k, False: 138]
  ------------------
  755|  1.11k|						xmpParent->name = (*currAttr)->value;
  756|  1.11k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 137, False: 1]
  ------------------
  757|    137|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     80|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 80, False: 57]
  ------------------
  758|     57|					}
  759|  1.24k|				}
  760|       |
  761|  1.34k|				break;
  762|       |
  763|  23.9k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 23.9k, False: 1.50k]
  ------------------
  764|  23.9k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  23.9k|				break;
  766|       |
  767|     63|			default :
  ------------------
  |  Branch (767:4): [True: 63, False: 25.4k]
  ------------------
  768|     63|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     63|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  25.4k|		}
  771|       |
  772|  25.4k|	}
  773|       |
  774|  13.0k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   128k|{
  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|   128k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 327, False: 128k]
  ------------------
  371|    327|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    327|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   128k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   128k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   128k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   128k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   128k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 34.4k, False: 93.8k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  34.4k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  34.4k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  34.4k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  34.4k|#define kXMP_CreateNodes	true
  ------------------
  384|  34.4k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  34.4k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  17.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 17.1k, False: 17.2k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  34.4k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  34.4k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 34.4k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  34.4k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   128k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 73.6k, False: 54.6k]
  ------------------
  398|  73.6k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  73.6k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 50, False: 73.5k]
  ------------------
  399|     50|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     50|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  73.6k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   128k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   128k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 127k, False: 250]
  |  Branch (406:26): [True: 150, False: 100]
  ------------------
  407|   128k|		 xmpParent->children.push_back ( newChild );
  408|   128k|	} else {
  409|    120|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|    120|	}
  411|   128k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 250, False: 127k]
  ------------------
  412|    250|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 21, False: 229]
  |  Branch (412:22): [True: 0, False: 229]
  ------------------
  413|    229|		xmpParent->options |= kRDF_HasValueElem;
  414|    229|	}
  415|       |	
  416|   128k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 54.3k, False: 73.8k]
  ------------------
  417|  54.3k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 10, False: 54.3k]
  ------------------
  418|  54.3k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  54.3k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  54.3k|	}
  423|       |	
  424|   128k|	return newChild;
  425|       |
  426|   128k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  12.9k|{
  787|  12.9k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  12.9k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   223k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 210k, False: 12.8k]
  ------------------
  791|   210k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 142k, False: 68.2k]
  ------------------
  792|  68.2k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 131, False: 68.0k]
  ------------------
  793|    131|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    131|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  68.0k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  68.0k|	}
  797|       |
  798|  12.9k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  68.0k|{
  854|  68.0k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  68.0k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     46|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 46, False: 68.0k]
  ------------------
  856|       |	
  857|  68.0k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 6.46k, False: 61.5k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  6.46k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  61.5k|	} else {
  863|       |
  864|       |		// Look through the attributes for one that isn't rdf:ID or xml:lang, it will usually tell
  865|       |		// what we should be dealing with. The called routines must verify their specific syntax!
  866|       |
  867|  61.5k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  61.5k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  61.5k|		XMP_VarString * attrName = 0;
  870|       |
  871|  83.3k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 30.9k, False: 52.3k]
  ------------------
  872|  30.9k|			attrName = &((*currAttr)->name);
  873|  30.9k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 9.27k, False: 21.7k]
  |  Branch (873:38): [True: 9.20k, False: 69]
  ------------------
  874|  30.9k|		}
  875|       |
  876|  61.5k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 9.20k, False: 52.3k]
  ------------------
  877|       |
  878|  9.20k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  9.20k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  9.20k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  9.20k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 124, False: 9.08k]
  ------------------
  882|    124|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  9.08k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 8.66k, False: 414]
  ------------------
  884|  8.66k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  8.66k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 6, False: 408]
  ------------------
  886|      6|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    408|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 300, False: 108]
  ------------------
  888|    300|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    300|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 10, False: 98]
  ------------------
  890|     10|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     98|			} else {
  892|     98|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     98|			}
  894|       |
  895|  52.3k|		} else {
  896|       |
  897|       |			// Only rdf:ID and xml:lang, could be a resourcePropertyElt, a literalPropertyElt, or an.
  898|       |			// emptyPropertyElt. Look at the child XML nodes to decide which.
  899|       |
  900|  52.3k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 1.10k, False: 51.2k]
  ------------------
  901|       |
  902|  1.10k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  51.2k|			} else {
  905|       |			
  906|  51.2k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  51.2k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  2.34M|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 2.29M, False: 45.4k]
  ------------------
  910|  2.29M|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 5.82k, False: 2.29M]
  ------------------
  911|  2.29M|				}
  912|       |				
  913|  51.2k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 45.4k, False: 5.82k]
  ------------------
  914|  45.4k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  45.4k|				} else {
  916|  5.82k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  5.82k|				}
  918|       |			
  919|  51.2k|			}
  920|       |
  921|  52.3k|		}
  922|       |		
  923|  61.5k|	}
  924|       |
  925|  68.0k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  68.0k|{
  350|       |
  351|  68.0k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 23, False: 68.0k]
  |  Branch (351:42): [True: 1, False: 68.0k]
  ------------------
  352|  68.0k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  68.0k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  68.0k|{
  334|       |
  335|  68.0k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 1, False: 68.0k]
  |  Branch (335:39): [True: 1, False: 0]
  ------------------
  336|  68.0k|	return false;
  337|       |
  338|  68.0k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  68.0k|{
  317|       |
  318|  68.0k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 54.4k, False: 13.5k]
  |  Branch (318:40): [True: 22, False: 54.4k]
  ------------------
  319|  68.0k|	return false;
  320|       |
  321|  68.0k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  16.2k|{
 1190|  16.2k|	bool hasPropertyAttrs = false;
 1191|  16.2k|	bool hasResourceAttr  = false;
 1192|  16.2k|	bool hasNodeIDAttr    = false;
 1193|  16.2k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  16.2k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  16.2k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     67|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 67, False: 16.1k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  16.1k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  16.1k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   100k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 84.6k, False: 16.0k]
  ------------------
 1205|       |
 1206|  84.6k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  84.6k|		switch ( attrTerm ) {
 1209|       |
 1210|     48|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 48, False: 84.5k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     48|				break;
 1213|       |
 1214|     74|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 74, False: 84.5k]
  ------------------
 1215|     74|				if ( hasNodeIDAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1215:10): [True: 10, False: 64]
  ------------------
 1216|     64|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 21, False: 43]
  ------------------
 1217|     43|				hasResourceAttr = true;
 1218|     43|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 43, False: 0]
  ------------------
 1219|     43|				break;
 1220|       |
 1221|     36|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 36, False: 84.5k]
  ------------------
 1222|     36|				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: 26]
  ------------------
 1223|     26|				hasNodeIDAttr = true;
 1224|     26|				break;
 1225|       |
 1226|  84.4k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 84.4k, False: 187]
  ------------------
 1227|  84.4k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 2.23k, False: 82.1k]
  ------------------
 1228|  2.23k|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 10, False: 2.22k]
  ------------------
 1229|  2.22k|					hasValueAttr = true;
 1230|  2.22k|					valueNode = *currAttr;
 1231|  82.1k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 81.5k, False: 664]
  ------------------
 1232|  81.5k|					hasPropertyAttrs = true;
 1233|  81.5k|				}
 1234|  84.4k|				break;
 1235|       |
 1236|  84.4k|			default :
  ------------------
  |  Branch (1236:4): [True: 29, False: 84.5k]
  ------------------
 1237|     29|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     29|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  84.6k|		}
 1241|       |
 1242|  84.6k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  16.0k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  16.0k|	bool childIsStruct = false;
 1250|       |	
 1251|  16.0k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 2.22k, False: 13.8k]
  ------------------
 1252|  2.22k|		childNode->value = valueNode->value;
 1253|  2.22k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 23, False: 2.20k]
  ------------------
 1254|  13.8k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 12.6k, False: 1.16k]
  ------------------
 1255|  12.6k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  12.6k|		childIsStruct = true;
 1257|  12.6k|	}
 1258|       |		
 1259|  16.0k|	currAttr = xmlNode.attrs.begin();
 1260|  16.0k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   100k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 84.2k, False: 15.9k]
  ------------------
 1263|       |
 1264|  84.2k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 2.21k, False: 82.0k]
  ------------------
 1265|  82.0k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  82.0k|		switch ( attrTerm ) {
 1268|       |
 1269|     48|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 48, False: 82.0k]
  ------------------
 1270|     64|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 16, False: 82.0k]
  ------------------
 1271|     64|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 82.0k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  81.9k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 81.9k, False: 64]
  ------------------
 1278|  81.9k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 45.1k, False: 36.8k]
  |  Branch (1278:31): [True: 52, False: 36.8k]
  ------------------
 1279|  45.1k|					AddQualifierNode ( childNode, **currAttr );
 1280|  45.1k|				} else {
 1281|  36.8k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  36.8k|				}
 1283|  81.9k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 82.0k]
  ------------------
 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|  82.0k|		}
 1290|       |
 1291|  82.0k|	}
 1292|       |
 1293|  16.0k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  66.2k|{
  484|  66.2k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 23, False: 66.2k]
  ------------------
  485|     23|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     23|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  66.2k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  66.2k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  66.6k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  66.6k|	const bool isLang = (name == "xml:lang");
  443|  66.6k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  66.6k|	XMP_Node * newQual = 0;
  446|       |
  447|  66.6k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  66.6k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 44.4k, False: 22.1k]
  ------------------
  450|  44.4k|			xmpParent->qualifiers.push_back ( newQual );
  451|  44.4k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 21.7k, False: 438]
  ------------------
  452|  21.7k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 21.7k, False: 36]
  ------------------
  453|  21.7k|				xmpParent->qualifiers.push_back ( newQual );
  454|  21.7k|			} else {
  455|     36|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     36|			}
  457|  21.7k|			xmpParent->options |= kXMP_PropHasLang;
  458|  21.7k|		} else {
  459|    438|			XMP_Assert ( isType );
  ------------------
  |  |  142|    438|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    438|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 293, False: 145]
  ------------------
  461|    293|				xmpParent->qualifiers.push_back ( newQual );
  462|    293|			} else {
  463|    145|				size_t offset = 0;
  464|    145|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 102, False: 43]
  ------------------
  465|    145|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|    145|			}
  467|    438|			xmpParent->options |= kXMP_PropHasType;
  468|    438|		}
  469|       |
  470|  66.6k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  66.6k|	return newQual;
  473|       |
  474|  66.6k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  45.5k|{
 1015|  45.5k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  45.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  45.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  66.6k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 21.1k, False: 45.5k]
  ------------------
 1021|  21.1k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  21.1k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 20.9k, False: 235]
  ------------------
 1023|  20.9k|			AddQualifierNode ( newChild, **currAttr );
 1024|  20.9k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 40, False: 195]
  |  Branch (1024:41): [True: 124, False: 71]
  ------------------
 1025|    164|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|    164|		} else {
 1027|     71|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     71|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  21.1k|	}
 1030|       |	
 1031|  45.5k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  45.5k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  45.5k|	size_t      textSize  = 0;
 1034|       |
 1035|  2.32M|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 2.27M, False: 45.4k]
  ------------------
 1036|  2.27M|		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.27M]
  ------------------
 1037|  2.27M|		textSize += (*currChild)->value.size();
 1038|  2.27M|	}
 1039|       |	
 1040|  45.4k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  2.32M|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 2.27M, False: 45.4k]
  ------------------
 1043|  2.27M|		newChild->value += (*currChild)->value;
 1044|  2.27M|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  45.4k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|      6|{
 1065|      6|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|      6|#define IgnoreParam(p)	(void)p
  ------------------
 1066|       |	
 1067|      6|	XMP_Throw ( "ParseTypeLiteral property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1068|       |
 1069|      0|}	// RDF_ParseTypeLiteralPropertyElement
ParseRDF.cpp:_ZL36RDF_ParseTypeResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
 1086|    300|{
 1087|       |
 1088|    300|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    300|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    300|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    300|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    600|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 300, False: 300]
  ------------------
 1095|    300|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    300|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 300, False: 0]
  ------------------
 1097|    300|			continue;	// ! The caller ensured the value is "Resource".
 1098|    300|		} 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|    300|	}
 1106|       |
 1107|    300|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    300|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 300]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    300|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL18FixupQualifiedNodeP8XMP_Node:
  504|    206|{
  505|    206|	size_t qualNum, qualLim;
  506|    206|	size_t childNum, childLim;
  507|       |
  508|    206|	XMP_Enforce ( (xmpParent->options & kXMP_PropValueIsStruct) && (! xmpParent->children.empty()) );
  ------------------
  |  |  148|    412|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:11): [True: 206, False: 0]
  |  |  |  Branch (148:11): [True: 206, 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|    206|	XMP_Node * valueNode = xmpParent->children[0];
  511|    206|	XMP_Enforce ( valueNode->name == "rdf:value" );
  ------------------
  |  |  148|    206|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 206]
  |  |  ------------------
  |  |  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|    206|	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|    206|	qualNum = 0;
  521|    206|	qualLim = valueNode->qualifiers.size();
  522|       |	
  523|    206|	if ( valueNode->options & kXMP_PropHasLang ) {
  ------------------
  |  Branch (523:7): [True: 0, False: 206]
  ------------------
  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|    206|	for ( ; qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (544:10): [True: 0, False: 206]
  ------------------
  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|    206|	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|  1.08k|	for ( childNum = 1, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (562:61): [True: 903, False: 185]
  ------------------
  563|       |
  564|    903|		XMP_Node * currQual = xmpParent->children[childNum];
  565|       |	
  566|    903|			bool isLang = (currQual->name == "xml:lang");
  567|       |			
  568|    903|			currQual->options |= kXMP_PropIsQualifier;
  569|    903|			currQual->parent = xmpParent;
  570|       |
  571|    903|			if ( isLang ) {
  ------------------
  |  Branch (571:9): [True: 73, False: 830]
  ------------------
  572|     73|				if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Duplicate xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (572:10): [True: 21, False: 52]
  ------------------
  573|     52|				xmpParent->options |= kXMP_PropHasLang;
  574|    830|			} else if ( currQual->name == "rdf:type" ) {
  ------------------
  |  Branch (574:16): [True: 18, False: 812]
  ------------------
  575|     18|				xmpParent->options |= kXMP_PropHasType;
  576|     18|			}
  577|       |
  578|    882|			if ( (! isLang) || xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (578:9): [True: 830, False: 52]
  |  Branch (578:23): [True: 5, False: 47]
  ------------------
  579|    835|				xmpParent->qualifiers.push_back ( currQual );
  580|    835|			} else {
  581|     47|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), currQual );
  582|     47|			}
  583|    882|			xmpParent->children[childNum] = 0;	// We just moved it to the qualifers.
  584|       |		
  585|    882|	}
  586|       |	
  587|    185|	if ( ! xmpParent->qualifiers.empty() ) xmpParent->options |= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (587:7): [True: 185, 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|    185|	XMP_Assert ( xmpParent->options & (kXMP_PropValueIsStruct | kRDF_HasValueElem) );
  ------------------
  |  |  142|    185|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|    185|	xmpParent->options &= ~ (static_cast<unsigned long>(kXMP_PropValueIsStruct) | static_cast<unsigned long>(kRDF_HasValueElem));
  594|    185|	xmpParent->options |= valueNode->options;
  595|       |	
  596|    185|	xmpParent->value.swap ( valueNode->value );
  597|       |	#if 0	// *** XMP_DebugBuild
  598|       |		xmpParent->_valuePtr = xmpParent->value.c_str();
  599|       |	#endif
  600|       |
  601|    185|	xmpParent->children[0] = 0;	// ! Remove the value node itself before the swap.
  602|    185|	xmpParent->children.swap ( valueNode->children );
  603|       |	
  604|    185|	for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (604:68): [True: 0, False: 185]
  ------------------
  605|      0|		XMP_Node * currChild = xmpParent->children[childNum];
  606|      0|		currChild->parent = xmpParent;
  607|      0|	}
  608|       |
  609|    185|	delete valueNode;
  610|       |	
  611|    185|}	// 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|     98|{
 1147|     98|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     98|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     98|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     98|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     98|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     98|#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.82k|{
  943|  5.82k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 5.07k, False: 750]
  |  Branch (943:21): [True: 0, False: 5.07k]
  ------------------
  944|       |	
  945|  5.82k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  5.82k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  5.82k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  6.01k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 190, False: 5.82k]
  ------------------
  951|    190|		XMP_VarString & attrName = (*currAttr)->name;
  952|    190|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 179, False: 11]
  ------------------
  953|    179|			AddQualifierNode ( newCompound, **currAttr );
  954|    179|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 11, False: 0]
  ------------------
  955|     11|			continue;	// Ignore all rdf:ID attributes.
  956|     11|		} 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|    190|	}
  960|       |	
  961|  5.82k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  5.82k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  19.0k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 19.0k, False: 0]
  ------------------
  965|  19.0k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 5.82k, False: 13.2k]
  ------------------
  966|  19.0k|	}
  967|  5.82k|	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.82k]
  ------------------
  968|  5.82k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|    102|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 102, False: 5.72k]
  ------------------
  969|       |
  970|  5.72k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 158, False: 5.56k]
  ------------------
  971|    158|		newCompound->options |= kXMP_PropValueIsArray;
  972|  5.56k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.53k, False: 3.02k]
  ------------------
  973|  2.53k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  3.02k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 2.43k, False: 593]
  ------------------
  975|  2.43k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  2.43k|	} else {
  977|    593|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    593|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 408, False: 185]
  ------------------
  979|    408|			XMP_VarString typeName ( (*currChild)->ns );
  980|    408|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    408|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     25|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 25, False: 383]
  ------------------
  982|    383|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    383|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    383|		}
  985|    593|	}
  986|       |
  987|  5.70k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  5.70k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 206, False: 5.49k]
  ------------------
  989|    206|		FixupQualifiedNode ( newCompound );
  990|  5.49k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.97k, False: 3.52k]
  ------------------
  991|  1.97k|		DetectAltText ( newCompound );
  992|  1.97k|	}
  993|       |
  994|  15.3k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 9.78k, False: 5.53k]
  ------------------
  995|  9.78k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    168|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 168, False: 9.61k]
  ------------------
  996|  9.61k|	}
  997|       |
  998|  5.70k|}	// RDF_ResourcePropertyElement

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

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   885k|{
   88|       |
   89|   885k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   885k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   885k|	const XMP_Uns8 * namePos   = nameStart;
   92|   885k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   885k|	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: 885k]
  ------------------
   97|       |
   98|   885k|	cp = *namePos;
   99|   885k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 883k, False: 1.72k]
  ------------------
  100|   883k|		++namePos;
  101|   883k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 883k]
  ------------------
  102|   883k|	} else {
  103|  1.72k|		cp = GetCodePoint ( &namePos );
  104|  1.72k|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 1.72k]
  ------------------
  105|  1.72k|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|   123M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 122M, False: 885k]
  ------------------
  110|   122M|		cp = *namePos;
  111|   122M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 122M, False: 89.0k]
  ------------------
  112|   122M|			++namePos;
  113|   122M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 973k, False: 121M]
  |  Branch (113:38): [True: 0, False: 973k]
  ------------------
  114|   122M|		} else {
  115|  89.0k|			cp = GetCodePoint ( &namePos );
  116|  89.0k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 57.7k, False: 31.2k]
  |  Branch (116:41): [True: 0, False: 57.7k]
  ------------------
  117|  89.0k|		}
  118|   122M|	}
  119|       |
  120|   885k|	return;
  121|       |
  122|   885k|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|   123M|{
   32|       |	// ASCII starting characters for an XML name.
   33|   123M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 92.9M, False: 30.7M]
  |  Branch (33:23): [True: 92.9M, False: 0]
  |  Branch (33:40): [True: 29.7M, False: 973k]
  |  Branch (33:55): [True: 29.1M, False: 576k]
  |  Branch (33:71): [True: 576k, False: 973k]
  ------------------
   34|   973k|	return false;
   35|   123M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  90.7k|{
   20|  90.7k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  90.7k|	XMP_Uns32 cp;
   22|  90.7k|	size_t u8Len;
   23|  90.7k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  90.7k|	*utf8Str_io = u8Ptr + u8Len;
   25|  90.7k|	return cp;
   26|  90.7k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  90.7k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  90.7k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 39.2k, False: 51.5k]
  |  Branch (43:24): [True: 896, False: 38.3k]
  |  Branch (43:43): [True: 38.3k, False: 51.5k]
  |  Branch (43:59): [True: 6.01k, False: 32.3k]
  ------------------
   44|  83.8k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 32.3k, False: 51.5k]
  |  Branch (44:24): [True: 14.3k, False: 18.0k]
  |  Branch (44:43): [True: 11.7k, False: 57.7k]
  |  Branch (44:60): [True: 0, False: 11.7k]
  ------------------
   45|       |
   46|  69.5k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 11.7k, False: 57.7k]
  |  Branch (46:25): [True: 11.4k, False: 337]
  |  Branch (46:46): [True: 337, False: 57.7k]
  |  Branch (46:64): [True: 0, False: 337]
  ------------------
   47|  58.1k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 337, False: 57.7k]
  |  Branch (47:26): [True: 0, False: 337]
  |  Branch (47:46): [True: 337, False: 57.7k]
  |  Branch (47:64): [True: 0, False: 337]
  ------------------
   48|  58.1k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 337, False: 57.7k]
  |  Branch (48:26): [True: 337, False: 0]
  |  Branch (48:46): [True: 0, False: 57.7k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  57.7k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 57.7k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 57.7k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  57.7k|	return false;
   52|       |
   53|  57.7k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   973k|{
   59|       |	// ASCII following characters for an XML name.
   60|   973k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 710k, False: 262k]
  |  Branch (60:23): [True: 710k, False: 0]
  |  Branch (60:39): [True: 171k, False: 91.0k]
  |  Branch (60:54): [True: 91.0k, False: 0]
  ------------------
   61|      0|	return false;
   62|   973k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  57.7k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  57.7k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 51.5k, False: 6.23k]
  |  Branch (69:24): [True: 6.23k, False: 0]
  |  Branch (69:41): [True: 6.23k, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  57.7k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  7.30k|{
   20|  7.30k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  7.30k|	XMP_Uns32 cp;
   22|  7.30k|	size_t u8Len;
   23|  7.30k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  7.30k|	*utf8Str_io = u8Ptr + u8Len;
   25|  7.30k|	return cp;
   26|  7.30k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  51.0k|{
   88|       |
   89|  51.0k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  51.0k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  51.0k|	const XMP_Uns8 * namePos   = nameStart;
   92|  51.0k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  51.0k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 51.0k]
  ------------------
   97|       |
   98|  51.0k|	cp = *namePos;
   99|  51.0k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 49.3k, False: 1.72k]
  ------------------
  100|  49.3k|		++namePos;
  101|  49.3k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 49.3k]
  ------------------
  102|  49.3k|	} else {
  103|  1.72k|		cp = GetCodePoint ( &namePos );
  104|  1.72k|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 1.72k]
  ------------------
  105|  1.72k|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  19.5M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 19.5M, False: 51.0k]
  ------------------
  110|  19.5M|		cp = *namePos;
  111|  19.5M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 19.4M, False: 80.6k]
  ------------------
  112|  19.4M|			++namePos;
  113|  19.4M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 478k, False: 18.9M]
  |  Branch (113:38): [True: 0, False: 478k]
  ------------------
  114|  19.4M|		} else {
  115|  80.6k|			cp = GetCodePoint ( &namePos );
  116|  80.6k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 55.6k, False: 25.0k]
  |  Branch (116:41): [True: 0, False: 55.6k]
  ------------------
  117|  80.6k|		}
  118|  19.5M|	}
  119|       |
  120|  51.0k|	return;
  121|       |
  122|  51.0k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  19.5M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  19.5M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 17.3M, False: 2.11M]
  |  Branch (33:23): [True: 17.3M, False: 0]
  |  Branch (33:40): [True: 1.63M, False: 478k]
  |  Branch (33:55): [True: 1.55M, False: 75.9k]
  |  Branch (33:71): [True: 75.9k, False: 478k]
  ------------------
   34|   478k|	return false;
   35|  19.5M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  82.4k|{
   20|  82.4k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  82.4k|	XMP_Uns32 cp;
   22|  82.4k|	size_t u8Len;
   23|  82.4k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  82.4k|	*utf8Str_io = u8Ptr + u8Len;
   25|  82.4k|	return cp;
   26|  82.4k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  82.4k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  82.4k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 30.8k, False: 51.5k]
  |  Branch (43:24): [True: 489, False: 30.3k]
  |  Branch (43:43): [True: 30.3k, False: 51.5k]
  |  Branch (43:59): [True: 501, False: 29.8k]
  ------------------
   44|  81.4k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 29.8k, False: 51.5k]
  |  Branch (44:24): [True: 13.6k, False: 16.2k]
  |  Branch (44:43): [True: 12.1k, False: 55.6k]
  |  Branch (44:60): [True: 0, False: 12.1k]
  ------------------
   45|       |
   46|  67.7k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 12.1k, False: 55.6k]
  |  Branch (46:25): [True: 10.7k, False: 1.40k]
  |  Branch (46:46): [True: 1.40k, False: 55.6k]
  |  Branch (46:64): [True: 0, False: 1.40k]
  ------------------
   47|  57.0k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 1.40k, False: 55.6k]
  |  Branch (47:26): [True: 0, False: 1.40k]
  |  Branch (47:46): [True: 1.40k, False: 55.6k]
  |  Branch (47:64): [True: 0, False: 1.40k]
  ------------------
   48|  57.0k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 1.40k, False: 55.6k]
  |  Branch (48:26): [True: 1.40k, False: 0]
  |  Branch (48:46): [True: 0, False: 55.6k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  55.6k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 55.6k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 55.6k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  55.6k|	return false;
   52|       |
   53|  55.6k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   478k|{
   59|       |	// ASCII following characters for an XML name.
   60|   478k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 301k, False: 176k]
  |  Branch (60:23): [True: 301k, False: 0]
  |  Branch (60:39): [True: 145k, False: 31.4k]
  |  Branch (60:54): [True: 31.4k, False: 0]
  ------------------
   61|      0|	return false;
   62|   478k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  55.6k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  55.6k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 51.5k, False: 4.10k]
  |  Branch (69:24): [True: 4.10k, False: 0]
  |  Branch (69:41): [True: 4.10k, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  55.6k|}

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

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

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

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

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

_ZN13XMP_AutoMutexC2Ev:
  222|   623k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   623k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   623k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|   190k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 190k, False: 432k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   432k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   553k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   562k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|   167k|		: options(_options), name(_name), parent(_parent)
  435|   167k|	{
  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|   167k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   128k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   128k|	{
  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|   128k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  66.6k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  66.6k|	{
  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|  66.6k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   392k|	{
  479|   637k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 244k, False: 392k]
  ------------------
  480|   244k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 243k, False: 1.06k]
  ------------------
  481|   244k|		}
  482|   392k|		children.clear();
  483|   392k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   372k|	{
  487|   477k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 104k, False: 372k]
  ------------------
  488|   104k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 104k, False: 0]
  ------------------
  489|   104k|		}
  490|   372k|		qualifiers.clear();
  491|   372k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  10.0k|	{
  495|  10.0k|		options = 0;
  496|  10.0k|		name.erase();
  497|  10.0k|		value.erase();
  498|  10.0k|		this->RemoveChildren();
  499|  10.0k|		this->RemoveQualifiers();
  500|  10.0k|	}
_ZN8XMP_NodeD2Ev:
  502|   362k|	virtual ~XMP_Node() { RemoveChildren(); RemoveQualifiers(); };

_ZN11XMPIterator10InitializeEv:
  376|      1|{
  377|      1|	sDummySchema = new XMP_Node ( 0, "dummy:schema/", kXMP_SchemaNode);
  378|      1|	return true;
  379|       |	
  380|      1|}	// Initialize
_ZN11XMPIterator9TerminateEv:
  388|      1|{
  389|      1|	delete ( sDummySchema );
  390|      1|	sDummySchema = 0;
  391|      1|	return;
  392|       |	
  393|      1|}	// Terminate
_ZN11XMPIteratorC2ERK7XMPMetaPKcS4_j:
  427|  9.69k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  9.69k|{
  429|  9.69k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 9.69k]
  ------------------
  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|  9.69k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 3.08k, False: 6.61k]
  ------------------
  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|  3.08k|		XMP_ExpandedXPath propPath;
  445|  3.08k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  3.08k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  3.08k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  3.08k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  3.08k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 3.08k, False: 0]
  ------------------
  449|       |
  450|  3.08k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  3.48k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 396, False: 3.08k]
  ------------------
  452|    396|				XMP_OptionBits stepKind = GetStepKind ( propPath[i].options );
  ------------------
  |  |  408|    396|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  453|    396|				if ( stepKind <= kXMP_QualifierStep ) rootName += '/';
  ------------------
  |  Branch (453:10): [True: 302, False: 94]
  ------------------
  454|    396|				rootName += propPath[i].step;
  455|    396|			}
  456|       |
  457|  3.08k|			propName = rootName.c_str();
  458|  3.08k|			size_t leafOffset = rootName.size();
  459|  50.0k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 47.1k, False: 2.88k]
  |  Branch (459:32): [True: 46.9k, False: 198]
  |  Branch (459:65): [True: 46.9k, False: 0]
  ------------------
  460|  3.08k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 198, False: 2.88k]
  ------------------
  461|       |
  462|  3.08k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  3.08k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  3.08k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 3.08k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  3.08k|		}
  469|       |	
  470|  6.61k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 6.61k]
  ------------------
  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.61k|	} 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|  20.3k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 13.6k, False: 6.61k]
  ------------------
  507|       |
  508|  13.6k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  13.6k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  13.6k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  13.6k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 13.6k, False: 0]
  ------------------
  513|  13.6k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  13.6k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 13.6k]
  ------------------
  515|  13.6k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 13.6k]
  ------------------
  516|  13.6k|			}
  517|       |
  518|  13.6k|		}
  519|       |		
  520|  6.61k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 6.61k]
  ------------------
  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.61k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  9.69k|	info.currPos = info.tree.children.begin();
  554|  9.69k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  9.69k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 9.69k]
  |  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|  9.69k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  9.69k|{
  592|  9.69k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  9.69k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  9.69k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   224k|{
  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|   224k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 1.27k, False: 222k]
  ------------------
  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|   222k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   222k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 7.62k, False: 215k]
  ------------------
  632|   215k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   215k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 215k]
  ------------------
  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|   215k|	*schemaNS = info.currSchema.c_str();
  644|   215k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   215k|	*propOptions = info.currPos->options;
  647|       |
  648|   215k|	*propPath  = "";
  649|   215k|	*pathSize  = 0;
  650|   215k|	*propValue = "";
  651|   215k|	*valueSize = 0;
  652|       |	
  653|   215k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 201k, False: 13.5k]
  ------------------
  654|       |
  655|   201k|		*propPath = info.currPos->fullPath.c_str();
  656|   201k|		*pathSize = info.currPos->fullPath.size();
  657|   201k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 201k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   201k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 181k, False: 20.0k]
  ------------------
  663|   181k|			*propValue = xmpNode->value.c_str();
  664|   181k|			*valueSize = xmpNode->value.size();
  665|   181k|		}
  666|       |
  667|   201k|	}
  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|   215k|	return true;
  675|       |
  676|   215k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   215k|{
  730|   215k|	UNUSED(options);
  731|       |
  732|   215k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   215k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  3.08k|{
  182|       |
  183|  3.08k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  3.08k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   201k|{
  115|   201k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   201k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   201k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 24.1k, False: 177k]
  |  Branch (118:44): [True: 24.1k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  24.1k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  24.1k|		leafOffset += 2;
  126|       |		
  127|  90.2k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 66.0k, False: 24.1k]
  ------------------
  128|  66.0k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  66.0k|			currPath += xmpQual->name;
  130|  66.0k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  66.0k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  66.0k|		}
  136|       |		
  137|  24.1k|		leafOffset -= 2;
  138|  24.1k|		currPath.erase ( leafOffset );
  139|       |
  140|  24.1k|	}
  141|       |
  142|   201k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 19.8k, False: 181k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  19.8k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  19.8k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  19.8k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 12.2k, False: 7.58k]
  ------------------
  151|  12.2k|			currPath += '/';
  152|  12.2k|			leafOffset += 1;
  153|  12.2k|		}
  154|       |		
  155|   151k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 132k, False: 19.8k]
  ------------------
  156|   132k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   132k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 38.0k, False: 94.0k]
  ------------------
  158|  38.0k|				currPath += xmpChild->name;
  159|  94.0k|			} else {
  160|  94.0k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|  94.0k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|  94.0k|				currPath += buffer;
  163|  94.0k|			}
  164|   132k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   132k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   132k|		}
  170|       |	
  171|  19.8k|	}
  172|       |
  173|   201k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  13.6k|{
   49|  13.6k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  42.2k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 28.6k, False: 13.6k]
  ------------------
   55|  28.6k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  28.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|  28.6k|	}
   62|       |
   63|  13.6k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   222k|{
  309|   222k|	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|   222k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 214k, False: 8.42k]
  ------------------
  323|       |	
  324|   222k|	bool isSchemaNode = false;
  325|   222k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   222k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 215k, False: 7.74k]
  ------------------
  328|       |
  329|   215k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   215k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 13.4k, False: 201k]
  ------------------
  331|  13.4k|			SetCurrSchema ( info, info.currPos->fullPath );
  332|  13.4k|			xmpNode = FindConstSchema ( &info.xmpObj->tree, info.currPos->fullPath.c_str() );
  ------------------
  |  |  298|  13.4k|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  13.4k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  333|  13.4k|			if ( xmpNode == 0 ) xmpNode = sDummySchema;
  ------------------
  |  Branch (333:9): [True: 0, False: 13.4k]
  ------------------
  334|   201k|		} else {
  335|   201k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   201k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   201k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   201k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   201k|		}
  338|   215k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 215k, False: 121]
  ------------------
  339|       |
  340|    121|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|    121|		info.currPos->children.clear();
  342|    121|		info.currPos->qualifiers.clear();
  343|    121|		AdvanceIterPos ( info );
  344|       |
  345|    121|	}
  346|       |
  347|   222k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 7.62k, False: 215k]
  ------------------
  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|   215k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   215k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   215k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 215k, False: 121]
  ------------------
  356|   215k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 201k, False: 13.4k]
  |  Branch (356:28): [True: 201k, False: 0]
  ------------------
  357|   201k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   201k|		}
  359|   215k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   215k|	}
  361|       |	
  362|   215k|	return xmpNode;
  363|       |
  364|   222k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  21.5k|{
  193|       |
  194|  21.5k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  21.5k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   214k|{
  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|   484k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 484k, Folded]
  ------------------
  221|       |	
  222|   484k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 63.6k, False: 420k]
  ------------------
  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|  63.6k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 7.62k, False: 56.0k]
  ------------------
  230|       |
  231|  56.0k|			IterPosPair & parent = info.ancestors.back();
  232|  56.0k|			info.currPos = parent.first;
  233|  56.0k|			info.endPos  = parent.second;
  234|  56.0k|			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|   420k|		} 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|   420k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 149k, False: 270k]
  ------------------
  253|   149k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 8.12k, False: 141k]
  ------------------
  254|   149k|				break;
  255|   149k|			}
  256|       |
  257|   270k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 214k, False: 56.0k]
  ------------------
  258|   214k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   214k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 23.8k, False: 190k]
  ------------------
  260|  23.8k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  23.8k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  23.8k|					info.currPos = info.currPos->qualifiers.begin();
  263|  23.8k|					break;
  264|  23.8k|				}
  265|   214k|			}
  266|       |
  267|   246k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 214k, False: 32.1k]
  ------------------
  268|   214k|				info.currPos->qualifiers.clear();
  269|   214k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   214k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 33.0k, False: 181k]
  ------------------
  271|  33.0k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  33.0k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  33.0k|					info.currPos = info.currPos->children.begin();
  274|  33.0k|					break;
  275|  33.0k|				}
  276|   214k|			}
  277|       |
  278|   213k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 213k, False: 0]
  ------------------
  279|   213k|				info.currPos->children.clear();
  280|   213k|				++info.currPos;											// Move to the next sibling.
  281|   213k|				continue;
  282|   213k|			}
  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|   213k|		}
  292|       |
  293|   484k|	}	// Loop to find the next node.
  294|       |	
  295|   214k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   214k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   214k|}	// AdvanceIterPos

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  8.34k|{
 1097|  8.34k|	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: 8.34k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  8.34k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 8.34k]
  ------------------
 1099|       |	
 1100|  8.34k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  8.34k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  8.34k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 8.34k, False: 0]
  ------------------
 1105|  8.34k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 8.34k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  8.34k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  8.34k|	}
 1108|       |	
 1109|  8.34k|	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|  8.34k|	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|  8.34k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 8.34k, False: 0]
  ------------------
 1127|       |
 1128|  8.34k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 8.34k, False: 0]
  |  Branch (1128:39): [True: 8.29k, False: 47]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  8.29k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  8.29k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     47|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     47|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 47, False: 0]
  ------------------
 1139|       |
 1140|     47|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     47|				buffer += pendingOverlap;
 1142|     47|				xmpSize -= pendingOverlap;
 1143|     47|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     47|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 47]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     47|				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|     47|			}
 1153|       |
 1154|  8.34k|		}
 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|  8.34k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  8.34k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  8.34k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 8.34k]
  ------------------
 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|  8.34k|		} 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|  8.39k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 47, False: 8.34k]
  ------------------
 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|     47|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     47|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 47, False: 0]
  ------------------
 1190|       |				
 1191|     47|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     47|				parser.pendingCount += pendingOverlap;
 1193|     47|				buffer += pendingOverlap;
 1194|     47|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     47|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 47]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     47|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     47|				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|     47|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 47, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     47|					parser.pendingCount = 0;
 1208|       |
 1209|     47|				} 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|     47|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  8.34k|			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|  8.34k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 8.34k]
  ------------------
 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|  8.34k|		}
 1258|       |		
 1259|  8.34k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 8.29k, False: 47]
  ------------------
 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|  8.29k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  8.29k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 7.52k, False: 774]
  ------------------
 1269|       |
 1270|  7.52k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  7.52k|				NormalizeDCArrays ( &this->tree );
 1272|  7.52k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 7.52k]
  ------------------
 1273|  7.52k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  7.52k|				size_t schemaNum = 0;
 1277|  21.2k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 13.6k, False: 7.52k]
  ------------------
 1278|  13.6k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  13.6k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 13.6k, False: 0]
  ------------------
 1280|  13.6k|						++schemaNum;
 1281|  13.6k|					} 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|  13.6k|				}
 1286|       |				
 1287|  7.52k|			}
 1288|       |
 1289|  8.29k|			delete this->xmlParser;
 1290|  8.29k|			this->xmlParser = 0;
 1291|       |
 1292|  8.29k|		}
 1293|       |		
 1294|  8.34k|	} catch ( ... ) {
 1295|       |
 1296|  1.73k|		delete this->xmlParser;
 1297|  1.73k|		this->xmlParser = 0;
 1298|  1.73k|		prevTkVer = 0;
 1299|  1.73k|		this->tree.ClearNode();
 1300|  1.73k|		throw;
 1301|       |
 1302|  1.73k|	}
 1303|       |	
 1304|  8.34k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  8.34k|{
  811|  8.34k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 8.34k]
  ------------------
  812|       |	
  813|  8.34k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  8.34k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 8.34k]
  ------------------
  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|  8.34k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 8.32k, 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|  8.32k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 8.32k, 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|  8.34k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  8.39k|{
  977|  8.39k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  8.39k|	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|  8.39k|	std::string copy;
  992|       |		
  993|  86.4M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 86.4M, False: 8.39k]
  ------------------
  994|       |
  995|  86.4M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 83.9M, False: 2.45M]
  |  Branch (995:30): [True: 83.7M, False: 236k]
  |  Branch (995:52): [True: 83.5M, False: 226k]
  ------------------
  996|  83.5M|			copy.push_back(*spanEnd);
  997|  83.5M|			continue;	// A regular ASCII character.
  998|  83.5M|		}
  999|       |
 1000|  2.92M|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 103k, False: 2.81M]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|   103k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|   103k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 103k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|   103k|				copy.append((const char*)spanEnd, uniLen);
 1010|   103k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|   103k|			} 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|  2.81M|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 2.45M, False: 359k]
  |  Branch (1026:36): [True: 132k, False: 226k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|  2.59M|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|  2.59M|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|  2.55M|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|   143k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 36.4k, False: 2.55M]
  |  Branch (1030:31): [True: 2.41M, False: 143k]
  |  Branch (1030:52): [True: 10.5k, False: 132k]
  ------------------
 1031|  2.45M|				copy.push_back(*spanEnd);
 1032|  2.45M|				continue;
 1033|  2.45M|			}
 1034|       |
 1035|   132k|			copy.push_back(' ');
 1036|       |		
 1037|   226k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   226k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   226k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   226k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   226k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 47, False: 226k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     47|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 47, False: 0]
  ------------------
 1048|     47|					copy.push_back('&');
 1049|     47|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     47|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   226k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 4.28k, False: 222k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  4.28k|				copy.push_back(' ');
 1058|  4.28k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   222k|			} else {
 1061|   222k|				copy.push_back('&');
 1062|   222k|			}
 1063|       |
 1064|   226k|		}
 1065|       |		
 1066|  2.92M|	}
 1067|       |	
 1068|  8.39k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  8.39k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  8.39k|	copy.push_back(' ');
 1070|  8.39k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  8.39k|	return length;
 1072|       |
 1073|  8.39k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|   103k|{
  868|   103k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|   103k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|   103k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 103k]
  ------------------
  870|   103k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 103k]
  ------------------
  871|       |	
  872|   103k|	int byteCount = 2;
  873|   103k|	XMP_Uns8 firstByte = *charStart;
  874|   114k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 11.1k, False: 103k]
  ------------------
  875|       |	
  876|   103k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 103k]
  ------------------
  877|       |
  878|   218k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 114k, False: 103k]
  ------------------
  879|   114k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 114k]
  ------------------
  880|   114k|	}
  881|       |	
  882|   103k|	return byteCount;
  883|       |	
  884|   103k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   226k|{
  898|   226k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   226k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   226k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 226k]
  ------------------
  900|   226k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   226k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   226k|	size_t tailLen = bufEnd - escStart;
  903|   226k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 47, False: 226k]
  ------------------
  904|       |	
  905|   226k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 92.1k, False: 134k]
  ------------------
  906|       |	
  907|   134k|	XMP_Uns8 escValue = 0;
  908|   134k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   134k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 111k, False: 23.1k]
  |  Branch (910:27): [True: 62.6k, False: 48.5k]
  ------------------
  911|  62.6k|		escValue = *escPos - '0';
  912|  62.6k|		++escPos;
  913|  71.6k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 47.6k, False: 24.0k]
  |  Branch (913:34): [True: 36.4k, False: 11.1k]
  ------------------
  914|  36.4k|		escValue = *escPos - 'A' + 10;
  915|  36.4k|		++escPos;
  916|  36.4k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 5.45k, False: 29.8k]
  |  Branch (916:34): [True: 1.64k, False: 3.80k]
  ------------------
  917|  1.64k|		escValue = *escPos - 'a' + 10;
  918|  1.64k|		++escPos;
  919|  1.64k|	}
  920|       |	
  921|   134k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 76.2k, False: 58.0k]
  |  Branch (921:27): [True: 20.5k, False: 55.7k]
  ------------------
  922|  20.5k|		escValue = (escValue << 4) + (*escPos - '0');
  923|  20.5k|		++escPos;
  924|   113k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 24.0k, False: 89.8k]
  |  Branch (924:34): [True: 7.63k, False: 16.4k]
  ------------------
  925|  7.63k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  7.63k|		++escPos;
  927|   106k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 9.71k, False: 96.4k]
  |  Branch (927:34): [True: 720, False: 8.99k]
  ------------------
  928|    720|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|    720|		++escPos;
  930|    720|	}
  931|       |	
  932|   134k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 134k]
  ------------------
  933|   134k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 104k, False: 29.5k]
  ------------------
  934|       |	
  935|  29.5k|	size_t escLen = escPos - escStart + 1;
  936|  29.5k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 835, False: 28.7k]
  ------------------
  937|       |	
  938|  28.7k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  28.7k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  4.98k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  4.66k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 23.7k, False: 4.98k]
  |  Branch (938:29): [True: 321, False: 4.66k]
  |  Branch (938:50): [True: 378, False: 4.28k]
  ------------------
  939|       |	
  940|  4.28k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  28.7k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  8.29k|{
  152|  8.29k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  8.29k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 207, False: 8.09k]
  ------------------
  155|  8.29k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 774, False: 7.52k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  7.52k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  7.52k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  7.52k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  7.52k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 7.52k]
  ------------------
  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|  8.04k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.57k, False: 6.46k]
  ------------------
  168|  1.57k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.57k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 868, False: 710]
  |  Branch (169:42): [True: 186, False: 524]
  ------------------
  170|  1.05k|				verStr = currAttr->value.c_str();
  171|  1.05k|				break;
  172|  1.05k|			}
  173|  1.57k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  7.52k|	unsigned long part;
  178|  39.3k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 32.8k, False: 6.52k]
  |  Branch (178:29): [True: 3.16k, False: 29.7k]
  |  Branch (178:48): [True: 28.7k, False: 998]
  ------------------
  179|       |	
  180|  7.52k|	part = 0;
  181|  11.4k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 4.86k, False: 6.55k]
  |  Branch (181:28): [True: 4.09k, False: 766]
  |  Branch (181:48): [True: 3.88k, False: 207]
  ------------------
  182|  3.88k|		part = (part * 10) + (*verStr - '0');
  183|  3.88k|		++verStr;
  184|  3.88k|	}
  185|  7.52k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 162, False: 7.36k]
  ------------------
  186|  7.52k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  7.52k|	part = 0;
  189|  7.52k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 504, False: 7.01k]
  ------------------
  190|  11.3k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 4.74k, False: 6.56k]
  |  Branch (190:28): [True: 4.04k, False: 701]
  |  Branch (190:48): [True: 3.79k, False: 254]
  ------------------
  191|  3.79k|		part = (part * 10) + (*verStr - '0');
  192|  3.79k|		++verStr;
  193|  3.79k|	}
  194|  7.52k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 164, False: 7.35k]
  ------------------
  195|  7.52k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  7.52k|	part = 0;
  198|  7.52k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 147, False: 7.37k]
  ------------------
  199|  11.2k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 4.62k, False: 6.57k]
  |  Branch (199:28): [True: 3.96k, False: 658]
  |  Branch (199:48): [True: 3.68k, False: 286]
  ------------------
  200|  3.68k|		part = (part * 10) + (*verStr - '0');
  201|  3.68k|		++verStr;
  202|  3.68k|	}
  203|  7.52k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 100, False: 7.42k]
  ------------------
  204|  7.52k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  7.52k|	part = 0;
  207|  7.52k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 257, False: 7.26k]
  ------------------
  208|  8.15k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.55k, False: 6.59k]
  |  Branch (208:28): [True: 1.06k, False: 487]
  |  Branch (208:48): [True: 627, False: 441]
  ------------------
  209|    627|		part = (part * 10) + (*verStr - '0');
  210|    627|		++verStr;
  211|    627|	}
  212|  7.52k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 44, False: 7.47k]
  ------------------
  213|  7.52k|	thiz->prevTkVer += part;
  214|       |	
  215|  7.52k|	return rootNode;
  216|       |	
  217|  7.52k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  24.6k|{
  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|  52.4k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 27.9k, False: 24.4k]
  ------------------
  116|  27.9k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  27.9k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 25.3k, False: 2.58k]
  ------------------
  118|  2.58k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 235, False: 2.34k]
  |  Branch (118:44): [True: 1, False: 2.34k]
  ------------------
  119|  2.58k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  24.4k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 24.4k, False: 0]
  ------------------
  122|  51.0k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 26.7k, False: 24.2k]
  ------------------
  123|  26.7k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  26.7k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 24.4k, False: 2.31k]
  ------------------
  125|  2.31k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 184, False: 2.12k]
  ------------------
  126|  2.31k|		}
  127|  24.4k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  48.4k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 24.2k, False: 24.2k]
  ------------------
  131|  24.2k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  24.2k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 24, False: 24.2k]
  ------------------
  133|  24.2k|	}
  134|       |	
  135|  24.2k|	return 0;
  136|       |
  137|  24.2k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  5.83k|{
  232|  5.83k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.83k|#define kXMP_ExistingOnly	false
  ------------------
  233|  5.83k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 5.15k, False: 682]
  ------------------
  234|       |	
  235|  3.28k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 2.60k, False: 682]
  ------------------
  236|  2.60k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  2.60k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  2.60k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 1.01k, False: 1.58k]
  ------------------
  240|       |		
  241|  1.58k|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 50, False: 1.53k]
  ------------------
  242|  1.53k|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 10, False: 1.52k]
  ------------------
  243|     60|			arrayForm = kXMP_PropArrayIsOrdered;
  244|  1.52k|		} else if (
  245|  1.52k|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 14, False: 1.51k]
  ------------------
  246|  1.51k|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 172, False: 1.34k]
  ------------------
  247|  1.34k|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 76, False: 1.26k]
  ------------------
  248|    262|			arrayForm = kXMP_PropArrayIsAltText;
  249|  1.26k|		} else if (
  250|  1.26k|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 11, False: 1.25k]
  ------------------
  251|  1.25k|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 78, False: 1.17k]
  ------------------
  252|  1.17k|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 25, False: 1.15k]
  ------------------
  253|  1.15k|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 62, False: 1.08k]
  ------------------
  254|  1.08k|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 20, False: 1.06k]
  ------------------
  255|  1.06k|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 10, False: 1.05k]
  ------------------
  256|    206|			arrayForm = kXMP_PropValueIsArray;
  257|    206|		}
  258|  1.58k|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 1.05k, False: 528]
  ------------------
  259|       |		
  260|    528|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    528|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    528|		dcSchema->children[propNum] = newArray;
  263|    528|		newArray->children.push_back ( currProp );
  264|    528|		currProp->parent = newArray;
  265|    528|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    528|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    528|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 262, False: 266]
  |  Branch (267:44): [True: 186, False: 76]
  ------------------
  268|    186|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|    186|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|    186|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 186, False: 0]
  ------------------
  271|    186|				currProp->qualifiers.push_back ( newLang );
  272|    186|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|    186|		}
  276|       |
  277|    528|	}
  278|       |	
  279|    682|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  5.83k|{
  666|  5.83k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  5.83k|	XMP_Node * currSchema = 0;
  671|       |
  672|  5.83k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.83k|#define kXMP_ExistingOnly	false
  ------------------
  673|  5.83k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 11, False: 5.82k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|     11|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|     11|#define kXMP_ExistingOnly	false
  ------------------
  677|     11|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 11]
  ------------------
  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|     11|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|     11|#define kXMP_ExistingOnly	false
  ------------------
  682|     11|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 11]
  |  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|     11|	}
  697|       |
  698|  5.83k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.83k|#define kXMP_ExistingOnly	false
  ------------------
  699|  5.83k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 5.83k]
  ------------------
  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.83k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  5.83k|#define kXMP_ExistingOnly	false
  ------------------
  707|  5.83k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 682, False: 5.15k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    682|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    682|#define kXMP_ExistingOnly	false
  ------------------
  710|    682|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 22, False: 660]
  ------------------
  711|     22|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     22|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     22|		}
  714|    682|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  5.83k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  5.83k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  5.83k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  5.83k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  5.83k|	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.83k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 387, False: 5.45k]
  ------------------
  732|       |
  733|    387|		bool nameIsUUID = false;
  734|    387|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    387|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    387|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 52, False: 335]
  |  |  ------------------
  ------------------
  737|       |
  738|     52|			nameIsUUID = true;
  739|       |
  740|    335|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 183, False: 152]
  ------------------
  741|       |
  742|    183|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  3.23k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 3.21k, False: 29]
  ------------------
  744|  3.21k|				char ch = nameStr[i];
  745|  3.21k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 131, False: 3.07k]
  ------------------
  746|    131|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 37, False: 94]
  |  Branch (746:23): [True: 23, False: 71]
  |  Branch (746:36): [True: 15, False: 56]
  |  Branch (746:49): [True: 28, False: 28]
  ------------------
  747|     28|					nameIsUUID = false;
  748|     28|					break;
  749|  3.07k|				} else {
  750|  3.07k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 3.04k, False: 36]
  |  Branch (750:27): [True: 961, False: 2.08k]
  |  Branch (750:44): [True: 2.03k, False: 86]
  |  Branch (750:59): [True: 1.99k, False: 40]
  ------------------
  751|    126|					nameIsUUID = false;
  752|    126|					break;
  753|  3.07k|				}
  754|  3.21k|			}
  755|       |
  756|    183|		}
  757|       |		
  758|    387|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 81, False: 306]
  ------------------
  759|       |
  760|     81|			XMP_ExpandedXPath expPath;
  761|     81|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     81|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     81|#define kXMP_CreateNodes	true
  ------------------
  763|     81|			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: 81]
  ------------------
  764|       |
  765|     81|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     81|			idNode->value = tree.name;
  767|     81|			idNode->RemoveChildren();
  768|     81|			idNode->RemoveQualifiers();
  769|       |
  770|     81|			tree.name.erase();
  771|       |
  772|     81|		}
  773|       |
  774|    387|	}
  775|       |
  776|  5.83k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  29.1k|{
  610|  29.1k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  29.1k|#define kXMP_ExistingOnly	false
  ------------------
  611|  29.1k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 27.1k, False: 2.08k]
  ------------------
  612|       |	
  613|  2.08k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.08k|#define kXMP_ExistingOnly	false
  ------------------
  614|  2.08k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.59k, False: 489]
  |  Branch (614:27): [True: 320, False: 169]
  ------------------
  615|       |	
  616|    169|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 19, False: 150]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|    150|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  1.10k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 959, False: 150]
  ------------------
  622|       |
  623|    959|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|    959|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 305, False: 654]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|    305|			delete ( currChild );
  629|    305|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|    654|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 611, False: 43]
  ------------------
  632|       |		
  633|    611|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 53, False: 558]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     53|				delete ( currChild );
  637|     53|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|    558|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|    558|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|    558|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 523, False: 35]
  ------------------
  644|    523|					currChild->qualifiers.push_back ( repairLang );
  645|    523|				} else {
  646|     35|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     35|				}
  648|    558|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|    558|			}
  651|       |
  652|    611|		}
  653|       |
  654|    959|	}
  655|       |
  656|    150|}	// RepairAltText

_ZNK7XMPMeta17SerializeToBufferEPPKcPjjjS1_S1_i:
 1170|  5.64k|{
 1171|  5.64k|	XMP_Assert ( (rdfString != 0) && (rdfSize != 0) && (newline != 0) && (indentStr != 0) );
  ------------------
  |  |  142|  5.64k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1172|       |
 1173|       |	// Fix up some default parameters.
 1174|       |	
 1175|  5.64k|	enum { kDefaultPad = 2048 };
 1176|  5.64k|	size_t unicodeUnitSize = 1;
 1177|  5.64k|	XMP_OptionBits charEncoding = options & kXMP_EncodingMask;
 1178|       |
 1179|  5.64k|	if ( charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1179:7): [True: 0, False: 5.64k]
  ------------------
 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|  5.64k|	if ( options & kXMP_OmitAllFormatting ) {
  ------------------
  |  Branch (1190:7): [True: 31, False: 5.61k]
  ------------------
 1191|     31|		newline = " ";	// ! Yes, a space for "newline". This ensures token separation.
 1192|     31|		indentStr = "";
 1193|  5.61k|	} else {
 1194|  5.61k|		if ( *newline == 0 ) newline = "\xA";	// Linefeed
  ------------------
  |  Branch (1194:8): [True: 5.61k, False: 0]
  ------------------
 1195|  5.61k|		if ( *indentStr == 0 ) {
  ------------------
  |  Branch (1195:8): [True: 5.61k, False: 0]
  ------------------
 1196|  5.61k|			indentStr = " ";
 1197|  5.61k|			if ( ! (options & kXMP_UseCompactFormat) ) indentStr  = "   ";
  ------------------
  |  Branch (1197:9): [True: 0, False: 5.61k]
  ------------------
 1198|  5.61k|		}
 1199|  5.61k|	}
 1200|       |	
 1201|  5.64k|	if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1201:7): [True: 0, False: 5.64k]
  ------------------
 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|  5.64k|	} else if ( options & kXMP_ReadOnlyPacket ) {
  ------------------
  |  Branch (1208:14): [True: 0, False: 5.64k]
  ------------------
 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|  5.64k|	} else if ( options & kXMP_OmitPacketWrapper ) {
  ------------------
  |  Branch (1213:14): [True: 2.11k, False: 3.53k]
  ------------------
 1214|  2.11k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1214:8): [True: 0, False: 2.11k]
  ------------------
 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|  2.11k|		padding = 0;
 1218|  3.53k|	} else {
 1219|  3.53k|		if ( padding == 0 ) padding = kDefaultPad * unicodeUnitSize;
  ------------------
  |  Branch (1219:8): [True: 3.53k, False: 0]
  ------------------
 1220|  3.53k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1220:8): [True: 0, False: 3.53k]
  ------------------
 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|  3.53k|	}
 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|  5.64k|	std::string tailStr;
 1228|       |
 1229|  5.64k|	SerializeAsRDF ( *this, *sOutputStr, tailStr, options, newline, indentStr, baseIndent );
 1230|  5.64k|	if ( charEncoding == kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1230:7): [True: 5.64k, False: 0]
  ------------------
 1231|       |
 1232|  5.64k|		if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1232:8): [True: 0, False: 5.64k]
  ------------------
 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|  5.64k|		size_t newlineLen = strlen ( newline );
 1239|       |	
 1240|  5.64k|		if ( padding < newlineLen ) {
  ------------------
  |  Branch (1240:8): [True: 2.11k, False: 3.53k]
  ------------------
 1241|  2.11k|			sOutputStr->append ( padding, ' ' );
 1242|  3.53k|		} else {
 1243|  3.53k|			padding -= newlineLen;	// Write this newline last.
 1244|  74.1k|			while ( padding >= (100 + newlineLen) ) {
  ------------------
  |  Branch (1244:12): [True: 70.6k, False: 3.53k]
  ------------------
 1245|  70.6k|				sOutputStr->append ( 100, ' ' );
 1246|  70.6k|				*sOutputStr += newline;
 1247|  70.6k|				padding -= (100 + newlineLen);
 1248|  70.6k|			}
 1249|  3.53k|			sOutputStr->append ( padding, ' ' );
 1250|  3.53k|			*sOutputStr += newline;
 1251|  3.53k|		}
 1252|       |
 1253|  5.64k|		*sOutputStr += tailStr;
 1254|       |	
 1255|  5.64k|	} 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|  5.64k|	*rdfString = sOutputStr->c_str();
 1343|  5.64k|	*rdfSize   = sOutputStr->size();
 1344|       |
 1345|  5.64k|}	// SerializeToBuffer
XMPMeta-Serialize.cpp:_ZL14SerializeAsRDFRK7XMPMetaRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_jPKcSB_i:
 1063|  5.64k|{
 1064|  5.64k|	const size_t treeNameLen = xmpObj.tree.name.size();
 1065|  5.64k|	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|  5.64k|	size_t outputLen = 2 * (strlen(kPacketHeader) + strlen(kRDF_XMPMetaStart) + strlen(kRDF_RDFStart) + 3*baseIndent*indentLen);
 1076|       |	
 1077|  19.2k|	for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum < schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (1077:71): [True: 13.5k, False: 5.64k]
  ------------------
 1078|  13.5k|		const XMP_Node * currSchema = xmpObj.tree.children[schemaNum];
 1079|  13.5k|		outputLen += 2*(baseIndent+2)*indentLen + strlen(kRDF_SchemaStart) + treeNameLen + strlen(kRDF_SchemaEnd) + 2;
 1080|  13.5k|		outputLen += EstimateRDFSize ( currSchema, baseIndent+2, indentLen );
 1081|  13.5k|	}
 1082|       |	
 1083|  5.64k|	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|  5.64k|	XMP_Index level;
 1088|       |	
 1089|  5.64k|	headStr.erase();
 1090|  5.64k|	headStr.reserve ( outputLen );
 1091|       |	
 1092|       |	// Write the packet header PI.
 1093|  5.64k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1093:7): [True: 3.53k, False: 2.11k]
  ------------------
 1094|  3.53k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1094:29): [True: 0, False: 3.53k]
  ------------------
 1095|  3.53k|		headStr += kPacketHeader;
 1096|  3.53k|		headStr += newline;
 1097|  3.53k|	}
 1098|       |
 1099|       |	// Write the xmpmeta element's start tag.
 1100|  5.64k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1100:7): [True: 5.64k, False: 0]
  ------------------
 1101|  5.64k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1101:29): [True: 0, False: 5.64k]
  ------------------
 1102|  5.64k|		headStr += kRDF_XMPMetaStart;
 1103|  5.64k|		headStr += kXMPCore_VersionMessage "\">";
  ------------------
  |  |  134|  5.64k|	#define kXMPCore_VersionMessage	kXMPCoreName " " XMP_API_VERSION_STRING
  |  |  ------------------
  |  |  |  |  133|  5.64k|	#define kXMPCoreName "XMP Core"
  |  |  ------------------
  ------------------
 1104|  5.64k|		headStr += newline;
 1105|  5.64k|	}
 1106|       |
 1107|       |	// Write the rdf:RDF start tag.
 1108|  11.2k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1108:30): [True: 5.64k, False: 5.64k]
  ------------------
 1109|  5.64k|	headStr += kRDF_RDFStart;
 1110|  5.64k|	headStr += newline;
 1111|       |	
 1112|       |	// Write all of the properties.
 1113|  5.64k|	if ( options & kXMP_UseCompactFormat ) {
  ------------------
  |  Branch (1113:7): [True: 5.64k, False: 0]
  ------------------
 1114|  5.64k|		SerializeCompactRDFSchemas ( xmpObj.tree, headStr, newline, indentStr, baseIndent );
 1115|  5.64k|	} 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|  11.2k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1132:30): [True: 5.64k, False: 5.64k]
  ------------------
 1133|  5.64k|	headStr += kRDF_RDFEnd;
 1134|  5.64k|	headStr += newline;
 1135|       |
 1136|       |	// Write the xmpmeta end tag.
 1137|  5.64k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1137:7): [True: 5.64k, False: 0]
  ------------------
 1138|  5.64k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1138:29): [True: 0, False: 5.64k]
  ------------------
 1139|  5.64k|		headStr += kRDF_XMPMetaEnd;
 1140|  5.64k|		headStr += newline;
 1141|  5.64k|	}
 1142|       |	
 1143|       |	// Write the packet trailer PI into the tail string as UTF-8.
 1144|  5.64k|	tailStr.erase();
 1145|  5.64k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1145:7): [True: 3.53k, False: 2.11k]
  ------------------
 1146|  3.53k|		tailStr.reserve ( strlen(kPacketTrailer) + (strlen(indentStr) * baseIndent) );
 1147|  3.53k|		for ( level = baseIndent; level > 0; --level ) tailStr += indentStr;
  ------------------
  |  Branch (1147:29): [True: 0, False: 3.53k]
  ------------------
 1148|  3.53k|		tailStr += kPacketTrailer;
 1149|  3.53k|		if ( options & kXMP_ReadOnlyPacket ) tailStr[tailStr.size()-4] = 'r';
  ------------------
  |  Branch (1149:8): [True: 0, False: 3.53k]
  ------------------
 1150|  3.53k|	}
 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|  5.64k|}	// SerializeAsRDF
XMPMeta-Serialize.cpp:_ZL15EstimateRDFSizePK8XMP_Nodeim:
   83|   102k|{
   84|   102k|	size_t outputLen = 2 * (indent*indentLen + currNode->name.size() + 4);	// The property element tags.
   85|       |	
   86|   102k|	if ( ! currNode->qualifiers.empty() ) {
  ------------------
  |  Branch (86:7): [True: 16.4k, False: 85.5k]
  ------------------
   87|       |		// This node has qualifiers, assume it is written using rdf:value and estimate the qualifiers.
   88|       |
   89|  16.4k|		indent += 2;	// Everything else is indented inside the rdf:Description element.
   90|  16.4k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
   91|  16.4k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_ValueStart) + 2);		// The rdf:value tags.
   92|       |
   93|  35.9k|		for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (93:68): [True: 19.4k, False: 16.4k]
  ------------------
   94|  19.4k|			const XMP_Node * currQual = currNode->qualifiers[qualNum];
   95|  19.4k|			outputLen += EstimateRDFSize ( currQual, indent, indentLen );
   96|  19.4k|		}
   97|       |
   98|  16.4k|	}
   99|       |	
  100|   102k|	if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (100:7): [True: 4.86k, False: 97.1k]
  ------------------
  101|  4.86k|		indent += 1;
  102|  4.86k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
  103|  97.1k|	} else if ( currNode->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (103:14): [True: 4.97k, False: 92.1k]
  ------------------
  104|  4.97k|		indent += 2;
  105|  4.97k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_BagStart) + 2);		// The rdf:Bag/Seq/Alt tags.
  106|  4.97k|		outputLen += 2 * currNode->children.size() * (strlen(kRDF_ItemStart) + 2);	// The rdf:li tags, indent counted in children.
  107|  92.1k|	} else if ( ! (currNode->options & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (107:14): [True: 78.5k, False: 13.5k]
  ------------------
  108|  78.5k|		outputLen += currNode->value.size();	// This is a leaf value node.
  109|  78.5k|	}
  110|       |
  111|   170k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (111:67): [True: 68.9k, False: 102k]
  ------------------
  112|  68.9k|		const XMP_Node * currChild = currNode->children[childNum];
  113|  68.9k|		outputLen += EstimateRDFSize ( currChild, indent+1, indentLen );
  114|  68.9k|	}
  115|       |
  116|   102k|	return outputLen;
  117|       |	
  118|   102k|}	// EstimateRDFSize
XMPMeta-Serialize.cpp:_ZL26SerializeCompactRDFSchemasRK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  978|  5.64k|{
  979|  5.64k|	XMP_Index level;
  980|  5.64k|	size_t schema, schemaLim;
  981|       |	
  982|       |	// Begin the rdf:Description start tag.
  983|  16.9k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (983:30): [True: 11.2k, False: 5.64k]
  ------------------
  984|  5.64k|	outputStr += kRDF_SchemaStart;
  985|  5.64k|	outputStr += '"';
  986|  5.64k|	outputStr += xmpTree.name;
  987|  5.64k|	outputStr += '"';
  988|       |	
  989|       |	// Write all necessary xmlns attributes.
  990|       |	
  991|  5.64k|	size_t totalLen = 8;	// Start at 8 for "xml:rdf:".
  992|  5.64k|	XMP_cStringMapPos currPos = sNamespacePrefixToURIMap->begin();
  993|  5.64k|	XMP_cStringMapPos endPos  = sNamespacePrefixToURIMap->end();
  994|  2.68M|	for ( ; currPos != endPos; ++currPos ) totalLen += currPos->first.size();
  ------------------
  |  Branch (994:10): [True: 2.67M, False: 5.64k]
  ------------------
  995|       |
  996|  5.64k|	XMP_VarString usedNS;
  997|  5.64k|	usedNS.reserve ( totalLen );
  998|  5.64k|	usedNS = "xml:rdf:";
  999|       |
 1000|  19.2k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1000:57): [True: 13.5k, False: 5.64k]
  ------------------
 1001|  13.5k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1002|  13.5k|		DeclareUsedNamespaces ( currSchema, usedNS, outputStr, newline, indentStr, baseIndent+4 );
 1003|  13.5k|	}
 1004|       |	
 1005|       |	// Write the top level "attrProps" and close the rdf:Description start tag.
 1006|  5.64k|	bool allAreAttrs = true;
 1007|  19.2k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1007:57): [True: 13.5k, False: 5.64k]
  ------------------
 1008|  13.5k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1009|  13.5k|		allAreAttrs &= SerializeCompactRDFAttrProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1010|  13.5k|	}
 1011|  5.64k|	if ( ! allAreAttrs ) {
  ------------------
  |  Branch (1011:7): [True: 2.52k, False: 3.12k]
  ------------------
 1012|  2.52k|		outputStr += ">";
 1013|  2.52k|		outputStr += newline;
 1014|  3.12k|	} else {
 1015|  3.12k|		outputStr += "/>";
 1016|  3.12k|		outputStr += newline;
 1017|  3.12k|		return;	// ! Done if all properties in all schema are written as attributes.
 1018|  3.12k|	}
 1019|       |
 1020|       |	// Write the remaining properties for each schema.
 1021|  8.71k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1021:57): [True: 6.19k, False: 2.52k]
  ------------------
 1022|  6.19k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1023|  6.19k|		SerializeCompactRDFElemProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1024|  6.19k|	}
 1025|       |	
 1026|       |	// Write the rdf:Description end tag.
 1027|       |	// *** Elide the end tag if everything (all props in all schema) is an attr.
 1028|  7.56k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (1028:30): [True: 5.04k, False: 2.52k]
  ------------------
 1029|  2.52k|	outputStr += kRDF_SchemaEnd;
 1030|  2.52k|	outputStr += newline;
 1031|       |
 1032|  2.52k|}	// SerializeCompactRDFSchemas
XMPMeta-Serialize.cpp:_ZL21DeclareUsedNamespacesPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_PKcSB_i:
  196|   102k|{
  197|       |
  198|   102k|	if ( currNode->options & kXMP_SchemaNode ) {
  ------------------
  |  Branch (198:7): [True: 13.5k, False: 88.4k]
  ------------------
  199|       |		// The schema node name is the URI, the value is the prefix.
  200|  13.5k|		DeclareOneNamespace ( currNode->value, currNode->name, usedNS, outputStr, newline, indentStr, indent );
  201|  88.4k|	} else if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (201:14): [True: 4.86k, False: 83.5k]
  ------------------
  202|  15.2k|		for ( size_t fieldNum = 0, fieldLim = currNode->children.size(); fieldNum < fieldLim; ++fieldNum ) {
  ------------------
  |  Branch (202:68): [True: 10.3k, False: 4.86k]
  ------------------
  203|  10.3k|			const XMP_Node * currField = currNode->children[fieldNum];
  204|  10.3k|			DeclareElemNamespace ( currField->name, usedNS, outputStr, newline, indentStr, indent );
  205|  10.3k|		}
  206|  4.86k|	}
  207|       |
  208|   170k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (208:67): [True: 68.9k, False: 102k]
  ------------------
  209|  68.9k|		const XMP_Node * currChild = currNode->children[childNum];
  210|  68.9k|		DeclareUsedNamespaces ( currChild, usedNS, outputStr, newline, indentStr, indent );
  211|  68.9k|	}
  212|       |
  213|   121k|	for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (213:67): [True: 19.4k, False: 102k]
  ------------------
  214|  19.4k|		const XMP_Node * currQual = currNode->qualifiers[qualNum];
  215|  19.4k|		DeclareElemNamespace ( currQual->name, usedNS, outputStr, newline, indentStr, indent );
  216|  19.4k|		DeclareUsedNamespaces ( currQual, usedNS, outputStr, newline, indentStr, indent );
  217|  19.4k|	}
  218|       |	
  219|   102k|}	// DeclareUsedNamespaces
XMPMeta-Serialize.cpp:_ZL19DeclareOneNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_RS5_S8_PKcSA_i:
  133|  43.4k|{
  134|  43.4k|	XMP_VarString boundedPrefix = ":";
  135|  43.4k|	boundedPrefix += nsPrefix;
  136|  43.4k|	size_t nsPos = usedNS.find ( boundedPrefix );
  137|       |
  138|  43.4k|	if ( nsPos == XMP_VarString::npos ) {
  ------------------
  |  Branch (138:7): [True: 11.3k, False: 32.1k]
  ------------------
  139|       |		
  140|  11.3k|		outputStr += newline;
  141|  56.5k|		for ( ; indent > 0; --indent ) outputStr += indentStr;
  ------------------
  |  Branch (141:11): [True: 45.2k, False: 11.3k]
  ------------------
  142|  11.3k|		outputStr += "xmlns:";
  143|  11.3k|		outputStr += nsPrefix;
  144|  11.3k|		if (outputStr[outputStr.size ( ) - 1] == ':')
  ------------------
  |  Branch (144:7): [True: 11.3k, False: 0]
  ------------------
  145|  11.3k|			outputStr[outputStr.size ( ) - 1] = '=';	// Change the colon to =.
  146|      0|		else
  147|      0|			outputStr += '=';
  148|  11.3k|		outputStr += '"';
  149|  11.3k|		outputStr += nsURI;
  150|  11.3k|		outputStr += '"';
  151|       |
  152|  11.3k|		usedNS += nsPrefix;
  153|       |
  154|  11.3k|	}
  155|       |
  156|  43.4k|}	// DeclareOneNamespace
XMPMeta-Serialize.cpp:_ZL20DeclareElemNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_S8_PKcSA_i:
  170|  29.8k|{
  171|  29.8k|	size_t colonPos = elemName.find ( ':' );
  172|       |
  173|  29.8k|	if ( colonPos != XMP_VarString::npos ) {
  ------------------
  |  Branch (173:7): [True: 29.8k, False: 0]
  ------------------
  174|  29.8k|		XMP_VarString nsPrefix ( elemName.substr ( 0, colonPos+1 ) );
  175|  29.8k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( nsPrefix );
  176|  29.8k|		XMP_Enforce ( prefixPos != sNamespacePrefixToURIMap->end() );
  ------------------
  |  |  148|  29.8k|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 29.8k]
  |  |  ------------------
  |  |  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|  29.8k|		DeclareOneNamespace ( nsPrefix, prefixPos->second, usedNS, outputStr, newline, indentStr, indent );
  178|  29.8k|	}
  179|       |
  180|  29.8k|}	// DeclareElemNamespace
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFAttrPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  687|  16.7k|{
  688|  16.7k|	size_t prop, propLim;
  689|  16.7k|	bool allAreAttrs = true;
  690|       |
  691|  46.7k|	for ( prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (691:57): [True: 29.9k, False: 16.7k]
  ------------------
  692|       |
  693|  29.9k|		const XMP_Node * currProp = parentNode->children[prop];
  694|  29.9k|		if ( ! CanBeRDFAttrProp ( currProp ) ) {
  ------------------
  |  Branch (694:8): [True: 5.52k, False: 24.4k]
  ------------------
  695|  5.52k|			allAreAttrs = false;
  696|  5.52k|			continue;
  697|  5.52k|		}
  698|       |		
  699|  24.4k|		outputStr += newline;
  700|   116k|		for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (700:35): [True: 92.2k, False: 24.4k]
  ------------------
  701|  24.4k|		outputStr += currProp->name;
  702|  24.4k|		outputStr += "=\"";
  703|  24.4k|		AppendNodeValue ( outputStr, currProp->value, kForAttribute );
  704|  24.4k|		outputStr += '"';
  705|       |
  706|  24.4k|	}
  707|       |	
  708|  16.7k|	return allAreAttrs;
  709|       |
  710|  16.7k|}	// SerializeCompactRDFAttrProps
XMPMeta-Serialize.cpp:_ZL16CanBeRDFAttrPropPK8XMP_Node:
  346|  89.1k|{
  347|       |	
  348|  89.1k|	if ( propNode->name[0] == '[' ) return false;
  ------------------
  |  Branch (348:7): [True: 35.9k, False: 53.2k]
  ------------------
  349|  53.2k|	if ( ! propNode->qualifiers.empty() ) return false;
  ------------------
  |  Branch (349:7): [True: 1.24k, False: 51.9k]
  ------------------
  350|  51.9k|	if ( propNode->options & kXMP_PropValueIsURI ) return false;
  ------------------
  |  Branch (350:7): [True: 0, False: 51.9k]
  ------------------
  351|  51.9k|	if ( propNode->options & kXMP_PropCompositeMask ) return false;
  ------------------
  |  Branch (351:7): [True: 10.6k, False: 41.3k]
  ------------------
  352|       |	
  353|  41.3k|	return true;
  354|       |	
  355|  51.9k|}	// CanBeRDFAttrProp
XMPMeta-Serialize.cpp:_ZL15AppendNodeValueRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_b:
  286|  78.3k|{
  287|       |
  288|  78.3k|	unsigned char * runStart = (unsigned char *) value.c_str();
  289|  78.3k|	unsigned char * runLimit  = runStart + value.size();
  290|  78.3k|	unsigned char * runEnd;
  291|  78.3k|	unsigned char   ch=0;
  292|       |	
  293|  3.95M|	while ( runStart < runLimit ) {
  ------------------
  |  Branch (293:10): [True: 3.87M, False: 78.3k]
  ------------------
  294|       |	
  295|  19.3M|		for ( runEnd = runStart; runEnd < runLimit; ++runEnd ) {
  ------------------
  |  Branch (295:28): [True: 19.2M, False: 68.0k]
  ------------------
  296|  19.2M|			ch = *runEnd;
  297|  19.2M|			if ( forAttribute && (ch == '"') ) break;
  ------------------
  |  Branch (297:9): [True: 17.8M, False: 1.36M]
  |  Branch (297:25): [True: 1.40M, False: 16.4M]
  ------------------
  298|  17.8M|			if ( (ch < 0x20) || (ch == '&') || (ch == '<') || (ch == '>') ) break;
  ------------------
  |  Branch (298:9): [True: 2.12M, False: 15.7M]
  |  Branch (298:24): [True: 389, False: 15.7M]
  |  Branch (298:39): [True: 369, False: 15.7M]
  |  Branch (298:54): [True: 275k, False: 15.4M]
  ------------------
  299|  17.8M|		}
  300|       |		
  301|  3.87M|		outputStr.append ( (char *) runStart, (runEnd - runStart) );
  302|       |		
  303|  3.87M|		if ( runEnd < runLimit ) {
  ------------------
  |  Branch (303:8): [True: 3.80M, False: 68.0k]
  ------------------
  304|       |
  305|  3.80M|			if ( ch < 0x20 ) {
  ------------------
  |  Branch (305:9): [True: 2.12M, False: 1.68M]
  ------------------
  306|       |			
  307|  2.12M|				XMP_Assert ( (ch == kTab) || (ch == kLF) || (ch == kCR) );
  ------------------
  |  |  142|  2.12M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  308|       |
  309|  2.12M|				char hexBuf[16];
  310|  2.12M|				memcpy ( hexBuf, "&#xn;", 5 );
  311|  2.12M|				hexBuf[3] = kHexDigits[ch&0xF];
  ------------------
  |  |   94|  2.12M|#define kHexDigits "0123456789ABCDEF"
  ------------------
  312|  2.12M|				outputStr.append ( hexBuf, 5 );
  313|       |
  314|  2.12M|			} else {
  315|       |
  316|  1.68M|				if ( ch == '"' ) {
  ------------------
  |  Branch (316:10): [True: 1.40M, False: 276k]
  ------------------
  317|  1.40M|					outputStr += "&quot;";
  318|  1.40M|				} else if ( ch == '<' ) {
  ------------------
  |  Branch (318:17): [True: 369, False: 276k]
  ------------------
  319|    369|					outputStr += "&lt;";
  320|   276k|				} else if ( ch == '>' ) {
  ------------------
  |  Branch (320:17): [True: 275k, False: 389]
  ------------------
  321|   275k|					outputStr += "&gt;";
  322|   275k|				} else {
  323|    389|					XMP_Assert ( ch == '&' );
  ------------------
  |  |  142|    389|	#define XMP_Assert(c)	((void) 0)
  ------------------
  324|    389|					outputStr += "&amp;";
  325|    389|				}
  326|       |
  327|  1.68M|			}
  328|       |
  329|  3.80M|			++runEnd;
  330|       |
  331|  3.80M|		}
  332|       |		
  333|  3.87M|		runStart = runEnd;
  334|       |	
  335|  3.87M|	}
  336|       |
  337|  78.3k|}	// AppendNodeValue
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFElemPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  758|  11.5k|{
  759|  11.5k|	XMP_Index level;
  760|       |
  761|  62.8k|	for ( size_t prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (761:64): [True: 51.3k, False: 11.5k]
  ------------------
  762|       |
  763|  51.3k|		const XMP_Node * propNode = parentNode->children[prop];
  764|  51.3k|		if ( CanBeRDFAttrProp ( propNode ) ) continue;
  ------------------
  |  Branch (764:8): [True: 9.44k, False: 41.8k]
  ------------------
  765|       |
  766|  41.8k|		bool emitEndTag = true;
  767|  41.8k|		bool indentEndTag = true;
  768|       |
  769|  41.8k|		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|  41.8k|		XMP_StringPtr elemName = propNode->name.c_str();
  777|  41.8k|		if ( *elemName == '[' ) elemName = "rdf:li";
  ------------------
  |  Branch (777:8): [True: 35.9k, False: 5.90k]
  ------------------
  778|       |
  779|   240k|		for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (779:25): [True: 198k, False: 41.8k]
  ------------------
  780|  41.8k|		outputStr += '<';
  781|  41.8k|		outputStr += elemName;
  782|       |
  783|  41.8k|		#define isCompact	false
  784|  41.8k|		bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  783|  41.8k|		#define isCompact	false
  ------------------
  785|  41.8k|		bool hasRDFResourceQual   = false;
  786|       |
  787|  60.4k|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (787:68): [True: 18.5k, False: 41.8k]
  ------------------
  788|  18.5k|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  789|  18.5k|			if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (789:9): [True: 3.71k, False: 14.8k]
  ------------------
  790|  3.71k|				hasGeneralQualifiers = true;
  791|  14.8k|			} else {
  792|  14.8k|				if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (792:10): [True: 0, False: 14.8k]
  ------------------
  793|  14.8k|				outputStr += ' ';
  794|  14.8k|				outputStr += currQual->name;
  795|  14.8k|				outputStr += "=\"";
  796|  14.8k|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  797|  14.8k|				outputStr += '"';
  798|  14.8k|			}
  799|  18.5k|		}
  800|       |		
  801|       |		// --------------------------------------------------------
  802|       |		// Process the property according to the standard patterns.
  803|       |	
  804|  41.8k|		if ( hasGeneralQualifiers ) {
  ------------------
  |  Branch (804:8): [True: 831, False: 41.0k]
  ------------------
  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|    831|			outputStr += " rdf:parseType=\"Resource\">";
  815|    831|			outputStr += newline;
  816|       |
  817|    831|			SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  818|       |		
  819|    831|			size_t qualNum = 0;
  820|    831|			size_t qualLim = propNode->qualifiers.size();
  821|    831|			if ( propNode->options & kXMP_PropHasLang ) ++qualNum;
  ------------------
  |  Branch (821:9): [True: 59, False: 772]
  ------------------
  822|       |			
  823|  4.54k|			for ( ; qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (823:12): [True: 3.71k, False: 831]
  ------------------
  824|  3.71k|				const XMP_Node * currQual = propNode->qualifiers[qualNum];
  825|  3.71k|				SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  826|  3.71k|			}
  827|       |			
  828|  41.0k|		} else {
  829|       |
  830|       |			// --------------------------------------------------------------------
  831|       |			// This node has only attribute qualifiers. Emit as a property element.
  832|       |			
  833|  41.0k|			if ( propForm == 0 ) {
  ------------------
  |  Branch (833:9): [True: 32.6k, False: 8.42k]
  ------------------
  834|       |			
  835|       |				// --------------------------
  836|       |				// This is a simple property.
  837|       |				
  838|  32.6k|				if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (838:10): [True: 0, False: 32.6k]
  ------------------
  839|      0|					outputStr += " rdf:resource=\"";
  840|      0|					AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  841|      0|					outputStr += "\"/>";
  842|      0|					outputStr += newline;
  843|      0|					emitEndTag = false;
  844|  32.6k|				} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (844:17): [True: 186, False: 32.4k]
  ------------------
  845|    186|					outputStr += "/>";
  846|    186|					outputStr += newline;
  847|    186|					emitEndTag = false;
  848|  32.4k|				} else {
  849|  32.4k|					outputStr += '>';
  850|  32.4k|					AppendNodeValue ( outputStr, propNode->value, kForElement );
  851|  32.4k|					indentEndTag = false;
  852|  32.4k|				}
  853|       |				
  854|  32.6k|			} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (854:16): [True: 4.87k, False: 3.55k]
  ------------------
  855|       |
  856|       |				// -----------------
  857|       |				// This is an array.
  858|       |				
  859|  4.87k|				outputStr += '>';
  860|  4.87k|				outputStr += newline;
  861|  4.87k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  862|       |			
  863|  4.87k|				if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (863:10): [True: 0, False: 4.87k]
  ------------------
  864|  4.87k|				SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+2 );
  865|       |
  866|  4.87k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  867|       |
  868|  4.87k|			} else {
  869|       |
  870|       |				// ----------------------
  871|       |				// This must be a struct.
  872|       |				
  873|  3.55k|				XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|  3.55k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  874|       |
  875|  3.55k|				bool hasAttrFields = false;
  876|  3.55k|				bool hasElemFields = false;
  877|       |			
  878|  3.55k|				size_t field, fieldLim;
  879|  11.3k|				for ( field = 0, fieldLim = propNode->children.size(); field != fieldLim; ++field ) {
  ------------------
  |  Branch (879:60): [True: 7.86k, False: 3.49k]
  ------------------
  880|  7.86k|					XMP_Node * currField = propNode->children[field];
  881|  7.86k|					if ( CanBeRDFAttrProp ( currField ) ) {
  ------------------
  |  Branch (881:11): [True: 7.42k, False: 444]
  ------------------
  882|  7.42k|						hasAttrFields = true;
  883|  7.42k|						if ( hasElemFields ) break;	// No sense looking further.
  ------------------
  |  Branch (883:12): [True: 6, False: 7.41k]
  ------------------
  884|  7.42k|					} else {
  885|    444|						hasElemFields = true;
  886|    444|						if ( hasAttrFields ) break;	// No sense looking further.
  ------------------
  |  Branch (886:12): [True: 58, False: 386]
  ------------------
  887|    444|					}
  888|  7.86k|				}
  889|       |				
  890|  3.55k|				if ( hasRDFResourceQual && hasElemFields ) {
  ------------------
  |  Branch (890:10): [True: 0, False: 3.55k]
  |  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|  3.55k|				if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (894:10): [True: 7, False: 3.54k]
  ------------------
  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|  3.54k|				} else if ( ! hasElemFields ) {
  ------------------
  |  Branch (902:17): [True: 3.10k, False: 444]
  ------------------
  903|       |
  904|       |					// All fields can be attributes, use the emptyPropertyElt form.
  905|  3.10k|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+1 );
  906|  3.10k|					outputStr += "/>";
  907|  3.10k|					outputStr += newline;
  908|  3.10k|					emitEndTag = false;
  909|       |
  910|  3.10k|				} else if ( ! hasAttrFields ) {
  ------------------
  |  Branch (910:17): [True: 380, False: 64]
  ------------------
  911|       |				
  912|       |					// All fields must be elements, use the parseTypeResourcePropertyElt form.
  913|    380|					outputStr += " rdf:parseType=\"Resource\">";
  914|    380|					outputStr += newline;
  915|    380|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  916|       |				
  917|    380|				} else {
  918|       |				
  919|       |					// Have a mix of attributes and elements, use an inner rdf:Description.
  920|     64|					outputStr += '>';
  921|     64|					outputStr += newline;
  922|    392|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (922:30): [True: 328, False: 64]
  ------------------
  923|     64|					outputStr += "<rdf:Description";
  924|     64|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+2 );
  925|     64|					outputStr += ">";
  926|     64|					outputStr += newline;
  927|     64|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  928|    392|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (928:30): [True: 328, False: 64]
  ------------------
  929|     64|					outputStr += kRDF_StructEnd;
  930|     64|					outputStr += newline;
  931|       |
  932|     64|				}
  933|       |
  934|  3.55k|			}
  935|       |
  936|  41.0k|		}
  937|       |		
  938|       |		// ----------------------------------
  939|       |		// Emit the property element end tag.
  940|       |		
  941|  41.8k|		if ( emitEndTag ) {
  ------------------
  |  Branch (941:8): [True: 38.5k, False: 3.29k]
  ------------------
  942|  38.5k|			if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (942:9): [True: 6.14k, False: 32.4k]
  |  Branch (942:46): [True: 22.5k, False: 6.14k]
  ------------------
  943|  38.5k|			outputStr += "</";
  944|  38.5k|			outputStr += elemName;
  945|  38.5k|			outputStr += '>';
  946|  38.5k|			outputStr += newline;
  947|  38.5k|		}
  948|       |
  949|  41.8k|	}
  950|       |	
  951|  11.5k|}	// SerializeCompactRDFElemProps
XMPMeta-Serialize.cpp:_ZL18IsRDFAttrQualifierNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  366|  24.9k|{
  367|       |
  368|  74.9k|	for ( size_t i = 0; *sAttrQualifiers[i] != 0; ++i ) {
  ------------------
  |  Branch (368:22): [True: 64.9k, False: 10.0k]
  ------------------
  369|  64.9k|		if ( qualName == sAttrQualifiers[i] ) return true;
  ------------------
  |  Branch (369:8): [True: 14.9k, False: 50.0k]
  ------------------
  370|  64.9k|	}
  371|       |
  372|  10.0k|	return false;
  373|       |	
  374|  24.9k|}	// IsRDFAttrQualifier
XMPMeta-Serialize.cpp:_ZL26SerializePrettyRDFPropertyPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_ib:
  415|  8.84k|{
  416|  8.84k|	XMP_Index level;
  417|  8.84k|	bool emitEndTag   = true;
  418|  8.84k|	bool indentEndTag = true;
  419|       |
  420|  8.84k|	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|  8.84k|	XMP_StringPtr elemName = propNode->name.c_str();
  426|  8.84k|	if ( emitAsRDFValue ) {
  ------------------
  |  Branch (426:7): [True: 1.63k, False: 7.21k]
  ------------------
  427|  1.63k|		elemName= "rdf:value";
  428|  7.21k|	} else if ( *elemName == '[' ) {
  ------------------
  |  Branch (428:14): [True: 167, False: 7.04k]
  ------------------
  429|    167|		elemName = "rdf:li";
  430|    167|	}
  431|       |
  432|  62.1k|	for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (432:24): [True: 53.2k, False: 8.84k]
  ------------------
  433|  8.84k|	outputStr += '<';
  434|  8.84k|	outputStr += elemName;
  435|       |	
  436|  8.84k|	#define isCompact	false
  437|  8.84k|	bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  436|  8.84k|	#define isCompact	false
  ------------------
  438|  8.84k|	bool hasRDFResourceQual   = false;
  439|       |	
  440|  14.3k|	for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (440:67): [True: 5.50k, False: 8.84k]
  ------------------
  441|  5.50k|		const XMP_Node * currQual = propNode->qualifiers[qualNum];
  442|  5.50k|		if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (442:8): [True: 5.43k, False: 73]
  ------------------
  443|  5.43k|			hasGeneralQualifiers = true;
  444|  5.43k|		} else {
  445|     73|			if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (445:9): [True: 0, False: 73]
  ------------------
  446|     73|			if ( ! emitAsRDFValue ) {
  ------------------
  |  Branch (446:9): [True: 14, False: 59]
  ------------------
  447|     14|				outputStr += ' ';
  448|     14|				outputStr += currQual->name;
  449|     14|				outputStr += "=\"";
  450|     14|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  451|     14|				outputStr += '"';
  452|     14|			}
  453|     73|		}
  454|  5.50k|	}
  455|       |	
  456|       |	// --------------------------------------------------------
  457|       |	// Process the property according to the standard patterns.
  458|       |	
  459|  8.84k|	if ( hasGeneralQualifiers && (! emitAsRDFValue) ) {
  ------------------
  |  Branch (459:7): [True: 2.43k, False: 6.40k]
  |  Branch (459:31): [True: 803, False: 1.63k]
  ------------------
  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|    803|		if ( hasRDFResourceQual ) {
  ------------------
  |  Branch (465:8): [True: 0, False: 803]
  ------------------
  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|    803|		outputStr += " rdf:parseType=\"Resource\">";
  470|    803|		outputStr += newline;
  471|       |
  472|    803|		SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  473|       |		
  474|  1.66k|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (474:68): [True: 862, False: 803]
  ------------------
  475|    862|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  476|    862|			if ( IsRDFAttrQualifier ( currQual->name ) ) continue;
  ------------------
  |  Branch (476:9): [True: 0, False: 862]
  ------------------
  477|    862|			SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  478|    862|		}
  479|       |		
  480|  8.04k|	} else {
  481|       |
  482|       |		// --------------------------------------------------------------------
  483|       |		// This node has no general qualifiers. Emit using an unqualified form.
  484|       |		
  485|  8.04k|		if ( propForm == 0 ) {
  ------------------
  |  Branch (485:8): [True: 6.62k, False: 1.41k]
  ------------------
  486|       |		
  487|       |			// --------------------------
  488|       |			// This is a simple property.
  489|       |			
  490|  6.62k|			if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (490:9): [True: 0, False: 6.62k]
  ------------------
  491|      0|				outputStr += " rdf:resource=\"";
  492|      0|				AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  493|      0|				outputStr += "\"/>";
  494|      0|				outputStr += newline;
  495|      0|				emitEndTag = false;
  496|  6.62k|			} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (496:16): [True: 65, False: 6.56k]
  ------------------
  497|     65|				outputStr += "/>";
  498|     65|				outputStr += newline;
  499|     65|				emitEndTag = false;
  500|  6.56k|			} else {
  501|  6.56k|				outputStr += '>';
  502|  6.56k|				AppendNodeValue ( outputStr, propNode->value, kForElement );
  503|  6.56k|				indentEndTag = false;
  504|  6.56k|			}
  505|       |			
  506|  6.62k|		} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (506:15): [True: 106, False: 1.30k]
  ------------------
  507|       |		
  508|       |			// This is an array.
  509|    106|			outputStr += '>';
  510|    106|			outputStr += newline;
  511|    106|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  512|    106|			if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (512:9): [True: 0, False: 106]
  ------------------
  513|    273|			for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (513:69): [True: 167, False: 106]
  ------------------
  514|    167|				const XMP_Node * currChild = propNode->children[childNum];
  515|    167|				SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+2 );
  516|    167|			}
  517|    106|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  518|       |		
  519|       |		
  520|  1.30k|		} else if ( ! hasRDFResourceQual ) {
  ------------------
  |  Branch (520:15): [True: 1.30k, False: 0]
  ------------------
  521|       |		
  522|       |			// This is a "normal" struct, use the rdf:parseType="Resource" form.
  523|  1.30k|			XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|  1.30k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  524|  1.30k|			if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (524:9): [True: 433, False: 875]
  ------------------
  525|    433|				outputStr += " rdf:parseType=\"Resource\"/>";
  526|    433|				outputStr += newline;
  527|    433|				emitEndTag = false;
  528|    875|			} else {
  529|    875|				outputStr += " rdf:parseType=\"Resource\">";
  530|    875|				outputStr += newline;
  531|  3.34k|				for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (531:70): [True: 2.47k, False: 875]
  ------------------
  532|  2.47k|					const XMP_Node * currChild = propNode->children[childNum];
  533|  2.47k|					SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+1 );
  534|  2.47k|				}
  535|    875|			}
  536|       |		
  537|  1.30k|		} 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|  8.04k|	}
  561|       |	
  562|       |	// ----------------------------------
  563|       |	// Emit the property element end tag.
  564|       |	
  565|  8.84k|	if ( emitEndTag ) {
  ------------------
  |  Branch (565:7): [True: 8.34k, False: 498]
  ------------------
  566|  11.5k|		if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (566:8): [True: 1.78k, False: 6.56k]
  |  Branch (566:45): [True: 9.76k, False: 1.78k]
  ------------------
  567|  8.34k|		outputStr += "</";
  568|  8.34k|		outputStr += elemName;
  569|  8.34k|		outputStr += '>';
  570|  8.34k|		outputStr += newline;
  571|  8.34k|	}
  572|       |	
  573|  8.84k|}	// SerializePrettyRDFProperty
XMPMeta-Serialize.cpp:_ZL15EmitRDFArrayTagjRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKcS8_iib:
  240|  9.95k|{
  241|  9.95k|	if ( (! isStartTag) && (arraySize == 0) ) return;
  ------------------
  |  Branch (241:7): [True: 4.97k, False: 4.97k]
  |  Branch (241:25): [True: 1.91k, False: 3.06k]
  ------------------
  242|       |	
  243|  44.4k|	for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (243:34): [True: 36.4k, False: 8.04k]
  ------------------
  244|  8.04k|	if ( isStartTag ) {
  ------------------
  |  Branch (244:7): [True: 4.97k, False: 3.06k]
  ------------------
  245|  4.97k|		outputStr += "<rdf:";
  246|  4.97k|	} else {
  247|  3.06k|		outputStr += "</rdf:";
  248|  3.06k|	}
  249|       |
  250|  8.04k|	if ( arrayForm & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (250:7): [True: 2.62k, False: 5.41k]
  ------------------
  251|  2.62k|		outputStr += "Alt";
  252|  5.41k|	} else if ( arrayForm & kXMP_PropArrayIsOrdered ) {
  ------------------
  |  Branch (252:14): [True: 5.09k, False: 325]
  ------------------
  253|  5.09k|		outputStr += "Seq";
  254|  5.09k|	} else {
  255|    325|		outputStr += "Bag";
  256|    325|	}
  257|       |	
  258|  8.04k|	if ( isStartTag && (arraySize == 0) ) outputStr += '/';
  ------------------
  |  Branch (258:7): [True: 4.97k, False: 3.06k]
  |  Branch (258:21): [True: 1.91k, False: 3.06k]
  ------------------
  259|  8.04k|	outputStr += '>';
  260|  8.04k|	outputStr += newline;
  261|       |
  262|  8.04k|}	// EmitRDFArrayTag

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

