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

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

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

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

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|    745|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    745|    setMsg(1);
  245|    745|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|    746|std::basic_string<charT> toBasicString(const T& arg) {
  154|    746|  std::basic_ostringstream<charT> os;
  155|    746|  os << arg;
  156|    746|  return os.str();
  157|    746|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  2.99k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  2.99k|  std::basic_ostringstream<charT> os;
  155|  2.99k|  os << arg;
  156|  2.99k|  return os.str();
  157|  2.99k|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|    170|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    170|    setMsg(1);
  245|    170|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    170|std::basic_string<charT> toBasicString(const T& arg) {
  154|    170|  std::basic_ostringstream<charT> os;
  155|    170|  os << arg;
  156|    170|  return os.str();
  157|    170|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|  1.45k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.45k|    setMsg(1);
  245|  1.45k|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  1.45k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.45k|  std::basic_ostringstream<charT> os;
  155|  1.45k|  os << arg;
  156|  1.45k|  return os.str();
  157|  1.45k|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|  2.99k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  2.99k|    setMsg(1);
  245|  2.99k|  }
_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|     24|std::basic_string<charT> toBasicString(const T& arg) {
  154|     24|  std::basic_ostringstream<charT> os;
  155|     24|  os << arg;
  156|     24|  return os.str();
  157|     24|}
_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEjEENS_9ErrorCodeERKT_RKT0_:
  250|      1|      code_(code), arg1_(toBasicString<char>(arg1)), arg2_(toBasicString<char>(arg2)) {
  251|      1|    setMsg(2);
  252|      1|  }
_ZN5Exiv213toBasicStringIcjEENSt3__112basic_stringIT_NS1_11char_traitsIS3_EENS1_9allocatorIS3_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|}
_ZN5Exiv25ErrorC2IPKcEENS_9ErrorCodeERKT_:
  243|     24|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|     24|    setMsg(1);
  245|     24|  }

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  8.62M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  12.3M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   511k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  158|  4.40M|  [[nodiscard]] auto begin() noexcept {
  159|  4.40M|    return pData_.begin();
  160|  4.40M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  42.4k|  [[nodiscard]] auto end() noexcept {
  163|  42.4k|    return pData_.end();
  164|  42.4k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  19.5k|  [[nodiscard]] auto begin() const noexcept {
  167|  19.5k|    return pData_.begin();
  168|  19.5k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  19.3k|  [[nodiscard]] auto end() const noexcept {
  171|  19.3k|    return pData_.end();
  172|  19.3k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  7.42M|  [[nodiscard]] size_t size() const {
  175|  7.42M|    return pData_.size();
  176|  7.42M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  56.5k|  [[nodiscard]] bool empty() const {
  208|  56.5k|    return pData_.empty();
  209|  56.5k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  1.78M|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  11.8k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  39.7k|const T* find(T (&src)[N], const K& key) {
  461|  39.7k|  static_assert(N > 0, "Passed zero length find");
  462|  39.7k|  auto rc = std::find(src, src + N, key);
  463|  39.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 39.7k]
  ------------------
  464|  39.7k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  76.3k|std::string toString(const T& arg) {
  480|  76.3k|  return toStringHelper(arg, std::is_integral<T>());
  481|  76.3k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  76.3k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  76.3k|  return std::to_string(arg);
  470|  76.3k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  57.3M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  57.3M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 1.13M, False: 56.2M]
  ------------------
  242|  1.13M|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|  1.13M|  }
  244|  56.2M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  57.3M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|   890k|const T* find(T (&src)[N], const K& key) {
  461|   890k|  static_assert(N > 0, "Passed zero length find");
  462|   890k|  auto rc = std::find(src, src + N, key);
  463|   890k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 883k, False: 6.89k]
  ------------------
  464|   890k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  8.67M|const T* find(T (&src)[N], const K& key) {
  461|  8.67M|  static_assert(N > 0, "Passed zero length find");
  462|  8.67M|  auto rc = std::find(src, src + N, key);
  463|  8.67M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.69M, False: 5.98M]
  ------------------
  464|  8.67M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     11|T stringTo(const std::string& s, bool& ok) {
  496|     11|  std::istringstream is(s);
  497|     11|  T tmp = T();
  498|     11|  ok = static_cast<bool>(is >> tmp);
  499|     11|  std::string rest;
  500|     11|  is >> std::skipws >> rest;
  501|     11|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 0, False: 11]
  ------------------
  502|      0|    ok = false;
  503|     11|  return tmp;
  504|     11|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  19.5k|std::string toString(const T& arg) {
  480|  19.5k|  return toStringHelper(arg, std::is_integral<T>());
  481|  19.5k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  19.5k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  19.5k|  return std::to_string(arg);
  470|  19.5k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  2.49k|std::string toString(const T& arg) {
  480|  2.49k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.49k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  2.49k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  2.49k|  return std::to_string(arg);
  470|  2.49k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   136k|std::string toString(const T& arg) {
  480|   136k|  return toStringHelper(arg, std::is_integral<T>());
  481|   136k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   136k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   136k|  return std::to_string(arg);
  470|   136k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.64k|std::string toString(const T& arg) {
  480|  3.64k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.64k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  3.64k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  3.64k|  std::ostringstream os;
  475|  3.64k|  os << arg;
  476|  3.64k|  return os.str();
  477|  3.64k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   126k|std::string toString(const T& arg) {
  480|   126k|  return toStringHelper(arg, std::is_integral<T>());
  481|   126k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   126k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   126k|  std::ostringstream os;
  475|   126k|  os << arg;
  476|   126k|  return os.str();
  477|   126k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  78.6k|std::string toString(const T& arg) {
  480|  78.6k|  return toStringHelper(arg, std::is_integral<T>());
  481|  78.6k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  78.6k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  78.6k|  return std::to_string(arg);
  470|  78.6k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|    937|const T* find(T (&src)[N], const K& key) {
  461|    937|  static_assert(N > 0, "Passed zero length find");
  462|    937|  auto rc = std::find(src, src + N, key);
  463|    937|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 554, False: 383]
  ------------------
  464|    937|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|    493|const T* find(T (&src)[N], const K& key) {
  461|    493|  static_assert(N > 0, "Passed zero length find");
  462|    493|  auto rc = std::find(src, src + N, key);
  463|    493|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 188, False: 305]
  ------------------
  464|    493|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|    747|const T* find(T (&src)[N], const K& key) {
  461|    747|  static_assert(N > 0, "Passed zero length find");
  462|    747|  auto rc = std::find(src, src + N, key);
  463|    747|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 633, False: 114]
  ------------------
  464|    747|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|  54.3k|const T* find(T (&src)[N], const K& key) {
  461|  54.3k|  static_assert(N > 0, "Passed zero length find");
  462|  54.3k|  auto rc = std::find(src, src + N, key);
  463|  54.3k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.40k, False: 52.9k]
  ------------------
  464|  54.3k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  3.79k|const T* find(T (&src)[N], const K& key) {
  461|  3.79k|  static_assert(N > 0, "Passed zero length find");
  462|  3.79k|  auto rc = std::find(src, src + N, key);
  463|  3.79k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.25k, False: 1.54k]
  ------------------
  464|  3.79k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  5.66k|const T* find(T (&src)[N], const K& key) {
  461|  5.66k|  static_assert(N > 0, "Passed zero length find");
  462|  5.66k|  auto rc = std::find(src, src + N, key);
  463|  5.66k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.34k, False: 2.32k]
  ------------------
  464|  5.66k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  1.96k|const T* find(T (&src)[N], const K& key) {
  461|  1.96k|  static_assert(N > 0, "Passed zero length find");
  462|  1.96k|  auto rc = std::find(src, src + N, key);
  463|  1.96k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.34k, False: 620]
  ------------------
  464|  1.96k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  1.33k|std::string toString(const T& arg) {
  480|  1.33k|  return toStringHelper(arg, std::is_integral<T>());
  481|  1.33k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  1.33k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  1.33k|  std::ostringstream os;
  475|  1.33k|  os << arg;
  476|  1.33k|  return os.str();
  477|  1.33k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|    770|std::string toString(const T& arg) {
  480|    770|  return toStringHelper(arg, std::is_integral<T>());
  481|    770|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|    770|std::string toStringHelper(const T& arg, std::true_type) {
  469|    770|  return std::to_string(arg);
  470|    770|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   390k|std::string toString(const T& arg) {
  480|   390k|  return toStringHelper(arg, std::is_integral<T>());
  481|   390k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   390k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   390k|  std::ostringstream os;
  475|   390k|  os << arg;
  476|   390k|  return os.str();
  477|   390k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.27k|const T* find(T (&src)[N], const K& key) {
  461|  1.27k|  static_assert(N > 0, "Passed zero length find");
  462|  1.27k|  auto rc = std::find(src, src + N, key);
  463|  1.27k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.17k, False: 104]
  ------------------
  464|  1.27k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  7.26k|const T* find(T (&src)[N], const K& key) {
  461|  7.26k|  static_assert(N > 0, "Passed zero length find");
  462|  7.26k|  auto rc = std::find(src, src + N, key);
  463|  7.26k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.50k, False: 3.76k]
  ------------------
  464|  7.26k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  7.26k|const T* find(T (&src)[N], const K& key) {
  461|  7.26k|  static_assert(N > 0, "Passed zero length find");
  462|  7.26k|  auto rc = std::find(src, src + N, key);
  463|  7.26k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 6.68k, False: 579]
  ------------------
  464|  7.26k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  4.86k|const T* find(T (&src)[N], const K& key) {
  461|  4.86k|  static_assert(N > 0, "Passed zero length find");
  462|  4.86k|  auto rc = std::find(src, src + N, key);
  463|  4.86k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.07k, False: 1.78k]
  ------------------
  464|  4.86k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  460|   102k|const T* find(T (&src)[N], const K& key) {
  461|   102k|  static_assert(N > 0, "Passed zero length find");
  462|   102k|  auto rc = std::find(src, src + N, key);
  463|   102k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 90.5k, False: 11.6k]
  ------------------
  464|   102k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  24.0k|const T* find(T (&src)[N], const K& key) {
  461|  24.0k|  static_assert(N > 0, "Passed zero length find");
  462|  24.0k|  auto rc = std::find(src, src + N, key);
  463|  24.0k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 10.0k, False: 13.9k]
  ------------------
  464|  24.0k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  3.88k|const T* find(T (&src)[N], const K& key) {
  461|  3.88k|  static_assert(N > 0, "Passed zero length find");
  462|  3.88k|  auto rc = std::find(src, src + N, key);
  463|  3.88k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.91k, False: 970]
  ------------------
  464|  3.88k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  3.88k|const T* find(T (&src)[N], const K& key) {
  461|  3.88k|  static_assert(N > 0, "Passed zero length find");
  462|  3.88k|  auto rc = std::find(src, src + N, key);
  463|  3.88k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.45k, False: 1.42k]
  ------------------
  464|  3.88k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|    462|const T* find(T (&src)[N], const K& key) {
  461|    462|  static_assert(N > 0, "Passed zero length find");
  462|    462|  auto rc = std::find(src, src + N, key);
  463|    462|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 177, False: 285]
  ------------------
  464|    462|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   114k|const T* find(T (&src)[N], const K& key) {
  461|   114k|  static_assert(N > 0, "Passed zero length find");
  462|   114k|  auto rc = std::find(src, src + N, key);
  463|   114k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 101k, False: 13.6k]
  ------------------
  464|   114k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|  75.8k|const T* find(T (&src)[N], const K& key) {
  461|  75.8k|  static_assert(N > 0, "Passed zero length find");
  462|  75.8k|  auto rc = std::find(src, src + N, key);
  463|  75.8k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 73.1k, False: 2.64k]
  ------------------
  464|  75.8k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  2.37k|const T* find(T (&src)[N], const K& key) {
  461|  2.37k|  static_assert(N > 0, "Passed zero length find");
  462|  2.37k|  auto rc = std::find(src, src + N, key);
  463|  2.37k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 336, False: 2.03k]
  ------------------
  464|  2.37k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  4.79k|const T* find(T (&src)[N], const K& key) {
  461|  4.79k|  static_assert(N > 0, "Passed zero length find");
  462|  4.79k|  auto rc = std::find(src, src + N, key);
  463|  4.79k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.08k, False: 2.71k]
  ------------------
  464|  4.79k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  6.95M|const T* find(T (&src)[N], const K& key) {
  461|  6.95M|  static_assert(N > 0, "Passed zero length find");
  462|  6.95M|  auto rc = std::find(src, src + N, key);
  463|  6.95M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 6.95M]
  ------------------
  464|  6.95M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  5.70M|const T* find(T (&src)[N], const K& key) {
  461|  5.70M|  static_assert(N > 0, "Passed zero length find");
  462|  5.70M|  auto rc = std::find(src, src + N, key);
  463|  5.70M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 5.70M]
  ------------------
  464|  5.70M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  4.64M|const T* find(T (&src)[N], const K& key) {
  461|  4.64M|  static_assert(N > 0, "Passed zero length find");
  462|  4.64M|  auto rc = std::find(src, src + N, key);
  463|  4.64M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.63M, False: 10.8k]
  ------------------
  464|  4.64M|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  4.17k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|  88.2k|const T* find(T (&src)[N], const K& key) {
  461|  88.2k|  static_assert(N > 0, "Passed zero length find");
  462|  88.2k|  auto rc = std::find(src, src + N, key);
  463|  88.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 28.7k, False: 59.4k]
  ------------------
  464|  88.2k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|  1.02M|const T* find(T (&src)[N], const K& key) {
  461|  1.02M|  static_assert(N > 0, "Passed zero length find");
  462|  1.02M|  auto rc = std::find(src, src + N, key);
  463|  1.02M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 76, False: 1.02M]
  ------------------
  464|  1.02M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  17.2k|const T* find(T (&src)[N], const K& key) {
  461|  17.2k|  static_assert(N > 0, "Passed zero length find");
  462|  17.2k|  auto rc = std::find(src, src + N, key);
  463|  17.2k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.18k, False: 12.0k]
  ------------------
  464|  17.2k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  460|  7.91k|const T* find(T (&src)[N], const K& key) {
  461|  7.91k|  static_assert(N > 0, "Passed zero length find");
  462|  7.91k|  auto rc = std::find(src, src + N, key);
  463|  7.91k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 7.91k]
  ------------------
  464|  7.91k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|  1.32k|const T* find(T (&src)[N], const K& key) {
  461|  1.32k|  static_assert(N > 0, "Passed zero length find");
  462|  1.32k|  auto rc = std::find(src, src + N, key);
  463|  1.32k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 332, False: 989]
  ------------------
  464|  1.32k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    197|T stringTo(const std::string& s, bool& ok) {
  496|    197|  std::istringstream is(s);
  497|    197|  T tmp = T();
  498|    197|  ok = static_cast<bool>(is >> tmp);
  499|    197|  std::string rest;
  500|    197|  is >> std::skipws >> rest;
  501|    197|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 81, False: 116]
  ------------------
  502|     81|    ok = false;
  503|    197|  return tmp;
  504|    197|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|     57|const T* find(T (&src)[N], const K& key) {
  461|     57|  static_assert(N > 0, "Passed zero length find");
  462|     57|  auto rc = std::find(src, src + N, key);
  463|     57|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 57, False: 0]
  ------------------
  464|     57|}

_ZNK5Exiv25Value6typeIdEv:
   85|  8.05M|  TypeId typeId() const {
   86|  8.05M|    return type_;
   87|  8.05M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  11.4M|  UniquePtr clone() const {
   94|  11.4M|    return UniquePtr(clone_());
   95|  11.4M|  }
_ZNK5Exiv25Value2okEv:
  181|   119k|  bool ok() const {
  182|   119k|    return ok_;
  183|   119k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  32.2k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  32.2k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 18.6k, False: 13.5k]
  ------------------
  797|  18.6k|      return str1.size() > str2.size();
  798|       |
  799|  13.5k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  13.5k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  32.2k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|  64.8k|inline TypeId getType<uint16_t>() {
 1084|  64.8k|  return unsignedShort;
 1085|  64.8k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  4.43k|inline TypeId getType<uint32_t>() {
 1089|  4.43k|  return unsignedLong;
 1090|  4.43k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  12.9k|inline TypeId getType<URational>() {
 1094|  12.9k|  return unsignedRational;
 1095|  12.9k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  26.3k|inline TypeId getType<int16_t>() {
 1099|  26.3k|  return signedShort;
 1100|  26.3k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  29.9k|inline TypeId getType<int32_t>() {
 1104|  29.9k|  return signedLong;
 1105|  29.9k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  11.5k|inline TypeId getType<Rational>() {
 1109|  11.5k|  return signedRational;
 1110|  11.5k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  6.64k|inline TypeId getType<float>() {
 1114|  6.64k|  return tiffFloat;
 1115|  6.64k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  12.1k|inline TypeId getType<double>() {
 1119|  12.1k|  return tiffDouble;
 1120|  12.1k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|   680k|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|   680k|  return getUShort(buf, byteOrder);
 1316|   680k|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  2.10M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  2.10M|  return getULong(buf, byteOrder);
 1321|  2.10M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   856k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   856k|  return getURational(buf, byteOrder);
 1326|   856k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|   606k|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|   606k|  return getShort(buf, byteOrder);
 1331|   606k|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   593k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   593k|  return getLong(buf, byteOrder);
 1336|   593k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   129k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   129k|  return getRational(buf, byteOrder);
 1341|   129k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|  48.5k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|  48.5k|  return getFloat(buf, byteOrder);
 1346|  48.5k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   282k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   282k|  return getDouble(buf, byteOrder);
 1351|   282k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|   193k|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|   193k|  return us2Data(buf, t, byteOrder);
 1374|   193k|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|   777k|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|   777k|  return ul2Data(buf, t, byteOrder);
 1382|   777k|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   713k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   713k|  return ur2Data(buf, t, byteOrder);
 1390|   713k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   222k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   222k|  return s2Data(buf, t, byteOrder);
 1398|   222k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   459k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   459k|  return l2Data(buf, t, byteOrder);
 1406|   459k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   134k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   134k|  return r2Data(buf, t, byteOrder);
 1414|   134k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|  80.6k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|  80.6k|  return f2Data(buf, t, byteOrder);
 1422|  80.6k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   189k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   189k|  return d2Data(buf, t, byteOrder);
 1430|   189k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  3.74k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  3.74k|  return float_to_integer_helper<int64_t>(n);
 1550|  3.74k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  11.2k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  11.2k|  return float_to_integer_helper<uint32_t>(n);
 1555|  11.2k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  12.0k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  12.0k|  return float_to_integer_helper<int64_t>(n);
 1560|  12.0k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  13.7k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  13.7k|  return float_to_integer_helper<uint32_t>(n);
 1564|  13.7k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  3.77k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  3.77k|  return rational_to_integer_helper<int64_t>(n);
 1569|  3.77k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  5.48k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  5.48k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  5.48k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  3.10k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  3.10k|  return rational_to_integer_helper<int64_t>(n);
 1578|  3.10k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  10.1k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  10.1k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  10.1k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  3.74k|  I float_to_integer_helper(size_t n) const {
 1213|  3.74k|    const auto v = value_.at(n);
 1214|  3.74k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.27k, False: 470]
  ------------------
 1215|  3.27k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.66k, False: 609]
  ------------------
 1216|  2.66k|      return static_cast<I>(std::lround(v));
 1217|  2.66k|    }
 1218|  1.07k|    return 0;
 1219|  3.74k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  11.2k|  I float_to_integer_helper(size_t n) const {
 1213|  11.2k|    const auto v = value_.at(n);
 1214|  11.2k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 9.26k, False: 1.98k]
  ------------------
 1215|  9.26k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 7.85k, False: 1.41k]
  ------------------
 1216|  7.85k|      return static_cast<I>(std::lround(v));
 1217|  7.85k|    }
 1218|  3.39k|    return 0;
 1219|  11.2k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  12.0k|  I float_to_integer_helper(size_t n) const {
 1213|  12.0k|    const auto v = value_.at(n);
 1214|  12.0k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 10.6k, False: 1.38k]
  ------------------
 1215|  10.6k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 8.83k, False: 1.80k]
  ------------------
 1216|  8.83k|      return static_cast<I>(std::lround(v));
 1217|  8.83k|    }
 1218|  3.18k|    return 0;
 1219|  12.0k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  13.7k|  I float_to_integer_helper(size_t n) const {
 1213|  13.7k|    const auto v = value_.at(n);
 1214|  13.7k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 10.6k, False: 3.09k]
  ------------------
 1215|  10.6k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 9.41k, False: 1.26k]
  ------------------
 1216|  9.41k|      return static_cast<I>(std::lround(v));
 1217|  9.41k|    }
 1218|  4.36k|    return 0;
 1219|  13.7k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  3.77k|  I rational_to_integer_helper(size_t n) const {
 1224|  3.77k|    auto a = value_.at(n).first;
 1225|  3.77k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  3.77k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.44k, False: 2.33k]
  ------------------
 1229|  1.44k|      return 0;
 1230|  1.44k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  2.33k|#ifdef __cpp_if_constexpr
 1234|  2.33k|    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.33k|      const auto imin = std::numeric_limits<I>::min();
 1240|  2.33k|      const auto imax = std::numeric_limits<I>::max();
 1241|  2.33k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 2.33k]
  |  Branch (1241:23): [True: 0, False: 2.33k]
  |  Branch (1241:35): [True: 0, False: 2.33k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  2.33k|#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.33k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  3.77k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  5.48k|  I rational_to_integer_helper(size_t n) const {
 1224|  5.48k|    auto a = value_.at(n).first;
 1225|  5.48k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  5.48k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.45k, False: 4.03k]
  ------------------
 1229|  1.45k|      return 0;
 1230|  1.45k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  4.03k|#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|  4.03k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  4.03k|      const auto imax = std::numeric_limits<I>::max();
 1257|  4.03k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 728, False: 3.30k]
  ------------------
 1258|    728|        return 0;
 1259|    728|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  3.30k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  3.30k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  3.30k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 3.30k]
  |  Branch (1263:25): [True: 0, False: 3.30k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  3.30k|    }
 1267|       |
 1268|  3.30k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  5.48k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  3.10k|  I rational_to_integer_helper(size_t n) const {
 1224|  3.10k|    auto a = value_.at(n).first;
 1225|  3.10k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  3.10k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 988, False: 2.11k]
  ------------------
 1229|    988|      return 0;
 1230|    988|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  2.11k|#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|  2.11k|    } 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|  2.11k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  2.11k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 2.11k]
  |  Branch (1251:23): [True: 0, False: 2.11k]
  ------------------
 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|  2.11k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  3.10k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  10.1k|  I rational_to_integer_helper(size_t n) const {
 1224|  10.1k|    auto a = value_.at(n).first;
 1225|  10.1k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  10.1k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.55k, False: 8.57k]
  ------------------
 1229|  1.55k|      return 0;
 1230|  1.55k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  8.57k|#ifdef __cpp_if_constexpr
 1234|  8.57k|    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|  8.57k|      const auto imin = std::numeric_limits<I>::min();
 1240|  8.57k|      const auto imax = std::numeric_limits<I>::max();
 1241|  8.57k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 8.57k]
  |  Branch (1241:23): [True: 0, False: 8.57k]
  |  Branch (1241:35): [True: 0, False: 8.57k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  8.57k|#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|  8.57k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  10.1k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|  64.8k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  64.8k|}
_ZN5Exiv25ValueD2Ev:
   43|  14.4M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|  63.4k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  63.4k|  value_.clear();
 1469|  63.4k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  63.4k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 63.4k, False: 0]
  |  Branch (1470:17): [True: 439, False: 63.0k]
  ------------------
 1471|    439|    len = (len / ts) * ts;
 1472|   744k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 680k, False: 63.4k]
  ------------------
 1473|   680k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   680k|  }
 1475|  63.4k|  return 0;
 1476|  63.4k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  1.30k|int ValueType<T>::read(const std::string& buf) {
 1480|  1.30k|  std::istringstream is(buf);
 1481|  1.30k|  T tmp;
 1482|  1.30k|  ValueList val;
 1483|  3.34k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 2.04k, False: 1.30k]
  ------------------
 1484|  2.04k|    val.push_back(tmp);
 1485|  1.30k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 4, False: 1.30k]
  ------------------
 1486|      4|    return 1;
 1487|  1.30k|  value_ = std::move(val);
 1488|  1.30k|  return 0;
 1489|  1.30k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|    993|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    993|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 634, False: 359]
  ------------------
 1651|    634|    pDataArea_ = Blob(buf, buf + len);
 1652|    359|  else
 1653|    359|    pDataArea_.clear();
 1654|    993|  return 0;
 1655|    993|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  63.4k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  63.4k|  size_t offset = 0;
 1494|   193k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 193k, False: 63.4k]
  ------------------
 1495|   193k|    offset += toData(buf + offset, val, byteOrder);
 1496|   193k|  }
 1497|  63.4k|  return offset;
 1498|  63.4k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   286k|size_t ValueType<T>::count() const {
 1502|   286k|  return value_.size();
 1503|   286k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   391k|size_t ValueType<T>::size() const {
 1507|   391k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   391k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    357|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    357|  auto end = value_.end();
 1518|    357|  auto i = value_.begin();
 1519|  11.0k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 10.7k, False: 357]
  ------------------
 1520|  10.7k|    os << std::setprecision(15) << *i;
 1521|  10.7k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 10.5k, False: 179]
  ------------------
 1522|  10.5k|      os << " ";
 1523|  10.7k|  }
 1524|    357|  return os;
 1525|    357|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   117k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   117k|  ok_ = true;
 1537|   117k|  return static_cast<int64_t>(value_.at(n));
 1538|   117k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   138k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   138k|  ok_ = true;
 1542|   138k|  return static_cast<uint32_t>(value_.at(n));
 1543|   138k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  5.94k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.94k|  return pDataArea_.size();
 1641|  5.94k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|    835|DataBuf ValueType<T>::dataArea() const {
 1645|    835|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    835|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   186k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   186k|  return new ValueType<T>(*this);
 1513|   186k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   186k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   186k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.50k, False: 185k]
  ------------------
 1449|  1.50k|    pDataArea_ = rhs.pDataArea_;
 1450|   186k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  10.7M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  57.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  57.1k|  value_.clear();
 1469|  57.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  57.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 57.1k, False: 0]
  |  Branch (1470:17): [True: 62, False: 57.1k]
  ------------------
 1471|     62|    len = (len / ts) * ts;
 1472|  2.15M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 2.10M, False: 57.1k]
  ------------------
 1473|  2.10M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  2.10M|  }
 1475|  57.1k|  return 0;
 1476|  57.1k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|  1.05k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.05k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 644, False: 409]
  ------------------
 1651|    644|    pDataArea_ = Blob(buf, buf + len);
 1652|    409|  else
 1653|    409|    pDataArea_.clear();
 1654|  1.05k|  return 0;
 1655|  1.05k|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  34.7k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  34.7k|  size_t offset = 0;
 1494|   777k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 777k, False: 34.7k]
  ------------------
 1495|   777k|    offset += toData(buf + offset, val, byteOrder);
 1496|   777k|  }
 1497|  34.7k|  return offset;
 1498|  34.7k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   189k|size_t ValueType<T>::count() const {
 1502|   189k|  return value_.size();
 1503|   189k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   147k|size_t ValueType<T>::size() const {
 1507|   147k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   147k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  3.53k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  3.53k|  auto end = value_.end();
 1518|  3.53k|  auto i = value_.begin();
 1519|  56.9k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 53.4k, False: 3.53k]
  ------------------
 1520|  53.4k|    os << std::setprecision(15) << *i;
 1521|  53.4k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 50.4k, False: 3.04k]
  ------------------
 1522|  50.4k|      os << " ";
 1523|  53.4k|  }
 1524|  3.53k|  return os;
 1525|  3.53k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  6.53k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  6.53k|  ok_ = true;
 1537|  6.53k|  return static_cast<int64_t>(value_.at(n));
 1538|  6.53k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|  92.2k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  92.2k|  ok_ = true;
 1542|  92.2k|  return static_cast<uint32_t>(value_.at(n));
 1543|  92.2k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  10.4k|size_t ValueType<T>::sizeDataArea() const {
 1640|  10.4k|  return pDataArea_.size();
 1641|  10.4k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|  1.15k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.15k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.15k|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   190k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   190k|  return new ValueType<T>(*this);
 1513|   190k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   190k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   190k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 501, False: 189k]
  ------------------
 1449|    501|    pDataArea_ = rhs.pDataArea_;
 1450|   190k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  12.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  12.9k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  12.4k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.4k|  value_.clear();
 1469|  12.4k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.4k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.4k, False: 0]
  |  Branch (1470:17): [True: 0, False: 12.4k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   868k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 856k, False: 12.4k]
  ------------------
 1473|   856k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   856k|  }
 1475|  12.4k|  return 0;
 1476|  12.4k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|  1.84k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.84k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.14k, False: 702]
  ------------------
 1651|  1.14k|    pDataArea_ = Blob(buf, buf + len);
 1652|    702|  else
 1653|    702|    pDataArea_.clear();
 1654|  1.84k|  return 0;
 1655|  1.84k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  9.10k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  9.10k|  size_t offset = 0;
 1494|   713k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 713k, False: 9.10k]
  ------------------
 1495|   713k|    offset += toData(buf + offset, val, byteOrder);
 1496|   713k|  }
 1497|  9.10k|  return offset;
 1498|  9.10k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  33.2k|size_t ValueType<T>::count() const {
 1502|  33.2k|  return value_.size();
 1503|  33.2k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  23.6k|size_t ValueType<T>::size() const {
 1507|  23.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  23.6k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    729|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    729|  auto end = value_.end();
 1518|    729|  auto i = value_.begin();
 1519|  86.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 86.0k, False: 729]
  ------------------
 1520|  86.0k|    os << std::setprecision(15) << *i;
 1521|  86.0k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 85.6k, False: 435]
  ------------------
 1522|  85.6k|      os << " ";
 1523|  86.0k|  }
 1524|    729|  return os;
 1525|    729|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  3.57k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.57k|  return pDataArea_.size();
 1641|  3.57k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    625|DataBuf ValueType<T>::dataArea() const {
 1645|    625|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    625|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  37.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  37.2k|  return new ValueType<T>(*this);
 1513|  37.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 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.56k, False: 35.7k]
  ------------------
 1449|  1.56k|    pDataArea_ = rhs.pDataArea_;
 1450|  37.2k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  26.3k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  26.3k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  21.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  21.1k|  value_.clear();
 1469|  21.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  21.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 21.1k, False: 0]
  |  Branch (1470:17): [True: 36, False: 21.0k]
  ------------------
 1471|     36|    len = (len / ts) * ts;
 1472|   627k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 606k, False: 21.1k]
  ------------------
 1473|   606k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   606k|  }
 1475|  21.1k|  return 0;
 1476|  21.1k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  5.20k|int ValueType<T>::read(const std::string& buf) {
 1480|  5.20k|  std::istringstream is(buf);
 1481|  5.20k|  T tmp;
 1482|  5.20k|  ValueList val;
 1483|  34.3k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 29.0k, False: 5.20k]
  ------------------
 1484|  29.0k|    val.push_back(tmp);
 1485|  5.20k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 5.20k]
  ------------------
 1486|      0|    return 1;
 1487|  5.20k|  value_ = std::move(val);
 1488|  5.20k|  return 0;
 1489|  5.20k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|    531|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    531|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 350, False: 181]
  ------------------
 1651|    350|    pDataArea_ = Blob(buf, buf + len);
 1652|    181|  else
 1653|    181|    pDataArea_.clear();
 1654|    531|  return 0;
 1655|    531|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  6.70k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.70k|  size_t offset = 0;
 1494|   222k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 222k, False: 6.70k]
  ------------------
 1495|   222k|    offset += toData(buf + offset, val, byteOrder);
 1496|   222k|  }
 1497|  6.70k|  return offset;
 1498|  6.70k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|  85.0k|size_t ValueType<T>::count() const {
 1502|  85.0k|  return value_.size();
 1503|  85.0k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  24.6k|size_t ValueType<T>::size() const {
 1507|  24.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  24.6k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    599|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    599|  auto end = value_.end();
 1518|    599|  auto i = value_.begin();
 1519|  45.8k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 45.2k, False: 599]
  ------------------
 1520|  45.2k|    os << std::setprecision(15) << *i;
 1521|  45.2k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 44.8k, False: 367]
  ------------------
 1522|  44.8k|      os << " ";
 1523|  45.2k|  }
 1524|    599|  return os;
 1525|    599|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  24.9k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  24.9k|  ok_ = true;
 1537|  24.9k|  return static_cast<int64_t>(value_.at(n));
 1538|  24.9k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   123k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   123k|  ok_ = true;
 1542|   123k|  return static_cast<uint32_t>(value_.at(n));
 1543|   123k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  1.75k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.75k|  return pDataArea_.size();
 1641|  1.75k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    331|DataBuf ValueType<T>::dataArea() const {
 1645|    331|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    331|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|  60.4k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  60.4k|  return new ValueType<T>(*this);
 1513|  60.4k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|  60.4k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  60.4k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 727, False: 59.7k]
  ------------------
 1449|    727|    pDataArea_ = rhs.pDataArea_;
 1450|  60.4k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  29.9k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  29.9k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  29.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  29.9k|  value_.clear();
 1469|  29.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  29.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 29.9k, False: 0]
  |  Branch (1470:17): [True: 107, False: 29.8k]
  ------------------
 1471|    107|    len = (len / ts) * ts;
 1472|   623k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 593k, False: 29.9k]
  ------------------
 1473|   593k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   593k|  }
 1475|  29.9k|  return 0;
 1476|  29.9k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|    788|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    788|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 437, False: 351]
  ------------------
 1651|    437|    pDataArea_ = Blob(buf, buf + len);
 1652|    351|  else
 1653|    351|    pDataArea_.clear();
 1654|    788|  return 0;
 1655|    788|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  63.3k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  63.3k|  size_t offset = 0;
 1494|   459k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 459k, False: 63.3k]
  ------------------
 1495|   459k|    offset += toData(buf + offset, val, byteOrder);
 1496|   459k|  }
 1497|  63.3k|  return offset;
 1498|  63.3k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   136k|size_t ValueType<T>::count() const {
 1502|   136k|  return value_.size();
 1503|   136k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   541k|size_t ValueType<T>::size() const {
 1507|   541k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   541k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    599|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    599|  auto end = value_.end();
 1518|    599|  auto i = value_.begin();
 1519|  36.4k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 35.8k, False: 599]
  ------------------
 1520|  35.8k|    os << std::setprecision(15) << *i;
 1521|  35.8k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 35.5k, False: 350]
  ------------------
 1522|  35.5k|      os << " ";
 1523|  35.8k|  }
 1524|    599|  return os;
 1525|    599|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  9.54k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  9.54k|  ok_ = true;
 1537|  9.54k|  return static_cast<int64_t>(value_.at(n));
 1538|  9.54k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  15.9k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  15.9k|  ok_ = true;
 1542|  15.9k|  return static_cast<uint32_t>(value_.at(n));
 1543|  15.9k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  4.24k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.24k|  return pDataArea_.size();
 1641|  4.24k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    473|DataBuf ValueType<T>::dataArea() const {
 1645|    473|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    473|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   130k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   130k|  return new ValueType<T>(*this);
 1513|   130k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   130k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   130k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 908, False: 130k]
  ------------------
 1449|    908|    pDataArea_ = rhs.pDataArea_;
 1450|   130k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  11.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  11.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  11.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  11.5k|  value_.clear();
 1469|  11.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  11.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 11.5k, False: 0]
  |  Branch (1470:17): [True: 0, False: 11.5k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   141k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 129k, False: 11.5k]
  ------------------
 1473|   129k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   129k|  }
 1475|  11.5k|  return 0;
 1476|  11.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|    472|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    472|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 287, False: 185]
  ------------------
 1651|    287|    pDataArea_ = Blob(buf, buf + len);
 1652|    185|  else
 1653|    185|    pDataArea_.clear();
 1654|    472|  return 0;
 1655|    472|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  6.62k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  6.62k|  size_t offset = 0;
 1494|   134k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 134k, False: 6.62k]
  ------------------
 1495|   134k|    offset += toData(buf + offset, val, byteOrder);
 1496|   134k|  }
 1497|  6.62k|  return offset;
 1498|  6.62k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  28.2k|size_t ValueType<T>::count() const {
 1502|  28.2k|  return value_.size();
 1503|  28.2k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  18.9k|size_t ValueType<T>::size() const {
 1507|  18.9k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  18.9k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    934|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    934|  auto end = value_.end();
 1518|    934|  auto i = value_.begin();
 1519|  12.8k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 11.9k, False: 934]
  ------------------
 1520|  11.9k|    os << std::setprecision(15) << *i;
 1521|  11.9k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 11.2k, False: 701]
  ------------------
 1522|  11.2k|      os << " ";
 1523|  11.9k|  }
 1524|    934|  return os;
 1525|    934|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  1.45k|size_t ValueType<T>::sizeDataArea() const {
 1640|  1.45k|  return pDataArea_.size();
 1641|  1.45k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|    144|DataBuf ValueType<T>::dataArea() const {
 1645|    144|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    144|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  32.6k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  32.6k|  return new ValueType<T>(*this);
 1513|  32.6k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  32.6k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  32.6k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 494, False: 32.1k]
  ------------------
 1449|    494|    pDataArea_ = rhs.pDataArea_;
 1450|  32.6k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  6.64k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  6.64k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  6.64k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  6.64k|  value_.clear();
 1469|  6.64k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  6.64k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 6.64k, False: 0]
  |  Branch (1470:17): [True: 0, False: 6.64k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|  55.2k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 48.5k, False: 6.64k]
  ------------------
 1473|  48.5k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  48.5k|  }
 1475|  6.64k|  return 0;
 1476|  6.64k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.03k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.03k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 826, False: 209]
  ------------------
 1651|    826|    pDataArea_ = Blob(buf, buf + len);
 1652|    209|  else
 1653|    209|    pDataArea_.clear();
 1654|  1.03k|  return 0;
 1655|  1.03k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  5.16k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.16k|  size_t offset = 0;
 1494|  80.6k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 80.6k, False: 5.16k]
  ------------------
 1495|  80.6k|    offset += toData(buf + offset, val, byteOrder);
 1496|  80.6k|  }
 1497|  5.16k|  return offset;
 1498|  5.16k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  36.2k|size_t ValueType<T>::count() const {
 1502|  36.2k|  return value_.size();
 1503|  36.2k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  13.5k|size_t ValueType<T>::size() const {
 1507|  13.5k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  13.5k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    470|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    470|  auto end = value_.end();
 1518|    470|  auto i = value_.begin();
 1519|  2.01k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 1.54k, False: 470]
  ------------------
 1520|  1.54k|    os << std::setprecision(15) << *i;
 1521|  1.54k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 1.27k, False: 270]
  ------------------
 1522|  1.27k|      os << " ";
 1523|  1.54k|  }
 1524|    470|  return os;
 1525|    470|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  4.48k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.48k|  return pDataArea_.size();
 1641|  4.48k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    295|DataBuf ValueType<T>::dataArea() const {
 1645|    295|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    295|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  24.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  24.2k|  return new ValueType<T>(*this);
 1513|  24.2k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  24.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  24.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.20k, False: 23.0k]
  ------------------
 1449|  1.20k|    pDataArea_ = rhs.pDataArea_;
 1450|  24.2k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  12.1k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  12.1k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  12.1k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  12.1k|  value_.clear();
 1469|  12.1k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  12.1k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 12.1k, False: 0]
  |  Branch (1470:17): [True: 0, False: 12.1k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   294k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 282k, False: 12.1k]
  ------------------
 1473|   282k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   282k|  }
 1475|  12.1k|  return 0;
 1476|  12.1k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|  1.14k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.14k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 754, False: 388]
  ------------------
 1651|    754|    pDataArea_ = Blob(buf, buf + len);
 1652|    388|  else
 1653|    388|    pDataArea_.clear();
 1654|  1.14k|  return 0;
 1655|  1.14k|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  5.87k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.87k|  size_t offset = 0;
 1494|   189k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 189k, False: 5.87k]
  ------------------
 1495|   189k|    offset += toData(buf + offset, val, byteOrder);
 1496|   189k|  }
 1497|  5.87k|  return offset;
 1498|  5.87k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  30.4k|size_t ValueType<T>::count() const {
 1502|  30.4k|  return value_.size();
 1503|  30.4k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  17.5k|size_t ValueType<T>::size() const {
 1507|  17.5k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  17.5k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    628|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    628|  auto end = value_.end();
 1518|    628|  auto i = value_.begin();
 1519|  5.06k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.44k, False: 628]
  ------------------
 1520|  4.44k|    os << std::setprecision(15) << *i;
 1521|  4.44k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.01k, False: 422]
  ------------------
 1522|  4.01k|      os << " ";
 1523|  4.44k|  }
 1524|    628|  return os;
 1525|    628|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  3.56k|size_t ValueType<T>::sizeDataArea() const {
 1640|  3.56k|  return pDataArea_.size();
 1641|  3.56k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    194|DataBuf ValueType<T>::dataArea() const {
 1645|    194|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    194|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  35.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  35.2k|  return new ValueType<T>(*this);
 1513|  35.2k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  35.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  35.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 796, False: 34.5k]
  ------------------
 1449|    796|    pDataArea_ = rhs.pDataArea_;
 1450|  35.2k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   308k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  4.43k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  4.43k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  19.0k|  [[nodiscard]] bool usePacket() const {
  218|  19.0k|    return usePacket_;
  219|  19.0k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  46.3k|  bool usePacket(bool b) {
  223|  46.3k|    bool r = usePacket_;
  224|  46.3k|    usePacket_ = b;
  225|  46.3k|    return r;
  226|  46.3k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  40.7k|  void setPacket(std::string xmpPacket) {
  229|  40.7k|    xmpPacket_ = std::move(xmpPacket);
  230|  40.7k|    usePacket(false);
  231|  40.7k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  261|  81.5k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  262|  81.5k|    return nsBindings_;
  263|  81.5k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  49.0k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  396|  18.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|  18.5k|    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  18.5k|  return *this;
  406|  18.5k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  86.9k|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|  86.9k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  86.9k|  return *this;
  406|  86.9k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   126k|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|   126k|    setValue(Exiv2::toString(value));
  405|   126k|  return *this;
  406|   126k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  11.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|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  11.8k|    setValue(Exiv2::toString(value));
  405|  11.8k|  return *this;
  406|  11.8k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  19.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|       |    setValue(&value);
  403|       |  else
  404|  19.5k|    setValue(Exiv2::toString(value));
  405|  19.5k|  return *this;
  406|  19.5k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_RKT_:
  396|  1.33k|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.33k|    setValue(Exiv2::toString(value));
  405|  1.33k|  return *this;
  406|  1.33k|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  1.64k|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.64k|    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.64k|  return *this;
  406|  1.64k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|    770|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|    770|    setValue(Exiv2::toString(value));
  405|    770|  return *this;
  406|    770|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  3.64k|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.64k|    setValue(Exiv2::toString(value));
  405|  3.64k|  return *this;
  406|  3.64k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    801|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|    801|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    801|  return *this;
  406|    801|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|  76.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|  76.3k|    setValue(Exiv2::toString(value));
  405|  76.3k|  return *this;
  406|  76.3k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  2.49k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  2.49k|    setValue(Exiv2::toString(value));
  405|  2.49k|  return *this;
  406|  2.49k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   129k|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|   129k|    setValue(Exiv2::toString(value));
  405|   129k|  return *this;
  406|   129k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  25.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|  25.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|  25.8k|  return *this;
  406|  25.8k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   134k|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|   134k|    setValue(Exiv2::toString(value));
  405|   134k|  return *this;
  406|   134k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|     84|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|     84|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|     84|  return *this;
  406|     84|}

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

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

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

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

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   202k|  static constexpr auto tagList() {
   39|   202k|    return tagInfo_;
   40|   202k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  8.11k|  static constexpr auto tagListCs() {
   43|  8.11k|    return tagInfoCs_;
   44|  8.11k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  3.60k|  static constexpr auto tagListSi() {
   47|  3.60k|    return tagInfoSi_;
   48|  3.60k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|    524|  static constexpr auto tagListCf() {
   55|    524|    return tagInfoCf_;
   56|    524|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.17k|  static constexpr auto tagListPi() {
   59|  1.17k|    return tagInfoPi_;
   60|  1.17k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    534|  static constexpr auto tagListTi() {
   63|    534|    return tagInfoTi_;
   64|    534|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|     47|  static constexpr auto tagListFi() {
   67|     47|    return tagInfoFi_;
   68|     47|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    793|  static constexpr auto tagListPa() {
   51|    793|    return tagInfoPa_;
   52|    793|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|    473|  static constexpr auto tagListPr() {
   71|    473|    return tagInfoPr_;
   72|    473|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    206|  static constexpr auto tagListVigCor2() {
  135|    206|    return tagInfoVigCor2_;
  136|    206|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|  1.13k|  static constexpr auto tagListLiOp() {
  139|  1.13k|    return tagInfoLiOp_;
  140|  1.13k|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    631|  static constexpr auto tagListAfMiAdj() {
  127|    631|    return tagInfoAfMiAdj_;
  128|    631|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|    239|  static constexpr auto tagListLe() {
  143|    239|    return tagInfoLe_;
  144|    239|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    581|  static constexpr auto tagListAm() {
  147|    581|    return tagInfoAm_;
  148|    581|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    201|  static constexpr auto tagListFil() {
  155|    201|    return tagInfoFil_;
  156|    201|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    304|  static constexpr auto tagListMe() {
  151|    304|    return tagInfoMe_;
  152|    304|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    200|  static constexpr auto tagListHdr() {
  159|    200|    return tagInfoHdr_;
  160|    200|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    325|  static constexpr auto tagListAfC() {
  163|    325|    return tagInfoAfC_;
  164|    325|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    230|  static constexpr auto tagListRawB() {
  167|    230|    return tagInfoRawB_;
  168|    230|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  3.83k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  3.83k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  3.78k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  3.78k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  3.63k|void Converter::cnvToXmp() {
  503|   453k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 453k, False: 3.63k]
  ------------------
  504|   453k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 374k, False: 78.7k]
  |  Branch (504:37): [True: 187k, False: 186k]
  |  Branch (504:52): [True: 78.7k, False: 186k]
  |  Branch (504:79): [True: 39.2k, False: 39.4k]
  ------------------
  505|   227k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   227k|    }
  507|   453k|  }
  508|  3.63k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  3.98k|void Converter::cnvFromXmp() {
  511|   501k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 501k, False: 3.98k]
  ------------------
  512|   501k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 414k, False: 87.6k]
  |  Branch (512:37): [True: 207k, False: 207k]
  |  Branch (512:52): [True: 87.6k, False: 207k]
  |  Branch (512:79): [True: 43.8k, False: 43.8k]
  ------------------
  513|   250k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   250k|    }
  515|   501k|  }
  516|  3.98k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  3.57k|void Converter::cnvNone(const char*, const char*) {
  519|  3.57k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  4.85k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  4.85k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  4.85k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 4.85k, False: 0]
  ------------------
  524|  4.85k|    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|    988|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|    988|  auto pos = iptcData_->findKey(IptcKey(to));
  533|    988|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 988, False: 0]
  ------------------
  534|    988|    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|    942|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|    942|  auto pos = xmpData_->findKey(XmpKey(to));
  545|    942|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 942]
  ------------------
  546|      0|    return true;
  547|    942|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 942]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|    942|  xmpData_->erase(pos);
  550|    942|  return true;
  551|    942|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   162k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   162k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   162k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 162k, False: 414]
  ------------------
  556|   162k|    return;
  557|    414|  std::string value = pos->toString();
  558|    414|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 414]
  ------------------
  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|    414|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 414]
  ------------------
  565|      0|    return;
  566|    414|  (*xmpData_)[to] = value;
  567|    414|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 414]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    414|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  1.79k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  1.79k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  1.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 1.79k, False: 0]
  ------------------
  574|  1.79k|    return;
  575|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|    return;
  577|      0|  const auto cv = dynamic_cast<const CommentValue*>(&pos->value());
  578|      0|  if (!cv) {
  ------------------
  |  Branch (578:7): [True: 0, False: 0]
  ------------------
  579|      0|#ifndef SUPPRESS_WARNINGS
  580|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  581|      0|#endif
  582|      0|    return;
  583|      0|  }
  584|       |  // Todo: Convert to UTF-8 if necessary
  585|      0|  try {
  586|      0|    (*xmpData_)[to] = cv->comment();
  587|      0|  } catch (const Error&) {
  588|      0|#ifndef SUPPRESS_WARNINGS
  589|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  590|      0|#endif
  591|      0|  }
  592|      0|  if (erase_)
  ------------------
  |  Branch (592:7): [True: 0, False: 0]
  ------------------
  593|      0|    exifData_->erase(pos);
  594|      0|}
_ZN5Exiv29Converter12cnvExifArrayEPKcS2_:
  596|  1.79k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  1.79k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  1.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 1.79k, False: 0]
  ------------------
  599|  1.79k|    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|  7.22k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  7.22k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  7.22k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 7.12k, False: 102]
  ------------------
  619|  7.12k|    return;
  620|    102|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 102]
  ------------------
  621|      0|    return;
  622|    102|  int year = 0;
  623|    102|  int month = 0;
  624|    102|  int day = 0;
  625|    102|  int hour = 0;
  626|    102|  int min = 0;
  627|    102|  int sec = 0;
  628|    102|  std::string subsec;
  629|       |
  630|    102|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 102, False: 0]
  ------------------
  631|    102|    std::string value = pos->toString();
  632|    102|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 102]
  ------------------
  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|    102|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 102]
  ------------------
  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|    102|  } 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|    102|  const char* subsecTag = nullptr;
  711|    102|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 6, False: 96]
  ------------------
  712|      6|    subsecTag = "Exif.Photo.SubSecTime";
  713|     96|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 13, False: 83]
  ------------------
  714|     13|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|     83|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 83, False: 0]
  ------------------
  716|     83|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|     83|  }
  718|       |
  719|    102|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 102, False: 0]
  ------------------
  720|    102|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    102|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 11, False: 91]
  ------------------
  722|     11|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 11, False: 0]
  ------------------
  723|     11|        std::string ss = subsec_pos->toString();
  724|     11|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 11, False: 0]
  ------------------
  725|     11|          bool ok = false;
  726|     11|          stringTo<long>(ss, ok);
  727|     11|          if (ok)
  ------------------
  |  Branch (727:15): [True: 11, False: 0]
  ------------------
  728|     11|            subsec = std::string(".") + ss;
  729|     11|        }
  730|     11|      }
  731|     11|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 11]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     11|    }
  734|    102|  }
  735|       |
  736|    102|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 102]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    102|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    102|#define stringFormat std::format
  ------------------
  740|    102|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 102]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    102|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  3.58k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  3.58k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  3.58k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 3.58k, False: 0]
  ------------------
  747|  3.58k|    return;
  748|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (748:7): [True: 0, False: 0]
  ------------------
  749|      0|    return;
  750|      0|  auto count = pos->count();
  751|      0|  std::string value;
  752|      0|  value.reserve(count);
  753|      0|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (753:22): [True: 0, False: 0]
  ------------------
  754|      0|    value.push_back(pos->toUint32(i));
  755|      0|  }
  756|      0|  (*xmpData_)[to] = value;
  757|      0|  if (erase_)
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|    exifData_->erase(pos);
  759|      0|}
_ZN5Exiv29Converter17cnvExifGPSVersionEPKcS2_:
  761|  1.79k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  1.79k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  1.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 1.79k, False: 0]
  ------------------
  764|  1.79k|    return;
  765|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (765:7): [True: 0, False: 0]
  ------------------
  766|      0|    return;
  767|      0|  std::string value;
  768|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (768:22): [True: 0, False: 0]
  ------------------
  769|      0|    if (i > 0)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|      value += '.';
  771|      0|    value += std::to_string(pos->toInt64(i));
  772|      0|  }
  773|      0|  (*xmpData_)[to] = value;
  774|      0|  if (erase_)
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  775|      0|    exifData_->erase(pos);
  776|      0|}
_ZN5Exiv29Converter12cnvExifFlashEPKcS2_:
  778|  1.79k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  1.79k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  1.79k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 1.79k, False: 0]
  |  Branch (780:7): [True: 1.79k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  1.79k|    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|  7.17k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  7.17k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  7.17k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 7.17k, False: 0]
  ------------------
  805|  7.17k|    return;
  806|      0|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (806:7): [True: 0, False: 0]
  ------------------
  807|      0|    return;
  808|      0|  if (pos->count() != 3) {
  ------------------
  |  Branch (808:7): [True: 0, False: 0]
  ------------------
  809|      0|#ifndef SUPPRESS_WARNINGS
  810|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  811|      0|#endif
  812|      0|    return;
  813|      0|  }
  814|      0|  auto refPos = exifData_->findKey(ExifKey(std::string(from) + "Ref"));
  815|      0|  if (refPos == exifData_->end()) {
  ------------------
  |  Branch (815:7): [True: 0, False: 0]
  ------------------
  816|      0|#ifndef SUPPRESS_WARNINGS
  817|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  818|      0|#endif
  819|      0|    return;
  820|      0|  }
  821|      0|  double deg[3];
  822|      0|  for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (822:19): [True: 0, False: 0]
  ------------------
  823|      0|    const auto [z, d] = pos->toRational(i);
  824|      0|    if (d == 0) {
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  ------------------
  825|      0|#ifndef SUPPRESS_WARNINGS
  826|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  827|      0|#endif
  828|      0|      return;
  829|      0|    }
  830|       |    // Hack: Need Value::toDouble
  831|      0|    deg[i] = static_cast<double>(z) / d;
  832|      0|  }
  833|      0|  double min = (deg[0] * 60.0) + deg[1] + (deg[2] / 60.0);
  834|      0|  auto ideg = static_cast<int>(min / 60.0);
  835|      0|  min -= ideg * 60;
  836|      0|  (*xmpData_)[to] = stringFormat("{},{:.7f}{}", ideg, min, refPos->toString().front());
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  837|       |
  838|      0|  if (erase_)
  ------------------
  |  Branch (838:7): [True: 0, False: 0]
  ------------------
  839|      0|    exifData_->erase(pos);
  840|      0|  if (erase_)
  ------------------
  |  Branch (840:7): [True: 0, False: 0]
  ------------------
  841|      0|    exifData_->erase(refPos);
  842|      0|}
_ZN5Exiv29Converter11cnvXmpValueEPKcS2_:
  844|   179k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   179k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   179k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 178k, False: 563]
  ------------------
  847|   178k|    return;
  848|    563|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 563]
  ------------------
  849|      0|    return;
  850|    563|  std::string value;
  851|    563|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 145, False: 418]
  ------------------
  852|    145|#ifndef SUPPRESS_WARNINGS
  853|    145|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    145|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 145]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    145|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    145|#endif
  855|    145|    return;
  856|    145|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    418|  ExifKey key(to);
  859|    418|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 414, False: 4]
  ------------------
  860|    414|    exifData_->add(ed);
  861|    414|  }
  862|    418|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 418]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    418|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  1.99k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  1.99k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 1.99k]
  ------------------
  868|      0|    return;
  869|  1.99k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  1.99k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 1.99k, False: 0]
  ------------------
  871|  1.99k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  1.99k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  1.99k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 1.99k]
  ------------------
  887|      0|    return;
  888|  1.99k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  1.99k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 1.99k, False: 0]
  ------------------
  890|  1.99k|    return;
  891|      0|  std::string array;
  892|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (892:22): [True: 0, False: 0]
  ------------------
  893|      0|    std::string value = pos->toString(i);
  894|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (894:9): [True: 0, False: 0]
  ------------------
  895|      0|#ifndef SUPPRESS_WARNINGS
  896|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  897|      0|#endif
  898|      0|      return;
  899|      0|    }
  900|      0|    array += value;
  901|      0|    if (i != pos->count() - 1)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|      array += " ";
  903|      0|  }
  904|      0|  (*exifData_)[to] = array;
  905|      0|  if (erase_)
  ------------------
  |  Branch (905:7): [True: 0, False: 0]
  ------------------
  906|      0|    xmpData_->erase(pos);
  907|      0|}
_ZN5Exiv29Converter10cnvXmpDateEPKcS2_:
  909|  7.96k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  7.96k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  7.96k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 7.66k, False: 298]
  ------------------
  912|  7.66k|    return;
  913|    298|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 298]
  ------------------
  914|      0|    return;
  915|    298|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    298|  std::string value = pos->toString();
  917|    298|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 298]
  ------------------
  918|      0|#ifndef SUPPRESS_WARNINGS
  919|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  920|      0|#endif
  921|      0|    return;
  922|      0|  }
  923|    298|  XMP_DateTime datetime;
  924|    298|  try {
  925|    298|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    298|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 106, False: 192]
  ------------------
  927|    106|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    106|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    106|#define stringFormat std::format
  ------------------
  930|    106|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    106|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 11, False: 95]
  ------------------
  933|     11|        const char* subsecTag = nullptr;
  934|     11|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 1, False: 10]
  ------------------
  935|      1|          subsecTag = "Exif.Photo.SubSecTime";
  936|     10|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 4, False: 6]
  ------------------
  937|      4|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|      6|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 6, False: 0]
  ------------------
  939|      6|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|      6|        }
  941|     11|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 11, False: 0]
  ------------------
  942|     11|          prepareExifTarget(subsecTag, true);
  943|     11|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|     11|        }
  945|     11|      }
  946|    192|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    192|      URational rhour(datetime.hour, 1);
  950|    192|      URational rmin(datetime.minute, 1);
  951|    192|      URational rsec(datetime.second, 1);
  952|    192|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 192]
  ------------------
  953|      0|        if (datetime.second != 0) {
  ------------------
  |  Branch (953:13): [True: 0, False: 0]
  ------------------
  954|       |          // Add the seconds to rmin so that the ns fit into rsec
  955|      0|          rmin.second = 60;
  956|      0|          rmin.first *= 60;
  957|      0|          rmin.first += datetime.second;
  958|      0|        }
  959|      0|        rsec.second = 1000000000;
  960|      0|        rsec.first = datetime.nanoSecond;
  961|      0|      }
  962|       |
  963|    192|      std::ostringstream array;
  964|    192|      array << rhour << " " << rmin << " " << rsec;
  965|    192|      (*exifData_)[to] = array.str();
  966|       |
  967|    192|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    192|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    192|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    192|#define stringFormat std::format
  ------------------
  970|    192|    }
  971|    298|  }
  972|    298|#ifndef SUPPRESS_WARNINGS
  973|    298|  catch (const XMP_Error& e) {
  974|    196|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    196|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 196]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    196|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    196|    return;
  976|    196|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    102|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 102]
  ------------------
  984|      0|    xmpData_->erase(pos);
  985|       |#else
  986|       |#ifndef SUPPRESS_WARNINGS
  987|       |  EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  988|       |#endif
  989|       |#endif  // !EXV_HAVE_XMP_TOOLKIT
  990|    102|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  3.98k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  3.98k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  3.98k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 3.98k, False: 0]
  ------------------
  995|  3.98k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  1.99k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  1.99k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  1.99k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 1.99k, False: 0]
  ------------------
 1015|  1.99k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  1.99k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  1.99k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  1.99k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 1.99k, False: 0]
  ------------------
 1035|  1.99k|    return;
 1036|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1036:7): [True: 0, False: 0]
  ------------------
 1037|      0|    return;
 1038|      0|  unsigned short value = 0;
 1039|       |
 1040|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:33): [True: 0, False: 0]
  ------------------
 1041|      0|    auto fired = pos->toUint32();
 1042|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1042:9): [True: 0, False: 0]
  ------------------
 1043|      0|      value |= fired & 1;
 1044|      0|#ifndef SUPPRESS_WARNINGS
 1045|      0|    else
 1046|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Fired"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1047|      0|                  << " to " << to << "\n";
 1048|      0|#endif
 1049|      0|  }
 1050|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Return"));
 1051|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:33): [True: 0, False: 0]
  ------------------
 1052|      0|    auto ret = pos->toUint32();
 1053|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1053:9): [True: 0, False: 0]
  ------------------
 1054|      0|      value |= (ret & 3) << 1;
 1055|      0|#ifndef SUPPRESS_WARNINGS
 1056|      0|    else
 1057|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Return"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1058|      0|                  << " to " << to << "\n";
 1059|      0|#endif
 1060|      0|  }
 1061|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Mode"));
 1062|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:33): [True: 0, False: 0]
  ------------------
 1063|      0|    auto mode = pos->toUint32();
 1064|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      value |= (mode & 3) << 3;
 1066|      0|#ifndef SUPPRESS_WARNINGS
 1067|      0|    else
 1068|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Mode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1069|      0|                  << " to " << to << "\n";
 1070|      0|#endif
 1071|      0|  }
 1072|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Function"));
 1073|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:33): [True: 0, False: 0]
  ------------------
 1074|      0|    auto function = pos->toUint32();
 1075|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1075:9): [True: 0, False: 0]
  ------------------
 1076|      0|      value |= (function & 1) << 5;
 1077|      0|#ifndef SUPPRESS_WARNINGS
 1078|      0|    else
 1079|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Function"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1080|      0|                  << " to " << to << "\n";
 1081|      0|#endif
 1082|      0|  }
 1083|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:RedEyeMode"));
 1084|      0|  if (pos != xmpData_->end()) {
  ------------------
  |  Branch (1084:7): [True: 0, False: 0]
  ------------------
 1085|      0|    if (pos->count() > 0) {
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|      auto red = pos->toUint32();
 1087|      0|      if (pos->value().ok())
  ------------------
  |  Branch (1087:11): [True: 0, False: 0]
  ------------------
 1088|      0|        value |= (red & 1) << 6;
 1089|      0|#ifndef SUPPRESS_WARNINGS
 1090|      0|      else
 1091|      0|        EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:RedEyeMode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1092|      0|                    << " to " << to << "\n";
 1093|      0|#endif
 1094|      0|    }
 1095|      0|    if (erase_)
  ------------------
  |  Branch (1095:9): [True: 0, False: 0]
  ------------------
 1096|      0|      xmpData_->erase(pos);
 1097|      0|  }
 1098|       |
 1099|      0|  (*exifData_)[to] = value;
 1100|      0|}
_ZN5Exiv29Converter14cnvXmpGPSCoordEPKcS2_:
 1102|  7.96k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  7.96k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  7.96k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 7.96k, False: 0]
  ------------------
 1105|  7.96k|    return;
 1106|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1106:7): [True: 0, False: 0]
  ------------------
 1107|      0|    return;
 1108|      0|  std::string value = pos->toString();
 1109|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1109:7): [True: 0, False: 0]
  ------------------
 1110|      0|#ifndef SUPPRESS_WARNINGS
 1111|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1112|      0|#endif
 1113|      0|    return;
 1114|      0|  }
 1115|      0|  if (value.empty()) {
  ------------------
  |  Branch (1115:7): [True: 0, False: 0]
  ------------------
 1116|      0|#ifndef SUPPRESS_WARNINGS
 1117|      0|    EXV_WARNING << from << " is empty\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1118|      0|#endif
 1119|      0|    return;
 1120|      0|  }
 1121|       |
 1122|      0|  double deg = 0.0;
 1123|      0|  double min = 0.0;
 1124|      0|  double sec = 0.0;
 1125|      0|  char ref = value.back();
 1126|      0|  char sep1 = '\0';
 1127|      0|  char sep2 = '\0';
 1128|       |
 1129|      0|  value.pop_back();
 1130|       |
 1131|      0|  std::istringstream in(value);
 1132|       |
 1133|      0|  in >> deg >> sep1 >> min >> sep2;
 1134|       |
 1135|      0|  if (sep2 == ',') {
  ------------------
  |  Branch (1135:7): [True: 0, False: 0]
  ------------------
 1136|      0|    in >> sec;
 1137|      0|  } else {
 1138|      0|    sec = (min - static_cast<int>(min)) * 60.0;
 1139|      0|    min = static_cast<double>(static_cast<int>(min));
 1140|      0|  }
 1141|       |
 1142|      0|  if (in.bad() || (ref != 'N' && ref != 'S' && ref != 'E' && ref != 'W') || sep1 != ',' || !in.eof()) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 0]
  |  Branch (1142:20): [True: 0, False: 0]
  |  Branch (1142:34): [True: 0, False: 0]
  |  Branch (1142:48): [True: 0, False: 0]
  |  Branch (1142:62): [True: 0, False: 0]
  |  Branch (1142:77): [True: 0, False: 0]
  |  Branch (1142:92): [True: 0, False: 0]
  ------------------
 1143|      0|#ifndef SUPPRESS_WARNINGS
 1144|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1145|      0|#endif
 1146|      0|    return;
 1147|      0|  }
 1148|       |
 1149|      0|  Rational rdeg = floatToRationalCast(static_cast<float>(deg));
 1150|      0|  Rational rmin = floatToRationalCast(static_cast<float>(min));
 1151|      0|  Rational rsec = floatToRationalCast(static_cast<float>(sec));
 1152|       |
 1153|      0|  std::ostringstream array;
 1154|      0|  array << rdeg << " " << rmin << " " << rsec;
 1155|      0|  (*exifData_)[to] = array.str();
 1156|       |
 1157|      0|  prepareExifTarget((std::string(to) + "Ref").c_str(), true);
 1158|      0|  char ref_str[2] = {ref, 0};
 1159|      0|  (*exifData_)[std::string(to) + "Ref"] = ref_str;
 1160|       |
 1161|      0|  if (erase_)
  ------------------
  |  Branch (1161:7): [True: 0, False: 0]
  ------------------
 1162|      0|    xmpData_->erase(pos);
 1163|      0|}
_ZN5Exiv29Converter12cnvIptcValueEPKcS2_:
 1165|  35.7k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  35.7k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  35.7k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 35.3k, False: 426]
  ------------------
 1168|  35.3k|    return;
 1169|    426|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 426]
  ------------------
 1170|      0|    return;
 1171|   111k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 110k, False: 426]
  ------------------
 1172|   110k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 57.3k, False: 53.2k]
  ------------------
 1173|  57.3k|      std::string value = pos->toString();
 1174|  57.3k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 57.3k]
  ------------------
 1175|      0|#ifndef SUPPRESS_WARNINGS
 1176|      0|        EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1177|      0|#endif
 1178|      0|        ++pos;
 1179|      0|        continue;
 1180|      0|      }
 1181|  57.3k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 57.3k, False: 0]
  ------------------
 1182|  57.3k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  57.3k|      (*xmpData_)[to] = value;
 1184|  57.3k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 57.3k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  57.3k|    }
 1189|   110k|    ++pos;
 1190|   110k|  }
 1191|    426|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  43.8k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  43.8k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  43.8k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 42.8k, False: 988]
  ------------------
 1196|  42.8k|    return;
 1197|    988|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 988]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|    988|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 299, False: 689]
  |  Branch (1200:35): [True: 439, False: 250]
  ------------------
 1201|    738|    std::string value;
 1202|    738|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 169, False: 569]
  ------------------
 1203|    169|#ifndef SUPPRESS_WARNINGS
 1204|    169|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    169|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 169]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    169|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    169|#endif
 1206|    169|      return;
 1207|    169|    }
 1208|    569|    (*iptcData_)[to] = value;
 1209|    569|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    569|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 569]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    569|    return;
 1213|    738|  }
 1214|       |
 1215|    250|  size_t count = pos->count();
 1216|    250|  bool added = false;
 1217|  59.2k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 59.0k, False: 250]
  ------------------
 1218|  59.0k|    std::string value = pos->toString(i);
 1219|  59.0k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 59.0k]
  ------------------
 1220|      0|#ifndef SUPPRESS_WARNINGS
 1221|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1222|      0|#endif
 1223|      0|      continue;
 1224|      0|    }
 1225|  59.0k|    IptcKey key(to);
 1226|  59.0k|    Iptcdatum id(key);
 1227|  59.0k|    id.setValue(value);
 1228|  59.0k|    iptcData_->add(id);
 1229|  59.0k|    added = true;
 1230|  59.0k|  }
 1231|    250|  if (added)
  ------------------
  |  Branch (1231:7): [True: 242, False: 8]
  ------------------
 1232|    242|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    250|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 250]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    250|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  1.84k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1317|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1318|       |  /// effect
 1319|  1.84k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  1.84k|  converter.cnvToXmp();
 1321|  1.84k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  1.99k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  1.99k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  1.99k|  converter.cnvFromXmp();
 1333|  1.99k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  1.79k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  1.79k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 1.79k, False: 0]
  ------------------
 1349|  1.79k|    iptcCharset = iptcData.detectCharset();
 1350|  1.79k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 1.79k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  1.79k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  1.79k|  converter.cnvToXmp();
 1355|  1.79k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  1.99k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  1.99k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  1.99k|  converter.cnvFromXmp();
 1371|  1.99k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  73.7k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  73.7k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 57.3k, False: 16.3k]
  ------------------
 1382|  57.3k|    return true;  // nothing to do
 1383|  16.3k|#ifdef EXV_HAVE_ICONV
 1384|  16.3k|  return convertStringCharsetIconv(str, from, to);
 1385|       |#elif defined _WIN32
 1386|       |  return convertStringCharsetWindows(str, from, to);
 1387|       |#else
 1388|       |#ifndef SUPPRESS_WARNINGS
 1389|       |  EXV_WARNING << "Charset conversion required but no character mapping functionality available.\n";
 1390|       |#endif
 1391|       |  return false;
 1392|       |#endif
 1393|  73.7k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  16.3k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  16.3k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 16.3k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  16.3k|  bool ret = true;
 1407|  16.3k|  auto cd = iconv_open(to.data(), from.data());
 1408|  16.3k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 16.3k]
  ------------------
 1409|      0|#ifndef SUPPRESS_WARNINGS
 1410|      0|    EXV_WARNING << "iconv_open: " << strError() << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1411|      0|#endif
 1412|      0|    return false;
 1413|      0|  }
 1414|  16.3k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  16.3k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  16.3k|#endif
 1420|  16.3k|  size_t inbytesleft = str.length();
 1421|  28.3k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 24.3k, False: 3.98k]
  ------------------
 1422|  24.3k|    char outbuf[256];
 1423|  24.3k|    char* outptr = outbuf;
 1424|  24.3k|    size_t outbytesleft = sizeof(outbuf);
 1425|  24.3k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  24.3k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  24.3k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 21.0k, False: 3.34k]
  |  Branch (1427:53): [True: 12.3k, False: 8.65k]
  ------------------
 1428|  12.3k|#ifndef SUPPRESS_WARNINGS
 1429|  12.3k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  12.3k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 12.3k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  12.3k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  12.3k|#endif
 1431|  12.3k|      ret = false;
 1432|  12.3k|      break;
 1433|  12.3k|    }
 1434|  11.9k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  11.9k|  }
 1436|       |
 1437|  16.3k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 16.3k, False: 0]
  ------------------
 1438|  16.3k|    iconv_close(cd);
 1439|       |
 1440|  16.3k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 3.98k, False: 12.3k]
  ------------------
 1441|  3.98k|    str = std::move(outstr);
 1442|  16.3k|  return ret;
 1443|  16.3k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|  1.30k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|  1.30k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 534, False: 767]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    534|    value = pos->toString(0);
 1596|    534|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 510, False: 24]
  |  Branch (1596:31): [True: 196, False: 314]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    196|      value = pos->toString();
 1600|    196|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 196, False: 0]
  |  Branch (1600:32): [True: 196, False: 0]
  ------------------
 1601|    196|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    196|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 196, False: 0]
  ------------------
 1603|    196|          value = value.substr(first_space_pos + 1);
 1604|    196|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    196|      }
 1608|    196|    }
 1609|    767|  } else {
 1610|    767|    value = pos->toString();
 1611|    767|  }
 1612|  1.30k|  return pos->value().ok();
 1613|  1.30k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  40.2k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  40.2k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  40.2k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  40.2k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 40.2k]
  |  Branch (18:17): [True: 0, False: 40.2k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  40.2k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 2.46k, False: 37.8k]
  |  Branch (22:26): [True: 2.36k, False: 98]
  ------------------
   23|  2.36k|    setByteOrder(littleEndian);
   24|  37.9k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 14.7k, False: 23.1k]
  |  Branch (24:33): [True: 14.6k, False: 98]
  ------------------
   25|  14.6k|    setByteOrder(bigEndian);
   26|  23.2k|  } else {
   27|  23.2k|    return false;
   28|  23.2k|  }
   29|  17.0k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 8.92k, False: 8.13k]
  ------------------
   30|  8.92k|    return false;
   31|  8.13k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  8.13k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 6.51k, False: 1.61k]
  ------------------
   33|  6.51k|    return false;
   34|  1.61k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  1.61k|  return true;
   37|  8.13k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    133|DataBuf Cr2Header::write() const {
   40|    133|  DataBuf buf(16);
   41|    133|  switch (byteOrder()) {
   42|     90|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 90, False: 43]
  ------------------
   43|     90|      buf.write_uint8(0, 'I');
   44|     90|      break;
   45|     43|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 43, False: 90]
  ------------------
   46|     43|      buf.write_uint8(0, 'M');
   47|     43|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 133]
  ------------------
   49|      0|      break;
   50|    133|  }
   51|    133|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    133|  buf.write_uint16(2, tag(), byteOrder());
   54|    133|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    133|  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|    133|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    133|  return buf;
   59|    133|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  39.7k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  39.7k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 1.18k, False: 38.5k]
  |  Branch (63:33): [True: 782, False: 37.7k]
  ------------------
   64|  1.96k|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  37.7k|  return isTiffImageTag(tag, group);
   67|  39.7k|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  95.0k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  95.0k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 34.8k, False: 60.1k]
  ------------------
   58|  34.8k|    value_ = pValue->clone();
   59|  95.0k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   317k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   317k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 317k, False: 0]
  ------------------
   63|   317k|    key_ = rhs.key_->clone();  // deep copy
   64|   317k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 317k, False: 0]
  ------------------
   65|   317k|    value_ = rhs.value_->clone();  // deep copy
   66|   317k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   412k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|   110k|std::string Iptcdatum::key() const {
   79|   110k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 110k, False: 0]
  ------------------
   80|   110k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   533k|uint16_t Iptcdatum::record() const {
   87|   533k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 533k, False: 0]
  ------------------
   88|   533k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|  1.51M|uint16_t Iptcdatum::tag() const {
  111|  1.51M|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 1.51M, False: 0]
  ------------------
  112|  1.51M|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|  61.0k|size_t Iptcdatum::size() const {
  131|  61.0k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 61.0k, False: 0]
  ------------------
  132|  61.0k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  57.8k|std::string Iptcdatum::toString() const {
  135|  57.8k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 57.8k, False: 0]
  ------------------
  136|  57.8k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  88.4k|const Value& Iptcdatum::value() const {
  159|  88.4k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 88.4k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  88.4k|  return *value_;
  162|  88.4k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|  99.1k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|  99.1k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 99.1k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|  99.1k|  key_.reset();
  169|  99.1k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 99.1k, False: 0]
  ------------------
  170|  99.1k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|  99.1k|  value_.reset();
  173|  99.1k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 99.1k, False: 0]
  ------------------
  174|  99.1k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|  99.1k|  return *this;
  177|  99.1k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.38k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.38k|  setValue(value);
  188|  1.38k|  return *this;
  189|  1.38k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  60.4k|int Iptcdatum::setValue(const std::string& value) {
  203|  60.4k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 60.1k, False: 244]
  ------------------
  204|  60.1k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  60.1k|    value_ = Value::create(type);
  206|  60.1k|  }
  207|  60.4k|  return value_->read(value);
  208|  60.4k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.38k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.38k|  IptcKey iptcKey(key);
  212|  1.38k|  auto pos = findKey(iptcKey);
  213|  1.38k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.13k, False: 244]
  ------------------
  214|  1.13k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.13k|  }
  216|    244|  return *pos;
  217|  1.38k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|  1.18k|size_t IptcData::size() const {
  220|  1.18k|  size_t newSize = 0;
  221|  30.5k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 30.5k, False: 1.18k]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  30.5k|    newSize += 5;
  224|  30.5k|    size_t dataSize = iptc.size();
  225|  30.5k|    newSize += dataSize;
  226|  30.5k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 30.5k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  30.5k|  }
  231|  1.18k|  return newSize;
  232|  1.18k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  34.8k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  34.8k|  return add(Iptcdatum(key, value));
  236|  34.8k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  93.8k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  93.8k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 21.3k, False: 72.5k]
  |  Branch (239:7): [True: 16.2k, False: 77.6k]
  ------------------
  240|  21.3k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 16.2k, False: 5.07k]
  ------------------
  241|  16.2k|    return 6;
  242|  16.2k|  }
  243|       |  // allow duplicates
  244|  77.6k|  iptcMetadata_.push_back(iptcDatum);
  245|  77.6k|  return 0;
  246|  93.8k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  1.79k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  1.79k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  1.79k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  38.0k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  38.0k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  38.0k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  21.3k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  21.3k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  21.3k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  1.79k|const char* IptcData::detectCharset() const {
  305|  1.79k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  1.79k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 515, False: 1.27k]
  ------------------
  307|    515|    const std::string value = pos->toString();
  308|    515|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 515, False: 0]
  |  Branch (308:30): [True: 515, False: 0]
  ------------------
  309|    515|      return "UTF-8";
  310|    515|  }
  311|       |
  312|  1.27k|  bool ascii = true;
  313|  1.27k|  bool utf8 = true;
  314|       |
  315|  1.27k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 1.27k]
  ------------------
  316|      0|    std::string value = key.toString();
  317|      0|    if (key.value().ok()) {
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|      int seqCount = 0;
  319|      0|      for (auto c : value) {
  ------------------
  |  Branch (319:19): [True: 0, False: 0]
  ------------------
  320|      0|        if (seqCount) {
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  ------------------
  321|      0|          if ((c & 0xc0) != 0x80) {
  ------------------
  |  Branch (321:15): [True: 0, False: 0]
  ------------------
  322|      0|            utf8 = false;
  323|      0|            break;
  324|      0|          }
  325|      0|          --seqCount;
  326|      0|        } else {
  327|      0|          if (c & 0x80)
  ------------------
  |  Branch (327:15): [True: 0, False: 0]
  ------------------
  328|      0|            ascii = false;
  329|      0|          else
  330|      0|            continue;  // ascii character
  331|       |
  332|      0|          if ((c & 0xe0) == 0xc0)
  ------------------
  |  Branch (332:15): [True: 0, False: 0]
  ------------------
  333|      0|            seqCount = 1;
  334|      0|          else if ((c & 0xf0) == 0xe0)
  ------------------
  |  Branch (334:20): [True: 0, False: 0]
  ------------------
  335|      0|            seqCount = 2;
  336|      0|          else if ((c & 0xf8) == 0xf0)
  ------------------
  |  Branch (336:20): [True: 0, False: 0]
  ------------------
  337|      0|            seqCount = 3;
  338|      0|          else if ((c & 0xfc) == 0xf8)
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      0|            seqCount = 4;
  340|      0|          else if ((c & 0xfe) == 0xfc)
  ------------------
  |  Branch (340:20): [True: 0, False: 0]
  ------------------
  341|      0|            seqCount = 5;
  342|      0|          else {
  343|      0|            utf8 = false;
  344|      0|            break;
  345|      0|          }
  346|      0|        }
  347|      0|      }
  348|      0|      if (seqCount)
  ------------------
  |  Branch (348:11): [True: 0, False: 0]
  ------------------
  349|      0|        utf8 = false;  // unterminated seq
  350|      0|      if (!utf8)
  ------------------
  |  Branch (350:11): [True: 0, False: 0]
  ------------------
  351|      0|        break;
  352|      0|    }
  353|      0|  }
  354|       |
  355|  1.27k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 1.27k, False: 0]
  ------------------
  356|  1.27k|    return "ASCII";
  357|      0|  if (utf8)
  ------------------
  |  Branch (357:7): [True: 0, False: 0]
  ------------------
  358|      0|    return "UTF-8";
  359|      0|  return nullptr;
  360|      0|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  2.79k|int IptcParser::decode(IptcData& iptcData, const byte* pData, size_t size) {
  363|       |#ifdef EXIV2_DEBUG_MESSAGES
  364|       |  std::cerr << "IptcParser::decode, size = " << size << "\n";
  365|       |#endif
  366|  2.79k|  auto pRead = pData;
  367|  2.79k|  const auto pEnd = pData + size;
  368|  2.79k|  iptcData.clear();
  369|       |
  370|  2.79k|  uint16_t record = 0;
  371|  2.79k|  uint16_t dataSet = 0;
  372|  2.79k|  uint32_t sizeData = 0;
  373|  2.79k|  byte extTest = 0;
  374|       |
  375|  1.01M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.00M, False: 1.80k]
  ------------------
  376|       |    // First byte should be a marker. If it isn't, scan forward and skip
  377|       |    // the chunk bytes present in some images. This deviates from the
  378|       |    // standard, which advises to treat such cases as errors.
  379|  1.00M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 973k, False: 35.8k]
  ------------------
  380|   973k|      continue;
  381|  35.8k|    record = *pRead++;
  382|  35.8k|    dataSet = *pRead++;
  383|       |
  384|  35.8k|    extTest = *pRead;
  385|  35.8k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 1.79k, False: 34.0k]
  ------------------
  386|       |      // extended dataset
  387|  1.79k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  1.79k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 254, False: 1.54k]
  ------------------
  389|    254|        return 5;
  390|  1.54k|      pRead += 2;
  391|  1.54k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 6, False: 1.53k]
  ------------------
  392|      6|        return 6;
  393|  1.53k|      sizeData = 0;
  394|  3.61k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 2.07k, False: 1.53k]
  ------------------
  395|  2.07k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  2.07k|      }
  397|  34.0k|    } else {
  398|       |      // standard dataset
  399|  34.0k|      sizeData = getUShort(pRead, bigEndian);
  400|  34.0k|      pRead += 2;
  401|  34.0k|    }
  402|  35.5k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 34.8k, False: 723]
  ------------------
  403|  34.8k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  34.8k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 34.8k]
  ------------------
  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|  34.8k|    } else {
  410|    723|#ifndef SUPPRESS_WARNINGS
  411|    723|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|    723|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 723]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    723|  LogMsg(LogMsg::warn).os()
  ------------------
  412|    723|#endif
  413|    723|      return 7;
  414|    723|    }
  415|  34.8k|    pRead += sizeData;
  416|  34.8k|  }
  417|       |
  418|  1.80k|  return 0;
  419|  2.79k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  19.8k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  19.8k|  DataBuf buf;
  423|  19.8k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 18.6k, False: 1.18k]
  ------------------
  424|  18.6k|    return buf;
  425|       |
  426|  1.18k|  buf = DataBuf(iptcData.size());
  427|  1.18k|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|  1.18k|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|  1.18k|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|  1.18k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  30.5k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 30.5k, False: 1.18k]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  30.5k|    *pWrite++ = marker_;
  437|  30.5k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  30.5k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  30.5k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 30.5k]
  ------------------
  442|       |      // always use 4 bytes for extended length
  443|      0|      uint16_t sizeOfSize = 4 | 0x8000;
  444|      0|      us2Data(pWrite, sizeOfSize, bigEndian);
  445|      0|      pWrite += 2;
  446|      0|      ul2Data(pWrite, static_cast<uint32_t>(dataSize), bigEndian);
  447|      0|      pWrite += 4;
  448|  30.5k|    } else {
  449|  30.5k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  30.5k|      pWrite += 2;
  451|  30.5k|    }
  452|  30.5k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  30.5k|  }
  454|       |
  455|  1.18k|  return buf;
  456|  19.8k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|  1.30M|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|  1.30M|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 22.7k, False: 1.28M]
  |  Branch (42:43): [True: 17.4k, False: 5.31k]
  ------------------
   43|  1.30M|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  61.2k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  61.2k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  34.8k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  34.8k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  34.8k|  auto value = Exiv2::Value::create(type);
  466|  34.8k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  34.8k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 22.8k, False: 11.9k]
  ------------------
  468|  22.8k|    Exiv2::IptcKey key(dataSet, record);
  469|  22.8k|    iptcData.add(key, value.get());
  470|  22.8k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 11.9k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  11.9k|    value = Exiv2::Value::create(Exiv2::string);
  473|  11.9k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  11.9k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 11.9k, False: 0]
  ------------------
  475|  11.9k|      Exiv2::IptcKey key(dataSet, record);
  476|  11.9k|      iptcData.add(key, value.get());
  477|  11.9k|    }
  478|  11.9k|  }
  479|  34.8k|  return rc;
  480|  34.8k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|   152k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    141|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|    141|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 21, False: 120]
  |  Branch (15:29): [True: 7, False: 113]
  ------------------
   16|     28|    return false;
   17|     28|  }
   18|       |
   19|    113|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    113|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    113|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    113|  bool clWithRightBrand = false;
   24|  1.62k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.53k, False: 92]
  ------------------
   25|  1.53k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.53k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 710, False: 825]
  |  Branch (26:31): [True: 14, False: 696]
  |  Branch (26:66): [True: 235, False: 1.28k]
  |  Branch (26:87): [True: 7, False: 228]
  ------------------
   27|     21|      clWithRightBrand = true;
   28|     21|      break;
   29|     21|    }
   30|  1.53k|  }
   31|    113|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 33, False: 80]
  |  Branch (31:32): [True: 10, False: 23]
  ------------------
   32|    141|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  1.67k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  1.67k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 1.67k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  1.67k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  4.48M|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  4.48M|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|  8.25M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 3.77M, False: 4.48M]
  ------------------
  138|  3.77M|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 1.04k, False: 3.77M]
  ------------------
  139|  1.04k|      throw Error(err);
  140|  3.77M|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  5.15M|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 672k, False: 4.48M]
  ------------------
  144|   672k|  }
  145|  4.48M|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 89, False: 4.48M]
  ------------------
  146|     89|    throw Error(err);
  147|       |
  148|  4.48M|  return static_cast<byte>(c);
  149|  4.48M|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  1.67k|void JpegBase::readMetadata() {
  152|  1.67k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  1.67k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 1.67k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  1.67k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  1.67k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 125, False: 1.55k]
  ------------------
  159|    125|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 125]
  |  Branch (159:25): [True: 0, False: 125]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|    125|    throw Error(ErrorCode::kerNotAJpeg);
  162|    125|  }
  163|  1.55k|  clearMetadata();
  164|  1.55k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  1.55k|  Blob psBlob;
  166|  1.55k|  bool foundCompletePsData = false;
  167|  1.55k|  bool foundExifData = false;
  168|  1.55k|  bool foundXmpData = false;
  169|  1.55k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  1.55k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|   890k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 890k, False: 207]
  |  Branch (174:28): [True: 890k, False: 195]
  |  Branch (174:46): [True: 890k, False: 12]
  ------------------
  175|   890k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|   890k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|   890k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 54.3k, False: 835k]
  ------------------
  181|  54.3k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  54.3k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  54.3k|    }
  184|       |
  185|   890k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 6.89k, False: 883k]
  ------------------
  186|  6.89k|      sof_encoding_process_ = itSofMarker->label_;
  187|  6.89k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 4.83k, False: 2.06k]
  |  Branch (187:24): [True: 4.73k, False: 101]
  ------------------
  188|  4.73k|        num_color_components_ = *buf.c_data(7);
  189|  4.73k|      }
  190|  6.89k|    }
  191|       |
  192|   890k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 884k, False: 5.66k]
  |  Branch (192:27): [True: 2.31k, False: 882k]
  |  Branch (192:46): [True: 1.66k, False: 655]
  ------------------
  193|  1.66k|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 196, False: 1.46k]
  ------------------
  194|    196|      const DecodeParams dp(max_recursion_depth_);
  195|    196|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8, dp);
  196|    196|      setByteOrder(bo);
  197|    196|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (197:11): [True: 166, False: 30]
  |  Branch (197:23): [True: 0, False: 166]
  ------------------
  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|    196|      --search;
  204|    196|      foundExifData = true;
  205|   890k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (205:16): [True: 887k, False: 2.16k]
  |  Branch (205:33): [True: 2.23k, False: 885k]
  |  Branch (205:52): [True: 1.35k, False: 874]
  ------------------
  206|  1.35k|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (206:19): [True: 52, False: 1.30k]
  ------------------
  207|     52|      xmpPacket_.assign(buf.c_str(31), size - 31);
  208|     52|      const DecodeParams dp(max_recursion_depth_);
  209|     52|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (209:11): [True: 45, False: 7]
  |  Branch (209:34): [True: 28, False: 17]
  ------------------
  210|     28|#ifndef SUPPRESS_WARNINGS
  211|     28|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     28|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 28]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     28|  LogMsg(LogMsg::warn).os()
  ------------------
  212|     28|#endif
  213|     28|      }
  214|     52|      --search;
  215|     52|      foundXmpData = true;
  216|   890k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (216:16): [True: 889k, False: 757]
  |  Branch (216:40): [True: 39.3k, False: 849k]
  ------------------
  217|  39.3k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (217:16): [True: 39.1k, False: 225]
  ------------------
  218|  39.1k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (218:19): [True: 20.5k, False: 18.5k]
  ------------------
  219|       |#ifdef EXIV2_DEBUG_MESSAGES
  220|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  221|       |#endif
  222|  20.5k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (222:11): [True: 18.8k, False: 1.75k]
  ------------------
  223|  18.8k|        append(psBlob, buf.c_data(16), size - 16);
  224|  18.8k|      }
  225|       |      // Check whether psBlob is complete
  226|  20.5k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (226:11): [True: 20.0k, False: 485]
  |  Branch (226:30): [True: 94, False: 19.9k]
  ------------------
  227|     94|        --search;
  228|     94|        foundCompletePsData = true;
  229|     94|      }
  230|   869k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (230:16): [True: 765, False: 868k]
  |  Branch (230:34): [True: 248, False: 517]
  ------------------
  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|    248|      comment_.assign(buf.c_str(2), size - 2);
  235|  1.29k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (235:14): [True: 1.12k, False: 171]
  |  Branch (235:35): [True: 1.04k, False: 77]
  ------------------
  236|  1.04k|        comment_.pop_back();
  237|  1.04k|      }
  238|    248|      --search;
  239|   869k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (239:16): [True: 17.7k, False: 851k]
  |  Branch (239:35): [True: 5.54k, False: 12.2k]
  ------------------
  240|  5.54k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (240:19): [True: 4.93k, False: 608]
  ------------------
  241|  4.93k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (241:11): [True: 60, False: 4.87k]
  ------------------
  242|     60|        rc = 8;
  243|     60|        break;
  244|     60|      }
  245|       |      // ICC profile
  246|  4.87k|      if (!foundIccData) {
  ------------------
  |  Branch (246:11): [True: 148, False: 4.72k]
  ------------------
  247|    148|        foundIccData = true;
  248|    148|        --search;
  249|    148|      }
  250|  4.87k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  251|  4.87k|      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|  4.87k|      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|  4.87k|      size_t icc_size = size - 2 - 14;
  263|  4.87k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (263:11): [True: 265, False: 4.60k]
  |  Branch (263:25): [True: 103, False: 162]
  ------------------
  264|    103|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  265|    103|        icc_size = s;
  266|    103|      }
  267|       |
  268|  4.87k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  269|   864k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (269:16): [True: 769k, False: 94.7k]
  |  Branch (269:37): [True: 932, False: 768k]
  ------------------
  270|       |      // We hit a SOFn (start-of-frame) marker
  271|    932|      if (size < 8) {
  ------------------
  |  Branch (271:11): [True: 80, False: 852]
  ------------------
  272|     80|        rc = 7;
  273|     80|        break;
  274|     80|      }
  275|    852|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  276|    852|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  277|    852|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (277:11): [True: 176, False: 676]
  ------------------
  278|    176|        --search;
  279|    852|    }
  280|       |
  281|       |    // Read the beginning of the next segment
  282|   890k|    try {
  283|   890k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  284|   890k|    } catch (const Error&) {
  285|    631|      rc = 5;
  286|    631|      break;
  287|    631|    }
  288|   890k|  }  // while there are segments to process
  289|       |
  290|  1.18k|  if (!psBlob.empty()) {
  ------------------
  |  Branch (290:7): [True: 240, False: 945]
  ------------------
  291|       |    // Find actual IPTC data within the psBlob
  292|    240|    Blob iptcBlob;
  293|    240|    const byte* record = nullptr;
  294|    240|    uint32_t sizeIptc = 0;
  295|    240|    uint32_t sizeHdr = 0;
  296|    240|    const byte* pCur = psBlob.data();
  297|    240|    const byte* pEnd = pCur + psBlob.size();
  298|  15.3k|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (298:12): [True: 15.2k, False: 41]
  |  Branch (298:27): [True: 15.0k, False: 199]
  ------------------
  299|       |#ifdef EXIV2_DEBUG_MESSAGES
  300|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  301|       |#endif
  302|  15.0k|      if (sizeIptc) {
  ------------------
  |  Branch (302:11): [True: 656, False: 14.4k]
  ------------------
  303|    656|        append(iptcBlob, record + sizeHdr, sizeIptc);
  304|    656|      }
  305|  15.0k|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  306|  15.0k|    }
  307|    240|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (307:9): [True: 78, False: 162]
  |  Branch (307:30): [True: 29, False: 49]
  ------------------
  308|     29|#ifndef SUPPRESS_WARNINGS
  309|     29|      EXV_WARNING << "Failed to decode IPTC 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()
  ------------------
  310|     29|#endif
  311|     29|      iptcData_.clear();
  312|     29|    }
  313|    240|  }
  314|       |
  315|  1.18k|  if (rc != 0) {
  ------------------
  |  Branch (315:7): [True: 771, False: 414]
  ------------------
  316|    771|#ifndef SUPPRESS_WARNINGS
  317|    771|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|    771|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 771]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    771|  LogMsg(LogMsg::warn).os()
  ------------------
  318|    771|#endif
  319|    771|  }
  320|  1.18k|}  // JpegBase::readMetadata
_ZN5Exiv28JpegBase13writeMetadataEv:
  578|    771|void JpegBase::writeMetadata() {
  579|    771|  if (io_->open() != 0) {
  ------------------
  |  Branch (579:7): [True: 0, False: 771]
  ------------------
  580|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  581|      0|  }
  582|    771|  IoCloser closer(*io_);
  583|    771|  MemIo tempIo;
  584|       |
  585|    771|  doWriteMetadata(tempIo);  // may throw
  586|    771|  io_->close();
  587|    771|  io_->transfer(tempIo);  // may throw
  588|    771|}
_ZN5Exiv28JpegBase15readNextSegmentEh:
  590|  3.59M|DataBuf JpegBase::readNextSegment(byte marker) {
  591|  3.59M|  const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  592|       |
  593|       |  // Read the rest of the segment if not empty.
  594|  3.59M|  DataBuf buf(size);
  595|  3.59M|  if (size > 0) {
  ------------------
  |  Branch (595:7): [True: 117k, False: 3.47M]
  ------------------
  596|   117k|    std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  597|   117k|    if (size > 2) {
  ------------------
  |  Branch (597:9): [True: 90.4k, False: 27.1k]
  ------------------
  598|  90.4k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  599|  90.4k|    }
  600|   117k|  }
  601|  3.59M|  return buf;
  602|  3.59M|}
_ZN5Exiv28JpegBase15doWriteMetadataERNS_7BasicIoE:
  604|    771|void JpegBase::doWriteMetadata(BasicIo& outIo) {
  605|    771|  if (!io_->isopen())
  ------------------
  |  Branch (605:7): [True: 0, False: 771]
  ------------------
  606|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  607|    771|  if (!outIo.isopen())
  ------------------
  |  Branch (607:7): [True: 0, False: 771]
  ------------------
  608|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  609|       |
  610|       |  // Ensure that this is the correct image type
  611|    771|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (611:7): [True: 0, False: 771]
  ------------------
  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|    771|  static const size_t notfound = std::numeric_limits<size_t>::max();
  619|       |
  620|    771|  const size_t seek = io_->tell();
  621|    771|  size_t count = 0;
  622|    771|  size_t search = 0;
  623|    771|  size_t insertPos = 0;
  624|    771|  size_t comPos = 0;
  625|    771|  size_t skipApp1Exif = notfound;
  626|    771|  size_t skipApp1Xmp = notfound;
  627|    771|  bool foundCompletePsData = false;
  628|    771|  bool foundIccData = false;
  629|    771|  std::vector<size_t> skipApp13Ps3;
  630|    771|  std::vector<size_t> skipApp2Icc;
  631|    771|  size_t skipCom = notfound;
  632|    771|  Blob psBlob;
  633|    771|  DataBuf rawExif;
  634|    771|  xmpData().usePacket(writeXmpFromPacket());
  635|       |
  636|       |  // Write image header
  637|    771|  if (writeHeader(outIo))
  ------------------
  |  Branch (637:7): [True: 0, False: 771]
  ------------------
  638|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  639|       |
  640|       |  // Read section marker
  641|    771|  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.97M|  while (marker != sos_ && marker != eoi_ && search < 6) {
  ------------------
  |  Branch (646:10): [True: 1.97M, False: 585]
  |  Branch (646:28): [True: 1.97M, False: 180]
  |  Branch (646:46): [True: 1.97M, False: 6]
  ------------------
  647|  1.97M|    DataBuf buf = readNextSegment(marker);
  648|       |
  649|  1.97M|    if (marker == app0_) {
  ------------------
  |  Branch (649:9): [True: 532, False: 1.97M]
  ------------------
  650|    532|      insertPos = count + 1;
  651|  1.97M|    } else if (skipApp1Exif == notfound && marker == app1_ &&
  ------------------
  |  Branch (651:16): [True: 1.84M, False: 127k]
  |  Branch (651:44): [True: 2.48k, False: 1.84M]
  ------------------
  652|  2.48k|               buf.size() >= 8 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (652:16): [True: 1.43k, False: 1.05k]
  ------------------
  653|  1.43k|               buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (653:16): [True: 98, False: 1.33k]
  ------------------
  654|     98|      skipApp1Exif = count;
  655|     98|      ++search;
  656|     98|      if (buf.size() > 8) {
  ------------------
  |  Branch (656:11): [True: 92, False: 6]
  ------------------
  657|     92|        rawExif.alloc(buf.size() - 8);
  658|     92|        std::copy_n(buf.begin() + 8, rawExif.size(), rawExif.begin());
  659|     92|      }
  660|  1.97M|    } else if (skipApp1Xmp == notfound && marker == app1_ &&
  ------------------
  |  Branch (660:16): [True: 1.87M, False: 98.5k]
  |  Branch (660:43): [True: 2.69k, False: 1.87M]
  ------------------
  661|  2.69k|               buf.size() >= 31 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (661:16): [True: 1.21k, False: 1.47k]
  ------------------
  662|  1.21k|               buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (662:16): [True: 59, False: 1.15k]
  ------------------
  663|     59|      skipApp1Xmp = count;
  664|     59|      ++search;
  665|  1.97M|    } else if (marker == app2_ && buf.size() >= 13 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (665:16): [True: 20.8k, False: 1.95M]
  |  Branch (665:35): [True: 9.24k, False: 11.5k]
  ------------------
  666|  9.24k|               buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (666:16): [True: 5.29k, False: 3.94k]
  ------------------
  667|  5.29k|      skipApp2Icc.push_back(count);
  668|  5.29k|      if (!foundIccData) {
  ------------------
  |  Branch (668:11): [True: 109, False: 5.18k]
  ------------------
  669|    109|        ++search;
  670|    109|        foundIccData = true;
  671|    109|      }
  672|  1.96M|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (672:16): [True: 1.96M, False: 485]
  |  Branch (672:40): [True: 35.8k, False: 1.93M]
  ------------------
  673|  35.8k|               buf.size() >= 16 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (673:16): [True: 35.6k, False: 211]
  ------------------
  674|  35.6k|               buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (674:16): [True: 18.8k, False: 16.7k]
  ------------------
  675|       |#ifdef EXIV2_DEBUG_MESSAGES
  676|       |      std::cerr << "Found APP13 Photoshop PS3 segment\n";
  677|       |#endif
  678|  18.8k|      skipApp13Ps3.push_back(count);
  679|       |      // Append to psBlob
  680|  18.8k|      append(psBlob, buf.c_data(16), buf.size() - 16);
  681|       |      // Check whether psBlob is complete
  682|  18.8k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (682:11): [True: 18.1k, False: 767]
  |  Branch (682:30): [True: 55, False: 18.0k]
  ------------------
  683|     55|        foundCompletePsData = true;
  684|     55|      }
  685|  1.95M|    } else if (marker == com_ && skipCom == notfound) {
  ------------------
  |  Branch (685:16): [True: 422, False: 1.95M]
  |  Branch (685:34): [True: 96, False: 326]
  ------------------
  686|       |      // Jpegs can have multiple comments, but for now only handle
  687|       |      // the first one (most jpegs only have one anyway).
  688|     96|      skipCom = count;
  689|     96|      ++search;
  690|     96|    }
  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.97M|    if (comPos == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (697:9): [True: 901k, False: 1.07M]
  |  Branch (697:24): [True: 250, False: 901k]
  ------------------
  698|    250|      comPos = count;
  699|    250|      ++search;
  700|    250|    }
  701|  1.97M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  702|  1.97M|    ++count;
  703|  1.97M|  }
  704|       |
  705|    771|  if (!foundCompletePsData && !psBlob.empty())
  ------------------
  |  Branch (705:7): [True: 250, False: 521]
  |  Branch (705:31): [True: 11, False: 239]
  ------------------
  706|     11|    throw Error(ErrorCode::kerNoImageInInputData);
  707|    760|  search += skipApp13Ps3.size() + skipApp2Icc.size();
  708|       |
  709|    760|  if (comPos == 0) {
  ------------------
  |  Branch (709:7): [True: 220, False: 540]
  ------------------
  710|    220|    if (marker == eoi_)
  ------------------
  |  Branch (710:9): [True: 127, False: 93]
  ------------------
  711|    127|      comPos = count;
  712|     93|    else
  713|     93|      comPos = insertPos;
  714|    220|    ++search;
  715|    220|  }
  716|    760|  if (!exifData_.empty())
  ------------------
  |  Branch (716:7): [True: 62, False: 698]
  ------------------
  717|     62|    ++search;
  718|    760|  if (!writeXmpFromPacket() && !xmpData_.empty())
  ------------------
  |  Branch (718:7): [True: 278, False: 482]
  |  Branch (718:32): [True: 15, False: 263]
  ------------------
  719|     15|    ++search;
  720|    760|  if (writeXmpFromPacket() && !xmpPacket_.empty())
  ------------------
  |  Branch (720:7): [True: 0, False: 760]
  |  Branch (720:31): [True: 0, False: 0]
  ------------------
  721|      0|    ++search;
  722|    760|  if (foundCompletePsData || !iptcData_.empty())
  ------------------
  |  Branch (722:7): [True: 521, False: 239]
  |  Branch (722:30): [True: 0, False: 239]
  ------------------
  723|     39|    ++search;
  724|    760|  if (!comment_.empty())
  ------------------
  |  Branch (724:7): [True: 18, False: 742]
  ------------------
  725|     18|    ++search;
  726|       |
  727|    760|  io_->seekOrThrow(seek, BasicIo::beg, ErrorCode::kerNoImageInInputData);
  728|    760|  count = 0;
  729|    760|  marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  730|       |
  731|       |  // To simplify this a bit, new segments are inserts at either the start
  732|       |  // or right after app0. This is standard in most jpegs, but has the
  733|       |  // potential to change segment ordering (which is allowed).
  734|       |  // Segments are erased if there is no assigned metadata.
  735|  1.61M|  while (marker != sos_ && search > 0) {
  ------------------
  |  Branch (735:10): [True: 1.61M, False: 543]
  |  Branch (735:28): [True: 1.61M, False: 68]
  ------------------
  736|  1.61M|    DataBuf buf = readNextSegment(marker);
  737|       |
  738|  1.61M|    if (insertPos == count) {
  ------------------
  |  Branch (738:9): [True: 271, False: 1.61M]
  ------------------
  739|       |      // Write Exif data first so that - if there is no app0 - we
  740|       |      // create "Exif images" according to the Exif standard.
  741|    271|      if (!exifData_.empty()) {
  ------------------
  |  Branch (741:11): [True: 62, False: 209]
  ------------------
  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: 42, False: 20]
  ------------------
  751|     42|          pExifData = !blob.empty() ? blob.data() : nullptr;
  ------------------
  |  Branch (751:23): [True: 41, False: 1]
  ------------------
  752|     42|          exifSize = blob.size();
  753|     42|        }
  754|     62|        if (exifSize > 0) {
  ------------------
  |  Branch (754:13): [True: 60, False: 2]
  ------------------
  755|     60|          std::array<byte, 10> tmpBuf;
  756|       |          // Write APP1 marker, size of APP1 field, Exif id and Exif data
  757|     60|          tmpBuf[0] = 0xff;
  758|     60|          tmpBuf[1] = app1_;
  759|       |
  760|     60|          if (exifSize > 0xffff - 8)
  ------------------
  |  Branch (760:15): [True: 2, False: 58]
  ------------------
  761|      2|            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|    269|      if (!writeXmpFromPacket() &&
  ------------------
  |  Branch (775:11): [True: 268, False: 1]
  ------------------
  776|    268|          XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {
  ------------------
  |  Branch (776:11): [True: 0, False: 268]
  ------------------
  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|    269|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (781:11): [True: 15, False: 254]
  ------------------
  782|     15|        std::array<byte, 33> tmpBuf;
  783|       |        // Write APP1 marker, size of APP1 field, XMP id and XMP packet
  784|     15|        tmpBuf[0] = 0xff;
  785|     15|        tmpBuf[1] = app1_;
  786|       |
  787|     15|        if (xmpPacket_.size() > 0xffff - 31)
  ------------------
  |  Branch (787:13): [True: 0, False: 15]
  ------------------
  788|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "XMP");
  789|     15|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(xmpPacket_.size() + 31), bigEndian);
  790|     15|        std::copy(xmpId_.begin(), xmpId_.end(), tmpBuf.begin() + 4);
  791|     15|        if (outIo.write(tmpBuf.data(), 33) != 33)
  ------------------
  |  Branch (791:13): [True: 0, False: 15]
  ------------------
  792|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  793|       |
  794|       |        // Write new XMP packet
  795|     15|        if (outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (795:13): [True: 0, False: 15]
  ------------------
  796|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  797|     15|        if (outIo.error())
  ------------------
  |  Branch (797:13): [True: 0, False: 15]
  ------------------
  798|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  799|     15|        --search;
  800|     15|      }
  801|       |
  802|    269|      if (iccProfileDefined()) {
  ------------------
  |  Branch (802:11): [True: 23, False: 246]
  ------------------
  803|     23|        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|     23|        tmpBuf[0] = 0xff;
  807|     23|        tmpBuf[1] = app2_;
  808|       |
  809|     23|        const size_t chunk_size = (256 * 256) - 40;  // leave bytes for marker, header and padding
  810|     23|        size_t size = iccProfile_.size();
  811|     23|        if (size >= 255 * chunk_size)
  ------------------
  |  Branch (811:13): [True: 0, False: 23]
  ------------------
  812|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "IccProfile");
  813|     23|        const size_t chunks = 1 + ((size - 1) / chunk_size);
  814|     73|        for (size_t chunk = 0; chunk < chunks; chunk++) {
  ------------------
  |  Branch (814:32): [True: 50, False: 23]
  ------------------
  815|     50|          auto bytes = std::min<size_t>(size, chunk_size);  // bytes to write
  816|     50|          size -= bytes;
  817|       |
  818|       |          // write JPEG marker (2 bytes)
  819|     50|          if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (819:15): [True: 0, False: 50]
  ------------------
  820|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Marker
  821|       |          // write length (2 bytes).  length includes the 2 bytes for the length
  822|     50|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(2 + 14 + bytes), bigEndian);
  823|     50|          if (outIo.write(tmpBuf.data() + 2, 2) != 2)
  ------------------
  |  Branch (823:15): [True: 0, False: 50]
  ------------------
  824|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Length
  825|       |
  826|       |          // write the ICC_PROFILE header (14 bytes)
  827|     50|          uint8_t pad[2];
  828|     50|          pad[0] = static_cast<uint8_t>(chunk + 1);
  829|     50|          pad[1] = static_cast<uint8_t>(chunks);
  830|     50|          outIo.write(reinterpret_cast<const byte*>(iccId_), 12);
  831|     50|          outIo.write(reinterpret_cast<const byte*>(pad), 2);
  832|     50|          if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes)
  ------------------
  |  Branch (832:15): [True: 0, False: 50]
  ------------------
  833|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  834|     50|          if (outIo.error())
  ------------------
  |  Branch (834:15): [True: 0, False: 50]
  ------------------
  835|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  836|     50|        }
  837|     23|        --search;
  838|     23|      }
  839|       |
  840|    269|      if (foundCompletePsData || !iptcData_.empty()) {
  ------------------
  |  Branch (840:11): [True: 40, False: 229]
  |  Branch (840:34): [True: 0, False: 229]
  ------------------
  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|     39|        DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
  844|     39|        const size_t maxChunkSize = 0xffff - 16;
  845|     39|        const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
  ------------------
  |  Branch (845:34): [True: 4, False: 35]
  ------------------
  846|     39|        const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);
  ------------------
  |  Branch (846:32): [True: 4, False: 35]
  ------------------
  847|     84|        while (chunkStart < chunkEnd) {
  ------------------
  |  Branch (847:16): [True: 45, False: 39]
  ------------------
  848|       |          // Determine size of next chunk
  849|     45|          size_t chunkSize = (chunkEnd + 1 - chunkStart);
  850|     45|          if (chunkSize > maxChunkSize) {
  ------------------
  |  Branch (850:15): [True: 14, False: 31]
  ------------------
  851|     14|            chunkSize = maxChunkSize;
  852|       |            // Don't break at a valid IRB boundary
  853|     14|            const auto writtenSize = chunkStart - newPsData.c_data();
  854|     14|            if (Photoshop::valid(newPsData.c_data(), writtenSize + chunkSize)) {
  ------------------
  |  Branch (854:17): [True: 0, False: 14]
  ------------------
  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|     14|          }
  860|       |
  861|       |          // Write APP13 marker, chunk size, and ps3Id
  862|     45|          std::array<byte, 18> tmpBuf;
  863|     45|          tmpBuf[0] = 0xff;
  864|     45|          tmpBuf[1] = app13_;
  865|     45|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(chunkSize + 16), bigEndian);
  866|     45|          std::copy_n(Photoshop::ps3Id_, 14, tmpBuf.begin() + 4);
  867|     45|          if (outIo.write(tmpBuf.data(), 18) != 18)
  ------------------
  |  Branch (867:15): [True: 0, False: 45]
  ------------------
  868|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  869|     45|          if (outIo.error())
  ------------------
  |  Branch (869:15): [True: 0, False: 45]
  ------------------
  870|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  871|       |
  872|       |          // Write next chunk of the Photoshop IRB data buffer
  873|     45|          if (outIo.write(chunkStart, chunkSize) != chunkSize)
  ------------------
  |  Branch (873:15): [True: 0, False: 45]
  ------------------
  874|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  875|     45|          if (outIo.error())
  ------------------
  |  Branch (875:15): [True: 0, False: 45]
  ------------------
  876|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  877|       |
  878|     45|          chunkStart += chunkSize;
  879|     45|        }
  880|     39|        --search;
  881|     39|      }
  882|    269|    }
  883|  1.61M|    if (comPos == count) {
  ------------------
  |  Branch (883:9): [True: 264, False: 1.61M]
  ------------------
  884|    264|      if (!comment_.empty()) {
  ------------------
  |  Branch (884:11): [True: 18, False: 246]
  ------------------
  885|     18|        std::array<byte, 4> tmpBuf;
  886|       |        // Write COM marker, size of comment, and string
  887|     18|        tmpBuf[0] = 0xff;
  888|     18|        tmpBuf[1] = com_;
  889|       |
  890|     18|        if (comment_.length() > 0xffff - 3)
  ------------------
  |  Branch (890:13): [True: 1, False: 17]
  ------------------
  891|      1|          throw Error(ErrorCode::kerTooLargeJpegSegment, "JPEG comment");
  892|     17|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
  893|       |
  894|     17|        if (outIo.write(tmpBuf.data(), 4) != 4)
  ------------------
  |  Branch (894:13): [True: 0, False: 17]
  ------------------
  895|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  896|     17|        if (outIo.write(reinterpret_cast<byte*>(comment_.data()), comment_.length()) != comment_.length())
  ------------------
  |  Branch (896:13): [True: 0, False: 17]
  ------------------
  897|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  898|     17|        if (outIo.putb(0) == EOF)
  ------------------
  |  Branch (898:13): [True: 0, False: 17]
  ------------------
  899|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  900|     17|        if (outIo.error())
  ------------------
  |  Branch (900:13): [True: 0, False: 17]
  ------------------
  901|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  902|     17|        --search;
  903|     17|      }
  904|    263|      --search;
  905|    263|    }
  906|  1.61M|    if (marker == eoi_) {
  ------------------
  |  Branch (906:9): [True: 146, False: 1.61M]
  ------------------
  907|    146|      break;
  908|    146|    }
  909|  1.61M|    if (skipApp1Exif == count || skipApp1Xmp == count ||
  ------------------
  |  Branch (909:9): [True: 84, False: 1.61M]
  |  Branch (909:9): [True: 17.0k, False: 1.59M]
  |  Branch (909:34): [True: 42, False: 1.61M]
  ------------------
  910|  1.61M|        std::find(skipApp13Ps3.begin(), skipApp13Ps3.end(), count) != skipApp13Ps3.end() ||
  ------------------
  |  Branch (910:9): [True: 13.8k, False: 1.60M]
  ------------------
  911|  1.60M|        std::find(skipApp2Icc.begin(), skipApp2Icc.end(), count) != skipApp2Icc.end() || skipCom == count) {
  ------------------
  |  Branch (911:9): [True: 2.99k, False: 1.59M]
  |  Branch (911:90): [True: 47, False: 1.59M]
  ------------------
  912|  17.0k|      --search;
  913|  1.59M|    } else {
  914|  1.59M|      std::array<byte, 2> tmpBuf;
  915|       |      // Write marker and a copy of the segment.
  916|  1.59M|      tmpBuf[0] = 0xff;
  917|  1.59M|      tmpBuf[1] = marker;
  918|  1.59M|      if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (918:11): [True: 0, False: 1.59M]
  ------------------
  919|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  920|  1.59M|      if (outIo.write(buf.c_data(), buf.size()) != buf.size())
  ------------------
  |  Branch (920:11): [True: 0, False: 1.59M]
  ------------------
  921|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  922|  1.59M|      if (outIo.error())
  ------------------
  |  Branch (922:11): [True: 0, False: 1.59M]
  ------------------
  923|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  924|  1.59M|    }
  925|       |
  926|       |    // Next marker
  927|  1.61M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  928|  1.61M|    ++count;
  929|  1.61M|  }
  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|    757|  io_->populateFakeData();
  934|       |
  935|       |  // Write the final marker, then copy rest of the Io.
  936|    757|  byte tmpBuf[2];
  937|    757|  tmpBuf[0] = 0xff;
  938|    757|  tmpBuf[1] = marker;
  939|    757|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (939:7): [True: 0, False: 757]
  ------------------
  940|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  941|       |
  942|    757|  DataBuf buf(4096);
  943|    757|  size_t readSize = io_->read(buf.data(), buf.size());
  944|  1.22k|  while (readSize != 0) {
  ------------------
  |  Branch (944:10): [True: 472, False: 757]
  ------------------
  945|    472|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (945:9): [True: 0, False: 472]
  ------------------
  946|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  947|    472|    readSize = io_->read(buf.data(), buf.size());
  948|    472|  }
  949|    757|  if (outIo.error())
  ------------------
  |  Branch (949:7): [True: 0, False: 757]
  ------------------
  950|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  951|       |
  952|    757|}  // JpegBase::doWriteMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  971|  1.64k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  972|  1.64k|}
_ZNK5Exiv29JpegImage11writeHeaderERNS_7BasicIoE:
  978|    762|int JpegImage::writeHeader(BasicIo& outIo) const {
  979|       |  // Jpeg header
  980|    762|  byte tmpBuf[2];
  981|    762|  tmpBuf[0] = 0xff;
  982|    762|  tmpBuf[1] = soi_;
  983|    762|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (983:7): [True: 0, False: 762]
  ------------------
  984|      0|    return 4;
  985|    762|  if (outIo.error())
  ------------------
  |  Branch (985:7): [True: 0, False: 762]
  ------------------
  986|      0|    return 4;
  987|    762|  return 0;
  988|    762|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  990|  2.40k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  991|  2.40k|  return isJpegType(iIo, advance);
  992|  2.40k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  994|  1.50k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  995|  1.50k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  996|  1.50k|  if (!image->good()) {
  ------------------
  |  Branch (996:7): [True: 0, False: 1.50k]
  ------------------
  997|      0|    return nullptr;
  998|      0|  }
  999|  1.50k|  return image;
 1000|  1.50k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1002|  44.5k|bool isJpegType(BasicIo& iIo, bool advance) {
 1003|  44.5k|  bool result = true;
 1004|  44.5k|  byte tmpBuf[2];
 1005|  44.5k|  iIo.read(tmpBuf, 2);
 1006|  44.5k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1006:7): [True: 0, False: 44.5k]
  |  Branch (1006:22): [True: 24, False: 44.5k]
  ------------------
 1007|     24|    return false;
 1008|       |
 1009|  44.5k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1009:7): [True: 38.9k, False: 5.55k]
  |  Branch (1009:28): [True: 266, False: 5.28k]
  ------------------
 1010|  39.2k|    result = false;
 1011|  39.2k|  }
 1012|  44.5k|  if (!advance || !result)
  ------------------
  |  Branch (1012:7): [True: 42.1k, False: 2.40k]
  |  Branch (1012:19): [True: 125, False: 2.28k]
  ------------------
 1013|  42.2k|    iIo.seek(-2, BasicIo::cur);
 1014|  44.5k|  return result;
 1015|  44.5k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1018|     31|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1019|     31|}
_ZNK5Exiv28ExvImage11writeHeaderERNS_7BasicIoE:
 1025|      9|int ExvImage::writeHeader(BasicIo& outIo) const {
 1026|       |  // Exv header
 1027|      9|  auto tmpBuf = std::array<byte, 7>{0xff, 0x01};
 1028|      9|  std::copy_n(exiv2Id_, 5, tmpBuf.begin() + 2);
 1029|      9|  if (outIo.write(tmpBuf.data(), 7) != 7)
  ------------------
  |  Branch (1029:7): [True: 0, False: 9]
  ------------------
 1030|      0|    return 4;
 1031|      9|  if (outIo.error())
  ------------------
  |  Branch (1031:7): [True: 0, False: 9]
  ------------------
 1032|      0|    return 4;
 1033|      9|  return 0;
 1034|      9|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1036|     40|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1037|     40|  return isExvType(iIo, advance);
 1038|     40|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1040|     31|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1041|     31|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1042|     31|  if (!image->good())
  ------------------
  |  Branch (1042:7): [True: 0, False: 31]
  ------------------
 1043|      0|    return nullptr;
 1044|     31|  return image;
 1045|     31|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1047|  39.1k|bool isExvType(BasicIo& iIo, bool advance) {
 1048|  39.1k|  bool result = true;
 1049|  39.1k|  byte tmpBuf[7];
 1050|  39.1k|  iIo.read(tmpBuf, 7);
 1051|  39.1k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1051:7): [True: 0, False: 39.1k]
  |  Branch (1051:22): [True: 90, False: 39.1k]
  ------------------
 1052|     90|    return false;
 1053|       |
 1054|  39.1k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1054:7): [True: 38.8k, False: 269]
  |  Branch (1054:28): [True: 130, False: 139]
  |  Branch (1054:49): [True: 37, False: 102]
  ------------------
 1055|  39.0k|    result = false;
 1056|  39.0k|  }
 1057|  39.1k|  if (!advance || !result)
  ------------------
  |  Branch (1057:7): [True: 39.0k, False: 40]
  |  Branch (1057:19): [True: 0, False: 40]
  ------------------
 1058|  39.0k|    iIo.seek(-7, BasicIo::cur);
 1059|  39.1k|  return result;
 1060|  39.1k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  4.48M|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  4.48M|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  4.48M|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  4.48M|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 187k, False: 4.29M]
  ------------------
  107|   187k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|   187k|    size = getUShort(buf.data(), bigEndian);
  109|   187k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|   187k|  }
  111|  4.48M|  return {buf, size};
  112|  4.48M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  1.67M|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  1.67M|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 774, False: 1.67M]
  |  Branch (92:38): [True: 408, False: 1.66M]
  ------------------
   93|  1.67M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  3.34M|constexpr bool inRange(int lo, int value, int hi) {
   88|  3.34M|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 3.33M, False: 6.61k]
  |  Branch (88:25): [True: 1.18k, False: 3.33M]
  ------------------
   89|  3.34M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  4.48M|bool markerHasLength(byte m) {
   99|  4.48M|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 4.45M, False: 24.8k]
  |  Branch (99:44): [True: 4.29M, False: 163k]
  ------------------
  100|  4.48M|  return !markerWithoutLength;
  101|  4.48M|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  2.75k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  2.75k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  2.75k|std::string MatroskaVideo::mimeType() const {
  604|  2.75k|  return "video/matroska";
  605|  2.75k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  607|  1.64k|void MatroskaVideo::writeMetadata() {
  608|  1.64k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  2.75k|void MatroskaVideo::readMetadata() {
  611|  2.75k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 2.75k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  2.75k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 2.75k]
  ------------------
  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|  2.75k|  IoCloser closer(*io_);
  622|  2.75k|  clearMetadata();
  623|  2.75k|  continueTraversing_ = true;
  624|  2.75k|  height_ = width_ = 1;
  625|       |
  626|  2.75k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  2.75k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|  57.9k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 55.1k, False: 2.75k]
  ------------------
  630|  55.1k|    decodeBlock();
  631|       |
  632|  2.75k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  2.75k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|  55.1k|void MatroskaVideo::decodeBlock() {
  636|  55.1k|  byte buf[8];
  637|  55.1k|  io_->read(buf, 1);
  638|       |
  639|  55.1k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 374, False: 54.7k]
  ------------------
  640|    374|    continueTraversing_ = false;
  641|    374|    return;
  642|    374|  }
  643|       |
  644|  54.7k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|  54.7k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 54.3k, False: 414]
  ------------------
  646|  54.3k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|  54.7k|  auto tag_id = returnTagValue(buf, block_size);
  649|  54.7k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|  54.7k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 1.40k, False: 53.3k]
  ------------------
  652|  1.40k|    continueTraversing_ = false;
  653|  1.40k|    return;
  654|  1.40k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|  53.3k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 461, False: 52.9k]
  |  Branch (658:27): [True: 1, False: 52.9k]
  ------------------
  659|      2|    continueTraversing_ = false;
  660|      2|    return;
  661|      2|  }
  662|       |
  663|  53.3k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|  53.3k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|  53.3k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 52.8k, False: 554]
  ------------------
  667|  52.8k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|  53.3k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|  53.3k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 25.5k, False: 27.8k]
  |  Branch (670:29): [True: 25.5k, False: 0]
  ------------------
  671|  25.5k|    return;
  672|       |
  673|  27.8k|  const size_t bufMaxSize = 200;
  674|       |
  675|  27.8k|#ifndef SUPPRESS_WARNINGS
  676|  27.8k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 25.7k, False: 2.06k]
  |  Branch (676:28): [True: 141, False: 25.6k]
  ------------------
  677|    141|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    141|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 141]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    141|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    141|  }
  680|  27.8k|#endif
  681|  27.8k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.06k, False: 25.7k]
  |  Branch (681:27): [True: 141, False: 25.6k]
  ------------------
  682|  1.64k|    io_->seek(size, BasicIo::cur);
  683|  1.64k|    return;
  684|  1.64k|  }
  685|       |
  686|  26.2k|  DataBuf buf2(bufMaxSize + 1);
  687|  26.2k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  26.2k|  switch (tag->_type) {
  689|  7.36k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 7.36k, False: 18.8k]
  ------------------
  690|  7.36k|      decodeInternalTags(tag, buf2.data());
  691|  7.36k|      break;
  692|  2.76k|    case String:
  ------------------
  |  Branch (692:5): [True: 2.76k, False: 23.4k]
  ------------------
  693|  2.76k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 26.2k]
  ------------------
  694|  2.76k|      decodeStringTags(tag, buf2.data());
  695|  2.76k|      break;
  696|  2.58k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 2.58k, False: 23.6k]
  ------------------
  697|  5.14k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 2.56k, False: 23.6k]
  ------------------
  698|  5.14k|      decodeIntegerTags(tag, buf2.data());
  699|  5.14k|      break;
  700|  6.37k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 6.37k, False: 19.8k]
  ------------------
  701|  6.37k|      decodeBooleanTags(tag, buf2.data());
  702|  6.37k|      break;
  703|  1.16k|    case Date:
  ------------------
  |  Branch (703:5): [True: 1.16k, False: 25.0k]
  ------------------
  704|  1.16k|      decodeDateTags(tag, buf2.data(), size);
  705|  1.16k|      break;
  706|  2.69k|    case Float:
  ------------------
  |  Branch (706:5): [True: 2.69k, False: 23.5k]
  ------------------
  707|  2.69k|      decodeFloatTags(tag, buf2.data());
  708|  2.69k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 26.2k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 26.2k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 26.2k]
  ------------------
  714|      0|      break;
  715|  26.2k|  }
  716|  26.2k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  7.36k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  7.36k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  7.36k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 260, False: 7.10k]
  ------------------
  721|    260|    return;
  722|       |
  723|  7.10k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  7.10k|    switch (tag->_id) {
  725|  7.10k|      case Xmp_video_VideoScanTpye:
  726|  7.10k|        return Exiv2::find(videoScanType, key);
  727|  7.10k|      case Xmp_audio_ChannelType:
  728|  7.10k|        return Exiv2::find(audioChannels, key);
  729|  7.10k|      case Xmp_video_ContentCompressAlgo:
  730|  7.10k|        return Exiv2::find(compressionAlgorithm, key);
  731|  7.10k|      case Xmp_video_ContentEncryptAlgo:
  732|  7.10k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  7.10k|      case Xmp_video_ContentSignAlgo_1:
  734|  7.10k|      case Xmp_video_ContentSignAlgo_2:
  735|  7.10k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  7.10k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  7.10k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  7.10k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  7.10k|      case Xmp_video_ContentEncodingType:
  740|  7.10k|        return Exiv2::find(encodingType, key);
  741|  7.10k|      case Xmp_video_DisplayUnit:
  742|  7.10k|        return Exiv2::find(displayUnit, key);
  743|  7.10k|      case Xmp_video_AspectRatioType:
  744|  7.10k|        return Exiv2::find(aspectRatioType, key);
  745|  7.10k|      case Xmp_video_PhysicalEquivalent:
  746|  7.10k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  7.10k|      case Xmp_video_TranslateCodec:
  748|  7.10k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  7.10k|      case Video_Audio_CodecID:
  750|  7.10k|        return Exiv2::find(trackCodec, key);
  751|  7.10k|      case Video_Audio_CodecName:
  752|  7.10k|        return Exiv2::find(codecInfo, key);
  753|  7.10k|      case CodecDownloadURL:
  754|  7.10k|      case CodecInfoURL:
  755|  7.10k|        return Exiv2::find(codecDownloadUrl, key);
  756|  7.10k|    }
  757|  7.10k|    return nullptr;
  758|  7.10k|  }();
  759|  7.10k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 2.72k, False: 4.38k]
  ------------------
  760|  2.72k|    xmpData_[tag->_label] = internalMt->_label;
  761|  4.38k|  } else {
  762|  4.38k|    xmpData_[tag->_label] = key;
  763|  4.38k|  }
  764|  7.10k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  2.76k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  2.76k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 1.43k, False: 1.33k]
  ------------------
  768|  1.43k|    track_count_++;
  769|  1.43k|    xmpData_[tag->_label] = track_count_;
  770|  1.43k|  } else {
  771|  1.33k|    xmpData_[tag->_label] = buf;
  772|  1.33k|  }
  773|  2.76k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  5.14k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  5.14k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  5.14k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 2.15k, False: 2.98k]
  ------------------
  778|  2.15k|    return;
  779|       |
  780|  2.98k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 1.38k, False: 1.60k]
  |  Branch (780:40): [True: 414, False: 1.19k]
  ------------------
  781|  1.79k|    width_ = value;
  782|  2.98k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 243, False: 2.74k]
  |  Branch (782:41): [True: 286, False: 2.46k]
  ------------------
  783|    529|    height_ = value;
  784|  2.98k|  xmpData_[tag->_label] = value;
  785|  2.98k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  6.37k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  6.37k|  const MatroskaTag* internalMt = nullptr;
  789|  6.37k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  6.37k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 1.30k, False: 5.07k]
  ------------------
  791|  1.30k|    return;
  792|       |
  793|  5.07k|  switch (tag->_id) {
  794|  1.27k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 1.27k, False: 3.80k]
  ------------------
  795|  1.27k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 322, False: 948]
  ------------------
  796|    322|        stream_ = f->_id;
  797|    322|      }
  798|  1.27k|      break;
  799|    423|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 423, False: 4.65k]
  ------------------
  800|    423|      internalMt = Exiv2::find(trackEnable, key);
  801|    423|      break;
  802|    967|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 967, False: 4.10k]
  ------------------
  803|    967|      internalMt = Exiv2::find(defaultOn, key);
  804|    967|      break;
  805|    559|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 559, False: 4.51k]
  ------------------
  806|    559|      internalMt = Exiv2::find(trackForced, key);
  807|    559|      break;
  808|    628|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 628, False: 4.44k]
  ------------------
  809|    628|      internalMt = Exiv2::find(trackLacing, key);
  810|    628|      break;
  811|    513|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 513, False: 4.56k]
  ------------------
  812|    513|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|    513|      break;
  814|    491|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 491, False: 4.58k]
  ------------------
  815|    491|      internalMt = Exiv2::find(codecSettings, key);
  816|    491|      break;
  817|    222|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 222, False: 4.85k]
  ------------------
  818|    222|      internalMt = tag;
  819|    222|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 5.07k]
  ------------------
  821|      0|      break;
  822|  5.07k|  }
  823|       |
  824|  5.07k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.59k, False: 3.47k]
  ------------------
  825|  1.59k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.59k|  }
  827|  5.07k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  1.16k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  1.16k|  int64_t duration_in_ms = 0;
  831|  1.16k|  uint64_t value;
  832|  1.16k|  switch (tag->_id) {
  833|    481|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 481, False: 681]
  ------------------
  834|    481|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 299, False: 182]
  ------------------
  835|    299|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|    299|      } else {
  837|    182|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    182|      }
  839|    481|      xmpData_[tag->_label] = duration_in_ms;
  840|    481|      break;
  841|    101|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 101, False: 1.06k]
  ------------------
  842|    101|      value = getULongLong(buf, bigEndian);
  843|    101|      if (!value)
  ------------------
  |  Branch (843:11): [True: 34, False: 67]
  ------------------
  844|     34|        return;
  845|     67|      duration_in_ms = value / 1000000000;
  846|     67|      xmpData_[tag->_label] = duration_in_ms;
  847|     67|      break;
  848|       |
  849|    580|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 580, False: 582]
  ------------------
  850|    580|      value = getULongLong(buf, bigEndian);
  851|    580|      if (!value)
  ------------------
  |  Branch (851:11): [True: 422, False: 158]
  ------------------
  852|    422|        return;
  853|    158|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    158|      xmpData_[tag->_label] = time_code_scale_;
  855|    158|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 1.16k]
  ------------------
  857|      0|      break;
  858|  1.16k|  }
  859|  1.16k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  2.69k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  2.69k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  2.69k|  switch (tag->_id) {
  865|    703|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 703, False: 1.98k]
  ------------------
  866|    952|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 249, False: 2.44k]
  ------------------
  867|    952|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|    952|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 2.69k]
  ------------------
  870|  1.73k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 1.73k, False: 952]
  ------------------
  871|  1.73k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  1.73k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 85, False: 1.65k]
  ------------------
  873|     85|        return;
  874|  1.65k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 874, False: 779]
  ------------------
  875|    874|        double frame_rate = 0;
  876|    874|        switch (stream_) {
  877|    283|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 283, False: 591]
  ------------------
  878|    283|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|    283|            break;
  880|     76|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 76, False: 798]
  ------------------
  881|     76|            frame_rate = static_cast<double>(key) / 1000;
  882|     76|            break;
  883|    515|          default:
  ------------------
  |  Branch (883:11): [True: 515, False: 359]
  ------------------
  884|    515|            break;
  885|    874|        }
  886|    874|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 359, False: 515]
  ------------------
  887|    359|          xmpData_[internalMt->_label] = frame_rate;
  888|    874|      } else
  889|    779|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|  1.65k|    } break;
  891|  1.65k|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.69k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  2.69k|  }
  895|  2.69k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   107k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   107k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 82.6k, False: 25.0k]
  ------------------
  899|  82.6k|    return 1;
  900|  25.0k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 13.1k, False: 11.9k]
  ------------------
  901|  13.1k|    return 2;
  902|  11.9k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 2.78k, False: 9.15k]
  ------------------
  903|  2.78k|    return 3;
  904|  9.15k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 4.78k, False: 4.37k]
  ------------------
  905|  4.78k|    return 4;
  906|  4.37k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 941, False: 3.43k]
  ------------------
  907|    941|    return 5;
  908|  3.43k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 453, False: 2.97k]
  ------------------
  909|    453|    return 6;
  910|  2.97k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 505, False: 2.47k]
  ------------------
  911|    505|    return 7;
  912|  2.47k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 1.98k, False: 485]
  ------------------
  913|  1.98k|    return 8;
  914|    485|  return 0;
  915|  2.47k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  2.75k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  2.75k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  2.75k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 2.75k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  2.75k|  return image;
  923|  2.75k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  12.2k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  12.2k|  bool result = true;
  927|  12.2k|  byte tmpBuf[4];
  928|  12.2k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  12.2k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 12.2k]
  |  Branch (930:22): [True: 414, False: 11.8k]
  ------------------
  931|    414|    return false;
  932|       |
  933|  11.8k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 3.51k, False: 8.34k]
  |  Branch (933:28): [True: 36, False: 8.30k]
  |  Branch (933:49): [True: 21, False: 8.28k]
  |  Branch (933:70): [True: 32, False: 8.25k]
  ------------------
  934|  3.60k|    result = false;
  935|  3.60k|  }
  936|       |
  937|  11.8k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 11.8k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  11.8k|    iIo.seek(0, BasicIo::beg);
  939|  11.8k|  return result;
  940|  12.2k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   107k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   107k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 107k, False: 485]
  |  Branch (583:23): [True: 107k, False: 0]
  ------------------
  584|       |
  585|   107k|  size_t b0 = buf[0] & (0xff >> size);
  586|   107k|  size_t tag = b0 << ((size - 1) * 8);
  587|   163k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 55.7k, False: 107k]
  ------------------
  588|  55.7k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  55.7k|  }
  590|       |
  591|   107k|  return tag;
  592|   107k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  7.10k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  7.10k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 7.10k, False: 0]
  ------------------
  725|    774|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 774, False: 6.33k]
  ------------------
  726|    774|        return Exiv2::find(videoScanType, key);
  727|    629|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 629, False: 6.47k]
  ------------------
  728|    629|        return Exiv2::find(audioChannels, key);
  729|    308|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 308, False: 6.79k]
  ------------------
  730|    308|        return Exiv2::find(compressionAlgorithm, key);
  731|    493|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 493, False: 6.61k]
  ------------------
  732|    493|        return Exiv2::find(encryptionAlgorithm, key);
  733|     98|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 98, False: 7.00k]
  ------------------
  734|    523|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 425, False: 6.68k]
  ------------------
  735|    523|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|     29|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 29, False: 7.07k]
  ------------------
  737|  1.68k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 1.65k, False: 5.45k]
  ------------------
  738|  1.68k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    339|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 339, False: 6.76k]
  ------------------
  740|    339|        return Exiv2::find(encodingType, key);
  741|    747|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 747, False: 6.36k]
  ------------------
  742|    747|        return Exiv2::find(displayUnit, key);
  743|    174|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 174, False: 6.93k]
  ------------------
  744|    174|        return Exiv2::find(aspectRatioType, key);
  745|    699|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 699, False: 6.40k]
  ------------------
  746|    699|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    509|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 509, False: 6.59k]
  ------------------
  748|    509|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 7.10k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    115|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 115, False: 6.99k]
  ------------------
  752|    115|        return Exiv2::find(codecInfo, key);
  753|     10|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 10, False: 7.09k]
  ------------------
  754|    112|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 102, False: 7.00k]
  ------------------
  755|    112|        return Exiv2::find(codecDownloadUrl, key);
  756|  7.10k|    }
  757|      0|    return nullptr;
  758|  7.10k|  }();

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

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

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

_ZN5Exiv28Internal15Nikon1MakerNote7tagListEv:
   38|    690|  static constexpr auto tagList() {
   39|    690|    return tagInfo_;
   40|    690|  }
_ZN5Exiv28Internal15Nikon2MakerNote7tagListEv:
   71|    281|  static constexpr auto tagList() {
   72|    281|    return tagInfo_;
   73|    281|  }
_ZN5Exiv28Internal15Nikon3MakerNote7tagListEv:
   91|  11.9k|  static constexpr auto tagList() {
   92|  11.9k|    return tagInfo_;
   93|  11.9k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListVrEv:
   95|  1.80k|  static constexpr auto tagListVr() {
   96|  1.80k|    return tagInfoVr_;
   97|  1.80k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListPcEv:
   99|  1.01k|  static constexpr auto tagListPc() {
  100|  1.01k|    return tagInfoPc_;
  101|  1.01k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListWtEv:
  103|  1.15k|  static constexpr auto tagListWt() {
  104|  1.15k|    return tagInfoWt_;
  105|  1.15k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListIiEv:
  107|  2.44k|  static constexpr auto tagListIi() {
  108|  2.44k|    return tagInfoIi_;
  109|  2.44k|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListAfEv:
  111|  2.10k|  static constexpr auto tagListAf() {
  112|  2.10k|    return tagInfoAf_;
  113|  2.10k|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf21Ev:
  115|    734|  static constexpr auto tagListAf21() {
  116|    734|    return tagInfoAf21_;
  117|    734|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListAf22Ev:
  119|    355|  static constexpr auto tagListAf22() {
  120|    355|    return tagInfoAf22_;
  121|    355|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListAFTEv:
  123|    501|  static constexpr auto tagListAFT() {
  124|    501|    return tagInfoAFT_;
  125|    501|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListFiEv:
  127|    109|  static constexpr auto tagListFi() {
  128|    109|    return tagInfoFi_;
  129|    109|  }
_ZN5Exiv28Internal15Nikon3MakerNote9tagListMeEv:
  131|     80|  static constexpr auto tagListMe() {
  132|     80|    return tagInfoMe_;
  133|     80|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl1Ev:
  135|     22|  static constexpr auto tagListFl1() {
  136|     22|    return tagInfoFl1_;
  137|     22|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl2Ev:
  139|     45|  static constexpr auto tagListFl2() {
  140|     45|    return tagInfoFl2_;
  141|     45|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl3Ev:
  143|     47|  static constexpr auto tagListFl3() {
  144|     47|    return tagInfoFl3_;
  145|     47|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl6Ev:
  147|     89|  static constexpr auto tagListFl6() {
  148|     89|    return tagInfoFl6_;
  149|     89|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListFl7Ev:
  151|     87|  static constexpr auto tagListFl7() {
  152|     87|    return tagInfoFl7_;
  153|     87|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi1Ev:
  155|     64|  static constexpr auto tagListSi1() {
  156|     64|    return tagInfoSi1_;
  157|     64|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi2Ev:
  159|     41|  static constexpr auto tagListSi2() {
  160|     41|    return tagInfoSi2_;
  161|     41|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListSi5Ev:
  171|    624|  static constexpr auto tagListSi5() {
  172|    624|    return tagInfoSi5_;
  173|    624|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb1Ev:
  175|      6|  static constexpr auto tagListCb1() {
  176|      6|    return tagInfoCb1_;
  177|      6|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb2Ev:
  179|     17|  static constexpr auto tagListCb2() {
  180|     17|    return tagInfoCb2_;
  181|     17|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2aEv:
  183|     18|  static constexpr auto tagListCb2a() {
  184|     18|    return tagInfoCb2a_;
  185|     18|  }
_ZN5Exiv28Internal15Nikon3MakerNote11tagListCb2bEv:
  187|    134|  static constexpr auto tagListCb2b() {
  188|    134|    return tagInfoCb2b_;
  189|    134|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb3Ev:
  191|     26|  static constexpr auto tagListCb3() {
  192|     26|    return tagInfoCb3_;
  193|     26|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListCb4Ev:
  195|     62|  static constexpr auto tagListCb4() {
  196|     62|    return tagInfoCb4_;
  197|     62|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd1Ev:
  199|    298|  static constexpr auto tagListLd1() {
  200|    298|    return tagInfoLd1_;
  201|    298|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd2Ev:
  203|  7.01k|  static constexpr auto tagListLd2() {
  204|  7.01k|    return tagInfoLd2_;
  205|  7.01k|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd3Ev:
  207|    289|  static constexpr auto tagListLd3() {
  208|    289|    return tagInfoLd3_;
  209|    289|  }
_ZN5Exiv28Internal15Nikon3MakerNote10tagListLd4Ev:
  211|    298|  static constexpr auto tagListLd4() {
  212|    298|    return tagInfoLd4_;
  213|    298|  }

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|  87.7k|  static constexpr auto tagList() {
   34|  87.7k|    return tagInfo_;
   35|  87.7k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  38.6k|  static constexpr auto tagListCs() {
   38|  38.6k|    return tagInfoCs_;
   39|  38.6k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|  1.16k|  static constexpr auto tagListEq() {
   42|  1.16k|    return tagInfoEq_;
   43|  1.16k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|    360|  static constexpr auto tagListRd() {
   46|    360|    return tagInfoRd_;
   47|    360|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    112|  static constexpr auto tagListRd2() {
   50|    112|    return tagInfoRd2_;
   51|    112|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    750|  static constexpr auto tagListIp() {
   54|    750|    return tagInfoIp_;
   55|    750|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    480|  static constexpr auto tagListFi() {
   58|    480|    return tagInfoFi_;
   59|    480|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|  1.42k|  static constexpr auto tagListFe() {
   62|  1.42k|    return tagInfoFe_;
   63|  1.42k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    447|  static constexpr auto tagListRi() {
   66|    447|    return tagInfoRi_;
   67|    447|  }

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

_ZN5Exiv28Internal9OrfHeaderC2ENS_9ByteOrderE:
    6|  23.4k|OrfHeader::OrfHeader(ByteOrder byteOrder) : TiffHeaderBase(0x4f52, 8, byteOrder, 0x00000008) {
    7|  23.4k|}
_ZN5Exiv28Internal9OrfHeader4readEPKhm:
    9|  23.4k|bool OrfHeader::read(const byte* pData, size_t size) {
   10|  23.4k|  if (size < 8)
  ------------------
  |  Branch (10:7): [True: 0, False: 23.4k]
  ------------------
   11|      0|    return false;
   12|       |
   13|  23.4k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (13:7): [True: 190, False: 23.2k]
  |  Branch (13:26): [True: 100, False: 90]
  ------------------
   14|    100|    setByteOrder(littleEndian);
   15|  23.3k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (15:14): [True: 997, False: 22.3k]
  |  Branch (15:33): [True: 905, False: 92]
  ------------------
   16|    905|    setByteOrder(bigEndian);
   17|  22.4k|  } else {
   18|  22.4k|    return false;
   19|  22.4k|  }
   20|       |
   21|  1.00k|  uint16_t sig = getUShort(pData + 2, byteOrder());
   22|  1.00k|  if (tag() != sig && 0x5352 != sig)
  ------------------
  |  Branch (22:7): [True: 928, False: 77]
  |  Branch (22:23): [True: 174, False: 754]
  ------------------
   23|    174|    return false;  // #658: Added 0x5352 "SR" for SP-560UZ
   24|    831|  sig_ = sig;
   25|    831|  setOffset(getULong(pData + 4, byteOrder()));
   26|    831|  return true;
   27|  1.00k|}
_ZNK5Exiv28Internal9OrfHeader5writeEv:
   29|     32|DataBuf OrfHeader::write() const {
   30|     32|  DataBuf buf(8);
   31|     32|  switch (byteOrder()) {
   32|      3|    case littleEndian:
  ------------------
  |  Branch (32:5): [True: 3, False: 29]
  ------------------
   33|      3|      buf.write_uint8(0, 'I');
   34|      3|      break;
   35|     29|    case bigEndian:
  ------------------
  |  Branch (35:5): [True: 29, False: 3]
  ------------------
   36|     29|      buf.write_uint8(0, 'M');
   37|     29|      break;
   38|      0|    default:
  ------------------
  |  Branch (38:5): [True: 0, False: 32]
  ------------------
   39|      0|      break;
   40|     32|  }
   41|     32|  buf.write_uint8(1, buf.read_uint8(0));
   42|       |
   43|     32|  buf.write_uint16(2, sig_, byteOrder());
   44|     32|  buf.write_uint32(4, 0x00000008, byteOrder());
   45|     32|  return buf;
   46|     32|}

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

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

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

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

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

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  1.52k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  1.52k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 376, False: 1.14k]
  |  Branch (57:26): [True: 376, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    376|    IoCloser closer(*io_);
   62|    376|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 376]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    376|  }
   68|  1.52k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  1.14k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  1.14k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 1.14k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  1.14k|  IoCloser closer(*io_);
  400|  1.14k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 1.14k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  1.14k|  clearMetadata();
  404|       |
  405|  1.14k|  const size_t imgSize = io_->size();
  406|  1.14k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|  1.14k|  const DecodeParams dp(max_recursion_depth_);
  408|       |
  409|  22.2k|  while (!io_->eof()) {
  ------------------
  |  Branch (409:10): [True: 21.6k, False: 536]
  ------------------
  410|  21.6k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  411|       |
  412|       |    // Decode chunk data length.
  413|  21.6k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  414|  21.6k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (414:9): [True: 297, False: 21.3k]
  ------------------
  415|    297|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  416|    297|    }
  417|       |
  418|  21.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|  21.3k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (425:9): [True: 250, False: 21.1k]
  |  Branch (425:32): [True: 2.76k, False: 18.3k]
  |  Branch (425:55): [True: 3.95k, False: 14.4k]
  |  Branch (425:78): [True: 373, False: 14.0k]
  ------------------
  426|  14.0k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (426:9): [True: 46, False: 14.0k]
  |  Branch (426:32): [True: 4.09k, False: 9.91k]
  |  Branch (426:55): [True: 455, False: 9.46k]
  ------------------
  427|  11.8k|      DataBuf chunkData(chunkLength);
  428|  11.8k|      if (chunkLength > 0) {
  ------------------
  |  Branch (428:11): [True: 9.15k, False: 2.70k]
  ------------------
  429|  9.15k|        readChunk(chunkData, *io_);  // Extract chunk data.
  430|  9.15k|      }
  431|       |
  432|  11.8k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (432:11): [True: 173, False: 11.6k]
  ------------------
  433|    173|        return;  // Last chunk found: we stop parsing.
  434|    173|      }
  435|  11.6k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (435:11): [True: 2.76k, False: 8.92k]
  |  Branch (435:34): [True: 186, False: 2.57k]
  ------------------
  436|    186|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  437|  11.5k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (437:18): [True: 3.95k, False: 7.54k]
  ------------------
  438|  3.95k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk, dp);
  439|  7.54k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (439:18): [True: 373, False: 7.16k]
  ------------------
  440|    373|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk, dp);
  441|  7.16k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (441:18): [True: 4.09k, False: 3.07k]
  ------------------
  442|  4.09k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk, dp);
  443|  4.09k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (443:18): [True: 46, False: 3.02k]
  ------------------
  444|     46|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size(), dp);
  445|     46|        setByteOrder(bo);
  446|  3.02k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (446:18): [True: 455, False: 2.57k]
  ------------------
  447|       |        // The ICC profile name can vary from 1-79 characters.
  448|    455|        uint32_t iccOffset = 0;
  449|  4.60k|        do {
  450|  4.60k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (450:19): [True: 4.59k, False: 10]
  |  Branch (450:37): [True: 4.57k, False: 18]
  ------------------
  451|  4.60k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (451:18): [True: 4.14k, False: 455]
  ------------------
  452|       |
  453|    455|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  454|    455|        ++iccOffset;  // +1 = 'compressed' flag
  455|    455|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  456|       |
  457|    455|        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|    455|      }
  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|  11.6k|      chunkLength = 0;
  467|  11.6k|    }
  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|  21.2k|    io_->seek(chunkLength + 4, BasicIo::cur);
  474|  21.2k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (474:9): [True: 536, False: 20.6k]
  |  Branch (474:25): [True: 143, False: 20.5k]
  ------------------
  475|    143|      throw Error(ErrorCode::kerFailedToReadImageData);
  476|    143|    }
  477|  21.2k|  }
  478|  1.14k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  480|    536|void PngImage::writeMetadata() {
  481|    536|  if (io_->open() != 0) {
  ------------------
  |  Branch (481:7): [True: 0, False: 536]
  ------------------
  482|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  483|      0|  }
  484|    536|  IoCloser closer(*io_);
  485|    536|  MemIo tempIo;
  486|       |
  487|    536|  doWriteMetadata(tempIo);  // may throw
  488|    536|  io_->close();
  489|    536|  io_->transfer(tempIo);  // may throw
  490|       |
  491|    536|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  493|    536|void PngImage::doWriteMetadata(BasicIo& outIo) {
  494|    536|  if (!io_->isopen())
  ------------------
  |  Branch (494:7): [True: 0, False: 536]
  ------------------
  495|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  496|    536|  if (!outIo.isopen())
  ------------------
  |  Branch (496:7): [True: 0, False: 536]
  ------------------
  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|    536|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (504:7): [True: 0, False: 536]
  ------------------
  505|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  506|      0|  }
  507|       |
  508|       |  // Write PNG Signature.
  509|    536|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (509:7): [True: 0, False: 536]
  ------------------
  510|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  511|       |
  512|    536|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  513|       |
  514|  5.54k|  while (!io_->eof()) {
  ------------------
  |  Branch (514:10): [True: 5.54k, False: 3]
  ------------------
  515|       |    // Read chunk header.
  516|  5.54k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  517|  5.54k|    if (io_->error())
  ------------------
  |  Branch (517:9): [True: 0, False: 5.54k]
  ------------------
  518|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  519|  5.54k|    if (bufRead != 8)
  ------------------
  |  Branch (519:9): [True: 0, False: 5.54k]
  ------------------
  520|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  521|       |
  522|       |    // Decode chunk data length.
  523|       |
  524|  5.54k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  525|  5.54k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (525:9): [True: 0, False: 5.54k]
  ------------------
  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|  5.54k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  531|  5.54k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  532|  5.54k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  533|  5.54k|    if (io_->error())
  ------------------
  |  Branch (533:9): [True: 0, False: 5.54k]
  ------------------
  534|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  535|  5.54k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (535:9): [True: 77, False: 5.46k]
  ------------------
  536|     77|      throw Error(ErrorCode::kerInputDataReadFailed);
  537|       |
  538|  5.46k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  539|       |
  540|  5.46k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (540:9): [True: 456, False: 5.01k]
  ------------------
  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|    456|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (545:11): [True: 0, False: 456]
  ------------------
  546|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  547|    456|      return;
  548|    456|    }
  549|  5.01k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (549:9): [True: 16, False: 4.99k]
  |  Branch (549:30): [True: 32, False: 4.96k]
  ------------------
  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|  4.96k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (556:16): [True: 1.11k, False: 3.85k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  559|       |#endif
  560|  1.11k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (560:11): [True: 0, False: 1.11k]
  ------------------
  561|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  562|       |
  563|       |      // Write all updated metadata here, just after IHDR.
  564|  1.11k|      if (!comment_.empty()) {
  ------------------
  |  Branch (564:11): [True: 321, False: 791]
  ------------------
  565|       |        // Update Comment data to a new PNG chunk
  566|    321|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  567|    321|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (567:13): [True: 0, False: 321]
  ------------------
  568|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  569|      0|        }
  570|    321|      }
  571|       |
  572|  1.11k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (572:11): [True: 242, False: 870]
  ------------------
  573|       |        // Update Exif data to a new PNG chunk
  574|    242|        Blob blob;
  575|    242|        ExifParser::encode(blob, littleEndian, exifData_);
  576|    242|        if (!blob.empty()) {
  ------------------
  |  Branch (576:13): [True: 224, False: 18]
  ------------------
  577|    224|          byte length[4];
  578|    224|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  579|       |
  580|       |          // calculate CRC
  581|    224|          uLong tmp = crc32(0L, Z_NULL, 0);
  582|    224|          tmp = crc32(tmp, typeExif, 4);
  583|    224|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  584|    224|          byte crc[4];
  585|    224|          ul2Data(crc, tmp, bigEndian);
  586|       |
  587|    224|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (587:15): [True: 0, False: 224]
  |  Branch (587:46): [True: 0, False: 224]
  ------------------
  588|    224|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (588:15): [True: 0, False: 224]
  |  Branch (588:71): [True: 0, False: 224]
  ------------------
  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|    224|        }
  596|    242|      }
  597|       |
  598|  1.11k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (598:11): [True: 68, False: 1.04k]
  ------------------
  599|       |        // Update IPTC data to a new PNG chunk
  600|     68|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  601|     68|        if (!newPsData.empty()) {
  ------------------
  |  Branch (601:13): [True: 68, False: 0]
  ------------------
  602|     68|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  603|     68|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  604|     68|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (604:15): [True: 0, False: 68]
  ------------------
  605|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  606|      0|          }
  607|     68|        }
  608|     68|      }
  609|       |
  610|  1.11k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (610:11): [True: 38, False: 1.07k]
  ------------------
  611|     38|        DataBuf compressed;
  612|     38|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  613|     38|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (613:13): [True: 38, False: 0]
  ------------------
  614|     38|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  615|     38|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  616|     38|          byte length[4];
  617|     38|          ul2Data(length, chunkLength, bigEndian);
  618|       |
  619|       |          // calculate CRC
  620|     38|          uLong tmp = crc32(0L, Z_NULL, 0);
  621|     38|          tmp = crc32(tmp, typeICCP, 4);
  622|     38|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  623|     38|          tmp = crc32(tmp, nullComp, 2);
  624|     38|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  625|     38|          byte crc[4];
  626|     38|          ul2Data(crc, tmp, bigEndian);
  627|       |
  628|     38|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (628:15): [True: 0, False: 38]
  |  Branch (628:46): [True: 0, False: 38]
  ------------------
  629|     38|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (629:15): [True: 0, False: 38]
  ------------------
  630|     38|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (630:15): [True: 0, False: 38]
  ------------------
  631|     38|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (631:15): [True: 0, False: 38]
  |  Branch (631:91): [True: 0, False: 38]
  ------------------
  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|     38|        }
  639|     38|      }
  640|       |
  641|  1.11k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (641:11): [True: 1.10k, False: 3]
  |  Branch (641:36): [True: 34, False: 1.07k]
  ------------------
  642|     34|#ifndef SUPPRESS_WARNINGS
  643|     34|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     34|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 34]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     34|  LogMsg(LogMsg::error).os()
  ------------------
  644|     34|#endif
  645|     34|      }
  646|  1.11k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (646:11): [True: 501, False: 611]
  ------------------
  647|       |        // Update XMP data to a new PNG chunk
  648|    501|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  649|    501|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (649:13): [True: 0, False: 501]
  ------------------
  650|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  651|      0|        }
  652|    501|      }
  653|  3.85k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (653:16): [True: 995, False: 2.85k]
  |  Branch (653:37): [True: 10, False: 2.84k]
  |  Branch (653:58): [True: 226, False: 2.62k]
  ------------------
  654|  1.23k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  655|  1.23k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (655:11): [True: 1.17k, False: 61]
  |  Branch (655:28): [True: 36, False: 1.13k]
  |  Branch (655:69): [True: 26, False: 1.10k]
  ------------------
  656|  1.10k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (656:28): [True: 225, False: 883]
  |  Branch (656:69): [True: 6, False: 877]
  ------------------
  657|    877|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (657:28): [True: 157, False: 720]
  |  Branch (657:65): [True: 127, False: 593]
  ------------------
  658|       |#ifdef EXIV2_DEBUG_MESSAGES
  659|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  660|       |                  << '\n';
  661|       |#endif
  662|    654|      } else {
  663|       |#ifdef EXIV2_DEBUG_MESSAGES
  664|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  665|       |                  << '\n';
  666|       |#endif
  667|    654|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (667:13): [True: 0, False: 654]
  ------------------
  668|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  669|    654|      }
  670|  2.62k|    } 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|  2.62k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (676:11): [True: 0, False: 2.62k]
  ------------------
  677|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  678|  2.62k|    }
  679|  5.01k|  }
  680|       |
  681|    536|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  685|  1.52k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  686|  1.52k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  687|  1.52k|  if (!image->good()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 1.52k]
  ------------------
  688|      0|    return nullptr;
  689|      0|  }
  690|  1.52k|  return image;
  691|  1.52k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  693|  26.0k|bool isPngType(BasicIo& iIo, bool advance) {
  694|  26.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (694:7): [True: 0, False: 26.0k]
  |  Branch (694:22): [True: 214, False: 25.7k]
  ------------------
  695|    214|    throw Error(ErrorCode::kerInputDataReadFailed);
  696|    214|  }
  697|  25.7k|  const int32_t len = 8;
  698|  25.7k|  std::array<byte, len> buf;
  699|  25.7k|  iIo.read(buf.data(), len);
  700|  25.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (700:7): [True: 0, False: 25.7k]
  |  Branch (700:22): [True: 0, False: 25.7k]
  ------------------
  701|      0|    return false;
  702|      0|  }
  703|  25.7k|  bool rc = buf == pngSignature;
  704|  25.7k|  if (!advance || !rc) {
  ------------------
  |  Branch (704:7): [True: 24.1k, False: 1.68k]
  |  Branch (704:19): [True: 0, False: 1.68k]
  ------------------
  705|  24.1k|    iIo.seek(-len, BasicIo::cur);
  706|  24.1k|  }
  707|       |
  708|  25.7k|  return rc;
  709|  25.7k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    408|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    408|  uLongf uncompressedLen = length;  // just a starting point
   76|    408|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|    988|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 580, False: 408]
  ------------------
   79|    580|    result.alloc(uncompressedLen);
   80|    580|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    580|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 22, False: 558]
  |  Branch (82:31): [True: 1, False: 21]
  ------------------
   83|      1|      result.reset();
   84|       |
   85|      1|      result.alloc(uncompressedLen);
   86|      1|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|      1|    }
   88|    580|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 172, False: 408]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    172|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    172|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 172]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    172|      else
   96|    172|        uncompressedLen *= 2;
   97|    172|    }
   98|    580|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    408|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  30.8k|static void readChunk(DataBuf& buffer, BasicIo& io) {
  380|       |#ifdef EXIV2_DEBUG_MESSAGES
  381|       |  std::cout << "Exiv2::PngImage::readMetadata: Position: " << io.tell() << '\n';
  382|       |#endif
  383|  30.8k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  30.8k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 30.8k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  30.8k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 77, False: 30.7k]
  ------------------
  388|     77|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|     77|  }
  390|  30.8k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|     38|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|     38|  uLongf compressedLen = length;  // just a starting point
  105|     38|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|    166|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 128, False: 38]
  ------------------
  108|    128|    result.alloc(compressedLen);
  109|    128|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    128|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 90, False: 38]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|     90|      result.reset();
  113|     90|      compressedLen *= 2;
  114|     90|    } else {
  115|     38|      result.reset();
  116|     38|      result.alloc(compressedLen);
  117|     38|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|     38|    }
  119|    128|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|     38|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  5.89k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  5.89k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  5.89k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  5.89k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|  1.66k|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|  1.66k|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|  1.66k|const byte* PreviewImage::pData() const {
 1018|  1.66k|  return preview_.c_data();
 1019|  1.66k|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|  1.66k|uint32_t PreviewImage::size() const {
 1022|  1.66k|  return static_cast<uint32_t>(preview_.size());
 1023|  1.66k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  7.66k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  7.66k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  7.66k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  7.66k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   265k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 258k, False: 7.66k]
  ------------------
 1052|   258k|    auto loader = Loader::create(id, image_);
 1053|   258k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 16.3k, False: 241k]
  |  Branch (1053:19): [True: 9.05k, False: 7.30k]
  ------------------
 1054|  9.05k|      PreviewProperties props = loader->getProperties();
 1055|  9.05k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  9.05k|      props.size_ = buf.size();         //     update the size
 1057|  9.05k|      list.push_back(std::move(props));
 1058|  9.05k|    }
 1059|   258k|  }
 1060|  7.66k|  std::sort(list.begin(), list.end(),
 1061|  7.66k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  7.66k|  return list;
 1064|  7.66k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|  1.66k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|  1.66k|  auto loader = Loader::create(properties.id_, image_);
 1068|  1.66k|  DataBuf buf;
 1069|  1.66k|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 1.66k, False: 0]
  ------------------
 1070|  1.66k|    buf = loader->getData();
 1071|  1.66k|  }
 1072|       |
 1073|  1.66k|  return {properties, std::move(buf)};
 1074|  1.66k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|   525k|PreviewId Loader::getNumLoaders() {
  351|   525k|  return PreviewId{std::size(loaderList_)};
  352|   525k|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  30.6k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  30.6k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  30.6k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  30.6k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  30.6k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 30.6k]
  |  Branch (355:21): [True: 30.6k, False: 0]
  ------------------
  356|  30.6k|    return;
  357|      0|  nativePreview_ = image.nativePreviews()[parIdx];
  358|      0|  width_ = nativePreview_.width_;
  359|      0|  height_ = nativePreview_.height_;
  360|      0|  valid_ = true;
  361|      0|  if (nativePreview_.filter_.empty()) {
  ------------------
  |  Branch (361:7): [True: 0, False: 0]
  ------------------
  362|      0|    size_ = nativePreview_.size_;
  363|      0|  } else {
  364|      0|    size_ = getData().size();
  365|      0|  }
  366|      0|}
preview.cpp:_ZN12_GLOBAL__N_16LoaderC2EiRKN5Exiv25ImageE:
  343|   244k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   244k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  9.05k|PreviewProperties Loader::getProperties() const {
  347|  9.05k|  return {"", "", size_, width_, height_, id_};
  348|  9.05k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  1.81k|  virtual bool readDimensions() {
   78|  1.81k|    return true;
   79|  1.81k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   244k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   268k|  [[nodiscard]] virtual bool valid() const {
   67|   268k|    return valid_;
   68|   268k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|  92.0k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|  92.0k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|  92.0k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|  92.0k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|  92.0k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 282, False: 91.7k]
  ------------------
  557|    282|    size_ = pos->sizeDataArea();  // indirect data
  558|    282|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 282, False: 0]
  |  Branch (558:23): [True: 200, False: 82]
  ------------------
  559|    200|      size_ = pos->size();  // direct data
  560|    282|  }
  561|       |
  562|  92.0k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 91.8k, False: 200]
  ------------------
  563|  91.8k|    return;
  564|       |
  565|    200|  valid_ = true;
  566|    200|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|     69|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|     69|  PreviewProperties prop = Loader::getProperties();
  574|     69|  prop.mimeType_ = "image/jpeg";
  575|     69|  prop.extension_ = ".jpg";
  576|     69|  return prop;
  577|     69|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|    269|DataBuf LoaderExifDataJpeg::getData() const {
  580|    269|  DataBuf buf;
  581|       |
  582|    269|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 269]
  ------------------
  583|      0|    return buf;
  584|       |
  585|    269|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 269, False: 0]
  ------------------
  586|    269|    buf = pos->dataArea();  // indirect data
  587|       |
  588|    269|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 269, False: 0]
  ------------------
  589|    269|      buf = DataBuf(pos->size());
  590|    269|      pos->copy(buf.data(), invalidByteOrder);
  591|    269|    }
  592|       |
  593|    269|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|    269|    return buf;
  595|    269|  }
  596|       |
  597|      0|  return buf;
  598|    269|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  600|    137|bool LoaderExifDataJpeg::readDimensions() {
  601|    137|  if (!valid())
  ------------------
  |  Branch (601:7): [True: 0, False: 137]
  ------------------
  602|      0|    return false;
  603|       |
  604|    137|  DataBuf buf = getData();
  605|    137|  if (buf.empty())
  ------------------
  |  Branch (605:7): [True: 0, False: 137]
  ------------------
  606|      0|    return false;
  607|       |
  608|    137|  try {
  609|    137|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  610|    137|    if (!image)
  ------------------
  |  Branch (610:9): [True: 0, False: 137]
  ------------------
  611|      0|      return false;
  612|    137|    image->readMetadata();
  613|       |
  614|    137|    width_ = image->pixelWidth();
  615|    137|    height_ = image->pixelHeight();
  616|    137|  } catch (const Error& /* error */) {
  617|     68|    return false;
  618|     68|  }
  619|       |
  620|     69|  return true;
  621|    137|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|  53.2k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|  53.2k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|  53.2k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|  53.2k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|  53.2k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|  53.2k|  size_t offsetCount = 0;
  628|  53.2k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|  53.2k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 45.7k, False: 7.55k]
  ------------------
  632|  45.7k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|  45.7k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 42.4k, False: 3.32k]
  ------------------
  634|  42.4k|      return;
  635|  3.32k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 3.32k, False: 0]
  |  Branch (635:9): [True: 709, False: 2.61k]
  |  Branch (635:39): [True: 709, False: 2.61k]
  ------------------
  636|    709|      return;
  637|  3.32k|  }
  638|       |
  639|  10.1k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  10.1k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 2.26k, False: 7.90k]
  ------------------
  641|  2.26k|    offsetTag_ = "StripOffsets";
  642|  2.26k|    sizeTag_ = "StripByteCounts";
  643|  2.26k|    offsetCount = pos->value().count();
  644|  7.90k|  } else {
  645|  7.90k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  7.90k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 7.65k, False: 250]
  ------------------
  647|  7.65k|      return;
  648|    250|    offsetTag_ = "TileOffsets";
  649|    250|    sizeTag_ = "TileByteCounts";
  650|    250|    offsetCount = pos->value().count();
  651|    250|  }
  652|       |
  653|  2.51k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  2.51k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 110, False: 2.40k]
  ------------------
  655|    110|    return;
  656|  2.40k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 58, False: 2.34k]
  ------------------
  657|     58|    return;
  658|  16.6k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 14.3k, False: 2.34k]
  ------------------
  659|  14.3k|    size_ += pos->toUint32(i);
  660|  14.3k|  }
  661|       |
  662|  2.34k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 58, False: 2.28k]
  ------------------
  663|     58|    return;
  664|       |
  665|  2.28k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  2.28k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 2.20k, False: 85]
  |  Branch (666:7): [True: 2.06k, False: 221]
  |  Branch (666:32): [True: 2.06k, False: 136]
  ------------------
  667|  2.06k|    width_ = pos->toUint32();
  668|  2.06k|  }
  669|       |
  670|  2.28k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  2.28k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 2.14k, False: 145]
  |  Branch (671:7): [True: 2.07k, False: 219]
  |  Branch (671:32): [True: 2.07k, False: 74]
  ------------------
  672|  2.07k|    height_ = pos->toUint32();
  673|  2.07k|  }
  674|       |
  675|  2.28k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 258, False: 2.03k]
  |  Branch (675:22): [True: 103, False: 1.92k]
  ------------------
  676|    315|    return;
  677|       |
  678|  1.97k|  valid_ = true;
  679|  1.97k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  1.81k|PreviewProperties LoaderTiff::getProperties() const {
  686|  1.81k|  PreviewProperties prop = Loader::getProperties();
  687|  1.81k|  prop.mimeType_ = "image/tiff";
  688|  1.81k|  prop.extension_ = ".tif";
  689|  1.81k|  return prop;
  690|  1.81k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  1.92k|DataBuf LoaderTiff::getData() const {
  693|  1.92k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  1.92k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   323k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 323k, False: 1.92k]
  ------------------
  699|   323k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 76.7k, False: 246k]
  ------------------
  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|  76.7k|      uint16_t tag = pos.tag();
  708|  76.7k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 74.5k, False: 2.21k]
  |  Branch (708:28): [True: 74.0k, False: 533]
  |  Branch (708:45): [True: 28.9k, False: 45.1k]
  ------------------
  709|  28.9k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|  28.9k|      }
  711|  76.7k|    }
  712|   323k|  }
  713|       |
  714|  1.92k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  1.92k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 1.92k, False: 0]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  1.92k|    BasicIo& io = image_.io();
  719|       |
  720|  1.92k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 1.92k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  1.92k|    IoCloser closer(io);
  724|       |
  725|  1.92k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  1.92k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  1.92k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 1.92k, False: 0]
  ------------------
  730|  1.92k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 1.69k, False: 230]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  1.69k|        uint32_t offset = dataValue.toUint32(0);
  733|  1.69k|        uint32_t size = sizes.toUint32(0);
  734|  1.69k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 302, False: 1.39k]
  ------------------
  735|    302|          dataValue.setDataArea(base + offset, size);
  736|  1.69k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    230|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    230|        DataBuf buf(size_);
  740|    230|        uint32_t idxBuf = 0;
  741|  6.20k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 5.97k, False: 230]
  ------------------
  742|  5.97k|          uint32_t offset = dataValue.toUint32(i);
  743|  5.97k|          uint32_t size = sizes.toUint32(i);
  744|       |
  745|       |          // the size_ parameter is originally computed by summing all values inside sizes
  746|       |          // see the constructor of LoaderTiff
  747|       |          // But e.g in malicious files some of these values could be negative
  748|       |          // That's why we check again for each step here to really make sure we don't overstep
  749|  5.97k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  5.97k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 1.47k, False: 4.50k]
  |  Branch (750:28): [True: 586, False: 887]
  ------------------
  751|    586|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|    586|          }
  753|       |
  754|  5.97k|          idxBuf += size;
  755|  5.97k|        }
  756|    230|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    230|      }
  758|  1.92k|    }
  759|  1.92k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  1.92k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 0, False: 1.92k]
  |  Branch (762:7): [True: 0, False: 1.92k]
  |  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|  1.92k|  MemIo mio;
  768|  1.92k|  IptcData emptyIptc;
  769|  1.92k|  XmpData emptyXmp;
  770|  1.92k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  1.92k|  return {mio.mmap(), mio.size()};
  772|  1.92k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|  61.4k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|  61.4k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|  61.4k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|  61.4k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|  61.4k|  const ExifData& exifData = image_.exifData();
  469|  61.4k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|  61.4k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 17.3k, False: 44.0k]
  |  Branch (470:7): [True: 16.7k, False: 44.7k]
  |  Branch (470:32): [True: 16.7k, False: 630]
  ------------------
  471|  16.7k|    offset_ = pos->toUint32();
  472|  16.7k|  }
  473|       |
  474|  61.4k|  size_ = 0;
  475|  61.4k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|  61.4k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 17.3k, False: 44.1k]
  |  Branch (476:7): [True: 16.3k, False: 45.0k]
  |  Branch (476:32): [True: 16.3k, False: 972]
  ------------------
  477|  16.3k|    size_ = pos->toUint32();
  478|  16.3k|  }
  479|       |
  480|  61.4k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 44.9k, False: 16.5k]
  |  Branch (480:23): [True: 487, False: 16.0k]
  ------------------
  481|  45.3k|    return;
  482|       |
  483|  16.1k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 0, False: 16.1k]
  ------------------
  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|  16.1k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 153, False: 15.9k]
  ------------------
  491|    153|    return;
  492|       |
  493|  15.9k|  valid_ = true;
  494|  15.9k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  7.16k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  7.16k|  PreviewProperties prop = Loader::getProperties();
  502|  7.16k|  prop.mimeType_ = "image/jpeg";
  503|  7.16k|  prop.extension_ = ".jpg";
  504|  7.16k|  return prop;
  505|  7.16k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  8.66k|DataBuf LoaderExifJpeg::getData() const {
  508|  8.66k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 8.66k]
  ------------------
  509|      0|    return {};
  510|  8.66k|  BasicIo& io = image_.io();
  511|       |
  512|  8.66k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 8.66k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  8.66k|  IoCloser closer(io);
  516|       |
  517|  8.66k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  8.66k|  return {base + offset_, size_};
  520|  8.66k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  14.4k|bool LoaderExifJpeg::readDimensions() {
  523|  14.4k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 14.4k]
  ------------------
  524|      0|    return false;
  525|  14.4k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 14.4k]
  |  Branch (525:17): [True: 0, False: 14.4k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  14.4k|  BasicIo& io = image_.io();
  529|       |
  530|  14.4k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 14.4k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  14.4k|  IoCloser closer(io);
  534|  14.4k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  14.4k|  try {
  537|  14.4k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  14.4k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 14.4k]
  ------------------
  539|      0|      return false;
  540|  14.4k|    image->readMetadata();
  541|       |
  542|  14.4k|    width_ = image->pixelWidth();
  543|  14.4k|    height_ = image->pixelHeight();
  544|  14.4k|  } catch (const Error& /* error */) {
  545|  7.22k|#ifndef SUPPRESS_WARNINGS
  546|  7.22k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  7.22k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.22k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.22k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  7.22k|#endif
  548|  7.22k|    return false;
  549|  7.22k|  }
  550|       |
  551|  7.16k|  return true;
  552|  14.4k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  7.47k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  7.47k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  7.47k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  7.47k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  7.47k|  (void)parIdx;
  776|       |
  777|  7.47k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  7.47k|  std::string prefix = "xmpGImg";
  780|  7.47k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 0, False: 7.47k]
  ------------------
  781|      0|    prefix = "xapGImg";
  782|      0|  }
  783|       |
  784|  7.47k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  7.47k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 7.47k, False: 0]
  ------------------
  786|  7.47k|    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|   259k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   259k|  Loader::UniquePtr loader;
  330|   259k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 259k]
  |  Branch (330:17): [True: 0, False: 259k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   259k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 22.7k, False: 237k]
  |  Branch (333:7): [True: 15.0k, False: 244k]
  |  Branch (333:41): [True: 15.0k, False: 7.73k]
  ------------------
  334|  15.0k|    return loader;
  335|       |
  336|   244k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   244k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 226k, False: 18.1k]
  ------------------
  338|   226k|    loader = nullptr;
  339|       |
  340|   244k|  return loader;
  341|   259k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  6.64k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  1.72M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  1.72M|  return ns_ == ns.ns_;
 4941|  1.72M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|  70.3M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|  70.3M|  return prefix_ == prefix.prefix_;
 4945|  70.3M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  1.88M|std::mutex& XmpProperties::getMutex() {
 4953|  1.88M|  static std::mutex m;
 4954|  1.88M|  return m;
 4955|  1.88M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.02M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  46.2M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 46.2M, False: 1.99M]
  ------------------
 4965|  46.2M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 29.0k, False: 46.2M]
  ------------------
 4966|  29.0k|      return &p;
 4967|  46.2M|  }
 4968|  1.99M|  return nullptr;
 4969|  2.02M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     30|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     30|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 30]
  ------------------
 4978|      0|    return;
 4979|     30|  std::string ns2 = ns;
 4980|     30|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 9, False: 21]
  |  Branch (4980:28): [True: 9, False: 0]
  ------------------
 4981|      9|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     30|  auto it = nsRegistry_.find(ns2);
 4985|     30|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 30]
  |  Branch (4985:7): [True: 0, False: 30]
  |  Branch (4985:34): [True: 0, False: 0]
  ------------------
 4986|      0|    return;  // Already registered with this prefix
 4987|      0|  }
 4988|       |
 4989|       |  // 2. Check if this prefix is already registered with a DIFFERENT URI
 4990|     30|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 30]
  ------------------
 4991|      0|#ifndef SUPPRESS_WARNINGS
 4992|      0|    if (ns2 != xnp->ns_)
  ------------------
  |  Branch (4992:9): [True: 0, False: 0]
  ------------------
 4993|      0|      EXV_WARNING << "Updating namespace URI for " << prefix << " from " << xnp->ns_ << " to " << ns2 << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 4994|      0|#endif
 4995|      0|    unregisterNsUnlocked(xnp->ns_, lock);
 4996|      0|  }
 4997|       |
 4998|       |  // 3. Ensure the URI is unregistered if it's currently used with a different prefix
 4999|       |  // (This handles the case where prefix changed for the same URI, preventing memory leak)
 5000|     30|  unregisterNsUnlocked(ns2, lock);
 5001|       |  // Allocated memory is freed when the namespace is unregistered.
 5002|       |  // Using malloc/free for better system compatibility in case
 5003|       |  // users don't unregister their namespaces explicitly.
 5004|     30|  XmpNsInfo xn;
 5005|     30|  auto c = new char[ns2.size() + 1];
 5006|     30|  std::strcpy(c, ns2.c_str());
 5007|     30|  xn.ns_ = c;
 5008|     30|  c = new char[prefix.size() + 1];
 5009|     30|  std::strcpy(c, prefix.c_str());
 5010|     30|  xn.prefix_ = c;
 5011|     30|  xn.xmpPropertyInfo_ = nullptr;
 5012|     30|  xn.desc_ = "";
 5013|     30|  nsRegistry_[ns2] = xn;
 5014|     30|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     30|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     30|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     30|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     60|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     60|  auto i = nsRegistry_.find(ns);
 5027|     60|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 30, False: 30]
  ------------------
 5028|     30|    delete[] i->second.prefix_;
 5029|     30|    delete[] i->second.ns_;
 5030|     30|    nsRegistry_.erase(i);
 5031|     30|  }
 5032|     60|}
_ZN5Exiv213XmpProperties21unregisterAllNsNoLockENS0_11LifetimeKeyE:
 5042|      1|void XmpProperties::unregisterAllNsNoLock(LifetimeKey) {
 5043|       |  /// \todo check if we are not unregistering the first NS
 5044|      1|  auto i = nsRegistry_.begin();
 5045|     31|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 30, False: 1]
  ------------------
 5046|     30|    auto kill = i++;
 5047|     30|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     30|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|  94.6k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|  94.6k|  std::string ns2 = ns;
 5058|  94.6k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 16.8k, False: 77.7k]
  |  Branch (5058:28): [True: 10.5k, False: 6.27k]
  ------------------
 5059|  10.5k|    ns2 += '/';
 5060|       |
 5061|  94.6k|  auto i = nsRegistry_.find(ns2);
 5062|  94.6k|  std::string p;
 5063|  94.6k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 6.39k, False: 88.2k]
  ------------------
 5064|  6.39k|    p = i->second.prefix_;
 5065|  88.2k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 59.4k, False: 28.7k]
  ------------------
 5066|  59.4k|    p = std::string(xn->prefix_);
 5067|  94.6k|  return p;
 5068|  94.6k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.00M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.00M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 26.2k, False: 975k]
  ------------------
 5077|  26.2k|    return xn->ns_;
 5078|   975k|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.00M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  6.11k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  6.11k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  6.11k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 2.78k, False: 3.33k]
  |  Branch (5083:59): [True: 3.30k, False: 30]
  ------------------
 5084|  6.11k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  42.5k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  42.5k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  42.5k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 41.1k, False: 1.42k]
  ------------------
 5114|  42.5k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  42.5k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  42.5k|  std::string prefix = key.groupName();
 5123|  42.5k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  42.5k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 42.5k]
  ------------------
 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|  42.5k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 42.5k, False: 0]
  ------------------
 5138|  5.45M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 5.45M, False: 1.42k]
  ------------------
 5139|  5.45M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 41.1k, False: 5.41M]
  ------------------
 5140|  41.1k|        return pl + j;
 5141|  41.1k|      }
 5142|  5.45M|    }
 5143|  42.5k|  }
 5144|  1.42k|  return nullptr;
 5145|  42.5k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  42.5k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  42.5k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  42.5k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.01M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.01M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.01M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.01M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.01M, False: 0]
  ------------------
 5175|  1.01M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.01M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 46, False: 1.01M]
  ------------------
 5177|     46|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.01M|  return xn;
 5179|  1.01M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|  87.1k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|  87.1k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 87.1k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|  87.1k|  property_ = property;
 5256|  87.1k|  prefix_ = prefix;
 5257|  87.1k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   271k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   271k|  p_->decomposeKey(key);
 5261|   271k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   642k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   642k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   642k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|  87.1k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|  87.1k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  1.32M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   322k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   322k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   322k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   322k|  return UniquePtr(clone_());
 5288|   322k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   322k|XmpKey* XmpKey::clone_() const {
 5291|   322k|  return new XmpKey(*this);
 5292|   322k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  9.69M|std::string XmpKey::key() const {
 5295|  9.69M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  9.69M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|   124k|std::string XmpKey::groupName() const {
 5303|   124k|  return p_->prefix_;
 5304|   124k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|   279k|std::string XmpKey::tagName() const {
 5307|   279k|  return p_->property_;
 5308|   279k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5336|   271k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5337|   271k|  XmpProperties::XmpLock lock;
 5338|   271k|  decomposeKeyUnlocked(key, lock);
 5339|   271k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5341|   914k|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5342|       |  // Get the family name, prefix and property name parts of the key
 5343|   914k|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5343:7): [True: 227, False: 914k]
  ------------------
 5344|    227|    throw Error(ErrorCode::kerInvalidKey, key);
 5345|   914k|  std::string::size_type pos1 = key.find('.');
 5346|   914k|  std::string::size_type pos0 = pos1 + 1;
 5347|   914k|  pos1 = key.find('.', pos0);
 5348|   914k|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5348:7): [True: 0, False: 914k]
  ------------------
 5349|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5350|   914k|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5351|   914k|  if (prefix.empty())
  ------------------
  |  Branch (5351:7): [True: 0, False: 914k]
  ------------------
 5352|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5353|   914k|  std::string property = key.substr(pos1 + 1);
 5354|   914k|  if (property.empty())
  ------------------
  |  Branch (5354:7): [True: 0, False: 914k]
  ------------------
 5355|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5356|       |
 5357|       |  // Validate prefix unlocked (must hold lock)
 5358|   914k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5358:7): [True: 0, False: 914k]
  ------------------
 5359|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5360|       |
 5361|   914k|  property_ = std::move(property);
 5362|   914k|  prefix_ = std::move(prefix);
 5363|   914k|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|   914k|  Impl() = default;                                                                             //!< Default constructor

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  3.35k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  3.35k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  3.35k|std::string QuickTimeVideo::mimeType() const {
  544|  3.35k|  return "video/quicktime";
  545|  3.35k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  547|    232|void QuickTimeVideo::writeMetadata() {
  548|    232|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  3.35k|void QuickTimeVideo::readMetadata() {
  551|  3.35k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 3.35k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  3.35k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 3.35k]
  ------------------
  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|  3.35k|  IoCloser closer(*io_);
  562|  3.35k|  clearMetadata();
  563|  3.35k|  continueTraversing_ = true;
  564|  3.35k|  height_ = width_ = 1;
  565|       |
  566|  3.35k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  3.35k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  46.8k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 43.4k, False: 3.35k]
  ------------------
  570|  43.4k|    decodeBlock(0);
  571|       |
  572|  3.35k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  3.35k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  51.4k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  51.4k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  51.4k|  const long bufMinSize = 4;
  579|  51.4k|  DataBuf buf(bufMinSize + 1);
  580|  51.4k|  uint64_t size = 0;
  581|  51.4k|  buf.data()[4] = '\0';
  582|       |
  583|  51.4k|  io_->read(buf.data(), 4);
  584|  51.4k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 379, False: 51.0k]
  ------------------
  585|    379|    continueTraversing_ = false;
  586|    379|    return;
  587|    379|  }
  588|       |
  589|  51.0k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  51.0k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  51.0k|  size_t hdrsize = 8;
  595|       |
  596|  51.0k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 135, False: 50.8k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    135|    DataBuf data(8);
  599|    135|    hdrsize += 8;
  600|    135|    io_->readOrThrow(data.data(), data.size());
  601|    135|    size = data.read_uint64(0, bigEndian);
  602|  50.8k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 1.94k, False: 48.9k]
  |  Branch (602:27): [True: 1.82k, False: 124]
  ------------------
  603|  1.82k|    size = buf.read_uint32(0, bigEndian);
  604|  1.82k|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|  1.82k|  }
  606|       |
  607|  51.0k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  51.0k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  51.0k|  enforce(size - hdrsize <= std::numeric_limits<size_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  610|       |
  611|       |  // std::cerr<<"Tag=>"<<buf.data()<<"     size=>"<<size-hdrsize << '\n';
  612|  51.0k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  51.0k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 4.89k, False: 46.1k]
  ------------------
  614|  4.89k|    discard(newsize);
  615|  4.89k|    return;
  616|  4.89k|  }
  617|  46.1k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  46.1k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  46.3k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  46.3k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  46.3k|  assert(buf.size() > 4);
  631|       |
  632|  46.3k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 46.3k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  46.3k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 5.98k, False: 40.3k]
  ------------------
  636|  5.98k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  40.3k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 3.83k, False: 36.4k]
  ------------------
  638|  3.83k|    fileTypeDecoder(size);
  639|       |
  640|  36.4k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 4.14k, False: 32.3k]
  ------------------
  641|  4.14k|    setMediaStream(size);
  642|       |
  643|  32.3k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 71, False: 32.2k]
  ------------------
  644|     71|    movieHeaderDecoder(size);
  645|       |
  646|  32.2k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 652, False: 31.6k]
  ------------------
  647|    652|    trackHeaderDecoder(size);
  648|       |
  649|  31.6k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 767, False: 30.8k]
  ------------------
  650|    767|    mediaHeaderDecoder(size);
  651|       |
  652|  30.8k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 4.80k, False: 26.0k]
  ------------------
  653|  4.80k|    handlerDecoder(size);
  654|       |
  655|  26.0k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 2.54k, False: 23.5k]
  ------------------
  656|  2.54k|    videoHeaderDecoder(size);
  657|       |
  658|  23.5k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 7.01k, False: 16.4k]
  ------------------
  659|  7.01k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  16.4k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 1.65k, False: 14.8k]
  ------------------
  662|  1.65k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  14.8k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 1.14k, False: 13.6k]
  ------------------
  665|  1.14k|    sampleDesc(size);
  666|       |
  667|  13.6k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 785, False: 12.9k]
  ------------------
  668|    785|    timeToSampleDecoder();
  669|       |
  670|  12.9k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 1.78k, False: 11.1k]
  ------------------
  671|  1.78k|    previewTagDecoder(size);
  672|       |
  673|  11.1k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 602, False: 10.5k]
  ------------------
  674|    602|    trackApertureTagDecoder(size);
  675|       |
  676|  10.5k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 246, False: 10.2k]
  ------------------
  677|    246|    keysTagDecoder(size);
  678|       |
  679|  10.2k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 673, False: 9.60k]
  ------------------
  680|    673|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 217, False: 456]
  ------------------
  681|    217|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    456|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 357, False: 99]
  ------------------
  683|    357|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|     99|    else
  685|     99|      discard(size);
  686|    673|  }
  687|       |
  688|  9.60k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 402, False: 9.20k]
  ------------------
  689|    402|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 154, False: 248]
  ------------------
  690|    154|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    248|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 208, False: 40]
  ------------------
  692|    208|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|     40|    else
  694|     40|      discard(size);
  695|    402|  }
  696|       |
  697|  9.20k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 206, False: 8.99k]
  ------------------
  698|    206|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|    206|  }
  700|       |
  701|  8.99k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 97, False: 8.89k]
  ------------------
  702|     97|    io_->readOrThrow(buf.data(), 4);
  703|     97|    io_->readOrThrow(buf.data(), 4);
  704|     97|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|     97|  }
  706|       |
  707|  8.89k|  else {
  708|  8.89k|    discard(size);
  709|  8.89k|  }
  710|  46.3k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  13.9k|void QuickTimeVideo::discard(size_t size) {
  713|  13.9k|  size_t cur_pos = io_->tell();
  714|  13.9k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  13.9k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|  1.78k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|  1.78k|  DataBuf buf(5);
  719|  1.78k|  size_t cur_pos = io_->tell();
  720|  1.78k|  io_->readOrThrow(buf.data(), 4);
  721|  1.78k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|  1.78k|  io_->readOrThrow(buf.data(), 2);
  723|  1.78k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|  1.78k|  io_->readOrThrow(buf.data(), 4);
  726|  1.78k|  buf.write_uint8(4, 0);  // nul-terminate string
  727|  1.78k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 3, False: 1.77k]
  ------------------
  728|      3|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|  1.77k|  else
  730|  1.77k|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|  1.78k|  io_->seek(cur_pos + size, BasicIo::beg);
  733|  1.78k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    246|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    246|  DataBuf buf(5);
  737|    246|  size_t cur_pos = io_->tell();
  738|    246|  io_->readOrThrow(buf.data(), 4);
  739|    246|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    246|  io_->readOrThrow(buf.data(), 2);
  741|    246|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    246|  io_->readOrThrow(buf.data(), 4);
  744|    246|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    246|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 19, False: 227]
  ------------------
  746|     19|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    227|  else
  748|    227|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    246|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    246|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|    602|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|    602|  DataBuf buf(4);
  755|    602|  DataBuf buf2(2);
  756|    602|  size_t cur_pos = io_->tell();
  757|    602|  byte n = 3;
  758|       |
  759|  2.40k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 1.79k, False: 602]
  ------------------
  760|  1.79k|    io_->seek(4L, BasicIo::cur);
  761|  1.79k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  1.79k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 34, False: 1.76k]
  ------------------
  764|     34|      io_->seek(4L, BasicIo::cur);
  765|     34|      io_->readOrThrow(buf.data(), 2);
  766|     34|      io_->readOrThrow(buf2.data(), 2);
  767|     34|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|     34|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     34|#define stringFormat std::format
  ------------------
  769|     34|      io_->readOrThrow(buf.data(), 2);
  770|     34|      io_->readOrThrow(buf2.data(), 2);
  771|     34|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|     34|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     34|#define stringFormat std::format
  ------------------
  773|     34|    }
  774|       |
  775|  1.76k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 83, False: 1.68k]
  ------------------
  776|     83|      io_->seek(4L, BasicIo::cur);
  777|     83|      io_->readOrThrow(buf.data(), 2);
  778|     83|      io_->readOrThrow(buf2.data(), 2);
  779|     83|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|     83|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     83|#define stringFormat std::format
  ------------------
  781|     83|      io_->readOrThrow(buf.data(), 2);
  782|     83|      io_->readOrThrow(buf2.data(), 2);
  783|     83|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|     83|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     83|#define stringFormat std::format
  ------------------
  785|     83|    }
  786|       |
  787|  1.68k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 91, False: 1.59k]
  ------------------
  788|     91|      io_->seek(4L, BasicIo::cur);
  789|     91|      io_->readOrThrow(buf.data(), 2);
  790|     91|      io_->readOrThrow(buf2.data(), 2);
  791|     91|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     91|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     91|#define stringFormat std::format
  ------------------
  793|     91|      io_->readOrThrow(buf.data(), 2);
  794|     91|      io_->readOrThrow(buf2.data(), 2);
  795|     91|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     91|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     91|#define stringFormat std::format
  ------------------
  797|     91|    }
  798|  1.79k|  }
  799|    602|  io_->seek(cur_pos + size, BasicIo::beg);
  800|    602|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|  1.76k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|  1.76k|  size_t cur_pos = io_->tell();
  804|  1.76k|  DataBuf buf(49);
  805|  1.76k|  DataBuf buf2(4);
  806|       |
  807|  1.76k|  io_->readOrThrow(buf.data(), 4);
  808|  1.76k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 1.29k, False: 471]
  ------------------
  809|  1.29k|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|  1.29k|    io_->readOrThrow(buf.data(), 24);
  812|  1.29k|    buf.write_uint8(24, 0);  // nul-terminate string
  813|  1.29k|    xmpData_["Xmp.video.Make"] = buf.data();
  814|  1.29k|    io_->readOrThrow(buf.data(), 14);
  815|  1.29k|    buf.write_uint8(14, 0);  // nul-terminate string
  816|  1.29k|    xmpData_["Xmp.video.Model"] = buf.data();
  817|  1.29k|    io_->readOrThrow(buf.data(), 4);
  818|  1.29k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.29k|#define stringFormat std::format
  ------------------
  819|  1.29k|    io_->readOrThrow(buf.data(), 4);
  820|  1.29k|    io_->readOrThrow(buf2.data(), 4);
  821|  1.29k|    xmpData_["Xmp.video.FNumber"] =
  822|  1.29k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|  1.29k|    io_->readOrThrow(buf.data(), 4);
  824|  1.29k|    io_->readOrThrow(buf2.data(), 4);
  825|  1.29k|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|  1.29k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|  1.29k|    io_->readOrThrow(buf.data(), 10);
  828|  1.29k|    io_->readOrThrow(buf.data(), 4);
  829|  1.29k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 104, False: 1.19k]
  ------------------
  830|    104|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    104|#define _(String) (String)
  ------------------
  831|  1.29k|    io_->readOrThrow(buf.data(), 4);
  832|  1.29k|    io_->readOrThrow(buf2.data(), 4);
  833|  1.29k|    xmpData_["Xmp.video.FocalLength"] =
  834|  1.29k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|  1.29k|    io_->seek(95L, BasicIo::cur);
  836|  1.29k|    io_->readOrThrow(buf.data(), 48);
  837|  1.29k|    buf.write_uint8(48, 0);
  838|  1.29k|    xmpData_["Xmp.video.Software"] = buf.data();
  839|  1.29k|    io_->readOrThrow(buf.data(), 4);
  840|  1.29k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|  1.29k|  }
  842|       |
  843|  1.76k|  io_->seek(cur_pos + size, BasicIo::beg);
  844|  1.76k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  846|  7.16k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  847|  7.16k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  848|  7.16k|  const size_t start_pos = io_->tell();
  849|  7.16k|  const TagVocabulary* td;
  850|  7.16k|  const TagVocabulary* tv;
  851|  7.16k|  const TagVocabulary* tv_internal;
  852|       |
  853|  7.16k|  const long bufMinSize = 100;
  854|  7.16k|  DataBuf buf(bufMinSize);
  855|  7.16k|  size_t size_internal = outer_size;
  856|  7.16k|  std::memset(buf.data(), 0x0, buf.size());
  857|       |
  858|  13.9k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 9.65k, False: 4.31k]
  |  Branch (858:38): [True: 9.65k, False: 0]
  ------------------
  859|  9.65k|    const size_t loop_start_pos = io_->tell();
  860|  9.65k|    buf.data()[4] = '\0';
  861|  9.65k|    io_->readOrThrow(buf.data(), 4);
  862|  9.65k|    const size_t size = buf.read_uint32(0, bigEndian);
  863|  9.65k|    if (size > size_internal)
  ------------------
  |  Branch (863:9): [True: 2.38k, False: 7.26k]
  ------------------
  864|  2.38k|      break;
  865|  7.26k|    size_internal -= size;
  866|  7.26k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  7.26k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 18, False: 7.24k]
  ------------------
  869|     18|      buf.data()[0] = ' ';
  870|  7.26k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  7.26k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  7.26k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 465, False: 6.79k]
  ------------------
  875|    465|      break;
  876|       |
  877|  6.79k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 81, False: 6.71k]
  |  Branch (877:40): [True: 67, False: 6.65k]
  ------------------
  878|    148|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  6.65k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 1.44k, False: 5.20k]
  ------------------
  881|  1.44k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  5.20k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 1.76k, False: 3.43k]
  ------------------
  884|  1.76k|      CameraTagsDecoder(size - 8);
  885|       |
  886|  3.43k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 11, False: 3.42k]
  |  Branch (886:45): [True: 19, False: 3.40k]
  |  Branch (886:76): [True: 20, False: 3.38k]
  ------------------
  887|  3.38k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 231, False: 3.15k]
  |  Branch (887:45): [True: 72, False: 3.08k]
  ------------------
  888|    353|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    353|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    353|#define _(String) (String)
  ------------------
  890|    353|    }
  891|       |
  892|  3.08k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 65, False: 3.01k]
  |  Branch (892:45): [True: 0, False: 3.01k]
  ------------------
  893|     65|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|     65|      io_->readOrThrow(buf.data(), 2);
  895|     65|      buf.data()[2] = '\0';
  896|     65|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|     65|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 23, False: 42]
  ------------------
  899|     23|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     23|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     23|#define _(String) (String)
  ------------------
  900|     42|      else
  901|     42|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     42|#define _(String) (String)
  ------------------
  902|     65|    }
  903|       |
  904|  3.01k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 171, False: 2.84k]
  ------------------
  905|    171|      io_->readOrThrow(buf.data(), 4);
  906|    171|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    171|#define _(String) (String)
  ------------------
  907|    171|    }
  908|       |
  909|  2.84k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 1.81k, False: 1.03k]
  ------------------
  910|  1.81k|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  6.79k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  6.79k|  }
  914|       |
  915|  7.16k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  7.16k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.44k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.44k|  size_t cur_pos = io_->tell();
  920|  1.44k|  DataBuf buf(201);
  921|  1.44k|  DataBuf buf2(4 + 1);
  922|  1.44k|  uint32_t TagID = 0;
  923|  1.44k|  uint16_t dataLength = 0;
  924|  1.44k|  uint16_t dataType = 2;
  925|  1.44k|  const TagDetails* td;
  926|  1.44k|  const TagDetails* td2;
  927|       |
  928|   103k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 102k, False: 1.44k]
  ------------------
  929|   102k|    io_->readOrThrow(buf.data(), 4);
  930|   102k|    TagID = buf.read_uint32(0, bigEndian);
  931|   102k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   102k|    io_->readOrThrow(buf.data(), 2);
  934|   102k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   102k|    std::memset(buf.data(), 0x0, buf.size());
  937|   102k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   102k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 3.99k, False: 98.4k]
  ------------------
  940|  3.99k|      size_t local_pos = io_->tell();
  941|  3.99k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  3.99k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  3.99k|      io_->readOrThrow(buf.data(), 4);
  945|  3.99k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  3.99k|      io_->readOrThrow(buf.data(), 20);
  947|  3.99k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  3.99k|      io_->readOrThrow(buf.data(), 20);
  949|  3.99k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  3.99k|      io_->readOrThrow(buf.data(), 4);
  951|  3.99k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  3.99k|      io_->readOrThrow(buf.data(), 1);
  954|  3.99k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  3.99k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 2.33k, False: 1.66k]
  ------------------
  956|  2.33k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.33k|#define _(String) (String)
  ------------------
  957|  1.66k|      else
  958|  1.66k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  3.99k|      io_->readOrThrow(buf.data(), 1);
  961|  3.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  3.99k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 2.47k, False: 1.52k]
  ------------------
  963|  2.47k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  2.47k|#define _(String) (String)
  ------------------
  964|       |
  965|  3.99k|      io_->readOrThrow(buf.data(), 1);
  966|  3.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  3.99k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 2.63k, False: 1.36k]
  ------------------
  968|  2.63k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  2.63k|#define _(String) (String)
  ------------------
  969|  1.36k|      else
  970|  1.36k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  3.99k|      io_->readOrThrow(buf.data(), 1);
  973|  3.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  3.99k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 1.79k, False: 2.20k]
  ------------------
  975|  1.79k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  1.79k|#define _(String) (String)
  ------------------
  976|  2.20k|      else
  977|  2.20k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  3.99k|      io_->readOrThrow(buf.data(), 1);
  980|  3.99k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  3.99k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 2.52k, False: 1.47k]
  ------------------
  982|  2.52k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  2.52k|#define _(String) (String)
  ------------------
  983|  1.47k|      else
  984|  1.47k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  3.99k|      io_->readOrThrow(buf.data(), 1);
  987|  3.99k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  3.99k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 2.02k, False: 1.97k]
  ------------------
  989|  2.02k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  2.02k|#define _(String) (String)
  ------------------
  990|  1.97k|      else
  991|  1.97k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  3.99k|      io_->readOrThrow(buf.data(), 1);
  994|  3.99k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  3.99k|      io_->readOrThrow(buf.data(), 1);
  997|  3.99k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  3.99k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 970, False: 3.02k]
  ------------------
  999|    970|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    970|#define _(String) (String)
  ------------------
 1000|  3.02k|      else
 1001|  3.02k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  3.99k|      io_->readOrThrow(buf.data(), 1);
 1004|  3.99k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  3.99k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 1.42k, False: 2.57k]
  ------------------
 1006|  1.42k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  1.42k|#define _(String) (String)
  ------------------
 1007|  2.57k|      else
 1008|  2.57k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  3.99k|      io_->readOrThrow(buf.data(), 1);
 1011|  3.99k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  3.99k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  3.99k|    }
 1015|       |
 1016|  98.4k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 463, False: 97.9k]
  ------------------
 1017|    463|      size_t local_pos = io_->tell();
 1018|    463|      dataLength = buf.read_uint16(0, bigEndian);
 1019|    463|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|    463|      io_->readOrThrow(buf.data(), 2);
 1022|    463|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|    463|      io_->readOrThrow(buf.data(), 1);
 1024|    463|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|    463|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 285, False: 178]
  ------------------
 1026|    285|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    285|#define _(String) (String)
  ------------------
 1027|       |
 1028|    463|      io_->readOrThrow(buf.data(), 1);
 1029|    463|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|    463|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 215, False: 248]
  ------------------
 1031|    215|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    215|#define _(String) (String)
  ------------------
 1032|       |
 1033|    463|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|    463|    }
 1035|       |
 1036|  97.9k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 1.99k, False: 95.9k]
  |  Branch (1036:31): [True: 418, False: 95.5k]
  ------------------
 1037|  1.93k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.93k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.93k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 761, False: 1.17k]
  ------------------
 1042|    761|#ifndef SUPPRESS_WARNINGS
 1043|    761|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    761|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 761]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    761|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    761|#endif
 1046|    761|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    761|        buf.data()[0] = '\0';
 1048|  1.17k|      } else {
 1049|  1.17k|        io_->readOrThrow(buf.data(), dataLength);
 1050|  1.17k|        buf.data()[dataLength] = '\0';
 1051|  1.17k|      }
 1052|       |
 1053|  1.93k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 307, False: 1.62k]
  ------------------
 1054|    307|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    307|#define _(String) (String)
  ------------------
 1055|    307|      }
 1056|  96.0k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 984, False: 95.0k]
  ------------------
 1057|    984|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|    984|      std::memset(buf.data(), 0x0, buf.size());
 1059|    984|      io_->readOrThrow(buf.data(), 4);
 1060|    984|      if (td)
  ------------------
  |  Branch (1060:11): [True: 500, False: 484]
  ------------------
 1061|    500|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    500|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|    984|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 482, False: 502]
  |  Branch (1064:31): [True: 208, False: 294]
  ------------------
 1065|    685|#ifndef SUPPRESS_WARNINGS
 1066|    685|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    685|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 685]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    685|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    685|#endif
 1069|    685|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    685|      } else
 1071|    299|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|  95.0k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 2.78k, False: 92.2k]
  ------------------
 1073|  2.78k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  2.78k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  2.78k|      io_->readOrThrow(buf.data(), 2);
 1076|  2.78k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 1.36k, False: 1.41k]
  ------------------
 1077|  1.36k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.36k|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  2.78k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 2.32k, False: 459]
  |  Branch (1080:31): [True: 213, False: 246]
  ------------------
 1081|  2.53k|#ifndef SUPPRESS_WARNINGS
 1082|  2.53k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  2.53k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.53k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.53k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  2.53k|#endif
 1085|  2.53k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  2.53k|      } else
 1087|    247|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  92.2k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 842, False: 91.4k]
  ------------------
 1089|    842|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|    842|      std::memset(buf.data(), 0x0, buf.size());
 1091|    842|      io_->readOrThrow(buf.data(), 4);
 1092|    842|      io_->readOrThrow(buf2.data(), 4);
 1093|    842|      if (td)
  ------------------
  |  Branch (1093:11): [True: 617, False: 225]
  ------------------
 1094|    617|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    617|#define _(String) (String)
  ------------------
 1095|    617|            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|    842|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 580, False: 262]
  |  Branch (1098:31): [True: 149, False: 113]
  ------------------
 1099|    725|#ifndef SUPPRESS_WARNINGS
 1100|    725|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    725|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 725]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    725|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|    725|#endif
 1103|    725|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|    725|      } else
 1105|    117|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  91.4k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.21k, False: 90.2k]
  ------------------
 1107|  1.21k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.21k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.21k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.21k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.21k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 282, False: 933]
  ------------------
 1112|    282|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    282|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    282|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.21k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 460, False: 755]
  |  Branch (1115:31): [True: 239, False: 516]
  ------------------
 1116|    699|#ifndef SUPPRESS_WARNINGS
 1117|    699|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    699|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 699]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    699|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    699|#endif
 1120|    699|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    699|      } else
 1122|    516|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.21k|    }
 1124|   102k|  }
 1125|       |
 1126|  1.44k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.44k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  4.14k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  4.14k|  size_t current_position = io_->tell();
 1131|  4.14k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  4.14k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 4.14k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  4.14k|  DataBuf buf(4 + 1);
 1135|       |
 1136|  47.4k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 47.4k, False: 0]
  |  Branch (1136:25): [True: 46.3k, False: 1.14k]
  ------------------
 1137|  46.3k|    io_->readOrThrow(buf.data(), 4);
 1138|  46.3k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 2.99k, False: 43.3k]
  ------------------
 1139|  2.99k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 107, False: 2.89k]
  ------------------
 1140|    107|        break;
 1141|  2.89k|      io_->readOrThrow(buf.data(), 4);
 1142|  2.89k|      io_->readOrThrow(buf.data(), 4);
 1143|  2.89k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  2.89k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 62, False: 2.82k]
  ------------------
 1146|     62|        currentStream_ = Video;
 1147|  2.82k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 926, False: 1.90k]
  ------------------
 1148|    926|        currentStream_ = Audio;
 1149|  1.90k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 45, False: 1.85k]
  ------------------
 1150|     45|        currentStream_ = Hint;
 1151|  1.85k|      else
 1152|  1.85k|        currentStream_ = GenMediaHeader;
 1153|  2.89k|      break;
 1154|  2.99k|    }
 1155|  46.3k|  }
 1156|       |
 1157|  4.14k|  io_->seek(current_position, BasicIo::beg);
 1158|  4.14k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|    785|void QuickTimeVideo::timeToSampleDecoder() {
 1161|    785|  DataBuf buf(4 + 1);
 1162|    785|  io_->readOrThrow(buf.data(), 4);
 1163|    785|  io_->readOrThrow(buf.data(), 4);
 1164|    785|  uint64_t totalframes = 0;
 1165|    785|  uint64_t timeOfFrames = 0;
 1166|    785|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  2.70k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 1.91k, False: 785]
  ------------------
 1169|  1.91k|    io_->readOrThrow(buf.data(), 4);
 1170|  1.91k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  1.91k|    totalframes = Safe::add(totalframes, temp);
 1172|  1.91k|    io_->readOrThrow(buf.data(), 4);
 1173|  1.91k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  1.91k|  }
 1175|    785|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 280, False: 505]
  ------------------
 1176|    280|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 129, False: 151]
  ------------------
 1177|    129|      timeOfFrames = 1;
 1178|    280|    xmpData_["Xmp.video.FrameRate"] =
 1179|    280|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    280|  }
 1181|    785|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.14k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.14k|  DataBuf buf(100);
 1185|  1.14k|  size_t cur_pos = io_->tell();
 1186|  1.14k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.14k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.14k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|  72.2k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 71.3k, False: 853]
  ------------------
 1191|  71.3k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 41.1k, False: 30.2k]
  ------------------
 1192|  41.1k|      imageDescDecoder();
 1193|  30.2k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 29.9k, False: 295]
  ------------------
 1194|  29.9k|      audioDescDecoder();
 1195|    295|    else
 1196|    295|      break;
 1197|  71.3k|  }
 1198|  1.14k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.14k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  29.9k|void QuickTimeVideo::audioDescDecoder() {
 1202|  29.9k|  DataBuf buf(40);
 1203|  29.9k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  29.9k|  buf.data()[4] = '\0';
 1205|  29.9k|  io_->readOrThrow(buf.data(), 4);
 1206|  29.9k|  size_t size = 82;
 1207|       |
 1208|  29.9k|  const TagVocabulary* td;
 1209|       |
 1210|   627k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 597k, False: 29.8k]
  ------------------
 1211|   597k|    io_->readOrThrow(buf.data(), 4);
 1212|   597k|    switch (i) {
 1213|  29.9k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 29.9k, False: 567k]
  ------------------
 1214|  29.9k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  29.9k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 497, False: 29.4k]
  ------------------
 1216|    497|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    497|#define _(String) (String)
  ------------------
 1217|  29.4k|        else
 1218|  29.4k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  29.9k|        break;
 1220|  29.9k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 29.9k, False: 567k]
  ------------------
 1221|  29.9k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  29.9k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 813, False: 29.0k]
  ------------------
 1223|    813|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    813|#define _(String) (String)
  ------------------
 1224|  29.9k|        break;
 1225|  29.9k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 29.9k, False: 567k]
  ------------------
 1226|  29.9k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  29.9k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  29.9k|        break;
 1229|  29.8k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 29.8k, False: 567k]
  ------------------
 1230|  29.8k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  29.8k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  29.8k|        break;
 1233|   478k|      default:
  ------------------
  |  Branch (1233:7): [True: 478k, False: 119k]
  ------------------
 1234|   478k|        break;
 1235|   597k|    }
 1236|   597k|  }
 1237|  29.8k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  29.8k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  41.1k|void QuickTimeVideo::imageDescDecoder() {
 1241|  41.1k|  DataBuf buf(40);
 1242|  41.1k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  41.1k|  buf.data()[4] = '\0';
 1244|  41.1k|  io_->readOrThrow(buf.data(), 4);
 1245|  41.1k|  size_t size = 82;
 1246|       |
 1247|  41.1k|  const TagVocabulary* td;
 1248|       |
 1249|   493k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 452k, False: 41.0k]
  ------------------
 1250|   452k|    io_->readOrThrow(buf.data(), 4);
 1251|   452k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   452k|    switch (i) {
 1254|  41.1k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 41.1k, False: 411k]
  ------------------
 1255|  41.1k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  41.1k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 478, False: 40.6k]
  ------------------
 1257|    478|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    478|#define _(String) (String)
  ------------------
 1258|  40.6k|        else
 1259|  40.6k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  41.1k|        break;
 1261|  41.1k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 41.1k, False: 411k]
  ------------------
 1262|  41.1k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  41.1k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 826, False: 40.2k]
  ------------------
 1264|    826|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|    826|#define _(String) (String)
  ------------------
 1265|  41.1k|        break;
 1266|  41.0k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 41.0k, False: 411k]
  ------------------
 1267|  41.0k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  41.0k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  41.0k|        break;
 1270|  41.0k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 41.0k, False: 411k]
  ------------------
 1271|  41.0k|        xmpData_["Xmp.video.XResolution"] =
 1272|  41.0k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  41.0k|        break;
 1274|  41.0k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 41.0k, False: 411k]
  ------------------
 1275|  41.0k|        xmpData_["Xmp.video.YResolution"] =
 1276|  41.0k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  41.0k|        io_->readOrThrow(buf.data(), 3);
 1278|  41.0k|        size -= 3;
 1279|  41.0k|        break;
 1280|  41.0k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 41.0k, False: 411k]
  ------------------
 1281|  41.0k|        io_->readOrThrow(buf.data(), 32);
 1282|  41.0k|        size -= 32;
 1283|  41.0k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  41.0k|        break;
 1285|   205k|      default:
  ------------------
  |  Branch (1285:7): [True: 205k, False: 246k]
  ------------------
 1286|   205k|        break;
 1287|   452k|    }
 1288|   452k|  }
 1289|  41.0k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  41.0k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  41.0k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  1.65k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  1.65k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  1.65k|  DataBuf buf(4 + 1);
 1296|  1.65k|  io_->readOrThrow(buf.data(), 4);
 1297|  1.65k|  io_->readOrThrow(buf.data(), 4);
 1298|  1.65k|  uint32_t noOfEntries;
 1299|       |
 1300|  1.65k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  3.58k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 2.23k, False: 1.35k]
  |  Branch (1302:43): [True: 1.93k, False: 303]
  ------------------
 1303|  1.93k|    decodeBlock(recursion_depth + 1);
 1304|  1.93k|  }
 1305|  1.65k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  2.54k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  2.54k|  DataBuf buf(3);
 1309|  2.54k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  2.54k|  buf.data()[2] = '\0';
 1311|  2.54k|  currentStream_ = Video;
 1312|       |
 1313|  2.54k|  const TagDetails* td;
 1314|       |
 1315|  15.9k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 13.4k, False: 2.54k]
  ------------------
 1316|  13.4k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  13.4k|    switch (i) {
 1319|  2.37k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 2.37k, False: 11.0k]
  ------------------
 1320|  2.37k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  2.37k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 2.03k, False: 336]
  ------------------
 1322|  2.03k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  2.03k|#define _(String) (String)
  ------------------
 1323|  2.37k|        break;
 1324|  2.37k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 2.37k, False: 11.0k]
  ------------------
 1325|  2.37k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  2.37k|        break;
 1327|  8.69k|      default:
  ------------------
  |  Branch (1327:7): [True: 8.69k, False: 4.74k]
  ------------------
 1328|  8.69k|        break;
 1329|  13.4k|    }
 1330|  13.4k|  }
 1331|  2.54k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  2.54k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  4.80k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  4.80k|  size_t cur_pos = io_->tell();
 1336|  4.80k|  DataBuf buf(5);
 1337|  4.80k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  4.80k|  buf.data()[4] = '\0';
 1339|       |
 1340|  4.80k|  const TagVocabulary* tv;
 1341|       |
 1342|  28.8k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 24.0k, False: 4.79k]
  ------------------
 1343|  24.0k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  24.0k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 14.3k, False: 9.60k]
  ------------------
 1346|  4.80k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 4.80k, False: 19.2k]
  ------------------
 1347|  4.80k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  4.80k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 1.76k, False: 3.03k]
  ------------------
 1349|  1.76k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 489, False: 1.27k]
  ------------------
 1350|    489|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    489|#define _(String) (String)
  ------------------
 1351|  1.27k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 553, False: 722]
  ------------------
 1352|    553|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    553|#define _(String) (String)
  ------------------
 1353|  1.76k|        }
 1354|  4.80k|        break;
 1355|  4.79k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 4.79k, False: 19.2k]
  ------------------
 1356|  4.79k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  4.79k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 2.71k, False: 2.08k]
  ------------------
 1358|  2.71k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 704, False: 2.00k]
  ------------------
 1359|    704|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    704|#define _(String) (String)
  ------------------
 1360|  2.00k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 810, False: 1.19k]
  ------------------
 1361|    810|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    810|#define _(String) (String)
  ------------------
 1362|  2.71k|        }
 1363|  4.79k|        break;
 1364|  4.79k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 4.79k, False: 19.2k]
  ------------------
 1365|  4.79k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  4.79k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 1.01k, False: 3.78k]
  ------------------
 1367|  1.01k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 169, False: 841]
  ------------------
 1368|    169|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    169|#define _(String) (String)
  ------------------
 1369|    841|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 168, False: 673]
  ------------------
 1370|    168|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    168|#define _(String) (String)
  ------------------
 1371|  1.01k|        }
 1372|  4.79k|        break;
 1373|  24.0k|    }
 1374|  24.0k|  }
 1375|  4.79k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  4.79k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  3.83k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  3.83k|  DataBuf buf(5);
 1380|  3.83k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  3.83k|  buf.data()[4] = '\0';
 1382|  3.83k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  3.83k|  const TagVocabulary* td;
 1384|       |
 1385|  34.9k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 31.1k, False: 3.83k]
  ------------------
 1386|  31.1k|    io_->readOrThrow(buf.data(), 4);
 1387|  31.1k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  31.1k|    switch (i) {
 1390|  3.79k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 3.79k, False: 27.3k]
  ------------------
 1391|  3.79k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 1.49k, False: 2.30k]
  ------------------
 1392|  1.49k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  1.49k|#define _(String) (String)
  ------------------
 1393|  3.79k|        break;
 1394|  1.53k|      case 1:
  ------------------
  |  Branch (1394:7): [True: 1.53k, False: 29.5k]
  ------------------
 1395|  1.53k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|  1.53k|        break;
 1397|  25.7k|      default:
  ------------------
  |  Branch (1397:7): [True: 25.7k, False: 5.32k]
  ------------------
 1398|  25.7k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 1.10k, False: 24.6k]
  ------------------
 1399|  1.10k|          v->read(_(td->label_));
  ------------------
  |  |   40|  1.10k|#define _(String) (String)
  ------------------
 1400|  24.6k|        else
 1401|  24.6k|          v->read(Exiv2::toString(buf.data()));
 1402|  25.7k|        break;
 1403|  31.1k|    }
 1404|  31.1k|  }
 1405|  3.83k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  3.83k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  3.83k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|    767|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|    767|  DataBuf buf(5);
 1411|    767|  std::memset(buf.data(), 0x0, buf.size());
 1412|    767|  buf.data()[4] = '\0';
 1413|    767|  int64_t time_scale = 1;
 1414|       |
 1415|  3.84k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 3.07k, False: 767]
  ------------------
 1416|  3.07k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  3.07k|    switch (i) {
 1419|    491|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 491, False: 2.58k]
  ------------------
 1420|    491|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 99, False: 392]
  ------------------
 1421|     99|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|    392|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 93, False: 299]
  ------------------
 1423|     93|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|    491|        break;
 1425|    463|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 463, False: 2.61k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|    463|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 72, False: 391]
  ------------------
 1428|     72|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|    391|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 93, False: 298]
  ------------------
 1430|     93|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|    463|        break;
 1432|    433|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 433, False: 2.64k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|    433|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 44, False: 389]
  ------------------
 1435|     44|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|    389|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 93, False: 296]
  ------------------
 1437|     93|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|    433|        break;
 1439|    433|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 433, False: 2.64k]
  ------------------
 1440|    433|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 44, False: 389]
  ------------------
 1441|     44|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|    389|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 93, False: 296]
  ------------------
 1443|     93|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|    433|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|    433|        mdhdTimeScale_ = time_scale;
 1446|    433|        break;
 1447|    431|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 431, False: 2.64k]
  ------------------
 1448|    431|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 43, False: 388]
  ------------------
 1449|     43|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 43, False: 0]
  ------------------
 1450|    388|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 93, False: 295]
  ------------------
 1451|     93|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 93, False: 0]
  ------------------
 1452|    431|        break;
 1453|    431|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 431, False: 2.64k]
  ------------------
 1454|    431|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 43, False: 388]
  ------------------
 1455|     43|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|    388|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 93, False: 295]
  ------------------
 1457|     93|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|    431|        break;
 1459|       |
 1460|    394|      default:
  ------------------
  |  Branch (1460:7): [True: 394, False: 2.68k]
  ------------------
 1461|    394|        break;
 1462|  3.07k|    }
 1463|  3.07k|  }
 1464|    767|  io_->readOrThrow(buf.data(), size % 4);
 1465|    767|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|    652|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|    652|  DataBuf buf(5);
 1469|    652|  std::memset(buf.data(), 0x0, buf.size());
 1470|    652|  buf.data()[4] = '\0';
 1471|    652|  int64_t temp = 0;
 1472|       |
 1473|  10.7k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 10.1k, False: 652]
  ------------------
 1474|  10.1k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  10.1k|    switch (i) {
 1477|    507|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 507, False: 9.62k]
  ------------------
 1478|    507|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 73, False: 434]
  ------------------
 1479|     73|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|    434|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 168, False: 266]
  ------------------
 1481|    168|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|    507|        break;
 1483|    506|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 506, False: 9.62k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|    506|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 73, False: 433]
  ------------------
 1486|     73|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|    433|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 168, False: 265]
  ------------------
 1488|    168|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|    506|        break;
 1490|    505|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 505, False: 9.62k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|    505|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 73, False: 432]
  ------------------
 1493|     73|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|    432|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 168, False: 264]
  ------------------
 1495|    168|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|    505|        break;
 1497|    504|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 504, False: 9.62k]
  ------------------
 1498|    504|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 72, False: 432]
  ------------------
 1499|     72|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|    432|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 168, False: 264]
  ------------------
 1501|    168|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|    504|        break;
 1503|    503|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 503, False: 9.62k]
  ------------------
 1504|    503|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 72, False: 431]
  ------------------
 1505|     72|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 72, False: 0]
  ------------------
 1506|    431|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 168, False: 263]
  ------------------
 1507|    168|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 168, False: 0]
  ------------------
 1508|    503|        break;
 1509|    467|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 467, False: 9.66k]
  ------------------
 1510|    467|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 43, False: 424]
  ------------------
 1511|     43|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|    424|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 168, False: 256]
  ------------------
 1513|    168|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|    467|        break;
 1515|    467|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 467, False: 9.66k]
  ------------------
 1516|    467|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 43, False: 424]
  ------------------
 1517|     43|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|    424|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 168, False: 256]
  ------------------
 1519|    168|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|    467|        break;
 1521|    462|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 462, False: 9.67k]
  ------------------
 1522|    462|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 43, False: 419]
  ------------------
 1523|     43|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|     43|          xmpData_["Xmp.video.Width"] = temp;
 1525|     43|          width_ = temp;
 1526|     43|        }
 1527|    462|        break;
 1528|    462|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 462, False: 9.67k]
  ------------------
 1529|    462|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 43, False: 419]
  ------------------
 1530|     43|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|     43|          xmpData_["Xmp.video.Height"] = temp;
 1532|     43|          height_ = temp;
 1533|     43|        }
 1534|    462|        break;
 1535|  5.74k|      default:
  ------------------
  |  Branch (1535:7): [True: 5.74k, False: 4.38k]
  ------------------
 1536|  5.74k|        break;
 1537|  10.1k|    }
 1538|  10.1k|  }
 1539|    652|  io_->readOrThrow(buf.data(), size % 4);
 1540|    652|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|     71|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|     71|  DataBuf buf(5);
 1544|     71|  std::memset(buf.data(), 0x0, buf.size());
 1545|     71|  buf.data()[4] = '\0';
 1546|       |
 1547|  1.14k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 1.06k, False: 71]
  ------------------
 1548|  1.06k|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|  1.06k|    switch (i) {
 1551|     60|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 60, False: 1.00k]
  ------------------
 1552|     60|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|     60|        break;
 1554|     59|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 59, False: 1.01k]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|     59|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|     59|        break;
 1558|     57|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 57, False: 1.01k]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|     57|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|     57|        break;
 1562|     55|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 55, False: 1.01k]
  ------------------
 1563|     55|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|     55|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|     55|        break;
 1566|     54|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 54, False: 1.01k]
  ------------------
 1567|     54|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 54, False: 0]
  ------------------
 1568|     54|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|     54|        }
 1570|     54|        break;
 1571|     54|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 54, False: 1.01k]
  ------------------
 1572|     54|        xmpData_["Xmp.video.PreferredRate"] =
 1573|     54|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|     54|        break;
 1575|     53|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 53, False: 1.01k]
  ------------------
 1576|     53|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|     53|        break;
 1578|     27|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 27, False: 1.04k]
  ------------------
 1579|     27|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     27|        break;
 1581|     27|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 27, False: 1.04k]
  ------------------
 1582|     27|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     27|        break;
 1584|     26|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 26, False: 1.04k]
  ------------------
 1585|     26|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     26|        break;
 1587|     26|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 26, False: 1.04k]
  ------------------
 1588|     26|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     26|        break;
 1590|     26|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 26, False: 1.04k]
  ------------------
 1591|     26|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     26|        break;
 1593|     26|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 26, False: 1.04k]
  ------------------
 1594|     26|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     26|        break;
 1596|     26|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 26, False: 1.04k]
  ------------------
 1597|     26|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|     26|        break;
 1599|    493|      default:
  ------------------
  |  Branch (1599:7): [True: 493, False: 576]
  ------------------
 1600|    493|        break;
 1601|  1.06k|    }
 1602|  1.06k|  }
 1603|     71|  io_->readOrThrow(buf.data(), size % 4);
 1604|     71|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  3.35k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  3.35k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  3.35k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 8, False: 3.35k]
  ------------------
 1609|      8|    return nullptr;
 1610|      8|  }
 1611|  3.35k|  return image;
 1612|  3.35k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  19.0k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  19.0k|  auto buf = DataBuf(12 + 1);
 1616|  19.0k|  iIo.read(buf.data(), 12);
 1617|  19.0k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  19.0k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 19.0k]
  |  Branch (1619:22): [True: 414, False: 18.6k]
  ------------------
 1620|    414|    return false;
 1621|    414|  }
 1622|  18.6k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  18.6k|  bool matched = false;
 1625|       |
 1626|   135k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 135k, False: 5.90k]
  ------------------
 1627|   135k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   135k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 12.7k, False: 122k]
  ------------------
 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|  12.7k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 10.0k, False: 2.69k]
  ------------------
 1633|  10.0k|        matched = true;
 1634|  10.0k|      }
 1635|  12.7k|      break;
 1636|  12.7k|    }
 1637|   135k|  }
 1638|       |
 1639|  18.6k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 18.6k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  18.6k|    iIo.seek(0L, BasicIo::beg);
 1641|  18.6k|  }
 1642|       |
 1643|  18.6k|  return matched;
 1644|  19.0k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|  95.7k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|  95.7k|  const char ignoreList[13][5] = {
  505|  95.7k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|  95.7k|  };
  507|       |
  508|  95.7k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.21M, False: 90.8k]
  ------------------
  509|  1.21M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 4.89k, False: 1.21M]
  ------------------
  510|  4.89k|      return true;
  511|       |
  512|  90.8k|  return false;
  513|  95.7k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  46.3k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  46.3k|  const char ignoreList[8][5] = {
  524|  46.3k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  46.3k|  };
  526|       |
  527|  46.3k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 359k, False: 40.3k]
  ------------------
  528|   359k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 5.98k, False: 353k]
  ------------------
  529|  5.98k|      return true;
  530|       |
  531|  40.3k|  return false;
  532|  46.3k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  2.05M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  2.05M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  2.05M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  2.05M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  2.40M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  1.65k|static std::string readString(BasicIo& io, size_t size) {
  621|  1.65k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  1.65k|  Exiv2::DataBuf str(size + 1);
  623|  1.65k|  io.readOrThrow(str.data(), size);
  624|  1.65k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  1.65k|  return Exiv2::toString(str.data());
  626|  1.65k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  365|    913|    Image(ImageType::riff, mdNone, std::move(io), params) {
  366|    913|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  368|    913|std::string RiffVideo::mimeType() const {
  369|    913|  return "video/riff";
  370|    913|}
_ZN5Exiv29RiffVideo13writeMetadataEv:
  372|     18|void RiffVideo::writeMetadata() {
  373|     18|}  // RiffVideo::writeMetadata
_ZN5Exiv29RiffVideo12readMetadataEv:
  375|    913|void RiffVideo::readMetadata() {
  376|    913|  if (io_->open() != 0)
  ------------------
  |  Branch (376:7): [True: 0, False: 913]
  ------------------
  377|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  378|       |
  379|       |  // Ensure that this is the correct image type
  380|    913|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (380:7): [True: 0, False: 913]
  ------------------
  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|    913|  IoCloser closer(*io_);
  387|    913|  clearMetadata();
  388|       |
  389|    913|  xmpData_["Xmp.video.FileSize"] = io_->size();
  390|    913|  xmpData_["Xmp.video.MimeType"] = mimeType();
  391|       |
  392|    913|  HeaderReader header(io_);
  393|    913|  xmpData_["Xmp.video.Container"] = header.getId();
  394|       |
  395|    913|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  396|       |
  397|    913|  decodeBlocks();
  398|    913|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  400|  8.24k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  401|  8.24k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  402|  8.24k|  id_ = readStringTag(io);
  403|  8.24k|  size_ = readDWORDTag(io);
  404|  8.24k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  406|  47.4k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  407|  47.4k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (407:7): [True: 13.5k, False: 33.9k]
  ------------------
  408|  13.5k|    return false;
  409|       |
  410|  33.9k|  return Internal::upper(str1) == str2;
  411|  47.4k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  413|    413|void RiffVideo::readList(const HeaderReader& header_) {
  414|    413|  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|    413|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (421:7): [True: 284, False: 129]
  ------------------
  422|    284|    readInfoListChunk(header_.getSize());
  423|    129|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (423:12): [True: 37, False: 92]
  ------------------
  424|     37|    readMoviList(header_.getSize());
  425|     37|  }
  426|    413|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  428|  6.79k|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|  6.79k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (435:7): [True: 649, False: 6.14k]
  ------------------
  436|    649|    readAviHeader();
  437|  6.14k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (437:12): [True: 822, False: 5.31k]
  ------------------
  438|    822|    readStreamHeader();
  439|  5.31k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (439:12): [True: 1.78k, False: 3.53k]
  ------------------
  440|  1.78k|    readStreamFormat(header_.getSize());
  441|  3.53k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (441:12): [True: 297, False: 3.24k]
  ------------------
  442|    297|    streamType_ = Audio;
  443|    297|    readStreamFormat(header_.getSize());
  444|  3.24k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (444:14): [True: 10, False: 3.23k]
  ------------------
  445|     10|    readStreamData(header_.getSize());
  446|  3.23k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (446:12): [True: 109, False: 3.12k]
  ------------------
  447|    109|    StreamName(header_.getSize());
  448|  3.12k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (448:12): [True: 248, False: 2.87k]
  ------------------
  449|    248|    readVPRPChunk(header_.getSize());
  450|  2.87k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (450:12): [True: 274, False: 2.60k]
  ------------------
  451|    274|    readIndexChunk(header_.getSize());
  452|  2.60k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (452:12): [True: 564, False: 2.03k]
  ------------------
  453|    564|    readDataChunk(header_.getSize());
  454|  2.03k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (454:12): [True: 169, False: 1.86k]
  ------------------
  455|    169|    readJunk(header_.getSize());
  456|  1.86k|  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|  1.86k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  463|  1.86k|  }
  464|  6.79k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  466|    913|void RiffVideo::decodeBlocks() {
  467|  7.33k|  do {
  468|  7.33k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (468:35): [True: 413, False: 6.92k]
  ------------------
  469|    413|      readList(header);
  470|  6.92k|    } else {
  471|  6.92k|      readChunk(header);
  472|  6.92k|    }
  473|  7.33k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (473:12): [True: 6.45k, False: 877]
  |  Branch (473:27): [True: 6.42k, False: 36]
  ------------------
  474|    913|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  476|    649|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|    649|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  497|    649|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  498|    649|  double frame_rate = 1000000. / TimeBetweenFrames;
  499|       |
  500|    649|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  501|       |
  502|    649|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  503|    649|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  504|       |
  505|    649|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  506|    649|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  507|       |
  508|    649|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  509|    649|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  510|       |
  511|    649|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  512|       |
  513|    649|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  514|       |
  515|    649|  uint32_t width = readDWORDTag(io_);
  516|    649|  xmpData_["Xmp.video.Width"] = width;
  517|       |
  518|    649|  uint32_t height = readDWORDTag(io_);
  519|    649|  xmpData_["Xmp.video.Height"] = height;
  520|       |
  521|    649|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  522|    649|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  523|       |
  524|    649|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  525|       |
  526|    649|  fillDuration(frame_rate, frame_count);
  527|    649|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  529|    822|void RiffVideo::readStreamHeader() {
  530|    822|  std::string stream = readStringTag(io_);
  531|    822|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (531:17): [True: 113, False: 709]
  ------------------
  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|    822|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  556|       |
  557|    822|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  558|    822|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  559|       |
  560|    822|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  561|       |
  562|    822|  if (divisor) {
  ------------------
  |  Branch (562:7): [True: 626, False: 196]
  ------------------
  563|    626|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  564|    626|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (564:14): [True: 59, False: 567]
  ------------------
  565|    626|  }
  566|    822|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  567|       |
  568|    822|  if (divisor) {
  ------------------
  |  Branch (568:7): [True: 598, False: 224]
  ------------------
  569|    598|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  570|    598|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (570:14): [True: 59, False: 539]
  ------------------
  571|    598|  }
  572|       |
  573|    822|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  574|       |
  575|    822|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (575:12): [True: 112, False: 710]
  ------------------
  576|       |
  577|    822|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (577:12): [True: 112, False: 710]
  ------------------
  578|    822|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  579|    822|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  581|  2.07k|void RiffVideo::readStreamFormat(uint64_t size_) {
  582|       |  // The structure of the strf chunk depends on the media type. Video streams use the BITMAPINFOHEADER structure,
  583|       |  // whereas audio streams use the WAVEFORMATEX structure.
  584|       |
  585|       |#ifdef EXIV2_DEBUG_MESSAGES
  586|       |  if (streamType_ == Audio) {
  587|       |    EXV_INFO << "--> wFormatTag      = " << readWORDTag(io_) << '\n';
  588|       |    EXV_INFO << "--> nChannels       = " << readWORDTag(io_) << '\n';
  589|       |    EXV_INFO << "--> nSamplesPerSec  = " << readDWORDTag(io_) << '\n';
  590|       |    EXV_INFO << "--> nAvgBytesPerSec = " << readDWORDTag(io_) << '\n';
  591|       |    EXV_INFO << "--> nBlockAlign     = " << readWORDTag(io_) << '\n';
  592|       |    EXV_INFO << "--> wBitsPerSample  = " << readWORDTag(io_) << '\n';
  593|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  594|       |      io_->seekOrThrow(io_->tell() - DWORD * 4, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  595|       |  } else if (streamType_ == Video) {
  596|       |    EXV_INFO << "--> biSize            = " << readDWORDTag(io_) << '\n';
  597|       |    EXV_INFO << "--> biWidth           = " << readDWORDTag(io_) << '\n';
  598|       |    EXV_INFO << "--> biHeight          = " << readDWORDTag(io_) << '\n';
  599|       |    EXV_INFO << "--> biPlanes          = " << readWORDTag(io_) << '\n';
  600|       |    EXV_INFO << "--> biBitCount        = " << readWORDTag(io_) << '\n';
  601|       |    EXV_INFO << "--> biCompression     = " << readDWORDTag(io_) << '\n';
  602|       |    EXV_INFO << "--> biSizeImage       = " << readDWORDTag(io_) << '\n';
  603|       |    EXV_INFO << "--> biXPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  604|       |    EXV_INFO << "--> biYPelsPerMeter   = " << readDWORDTag(io_) << '\n';
  605|       |    EXV_INFO << "--> biClrUsed         = " << readDWORDTag(io_) << '\n';
  606|       |    EXV_INFO << "--> biClrImportant    = " << readDWORDTag(io_) << '\n';
  607|       |    if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  608|       |      io_->seekOrThrow(io_->tell() - DWORD * 10, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  609|       |  }
  610|       |#endif
  611|       |
  612|  2.07k|  if (streamType_ == Video) {
  ------------------
  |  Branch (612:7): [True: 209, False: 1.86k]
  ------------------
  613|    209|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  614|    209|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  615|    209|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  616|    209|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  617|    209|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  618|    209|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  619|    209|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  620|    209|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  621|    209|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (621:18): [True: 115, False: 94]
  ------------------
  622|    115|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  623|     94|    else
  624|     94|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  625|    209|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (625:18): [True: 148, False: 61]
  ------------------
  626|    148|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  627|     61|    else
  628|     61|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  629|  1.86k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (629:14): [True: 1.79k, False: 74]
  ------------------
  630|  1.79k|    uint16_t format_tag = readWORDTag(io_);
  631|  1.79k|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (631:67): [True: 1.28k, False: 514]
  ------------------
  632|  1.28k|      xmpData_["Xmp.audio.Compressor"] = it->second;
  633|    514|    else
  634|    514|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  635|       |
  636|  1.79k|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  637|  1.79k|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  638|  1.79k|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  639|  1.79k|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  640|  1.79k|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  641|  1.79k|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (641:9): [True: 46, False: 1.74k]
  ------------------
  642|     46|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  643|  1.79k|  } else {
  644|     74|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  645|     74|  }
  646|  2.07k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  648|     10|void RiffVideo::readStreamData(uint64_t size_) const {
  649|     10|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  650|     10|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  652|    109|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|    109|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  655|    109|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  657|    284|void RiffVideo::readInfoListChunk(uint64_t size_) {
  658|    284|  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|    284|  std::map<std::string, std::string> table;
  663|  1.25k|  while (current_size < size_) {
  ------------------
  |  Branch (663:10): [True: 969, False: 284]
  ------------------
  664|    969|    std::string type = readStringTag(io_);
  665|    969|    size_t size = readDWORDTag(io_);
  666|    969|    std::string content = readStringTag(io_, size);
  667|    969|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
  ------------------
  |  Branch (667:50): [True: 25, False: 944]
  ------------------
  668|       |      // Check that it isn't a duplicate.
  669|     25|      Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
  670|     25|      table[it->second] = content;
  671|     25|    }
  672|    969|    current_size += DWORD * 2;
  673|    969|    current_size += size;
  674|    969|  }
  675|       |  // Copy the elements from the temporary table to xmpData_.
  676|    284|  for (const auto& it : table) {
  ------------------
  |  Branch (676:23): [True: 6, False: 284]
  ------------------
  677|      6|    xmpData_[it.first] = it.second;
  678|      6|  }
  679|    284|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  681|     37|void RiffVideo::readMoviList(uint64_t size_) const {
  682|     37|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  683|     37|}
_ZNK5Exiv29RiffVideo13readVPRPChunkEm:
  685|    248|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|    248|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  709|    248|}
_ZNK5Exiv29RiffVideo14readIndexChunkEm:
  711|    274|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|    274|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|    274|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  731|    564|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|    564|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  743|    564|  if (size_ % 2 != 0)
  ------------------
  |  Branch (743:7): [True: 312, False: 252]
  ------------------
  744|    312|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  745|    564|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  747|    169|void RiffVideo::readJunk(uint64_t size_) const {
  748|    169|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  749|    169|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  751|  2.43k|std::string RiffVideo::getStreamType(uint32_t stream) {
  752|  2.43k|  if (stream == 1)
  ------------------
  |  Branch (752:7): [True: 109, False: 2.32k]
  ------------------
  753|    109|    return "Mono";
  754|  2.32k|  if (stream == 2)
  ------------------
  |  Branch (754:7): [True: 792, False: 1.53k]
  ------------------
  755|    792|    return "Stereo";
  756|  1.53k|  if (stream == 5)
  ------------------
  |  Branch (756:7): [True: 122, False: 1.41k]
  ------------------
  757|    122|    return "5.1 Surround Sound";
  758|  1.41k|  if (stream == 7)
  ------------------
  |  Branch (758:7): [True: 344, False: 1.06k]
  ------------------
  759|    344|    return "7.1 Surround Sound";
  760|  1.06k|  return "Mono";
  761|  1.41k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  763|    618|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  764|    618|  if (frame_rate == 0)
  ------------------
  |  Branch (764:7): [True: 0, False: 618]
  ------------------
  765|      0|    return;
  766|       |
  767|    618|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  768|    618|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  769|    618|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  770|    618|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|    913|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|    913|  auto image = std::make_unique<RiffVideo>(std::move(io), params);
  774|    913|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 913]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|    913|  return image;
  778|    913|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  780|  9.50k|bool isRiffType(BasicIo& iIo, bool advance) {
  781|  9.50k|  constexpr int len = 4;
  782|  9.50k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  783|  9.50k|  std::array<byte, len> buf;
  784|  9.50k|  iIo.read(buf.data(), len);
  785|  9.50k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 9.50k]
  |  Branch (785:22): [True: 414, False: 9.09k]
  ------------------
  786|    414|    return false;
  787|    414|  }
  788|  9.09k|  bool matched = buf == RiffVideoId;
  789|  9.09k|  if (!advance || !matched) {
  ------------------
  |  Branch (789:7): [True: 9.09k, False: 0]
  |  Branch (789:19): [True: 0, False: 0]
  ------------------
  790|  9.09k|    iIo.seek(-1 * len, BasicIo::cur);
  791|  9.09k|  }
  792|  9.09k|  return matched;
  793|  9.50k|}

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  19.7k|  static constexpr auto tagList() {
   30|  19.7k|    return tagInfo_;
   31|  19.7k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|    828|  static constexpr auto tagListCs() {
   34|    828|    return tagInfoCs_;
   35|    828|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    353|  static constexpr auto tagListCs2() {
   38|    353|    return tagInfoCs2_;
   39|    353|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  19.0k|  static constexpr auto tagListFp() {
   42|  19.0k|    return tagInfoFp_;
   43|  19.0k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|    646|  static constexpr auto tagListSonyMisc1() {
   46|    646|    return tagInfoSonyMisc1_;
   47|    646|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|    246|  static constexpr auto tagListSonyMisc2b() {
   50|    246|    return tagInfoSonyMisc2b_;
   51|    246|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  12.5k|  static constexpr auto tagListSonyMisc3c() {
   54|  12.5k|    return tagInfoSonyMisc3c_;
   55|  12.5k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   608k|  static constexpr auto tagListSonySInfo1() {
   58|   608k|    return tagInfoSonySInfo1_;
   59|   608k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  1.96M|const TagInfo* ifdTagList() {
 1779|  1.96M|  return ifdTagInfo;
 1780|  1.96M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   265k|const TagInfo* exifTagList() {
 2217|   265k|  return exifTagInfo;
 2218|   265k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   143k|const TagInfo* gpsTagList() {
 2433|   143k|  return gpsTagInfo;
 2434|   143k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|  75.2k|const TagInfo* iopTagList() {
 2508|  75.2k|  return iopTagInfo;
 2509|  75.2k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  17.9k|const TagInfo* mnTagList() {
 2524|  17.9k|  return mnTagInfo;
 2525|  17.9k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.06M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.06M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.06M, False: 0]
  ------------------
 2529|  1.06M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.06M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  2.95M|bool isExifIfd(IfdId ifdId) {
 2534|  2.95M|  switch (ifdId) {
 2535|   441k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 441k, False: 2.51M]
  ------------------
 2536|   581k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 140k, False: 2.81M]
  ------------------
 2537|   667k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 86.4k, False: 2.87M]
  ------------------
 2538|   739k|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 71.2k, False: 2.88M]
  ------------------
 2539|   794k|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 55.8k, False: 2.90M]
  ------------------
 2540|   813k|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 18.8k, False: 2.93M]
  ------------------
 2541|   814k|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 1.11k, False: 2.95M]
  ------------------
 2542|   814k|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 2.95M]
  ------------------
 2543|  1.14M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 331k, False: 2.62M]
  ------------------
 2544|  1.36M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 218k, False: 2.73M]
  ------------------
 2545|  1.50M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 137k, False: 2.82M]
  ------------------
 2546|  1.62M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 118k, False: 2.83M]
  ------------------
 2547|  1.63M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 15.8k, False: 2.94M]
  ------------------
 2548|  1.64M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 9.88k, False: 2.94M]
  ------------------
 2549|  1.66M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 16.8k, False: 2.94M]
  ------------------
 2550|  1.66M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 6.59k, False: 2.95M]
  ------------------
 2551|  1.67M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 9.52k, False: 2.94M]
  ------------------
 2552|  1.70M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 23.4k, False: 2.93M]
  ------------------
 2553|  1.88M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 186k, False: 2.77M]
  ------------------
 2554|  1.88M|      return true;
 2555|  1.06M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.06M, False: 1.88M]
  ------------------
 2556|  1.06M|      return false;
 2557|  2.95M|  }
 2558|  2.95M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  3.90M|const TagInfo* tagList(IfdId ifdId) {
 2569|  3.90M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 3.90M, False: 0]
  ------------------
 2570|  3.90M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 3.90M, False: 0]
  ------------------
 2571|  3.90M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  3.90M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  2.95M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  2.95M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 2.95M, False: 0]
  ------------------
 2577|  2.95M|    int idx = 0;
 2578|   253M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 251M, False: 1.74M]
  ------------------
 2579|   251M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.21M, False: 250M]
  ------------------
 2580|  1.21M|        break;
 2581|   251M|    }
 2582|  2.95M|    return ti + idx;
 2583|  2.95M|  }
 2584|      0|  return nullptr;
 2585|  2.95M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|   946k|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|   946k|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 946k]
  ------------------
 2589|      0|    return nullptr;
 2590|   946k|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 946k, False: 0]
  ------------------
 2591|  57.3M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 57.2M, False: 89.3k]
  ------------------
 2592|  57.2M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 857k, False: 56.3M]
  ------------------
 2593|   857k|        return ti + idx;
 2594|   857k|      }
 2595|  57.2M|    }
 2596|   946k|  }
 2597|  89.3k|  return nullptr;
 2598|   946k|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  5.70M|IfdId groupId(const std::string& groupName) {
 2601|  5.70M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 5.70M, False: 0]
  ------------------
 2602|  5.70M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  5.70M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  1.98M|const char* groupName(IfdId ifdId) {
 2613|  1.98M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 1.98M, False: 0]
  ------------------
 2614|  1.98M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  1.98M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    228|float fnumber(float apertureValue) {
 2648|    228|  float result = std::exp2(apertureValue / 2.F);
 2649|    228|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 10, False: 218]
  ------------------
 2650|     10|    result = 3.5F;
 2651|     10|  }
 2652|    228|  return result;
 2653|    228|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    228|URational exposureTime(float shutterSpeedValue) {
 2656|    228|  URational ur(1, 1);
 2657|    228|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    228|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 100, False: 128]
  ------------------
 2659|    100|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    100|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 41, False: 59]
  ------------------
 2662|     41|      ur.second = static_cast<uint32_t>(x);
 2663|     41|    }
 2664|    128|  } else {
 2665|    128|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    128|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 128, False: 0]
  |  Branch (2667:19): [True: 128, False: 0]
  ------------------
 2668|    128|      ur.first = static_cast<uint32_t>(x);
 2669|    128|    }
 2670|    128|  }
 2671|    228|  return ur;
 2672|    228|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|   946k|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|   946k|  auto ti = tagInfo(tagName, ifdId);
 2676|   946k|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 857k, False: 89.3k]
  |  Branch (2676:13): [True: 857k, False: 0]
  ------------------
 2677|   857k|    return ti->tag_;
 2678|  89.3k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 89.3k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|  89.3k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|  89.3k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  6.51k|const TagInfo* tagList(const std::string& groupName) {
 3295|  6.51k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  6.51k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 6.51k]
  |  Branch (3296:14): [True: 0, False: 6.51k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  6.51k|  return ii->tagList_();
 3300|  6.51k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  23.1M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  23.1M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 23.1M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 4.64M, False: 18.5M]
  |  Branch (42:86): [True: 19.3k, False: 18.5M]
  ------------------
   43|  4.66M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 10.8k, False: 4.65M]
  ------------------
   44|  23.1M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  20.5k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  20.5k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 6.59k, False: 13.9k]
  |  Branch (48:20): [True: 0, False: 13.9k]
  ------------------
   49|  6.59k|    wroteHeader_ = true;
   50|  20.5k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  3.96M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  3.96M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 13.7k, False: 3.95M]
  |  Branch (53:24): [True: 13.7k, False: 0]
  ------------------
   54|  13.7k|    io_.write(pHeader_, size_);
   55|  13.7k|    wroteHeader_ = true;
   56|  13.7k|  }
   57|  3.96M|  return io_.write(pData, wcount);
   58|  3.96M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  45.8k|int IoWrapper::putb(byte data) {
   61|  45.8k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 45.8k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  45.8k|  return io_.putb(data);
   66|  45.8k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     48|void IoWrapper::setTarget(int id, size_t target) {
   69|     48|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 48]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     48|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 15, False: 33]
  ------------------
   73|     15|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     48|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   136k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   136k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  47.8k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  47.8k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  15.3k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  15.3k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  15.3k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  26.6k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  26.6k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  6.18k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  6.18k|    cfgSelFct_(cfgSelFct),
   99|  6.18k|    arraySet_(arraySet),
  100|  6.18k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  6.18k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  7.07M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  7.07M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  7.11M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  41.9k|    TiffComponent(rhs),
  125|  41.9k|    tiffType_(rhs.tiffType_),
  126|  41.9k|    count_(rhs.count_),
  127|  41.9k|    offset_(rhs.offset_),
  128|  41.9k|    size_(rhs.size_),
  129|  41.9k|    pData_(rhs.pData_),
  130|  41.9k|    idx_(rhs.idx_),
  131|  41.9k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 22.8k, False: 19.1k]
  ------------------
  132|  41.9k|    storage_(rhs.storage_) {
  133|  41.9k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    288|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    288|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|  91.8k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|  91.8k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|  91.2k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|  91.2k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  35.5k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  35.5k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  35.5k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  41.9k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  41.9k|  return UniquePtr(doClone());
  159|  41.9k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  34.7k|TiffEntry* TiffEntry::doClone() const {
  162|  34.7k|  return new TiffEntry(*this);
  163|  34.7k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    434|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    434|  return new TiffDataEntry(*this);
  167|    434|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  2.44k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  2.44k|  return new TiffImageEntry(*this);
  171|  2.44k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  4.05k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  4.05k|  return new TiffSizeEntry(*this);
  175|  4.05k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    288|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    288|  return new TiffSubIfd(*this);
  183|    288|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  17.0M|int TiffEntryBase::idx() const {
  206|  17.0M|  return idx_;
  207|  17.0M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|   785k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|   785k|  storage_ = std::move(buf);
  211|   785k|  pData_ = storage_->data();
  212|   785k|  size_ = storage_->size();
  213|   785k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  2.78M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  2.78M|  pData_ = pData;
  217|  2.78M|  size_ = size;
  218|  2.78M|  storage_ = std::move(storage);
  219|  2.78M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 2.78M]
  ------------------
  220|      0|    size_ = 0;
  221|  2.78M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  2.69M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  2.69M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 2.69M]
  ------------------
  225|      0|    return;
  226|  2.69M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 784k, False: 1.91M]
  ------------------
  227|   784k|    auto d = std::make_shared<DataBuf>(newSize);
  228|   784k|    setData(std::move(d));
  229|   784k|  }
  230|  2.69M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 816k, False: 1.88M]
  ------------------
  231|   816k|    memset(pData_, 0x0, size_);
  232|   816k|  }
  233|  2.69M|  size_ = value->copy(pData_, byteOrder);
  234|  2.69M|  setValue(std::move(value));
  235|  2.69M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  5.55M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  5.55M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 5.55M]
  ------------------
  239|      0|    return;
  240|  5.55M|  tiffType_ = toTiffType(value->typeId());
  241|  5.55M|  count_ = value->count();
  242|  5.55M|  pValue_ = std::move(value);
  243|  5.55M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  13.9k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  13.9k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 375, False: 13.5k]
  |  Branch (246:20): [True: 298, False: 13.2k]
  ------------------
  247|    673|#ifndef SUPPRESS_WARNINGS
  248|    673|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    673|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 673]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    673|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|    673|#endif
  251|    673|    return;
  252|    673|  }
  253|  13.2k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 2.14k, False: 11.1k]
  ------------------
  254|  2.14k|#ifndef SUPPRESS_WARNINGS
  255|  2.14k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.14k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.14k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.14k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  2.14k|#endif
  258|  2.14k|    return;
  259|  2.14k|  }
  260|  11.1k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.70k, False: 9.40k]
  ------------------
  261|  1.70k|#ifndef SUPPRESS_WARNINGS
  262|  1.70k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.70k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.70k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.70k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.70k|#endif
  266|  1.70k|    return;
  267|  1.70k|  }
  268|  9.40k|  size_t size = 0;
  269|  22.1k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 12.7k, False: 9.40k]
  ------------------
  270|  12.7k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  12.7k|  }
  272|  9.40k|  const size_t offset = pValue()->toUint32(0);
  273|  9.40k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 292, False: 9.11k]
  |  Branch (273:26): [True: 923, False: 8.18k]
  |  Branch (273:54): [True: 13, False: 8.17k]
  ------------------
  274|  1.22k|#ifndef SUPPRESS_WARNINGS
  275|  1.22k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.22k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.22k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.22k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.22k|#endif
  278|  1.22k|    return;
  279|  1.22k|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  8.17k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 256, False: 7.92k]
  ------------------
  283|    256|#ifndef SUPPRESS_WARNINGS
  284|    256|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    256|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 256]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    256|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    256|#endif
  287|    256|    return;
  288|    256|  }
  289|  7.92k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  7.92k|  sizeDataArea_ = size;
  291|  7.92k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  7.92k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  55.9k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  55.9k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 3.10k, False: 52.8k]
  |  Branch (295:20): [True: 2.25k, False: 50.5k]
  ------------------
  296|  5.35k|#ifndef SUPPRESS_WARNINGS
  297|  5.35k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  5.35k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.35k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.35k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  5.35k|#endif
  300|  5.35k|    return;
  301|  5.35k|  }
  302|  50.5k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 15.8k, False: 34.6k]
  ------------------
  303|  15.8k|#ifndef SUPPRESS_WARNINGS
  304|  15.8k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  15.8k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 15.8k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  15.8k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  15.8k|#endif
  308|  15.8k|    return;
  309|  15.8k|  }
  310|  4.44M|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 4.40M, False: 34.6k]
  ------------------
  311|  4.40M|    const size_t offset = pValue()->toUint32(i);
  312|  4.40M|    const size_t size = pSize->toUint32(i);
  313|       |
  314|  4.40M|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 25.3k, False: 4.38M]
  |  Branch (314:28): [True: 65.7k, False: 4.31M]
  |  Branch (314:56): [True: 37, False: 4.31M]
  ------------------
  315|  91.0k|#ifndef SUPPRESS_WARNINGS
  316|  91.0k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  91.0k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 91.0k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  91.0k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|  91.0k|#endif
  319|  4.31M|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 3.97M, False: 341k]
  ------------------
  320|  3.97M|      const byte* pStrip = pData + baseOffset + offset;
  321|  3.97M|      strips_.emplace_back(pStrip, size);
  322|  3.97M|    }
  323|  4.40M|  }
  324|  34.6k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  6.68k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  6.68k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 2.65k, False: 4.03k]
  ------------------
  328|  2.65k|    return 0;
  329|  4.03k|  return pHeader_->ifdOffset();
  330|  6.68k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  27.0k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  27.0k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 6.10k, False: 20.9k]
  |  Branch (333:20): [True: 18.4k, False: 2.54k]
  ------------------
  334|  24.5k|    return imageByteOrder_;
  335|  24.5k|  }
  336|  2.54k|  return pHeader_->byteOrder();
  337|  27.0k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  3.85k|size_t TiffIfdMakernote::mnOffset() const {
  340|  3.85k|  return mnOffset_;
  341|  3.85k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  14.5k|size_t TiffIfdMakernote::baseOffset() const {
  344|  14.5k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.31k, False: 11.2k]
  ------------------
  345|  3.31k|    return 0;
  346|  11.2k|  return pHeader_->baseOffset(mnOffset_);
  347|  14.5k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  7.44k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  7.44k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 2.65k, False: 4.78k]
  ------------------
  351|  2.65k|    return true;
  352|  4.78k|  return pHeader_->read(pData, size, byteOrder);
  353|  7.44k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  6.46k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  6.46k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 5.81k, False: 659]
  ------------------
  357|  5.81k|    pHeader_->setByteOrder(byteOrder);
  358|  6.46k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  65.9k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  65.9k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 6.58k, False: 59.3k]
  ------------------
  362|  6.58k|    return 0;
  363|  59.3k|  return pHeader_->size();
  364|  65.9k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  7.85k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  7.85k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 654, False: 7.20k]
  ------------------
  368|    654|    return 0;
  369|  7.20k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  7.85k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  4.28M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  4.28M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  4.28M|  return count_ * TypeInfo::typeSize(typeId);
  375|  4.28M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.32M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.32M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.32M, False: 328]
  ------------------
  379|  1.32M|    return true;  // Not a complex array or already initialized
  380|       |
  381|    830|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 830, False: 0]
  ------------------
  382|    830|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 328, False: 502]
  ------------------
  383|    328|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    328|      arrayDef_ = arraySet_[idx].def_;
  385|    328|      defSize_ = arraySet_[idx].defSize_;
  386|    328|      return true;
  387|    328|    }
  388|    830|  }
  389|      0|  return false;
  390|    328|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  3.94k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  3.94k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.21k, False: 1.73k]
  ------------------
  394|  2.21k|    return true;  // Not a complex array
  395|       |
  396|  1.73k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  1.73k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.10k, False: 625]
  ------------------
  398|  1.10k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.10k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.10k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.10k|  }
  402|  1.73k|  return idx > -1;
  403|  3.94k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  12.3k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  12.3k|  origData_ = const_cast<byte*>(pData());
  407|  12.3k|  origSize_ = TiffEntryBase::doSize();
  408|  12.3k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     61|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     61|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 61]
  ------------------
  412|      0|    return false;
  413|     61|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 27, False: 34]
  ------------------
  414|     27|    return true;
  415|     34|  std::memcpy(origData_, pData, origSize_);
  416|     34|  return true;
  417|     61|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  1.30M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  1.30M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  1.30M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  1.30M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  1.30M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  1.30M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 1.30M]
  ------------------
  425|      0|    return 0;
  426|       |  // The assertion typically fails if a component is not configured in
  427|       |  // the TIFF structure table (TiffCreator::tiffTreeStruct_)
  428|  1.30M|  tp->setStart(pData() + idx);
  429|  1.30M|  auto s = storage();
  430|  1.30M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  1.30M|  tp->setElDef(def);
  432|  1.30M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  1.30M|  addChild(std::move(tc));
  434|  1.30M|  return sz;
  435|  1.30M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  16.6M|                                      TiffComponent::UniquePtr object) {
  439|  16.6M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  16.6M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  2.70M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  2.70M|  return this;
  445|  2.70M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  6.72M|                                        TiffComponent::UniquePtr object) {
  449|  6.72M|  tiffPath.pop();
  450|  6.72M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  6.72M|  TiffComponent* tc = nullptr;
  453|       |  // Try to use an existing component if there is still at least one
  454|       |  // composite tag on the stack or the tag to add is the MakerNote tag.
  455|       |  // This is used to prevent duplicate entries. Sub-IFDs also, but the > 1
  456|       |  // condition takes care of them, see below.
  457|  6.72M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 5.30M, False: 1.42M]
  |  Branch (457:31): [True: 1.26k, False: 1.42M]
  |  Branch (457:62): [True: 1.03k, False: 228]
  ------------------
  458|  5.30M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 38.9k, False: 5.26M]
  ------------------
  459|  38.9k|      tc = pNext_.get();
  460|  5.26M|    } else {
  461|  41.2M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 41.2M, False: 21.9k]
  ------------------
  462|  41.2M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 5.26M, False: 35.9M]
  |  Branch (462:46): [True: 5.24M, False: 15.5k]
  ------------------
  463|  5.24M|          tc = component.get();
  464|  5.24M|          break;
  465|  5.24M|        }
  466|  41.2M|      }
  467|  5.26M|    }
  468|  5.30M|  }
  469|       |
  470|  6.72M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 5.28M, False: 1.44M]
  ------------------
  471|  5.28M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.44M|  auto atc = [&] {
  474|  1.44M|    if (tiffPath.size() == 1 && object) {
  475|  1.44M|      return std::move(object);
  476|  1.44M|    }
  477|  1.44M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.44M|  }();
  479|       |
  480|       |  // Prevent dangling sub-IFD tags: Do not add a sub-IFD component without children.
  481|       |  // Todo: How to check before creating the component?
  482|  1.44M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.42M, False: 22.7k]
  |  Branch (482:31): [True: 19.1k, False: 1.40M]
  ------------------
  483|  19.1k|    return nullptr;
  484|       |
  485|  1.42M|  tc = [&] {
  486|  1.42M|    if (tpi.extendedTag() == Tag::next)
  487|  1.42M|      return this->addNext(std::move(atc));
  488|  1.42M|    return this->addChild(std::move(atc));
  489|  1.42M|  }();
  490|  1.42M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.44M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  2.02M|                                     TiffComponent::UniquePtr object) {
  495|  2.02M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  2.02M|  tiffPath.pop();
  497|  2.02M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.02M]
  ------------------
  498|       |    // If the last element in the path is the sub-IFD tag itself we're done.
  499|       |    // But that shouldn't happen - see TiffDirectory::doAddPath
  500|      0|    return this;
  501|      0|  }
  502|  2.02M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  2.02M|  tiffPath.push(tpi1);
  504|  2.02M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.22M, False: 11.5k]
  ------------------
  505|  2.22M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 2.01M, False: 202k]
  ------------------
  506|  2.01M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  11.5k|  auto tc = [&] {
  509|  11.5k|    if (tiffPath.size() == 1 && object) {
  510|  11.5k|      return addChild(std::move(object));
  511|  11.5k|    }
  512|  11.5k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  11.5k|  }();
  514|  11.5k|  setCount(ifds_.size());
  515|  11.5k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  2.02M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  1.92M|                                      TiffComponent::UniquePtr object) {
  520|  1.92M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  1.92M|  tiffPath.pop();
  522|  1.92M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 11.8k, False: 1.90M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  11.8k|    return this;
  525|  11.8k|  }
  526|  1.90M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  1.90M|  tiffPath.push(tpi1);
  528|  1.90M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 7.91k, False: 1.90M]
  ------------------
  529|  7.91k|    mnGroup_ = tpi2.group();
  530|  7.91k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  7.91k|  }
  532|  1.90M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  1.92M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  1.90M|                                           TiffComponent::UniquePtr object) {
  537|  1.90M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  1.90M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.34M|                                          TiffComponent::UniquePtr object) {
  542|  1.34M|  pRoot_ = pRoot;
  543|  1.34M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 13.8k, False: 1.32M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  13.8k|    return this;
  546|  13.8k|  }
  547|  1.32M|  tiffPath.pop();
  548|  1.32M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.32M|  initialize(tpi.group());
  551|       |  // Todo: Duplicates are not allowed!
  552|       |  // To allow duplicate entries, we only check if the new component already
  553|       |  // exists if there is still at least one composite tag on the stack
  554|  1.32M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.32M]
  ------------------
  555|      0|    for (const auto& element : elements_)
  ------------------
  |  Branch (555:30): [True: 0, False: 0]
  ------------------
  556|      0|      if (element->tag() == tpi.tag() && element->group() == tpi.group())
  ------------------
  |  Branch (556:11): [True: 0, False: 0]
  |  Branch (556:42): [True: 0, False: 0]
  ------------------
  557|      0|        return element->addPath(tag, tiffPath, pRoot, std::move(object));
  558|      0|  }
  559|       |
  560|  1.32M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.32M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.32M]
  ------------------
  561|      0|    auto tc = addChild(std::move(object));
  562|      0|    setCount(elements_.size());
  563|      0|    return tc->addPath(tag, tiffPath, pRoot, nullptr);
  564|      0|  }
  565|       |
  566|  1.32M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.32M|  setCount(elements_.size());
  568|  1.32M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.32M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  7.17M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  7.17M|  return doAddChild(std::move(tiffComponent));
  573|  7.17M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  4.46M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  4.46M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  4.46M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|  79.8k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|  79.8k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|  79.8k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 79.8k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|  79.8k|  return ifds_.emplace_back(std::move(d)).get();
  589|  79.8k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  2.63M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  2.63M|  setDecoded(true);
  604|  2.63M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  2.63M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  3.17k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  3.17k|  return doAddNext(std::move(tiffComponent));
  609|  3.17k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  3.17k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  3.17k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 3.17k, False: 0]
  ------------------
  617|  3.17k|    pNext_ = std::move(tiffComponent);
  618|  3.17k|    return pNext_.get();
  619|  3.17k|  }
  620|      0|  return nullptr;
  621|  3.17k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  51.1M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  51.1M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 51.1M, False: 13.4k]
  ------------------
  636|  51.1M|    doAccept(visitor);  // one for NVI :)
  637|  51.1M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  32.0M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  32.0M|  visitor.visitEntry(this);
  641|  32.0M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   363k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   363k|  visitor.visitDataEntry(this);
  645|   363k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  2.06M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  2.06M|  visitor.visitImageEntry(this);
  649|  2.06M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.34M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.34M|  visitor.visitSizeEntry(this);
  653|  2.34M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  1.48M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  1.48M|  visitor.visitDirectory(this);
  657|  38.0M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 38.0M, False: 1.23M]
  ------------------
  658|  38.0M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 249k, False: 37.7M]
  ------------------
  659|   249k|      break;
  660|  37.7M|    component->accept(visitor);
  661|  37.7M|  }
  662|  1.48M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.21M, False: 262k]
  ------------------
  663|  1.21M|    visitor.visitDirectoryNext(this);
  664|  1.48M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 52.1k, False: 1.42M]
  ------------------
  665|  52.1k|    pNext_->accept(visitor);
  666|  1.48M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.19M, False: 282k]
  ------------------
  667|  1.19M|    visitor.visitDirectoryEnd(this);
  668|  1.48M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   271k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   271k|  visitor.visitSubIfd(this);
  672|  1.09M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 1.09M, False: 213k]
  ------------------
  673|  1.09M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 57.7k, False: 1.04M]
  ------------------
  674|  57.7k|      break;
  675|  1.04M|    ifd->accept(visitor);
  676|  1.04M|  }
  677|   271k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   201k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   201k|  visitor.visitMnEntry(this);
  681|   201k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 79.6k, False: 121k]
  ------------------
  682|  79.6k|    mn_->accept(visitor);
  683|   201k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.65k, False: 199k]
  ------------------
  684|  1.65k|    mn_ = nullptr;
  685|  1.65k|  }
  686|       |
  687|   201k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  73.1k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  73.1k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 73.1k, False: 0]
  ------------------
  691|  73.1k|    visitor.visitIfdMakernote(this);
  692|  73.1k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 72.2k, False: 935]
  ------------------
  693|  72.2k|    ifd_.accept(visitor);
  694|  73.1k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 72.2k, False: 935]
  |  Branch (694:52): [True: 56.6k, False: 15.5k]
  ------------------
  695|  56.6k|    visitor.visitIfdMakernoteEnd(this);
  696|  73.1k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   149k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   149k|  visitor.visitBinaryArray(this);
  700|  11.7M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 11.7M, False: 149k]
  ------------------
  701|  11.7M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 761, False: 11.7M]
  ------------------
  702|    761|      break;
  703|  11.7M|    element->accept(visitor);
  704|  11.7M|  }
  705|   149k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 138k, False: 11.3k]
  ------------------
  706|   138k|    visitor.visitBinaryArrayEnd(this);
  707|   149k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  12.0M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  12.0M|  visitor.visitBinaryElement(this);
  711|  12.0M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  2.73M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  2.73M|  doEncode(encoder, datum);
  715|  2.73M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.33M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.33M|  encoder.encodeBinaryElement(this, datum);
  719|  1.33M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  14.2k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  14.2k|  encoder.encodeBinaryArray(this, datum);
  723|  14.2k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  8.40k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  8.40k|  encoder.encodeDataEntry(this, datum);
  727|  8.40k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.31M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.31M|  encoder.encodeTiffEntry(this, datum);
  731|  1.31M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  17.3k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  17.3k|  encoder.encodeImageEntry(this, datum);
  735|  17.3k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  12.4k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  12.4k|  encoder.encodeMnEntry(this, datum);
  739|  12.4k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  23.7k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  23.7k|  encoder.encodeSizeEntry(this, datum);
  743|  23.7k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  1.53k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  1.53k|  encoder.encodeSubIfd(this, datum);
  747|  1.53k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  1.68M|size_t TiffComponent::count() const {
  750|  1.68M|  return doCount();
  751|  1.68M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   155k|size_t TiffDirectory::doCount() const {
  754|   155k|  return components_.size();
  755|   155k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.51M|size_t TiffEntryBase::doCount() const {
  758|  1.51M|  return count_;
  759|  1.51M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  17.7k|size_t TiffMnEntry::doCount() const {
  762|  17.7k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 9.66k, False: 8.12k]
  ------------------
  763|  9.66k|    return TiffEntryBase::doCount();
  764|  9.66k|  }
  765|  8.12k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  8.12k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 1.69k, False: 6.43k]
  |  Branch (768:36): [True: 1.52k, False: 165]
  |  Branch (768:68): [True: 1.46k, False: 61]
  ------------------
  769|  1.46k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  1.46k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.46k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.46k|  LogMsg(LogMsg::error).os()
  ------------------
                  EXV_ERROR << stringFormat(
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  770|      0|        "Makernote entry 0x{:04x} has incorrect Exif (TIFF) type {}. (Expected signed or unsigned byte.)\n", tag(),
  771|      0|        static_cast<uint16_t>(tiffType()));
  772|  1.46k|  }
  773|  8.12k|#endif
  774|  8.12k|  return mn_->size();
  775|  17.7k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  20.6k|size_t TiffBinaryArray::doCount() const {
  782|  20.6k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 3.15k, False: 17.4k]
  |  Branch (782:17): [True: 10.7k, False: 6.65k]
  ------------------
  783|  13.9k|    return TiffEntryBase::doCount();
  784|       |
  785|  6.65k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 6.65k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  6.65k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  6.65k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  6.65k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 45, False: 6.60k]
  ------------------
  791|     45|#ifndef SUPPRESS_WARNINGS
  792|     45|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|     45|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 45]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     45|  LogMsg(LogMsg::warn).os()
  ------------------
                  EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
  793|      0|                                groupName(group()), tag(), static_cast<uint16_t>(tiffType()));
  794|     45|#endif
  795|     45|    typeSize = 1;
  796|     45|  }
  797|       |
  798|  6.65k|  return size() / typeSize;
  799|  6.65k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|  1.41k|size_t TiffBinaryElement::doCount() const {
  802|  1.41k|  return elDef_.count_;
  803|  1.41k|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  2.77M|                            size_t& imageIdx) {
  807|  2.77M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  2.77M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  34.0k|                              size_t& imageIdx) {
  812|  34.0k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  34.0k|  const size_t compCount = count();
  816|  34.0k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 34.0k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  34.0k|  size_t sizeNext = 0;
  821|  34.0k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 928, False: 33.0k]
  ------------------
  822|    928|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  34.0k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 593, False: 33.4k]
  |  Branch (825:25): [True: 188, False: 405]
  ------------------
  826|    188|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  33.8k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 48, False: 33.7k]
  ------------------
  830|       |#ifdef EXIV2_DEBUG_MESSAGES
  831|       |    std::cerr << "Directory " << groupName(group()) << " offset is 0x" << std::setw(8) << std::setfill('0') << std::hex
  832|       |              << offset << std::dec << "\n";
  833|       |#endif
  834|     48|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     48|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  33.8k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 33.6k, False: 167]
  ------------------
  838|       |
  839|       |  // TIFF standard requires IFD entries to be sorted in ascending order by tag.
  840|       |  // Not sorting makernote directories sometimes preserves them better.
  841|  33.8k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 24.9k, False: 8.83k]
  ------------------
  842|  24.9k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  24.9k|  }
  844|       |  // Size of IFD values and additional data
  845|  33.8k|  size_t sizeValue = 0;
  846|  33.8k|  size_t sizeData = 0;
  847|  1.41M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.41M, False: 33.8k]
  ------------------
  848|  1.41M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 82.5k, False: 1.33M]
  ------------------
  849|  82.5k|      sv += sv & 1;  // Align value to word boundary
  850|  82.5k|      sizeValue += sv;
  851|  82.5k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.41M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 695k, False: 718k]
  ------------------
  854|   695k|      auto sd = component->sizeData();
  855|   695k|      sd += sd & 1;  // Align data to word boundary
  856|   695k|      sizeData += sd;
  857|   695k|    }
  858|  1.41M|  }
  859|       |
  860|  33.8k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  33.8k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  33.8k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  33.8k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 13.7k, False: 20.0k]
  ------------------
  864|  13.7k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  13.7k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  13.7k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  33.8k|  byte buf[4];
  870|  33.8k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  33.8k|  ioWrapper.write(buf, 2);
  872|  33.8k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.40M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.40M, False: 33.8k]
  ------------------
  875|  1.40M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.40M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 82.0k, False: 1.32M]
  ------------------
  877|  82.0k|      sv += sv & 1;  // Align value to word boundary
  878|  82.0k|      valueIdx += sv;
  879|  82.0k|    }
  880|  1.40M|    auto sd = component->sizeData();
  881|  1.40M|    sd += sd & 1;  // Align data to word boundary
  882|  1.40M|    dataIdx += sd;
  883|  1.40M|  }
  884|       |  // c) Pointer to the next IFD
  885|  33.8k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 33.4k, False: 332]
  ------------------
  886|  33.4k|    memset(buf, 0x0, 4);
  887|  33.4k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 927, False: 32.5k]
  |  Branch (887:19): [True: 926, False: 1]
  ------------------
  888|    926|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|    926|    }
  890|  33.4k|    ioWrapper.write(buf, 4);
  891|  33.4k|    idx += 4;
  892|  33.4k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  33.8k|  valueIdx = sizeDir;
  896|  33.8k|  dataIdx = sizeDir + sizeValue;
  897|  1.39M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.39M, False: 33.8k]
  ------------------
  898|  1.39M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 80.2k, False: 1.31M]
  ------------------
  899|  80.2k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  80.2k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  80.2k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 14.0k, False: 66.2k]
  ------------------
  902|  14.0k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  14.0k|        sv += 1;
  904|  14.0k|      }
  905|  80.2k|      idx += sv;
  906|  80.2k|      valueIdx += sv;
  907|  80.2k|    }
  908|  1.39M|    auto sd = component->sizeData();
  909|  1.39M|    sd += sd & 1;  // Align data to word boundary
  910|  1.39M|    dataIdx += sd;
  911|  1.39M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  33.8k|  dataIdx = sizeDir + sizeValue;
  915|  33.8k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  33.8k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 909, False: 32.9k]
  |  Branch (918:17): [True: 908, False: 1]
  ------------------
  919|    908|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|    908|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  33.8k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 13.3k, False: 20.5k]
  ------------------
  924|  13.3k|    idx += writeImage(ioWrapper, byteOrder);
  925|  13.3k|  }
  926|       |
  927|  33.8k|  return idx;
  928|  34.0k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.40M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.40M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.40M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.40M]
  ------------------
  934|      0|    return 0;
  935|  1.40M|  byte buf[8];
  936|  1.40M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.40M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.40M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.40M|  ioWrapper.write(buf, 8);
  940|  1.40M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 82.0k, False: 1.32M]
  ------------------
  941|  82.0k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  82.0k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  82.0k|    ioWrapper.write(buf, 4);
  944|  1.32M|  } else {
  945|  1.32M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.32M|#ifndef SUPPRESS_WARNINGS
  947|  1.32M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 100, False: 1.32M]
  ------------------
  948|    100|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|    100|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 100]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    100|  LogMsg(LogMsg::error).os()
  ------------------
  949|    100|    }
  950|  1.32M|#endif
  951|  1.32M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.30M, False: 18.1k]
  ------------------
  952|  1.30M|      memset(buf, 0x0, 4);
  953|  1.30M|      ioWrapper.write(buf, 4 - len);
  954|  1.30M|    }
  955|  1.32M|  }
  956|  1.40M|  return 12;
  957|  1.40M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.36M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.36M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 18.1k, False: 1.34M]
  |  Branch (961:19): [True: 1.25M, False: 93.8k]
  ------------------
  962|  1.26M|    return 0;
  963|       |
  964|  93.8k|  DataBuf buf(pValue_->size());
  965|  93.8k|  pValue_->copy(buf.data(), byteOrder);
  966|  93.8k|  ioWrapper.write(buf.c_data(), buf.size());
  967|  93.8k|  return buf.size();
  968|  1.36M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  77.7k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  77.7k|  size_t rc = 0;
  972|  77.7k|  switch (tiffType) {
  973|  3.17k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 3.17k, False: 74.5k]
  ------------------
  974|  7.42k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 4.25k, False: 73.4k]
  ------------------
  975|  7.42k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 16, False: 7.41k]
  ------------------
  976|     16|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  7.41k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  7.41k|      break;
  979|  67.4k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 67.4k, False: 10.2k]
  ------------------
  980|  69.9k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 2.49k, False: 75.2k]
  ------------------
  981|  69.9k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  982|  69.9k|      break;
  983|    353|    default:
  ------------------
  |  Branch (983:5): [True: 353, False: 77.3k]
  ------------------
  984|    353|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  985|  77.7k|  }
  986|  77.3k|  return rc;
  987|  77.7k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  990|  5.72k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  991|  5.72k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (991:7): [True: 52, False: 5.67k]
  |  Branch (991:20): [True: 3.99k, False: 1.67k]
  ------------------
  992|  4.05k|    return 0;
  993|       |
  994|  1.67k|  DataBuf buf(pValue()->size());
  995|  1.67k|  size_t idx = 0;
  996|  1.67k|  const size_t prevOffset = pValue()->toUint32(0);
  997|  4.25k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (997:22): [True: 2.57k, False: 1.67k]
  ------------------
  998|  2.57k|    const size_t iOffset = pValue()->toUint32(i);
  999|  2.57k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1000|  2.57k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1001|  2.57k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1002|  2.57k|  }
 1003|  1.67k|  ioWrapper.write(buf.c_data(), buf.size());
 1004|  1.67k|  return buf.size();
 1005|  5.72k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1008|  17.2k|                               size_t dataIdx, size_t& imageIdx) {
 1009|  17.2k|  size_t o2 = imageIdx;
 1010|       |  // For makernotes, write TIFF image data to the data area
 1011|  17.2k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1011:7): [True: 352, False: 16.9k]
  ------------------
 1012|    352|    o2 = Safe::add<size_t>(offset, dataIdx);
 1013|       |#ifdef EXIV2_DEBUG_MESSAGES
 1014|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1015|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1016|       |#endif
 1017|  17.2k|  DataBuf buf(strips_.size() * 4);
 1018|  17.2k|  size_t idx = 0;
 1019|  63.6k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1019:29): [True: 63.6k, False: 17.2k]
  ------------------
 1020|  63.6k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1021|       |    // Align strip data to word boundary
 1022|  63.6k|    const auto sz = Safe::add(off, off & 1);
 1023|  63.6k|    o2 = Safe::add(o2, sz);
 1024|  63.6k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1024:9): [True: 62.3k, False: 1.32k]
  ------------------
 1025|  62.3k|      imageIdx = Safe::add(imageIdx, sz);
 1026|  63.6k|  }
 1027|  17.2k|  ioWrapper.write(buf.c_data(), buf.size());
 1028|  17.2k|  return buf.size();
 1029|  17.2k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1032|  8.74k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1033|  8.74k|  DataBuf buf(ifds_.size() * 4);
 1034|  8.74k|  size_t idx = 0;
 1035|       |  // Sort IFDs by group, needed if image data tags were copied first
 1036|  8.74k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1037|  11.5k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1037:19): [True: 11.5k, False: 8.74k]
  ------------------
 1038|  11.5k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1039|  11.5k|    dataIdx += ifd->size();
 1040|  11.5k|  }
 1041|  8.74k|  ioWrapper.write(buf.c_data(), buf.size());
 1042|  8.74k|  return buf.size();
 1043|  8.74k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1046|  17.2k|                            size_t& imageIdx) {
 1047|  17.2k|  if (!mn_) {
  ------------------
  |  Branch (1047:7): [True: 9.37k, False: 7.85k]
  ------------------
 1048|  9.37k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1049|  9.37k|  }
 1050|  7.85k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1051|  17.2k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1054|  7.85k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1055|  7.85k|  mnOffset_ = offset;
 1056|  7.85k|  setImageByteOrder(byteOrder);
 1057|  7.85k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1058|  7.85k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1059|  7.85k|                    imageIdx);
 1060|  7.85k|  return len;
 1061|  7.85k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1064|  20.3k|                                size_t dataIdx, size_t& imageIdx) {
 1065|  20.3k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1065:7): [True: 3.11k, False: 17.2k]
  |  Branch (1065:17): [True: 10.6k, False: 6.59k]
  ------------------
 1066|  13.7k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1067|  6.59k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1067:7): [True: 871, False: 5.72k]
  ------------------
 1068|    871|    byteOrder = cfg()->byteOrder_;
 1069|       |  // Tags must be sorted in ascending order
 1070|  6.59k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1071|  6.59k|  size_t idx = 0;
 1072|  6.59k|  MemIo mio;  // memory stream in which to store data
 1073|  6.59k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1074|       |  // Some array entries need to have the size in the first element
 1075|  6.59k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1075:7): [True: 632, False: 5.96k]
  ------------------
 1076|    632|    byte buf[4];
 1077|    632|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1078|    632|    switch (elSize) {
 1079|    184|      case 2:
  ------------------
  |  Branch (1079:7): [True: 184, False: 448]
  ------------------
 1080|    184|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1081|    184|        break;
 1082|    448|      case 4:
  ------------------
  |  Branch (1082:7): [True: 448, False: 184]
  ------------------
 1083|    448|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1084|    448|        break;
 1085|      0|      default:
  ------------------
  |  Branch (1085:7): [True: 0, False: 632]
  ------------------
 1086|      0|        break;
 1087|    632|    }
 1088|    632|    mioWrapper.write(buf, elSize);
 1089|    632|  }
 1090|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1091|  1.32M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1091:23): [True: 1.32M, False: 6.59k]
  ------------------
 1092|       |    // Skip the manufactured tag, if it exists
 1093|  1.32M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1093:9): [True: 42.7k, False: 1.28M]
  |  Branch (1093:28): [True: 632, False: 42.1k]
  ------------------
 1094|    632|      continue;
 1095|  1.32M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1096|  1.32M|    idx += fillGap(mioWrapper, idx, newIdx);
 1097|  1.32M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1098|  1.32M|  }
 1099|  6.59k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1099:7): [True: 5.11k, False: 1.48k]
  |  Branch (1099:29): [True: 5.11k, False: 0]
  ------------------
 1100|  5.11k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1101|  5.11k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1102|  5.11k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1103|  5.11k|  }
 1104|       |
 1105|  6.59k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1105:7): [True: 269, False: 6.32k]
  ------------------
 1106|       |    // Select sonyTagEncipher
 1107|    269|    CryptFct cryptFct = cfg()->cryptFct_;
 1108|    269|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1108:9): [True: 120, False: 149]
  ------------------
 1109|    120|      cryptFct = sonyTagEncipher;
 1110|    120|    }
 1111|    269|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1112|    269|    if (!buf.empty()) {
  ------------------
  |  Branch (1112:9): [True: 152, False: 117]
  ------------------
 1113|    152|      mio.seek(0, Exiv2::BasicIo::beg);
 1114|    152|      mio.write(buf.c_data(), buf.size());
 1115|    152|    }
 1116|    269|  }
 1117|  6.59k|  ioWrapper.write(mio.mmap(), mio.size());
 1118|       |
 1119|  6.59k|  return idx;
 1120|  6.59k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1123|  1.32M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1124|  1.32M|  auto pv = pValue();
 1125|  1.32M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1125:7): [True: 0, False: 1.32M]
  |  Branch (1125:14): [True: 649k, False: 677k]
  ------------------
 1126|   649k|    return 0;
 1127|   677k|  DataBuf buf(pv->size());
 1128|   677k|  pv->copy(buf.data(), byteOrder);
 1129|   677k|  ioWrapper.write(buf.c_data(), buf.size());
 1130|   677k|  return buf.size();
 1131|  1.32M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1134|  1.42M|                                size_t& imageIdx) const {
 1135|  1.42M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1136|  1.42M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1139|  33.3k|                                  size_t& imageIdx) const {
 1140|  33.3k|  size_t len = 0;
 1141|  1.39M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1141:25): [True: 1.39M, False: 33.3k]
  ------------------
 1142|  1.39M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1143|  1.39M|  }
 1144|  33.3k|  return len;
 1145|  33.3k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1148|  1.36M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1149|  1.36M|  return 0;
 1150|  1.36M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1153|  16.9k|                                   size_t& /*imageIdx*/) const {
 1154|  16.9k|  size_t len = 0;
 1155|       |  // For makernotes, write TIFF image data to the data area
 1156|  16.9k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1156:7): [True: 322, False: 16.6k]
  ------------------
 1157|    322|    len = writeImage(ioWrapper, byteOrder);
 1158|    322|  }
 1159|  16.9k|  return len;
 1160|  16.9k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1163|  4.61k|                                  size_t& /*imageIdx*/) const {
 1164|  4.61k|  if (!pValue())
  ------------------
  |  Branch (1164:7): [True: 48, False: 4.56k]
  ------------------
 1165|     48|    return 0;
 1166|       |
 1167|  4.56k|  DataBuf buf = pValue()->dataArea();
 1168|  4.56k|  if (!buf.empty())
  ------------------
  |  Branch (1168:7): [True: 291, False: 4.27k]
  ------------------
 1169|    291|    ioWrapper.write(buf.c_data(), buf.size());
 1170|       |  // Align data to word boundary
 1171|  4.56k|  size_t align = (buf.size() & 1);
 1172|  4.56k|  if (align)
  ------------------
  |  Branch (1172:7): [True: 231, False: 4.33k]
  ------------------
 1173|    231|    ioWrapper.putb(0x0);
 1174|       |
 1175|  4.56k|  return buf.size() + align;
 1176|  4.61k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1179|  8.69k|                               size_t& imageIdx) const {
 1180|  8.69k|  size_t len = 0;
 1181|  11.3k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1181:19): [True: 11.3k, False: 8.69k]
  ------------------
 1182|  11.3k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1183|  11.3k|  }
 1184|       |  // Align data to word boundary
 1185|  8.69k|  size_t align = (len & 1);
 1186|  8.69k|  if (align)
  ------------------
  |  Branch (1186:7): [True: 0, False: 8.69k]
  ------------------
 1187|      0|    ioWrapper.putb(0x0);
 1188|       |
 1189|  8.69k|  return len + align;
 1190|  8.69k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1197|   841k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1198|   841k|  return doWriteImage(ioWrapper, byteOrder);
 1199|   841k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1201|  24.0k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1202|  24.0k|  size_t len = 0;
 1203|  24.0k|  const TiffComponent* pSubIfd = nullptr;
 1204|   817k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1204:30): [True: 817k, False: 24.0k]
  ------------------
 1205|   817k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1205:9): [True: 1.42k, False: 816k]
  ------------------
 1206|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1207|  1.42k|#ifndef SUPPRESS_WARNINGS
 1208|  1.42k|      if (pSubIfd) {
  ------------------
  |  Branch (1208:11): [True: 453, False: 972]
  ------------------
 1209|    453|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    453|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 453]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    453|  LogMsg(LogMsg::error).os()
  ------------------
 1210|    453|      }
 1211|  1.42k|#endif
 1212|  1.42k|      pSubIfd = component.get();
 1213|  1.42k|      continue;
 1214|  1.42k|    }
 1215|   816k|    len += component->writeImage(ioWrapper, byteOrder);
 1216|   816k|  }
 1217|  24.0k|  if (pSubIfd) {
  ------------------
  |  Branch (1217:7): [True: 956, False: 23.0k]
  ------------------
 1218|    956|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1219|    956|  }
 1220|  24.0k|  if (pNext_) {
  ------------------
  |  Branch (1220:7): [True: 721, False: 23.2k]
  ------------------
 1221|    721|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1222|    721|  }
 1223|  24.0k|  return len;
 1224|  24.0k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1226|   795k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1227|   795k|  return 0;
 1228|   795k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1230|  7.51k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1231|  7.51k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1232|  7.51k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1233|  7.51k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1243|  14.7k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1244|  14.7k|  if (!pValue())
  ------------------
  |  Branch (1244:7): [True: 139, False: 14.6k]
  ------------------
 1245|    139|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1246|       |
 1247|  14.6k|  size_t len = pValue()->sizeDataArea();
 1248|  14.6k|  if (len > 0) {
  ------------------
  |  Branch (1248:7): [True: 181, False: 14.4k]
  ------------------
 1249|       |#ifdef EXIV2_DEBUG_MESSAGES
 1250|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1251|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1252|       |#endif
 1253|    181|    DataBuf buf = pValue()->dataArea();
 1254|    181|    ioWrapper.write(buf.c_data(), buf.size());
 1255|    181|    size_t align = len & 1;  // Align image data to word boundary
 1256|    181|    if (align)
  ------------------
  |  Branch (1256:9): [True: 87, False: 94]
  ------------------
 1257|     87|      ioWrapper.putb(0x0);
 1258|    181|    len += align;
 1259|  14.4k|  } else {
 1260|       |#ifdef EXIV2_DEBUG_MESSAGES
 1261|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1262|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1263|       |#endif
 1264|  14.4k|    len = 0;
 1265|  56.0k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1265:24): [True: 56.0k, False: 14.4k]
  ------------------
 1266|  56.0k|      ioWrapper.write(f, s);
 1267|  56.0k|      len += s;
 1268|  56.0k|      size_t align = s & 1;  // Align strip data to word boundary
 1269|  56.0k|      if (align)
  ------------------
  |  Branch (1269:11): [True: 31.5k, False: 24.5k]
  ------------------
 1270|  31.5k|        ioWrapper.putb(0x0);
 1271|  56.0k|      len += align;
 1272|  56.0k|    }
 1273|  14.4k|  }
 1274|       |#ifdef EXIV2_DEBUG_MESSAGES
 1275|       |  std::cerr << ", len = " << len << " bytes\n";
 1276|       |#endif
 1277|  14.6k|  return len;
 1278|  14.7k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1280|  14.8M|size_t TiffComponent::size() const {
 1281|  14.8M|  return doSize();
 1282|  14.8M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1284|   121k|size_t TiffDirectory::doSize() const {
 1285|   121k|  size_t compCount = count();
 1286|       |  // Size of the directory, without values and additional data
 1287|   121k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1287:40): [True: 120k, False: 1.51k]
  ------------------
 1288|       |  // Size of IFD values and data
 1289|  5.62M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1289:25): [True: 5.62M, False: 121k]
  ------------------
 1290|  5.62M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1290:40): [True: 273k, False: 5.35M]
  ------------------
 1291|   273k|      sv += sv & 1;  // Align value to word boundary
 1292|   273k|      len += sv;
 1293|   273k|    }
 1294|  5.62M|    auto sd = component->sizeData();
 1295|  5.62M|    sd += sd & 1;  // Align data to word boundary
 1296|  5.62M|    len += sd;
 1297|  5.62M|  }
 1298|       |  // Size of next-IFD, if any
 1299|   121k|  size_t sizeNext = 0;
 1300|   121k|  if (pNext_) {
  ------------------
  |  Branch (1300:7): [True: 229, False: 121k]
  ------------------
 1301|    229|    sizeNext = pNext_->size();
 1302|    229|    len += sizeNext;
 1303|    229|  }
 1304|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1305|   121k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1305:7): [True: 1.17k, False: 120k]
  |  Branch (1305:25): [True: 1.05k, False: 121]
  ------------------
 1306|  1.05k|    len = 0;
 1307|   121k|  return len;
 1308|   121k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1310|  14.9M|size_t TiffEntryBase::doSize() const {
 1311|  14.9M|  return size_;
 1312|  14.9M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1314|   102k|size_t TiffImageEntry::doSize() const {
 1315|   102k|  return strips_.size() * 4;
 1316|   102k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1318|  45.2k|size_t TiffSubIfd::doSize() const {
 1319|  45.2k|  return ifds_.size() * 4;
 1320|  45.2k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1322|  96.1k|size_t TiffMnEntry::doSize() const {
 1323|  96.1k|  if (!mn_) {
  ------------------
  |  Branch (1323:7): [True: 38.3k, False: 57.7k]
  ------------------
 1324|  38.3k|    return TiffEntryBase::doSize();
 1325|  38.3k|  }
 1326|  57.7k|  return mn_->size();
 1327|  96.1k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1329|  65.9k|size_t TiffIfdMakernote::doSize() const {
 1330|  65.9k|  return sizeHeader() + ifd_.size();
 1331|  65.9k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1333|   273k|size_t TiffBinaryArray::doSize() const {
 1334|   273k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1334:7): [True: 40.6k, False: 233k]
  |  Branch (1334:17): [True: 139k, False: 93.3k]
  ------------------
 1335|   180k|    return TiffEntryBase::doSize();
 1336|       |
 1337|  93.3k|  if (elements_.empty())
  ------------------
  |  Branch (1337:7): [True: 0, False: 93.3k]
  ------------------
 1338|      0|    return 0;
 1339|       |
 1340|       |  // Remaining assumptions:
 1341|       |  // - array elements don't "overlap"
 1342|       |  // - no duplicate tags in the array
 1343|  93.3k|  size_t idx = 0;
 1344|  93.3k|  size_t sz = cfg()->tagStep();
 1345|  18.6M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1345:23): [True: 18.6M, False: 93.3k]
  ------------------
 1346|  18.6M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1346:9): [True: 3.41M, False: 15.2M]
  ------------------
 1347|  3.41M|      idx = element->tag();
 1348|  3.41M|      sz = element->size();
 1349|  3.41M|    }
 1350|  18.6M|  }
 1351|  93.3k|  idx *= cfg()->tagStep();
 1352|  93.3k|  idx += sz;
 1353|       |
 1354|  93.3k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1354:7): [True: 71.7k, False: 21.5k]
  |  Branch (1354:29): [True: 71.7k, False: 0]
  ------------------
 1355|  71.7k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1356|  71.7k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1357|  71.7k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1358|  71.7k|  }
 1359|  93.3k|  return idx;
 1360|       |
 1361|  93.3k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1363|  3.41M|size_t TiffBinaryElement::doSize() const {
 1364|  3.41M|  if (!pValue())
  ------------------
  |  Branch (1364:7): [True: 0, False: 3.41M]
  ------------------
 1365|      0|    return 0;
 1366|  3.41M|  return pValue()->size();
 1367|  3.41M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1369|  9.12M|size_t TiffComponent::sizeData() const {
 1370|  9.12M|  return doSizeData();
 1371|  9.12M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1377|  8.98M|size_t TiffEntryBase::doSizeData() const {
 1378|  8.98M|  return 0;
 1379|  8.98M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1381|  77.5k|size_t TiffImageEntry::doSizeData() const {
 1382|  77.5k|  size_t len = 0;
 1383|       |  // For makernotes, TIFF image data is written to the data area
 1384|  77.5k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1384:7): [True: 8.07k, False: 69.4k]
  ------------------
 1385|  8.07k|    len = sizeImage();
 1386|  8.07k|  }
 1387|  77.5k|  return len;
 1388|  77.5k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1390|  32.5k|size_t TiffDataEntry::doSizeData() const {
 1391|  32.5k|  if (!pValue())
  ------------------
  |  Branch (1391:7): [True: 154, False: 32.3k]
  ------------------
 1392|    154|    return 0;
 1393|  32.3k|  return pValue()->sizeDataArea();
 1394|  32.5k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1396|  34.8k|size_t TiffSubIfd::doSizeData() const {
 1397|  34.8k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1398|  34.8k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1404|  8.07k|size_t TiffComponent::sizeImage() const {
 1405|  8.07k|  return doSizeImage();
 1406|  8.07k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1426|  8.07k|size_t TiffImageEntry::doSizeImage() const {
 1427|  8.07k|  if (!pValue())
  ------------------
  |  Branch (1427:7): [True: 0, False: 8.07k]
  ------------------
 1428|      0|    return 0;
 1429|  8.07k|  auto len = pValue()->sizeDataArea();
 1430|  8.07k|  if (len != 0)
  ------------------
  |  Branch (1430:7): [True: 0, False: 8.07k]
  ------------------
 1431|      0|    return len;
 1432|       |
 1433|  8.07k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1434|  8.07k|                               [](const auto& s) { return s.second; });
 1435|  8.07k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1452|  8.63M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1453|  8.63M|  auto ti = static_cast<TypeId>(tiffType);
 1454|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1455|  8.63M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1455:22): [True: 10.4k, False: 8.62M]
  ------------------
 1456|  10.4k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1456:9): [True: 7.00k, False: 3.48k]
  ------------------
 1457|  7.00k|      ti = comment;
 1458|  7.00k|    }
 1459|  10.4k|  }
 1460|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1461|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1462|  8.63M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1462:7): [True: 4.51M, False: 4.11M]
  ------------------
 1463|  4.51M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1463:9): [True: 5.28k, False: 4.51M]
  |  Branch (1463:26): [True: 1.72k, False: 3.55k]
  |  Branch (1463:58): [True: 2.67k, False: 4.51M]
  |  Branch (1463:75): [True: 11, False: 2.66k]
  ------------------
 1464|  1.73k|    ti = Exiv2::signedByte;
 1465|  1.73k|  }
 1466|  8.63M|  return ti;
 1467|  8.63M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1469|  5.55M|TiffType toTiffType(TypeId typeId) {
 1470|  5.55M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1470:7): [True: 0, False: 5.55M]
  ------------------
 1471|      0|#ifndef SUPPRESS_WARNINGS
 1472|      0|    EXV_ERROR << "'" << TypeInfo::typeName(typeId) << "' is not a valid Exif (TIFF) type; using type '"
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1473|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1474|      0|#endif
 1475|      0|    return ttUndefined;
 1476|      0|  }
 1477|  5.55M|  return static_cast<TiffType>(typeId);
 1478|  5.55M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1480|  23.7M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1481|  23.7M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1481:7): [True: 16.2M, False: 7.54M]
  ------------------
 1482|  16.2M|    return lhs->tag() < rhs->tag();
 1483|  7.54M|  return lhs->idx() < rhs->idx();
 1484|  23.7M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1486|  4.10M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1487|  4.10M|  return std::make_unique<TiffEntry>(tag, group);
 1488|  4.10M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1490|  35.5k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1491|  35.5k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1492|  35.5k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1494|  2.67M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1495|  2.67M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1496|  2.67M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.44M|  auto atc = [&] {
  474|  1.44M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.42M, False: 22.7k]
  |  Branch (474:33): [True: 41.2k, False: 1.38M]
  ------------------
  475|  41.2k|      return std::move(object);
  476|  41.2k|    }
  477|  1.40M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.44M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.42M|  tc = [&] {
  486|  1.42M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 928, False: 1.42M]
  ------------------
  487|    928|      return this->addNext(std::move(atc));
  488|  1.42M|    return this->addChild(std::move(atc));
  489|  1.42M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  11.5k|  auto tc = [&] {
  509|  11.5k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 11.5k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  11.5k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  11.5k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1036|  3.16k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderEENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEEEEDaRKT_:
 1232|  9.97k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1434|   116k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1437|  63.3k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1438|  63.3k|  const TagInfo* tags = [=] {
 1439|  63.3k|    if (group == IfdId::gpsId)
 1440|  63.3k|      return Internal::gpsTagList();
 1441|  63.3k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1442|  63.3k|  }();
 1443|  63.3k|  if (tags)
  ------------------
  |  Branch (1443:7): [True: 11.3k, False: 51.9k]
  ------------------
 1444|   361k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1444:26): [True: 360k, False: 885]
  ------------------
 1445|   360k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1445:11): [True: 10.4k, False: 349k]
  ------------------
 1446|  10.4k|        return tags + idx;
 1447|  52.8k|  return nullptr;
 1448|  63.3k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1438|  63.3k|  const TagInfo* tags = [=] {
 1439|  63.3k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1439:9): [True: 7.12k, False: 56.1k]
  ------------------
 1440|  7.12k|      return Internal::gpsTagList();
 1441|  56.1k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1441:12): [True: 4.24k, False: 51.9k]
  ------------------
 1442|  63.3k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1503|  1.33M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1504|  1.33M|  if (curr < tobe) {
  ------------------
  |  Branch (1504:7): [True: 226k, False: 1.10M]
  ------------------
 1505|   226k|    Exiv2::DataBuf buf(tobe - curr);
 1506|   226k|    ioWrapper.write(buf.c_data(), buf.size());
 1507|   226k|    return tobe - curr;
 1508|   226k|  }
 1509|  1.10M|  return 0;
 1510|  1.33M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  10.8M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  10.8M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  41.2M|  [[nodiscard]] uint16_t tag() const {
   82|  41.2M|    return static_cast<uint16_t>(extendedTag_);
   83|  41.2M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  10.8M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  10.8M|    return extendedTag_;
   87|  10.8M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  11.5M|  [[nodiscard]] IfdId group() const {
   90|  11.5M|    return group_;
   91|  11.5M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  7.22M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  7.22M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  4.45M|  void setStart(const byte* pStart) {
  217|  4.45M|    pStart_ = const_cast<byte*>(pStart);
  218|  4.45M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   204M|  [[nodiscard]] uint16_t tag() const {
  241|   204M|    return tag_;
  242|   204M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  29.4M|  [[nodiscard]] IfdId group() const {
  245|  29.4M|    return group_;
  246|  29.4M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  4.56M|  [[nodiscard]] byte* start() const {
  249|  4.56M|    return pStart_;
  250|  4.56M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  2.90M|  void setOffset(size_t offset) {
  417|  2.90M|    offset_ = offset;
  418|  2.90M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.55M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.55M|    return tiffType_;
  460|  1.55M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  82.0k|  [[nodiscard]] size_t offset() const {
  466|  82.0k|    return offset_;
  467|  82.0k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  2.73M|  [[nodiscard]] const byte* pData() const {
  477|  2.73M|    return pData_;
  478|  2.73M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  23.0M|  [[nodiscard]] const Value* pValue() const {
  481|  23.0M|    return pValue_.get();
  482|  23.0M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.34M|  void setCount(size_t count) {
  498|  1.34M|    count_ = count;
  499|  1.34M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  2.82M|  void setIdx(int idx) {
  502|  2.82M|    idx_ = idx;
  503|  2.82M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  1.30M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  1.30M|    return storage_;
  542|  1.30M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  69.0k|  [[nodiscard]] uint16_t szTag() const {
  624|  69.0k|    return szTag_;
  625|  69.0k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  69.0k|  [[nodiscard]] IfdId szGroup() const {
  628|  69.0k|    return szGroup_;
  629|  69.0k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|  68.5k|  [[nodiscard]] uint16_t dtTag() const {
  790|  68.5k|    return dtTag_;
  791|  68.5k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|  68.5k|  [[nodiscard]] IfdId dtGroup() const {
  794|  68.5k|    return dtGroup_;
  795|  68.5k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  28.1k|  [[nodiscard]] bool hasNext() const {
  843|  28.1k|    return hasNext_;
  844|  28.1k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  15.2k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  15.2k|    imageByteOrder_ = byteOrder;
 1108|  15.2k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  6.37M|  bool operator==(size_t idx) const {
 1218|  6.37M|    return idx_ == idx;
 1219|  6.37M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  2.89M|  [[nodiscard]] size_t tagStep() const {
 1235|  2.89M|    return elDefaultDef_.size(0, group_);
 1236|  2.89M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  2.64M|  void setDecoded(bool decoded) {
 1311|  2.64M|    decoded_ = decoded;
 1312|  2.64M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  8.66M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  8.66M|    return arrayCfg_;
 1320|  8.66M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   156k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   156k|    return arrayDef_;
 1324|   156k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  79.9k|  [[nodiscard]] size_t defSize() const {
 1327|  79.9k|    return defSize_;
 1328|  79.9k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   274k|  [[nodiscard]] bool decoded() const {
 1331|   274k|    return decoded_;
 1332|   274k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  1.30M|  void setElDef(const ArrayDef& def) {
 1405|  1.30M|    elDef_ = def;
 1406|  1.30M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  1.30M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  1.30M|    elByteOrder_ = byteOrder;
 1412|  1.30M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  1.34M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  1.34M|    return &elDef_;
 1422|  1.34M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  1.35M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  1.35M|    return elByteOrder_;
 1428|  1.35M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  27.9k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  27.9k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  27.9k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|      6|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|      6|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|      6|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    162|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    162|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    162|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     43|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     43|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     43|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    336|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    336|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    336|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     18|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     18|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     18|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  11.1k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  11.1k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  11.1k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  7.61k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  7.61k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  7.61k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.83k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.83k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.83k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.50k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.50k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.50k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    544|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    544|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    544|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.93k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.93k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.93k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.0k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.0k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.0k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  13.5k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  13.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  13.5k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.63k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.63k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.63k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  4.92k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  4.92k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  4.92k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.08k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.08k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.08k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.05k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.05k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.05k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    365|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    365|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    365|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    753|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    753|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    753|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  12.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  12.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  12.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  11.5k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  11.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  11.5k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.18k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.18k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.18k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.30k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.30k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.30k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    468|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    468|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    468|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.21k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.21k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.21k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  9.60k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  9.60k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  9.60k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  10.6k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  10.6k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  10.6k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    984|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    984|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    984|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.36k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.36k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.36k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    394|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    394|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    394|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    655|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    655|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    655|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  8.98k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  8.98k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  8.98k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  8.50k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  8.50k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  8.50k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    598|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    598|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    598|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    783|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    783|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    783|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    351|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    351|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    351|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.16k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.16k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.16k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  5.81k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  5.81k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  5.81k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  5.07k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  5.07k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  5.07k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    245|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    245|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    245|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    358|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    358|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    358|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    383|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    383|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    383|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.08k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.08k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.08k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.65k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.65k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.65k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    262|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    262|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    262|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    373|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    373|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    373|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    250|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    250|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    250|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    297|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    297|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    297|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.06k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.06k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.06k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.94k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.94k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.94k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    293|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    293|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    293|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    458|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    458|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    458|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    290|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    290|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    290|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    637|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    637|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    637|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.49k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.49k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.49k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.37k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.37k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.37k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    304|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    304|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    304|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     80|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     80|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     80|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    308|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    308|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    308|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.33k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.33k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.33k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    700|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    700|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    700|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    232|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    232|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    232|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    252|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    252|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    252|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    230|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    230|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    230|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    872|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    872|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    872|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    863|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    863|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    863|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    797|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    797|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    797|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    288|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    288|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    288|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    179|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    179|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    179|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    348|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    348|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    348|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    241|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    241|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    241|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    166|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    166|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    166|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.64k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.64k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.64k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  15.6k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  15.6k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  15.6k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  10.1k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  10.1k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  10.1k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    521|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    521|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    521|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    322|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    322|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    322|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    236|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    236|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    236|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     76|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     76|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     76|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    219|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    219|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    219|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    178|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    178|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    178|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    377|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    377|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    377|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     75|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     75|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     75|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    209|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    209|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    209|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    365|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    365|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    365|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    199|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    199|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    199|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    101|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    101|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    101|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    323|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    323|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    323|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    249|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    249|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    249|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    253|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    253|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    253|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  8.98k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  8.98k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  8.98k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.53k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.53k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.53k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    468|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    468|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    468|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.62k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.62k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.62k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    270|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    270|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    270|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    391|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    391|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    391|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    260|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    260|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    260|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    226|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    226|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    226|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    375|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    375|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    375|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    439|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    439|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    439|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    532|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    532|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    532|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    324|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    324|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    324|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.58k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.58k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.58k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    684|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    684|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    684|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    944|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    944|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    944|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  5.62k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  5.62k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  5.62k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  1.30k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  1.30k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  1.30k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.97k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.97k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.97k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.80k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.80k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.80k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    385|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    385|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    385|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.09k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.09k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.09k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.09k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.19k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.19k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.19k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__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|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    347|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    347|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    347|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__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_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    146|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    146|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    146|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     56|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     56|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     56|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     56|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    121|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    121|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    121|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    252|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    252|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    252|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     29|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     29|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     29|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    164|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    164|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    164|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     88|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     88|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     88|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     88|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    263|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    263|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    263|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    224|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    224|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    224|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    152|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    152|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    152|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    435|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    435|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    435|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    235|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    235|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    235|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     53|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     53|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     53|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    462|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    462|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    462|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    356|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    356|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    356|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    356|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    108|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    108|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    108|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    108|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    134|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    134|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    134|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    134|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    172|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    172|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    172|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    172|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    376|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    376|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    376|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    376|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    330|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    330|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    330|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    330|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    301|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    301|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    301|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    301|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    358|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    358|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    358|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    358|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  2.90k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  2.90k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  2.90k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  2.90k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    375|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    375|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    375|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    375|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    242|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    242|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    242|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    242|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    465|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    465|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    465|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    465|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    230|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    230|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    230|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    230|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    313|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    313|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    313|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    165|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    165|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    165|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    616|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    616|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    616|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    931|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    931|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    931|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    278|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    278|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    278|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.30k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.30k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.30k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  5.00k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  5.00k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  5.00k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  5.00k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    683|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    683|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    683|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    494|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    494|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    494|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    488|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    488|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    488|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    222|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    222|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    222|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    222|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    530|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    530|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    530|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    530|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    232|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    232|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    232|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    232|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    549|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    549|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    549|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    549|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    116|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    116|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    116|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    116|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.68k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.68k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.68k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.68k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    315|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    315|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    315|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    315|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    121|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    121|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    121|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    202|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    202|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    202|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    202|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    170|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    170|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    170|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    144|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    144|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    144|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    532|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    532|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    532|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    532|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     87|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     87|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     87|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     28|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     28|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     28|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     64|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     64|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     64|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     64|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.07k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.07k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.07k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.07k|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    476|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    476|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    476|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     57|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     57|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     57|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|     40|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|     40|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|     40|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|     40|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  7.66k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  7.66k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  7.66k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  7.27M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   136k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  48.1k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  32.8k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  14.1M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  14.1M|  return ifdId_ == md.ifdId();
   31|  14.1M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  1.91M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  1.91M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  1.91M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 6.47k, False: 1.90M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  6.47k|    decoderFct = td->decoderFct_;
 1996|  6.47k|  }
 1997|  1.91M|  return decoderFct;
 1998|  1.91M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  2.73M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  2.73M|  EncoderFct encoderFct = nullptr;
 2002|  2.73M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 4.36k, False: 2.72M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  4.36k|    encoderFct = td->encoderFct_;
 2005|  4.36k|  }
 2006|  2.73M|  return encoderFct;
 2007|  2.73M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  7.31M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  7.31M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  7.31M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  7.31M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 6.95M, False: 359k]
  ------------------
 2014|  6.95M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  6.95M|  }
 2016|  7.31M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 7.13M, False: 178k]
  |  Branch (2016:7): [True: 7.11M, False: 196k]
  |  Branch (2016:37): [True: 7.11M, False: 18.4k]
  ------------------
 2017|  7.11M|    return i->second(tag, group);
 2018|  7.11M|  }
 2019|       |#ifdef EXIV2_DEBUG_MESSAGES
 2020|       |  if (i == tiffGroupTable_.end())
 2021|       |    std::cerr << "Warning: No TIFF structure entry found for ";
 2022|       |  else
 2023|       |    std::cerr << "Warning: No TIFF component creator found for ";
 2024|       |  std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0') << std::hex << std::right << extendedTag
 2025|       |            << ", group " << groupName(group) << "\n";
 2026|       |#endif
 2027|   196k|  return nullptr;
 2028|  7.31M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  2.75M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  2.75M|  TiffPath ret;
 2032|  10.8M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 10.8M, Folded]
  ------------------
 2033|  10.8M|    ret.emplace(extendedTag, group);
 2034|  10.8M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  10.8M|    assert(ts != tiffTreeTable_.end());
 2036|  10.8M|    extendedTag = ts->second.second;
 2037|  10.8M|    group = ts->second.first;
 2038|  10.8M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 2.75M, False: 8.05M]
  ------------------
 2039|  2.75M|      break;
 2040|  2.75M|    }
 2041|  10.8M|  }
 2042|  2.75M|  return ret;
 2043|  2.75M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2047|  17.4k|                                   TiffHeaderBase* pHeader) {
 2048|       |  // Create standard TIFF header if necessary
 2049|  17.4k|  std::unique_ptr<TiffHeaderBase> ph;
 2050|  17.4k|  if (!pHeader) {
  ------------------
  |  Branch (2050:7): [True: 9.26k, False: 8.21k]
  ------------------
 2051|  9.26k|    ph = std::make_unique<TiffHeader>();
 2052|  9.26k|    pHeader = ph.get();
 2053|  9.26k|  }
 2054|       |
 2055|  17.4k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2055:12): [True: 16.9k, False: 505]
  ------------------
 2056|  16.9k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2057|  16.9k|    rootDir->accept(decoder);
 2058|  16.9k|  }
 2059|  17.4k|  return pHeader->byteOrder();
 2060|       |
 2061|  17.4k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2066|  14.5k|                                     OffsetWriter* pOffsetWriter) {
 2067|       |  /*
 2068|       |     1) parse the binary image, if one is provided, and
 2069|       |     2) attempt updating the parsed tree in-place ("non-intrusive writing")
 2070|       |     3) else, create a new tree and write a new TIFF structure ("intrusive
 2071|       |        writing"). If there is a parsed tree, it is only used to access the
 2072|       |        image data in this case.
 2073|       |   */
 2074|  14.5k|  WriteMethod writeMethod = wmIntrusive;
 2075|  14.5k|  auto parsedTree = parse(pData, size, root, pHeader);
 2076|  14.5k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2077|  14.5k|  if (parsedTree) {
  ------------------
  |  Branch (2077:7): [True: 5.15k, False: 9.39k]
  ------------------
 2078|       |    // Attempt to update existing TIFF components based on metadata entries
 2079|  5.15k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2080|  5.15k|    parsedTree->accept(encoder);
 2081|  5.15k|    if (!encoder.dirty())
  ------------------
  |  Branch (2081:9): [True: 627, False: 4.52k]
  ------------------
 2082|    627|      writeMethod = wmNonIntrusive;
 2083|  5.15k|  }
 2084|  14.5k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2084:7): [True: 13.9k, False: 632]
  ------------------
 2085|  13.9k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2086|  13.9k|    if (parsedTree) {
  ------------------
  |  Branch (2086:9): [True: 4.52k, False: 9.39k]
  ------------------
 2087|       |      // Copy image tags from the original image to the composite
 2088|  4.52k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2089|  4.52k|      parsedTree->accept(copier);
 2090|  4.52k|    }
 2091|       |    // Add entries from metadata to composite
 2092|  13.9k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2093|  13.9k|                        findEncoderFct);
 2094|  13.9k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2095|       |    // Write binary representation from the composite tree
 2096|  13.9k|    DataBuf header = pHeader->write();
 2097|  13.9k|    auto tempIo = MemIo();
 2098|  13.9k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2099|  13.9k|    auto imageIdx(std::string::npos);
 2100|  13.9k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2101|  13.9k|    if (pOffsetWriter)
  ------------------
  |  Branch (2101:9): [True: 125, False: 13.7k]
  ------------------
 2102|    125|      pOffsetWriter->writeOffsets(tempIo);
 2103|  13.9k|    io.transfer(tempIo);  // may throw
 2104|  13.9k|#ifndef SUPPRESS_WARNINGS
 2105|  13.9k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  13.9k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 13.9k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  13.9k|  LogMsg(LogMsg::info).os()
  ------------------
 2106|  13.9k|#endif
 2107|  13.9k|  }
 2108|    632|#ifndef SUPPRESS_WARNINGS
 2109|    632|  else {
 2110|    632|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    632|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 632]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    632|  LogMsg(LogMsg::info).os()
  ------------------
 2111|    632|  }
 2112|  14.5k|#endif
 2113|  14.5k|  return writeMethod;
 2114|  14.5k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2117|  32.0k|                                                 TiffHeaderBase* pHeader) {
 2118|  32.0k|  TiffComponent::UniquePtr rootDir;
 2119|  32.0k|  if (!pData || size == 0)
  ------------------
  |  Branch (2119:7): [True: 9.48k, False: 22.5k]
  |  Branch (2119:17): [True: 0, False: 22.5k]
  ------------------
 2120|  9.48k|    return rootDir;
 2121|  22.5k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2121:7): [True: 180, False: 22.3k]
  |  Branch (2121:38): [True: 225, False: 22.1k]
  ------------------
 2122|    405|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2123|    405|  }
 2124|  22.1k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2125|  22.1k|  if (rootDir) {
  ------------------
  |  Branch (2125:7): [True: 22.1k, False: 0]
  ------------------
 2126|  22.1k|    rootDir->setStart(pData + pHeader->offset());
 2127|  22.1k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2128|  22.1k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2129|  22.1k|    rootDir->accept(reader);
 2130|  22.1k|    reader.postProcess();
 2131|  22.1k|  }
 2132|  22.1k|  return rootDir;
 2133|       |
 2134|  22.5k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2136|  14.5k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2137|  14.5k|  PrimaryGroups ret;
 2138|  14.5k|  if (!pSourceDir)
  ------------------
  |  Branch (2138:7): [True: 9.39k, False: 5.15k]
  ------------------
 2139|  9.39k|    return ret;
 2140|       |
 2141|  5.15k|  static constexpr auto imageGroups = std::array{
 2142|  5.15k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2143|  5.15k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2144|  5.15k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2145|  5.15k|  };
 2146|       |
 2147|  67.0k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2147:24): [True: 67.0k, False: 5.15k]
  ------------------
 2148|  67.0k|    TiffFinder finder(0x00fe, imageGroup);
 2149|  67.0k|    pSourceDir->accept(finder);
 2150|  67.0k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2151|  67.0k|    if (!te)
  ------------------
  |  Branch (2151:9): [True: 65.8k, False: 1.19k]
  ------------------
 2152|  65.8k|      continue;
 2153|  1.19k|    const Value* pV = te->pValue();
 2154|  1.19k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2154:9): [True: 1.06k, False: 133]
  |  Branch (2154:15): [True: 893, False: 169]
  |  Branch (2154:47): [True: 817, False: 76]
  |  Branch (2154:67): [True: 734, False: 83]
  ------------------
 2155|    734|      ret.push_back(te->group());
 2156|    734|    }
 2157|  1.19k|  }
 2158|  5.15k|  return ret;
 2159|  14.5k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2162|   369k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2163|   369k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2165|   297k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2166|   297k|  if (!pData || size < 8)
  ------------------
  |  Branch (2166:7): [True: 0, False: 297k]
  |  Branch (2166:17): [True: 63, False: 297k]
  ------------------
 2167|     63|    return false;
 2168|       |
 2169|   297k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2169:7): [True: 7.72k, False: 290k]
  |  Branch (2169:26): [True: 6.95k, False: 767]
  ------------------
 2170|  6.95k|    byteOrder_ = littleEndian;
 2171|   290k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2171:14): [True: 111k, False: 179k]
  |  Branch (2171:33): [True: 110k, False: 888]
  ------------------
 2172|   110k|    byteOrder_ = bigEndian;
 2173|   180k|  } else {
 2174|   180k|    return false;
 2175|   180k|  }
 2176|   117k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2177|   117k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2177:7): [True: 117k, False: 18]
  |  Branch (2177:19): [True: 117k, False: 115]
  |  Branch (2177:33): [True: 41.7k, False: 75.8k]
  ------------------
 2178|  41.7k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2179|  75.9k|  tag_ = t;
 2180|  75.9k|  offset_ = getULong(pData + 4, byteOrder_);
 2181|       |
 2182|  75.9k|  return true;
 2183|   117k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2185|  14.1k|DataBuf TiffHeaderBase::write() const {
 2186|  14.1k|  DataBuf buf(8);
 2187|  14.1k|  switch (byteOrder_) {
  ------------------
  |  Branch (2187:11): [True: 14.1k, False: 0]
  ------------------
 2188|  10.0k|    case littleEndian:
  ------------------
  |  Branch (2188:5): [True: 10.0k, False: 4.12k]
  ------------------
 2189|  10.0k|      buf.write_uint8(0, 'I');
 2190|  10.0k|      break;
 2191|  4.12k|    case bigEndian:
  ------------------
  |  Branch (2191:5): [True: 4.12k, False: 10.0k]
  ------------------
 2192|  4.12k|      buf.write_uint8(0, 'M');
 2193|  4.12k|      break;
 2194|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2194:5): [True: 0, False: 14.1k]
  ------------------
 2195|      0|      break;
 2196|  14.1k|  }
 2197|  14.1k|  buf.write_uint8(1, buf.read_uint8(0));
 2198|  14.1k|  buf.write_uint16(2, tag_, byteOrder_);
 2199|  14.1k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2200|  14.1k|  return buf;
 2201|  14.1k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2219|   102k|ByteOrder TiffHeaderBase::byteOrder() const {
 2220|   102k|  return byteOrder_;
 2221|   102k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2223|  18.0k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2224|  18.0k|  byteOrder_ = byteOrder;
 2225|  18.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2227|  45.2k|uint32_t TiffHeaderBase::offset() const {
 2228|  45.2k|  return offset_;
 2229|  45.2k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2231|  8.96k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2232|  8.96k|  offset_ = offset;
 2233|  8.96k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2239|  19.0k|uint16_t TiffHeaderBase::tag() const {
 2240|  19.0k|  return tag_;
 2241|  19.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2243|  1.50k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2244|  1.50k|  return false;
 2245|  1.50k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2325|  2.86M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2326|  2.86M|  const bool result = isTiffImageTagLookup(tag, group);
 2327|       |#ifdef EXIV2_DEBUG_MESSAGES
 2328|       |  if (result) {
 2329|       |    ExifKey key(tag, groupName(group));
 2330|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2331|       |  } else {
 2332|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2333|       |  }
 2334|       |#endif
 2335|  2.86M|  return result;
 2336|  2.86M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2339|   251k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2340|   251k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2342|  2.87M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2343|  2.87M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2343:7): [True: 54.3k, False: 2.81M]
  ------------------
 2344|       |#ifdef EXIV2_DEBUG_MESSAGES
 2345|       |    std::cerr << "No image tags in this image\n";
 2346|       |#endif
 2347|  54.3k|    return false;
 2348|  54.3k|  }
 2349|       |#ifdef EXIV2_DEBUG_MESSAGES
 2350|       |  ExifKey key(tag, groupName(group));
 2351|       |#endif
 2352|       |  // If there are primary groups and none matches group, we're done
 2353|  2.81M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2353:7): [True: 61.1k, False: 2.75M]
  |  Branch (2353:7): [True: 22.5k, False: 2.79M]
  ------------------
 2354|  61.1k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2354:7): [True: 22.5k, False: 38.6k]
  ------------------
 2355|       |#ifdef EXIV2_DEBUG_MESSAGES
 2356|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2357|       |#endif
 2358|  22.5k|    return false;
 2359|  22.5k|  }
 2360|       |  // All tags of marked primary groups other than IFD0 are considered
 2361|       |  // image tags. That should take care of NEFs until we know better.
 2362|  2.79M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2362:7): [True: 38.6k, False: 2.75M]
  |  Branch (2362:34): [True: 37.9k, False: 704]
  ------------------
 2363|       |#ifdef EXIV2_DEBUG_MESSAGES
 2364|       |    ExifKey key(tag, groupName(group));
 2365|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2366|       |#endif
 2367|  37.9k|    return true;
 2368|  37.9k|  }
 2369|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2370|  2.75M|  return isTiffImageTag(tag, group);
 2371|  2.79M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2373|    161|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2374|    161|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2375|    161|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2377|     15|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2378|     15|  auto it = offsetList_.find(id);
 2379|     15|  if (it != offsetList_.end())
  ------------------
  |  Branch (2379:7): [True: 15, False: 0]
  ------------------
 2380|     15|    it->second.target_ = target;
 2381|     15|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2383|    125|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2384|    125|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2384:29): [True: 125, False: 125]
  ------------------
 2385|    125|    io.seek(off.origin_, BasicIo::beg);
 2386|    125|    byte buf[4] = {0, 0, 0, 0};
 2387|    125|    l2Data(buf, off.target_, off.byteOrder_);
 2388|    125|    io.write(buf, 4);
 2389|    125|  }
 2390|    125|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2247|  2.86M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2248|  2.86M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2248:7): [True: 2.45M, False: 418k]
  ------------------
 2249|  2.45M|    return false;
 2250|  2.45M|  }
 2251|       |  //! List of TIFF image tags
 2252|   418k|  switch (tag) {
 2253|    634|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2253:5): [True: 634, False: 418k]
  ------------------
 2254|  1.59k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2254:5): [True: 957, False: 417k]
  ------------------
 2255|  10.2k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2255:5): [True: 8.69k, False: 410k]
  ------------------
 2256|  17.3k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2256:5): [True: 7.04k, False: 411k]
  ------------------
 2257|  23.4k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2257:5): [True: 6.15k, False: 412k]
  ------------------
 2258|  23.9k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2258:5): [True: 495, False: 418k]
  ------------------
 2259|  24.3k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2259:5): [True: 359, False: 418k]
  ------------------
 2260|  24.5k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2260:5): [True: 213, False: 418k]
  ------------------
 2261|  27.1k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2261:5): [True: 2.56k, False: 416k]
  ------------------
 2262|  27.4k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2262:5): [True: 278, False: 418k]
  ------------------
 2263|  27.7k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2263:5): [True: 301, False: 418k]
  ------------------
 2264|  30.0k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2264:5): [True: 2.29k, False: 416k]
  ------------------
 2265|  30.4k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2265:5): [True: 393, False: 418k]
  ------------------
 2266|  30.8k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2266:5): [True: 423, False: 418k]
  ------------------
 2267|  31.0k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2267:5): [True: 195, False: 418k]
  ------------------
 2268|  31.0k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2268:5): [True: 48, False: 418k]
  ------------------
 2269|  31.2k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2269:5): [True: 226, False: 418k]
  ------------------
 2270|  31.4k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2270:5): [True: 117, False: 418k]
  ------------------
 2271|  31.7k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2271:5): [True: 317, False: 418k]
  ------------------
 2272|  32.0k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2272:5): [True: 323, False: 418k]
  ------------------
 2273|  32.4k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2273:5): [True: 428, False: 418k]
  ------------------
 2274|  32.6k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2274:5): [True: 137, False: 418k]
  ------------------
 2275|  32.7k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2275:5): [True: 166, False: 418k]
  ------------------
 2276|  32.8k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2276:5): [True: 114, False: 418k]
  ------------------
 2277|  33.3k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2277:5): [True: 476, False: 418k]
  ------------------
 2278|  33.5k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2278:5): [True: 214, False: 418k]
  ------------------
 2279|  33.7k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2279:5): [True: 150, False: 418k]
  ------------------
 2280|  33.9k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2280:5): [True: 201, False: 418k]
  ------------------
 2281|  34.0k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2281:5): [True: 86, False: 418k]
  ------------------
 2282|  34.3k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2282:5): [True: 329, False: 418k]
  ------------------
 2283|  35.7k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2283:5): [True: 1.38k, False: 417k]
  ------------------
 2284|  35.7k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2284:5): [True: 28, False: 418k]
  ------------------
 2285|  35.9k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2285:5): [True: 223, False: 418k]
  ------------------
 2286|  36.0k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2286:5): [True: 99, False: 418k]
  ------------------
 2287|  36.2k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2287:5): [True: 118, False: 418k]
  ------------------
 2288|  36.2k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2288:5): [True: 76, False: 418k]
  ------------------
 2289|  36.3k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2289:5): [True: 89, False: 418k]
  ------------------
 2290|  36.5k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2290:5): [True: 172, False: 418k]
  ------------------
 2291|  36.7k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2291:5): [True: 191, False: 418k]
  ------------------
 2292|  36.8k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2292:5): [True: 129, False: 418k]
  ------------------
 2293|  37.0k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2293:5): [True: 224, False: 418k]
  ------------------
 2294|  37.3k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2294:5): [True: 213, False: 418k]
  ------------------
 2295|  37.5k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 249, False: 418k]
  ------------------
 2296|  37.8k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2296:5): [True: 310, False: 418k]
  ------------------
 2297|  37.9k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2297:5): [True: 89, False: 418k]
  ------------------
 2298|  38.2k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2298:5): [True: 290, False: 418k]
  ------------------
 2299|  39.7k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2299:5): [True: 1.50k, False: 417k]
  ------------------
 2300|  49.1k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2300:5): [True: 9.43k, False: 409k]
  ------------------
 2301|  56.9k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2301:5): [True: 7.79k, False: 411k]
  ------------------
 2302|  57.2k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2302:5): [True: 299, False: 418k]
  ------------------
 2303|  57.3k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2303:5): [True: 57, False: 418k]
  ------------------
 2304|  57.4k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2304:5): [True: 118, False: 418k]
  ------------------
 2305|  57.5k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2305:5): [True: 90, False: 418k]
  ------------------
 2306|  57.7k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2306:5): [True: 236, False: 418k]
  ------------------
 2307|  57.9k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2307:5): [True: 158, False: 418k]
  ------------------
 2308|  58.0k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2308:5): [True: 88, False: 418k]
  ------------------
 2309|  58.0k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2309:5): [True: 55, False: 418k]
  ------------------
 2310|  58.1k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2310:5): [True: 85, False: 418k]
  ------------------
 2311|  58.4k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2311:5): [True: 239, False: 418k]
  ------------------
 2312|  58.4k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2312:5): [True: 71, False: 418k]
  ------------------
 2313|  58.4k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2313:5): [True: 19, False: 418k]
  ------------------
 2314|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2315|  58.5k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2315:5): [True: 74, False: 418k]
  ------------------
 2316|  58.6k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2316:5): [True: 34, False: 418k]
  ------------------
 2317|  58.7k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2317:5): [True: 142, False: 418k]
  ------------------
 2318|  58.9k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2318:5): [True: 204, False: 418k]
  ------------------
 2319|  58.9k|      return true;
 2320|   359k|    default:
  ------------------
  |  Branch (2320:5): [True: 359k, False: 58.9k]
  ------------------
 2321|   359k|      return false;
 2322|   418k|  }
 2323|   418k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   96|  8.67M|size_t TypeInfo::typeSize(TypeId typeId) {
   97|  8.67M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (97:12): [True: 5.98M, False: 2.69M]
  ------------------
   98|  5.98M|    return tit->size_;
   99|  2.69M|  return 0;
  100|  8.67M|}
_ZN5Exiv27DataBufC2Em:
  102|  6.85M|DataBuf::DataBuf(size_t size) : pData_(size) {
  103|  6.85M|}
_ZN5Exiv27DataBufC2EPKhm:
  105|  59.9k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
  106|  59.9k|}
_ZN5Exiv27DataBuf5allocEm:
  108|  27.1k|void DataBuf::alloc(size_t size) {
  109|  27.1k|  pData_.resize(size);
  110|  27.1k|}
_ZN5Exiv27DataBuf6resizeEm:
  112|   178k|void DataBuf::resize(size_t size) {
  113|   178k|  pData_.resize(size);
  114|   178k|}
_ZN5Exiv27DataBuf5resetEv:
  116|  34.3k|void DataBuf::reset() {
  117|  34.3k|  pData_.clear();
  118|  34.3k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  120|  1.09M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  121|  1.09M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (121:7): [True: 0, False: 1.09M]
  ------------------
  122|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  123|      0|  }
  124|  1.09M|  return pData_[offset];
  125|  1.09M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  127|   585k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  128|   585k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 585k]
  ------------------
  129|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  130|      0|  }
  131|   585k|  pData_[offset] = x;
  132|   585k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  134|   445k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  135|   445k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 445k]
  |  Branch (135:28): [True: 2, False: 445k]
  ------------------
  136|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  137|      2|  }
  138|   445k|  return getUShort(&pData_[offset], byteOrder);
  139|   445k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  141|  14.4k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  142|  14.4k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 14.4k]
  |  Branch (142:28): [True: 0, False: 14.4k]
  ------------------
  143|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  144|      0|  }
  145|  14.4k|  us2Data(&pData_[offset], x, byteOrder);
  146|  14.4k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  148|   322k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  149|   322k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (149:7): [True: 0, False: 322k]
  |  Branch (149:28): [True: 1, False: 322k]
  ------------------
  150|      1|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  151|      1|  }
  152|   322k|  return getULong(&pData_[offset], byteOrder);
  153|   322k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  155|  14.4k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  156|  14.4k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (156:7): [True: 0, False: 14.4k]
  |  Branch (156:28): [True: 0, False: 14.4k]
  ------------------
  157|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  158|      0|  }
  159|  14.4k|  ul2Data(&pData_[offset], x, byteOrder);
  160|  14.4k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  162|  9.24k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  163|  9.24k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (163:7): [True: 0, False: 9.24k]
  |  Branch (163:28): [True: 0, False: 9.24k]
  ------------------
  164|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  165|      0|  }
  166|  9.24k|  return getULongLong(&pData_[offset], byteOrder);
  167|  9.24k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  176|   394k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  177|   394k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (177:7): [True: 0, False: 394k]
  |  Branch (177:34): [True: 0, False: 394k]
  ------------------
  178|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  179|      0|  }
  180|   394k|  return memcmp(&pData_[offset], buf, bufsize);
  181|   394k|}
_ZN5Exiv27DataBuf4dataEm:
  183|  5.38M|byte* Exiv2::DataBuf::data(size_t offset) {
  184|  5.38M|  return const_cast<byte*>(c_data(offset));
  185|  5.38M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  187|  8.21M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  188|  8.21M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (188:7): [True: 1.60M, False: 6.60M]
  |  Branch (188:25): [True: 8.59k, False: 6.60M]
  ------------------
  189|  1.61M|    return nullptr;
  190|  1.61M|  }
  191|  6.60M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (191:7): [True: 0, False: 6.60M]
  ------------------
  192|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  193|      0|  }
  194|  6.60M|  return &pData_[offset];
  195|  6.60M|}
_ZNK5Exiv27DataBuf5c_strEm:
  197|  37.0k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  198|  37.0k|  return reinterpret_cast<const char*>(c_data(offset));
  199|  37.0k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  220|  11.9k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  221|  11.9k|  return os << r.first << "/" << r.second;
  222|  11.9k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  249|  86.0k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  250|  86.0k|  return os << r.first << "/" << r.second;
  251|  86.0k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  257|  57.3M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  258|  57.3M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  259|  57.3M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  261|  58.7M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  262|  58.7M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (262:7): [True: 846k, False: 57.8M]
  ------------------
  263|   846k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  264|   846k|  }
  265|  57.8M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  266|  58.7M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  268|  30.5k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  269|  30.5k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (269:7): [True: 8.89k, False: 21.6k]
  ------------------
  270|  8.89k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  271|  8.89k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  272|  8.89k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  273|  8.89k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  274|  8.89k|  }
  275|  21.6k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  276|  21.6k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  277|  21.6k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  278|  21.6k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  279|  30.5k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  281|   856k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  282|   856k|  uint32_t nominator = getULong(buf, byteOrder);
  283|   856k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  284|   856k|  return {nominator, denominator};
  285|   856k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  287|   609k|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  288|   609k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (288:7): [True: 3.00k, False: 606k]
  ------------------
  289|  3.00k|    return buf[1] << 8 | buf[0];
  290|  3.00k|  }
  291|   606k|  return buf[0] << 8 | buf[1];
  292|   609k|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  294|   856k|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  295|   856k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (295:7): [True: 4.04k, False: 852k]
  ------------------
  296|  4.04k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  297|  4.04k|  }
  298|   852k|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  299|   856k|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  301|   129k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  302|   129k|  int32_t nominator = getLong(buf, byteOrder);
  303|   129k|  int32_t denominator = getLong(buf + 4, byteOrder);
  304|   129k|  return {nominator, denominator};
  305|   129k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  307|  52.5k|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|  52.5k|#ifdef __cpp_lib_bit_cast
  312|  52.5k|  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|  52.5k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  323|   282k|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|   282k|#ifdef __cpp_lib_bit_cast
  328|   282k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (328:7): [True: 115k, False: 166k]
  ------------------
  329|   115k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  330|   115k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  331|   115k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  332|   115k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  333|   166k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  334|   166k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  335|   166k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  336|   166k|                               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|   282k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  358|  3.21M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  359|  3.21M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (359:7): [True: 2.64M, False: 570k]
  ------------------
  360|  2.64M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  361|  2.64M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  362|  2.64M|  } else {
  363|   570k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  364|   570k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  365|   570k|  }
  366|  3.21M|  return 2;
  367|  3.21M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  369|  4.02M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  370|  4.02M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (370:7): [True: 1.89M, False: 2.12M]
  ------------------
  371|  1.89M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  372|  1.89M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  373|  1.89M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  374|  1.89M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  375|  2.12M|  } else {
  376|  2.12M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  377|  2.12M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  378|  2.12M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  379|  2.12M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  380|  2.12M|  }
  381|  4.02M|  return 4;
  382|  4.02M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  399|   713k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  400|   713k|  size_t o = ul2Data(buf, l.first, byteOrder);
  401|   713k|  o += ul2Data(buf + o, l.second, byteOrder);
  402|   713k|  return o;
  403|   713k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  405|   222k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  406|   222k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (406:7): [True: 75.2k, False: 147k]
  ------------------
  407|  75.2k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  408|  75.2k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  409|   147k|  } else {
  410|   147k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  411|   147k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  412|   147k|  }
  413|   222k|  return 2;
  414|   222k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  416|   799k|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  417|   799k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (417:7): [True: 150k, False: 648k]
  ------------------
  418|   150k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  419|   150k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  420|   150k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  421|   150k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  422|   648k|  } else {
  423|   648k|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  424|   648k|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  425|   648k|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  426|   648k|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  427|   648k|  }
  428|   799k|  return 4;
  429|   799k|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  431|   134k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  432|   134k|  size_t o = l2Data(buf, l.first, byteOrder);
  433|   134k|  o += l2Data(buf + o, l.second, byteOrder);
  434|   134k|  return o;
  435|   134k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  437|  80.6k|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|  80.6k|#ifdef __cpp_lib_bit_cast
  442|  80.6k|  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|  80.6k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  453|   189k|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|   189k|  union {
  458|   189k|    uint64_t ull_;
  459|   189k|    double d_;
  460|   189k|  } u;
  461|   189k|  u.d_ = d;
  462|   189k|  uint64_t m = 0xff;
  463|   189k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (463:7): [True: 172k, False: 16.7k]
  ------------------
  464|   172k|    buf[0] = static_cast<byte>(u.ull_ & m);
  465|   172k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  466|   172k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  467|   172k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   172k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  469|   172k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  470|   172k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  471|   172k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  472|   172k|  } else {
  473|  16.7k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  474|  16.7k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  475|  16.7k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  476|  16.7k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  477|  16.7k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  478|  16.7k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  479|  16.7k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  480|  16.7k|    buf[7] = static_cast<byte>(u.ull_ & m);
  481|  16.7k|  }
  482|   189k|  return 8;
  483|   189k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  512|  89.3k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  513|  89.3k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (513:7): [True: 0, False: 89.3k]
  ------------------
  514|      0|    return false;
  515|  89.3k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (515:7): [True: 89.3k, False: 0]
  |  Branch (515:19): [True: 0, False: 89.3k]
  ------------------
  516|      0|    return false;
  517|       |
  518|  89.3k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  519|  89.3k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  521|      8|int exifTime(const char* buf, tm* tm) {
  522|      8|  int rc = 1;
  523|      8|  int year = 0;
  524|      8|  int mon = 0;
  525|      8|  int mday = 0;
  526|      8|  int hour = 0;
  527|      8|  int min = 0;
  528|      8|  int sec = 0;
  529|      8|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (529:7): [True: 4, False: 4]
  ------------------
  530|      4|    tm->tm_year = year - 1900;
  531|      4|    tm->tm_mon = mon - 1;
  532|      4|    tm->tm_mday = mday;
  533|      4|    tm->tm_hour = hour;
  534|      4|    tm->tm_min = min;
  535|      4|    tm->tm_sec = sec;
  536|      4|    rc = 0;
  537|      4|  }
  538|      8|  return rc;
  539|      8|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  667|    228|Rational floatToRationalCast(float f) {
  668|       |  // Convert f to double because it simplifies the range checks
  669|       |  // below. (All int values can be losslessly converted to double, but
  670|       |  // sometimes get rounded when converted to float.)
  671|    228|  const double d = f;
  672|       |  // Beware: primitive conversion algorithm
  673|    228|  int32_t den;
  674|    228|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (674:7): [True: 164, False: 64]
  ------------------
  675|    164|    den = 1000000;
  676|    164|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (676:14): [True: 4, False: 60]
  ------------------
  677|      4|    den = 10000;
  678|     60|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (678:14): [True: 7, False: 53]
  ------------------
  679|      7|    den = 100;
  680|     53|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (680:14): [True: 18, False: 35]
  ------------------
  681|     18|    den = 1;
  682|     35|  } else {
  683|     35|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (683:13): [True: 35, False: 0]
  ------------------
  684|     35|  }
  685|    193|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  686|    193|  const int32_t g = std::gcd(nom, den);
  687|       |
  688|    193|  return {nom / g, den / g};
  689|    228|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   44|  88.2M|  bool operator==(Exiv2::TypeId typeId) const {
   45|  88.2M|    return typeId_ == typeId;
   46|  88.2M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   20|  3.78M|Value::Value(TypeId typeId) : type_(typeId) {
   21|  3.78M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   23|  2.98M|Value::UniquePtr Value::create(TypeId typeId) {
   24|  2.98M|  switch (typeId) {
   25|      0|    case invalidTypeId:
  ------------------
  |  Branch (25:5): [True: 0, False: 2.98M]
  ------------------
   26|  3.45k|    case signedByte:
  ------------------
  |  Branch (26:5): [True: 3.45k, False: 2.98M]
  ------------------
   27|  1.29M|    case unsignedByte:
  ------------------
  |  Branch (27:5): [True: 1.29M, False: 1.69M]
  ------------------
   28|  1.29M|      return std::make_unique<DataValue>(typeId);
   29|  43.5k|    case asciiString:
  ------------------
  |  Branch (29:5): [True: 43.5k, False: 2.94M]
  ------------------
   30|  43.5k|      return std::make_unique<AsciiValue>();
   31|  59.1k|    case unsignedShort:
  ------------------
  |  Branch (31:5): [True: 59.1k, False: 2.92M]
  ------------------
   32|  59.1k|      return std::make_unique<ValueType<uint16_t>>();
   33|  41.9k|    case unsignedLong:
  ------------------
  |  Branch (33:5): [True: 41.9k, False: 2.94M]
  ------------------
   34|  57.1k|    case tiffIfd:
  ------------------
  |  Branch (34:5): [True: 15.1k, False: 2.97M]
  ------------------
   35|  57.1k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   36|  12.4k|    case unsignedRational:
  ------------------
  |  Branch (36:5): [True: 12.4k, False: 2.97M]
  ------------------
   37|  12.4k|      return std::make_unique<ValueType<URational>>();
   38|  53.0k|    case undefined:
  ------------------
  |  Branch (38:5): [True: 53.0k, False: 2.93M]
  ------------------
   39|  53.0k|      return std::make_unique<DataValue>();
   40|  26.3k|    case signedShort:
  ------------------
  |  Branch (40:5): [True: 26.3k, False: 2.96M]
  ------------------
   41|  26.3k|      return std::make_unique<ValueType<int16_t>>();
   42|  29.9k|    case signedLong:
  ------------------
  |  Branch (42:5): [True: 29.9k, False: 2.95M]
  ------------------
   43|  29.9k|      return std::make_unique<ValueType<int32_t>>();
   44|  11.5k|    case signedRational:
  ------------------
  |  Branch (44:5): [True: 11.5k, False: 2.97M]
  ------------------
   45|  11.5k|      return std::make_unique<ValueType<Rational>>();
   46|  6.64k|    case tiffFloat:
  ------------------
  |  Branch (46:5): [True: 6.64k, False: 2.98M]
  ------------------
   47|  6.64k|      return std::make_unique<ValueType<float>>();
   48|  12.1k|    case tiffDouble:
  ------------------
  |  Branch (48:5): [True: 12.1k, False: 2.97M]
  ------------------
   49|  12.1k|      return std::make_unique<ValueType<double>>();
   50|  89.6k|    case string:
  ------------------
  |  Branch (50:5): [True: 89.6k, False: 2.89M]
  ------------------
   51|  89.6k|      return std::make_unique<StringValue>();
   52|  4.96k|    case date:
  ------------------
  |  Branch (52:5): [True: 4.96k, False: 2.98M]
  ------------------
   53|  4.96k|      return std::make_unique<DateValue>();
   54|  9.17k|    case time:
  ------------------
  |  Branch (54:5): [True: 9.17k, False: 2.97M]
  ------------------
   55|  9.17k|      return std::make_unique<TimeValue>();
   56|  6.72k|    case comment:
  ------------------
  |  Branch (56:5): [True: 6.72k, False: 2.98M]
  ------------------
   57|  6.72k|      return std::make_unique<CommentValue>();
   58|  41.7k|    case xmpText:
  ------------------
  |  Branch (58:5): [True: 41.7k, False: 2.94M]
  ------------------
   59|  41.7k|      return std::make_unique<XmpTextValue>();
   60|      3|    case xmpBag:
  ------------------
  |  Branch (60:5): [True: 3, False: 2.98M]
  ------------------
   61|  4.20k|    case xmpSeq:
  ------------------
  |  Branch (61:5): [True: 4.20k, False: 2.98M]
  ------------------
   62|  4.20k|    case xmpAlt:
  ------------------
  |  Branch (62:5): [True: 0, False: 2.98M]
  ------------------
   63|  4.20k|      return std::make_unique<XmpArrayValue>(typeId);
   64|    513|    case langAlt:
  ------------------
  |  Branch (64:5): [True: 513, False: 2.98M]
  ------------------
   65|    513|      return std::make_unique<LangAltValue>();
   66|  1.22M|    default:
  ------------------
  |  Branch (66:5): [True: 1.22M, False: 1.76M]
  ------------------
   67|  1.22M|      return std::make_unique<DataValue>(typeId);
   68|  2.98M|  }
   69|  2.98M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   71|    678|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   72|    678|  return -1;
   73|    678|}
_ZNK5Exiv25Value8toStringEv:
   75|   246k|std::string Value::toString() const {
   76|   246k|  std::ostringstream os;
   77|   246k|  write(os);
   78|   246k|  ok_ = !os.fail();
   79|   246k|  return os.str();
   80|   246k|}
_ZNK5Exiv25Value8toStringEm:
   82|   142k|std::string Value::toString(size_t /*n*/) const {
   83|   142k|  return toString();
   84|   142k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   86|  40.5k|size_t Value::sizeDataArea() const {
   87|  40.5k|  return 0;
   88|  40.5k|}
_ZNK5Exiv25Value8dataAreaEv:
   90|  2.46k|DataBuf Value::dataArea() const {
   91|  2.46k|  return {nullptr, 0};
   92|  2.46k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   94|  2.57M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   95|  2.57M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   97|     15|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   98|     15|  read(buf, len, byteOrder);
   99|     15|}
_ZNK5Exiv29DataValue5countEv:
  101|  10.8M|size_t DataValue::count() const {
  102|  10.8M|  return size();
  103|  10.8M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  105|  2.57M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  106|       |  // byteOrder not needed
  107|  2.57M|  value_.assign(buf, buf + len);
  108|  2.57M|  return 0;
  109|  2.57M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  123|  3.22M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  124|       |  // byteOrder not needed
  125|  3.22M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  126|  3.22M|}
_ZNK5Exiv29DataValue4sizeEv:
  128|  22.1M|size_t DataValue::size() const {
  129|  22.1M|  return value_.size();
  130|  22.1M|}
_ZNK5Exiv29DataValue6clone_Ev:
  132|  9.78M|DataValue* DataValue::clone_() const {
  133|  9.78M|  return new DataValue(*this);
  134|  9.78M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  136|  2.26k|std::ostream& DataValue::write(std::ostream& os) const {
  137|  2.26k|  if (!value_.empty()) {
  ------------------
  |  Branch (137:7): [True: 1.30k, False: 959]
  ------------------
  138|  1.30k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  139|  1.30k|    os << static_cast<int>(value_.back());
  140|  1.30k|  }
  141|  2.26k|  return os;
  142|  2.26k|}
_ZNK5Exiv29DataValue7toInt64Em:
  149|  88.6k|int64_t DataValue::toInt64(size_t n) const {
  150|  88.6k|  ok_ = true;
  151|  88.6k|  return value_.at(n);
  152|  88.6k|}
_ZNK5Exiv29DataValue8toUint32Em:
  154|  8.56M|uint32_t DataValue::toUint32(size_t n) const {
  155|  8.56M|  ok_ = true;
  156|  8.56M|  return value_.at(n);
  157|  8.56M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  173|  60.1k|int StringValueBase::read(const std::string& buf) {
  174|  60.1k|  value_ = buf;
  175|  60.1k|  return 0;
  176|  60.1k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  178|  77.5k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  179|       |  // byteOrder not needed
  180|  77.5k|  if (buf)
  ------------------
  |  Branch (180:7): [True: 77.5k, False: 0]
  ------------------
  181|  77.5k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  182|  77.5k|  return 0;
  183|  77.5k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  185|  83.4k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  186|  83.4k|  if (value_.empty())
  ------------------
  |  Branch (186:7): [True: 49.7k, False: 33.7k]
  ------------------
  187|  49.7k|    return 0;
  188|       |  // byteOrder not needed
  189|  33.7k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  190|  83.4k|}
_ZNK5Exiv215StringValueBase5countEv:
  192|  97.9k|size_t StringValueBase::count() const {
  193|  97.9k|  return size();
  194|  97.9k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  196|   331k|size_t StringValueBase::size() const {
  197|   331k|  return value_.size();
  198|   331k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  200|  57.8k|std::ostream& StringValueBase::write(std::ostream& os) const {
  201|  57.8k|  return os << value_;
  202|  57.8k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  204|    803|int64_t StringValueBase::toInt64(size_t n) const {
  205|    803|  ok_ = true;
  206|    803|  return static_cast<signed char>(value_.at(n));
  207|    803|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  209|  6.50k|uint32_t StringValueBase::toUint32(size_t n) const {
  210|  6.50k|  ok_ = true;
  211|  6.50k|  return static_cast<unsigned char>(value_.at(n));
  212|  6.50k|}
_ZN5Exiv211StringValueC2Ev:
  224|  89.6k|StringValue::StringValue() : StringValueBase(string) {
  225|  89.6k|}
_ZNK5Exiv211StringValue6clone_Ev:
  230|   440k|StringValue* StringValue::clone_() const {
  231|   440k|  return new StringValue(*this);
  232|   440k|}
_ZN5Exiv210AsciiValueC2Ev:
  234|  43.5k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  235|  43.5k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  240|  4.38k|int AsciiValue::read(const std::string& buf) {
  241|  4.38k|  value_ = buf;
  242|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  243|  4.38k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (243:7): [True: 9, False: 4.37k]
  |  Branch (243:25): [True: 4.37k, False: 0]
  ------------------
  244|  4.38k|    value_ += '\0';
  245|  4.38k|  }
  246|  4.38k|  return 0;
  247|  4.38k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  249|   165k|AsciiValue* AsciiValue::clone_() const {
  250|   165k|  return new AsciiValue(*this);
  251|   165k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  253|  31.2k|std::ostream& AsciiValue::write(std::ostream& os) const {
  254|       |  // Write only up to the first '\0' (if any)
  255|  31.2k|  std::string::size_type pos = value_.find_first_of('\0');
  256|  31.2k|  if (pos == std::string::npos)
  ------------------
  |  Branch (256:7): [True: 6.36k, False: 24.9k]
  ------------------
  257|  6.36k|    pos = value_.size();
  258|  31.2k|  return os << value_.substr(0, pos);
  259|  31.2k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  286|  4.09k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  287|  4.09k|  int i = 0;
  288|  18.2k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (288:10): [True: 16.4k, False: 1.80k]
  |  Branch (288:10): [True: 14.1k, False: 4.09k]
  |  Branch (288:58): [True: 14.1k, False: 2.29k]
  ------------------
  289|  14.1k|  }
  290|  4.09k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (290:10): [True: 1.80k, False: 2.29k]
  ------------------
  291|  4.09k|}
_ZN5Exiv212CommentValueC2Ev:
  293|  6.72k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  294|  6.72k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  330|  6.72k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  331|  6.72k|  byteOrder_ = byteOrder;
  332|  6.72k|  return StringValueBase::read(buf, len, byteOrder);
  333|  6.72k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  335|  6.18k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  336|  6.18k|  std::string c = value_;
  337|  6.18k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (337:7): [True: 774, False: 5.41k]
  ------------------
  338|    774|    c = value_.substr(8);
  339|    774|    [[maybe_unused]] const size_t sz = c.size();
  340|    774|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (340:9): [True: 36, False: 738]
  |  Branch (340:39): [True: 0, False: 36]
  ------------------
  341|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  342|    774|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (342:16): [True: 738, False: 36]
  |  Branch (342:43): [True: 46, False: 692]
  ------------------
  343|     46|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  344|     46|    }
  345|    774|    c = value_.substr(0, 8) + c;
  346|    774|  }
  347|  6.18k|  if (c.empty())
  ------------------
  |  Branch (347:7): [True: 1.95k, False: 4.23k]
  ------------------
  348|  1.95k|    return 0;
  349|  4.23k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  350|  6.18k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  382|  6.18k|CommentValue::CharsetId CommentValue::charsetId() const {
  383|  6.18k|  CharsetId charsetId = undefined;
  384|  6.18k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (384:7): [True: 4.09k, False: 2.08k]
  ------------------
  385|  4.09k|    const std::string code = value_.substr(0, 8);
  386|  4.09k|    charsetId = CharsetInfo::charsetIdByCode(code);
  387|  4.09k|  }
  388|  6.18k|  return charsetId;
  389|  6.18k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  411|  17.9k|CommentValue* CommentValue::clone_() const {
  412|  17.9k|  return new CommentValue(*this);
  413|  17.9k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  415|  13.2k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  416|  13.2k|  xmpArrayType_ = xmpArrayType;
  417|  13.2k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  419|  7.61k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  420|  7.61k|  xmpStruct_ = xmpStruct;
  421|  7.61k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  423|   378k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  424|   378k|  return xmpArrayType_;
  425|   378k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  427|  13.2k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  428|  13.2k|  XmpArrayType xa = xaNone;
  429|  13.2k|  switch (typeId) {
  430|    374|    case xmpAlt:
  ------------------
  |  Branch (430:5): [True: 374, False: 12.8k]
  ------------------
  431|    374|      xa = xaAlt;
  432|    374|      break;
  433|    300|    case xmpBag:
  ------------------
  |  Branch (433:5): [True: 300, False: 12.9k]
  ------------------
  434|    300|      xa = xaBag;
  435|    300|      break;
  436|  5.47k|    case xmpSeq:
  ------------------
  |  Branch (436:5): [True: 5.47k, False: 7.73k]
  ------------------
  437|  5.47k|      xa = xaSeq;
  438|  5.47k|      break;
  439|  7.06k|    default:
  ------------------
  |  Branch (439:5): [True: 7.06k, False: 6.14k]
  ------------------
  440|  7.06k|      break;
  441|  13.2k|  }
  442|  13.2k|  return xa;
  443|  13.2k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  445|   390k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  446|   390k|  return xmpStruct_;
  447|   390k|}
_ZN5Exiv212XmpTextValueC2Ev:
  469|   126k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  470|   126k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  476|   640k|int XmpTextValue::read(const std::string& buf) {
  477|       |  // support a type=Alt,Bag,Seq,Struct indicator
  478|   640k|  std::string b = buf;
  479|   640k|  std::string type;
  480|   640k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (480:7): [True: 1.25k, False: 639k]
  ------------------
  481|  1.25k|    std::string::size_type pos = buf.find_first_of(' ');
  482|  1.25k|    type = buf.substr(5, pos - 5);
  483|       |    // Strip quotes (so you can also specify the type without quotes)
  484|  1.25k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (484:9): [True: 793, False: 459]
  |  Branch (484:26): [True: 402, False: 391]
  ------------------
  485|    402|      type = type.substr(1);
  486|  1.25k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (486:9): [True: 744, False: 508]
  |  Branch (486:26): [True: 340, False: 404]
  ------------------
  487|    340|      type.pop_back();
  488|  1.25k|    b.clear();
  489|  1.25k|    if (pos != std::string::npos)
  ------------------
  |  Branch (489:9): [True: 705, False: 547]
  ------------------
  490|    705|      b = buf.substr(pos + 1);
  491|  1.25k|  }
  492|   640k|  if (!type.empty()) {
  ------------------
  |  Branch (492:7): [True: 744, False: 639k]
  ------------------
  493|    744|    if (type == "Alt") {
  ------------------
  |  Branch (493:9): [True: 25, False: 719]
  ------------------
  494|     25|      setXmpArrayType(XmpValue::xaAlt);
  495|    719|    } else if (type == "Bag") {
  ------------------
  |  Branch (495:16): [True: 28, False: 691]
  ------------------
  496|     28|      setXmpArrayType(XmpValue::xaBag);
  497|    691|    } else if (type == "Seq") {
  ------------------
  |  Branch (497:16): [True: 19, False: 672]
  ------------------
  498|     19|      setXmpArrayType(XmpValue::xaSeq);
  499|    672|    } else if (type == "Struct") {
  ------------------
  |  Branch (499:16): [True: 259, False: 413]
  ------------------
  500|    259|      setXmpStruct();
  501|    413|    } else {
  502|    413|      throw Error(ErrorCode::kerInvalidXmpText, type);
  503|    413|    }
  504|    744|  }
  505|   640k|  value_ = std::move(b);
  506|   640k|  return 0;
  507|   640k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  513|  79.3k|size_t XmpTextValue::size() const {
  514|  79.3k|  std::ostringstream os;
  515|  79.3k|  write(os);
  516|  79.3k|  return os.str().size();
  517|  79.3k|}
_ZNK5Exiv212XmpTextValue5countEv:
  519|  79.3k|size_t XmpTextValue::count() const {
  520|  79.3k|  return size();
  521|  79.3k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  523|   226k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  524|   226k|  bool del = false;
  525|   226k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (525:7): [True: 314, False: 225k]
  ------------------
  526|    314|    switch (xmpArrayType()) {
  ------------------
  |  Branch (526:13): [True: 314, False: 0]
  ------------------
  527|    121|      case XmpValue::xaAlt:
  ------------------
  |  Branch (527:7): [True: 121, False: 193]
  ------------------
  528|    121|        os << "type=\"Alt\"";
  529|    121|        break;
  530|      2|      case XmpValue::xaBag:
  ------------------
  |  Branch (530:7): [True: 2, False: 312]
  ------------------
  531|      2|        os << "type=\"Bag\"";
  532|      2|        break;
  533|    191|      case XmpValue::xaSeq:
  ------------------
  |  Branch (533:7): [True: 191, False: 123]
  ------------------
  534|    191|        os << "type=\"Seq\"";
  535|    191|        break;
  536|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (536:7): [True: 0, False: 314]
  ------------------
  537|      0|        break;  // just to suppress the warning
  538|    314|    }
  539|    314|    del = true;
  540|   225k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (540:14): [True: 6.54k, False: 219k]
  ------------------
  541|  6.54k|    switch (xmpStruct()) {
  ------------------
  |  Branch (541:13): [True: 6.54k, False: 0]
  ------------------
  542|  6.54k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (542:7): [True: 6.54k, False: 0]
  ------------------
  543|  6.54k|        os << "type=\"Struct\"";
  544|  6.54k|        break;
  545|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (545:7): [True: 0, False: 6.54k]
  ------------------
  546|      0|        break;  // just to suppress the warning
  547|  6.54k|    }
  548|  6.54k|    del = true;
  549|  6.54k|  }
  550|   226k|  if (del && !value_.empty())
  ------------------
  |  Branch (550:7): [True: 6.85k, False: 219k]
  |  Branch (550:14): [True: 26, False: 6.83k]
  ------------------
  551|     26|    os << " ";
  552|   226k|  return os << value_;
  553|   226k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  571|   275k|XmpTextValue* XmpTextValue::clone_() const {
  572|   275k|  return new XmpTextValue(*this);
  573|   275k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  575|  5.85k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  576|  5.85k|  setXmpArrayType(xmpArrayType(typeId));
  577|  5.85k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|   148k|int XmpArrayValue::read(const std::string& buf) {
  580|   148k|  if (!buf.empty())
  ------------------
  |  Branch (580:7): [True: 142k, False: 6.32k]
  ------------------
  581|   142k|    value_.push_back(buf);
  582|   148k|  return 0;
  583|   148k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  589|  68.3k|size_t XmpArrayValue::count() const {
  590|  68.3k|  return value_.size();
  591|  68.3k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  593|    225|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  594|    225|  if (!value_.empty()) {
  ------------------
  |  Branch (594:7): [True: 217, False: 8]
  ------------------
  595|    217|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  596|    217|    os << value_.back();
  597|    217|  }
  598|    225|  return os;
  599|    225|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  601|   192k|std::string XmpArrayValue::toString(size_t n) const {
  602|   192k|  ok_ = true;
  603|   192k|  return value_.at(n);
  604|   192k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  622|  11.4k|XmpArrayValue* XmpArrayValue::clone_() const {
  623|  11.4k|  return new XmpArrayValue(*this);
  624|  11.4k|}
_ZN5Exiv212LangAltValueC2Ev:
  626|  1.44k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  627|  1.44k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  633|    513|int LangAltValue::read(const std::string& buf) {
  634|    513|  std::string b = buf;
  635|    513|  std::string lang = "x-default";
  636|    513|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (636:7): [True: 137, False: 376]
  ------------------
  637|    137|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  638|       |
  639|    137|    const std::string::size_type pos = buf.find_first_of(' ');
  640|    137|    if (pos == std::string::npos) {
  ------------------
  |  Branch (640:9): [True: 33, False: 104]
  ------------------
  641|     33|      lang = buf.substr(5);
  642|    104|    } else {
  643|    104|      lang = buf.substr(5, pos - 5);
  644|    104|    }
  645|    137|    if (lang.empty())
  ------------------
  |  Branch (645:9): [True: 0, False: 137]
  ------------------
  646|      0|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  647|       |    // Strip quotes (so you can also specify the language without quotes)
  648|    137|    if (lang.front() == '"') {
  ------------------
  |  Branch (648:9): [True: 39, False: 98]
  ------------------
  649|     39|      lang = lang.substr(1);
  650|       |
  651|     39|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (651:11): [True: 3, False: 36]
  |  Branch (651:27): [True: 23, False: 13]
  ------------------
  652|     26|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  653|       |
  654|     13|      lang.pop_back();
  655|     13|    }
  656|       |
  657|    111|    if (lang.empty())
  ------------------
  |  Branch (657:9): [True: 0, False: 111]
  ------------------
  658|      0|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  659|       |
  660|       |    // Check language is in the correct format (see https://www.ietf.org/rfc/rfc3066.txt)
  661|    111|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (661:55): [True: 54, False: 57]
  ------------------
  662|     54|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  663|     54|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (663:11): [True: 23, False: 31]
  |  Branch (663:38): [True: 10, False: 21]
  ------------------
  664|     33|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  665|     54|    }
  666|       |
  667|     78|    b.clear();
  668|     78|    if (pos != std::string::npos)
  ------------------
  |  Branch (668:9): [True: 61, False: 17]
  ------------------
  669|     61|      b = buf.substr(pos + 1);
  670|     78|  }
  671|       |
  672|    454|  value_[lang] = std::move(b);
  673|    454|  return 0;
  674|    513|}
_ZNK5Exiv212LangAltValue5countEv:
  680|    510|size_t LangAltValue::count() const {
  681|    510|  return value_.size();
  682|    510|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  684|    196|std::ostream& LangAltValue::write(std::ostream& os) const {
  685|    196|  bool first = true;
  686|       |
  687|       |  // Write the default entry first
  688|    196|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (688:42): [True: 0, False: 196]
  ------------------
  689|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  690|      0|    first = false;
  691|      0|  }
  692|       |
  693|       |  // Write the others
  694|    196|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (694:30): [True: 196, False: 196]
  ------------------
  695|    196|    if (lang != "x-default") {
  ------------------
  |  Branch (695:9): [True: 196, False: 0]
  ------------------
  696|    196|      if (!first)
  ------------------
  |  Branch (696:11): [True: 0, False: 196]
  ------------------
  697|      0|        os << ", ";
  698|    196|      os << "lang=\"" << lang << "\" " << s;
  699|    196|      first = false;
  700|    196|    }
  701|    196|  }
  702|    196|  return os;
  703|    196|}
_ZNK5Exiv212LangAltValue8toStringEm:
  705|    534|std::string LangAltValue::toString(size_t /*n*/) const {
  706|    534|  return toString("x-default");
  707|    534|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  709|    534|std::string LangAltValue::toString(const std::string& qualifier) const {
  710|    534|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (710:40): [True: 24, False: 510]
  ------------------
  711|     24|    ok_ = true;
  712|     24|    return i->second;
  713|     24|  }
  714|    510|  ok_ = false;
  715|    510|  return "";
  716|    534|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  738|  2.27k|LangAltValue* LangAltValue::clone_() const {
  739|  2.27k|  return new LangAltValue(*this);
  740|  2.27k|}
_ZN5Exiv29DateValueC2Ev:
  742|  4.96k|DateValue::DateValue() : Value(date) {
  743|  4.96k|  date_ = {};
  744|  4.96k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  750|  4.68k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  751|  4.68k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  752|  4.68k|  return read(str);
  753|  4.68k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  755|  4.96k|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|  4.96k|  size_t monthPos = 0;
  759|  4.96k|  size_t dayPos = 0;
  760|       |
  761|  4.96k|  auto printWarning = [] {
  762|  4.96k|#ifndef SUPPRESS_WARNINGS
  763|  4.96k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  764|  4.96k|#endif
  765|  4.96k|  };
  766|       |
  767|  4.96k|  if (buf.size() < 8) {
  ------------------
  |  Branch (767:7): [True: 1.16k, False: 3.80k]
  ------------------
  768|  1.16k|    printWarning();
  769|  1.16k|    return 1;
  770|  1.16k|  }
  771|       |
  772|  3.80k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (772:8): [True: 2.41k, False: 1.38k]
  |  Branch (772:28): [True: 1.21k, False: 1.20k]
  |  Branch (772:45): [True: 213, False: 1.00k]
  |  Branch (772:63): [True: 1.38k, False: 2.21k]
  ------------------
  773|  1.59k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (773:9): [True: 213, False: 1.38k]
  ------------------
  774|    213|      monthPos = 5;
  775|    213|      dayPos = 8;
  776|  1.38k|    } else {
  777|  1.38k|      monthPos = 4;
  778|  1.38k|      dayPos = 6;
  779|  1.38k|    }
  780|       |
  781|  1.59k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  1.59k|      for (size_t i = start; i < start + count; ++i) {
  783|  1.59k|        if (!std::isdigit(buf[i])) {
  784|  1.59k|          printWarning();
  785|  1.59k|          return 1;
  786|  1.59k|        }
  787|  1.59k|      }
  788|  1.59k|      dest = std::stoul(buf.substr(start, count));
  789|  1.59k|      return 0;
  790|  1.59k|    };
  791|       |
  792|  1.59k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (792:9): [True: 668, False: 925]
  |  Branch (792:42): [True: 371, False: 554]
  |  Branch (792:83): [True: 119, False: 435]
  ------------------
  793|  1.15k|      printWarning();
  794|  1.15k|      return 1;
  795|  1.15k|    }
  796|       |
  797|    435|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (797:9): [True: 207, False: 228]
  |  Branch (797:29): [True: 104, False: 124]
  ------------------
  798|    311|      date_.month = 0;
  799|    311|      date_.day = 0;
  800|    311|      printWarning();
  801|    311|      return 1;
  802|    311|    }
  803|    124|    return 0;
  804|    435|  }
  805|  2.21k|  printWarning();
  806|  2.21k|  return 1;
  807|  3.80k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  813|     51|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|     51|  auto out = reinterpret_cast<char*>(buf);
  818|     51|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|     51|#define stringFormatTo std::format_to
  ------------------
  819|       |
  820|     51|  return it - out;
  821|     51|}
_ZNK5Exiv29DateValue4sizeEv:
  831|    102|size_t DateValue::size() const {
  832|    102|  return 8;
  833|    102|}
_ZNK5Exiv29DateValue6clone_Ev:
  835|    719|DateValue* DateValue::clone_() const {
  836|    719|  return new DateValue(*this);
  837|    719|}
_ZN5Exiv29TimeValueC2Ev:
  878|  9.17k|TimeValue::TimeValue() : Value(time) {
  879|  9.17k|  time_ = {};
  880|  9.17k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  886|  9.17k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  887|  9.17k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  888|  9.17k|  return read(str);
  889|  9.17k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  891|  9.17k|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|  9.17k|  auto printWarning = [] {
  897|  9.17k|#ifndef SUPPRESS_WARNINGS
  898|  9.17k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  899|  9.17k|#endif
  900|  9.17k|    return 1;
  901|  9.17k|  };
  902|       |
  903|  9.17k|  if (buf.size() < 2)
  ------------------
  |  Branch (903:7): [True: 1.25k, False: 7.92k]
  ------------------
  904|  1.25k|    return printWarning();
  905|       |
  906|  7.92k|  for (auto c : buf)
  ------------------
  |  Branch (906:15): [True: 78.8k, False: 5.08k]
  ------------------
  907|  78.8k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (907:9): [True: 75.0k, False: 3.79k]
  |  Branch (907:21): [True: 70.5k, False: 4.49k]
  |  Branch (907:33): [True: 66.2k, False: 4.23k]
  |  Branch (907:45): [True: 63.3k, False: 2.96k]
  |  Branch (907:57): [True: 2.84k, False: 60.4k]
  ------------------
  908|  2.84k|      return printWarning();
  909|       |
  910|  5.08k|  size_t mpos;
  911|  5.08k|  size_t spos;
  912|  5.08k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (912:7): [True: 2.03k, False: 3.04k]
  ------------------
  913|  2.03k|    mpos = 3;
  914|  2.03k|    spos = 6;
  915|  3.04k|  } else {
  916|  3.04k|    mpos = 2;
  917|  3.04k|    spos = 4;
  918|  3.04k|  }
  919|       |
  920|  5.08k|  try {
  921|  5.08k|    auto hi = std::stoi(buf.substr(0, 2));
  922|  5.08k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (922:9): [True: 139, False: 4.94k]
  |  Branch (922:19): [True: 111, False: 4.83k]
  ------------------
  923|    147|      return printWarning();
  924|  4.93k|    time_.hour = hi;
  925|  4.93k|    if (buf.size() > 3) {
  ------------------
  |  Branch (925:9): [True: 3.71k, False: 1.21k]
  ------------------
  926|  3.71k|      auto mi = std::stoi(buf.substr(mpos, 2));
  927|  3.71k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (927:11): [True: 242, False: 3.47k]
  |  Branch (927:21): [True: 153, False: 3.31k]
  ------------------
  928|    342|        return printWarning();
  929|  3.37k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  930|  3.37k|    } else {
  931|  1.21k|      time_.minute = 0;
  932|  1.21k|    }
  933|  4.59k|    if (buf.size() > 5) {
  ------------------
  |  Branch (933:9): [True: 2.26k, False: 2.32k]
  ------------------
  934|  2.26k|      auto si = std::stoi(buf.substr(spos, 2));
  935|  2.26k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (935:11): [True: 272, False: 1.99k]
  |  Branch (935:21): [True: 138, False: 1.85k]
  ------------------
  936|    231|        return printWarning();
  937|  2.03k|      time_.second = std::stoi(buf.substr(spos, 2));
  938|  2.32k|    } else {
  939|  2.32k|      time_.second = 0;
  940|  2.32k|    }
  941|       |
  942|  4.36k|    auto fpos = buf.find('+');
  943|  4.36k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (943:9): [True: 1.38k, False: 2.97k]
  ------------------
  944|  1.38k|      fpos = buf.find('-');
  945|       |
  946|  4.36k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (946:9): [True: 3.77k, False: 581]
  ------------------
  947|  3.77k|      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|  3.77k|      const bool negative = format.at(0) == '-';
  953|  3.77k|      auto posColon = format.find(':');
  954|  3.77k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (954:11): [True: 2.11k, False: 1.66k]
  ------------------
  955|       |        // Extended format
  956|  2.11k|        auto tzhi = std::stoi(format.substr(0, 3));
  957|  2.11k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (957:13): [True: 193, False: 1.92k]
  |  Branch (957:27): [True: 713, False: 1.21k]
  ------------------
  958|    796|          return printWarning();
  959|  1.32k|        time_.tzHour = tzhi;
  960|  1.32k|        if (format.size() > 3) {
  ------------------
  |  Branch (960:13): [True: 604, False: 716]
  ------------------
  961|    604|          int minute = std::stoi(format.substr(3));
  962|    604|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (962:15): [True: 187, False: 417]
  |  Branch (962:29): [True: 175, False: 242]
  ------------------
  963|    234|            return printWarning();
  964|    370|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (964:28): [True: 192, False: 178]
  ------------------
  965|    370|        }
  966|  1.66k|      } else {
  967|       |        // Basic format
  968|  1.66k|        auto tzhi = std::stoi(format.substr(0, posColon));
  969|  1.66k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (969:13): [True: 259, False: 1.40k]
  |  Branch (969:27): [True: 93, False: 1.31k]
  ------------------
  970|    308|          return printWarning();
  971|  1.35k|        time_.tzHour = tzhi;
  972|  1.35k|        int minute = std::stoi(format.substr(posColon + 1));
  973|  1.35k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (973:13): [True: 367, False: 988]
  |  Branch (973:27): [True: 327, False: 661]
  ------------------
  974|    583|          return printWarning();
  975|    772|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (975:26): [True: 115, False: 657]
  ------------------
  976|    772|      }
  977|  3.77k|    }
  978|  4.36k|  } catch (std::exception&) {
  979|       |    // std::stoi might throw an exception if the syntax is invalid.
  980|    684|    return printWarning();
  981|    684|  }
  982|  1.75k|  return 0;
  983|  5.08k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  990|    347|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|    347|  char plusMinus = '+';
  994|    347|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (994:7): [True: 126, False: 221]
  |  Branch (994:27): [True: 7, False: 214]
  ------------------
  995|    133|    plusMinus = '-';
  996|       |
  997|    347|  auto out = reinterpret_cast<char*>(buf);
  998|    347|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    347|#define stringFormatTo std::format_to
  ------------------
  999|    347|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
 1000|       |
 1001|    347|  auto wrote = static_cast<size_t>(it - out);
 1002|    347|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
 1003|    347|  return wrote;
 1004|    347|}
_ZNK5Exiv29TimeValue4sizeEv:
 1014|    694|size_t TimeValue::size() const {
 1015|    694|  return 11;
 1016|    694|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1018|  3.22k|TimeValue* TimeValue::clone_() const {
 1019|  3.22k|  return new TimeValue(*this);
 1020|  3.22k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  761|  5.99k|  auto printWarning = [] {
  762|  5.99k|#ifndef SUPPRESS_WARNINGS
  763|  5.99k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  5.99k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 5.99k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  5.99k|  LogMsg(LogMsg::warn).os()
  ------------------
  764|  5.99k|#endif
  765|  5.99k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  781|  3.07k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  10.2k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (782:30): [True: 8.36k, False: 1.91k]
  ------------------
  783|  8.36k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (783:13): [True: 1.15k, False: 7.20k]
  ------------------
  784|  1.15k|          printWarning();
  785|  1.15k|          return 1;
  786|  1.15k|        }
  787|  8.36k|      }
  788|  1.91k|      dest = std::stoul(buf.substr(start, count));
  789|  1.91k|      return 0;
  790|  3.07k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  896|  7.42k|  auto printWarning = [] {
  897|  7.42k|#ifndef SUPPRESS_WARNINGS
  898|  7.42k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  7.42k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.42k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.42k|  LogMsg(LogMsg::warn).os()
  ------------------
  899|  7.42k|#endif
  900|  7.42k|    return 1;
  901|  7.42k|  };

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

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

_ZN5Exiv28Xmpdatum4ImplC2ERKNS_6XmpKeyEPKNS_5ValueE:
  253|   142k|Xmpdatum::Impl::Impl(const XmpKey& key, const Value* pValue) : key_(key.clone()) {
  254|   142k|  if (pValue)
  ------------------
  |  Branch (254:7): [True: 90.9k, False: 51.9k]
  ------------------
  255|  90.9k|    value_ = pValue->clone();
  256|   142k|}
_ZN5Exiv28Xmpdatum4ImplC2ERKS1_:
  258|   177k|Xmpdatum::Impl::Impl(const Impl& rhs) {
  259|   177k|  if (rhs.key_)
  ------------------
  |  Branch (259:7): [True: 177k, False: 0]
  ------------------
  260|   177k|    key_ = rhs.key_->clone();  // deep copy
  261|   177k|  if (rhs.value_)
  ------------------
  |  Branch (261:7): [True: 177k, False: 0]
  ------------------
  262|   177k|    value_ = rhs.value_->clone();  // deep copy
  263|   177k|}
_ZN5Exiv28Xmpdatum4ImplaSERKS1_:
  265|  1.96k|Xmpdatum::Impl& Xmpdatum::Impl::operator=(const Impl& rhs) {
  266|  1.96k|  if (this == &rhs)
  ------------------
  |  Branch (266:7): [True: 0, False: 1.96k]
  ------------------
  267|      0|    return *this;
  268|  1.96k|  key_.reset();
  269|  1.96k|  if (rhs.key_)
  ------------------
  |  Branch (269:7): [True: 1.96k, False: 0]
  ------------------
  270|  1.96k|    key_ = rhs.key_->clone();  // deep copy
  271|  1.96k|  value_.reset();
  272|  1.96k|  if (rhs.value_)
  ------------------
  |  Branch (272:7): [True: 1.96k, False: 0]
  ------------------
  273|  1.96k|    value_ = rhs.value_->clone();  // deep copy
  274|  1.96k|  return *this;
  275|  1.96k|}
_ZN5Exiv28XmpdatumC2ERKNS_6XmpKeyEPKNS_5ValueE:
  277|   142k|Xmpdatum::Xmpdatum(const XmpKey& key, const Value* pValue) : p_(std::make_unique<Impl>(key, pValue)) {
  278|   142k|}
_ZN5Exiv28XmpdatumC2ERKS0_:
  280|   177k|Xmpdatum::Xmpdatum(const Xmpdatum& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
  281|   177k|}
_ZN5Exiv28XmpdatumaSERKS0_:
  283|  1.96k|Xmpdatum& Xmpdatum::operator=(const Xmpdatum& rhs) {
  284|  1.96k|  if (this == &rhs)
  ------------------
  |  Branch (284:7): [True: 0, False: 1.96k]
  ------------------
  285|      0|    return *this;
  286|  1.96k|  *p_ = *rhs.p_;
  287|  1.96k|  return *this;
  288|  1.96k|}
_ZN5Exiv28XmpdatumD2Ev:
  290|   320k|Xmpdatum::~Xmpdatum() = default;
_ZNK5Exiv28Xmpdatum3keyEv:
  292|  8.78M|std::string Xmpdatum::key() const {
  293|  8.78M|  return p_->key_ ? p_->key_->key() : "";
  ------------------
  |  Branch (293:10): [True: 8.78M, False: 0]
  ------------------
  294|  8.78M|}
_ZNK5Exiv28Xmpdatum9groupNameEv:
  300|  81.5k|std::string Xmpdatum::groupName() const {
  301|  81.5k|  return p_->key_ ? p_->key_->groupName() : "";
  ------------------
  |  Branch (301:10): [True: 81.5k, False: 0]
  ------------------
  302|  81.5k|}
_ZNK5Exiv28Xmpdatum7tagNameEv:
  304|   236k|std::string Xmpdatum::tagName() const {
  305|   236k|  return p_->key_ ? p_->key_->tagName() : "";
  ------------------
  |  Branch (305:10): [True: 236k, False: 0]
  ------------------
  306|   236k|}
_ZNK5Exiv28Xmpdatum6typeIdEv:
  320|   404k|TypeId Xmpdatum::typeId() const {
  321|   404k|  return p_->value_ ? p_->value_->typeId() : invalidTypeId;
  ------------------
  |  Branch (321:10): [True: 404k, False: 0]
  ------------------
  322|   404k|}
_ZNK5Exiv28Xmpdatum5countEv:
  332|   148k|size_t Xmpdatum::count() const {
  333|   148k|  return p_->value_ ? p_->value_->count() : 0;
  ------------------
  |  Branch (333:10): [True: 148k, False: 0]
  ------------------
  334|   148k|}
_ZNK5Exiv28Xmpdatum8toStringEv:
  340|  3.03k|std::string Xmpdatum::toString() const {
  341|  3.03k|  return p_->value_ ? p_->value_->toString() : "";
  ------------------
  |  Branch (341:10): [True: 3.03k, False: 0]
  ------------------
  342|  3.03k|}
_ZNK5Exiv28Xmpdatum8toStringEm:
  344|   335k|std::string Xmpdatum::toString(size_t n) const {
  345|   335k|  return p_->value_ ? p_->value_->toString(n) : "";
  ------------------
  |  Branch (345:10): [True: 335k, False: 0]
  ------------------
  346|   335k|}
_ZNK5Exiv28Xmpdatum5valueEv:
  364|   242k|const Value& Xmpdatum::value() const {
  365|   242k|  if (!p_->value_)
  ------------------
  |  Branch (365:7): [True: 0, False: 242k]
  ------------------
  366|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  367|   242k|  return *p_->value_;
  368|   242k|}
_ZN5Exiv28Xmpdatum8setValueEPKNS_5ValueE:
  378|  18.5k|void Xmpdatum::setValue(const Value* pValue) {
  379|  18.5k|  p_->value_.reset();
  380|  18.5k|  if (pValue)
  ------------------
  |  Branch (380:7): [True: 18.5k, False: 0]
  ------------------
  381|  18.5k|    p_->value_ = pValue->clone();
  382|  18.5k|}
_ZN5Exiv28Xmpdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  384|   621k|int Xmpdatum::setValue(const std::string& value) {
  385|   621k|  XmpProperties::XmpLock lock;
  386|   621k|  if (!p_->value_) {
  ------------------
  |  Branch (386:7): [True: 42.5k, False: 578k]
  ------------------
  387|  42.5k|    TypeId type = xmpText;
  388|  42.5k|    if (p_->key_) {
  ------------------
  |  Branch (388:9): [True: 42.5k, False: 0]
  ------------------
  389|  42.5k|      type = XmpProperties::propertyTypeUnlocked(*p_->key_.get(), lock);
  390|  42.5k|    }
  391|  42.5k|    p_->value_ = Value::create(type);
  392|  42.5k|  }
  393|   621k|  return p_->value_->read(value);
  394|   621k|}
_ZN5Exiv27XmpDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  396|   642k|Xmpdatum& XmpData::operator[](const std::string& key) {
  397|   642k|  XmpProperties::XmpLock lock;
  398|   642k|  XmpKey xmpKey(key, lock);
  399|   642k|  auto pos = std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(xmpKey));
  400|   642k|  if (pos == xmpMetadata_.end()) {
  ------------------
  |  Branch (400:7): [True: 51.9k, False: 590k]
  ------------------
  401|  51.9k|    return xmpMetadata_.emplace_back(xmpKey);
  402|  51.9k|  }
  403|   590k|  return *pos;
  404|   642k|}
_ZN5Exiv27XmpData3addERKNS_6XmpKeyEPKNS_5ValueE:
  406|  3.83k|int XmpData::add(const XmpKey& key, const Value* value) {
  407|  3.83k|  XmpProperties::XmpLock lock;
  408|  3.83k|  return addUnlocked(key, value, lock);
  409|  3.83k|}
_ZN5Exiv27XmpData11addUnlockedERKNS_6XmpKeyEPKNS_5ValueERKNS_13XmpProperties7XmpLockE:
  411|  90.9k|int XmpData::addUnlocked(const XmpKey& key, const Value* value, const XmpProperties::XmpLock&) {
  412|  90.9k|  xmpMetadata_.emplace_back(key, value);
  413|  90.9k|  return 0;
  414|  90.9k|}
_ZNK5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  426|  14.9k|XmpData::const_iterator XmpData::findKey(const XmpKey& key) const {
  427|  14.9k|  XmpProperties::XmpLock lock;
  428|  14.9k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  429|  14.9k|}
_ZN5Exiv27XmpData7findKeyERKNS_6XmpKeyE:
  431|   252k|XmpData::iterator XmpData::findKey(const XmpKey& key) {
  432|   252k|  XmpProperties::XmpLock lock;
  433|   252k|  return std::find_if(xmpMetadata_.begin(), xmpMetadata_.end(), FindXmpdatum(key));
  434|   252k|}
_ZN5Exiv27XmpData5clearEv:
  436|  37.4k|void XmpData::clear() {
  437|  37.4k|  XmpProperties::XmpLock lock;
  438|  37.4k|  clearUnlocked(lock);
  439|  37.4k|}
_ZN5Exiv27XmpData13clearUnlockedERKNS_13XmpProperties7XmpLockE:
  441|  43.4k|void XmpData::clearUnlocked(const XmpProperties::XmpLock&) {
  442|  43.4k|  xmpMetadata_.clear();
  443|  43.4k|  nsBindings_.clear();
  444|  43.4k|}
_ZNK5Exiv27XmpData5beginEv:
  455|  2.43k|XmpData::const_iterator XmpData::begin() const {
  456|  2.43k|  return xmpMetadata_.begin();
  457|  2.43k|}
_ZNK5Exiv27XmpData3endEv:
  459|  17.3k|XmpData::const_iterator XmpData::end() const {
  460|  17.3k|  return xmpMetadata_.end();
  461|  17.3k|}
_ZNK5Exiv27XmpData5emptyEv:
  463|  2.05k|bool XmpData::empty() const {
  464|  2.05k|  XmpProperties::XmpLock lock;
  465|  2.05k|  return emptyUnlocked(lock);
  466|  2.05k|}
_ZNK5Exiv27XmpData13emptyUnlockedERKNS_13XmpProperties7XmpLockE:
  468|  30.7k|bool XmpData::emptyUnlocked(const XmpProperties::XmpLock&) const {
  469|  30.7k|  return xmpMetadata_.empty();
  470|  30.7k|}
_ZN5Exiv27XmpData5beginEv:
  481|  5.66k|XmpData::iterator XmpData::begin() {
  482|  5.66k|  return xmpMetadata_.begin();
  483|  5.66k|}
_ZN5Exiv27XmpData3endEv:
  485|   258k|XmpData::iterator XmpData::end() {
  486|   258k|  return xmpMetadata_.end();
  487|   258k|}
_ZN5Exiv27XmpData5eraseENSt3__111__wrap_iterIPNS_8XmpdatumEEE:
  489|    942|XmpData::iterator XmpData::erase(XmpData::iterator pos) {
  490|    942|  XmpProperties::XmpLock lock;
  491|    942|  return xmpMetadata_.erase(pos);
  492|    942|}
_ZN5Exiv227xmpToolkitEnsureInitializedEv:
  538|  81.2k|void xmpToolkitEnsureInitialized() {
  539|  81.2k|  static XmpToolkitLifetimeManager instance;
  540|  81.2k|  (void)instance;
  541|  81.2k|}
_ZN5Exiv29XmpParser14registerNsImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  543|  46.5k|void XmpParser::registerNsImpl(const std::string& ns, const std::string& prefix) {
  544|  46.5k|  xmpToolkitEnsureInitialized();
  545|  46.5k|  try {
  546|  46.5k|    std::string existingPrefix;
  547|  46.5k|    if (SXMPMeta::GetNamespacePrefix(ns.c_str(), &existingPrefix)) {
  ------------------
  |  Branch (547:9): [True: 46.5k, False: 8]
  ------------------
  548|  46.5k|      if (!existingPrefix.empty() && existingPrefix.back() == ':') {
  ------------------
  |  Branch (548:11): [True: 46.5k, False: 0]
  |  Branch (548:38): [True: 46.5k, False: 0]
  ------------------
  549|  46.5k|        existingPrefix.pop_back();
  550|  46.5k|      }
  551|  46.5k|      if (existingPrefix == prefix) {
  ------------------
  |  Branch (551:11): [True: 46.1k, False: 427]
  ------------------
  552|       |        // Already registered correctly, skip overhead
  553|  46.1k|        return;
  554|  46.1k|      }
  555|  46.5k|    }
  556|       |
  557|    435|    SXMPMeta::DeleteNamespace(ns.c_str());
  558|       |#ifdef EXV_ADOBE_XMPSDK
  559|       |    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(), nullptr);
  560|       |#else
  561|    435|    SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
  562|    435|#endif
  563|    435|  } catch (const XMP_Error& /* e */) {
  564|       |    // throw Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg());
  565|      0|  }
  566|  46.5k|}
_ZN5Exiv29XmpParser6decodeERNS_7XmpDataERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKNS_12DecodeParamsE:
  663|  6.72k|int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket, const DecodeParams& dp) {
  664|  6.72k|  try {
  665|  6.72k|    xmpData.setPacket(xmpPacket);
  666|  6.72k|    if (xmpPacket.empty()) {
  ------------------
  |  Branch (666:9): [True: 711, False: 6.01k]
  ------------------
  667|    711|      xmpData.clear();
  668|    711|      return 0;
  669|    711|    }
  670|       |
  671|       |    // Acquire Giant Lock
  672|  6.01k|    XmpProperties::XmpLock lock;
  673|  6.01k|    try {
  674|  6.01k|      xmpToolkitEnsureInitialized();
  675|  6.01k|    } catch (const Error&) {
  676|      0|#ifndef SUPPRESS_WARNINGS
  677|      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()
  ------------------
  678|      0|#endif
  679|      0|      return 2;
  680|      0|    }
  681|       |
  682|  6.01k|    xmpData.clearUnlocked(lock);
  683|       |
  684|       |    // Make sure the unterminated substring is used
  685|  6.01k|    size_t len = xmpPacket.size();
  686|  1.01M|    while (len > 0 && 0 == xmpPacket[len - 1])
  ------------------
  |  Branch (686:12): [True: 1.01M, False: 230]
  |  Branch (686:23): [True: 1.01M, False: 5.78k]
  ------------------
  687|  1.01M|      --len;
  688|       |
  689|  6.01k|    XMLValidator::check(xmpPacket.data(), len, dp);
  690|  6.01k|    SXMPMeta meta(xmpPacket.data(), static_cast<XMP_StringLen>(len));
  691|  6.01k|    SXMPIterator iter(meta);
  692|  6.01k|    std::string schemaNs;
  693|  6.01k|    std::string propPath;
  694|  6.01k|    std::string propValue;
  695|  6.01k|    XMP_OptionBits opt = 0;
  696|   100k|    while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
  ------------------
  |  Branch (696:12): [True: 94.6k, False: 6.01k]
  ------------------
  697|  94.6k|      printNode(schemaNs, propPath, propValue, opt);
  698|  94.6k|      if (XMP_PropIsAlias(opt)) {
  ------------------
  |  Branch (698:11): [True: 0, False: 94.6k]
  ------------------
  699|      0|        throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
  700|      0|      }
  701|  94.6k|      if (XMP_NodeIsSchema(opt)) {
  ------------------
  |  Branch (701:11): [True: 7.51k, False: 87.1k]
  ------------------
  702|       |        // Register unknown namespaces with Exiv2
  703|       |        // (Namespaces are automatically registered with the XMP Toolkit)
  704|  7.51k|        std::string prefix = XmpProperties::prefixUnlocked(schemaNs, lock);
  705|  7.51k|        if (prefix.empty()) {
  ------------------
  |  Branch (705:13): [True: 6.11k, False: 1.39k]
  ------------------
  706|  6.11k|          if (!SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &prefix))
  ------------------
  |  Branch (706:15): [True: 0, False: 6.11k]
  ------------------
  707|      0|            throw Error(ErrorCode::kerSchemaNamespaceNotRegistered, schemaNs);
  708|  6.11k|          prefix.pop_back();
  709|       |          // Hardening: a parsed packet must not silently rebind a prefix that is
  710|       |          // already globally bound -- a built-in standard prefix, or one a prior
  711|       |          // explicit registerNs() established -- to a different URI.  Letting it
  712|       |          // would poison every later write and lookup in this process (the
  713|       |          // namespace-leak bug).  The packet's own binding is still captured
  714|       |          // per-instance below, so this object round-trips faithfully; we just
  715|       |          // don't pollute the global registry on a read.
  716|  6.11k|          if (!XmpProperties::prefixIsBoundUnlocked(prefix, lock))
  ------------------
  |  Branch (716:15): [True: 30, False: 6.08k]
  ------------------
  717|     30|            XmpProperties::registerNsUnlocked(schemaNs, prefix, lock);
  718|  6.11k|        }
  719|       |        // Record the prefix->URI binding exactly as declared by THIS packet so
  720|       |        // encode() can resolve each property's URI from the data it came from,
  721|       |        // rather than from the process-global registry which another image may
  722|       |        // have rebound (e.g. to a corrupted URI).  See XmpData::nsBindings().
  723|  7.51k|        xmpData.nsBindings_[prefix] = schemaNs;
  724|  7.51k|        continue;
  725|  7.51k|      }
  726|  87.1k|      auto key = makeXmpKey(schemaNs, propPath, lock);
  727|  87.1k|      if (XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (727:11): [True: 932, False: 86.1k]
  ------------------
  728|       |        // Read Lang Alt property
  729|    932|        auto val = std::make_unique<LangAltValue>();
  730|    932|        XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  731|  8.13k|        while (count-- > 0) {
  ------------------
  |  Branch (731:16): [True: 7.20k, False: 931]
  ------------------
  732|       |          // Get the text
  733|  7.20k|          bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  734|  7.20k|          printNode(schemaNs, propPath, propValue, opt);
  735|  7.20k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropHasLang(opt)) {
  ------------------
  |  Branch (735:15): [True: 0, False: 7.20k]
  |  Branch (735:28): [True: 0, False: 7.20k]
  |  Branch (735:54): [True: 1, False: 7.20k]
  ------------------
  736|      1|            throw Error(ErrorCode::kerDecodeLangAltPropertyFailed, propPath, opt);
  737|      1|          }
  738|  7.20k|          std::string text = propValue;
  739|       |          // Get the language qualifier
  740|  7.20k|          haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
  741|  7.20k|          printNode(schemaNs, propPath, propValue, opt);
  742|  7.20k|          if (!haveNext || !XMP_PropIsSimple(opt) || !XMP_PropIsQualifier(opt) ||
  ------------------
  |  Branch (742:15): [True: 0, False: 7.20k]
  |  Branch (742:15): [True: 0, False: 7.20k]
  |  Branch (742:28): [True: 0, False: 7.20k]
  |  Branch (742:54): [True: 0, False: 7.20k]
  ------------------
  743|  7.20k|              propPath.substr(propPath.size() - 8, 8) != "xml:lang") {
  ------------------
  |  Branch (743:15): [True: 0, False: 7.20k]
  ------------------
  744|      0|            throw Error(ErrorCode::kerDecodeLangAltQualifierFailed, propPath, opt);
  745|      0|          }
  746|  7.20k|          val->value_[propValue] = std::move(text);
  747|  7.20k|        }
  748|    931|        xmpData.addUnlocked(*key, val.get(), lock);
  749|    931|        continue;
  750|    932|      }
  751|  86.1k|      if (XMP_PropIsArray(opt) && !XMP_PropHasQualifiers(opt) && !XMP_ArrayIsAltText(opt)) {
  ------------------
  |  Branch (751:11): [True: 1.93k, False: 84.2k]
  |  Branch (751:35): [True: 1.93k, False: 0]
  |  Branch (751:66): [True: 1.93k, False: 0]
  ------------------
  752|       |        // Check if all elements are simple
  753|  1.93k|        bool simpleArray = true;
  754|  1.93k|        SXMPIterator aIter(meta, schemaNs.c_str(), propPath.c_str());
  755|  1.93k|        std::string aSchemaNs;
  756|  1.93k|        std::string aPropPath;
  757|  1.93k|        std::string aPropValue;
  758|  1.93k|        XMP_OptionBits aOpt = 0;
  759|  69.6k|        while (aIter.Next(&aSchemaNs, &aPropPath, &aPropValue, &aOpt)) {
  ------------------
  |  Branch (759:16): [True: 68.0k, False: 1.64k]
  ------------------
  760|  68.0k|          if (propPath == aPropPath)
  ------------------
  |  Branch (760:15): [True: 1.93k, False: 66.0k]
  ------------------
  761|  1.93k|            continue;
  762|  66.0k|          if (!XMP_PropIsSimple(aOpt) || XMP_PropHasQualifiers(aOpt) || XMP_PropIsQualifier(aOpt) ||
  ------------------
  |  Branch (762:15): [True: 157, False: 65.9k]
  |  Branch (762:42): [True: 134, False: 65.7k]
  |  Branch (762:73): [True: 0, False: 65.7k]
  ------------------
  763|  66.0k|              XMP_NodeIsSchema(aOpt) || XMP_PropIsAlias(aOpt)) {
  ------------------
  |  Branch (763:15): [True: 0, False: 65.7k]
  |  Branch (763:41): [True: 0, False: 65.7k]
  ------------------
  764|    291|            simpleArray = false;
  765|    291|            break;
  766|    291|          }
  767|  66.0k|        }
  768|  1.93k|        if (simpleArray) {
  ------------------
  |  Branch (768:13): [True: 1.64k, False: 291]
  ------------------
  769|       |          // Read the array into an XmpArrayValue
  770|  1.64k|          auto val = std::make_unique<XmpArrayValue>(arrayValueTypeId(opt));
  771|  1.64k|          XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
  772|  67.3k|          while (count-- > 0) {
  ------------------
  |  Branch (772:18): [True: 65.7k, False: 1.64k]
  ------------------
  773|  65.7k|            iter.Next(&schemaNs, &propPath, &propValue, &opt);
  774|  65.7k|            printNode(schemaNs, propPath, propValue, opt);
  775|  65.7k|            val->read(propValue);
  776|  65.7k|          }
  777|  1.64k|          xmpData.addUnlocked(*key, val.get(), lock);
  778|  1.64k|          continue;
  779|  1.64k|        }
  780|  1.93k|      }
  781|       |
  782|  84.5k|      auto val = std::make_unique<XmpTextValue>();
  783|  84.5k|      if (XMP_PropIsStruct(opt) || XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (783:11): [True: 7.06k, False: 77.4k]
  |  Branch (783:36): [True: 291, False: 77.1k]
  ------------------
  784|       |        // Create a metadatum with only XMP options
  785|  7.35k|        val->setXmpArrayType(xmpArrayType(opt));
  786|  7.35k|        val->setXmpStruct(xmpStruct(opt));
  787|  7.35k|        xmpData.addUnlocked(*key, val.get(), lock);
  788|  7.35k|        continue;
  789|  7.35k|      }
  790|  77.1k|      if (XMP_PropIsSimple(opt) || XMP_PropIsQualifier(opt)) {
  ------------------
  |  Branch (790:11): [True: 77.1k, False: 0]
  |  Branch (790:36): [True: 0, False: 0]
  ------------------
  791|  77.1k|        val->read(propValue);
  792|  77.1k|        xmpData.addUnlocked(*key, val.get(), lock);
  793|  77.1k|        continue;
  794|  77.1k|      }
  795|       |      // Don't let any node go by unnoticed
  796|      0|      throw Error(ErrorCode::kerUnhandledXmpNode, key->key(), opt);
  797|  77.1k|    }  // iterate through all XMP nodes
  798|       |
  799|  6.01k|    return 0;
  800|  6.01k|  }
  801|  6.72k|#ifndef SUPPRESS_WARNINGS
  802|  6.72k|  catch (const Error& e) {
  803|     49|    if (e.code() == ErrorCode::kerXMPToolkitError) {
  ------------------
  |  Branch (803:9): [True: 0, False: 49]
  ------------------
  804|       |      // Initialization failures caught above, this handles other XMP errors if any wrapped in Error
  805|      0|    }
  806|     49|    throw;
  807|  2.69k|  } catch (const XMP_Error& e) {
  808|  2.69k|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|  2.69k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.69k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.69k|  LogMsg(LogMsg::error).os()
  ------------------
  809|  2.69k|    xmpData.clear();
  810|  2.69k|    return 3;
  811|  2.69k|  }
  812|       |#else
  813|       |  catch (const XMP_Error&) {
  814|       |    xmpData.clear();
  815|       |    return 3;
  816|       |  }
  817|       |#endif  // SUPPRESS_WARNINGS
  818|  6.72k|}  // XmpParser::decode
_ZN5Exiv29XmpParser6encodeERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_7XmpDataEtj:
  832|  28.6k|int XmpParser::encode(std::string& xmpPacket, const XmpData& xmpData, uint16_t formatFlags, uint32_t padding) {
  833|  28.6k|  try {
  834|       |    // Acquire Giant Lock
  835|  28.6k|    XmpProperties::XmpLock lock;
  836|  28.6k|    try {
  837|  28.6k|      xmpToolkitEnsureInitialized();
  838|  28.6k|    } catch (const Error&) {
  839|      0|#ifndef SUPPRESS_WARNINGS
  840|      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()
  ------------------
  841|      0|#endif
  842|      0|      return 2;
  843|      0|    }
  844|       |
  845|  28.6k|    if (xmpData.emptyUnlocked(lock)) {
  ------------------
  |  Branch (845:9): [True: 26.2k, False: 2.43k]
  ------------------
  846|  26.2k|      xmpPacket.clear();
  847|  26.2k|      return 0;
  848|  26.2k|    }  // We are holding the Giant Lock, so we can iterate nsRegistry_ safely.
  849|       |    // XmpProperties interactions must go through Unlocked/impl methods to avoid deadlocks.
  850|  46.5k|    for (const auto& [xmp, uri] : XmpProperties::nsRegistry_) {
  ------------------
  |  Branch (850:33): [True: 46.5k, False: 2.43k]
  ------------------
  851|       |#ifdef EXIV2_DEBUG_MESSAGES
  852|       |      std::cerr << "Registering " << uri.prefix_ << " : " << xmp << "\n";
  853|       |#endif
  854|       |      // registerNsImpl is safe since we hold the lock
  855|  46.5k|      registerNsImpl(xmp, uri.prefix_);
  856|  46.5k|    }
  857|       |
  858|       |    // Note: we deliberately do NOT re-register the per-instance bindings with
  859|       |    // the toolkit here.  Every URI they contain was already registered while its
  860|       |    // packet was parsed in decode() (custom ones are also in nsRegistry_, handled
  861|       |    // above), so SetProperty resolves them.  Re-registering would overwrite the
  862|       |    // toolkit's URI->prefix mapping whenever our preferred prefix differs from the
  863|       |    // one the file used for that URI (e.g. iptc vs Iptc4xmpCore), which breaks
  864|       |    // serialization of struct fields that still carry the file's prefix.
  865|  2.43k|    SXMPMeta meta;
  866|  81.5k|    for (const auto& xmp : xmpData) {
  ------------------
  |  Branch (866:26): [True: 81.5k, False: 2.43k]
  ------------------
  867|  81.5k|      const std::string ns = resolveNamespace(xmpData, xmp.groupName(), lock);
  868|  81.5k|      XMP_OptionBits options = 0;
  869|       |
  870|  81.5k|      if (xmp.typeId() == langAlt) {
  ------------------
  |  Branch (870:11): [True: 757, False: 80.7k]
  ------------------
  871|       |        // Encode Lang Alt property
  872|    757|        const auto la = dynamic_cast<const LangAltValue*>(&xmp.value());
  873|    757|        if (!la)
  ------------------
  |  Branch (873:13): [True: 0, False: 757]
  ------------------
  874|      0|          throw Error(ErrorCode::kerEncodeLangAltPropertyFailed, xmp.key());
  875|       |
  876|    757|        int idx = 1;
  877|  2.74k|        for (const auto& [lang, specs] : la->value_) {
  ------------------
  |  Branch (877:40): [True: 2.74k, False: 757]
  ------------------
  878|  2.74k|          if (!specs.empty()) {  // remove lang specs with no value
  ------------------
  |  Branch (878:15): [True: 2.71k, False: 30]
  ------------------
  879|  2.71k|            printNode(ns, xmp.tagName(), specs, 0);
  880|  2.71k|            meta.AppendArrayItem(ns.c_str(), xmp.tagName().c_str(), kXMP_PropArrayIsAlternate, specs.c_str());
  881|  2.71k|            const std::string item = xmp.tagName() + "[" + toString(idx++) + "]";
  882|  2.71k|            meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", lang.c_str());
  883|  2.71k|          }
  884|  2.74k|        }
  885|    757|        continue;
  886|    757|      }
  887|       |
  888|       |      // Todo: Xmpdatum should have an XmpValue, not a Value
  889|  80.7k|      const auto val = dynamic_cast<const XmpValue*>(&xmp.value());
  890|  80.7k|      if (!val)
  ------------------
  |  Branch (890:11): [True: 0, False: 80.7k]
  ------------------
  891|      0|        throw Error(ErrorCode::kerInvalidKeyXmpValue, xmp.key(), xmp.typeName());
  892|  80.7k|      options = xmpArrayOptionBits(val->xmpArrayType()) | xmpArrayOptionBits(val->xmpStruct());
  893|  80.7k|      if (xmp.typeId() == xmpBag || xmp.typeId() == xmpSeq || xmp.typeId() == xmpAlt) {
  ------------------
  |  Branch (893:11): [True: 181, False: 80.5k]
  |  Branch (893:37): [True: 998, False: 79.5k]
  |  Branch (893:63): [True: 209, False: 79.3k]
  ------------------
  894|  1.38k|        printNode(ns, xmp.tagName(), "", options);
  895|  1.38k|        meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  896|  68.1k|        for (size_t idx = 0; idx < xmp.count(); ++idx) {
  ------------------
  |  Branch (896:30): [True: 66.7k, False: 1.38k]
  ------------------
  897|  66.7k|          const std::string item = xmp.tagName() + "[" + toString(idx + 1) + "]";
  898|  66.7k|          printNode(ns, item, xmp.toString(static_cast<long>(idx)), 0);
  899|  66.7k|          meta.SetProperty(ns.c_str(), item.c_str(), xmp.toString(static_cast<long>(idx)).c_str());
  900|  66.7k|        }
  901|  1.38k|        continue;
  902|  1.38k|      }
  903|  79.3k|      if (xmp.typeId() == xmpText) {
  ------------------
  |  Branch (903:11): [True: 79.3k, False: 0]
  ------------------
  904|  79.3k|        const auto xt = dynamic_cast<const XmpTextValue*>(&xmp.value());
  905|  79.3k|        if (xmp.count() == 0 || xt->xmpStruct() != XmpValue::xsNone || xt->xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (905:13): [True: 1.81k, False: 77.5k]
  |  Branch (905:33): [True: 6.18k, False: 71.3k]
  |  Branch (905:72): [True: 258, False: 71.1k]
  ------------------
  906|  8.25k|          printNode(ns, xmp.tagName(), "", options);
  907|  8.25k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), nullptr, options);
  908|  71.1k|        } else {
  909|  71.1k|          printNode(ns, xmp.tagName(), xmp.toString(0), options);
  910|  71.1k|          meta.SetProperty(ns.c_str(), xmp.tagName().c_str(), xmp.toString(0).c_str(), options);
  911|  71.1k|        }
  912|  79.3k|        continue;
  913|  79.3k|      }
  914|       |      // Don't let any Xmpdatum go by unnoticed
  915|      0|      throw Error(ErrorCode::kerUnhandledXmpdatum, xmp.tagName(), xmp.typeName());
  916|  79.3k|    }
  917|  2.43k|    std::string tmpPacket;
  918|  2.43k|    meta.SerializeToBuffer(&tmpPacket, xmpFormatOptionBits(static_cast<XmpFormatFlags>(formatFlags)),
  919|  2.43k|                           padding);  // throws
  920|  2.43k|    xmpPacket = std::move(tmpPacket);
  921|       |
  922|  2.43k|    return 0;
  923|  2.43k|  }
  924|  28.6k|#ifndef SUPPRESS_WARNINGS
  925|  28.6k|  catch (const Error& /* e */) {
  926|      0|    throw;
  927|    183|  } catch (const XMP_Error& e) {
  928|    183|    EXV_ERROR << Error(ErrorCode::kerXMPToolkitError, e.GetID(), e.GetErrMsg()) << "\n";
  ------------------
  |  |  142|    183|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 183]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    183|  LogMsg(LogMsg::error).os()
  ------------------
  929|    183|    return 3;
  930|    183|  }
  931|       |#else
  932|       |  catch (const XMP_Error&) {
  933|       |    return 3;
  934|       |  }
  935|       |#endif  // SUPPRESS_WARNINGS
  936|  28.6k|}  // XmpParser::encode
_ZN5Exiv29XmpParser10makeXmpKeyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 1098|  87.1k|                                                      const XmpProperties::XmpLock& lock) {
 1099|  87.1k|  std::string property;
 1100|  87.1k|  std::string::size_type idx = propPath.find(':');
 1101|  87.1k|  if (idx == std::string::npos) {
  ------------------
  |  Branch (1101:7): [True: 0, False: 87.1k]
  ------------------
 1102|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerPropertyNameIdentificationFailed, propPath, schemaNs);
 1103|      0|  }
 1104|       |  // Don't worry about out_of_range, XMP parser takes care of this
 1105|  87.1k|  property = propPath.substr(idx + 1);
 1106|  87.1k|  std::string prefix = Exiv2::XmpProperties::prefixUnlocked(schemaNs, lock);
 1107|  87.1k|  if (prefix.empty()) {
  ------------------
  |  Branch (1107:7): [True: 22.6k, False: 64.4k]
  ------------------
 1108|       |    // The namespace was intentionally not registered globally (e.g. a packet
 1109|       |    // that rebinds an already-bound prefix to a different URI -- see the
 1110|       |    // hardening in decode()).  Fall back to the prefix the toolkit parsed so
 1111|       |    // the property still gets a key; its URI is preserved per-instance.
 1112|  22.6k|    std::string toolkitPrefix;
 1113|  22.6k|    if (SXMPMeta::GetNamespacePrefix(schemaNs.c_str(), &toolkitPrefix)) {
  ------------------
  |  Branch (1113:9): [True: 22.6k, False: 0]
  ------------------
 1114|  22.6k|      toolkitPrefix.pop_back();
 1115|  22.6k|      prefix = std::move(toolkitPrefix);
 1116|  22.6k|    }
 1117|  22.6k|  }
 1118|  87.1k|  if (prefix.empty()) {
  ------------------
  |  Branch (1118:7): [True: 0, False: 87.1k]
  ------------------
 1119|      0|    throw Exiv2::Error(Exiv2::ErrorCode::kerNoPrefixForNamespace, propPath, schemaNs);
 1120|      0|  }
 1121|  87.1k|  return Exiv2::XmpKey::UniquePtr(new Exiv2::XmpKey(prefix, property, lock));
 1122|  87.1k|}  // makeXmpKey
_ZN5Exiv29XmpParser16resolveNamespaceERKNS_7XmpDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 1125|  81.5k|                                               const XmpProperties::XmpLock& lock) {
 1126|  81.5k|  const auto& nsBindings = xmpData.nsBindings();
 1127|  81.5k|  const auto binding = nsBindings.find(prefix);
 1128|  81.5k|  return binding != nsBindings.end() ? binding->second : XmpProperties::nsUnlocked(prefix, lock);
  ------------------
  |  Branch (1128:10): [True: 80.9k, False: 568]
  ------------------
 1129|  81.5k|}  // resolveNamespace
xmp.cpp:_ZNK12_GLOBAL__N_112FindXmpdatumclERKN5Exiv28XmpdatumE:
  203|  8.73M|  bool operator()(const Exiv2::Xmpdatum& xmpdatum) const {
  204|  8.73M|    return key_ == xmpdatum.key();
  205|  8.73M|  }
xmp.cpp:_ZN12_GLOBAL__N_112FindXmpdatumC2ERKN5Exiv26XmpKeyE:
  197|   910k|  explicit FindXmpdatum(const Exiv2::XmpKey& key) : key_(key.key()) {
  198|   910k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator5checkEPKcmRKN5Exiv212DecodeParamsE:
   67|  6.01k|  static void check(const char* buf, size_t buflen, const DecodeParams& dp) {
   68|  6.01k|    XMLValidator validator(dp.max_recursion_depth());
   69|  6.01k|    validator.check_internal(buf, buflen);
   70|  6.01k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorC2Em:
   79|  6.01k|      max_recursion_depth_(max_recursion_depth), parser_(XML_ParserCreateNS(nullptr, '@')) {
   80|  6.01k|    if (!parser_) {
  ------------------
  |  Branch (80:9): [True: 0, False: 6.01k]
  ------------------
   81|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Could not create expat parser");
   82|      0|    }
   83|  6.01k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14check_internalEPKcm:
  104|  6.01k|  void check_internal(const char* buf, size_t buflen) {
  105|  6.01k|    if (buflen > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (105:9): [True: 0, False: 6.01k]
  ------------------
  106|      0|      throw Error(ErrorCode::kerXMPToolkitError, "Buffer length is greater than INT_MAX");
  107|      0|    }
  108|       |
  109|  6.01k|    XML_SetUserData(parser_, this);
  110|  6.01k|    XML_SetElementHandler(parser_, startElement_cb, endElement_cb);
  111|  6.01k|    XML_SetNamespaceDeclHandler(parser_, startNamespace_cb, endNamespace_cb);
  112|  6.01k|    XML_SetStartDoctypeDeclHandler(parser_, startDTD_cb);
  113|       |
  114|  6.01k|    if (XML_Parse(parser_, buf, static_cast<int>(buflen), true) == XML_STATUS_ERROR) {
  ------------------
  |  Branch (114:9): [True: 1.42k, False: 4.59k]
  ------------------
  115|  1.42k|      setError(XML_ErrorString(XML_GetErrorCode(parser_)));
  116|  1.42k|    }
  117|       |
  118|  6.01k|    if (haserror_) {
  ------------------
  |  Branch (118:9): [True: 1.42k, False: 4.59k]
  ------------------
  119|  1.42k|      throw XMP_Error(kXMPErr_BadXML, "Error in XMLValidator");
  120|  1.42k|    }
  121|  6.01k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15startElement_cbEPvPKcPS3_:
  160|   139k|  static void XMLCALL startElement_cb(void* userData, const XML_Char* name, const XML_Char** attrs) noexcept {
  161|   139k|    static_cast<XMLValidator*>(userData)->startElement(name, attrs);
  162|   139k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12startElementEPKcPS2_:
  123|   139k|  void startElement(const XML_Char*, const XML_Char**) noexcept {
  124|   139k|    if (element_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (124:9): [True: 656, False: 138k]
  ------------------
  125|    656|      setError("Too deeply nested");
  126|    656|    }
  127|   139k|    ++element_depth_;
  128|   139k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator13endElement_cbEPvPKc:
  166|   124k|  static void XMLCALL endElement_cb(void* userData, const XML_Char* name) noexcept {
  167|   124k|    static_cast<XMLValidator*>(userData)->endElement(name);
  168|   124k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator10endElementEPKc:
  130|   124k|  void endElement(const XML_Char*) noexcept {
  131|   124k|    if (element_depth_ > 0) {
  ------------------
  |  Branch (131:9): [True: 124k, False: 0]
  ------------------
  132|   124k|      --element_depth_;
  133|   124k|    } else {
  134|      0|      setError("Negative depth");
  135|      0|    }
  136|   124k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator17startNamespace_cbEPvPKcS3_:
  172|  41.8k|  static void XMLCALL startNamespace_cb(void* userData, const XML_Char* prefix, const XML_Char* uri) noexcept {
  173|  41.8k|    static_cast<XMLValidator*>(userData)->startNamespace(prefix, uri);
  174|  41.8k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator14startNamespaceEPKcS2_:
  138|  41.8k|  void startNamespace(const XML_Char*, const XML_Char*) noexcept {
  139|  41.8k|    if (namespace_depth_ > max_recursion_depth_) {
  ------------------
  |  Branch (139:9): [True: 280, False: 41.5k]
  ------------------
  140|    280|      setError("Too deeply nested");
  141|    280|    }
  142|  41.8k|    ++namespace_depth_;
  143|  41.8k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator15endNamespace_cbEPvPKc:
  178|  33.3k|  static void XMLCALL endNamespace_cb(void* userData, const XML_Char* prefix) noexcept {
  179|  33.3k|    static_cast<XMLValidator*>(userData)->endNamespace(prefix);
  180|  33.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator12endNamespaceEPKc:
  145|  33.3k|  void endNamespace(const XML_Char*) noexcept {
  146|  33.3k|    if (namespace_depth_ > 0) {
  ------------------
  |  Branch (146:9): [True: 33.3k, False: 0]
  ------------------
  147|  33.3k|      --namespace_depth_;
  148|  33.3k|    } else {
  149|      0|      setError("Negative depth");
  150|      0|    }
  151|  33.3k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator11startDTD_cbEPvPKcS3_S3_i:
  183|     34|                                  const XML_Char* pubid, int has_internal_subset) noexcept {
  184|     34|    static_cast<XMLValidator*>(userData)->startDTD(doctypeName, sysid, pubid, has_internal_subset);
  185|     34|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8startDTDEPKcS2_S2_i:
  153|     34|  void startDTD(const XML_Char*, const XML_Char*, const XML_Char*, int) noexcept {
  154|       |    // DOCTYPE is used for XXE attacks.
  155|     34|    setError("DOCTYPE not supported");
  156|     34|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidator8setErrorEPKc:
   89|  2.39k|  void setError(const char* msg) {
   90|  2.39k|    const XML_Size errlinenum = XML_GetCurrentLineNumber(parser_);
   91|  2.39k|    const XML_Size errcolnum = XML_GetCurrentColumnNumber(parser_);
   92|  2.39k|#ifndef SUPPRESS_WARNINGS
   93|  2.39k|    EXV_INFO << "Invalid XML at line " << errlinenum << ", column " << errcolnum << ": " << msg << "\n";
  ------------------
  |  |  134|  2.39k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 2.39k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  2.39k|  LogMsg(LogMsg::info).os()
  ------------------
   94|  2.39k|#endif
   95|       |    // If this is the first error, then save it.
   96|  2.39k|    if (!haserror_) {
  ------------------
  |  Branch (96:9): [True: 1.42k, False: 970]
  ------------------
   97|  1.42k|      haserror_ = true;
   98|  1.42k|      errmsg_ = msg;
   99|  1.42k|      errlinenum_ = errlinenum;
  100|  1.42k|      errcolnum_ = errcolnum;
  101|  1.42k|    }
  102|  2.39k|  }
xmp.cpp:_ZN12_GLOBAL__N_112XMLValidatorD2Ev:
   85|  6.01k|  ~XMLValidator() {
   86|  6.01k|    XML_ParserFree(parser_);
   87|  6.01k|  }
xmp.cpp:_ZN12_GLOBAL__N_19xmpStructEj:
  955|  7.35k|Exiv2::XmpValue::XmpStruct xmpStruct(XMP_OptionBits opt) {
  956|  7.35k|  Exiv2::XmpValue::XmpStruct var(Exiv2::XmpValue::xsNone);
  957|  7.35k|  if (XMP_PropIsStruct(opt)) {
  ------------------
  |  Branch (957:7): [True: 7.06k, False: 291]
  ------------------
  958|  7.06k|    var = Exiv2::XmpValue::xsStruct;
  959|  7.06k|  }
  960|  7.35k|  return var;
  961|  7.35k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue9XmpStructE:
  963|  80.7k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpStruct xs) {
  964|  80.7k|  XMP_OptionBits var(0);
  965|  80.7k|  switch (xs) {
  ------------------
  |  Branch (965:11): [True: 80.7k, False: 0]
  ------------------
  966|  74.5k|    case Exiv2::XmpValue::xsNone:
  ------------------
  |  Branch (966:5): [True: 74.5k, False: 6.18k]
  ------------------
  967|  74.5k|      break;
  968|  6.18k|    case Exiv2::XmpValue::xsStruct:
  ------------------
  |  Branch (968:5): [True: 6.18k, False: 74.5k]
  ------------------
  969|  6.18k|      XMP_SetOption(var, kXMP_PropValueIsStruct);
  970|  6.18k|      break;
  971|  80.7k|  }
  972|  80.7k|  return var;
  973|  80.7k|}
xmp.cpp:_ZN12_GLOBAL__N_116arrayValueTypeIdEj:
  975|  9.00k|Exiv2::TypeId arrayValueTypeId(XMP_OptionBits opt) {
  976|  9.00k|  Exiv2::TypeId typeId(Exiv2::invalidTypeId);
  977|  9.00k|  if (XMP_PropIsArray(opt)) {
  ------------------
  |  Branch (977:7): [True: 1.93k, False: 7.06k]
  ------------------
  978|  1.93k|    if (XMP_ArrayIsAlternate(opt))
  ------------------
  |  Branch (978:9): [True: 374, False: 1.56k]
  ------------------
  979|    374|      typeId = Exiv2::xmpAlt;
  980|  1.56k|    else if (XMP_ArrayIsOrdered(opt))
  ------------------
  |  Branch (980:14): [True: 1.26k, False: 297]
  ------------------
  981|  1.26k|      typeId = Exiv2::xmpSeq;
  982|    297|    else if (XMP_ArrayIsUnordered(opt))
  ------------------
  |  Branch (982:14): [True: 297, False: 0]
  ------------------
  983|    297|      typeId = Exiv2::xmpBag;
  984|  1.93k|  }
  985|  9.00k|  return typeId;
  986|  9.00k|}
xmp.cpp:_ZN12_GLOBAL__N_112xmpArrayTypeEj:
  988|  7.35k|Exiv2::XmpValue::XmpArrayType xmpArrayType(XMP_OptionBits opt) {
  989|  7.35k|  return Exiv2::XmpValue::xmpArrayType(arrayValueTypeId(opt));
  990|  7.35k|}
xmp.cpp:_ZN12_GLOBAL__N_118xmpArrayOptionBitsEN5Exiv28XmpValue12XmpArrayTypeE:
  992|  80.7k|XMP_OptionBits xmpArrayOptionBits(Exiv2::XmpValue::XmpArrayType xat) {
  993|  80.7k|  XMP_OptionBits var(0);
  994|  80.7k|  switch (xat) {
  ------------------
  |  Branch (994:11): [True: 80.7k, False: 0]
  ------------------
  995|  79.1k|    case Exiv2::XmpValue::xaNone:
  ------------------
  |  Branch (995:5): [True: 79.1k, False: 1.64k]
  ------------------
  996|  79.1k|      break;
  997|    278|    case Exiv2::XmpValue::xaAlt:
  ------------------
  |  Branch (997:5): [True: 278, False: 80.4k]
  ------------------
  998|    278|      XMP_SetOption(var, kXMP_PropValueIsArray);
  999|    278|      XMP_SetOption(var, kXMP_PropArrayIsAlternate);
 1000|    278|      break;
 1001|  1.18k|    case Exiv2::XmpValue::xaSeq:
  ------------------
  |  Branch (1001:5): [True: 1.18k, False: 79.5k]
  ------------------
 1002|  1.18k|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1003|  1.18k|      XMP_SetOption(var, kXMP_PropArrayIsOrdered);
 1004|  1.18k|      break;
 1005|    183|    case Exiv2::XmpValue::xaBag:
  ------------------
  |  Branch (1005:5): [True: 183, False: 80.5k]
  ------------------
 1006|    183|      XMP_SetOption(var, kXMP_PropValueIsArray);
 1007|    183|      break;
 1008|  80.7k|  }
 1009|  80.7k|  return var;
 1010|  80.7k|}
xmp.cpp:_ZN12_GLOBAL__N_119xmpFormatOptionBitsEN5Exiv29XmpParser14XmpFormatFlagsE:
 1016|  2.24k|XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags) {
 1017|  2.24k|  XMP_OptionBits var(0);
 1018|  2.24k|  if (flags & Exiv2::XmpParser::omitPacketWrapper)
  ------------------
  |  Branch (1018:7): [True: 1.06k, False: 1.18k]
  ------------------
 1019|  1.06k|    var |= kXMP_OmitPacketWrapper;
 1020|  2.24k|  if (flags & Exiv2::XmpParser::readOnlyPacket)
  ------------------
  |  Branch (1020:7): [True: 0, False: 2.24k]
  ------------------
 1021|      0|    var |= kXMP_ReadOnlyPacket;
 1022|  2.24k|  if (flags & Exiv2::XmpParser::useCompactFormat)
  ------------------
  |  Branch (1022:7): [True: 2.24k, False: 0]
  ------------------
 1023|  2.24k|    var |= kXMP_UseCompactFormat;
 1024|  2.24k|  if (flags & Exiv2::XmpParser::includeThumbnailPad)
  ------------------
  |  Branch (1024:7): [True: 0, False: 2.24k]
  ------------------
 1025|      0|    var |= kXMP_IncludeThumbnailPad;
 1026|  2.24k|  if (flags & Exiv2::XmpParser::exactPacketLength)
  ------------------
  |  Branch (1026:7): [True: 0, False: 2.24k]
  ------------------
 1027|      0|    var |= kXMP_ExactPacketLength;
 1028|  2.24k|  if (flags & Exiv2::XmpParser::writeAliasComments)
  ------------------
  |  Branch (1028:7): [True: 0, False: 2.24k]
  ------------------
 1029|      0|    var |= kXMP_WriteAliasComments;
 1030|  2.24k|  if (flags & Exiv2::XmpParser::omitAllFormatting)
  ------------------
  |  Branch (1030:7): [True: 15, False: 2.23k]
  ------------------
 1031|     15|    var |= kXMP_OmitAllFormatting;
 1032|  2.24k|  return var;
 1033|  2.24k|}
xmp.cpp:_ZN12_GLOBAL__N_19printNodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_j:
 1091|   324k|void printNode(const std::string&, const std::string&, const std::string&, XMP_OptionBits) {
 1092|   324k|}
_ZN5Exiv28Xmpdatum4ImplD2Ev:
  246|   320k|  ~Impl() = default;

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

_ZN5Exiv210XmpSidecarC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   30|  2.00k|    Image(ImageType::xmp, mdXmp, std::move(io), params) {
   31|  2.00k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (31:7): [True: 0, False: 2.00k]
  |  Branch (31:26): [True: 0, False: 0]
  ------------------
   32|      0|    IoCloser closer(*io_);
   33|      0|    io_->write(reinterpret_cast<const byte*>(xmlHeader), xmlHdrCnt);
   34|      0|  }
   35|  2.00k|}  // XmpSidecar::XmpSidecar
_ZN5Exiv210XmpSidecar12readMetadataEv:
   46|  2.00k|void XmpSidecar::readMetadata() {
   47|       |#ifdef EXIV2_DEBUG_MESSAGES
   48|       |  std::cerr << "Reading XMP file " << io_->path() << "\n";
   49|       |#endif
   50|  2.00k|  if (io_->open() != 0) {
  ------------------
  |  Branch (50:7): [True: 0, False: 2.00k]
  ------------------
   51|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   52|      0|  }
   53|  2.00k|  IoCloser closer(*io_);
   54|       |  // Ensure that this is the correct image type
   55|  2.00k|  if (!isXmpType(*io_, false)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.00k]
  ------------------
   56|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  |  Branch (56:25): [True: 0, False: 0]
  ------------------
   57|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
   58|      0|    throw Error(ErrorCode::kerNotAnImage, "XMP");
   59|      0|  }
   60|       |  // Read the XMP packet from the IO stream
   61|  2.00k|  std::string xmpPacket;
   62|  2.00k|  const long len = 64 * 1024;
   63|  2.00k|  auto buf = std::make_unique<byte[]>(len);
   64|  4.84k|  while (auto l = io_->read(buf.get(), len)) {
  ------------------
  |  Branch (64:15): [True: 2.83k, False: 2.00k]
  ------------------
   65|  2.83k|    xmpPacket.append(reinterpret_cast<char*>(buf.get()), l);
   66|  2.83k|  }
   67|  2.00k|  if (io_->error())
  ------------------
  |  Branch (67:7): [True: 0, False: 2.00k]
  ------------------
   68|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
   69|  2.00k|  clearMetadata();
   70|  2.00k|  xmpPacket_ = std::move(xmpPacket);
   71|  2.00k|  const DecodeParams dp(max_recursion_depth_);
   72|  2.00k|  if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (72:7): [True: 2.00k, False: 1]
  |  Branch (72:30): [True: 278, False: 1.72k]
  ------------------
   73|    278|#ifndef SUPPRESS_WARNINGS
   74|    278|    EXV_WARNING << "Failed to decode XMP metadata.\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()
  ------------------
   75|    278|#endif
   76|    278|  }
   77|       |
   78|       |  // #1112 - store dates to deal with loss of TZ information during conversions
   79|  10.3k|  for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (79:24): [True: 10.3k, False: 2.00k]
  ------------------
   80|  10.3k|    std::string key(xmp.key());
   81|  10.3k|    if (Internal::contains(key, "Date")) {
  ------------------
  |  Branch (81:9): [True: 968, False: 9.35k]
  ------------------
   82|    968|      dates_[key] = xmp.value().toString();
   83|    968|    }
   84|  10.3k|  }
   85|       |
   86|  2.00k|  copyXmpToIptc(xmpData_, iptcData_);
   87|  2.00k|  copyXmpToExif(xmpData_, exifData_);
   88|  2.00k|}  // XmpSidecar::readMetadata
_ZN5Exiv210XmpSidecar13writeMetadataEv:
   94|  1.88k|void XmpSidecar::writeMetadata() {
   95|  1.88k|  if (io_->open() != 0) {
  ------------------
  |  Branch (95:7): [True: 0, False: 1.88k]
  ------------------
   96|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
   97|      0|  }
   98|  1.88k|  IoCloser closer(*io_);
   99|       |
  100|  1.88k|  if (!writeXmpFromPacket()) {
  ------------------
  |  Branch (100:7): [True: 1.88k, False: 0]
  ------------------
  101|       |    // #589 copy XMP tags
  102|  1.88k|    Exiv2::XmpData copy;
  103|  10.2k|    for (const auto& xmp : xmpData_) {
  ------------------
  |  Branch (103:26): [True: 10.2k, False: 1.88k]
  ------------------
  104|  10.2k|      if (!matchi(xmp.key(), "exif") && !matchi(xmp.key(), "iptc")) {
  ------------------
  |  Branch (104:11): [True: 9.47k, False: 778]
  |  Branch (104:11): [True: 9.40k, False: 847]
  |  Branch (104:41): [True: 9.40k, False: 69]
  ------------------
  105|  9.40k|        copy[xmp.key()] = xmp.value();
  106|  9.40k|      }
  107|  10.2k|    }
  108|       |
  109|       |    // run the converters
  110|  1.88k|    copyExifToXmp(exifData_, xmpData_);
  111|  1.88k|    copyIptcToXmp(iptcData_, xmpData_);
  112|       |
  113|       |    // #1112 - restore dates if they lost their TZ info
  114|  1.88k|    for (const auto& [sKey, value_orig] : dates_) {
  ------------------
  |  Branch (114:41): [True: 898, False: 1.88k]
  ------------------
  115|    898|      Exiv2::XmpKey key(sKey);
  116|    898|      if (xmpData_.findKey(key) != xmpData_.end()) {
  ------------------
  |  Branch (116:11): [True: 895, False: 3]
  ------------------
  117|    895|        std::string value_now(xmpData_[sKey].value().toString());
  118|       |        // std::cout << key << " -> " << value_now << " => " << value_orig << '\n';
  119|    895|        if (Internal::contains(value_orig, value_now.substr(0, 10))) {
  ------------------
  |  Branch (119:13): [True: 796, False: 99]
  ------------------
  120|    796|          xmpData_[sKey] = value_orig;
  121|    796|        }
  122|    895|      }
  123|    898|    }
  124|       |
  125|       |    // #589 - restore tags which were modified by the converters
  126|  9.14k|    for (const auto& xmp : copy) {
  ------------------
  |  Branch (126:26): [True: 9.14k, False: 1.88k]
  ------------------
  127|  9.14k|      xmpData_[xmp.key()] = xmp.value();
  128|  9.14k|    }
  129|       |
  130|  1.88k|    if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::omitPacketWrapper | XmpParser::useCompactFormat) > 1) {
  ------------------
  |  Branch (130:9): [True: 101, False: 1.78k]
  ------------------
  131|    101|#ifndef SUPPRESS_WARNINGS
  132|    101|      EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|    101|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 101]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    101|  LogMsg(LogMsg::error).os()
  ------------------
  133|    101|#endif
  134|    101|    }
  135|  1.88k|  }
  136|  1.88k|  if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (136:7): [True: 1.17k, False: 718]
  ------------------
  137|  1.17k|    if (!xmpPacket_.starts_with("<?xml")) {
  ------------------
  |  Branch (137:9): [True: 1.17k, False: 0]
  ------------------
  138|  1.17k|      xmpPacket_ = xmlHeader + xmpPacket_ + xmlFooter;
  139|  1.17k|    }
  140|  1.17k|    MemIo tempIo;
  141|       |
  142|       |    // Write XMP packet
  143|  1.17k|    if (tempIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (143:9): [True: 0, False: 1.17k]
  ------------------
  144|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  145|  1.17k|    if (tempIo.error())
  ------------------
  |  Branch (145:9): [True: 0, False: 1.17k]
  ------------------
  146|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  147|  1.17k|    io_->close();
  148|  1.17k|    io_->transfer(tempIo);  // may throw
  149|  1.17k|  }
  150|  1.88k|}  // XmpSidecar::writeMetadata
_ZN5Exiv214newXmpInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  154|  2.00k|Image::UniquePtr newXmpInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  155|  2.00k|  auto image = std::make_unique<XmpSidecar>(std::move(io), params);
  156|  2.00k|  if (!image->good()) {
  ------------------
  |  Branch (156:7): [True: 0, False: 2.00k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  2.00k|  return image;
  160|  2.00k|}
_ZN5Exiv29isXmpTypeERNS_7BasicIoEb:
  162|  20.8k|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|  20.8k|  const int32_t len = 80;
  171|  20.8k|  byte buf[len];
  172|  20.8k|  iIo.read(buf, xmlHdrCnt + 1);
  173|  20.8k|  if (iIo.eof() && 0 == strncmp(reinterpret_cast<const char*>(buf), xmlHeader, xmlHdrCnt)) {
  ------------------
  |  Branch (173:7): [True: 348, False: 20.4k]
  |  Branch (173:20): [True: 3, False: 345]
  ------------------
  174|      3|    return true;
  175|      3|  }
  176|  20.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (176:7): [True: 0, False: 20.7k]
  |  Branch (176:22): [True: 345, False: 20.4k]
  ------------------
  177|    345|    return false;
  178|    345|  }
  179|  20.4k|  iIo.read(buf + xmlHdrCnt + 1, len - xmlHdrCnt - 1);
  180|  20.4k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (180:7): [True: 0, False: 20.4k]
  |  Branch (180:22): [True: 77, False: 20.3k]
  ------------------
  181|     77|    return false;
  182|     77|  }
  183|       |  // Skip leading BOM
  184|  20.3k|  int32_t start = 0;
  185|  20.3k|  if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
  ------------------
  |  Branch (185:7): [True: 111, False: 20.2k]
  ------------------
  186|    111|    start = 3;
  187|    111|  }
  188|  20.3k|  bool rc = false;
  189|  20.3k|  std::string head(reinterpret_cast<const char*>(buf + start), len - start);
  190|  20.3k|  if (head.starts_with("<?xml")) {
  ------------------
  |  Branch (190:7): [True: 163, False: 20.2k]
  ------------------
  191|       |    // Forward to the next tag
  192|    163|    auto it = std::find(head.begin() + 5, head.end(), '<');
  193|    163|    if (it != head.end())
  ------------------
  |  Branch (193:9): [True: 143, False: 20]
  ------------------
  194|    143|      head = head.substr(std::distance(head.begin(), it));
  195|    163|  }
  196|  20.3k|  if (head.starts_with("<?xpacket") || head.starts_with("<x:xmpmeta")) {
  ------------------
  |  Branch (196:7): [True: 2.73k, False: 17.6k]
  |  Branch (196:40): [True: 3.28k, False: 14.3k]
  ------------------
  197|  6.02k|    rc = true;
  198|  6.02k|  }
  199|  20.3k|  if (!advance || !rc) {
  ------------------
  |  Branch (199:7): [True: 20.3k, False: 0]
  |  Branch (199:19): [True: 0, False: 0]
  ------------------
  200|  20.3k|    iIo.seek(-(len - start), BasicIo::cur);  // Swallow the BOM
  201|  20.3k|  }
  202|  20.3k|  return rc;
  203|  20.4k|}
xmpsidecar.cpp:_ZN5Exiv2L6matchiERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKc:
   90|  19.7k|static bool matchi(const std::string& key, const char* substr) {
   91|  19.7k|  return Internal::contains(Internal::lower(key), substr);
   92|  19.7k|}

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

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  4.07k|{
  625|  4.07k|	IgnoreParam(options);
  ------------------
  |  |  117|  4.07k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  4.07k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  4.07k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  4.07k|{
  647|       |
  648|  4.07k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     25|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 25, False: 4.05k]
  ------------------
  649|  4.05k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  4.05k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  4.05k|{
  664|  4.05k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  4.05k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  4.05k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  4.05k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  21.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 17.6k, False: 4.05k]
  ------------------
  670|  17.6k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 13.3k, False: 4.26k]
  ------------------
  671|  4.26k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  4.26k|	}
  673|       |
  674|  4.05k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  7.81k|{
  695|  7.81k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  7.81k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 3.57k, False: 4.23k]
  |  Branch (696:45): [True: 21, False: 3.55k]
  ------------------
  697|     21|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|     21|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  7.79k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 4.26k, False: 3.52k]
  |  Branch (700:21): [True: 96, False: 4.17k]
  ------------------
  701|     96|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     96|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  7.69k|	} else {
  703|  7.69k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  7.69k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  7.69k|	}
  706|       |
  707|  7.79k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   233k|{
  265|   233k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   233k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 232k, False: 251]
  |  Branch (269:28): [True: 102k, False: 130k]
  ------------------
  270|       |
  271|   102k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 84.0k, False: 18.5k]
  ------------------
  272|  84.0k|			term = kRDFTerm_li;
  273|  84.0k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 10, False: 18.4k]
  ------------------
  274|     10|			term = kRDFTerm_parseType;
  275|  18.4k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 4.26k, False: 14.2k]
  ------------------
  276|  4.26k|			term = kRDFTerm_Description;
  277|  14.2k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 992, False: 13.2k]
  ------------------
  278|    992|			term = kRDFTerm_about;
  279|  13.2k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 36, False: 13.1k]
  ------------------
  280|     36|			term = kRDFTerm_resource;
  281|  13.1k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 19, False: 13.1k]
  ------------------
  282|     19|			term = kRDFTerm_RDF;
  283|  13.1k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 101, False: 13.0k]
  ------------------
  284|    101|			term = kRDFTerm_ID;
  285|  13.0k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 67, False: 13.0k]
  ------------------
  286|     67|			term = kRDFTerm_nodeID;
  287|  13.0k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 10, False: 12.9k]
  ------------------
  288|     10|			term = kRDFTerm_datatype;
  289|  12.9k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 10, False: 12.9k]
  ------------------
  290|     10|			term = kRDFTerm_aboutEach;
  291|  12.9k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 10, False: 12.9k]
  ------------------
  292|     10|			term = kRDFTerm_aboutEachPrefix;
  293|  12.9k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 34, False: 12.9k]
  ------------------
  294|     34|			term = kRDFTerm_bagID;
  295|     34|		}
  296|       |
  297|   102k|	}
  298|       |
  299|   233k|	return term;
  300|       |
  301|   233k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  7.69k|{
  732|  7.69k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  7.69k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  7.69k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  23.3k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 15.9k, False: 7.38k]
  ------------------
  738|       |
  739|  15.9k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  15.9k|		switch ( attrTerm ) {
  742|       |
  743|     55|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 55, False: 15.9k]
  ------------------
  744|     66|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 11, False: 15.9k]
  ------------------
  745|  1.05k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 992, False: 14.9k]
  ------------------
  746|       |
  747|  1.05k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|      8|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 8, False: 1.05k]
  ------------------
  748|  1.05k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.05k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.02k, False: 25]
  |  Branch (750:24): [True: 985, False: 40]
  ------------------
  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|    985|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|    985|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|    985|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 876, False: 109]
  ------------------
  755|    876|						xmpParent->name = (*currAttr)->value;
  756|    876|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 87, False: 22]
  ------------------
  757|     87|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     68|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 68, False: 19]
  ------------------
  758|     19|					}
  759|    985|				}
  760|       |
  761|    982|				break;
  762|       |
  763|  14.8k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 14.8k, False: 1.12k]
  ------------------
  764|  14.8k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  14.8k|				break;
  766|       |
  767|     70|			default :
  ------------------
  |  Branch (767:4): [True: 70, False: 15.9k]
  ------------------
  768|     70|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     70|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  15.9k|		}
  771|       |
  772|  15.9k|	}
  773|       |
  774|  7.69k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   130k|{
  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|   130k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 234, False: 130k]
  ------------------
  371|    234|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    234|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   130k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   130k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   130k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   130k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   130k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 21.2k, False: 108k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  21.2k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  21.2k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  21.2k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  21.2k|#define kXMP_CreateNodes	true
  ------------------
  384|  21.2k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  21.2k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  10.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 10.1k, False: 11.1k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  21.2k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  21.2k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 21.2k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  21.2k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   130k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 46.1k, False: 83.9k]
  ------------------
  398|  46.1k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  46.1k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 42, False: 46.0k]
  ------------------
  399|     42|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     42|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  46.1k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   130k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   130k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 129k, False: 33]
  |  Branch (406:26): [True: 12, False: 21]
  ------------------
  407|   129k|		 xmpParent->children.push_back ( newChild );
  408|   129k|	} else {
  409|     31|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|     31|	}
  411|   130k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 33, False: 129k]
  ------------------
  412|     33|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     22|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 22, False: 11]
  |  Branch (412:22): [True: 0, False: 11]
  ------------------
  413|     11|		xmpParent->options |= kRDF_HasValueElem;
  414|     11|	}
  415|       |	
  416|   129k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 83.9k, False: 46.0k]
  ------------------
  417|  83.9k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      9|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 9, False: 83.8k]
  ------------------
  418|  83.8k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  83.8k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  83.8k|	}
  423|       |	
  424|   129k|	return newChild;
  425|       |
  426|   129k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  7.69k|{
  787|  7.69k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  7.69k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   291k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 284k, False: 7.60k]
  ------------------
  791|   284k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 192k, False: 92.0k]
  ------------------
  792|  92.0k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 90, False: 91.9k]
  ------------------
  793|     90|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|     90|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  91.9k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  91.9k|	}
  797|       |
  798|  7.69k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  91.9k|{
  854|  91.9k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  91.9k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     47|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 47, False: 91.9k]
  ------------------
  856|       |	
  857|  91.9k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 4.53k, False: 87.3k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  4.53k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  87.3k|	} 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|  87.3k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  87.3k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  87.3k|		XMP_VarString * attrName = 0;
  870|       |
  871|  96.1k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 13.6k, False: 82.5k]
  ------------------
  872|  13.6k|			attrName = &((*currAttr)->name);
  873|  13.6k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 4.89k, False: 8.78k]
  |  Branch (873:38): [True: 4.87k, False: 23]
  ------------------
  874|  13.6k|		}
  875|       |
  876|  87.3k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 4.87k, False: 82.5k]
  ------------------
  877|       |
  878|  4.87k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  4.87k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  4.87k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  4.87k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 49, False: 4.82k]
  ------------------
  882|     49|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  4.82k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 4.43k, False: 396]
  ------------------
  884|  4.43k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  4.43k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 6, False: 390]
  ------------------
  886|      6|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    390|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 311, False: 79]
  ------------------
  888|    311|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    311|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 0, False: 79]
  ------------------
  890|      0|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|     79|			} else {
  892|     79|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|     79|			}
  894|       |
  895|  82.5k|		} else {
  896|       |
  897|       |			// Only rdf:ID and xml:lang, could be a resourcePropertyElt, a literalPropertyElt, or an.
  898|       |			// emptyPropertyElt. Look at the child XML nodes to decide which.
  899|       |
  900|  82.5k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 370, False: 82.1k]
  ------------------
  901|       |
  902|    370|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  82.1k|			} else {
  905|       |			
  906|  82.1k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  82.1k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|   206k|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 127k, False: 78.5k]
  ------------------
  910|   127k|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 3.60k, False: 124k]
  ------------------
  911|   127k|				}
  912|       |				
  913|  82.1k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 78.5k, False: 3.60k]
  ------------------
  914|  78.5k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  78.5k|				} else {
  916|  3.60k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  3.60k|				}
  918|       |			
  919|  82.1k|			}
  920|       |
  921|  82.5k|		}
  922|       |		
  923|  87.3k|	}
  924|       |
  925|  91.9k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  91.9k|{
  350|       |
  351|  91.9k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 28, False: 91.9k]
  |  Branch (351:42): [True: 1, False: 91.9k]
  ------------------
  352|  91.9k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  91.9k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  91.9k|{
  334|       |
  335|  91.9k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 1, False: 91.9k]
  |  Branch (335:39): [True: 1, False: 0]
  ------------------
  336|  91.9k|	return false;
  337|       |
  338|  91.9k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  91.9k|{
  317|       |
  318|  91.9k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 84.0k, False: 7.90k]
  |  Branch (318:40): [True: 18, False: 84.0k]
  ------------------
  319|  91.9k|	return false;
  320|       |
  321|  91.9k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  9.33k|{
 1190|  9.33k|	bool hasPropertyAttrs = false;
 1191|  9.33k|	bool hasResourceAttr  = false;
 1192|  9.33k|	bool hasNodeIDAttr    = false;
 1193|  9.33k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  9.33k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  9.33k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     85|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 85, False: 9.25k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  9.25k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  9.25k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|  68.7k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 59.5k, False: 9.22k]
  ------------------
 1205|       |
 1206|  59.5k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  59.5k|		switch ( attrTerm ) {
 1209|       |
 1210|     23|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 23, False: 59.4k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     23|				break;
 1213|       |
 1214|     35|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 35, False: 59.4k]
  ------------------
 1215|     35|				if ( hasNodeIDAttr ) XMP_Throw ( "Empty property element can't have both rdf:resource and rdf:nodeID", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1215:10): [True: 0, False: 35]
  ------------------
 1216|     35|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      6|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 6, False: 29]
  ------------------
 1217|     29|				hasResourceAttr = true;
 1218|     29|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 29, False: 0]
  ------------------
 1219|     29|				break;
 1220|       |
 1221|     33|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 33, False: 59.4k]
  ------------------
 1222|     33|				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: 23]
  ------------------
 1223|     23|				hasNodeIDAttr = true;
 1224|     23|				break;
 1225|       |
 1226|  59.4k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 59.4k, False: 101]
  ------------------
 1227|  59.4k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 1.49k, False: 57.9k]
  ------------------
 1228|  1.49k|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 3, False: 1.49k]
  ------------------
 1229|  1.49k|					hasValueAttr = true;
 1230|  1.49k|					valueNode = *currAttr;
 1231|  57.9k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 57.8k, False: 90]
  ------------------
 1232|  57.8k|					hasPropertyAttrs = true;
 1233|  57.8k|				}
 1234|  59.4k|				break;
 1235|       |
 1236|  59.4k|			default :
  ------------------
  |  Branch (1236:4): [True: 10, False: 59.5k]
  ------------------
 1237|     10|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  59.5k|		}
 1241|       |
 1242|  59.5k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  9.22k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  9.22k|	bool childIsStruct = false;
 1250|       |	
 1251|  9.22k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 1.50k, False: 7.71k]
  ------------------
 1252|  1.50k|		childNode->value = valueNode->value;
 1253|  1.50k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 16, False: 1.48k]
  ------------------
 1254|  7.71k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 7.29k, False: 428]
  ------------------
 1255|  7.29k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  7.29k|		childIsStruct = true;
 1257|  7.29k|	}
 1258|       |		
 1259|  9.22k|	currAttr = xmlNode.attrs.begin();
 1260|  9.22k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|  68.4k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 59.3k, False: 9.12k]
  ------------------
 1263|       |
 1264|  59.3k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 1.49k, False: 57.8k]
  ------------------
 1265|  57.8k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  57.8k|		switch ( attrTerm ) {
 1268|       |
 1269|     23|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 23, False: 57.8k]
  ------------------
 1270|     46|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 23, False: 57.8k]
  ------------------
 1271|     46|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 57.8k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  57.7k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 57.7k, False: 46]
  ------------------
 1278|  57.7k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 34.0k, False: 23.7k]
  |  Branch (1278:31): [True: 13, False: 23.7k]
  ------------------
 1279|  34.0k|					AddQualifierNode ( childNode, **currAttr );
 1280|  34.0k|				} else {
 1281|  23.7k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  23.7k|				}
 1283|  57.7k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 57.8k]
  ------------------
 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|  57.8k|		}
 1290|       |
 1291|  57.8k|	}
 1292|       |
 1293|  9.22k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  42.7k|{
  484|  42.7k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 24, False: 42.7k]
  ------------------
  485|     24|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     24|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  486|      0|	}
  487|       |	
  488|  42.7k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  42.7k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  42.8k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  42.8k|	const bool isLang = (name == "xml:lang");
  443|  42.8k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  42.8k|	XMP_Node * newQual = 0;
  446|       |
  447|  42.8k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  42.8k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 33.9k, False: 8.89k]
  ------------------
  450|  33.9k|			xmpParent->qualifiers.push_back ( newQual );
  451|  33.9k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 8.77k, False: 116]
  ------------------
  452|  8.77k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 8.76k, False: 12]
  ------------------
  453|  8.76k|				xmpParent->qualifiers.push_back ( newQual );
  454|  8.76k|			} else {
  455|     12|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     12|			}
  457|  8.77k|			xmpParent->options |= kXMP_PropHasLang;
  458|  8.77k|		} else {
  459|    116|			XMP_Assert ( isType );
  ------------------
  |  |  142|    116|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    116|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 89, False: 27]
  ------------------
  461|     89|				xmpParent->qualifiers.push_back ( newQual );
  462|     89|			} else {
  463|     27|				size_t offset = 0;
  464|     27|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 16, False: 11]
  ------------------
  465|     27|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|     27|			}
  467|    116|			xmpParent->options |= kXMP_PropHasType;
  468|    116|		}
  469|       |
  470|  42.8k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  42.8k|	return newQual;
  473|       |
  474|  42.8k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  78.5k|{
 1015|  78.5k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  78.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  78.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  87.3k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 8.77k, False: 78.5k]
  ------------------
 1021|  8.77k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  8.77k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 8.67k, False: 97]
  ------------------
 1023|  8.67k|			AddQualifierNode ( newChild, **currAttr );
 1024|  8.67k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 7, False: 90]
  |  Branch (1024:41): [True: 49, False: 41]
  ------------------
 1025|     56|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     56|		} else {
 1027|     41|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     41|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  8.77k|	}
 1030|       |	
 1031|  78.5k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  78.5k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  78.5k|	size_t      textSize  = 0;
 1034|       |
 1035|   195k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 117k, False: 78.5k]
  ------------------
 1036|   117k|		if ( (*currChild)->kind != kCDataNode ) XMP_Throw ( "Invalid child of literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      7|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1036:8): [True: 7, False: 117k]
  ------------------
 1037|   117k|		textSize += (*currChild)->value.size();
 1038|   117k|	}
 1039|       |	
 1040|  78.5k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|   195k|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 117k, False: 78.5k]
  ------------------
 1043|   117k|		newChild->value += (*currChild)->value;
 1044|   117k|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  78.5k|}	// RDF_LiteralPropertyElement
ParseRDF.cpp:_ZL35RDF_ParseTypeLiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1064|      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|    311|{
 1087|       |
 1088|    311|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    311|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    311|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    311|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    622|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 311, False: 311]
  ------------------
 1095|    311|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    311|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 311, False: 0]
  ------------------
 1097|    311|			continue;	// ! The caller ensured the value is "Resource".
 1098|    311|		} 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|    311|	}
 1106|       |
 1107|    311|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    311|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 311]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    311|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL18FixupQualifiedNodeP8XMP_Node:
  504|     11|{
  505|     11|	size_t qualNum, qualLim;
  506|     11|	size_t childNum, childLim;
  507|       |
  508|     11|	XMP_Enforce ( (xmpParent->options & kXMP_PropValueIsStruct) && (! xmpParent->children.empty()) );
  ------------------
  |  |  148|     22|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:11): [True: 11, False: 0]
  |  |  |  Branch (148:11): [True: 11, 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|     11|	XMP_Node * valueNode = xmpParent->children[0];
  511|     11|	XMP_Enforce ( valueNode->name == "rdf:value" );
  ------------------
  |  |  148|     11|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 11]
  |  |  ------------------
  |  |  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|     11|	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|     11|	qualNum = 0;
  521|     11|	qualLim = valueNode->qualifiers.size();
  522|       |	
  523|     11|	if ( valueNode->options & kXMP_PropHasLang ) {
  ------------------
  |  Branch (523:7): [True: 0, False: 11]
  ------------------
  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|     11|	for ( ; qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (544:10): [True: 0, False: 11]
  ------------------
  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|     11|	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|    101|	for ( childNum = 1, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (562:61): [True: 90, False: 11]
  ------------------
  563|       |
  564|     90|		XMP_Node * currQual = xmpParent->children[childNum];
  565|       |	
  566|     90|			bool isLang = (currQual->name == "xml:lang");
  567|       |			
  568|     90|			currQual->options |= kXMP_PropIsQualifier;
  569|     90|			currQual->parent = xmpParent;
  570|       |
  571|     90|			if ( isLang ) {
  ------------------
  |  Branch (571:9): [True: 0, False: 90]
  ------------------
  572|      0|				if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Duplicate xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (572:10): [True: 0, False: 0]
  ------------------
  573|      0|				xmpParent->options |= kXMP_PropHasLang;
  574|     90|			} else if ( currQual->name == "rdf:type" ) {
  ------------------
  |  Branch (574:16): [True: 0, False: 90]
  ------------------
  575|      0|				xmpParent->options |= kXMP_PropHasType;
  576|      0|			}
  577|       |
  578|     90|			if ( (! isLang) || xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (578:9): [True: 90, False: 0]
  |  Branch (578:23): [True: 0, False: 0]
  ------------------
  579|     90|				xmpParent->qualifiers.push_back ( currQual );
  580|     90|			} else {
  581|      0|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), currQual );
  582|      0|			}
  583|     90|			xmpParent->children[childNum] = 0;	// We just moved it to the qualifers.
  584|       |		
  585|     90|	}
  586|       |	
  587|     11|	if ( ! xmpParent->qualifiers.empty() ) xmpParent->options |= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (587:7): [True: 11, 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|     11|	XMP_Assert ( xmpParent->options & (kXMP_PropValueIsStruct | kRDF_HasValueElem) );
  ------------------
  |  |  142|     11|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|     11|	xmpParent->options &= ~ (static_cast<unsigned long>(kXMP_PropValueIsStruct) | static_cast<unsigned long>(kRDF_HasValueElem));
  594|     11|	xmpParent->options |= valueNode->options;
  595|       |	
  596|     11|	xmpParent->value.swap ( valueNode->value );
  597|       |	#if 0	// *** XMP_DebugBuild
  598|       |		xmpParent->_valuePtr = xmpParent->value.c_str();
  599|       |	#endif
  600|       |
  601|     11|	xmpParent->children[0] = 0;	// ! Remove the value node itself before the swap.
  602|     11|	xmpParent->children.swap ( valueNode->children );
  603|       |	
  604|     11|	for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (604:68): [True: 0, False: 11]
  ------------------
  605|      0|		XMP_Node * currChild = xmpParent->children[childNum];
  606|      0|		currChild->parent = xmpParent;
  607|      0|	}
  608|       |
  609|     11|	delete valueNode;
  610|       |	
  611|     11|}	// FixupQualifiedNode
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|     79|{
 1147|     79|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     79|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     79|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     79|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|     79|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     79|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  3.60k|{
  943|  3.60k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 3.41k, False: 187]
  |  Branch (943:21): [True: 0, False: 3.41k]
  ------------------
  944|       |	
  945|  3.60k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  3.60k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  3.60k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  3.62k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 24, False: 3.60k]
  ------------------
  951|     24|		XMP_VarString & attrName = (*currAttr)->name;
  952|     24|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 18, False: 6]
  ------------------
  953|     18|			AddQualifierNode ( newCompound, **currAttr );
  954|     18|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 6, False: 0]
  ------------------
  955|      6|			continue;	// Ignore all rdf:ID attributes.
  956|      6|		} else {
  957|      0|			XMP_Throw ( "Invalid attribute for resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  958|      0|		}
  959|     24|	}
  960|       |	
  961|  3.60k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  3.60k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  10.8k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 10.8k, False: 0]
  ------------------
  965|  10.8k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 3.60k, False: 7.24k]
  ------------------
  966|  10.8k|	}
  967|  3.60k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 3.60k]
  ------------------
  968|  3.60k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     48|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 48, False: 3.55k]
  ------------------
  969|       |
  970|  3.55k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 129, False: 3.42k]
  ------------------
  971|    129|		newCompound->options |= kXMP_PropValueIsArray;
  972|  3.42k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 1.59k, False: 1.83k]
  ------------------
  973|  1.59k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  1.83k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 1.66k, False: 175]
  ------------------
  975|  1.66k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  1.66k|	} else {
  977|    175|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    175|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 109, False: 66]
  ------------------
  979|    109|			XMP_VarString typeName ( (*currChild)->ns );
  980|    109|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    109|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 10, False: 99]
  ------------------
  982|     99|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|     99|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|     99|		}
  985|    175|	}
  986|       |
  987|  3.54k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  3.54k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 11, False: 3.53k]
  ------------------
  989|     11|		FixupQualifiedNode ( newCompound );
  990|  3.53k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 1.44k, False: 2.09k]
  ------------------
  991|  1.44k|		DetectAltText ( newCompound );
  992|  1.44k|	}
  993|       |
  994|  11.5k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 8.05k, False: 3.50k]
  ------------------
  995|  8.05k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     44|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 44, False: 8.01k]
  ------------------
  996|  8.01k|	}
  997|       |
  998|  3.54k|}	// 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|  79.8k|{
  568|  79.8k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  79.8k|	size_t unitCount = 0;
  570|       |
  571|  79.8k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  79.8k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 79.8k]
  ------------------
  573|  79.8k|	inUnit = *utf8In;
  574|  79.8k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 79.8k, False: 0]
  ------------------
  575|       |	
  576|      0|	unitCount = 1;
  577|      0|	*cpOut = inUnit;	// ! Don't put after Done, don't write if no input.
  578|       |	
  579|      0|Done:	
  580|      0|	*utf8Read = unitCount;
  581|      0|	return;
  582|       |
  583|  79.8k|MultiByte:
  584|  79.8k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  79.8k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  79.8k|{
  517|  79.8k|	UTF8Unit  inUnit = *utf8In;
  518|  79.8k|	size_t    unitCount = 0;
  519|  79.8k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  79.8k|	const UTF8Unit * utf8Pos;
  521|       |
  522|       |	// -------------------------------------------------------------------------------------
  523|       |	// We've got a multibyte UTF-8 character. The first byte has the number of bytes and the
  524|       |	// highest order data bits. The other bytes each add 6 more data bits.
  525|       |	
  526|       |	#if 0	// This might be a more effcient way to count the bytes.
  527|       |		static XMP_Uns8 kByteCounts[16] = { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 4 };
  528|       |		size_t bytesNeeded = kByteCounts [ inUnit >> 4 ];
  529|       |		if ( (bytesNeeded < 2) || ((bytesNeeded == 4) && ((inUnit & 0x08) != 0)) ) {
  530|       |			UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  531|       |		}
  532|       |	#endif
  533|       |
  534|  79.8k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|   242k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 163k, False: 79.8k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  79.8k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     18|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 10, False: 79.7k]
  |  Branch (538:28): [True: 8, False: 79.7k]
  ------------------
  539|  79.7k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 79.7k]
  ------------------
  540|  79.7k|	unitCount = bytesNeeded;
  541|       |	
  542|  79.7k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  79.7k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|   163k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 83.3k, False: 79.7k]
  ------------------
  546|  83.3k|		inUnit = *utf8Pos;
  547|  83.3k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     13|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 13, False: 83.3k]
  ------------------
  548|  83.3k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  83.3k|	}
  550|       |	
  551|  79.7k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 501, False: 79.2k]
  ------------------
  552|    501|		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: 501, False: 0]
  |  Branch (552:26): [True: 1, False: 500]
  ------------------
  553|    500|		if ( cp > 0x10FFFF ) UC_Throw ( "Bad UTF-8 - out of range", kXMPErr_BadParam );
  ------------------
  |  |   18|      2|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (553:8): [True: 2, False: 498]
  ------------------
  554|    500|	}
  555|       |	
  556|  79.7k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  79.7k|Done:	
  559|  79.7k|	*utf8Read = unitCount;
  560|  79.7k|	return;
  561|       |	
  562|  79.7k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|   904k|{
   88|       |
   89|   904k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|   904k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|   904k|	const XMP_Uns8 * namePos   = nameStart;
   92|   904k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|   904k|	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: 904k]
  ------------------
   97|       |
   98|   904k|	cp = *namePos;
   99|   904k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 903k, False: 358]
  ------------------
  100|   903k|		++namePos;
  101|   903k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 903k]
  ------------------
  102|   903k|	} else {
  103|    358|		cp = GetCodePoint ( &namePos );
  104|    358|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 358]
  ------------------
  105|    358|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  76.5M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 75.6M, False: 904k]
  ------------------
  110|  75.6M|		cp = *namePos;
  111|  75.6M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 75.5M, False: 45.3k]
  ------------------
  112|  75.5M|			++namePos;
  113|  75.5M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 392k, False: 75.1M]
  |  Branch (113:38): [True: 0, False: 392k]
  ------------------
  114|  75.5M|		} else {
  115|  45.3k|			cp = GetCodePoint ( &namePos );
  116|  45.3k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 19.0k, False: 26.3k]
  |  Branch (116:41): [True: 0, False: 19.0k]
  ------------------
  117|  45.3k|		}
  118|  75.6M|	}
  119|       |
  120|   904k|	return;
  121|       |
  122|   904k|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|  76.4M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  76.4M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 50.5M, False: 25.9M]
  |  Branch (33:23): [True: 50.5M, False: 0]
  |  Branch (33:40): [True: 25.5M, False: 392k]
  |  Branch (33:55): [True: 25.5M, False: 44.9k]
  |  Branch (33:71): [True: 44.9k, False: 392k]
  ------------------
   34|   392k|	return false;
   35|  76.4M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  45.7k|{
   20|  45.7k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  45.7k|	XMP_Uns32 cp;
   22|  45.7k|	size_t u8Len;
   23|  45.7k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  45.7k|	*utf8Str_io = u8Ptr + u8Len;
   25|  45.7k|	return cp;
   26|  45.7k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  45.7k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  45.7k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 27.4k, False: 18.3k]
  |  Branch (43:24): [True: 515, False: 26.8k]
  |  Branch (43:43): [True: 26.8k, False: 18.3k]
  |  Branch (43:59): [True: 14.7k, False: 12.1k]
  ------------------
   44|  30.4k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 12.1k, False: 18.3k]
  |  Branch (44:24): [True: 5.68k, False: 6.46k]
  |  Branch (44:43): [True: 5.79k, False: 19.0k]
  |  Branch (44:60): [True: 0, False: 5.79k]
  ------------------
   45|       |
   46|  24.8k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 5.79k, False: 19.0k]
  |  Branch (46:25): [True: 3.61k, False: 2.18k]
  |  Branch (46:46): [True: 2.18k, False: 19.0k]
  |  Branch (46:64): [True: 0, False: 2.18k]
  ------------------
   47|  21.1k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 2.18k, False: 19.0k]
  |  Branch (47:26): [True: 0, False: 2.18k]
  |  Branch (47:46): [True: 2.18k, False: 19.0k]
  |  Branch (47:64): [True: 0, False: 2.18k]
  ------------------
   48|  21.1k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 2.18k, False: 19.0k]
  |  Branch (48:26): [True: 2.18k, False: 0]
  |  Branch (48:46): [True: 0, False: 19.0k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  19.0k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 19.0k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 19.0k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  19.0k|	return false;
   52|       |
   53|  19.0k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   392k|{
   59|       |	// ASCII following characters for an XML name.
   60|   392k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 273k, False: 118k]
  |  Branch (60:23): [True: 273k, False: 0]
  |  Branch (60:39): [True: 62.2k, False: 56.3k]
  |  Branch (60:54): [True: 56.3k, False: 0]
  ------------------
   61|      0|	return false;
   62|   392k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  19.0k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  19.0k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 18.3k, False: 666]
  |  Branch (69:24): [True: 666, False: 0]
  |  Branch (69:41): [True: 666, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  19.0k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  7.87k|{
   20|  7.87k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  7.87k|	XMP_Uns32 cp;
   22|  7.87k|	size_t u8Len;
   23|  7.87k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  7.87k|	*utf8Str_io = u8Ptr + u8Len;
   25|  7.87k|	return cp;
   26|  7.87k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  32.4k|{
   88|       |
   89|  32.4k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  32.4k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  32.4k|	const XMP_Uns8 * namePos   = nameStart;
   92|  32.4k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  32.4k|	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: 32.4k]
  ------------------
   97|       |
   98|  32.4k|	cp = *namePos;
   99|  32.4k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 32.1k, False: 235]
  ------------------
  100|  32.1k|		++namePos;
  101|  32.1k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 32.1k]
  ------------------
  102|  32.1k|	} else {
  103|    235|		cp = GetCodePoint ( &namePos );
  104|    235|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 235]
  ------------------
  105|    235|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  9.64M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 9.61M, False: 32.4k]
  ------------------
  110|  9.61M|		cp = *namePos;
  111|  9.61M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 9.59M, False: 25.9k]
  ------------------
  112|  9.59M|			++namePos;
  113|  9.59M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 154k, False: 9.43M]
  |  Branch (113:38): [True: 0, False: 154k]
  ------------------
  114|  9.59M|		} else {
  115|  25.9k|			cp = GetCodePoint ( &namePos );
  116|  25.9k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 17.4k, False: 8.49k]
  |  Branch (116:41): [True: 0, False: 17.4k]
  ------------------
  117|  25.9k|		}
  118|  9.61M|	}
  119|       |
  120|  32.4k|	return;
  121|       |
  122|  32.4k|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|  9.62M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  9.62M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 8.92M, False: 694k]
  |  Branch (33:23): [True: 8.92M, False: 0]
  |  Branch (33:40): [True: 539k, False: 154k]
  |  Branch (33:55): [True: 526k, False: 13.0k]
  |  Branch (33:71): [True: 13.0k, False: 154k]
  ------------------
   34|   154k|	return false;
   35|  9.62M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  26.1k|{
   20|  26.1k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  26.1k|	XMP_Uns32 cp;
   22|  26.1k|	size_t u8Len;
   23|  26.1k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  26.1k|	*utf8Str_io = u8Ptr + u8Len;
   25|  26.1k|	return cp;
   26|  26.1k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  26.1k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  26.1k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 8.86k, False: 17.3k]
  |  Branch (43:24): [True: 387, False: 8.48k]
  |  Branch (43:43): [True: 8.48k, False: 17.3k]
  |  Branch (43:59): [True: 93, False: 8.38k]
  ------------------
   44|  25.6k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 8.38k, False: 17.3k]
  |  Branch (44:24): [True: 4.94k, False: 3.44k]
  |  Branch (44:43): [True: 3.30k, False: 17.4k]
  |  Branch (44:60): [True: 0, False: 3.30k]
  ------------------
   45|       |
   46|  20.7k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 3.30k, False: 17.4k]
  |  Branch (46:25): [True: 3.17k, False: 137]
  |  Branch (46:46): [True: 137, False: 17.4k]
  |  Branch (46:64): [True: 0, False: 137]
  ------------------
   47|  17.5k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 137, False: 17.4k]
  |  Branch (47:26): [True: 0, False: 137]
  |  Branch (47:46): [True: 137, False: 17.4k]
  |  Branch (47:64): [True: 0, False: 137]
  ------------------
   48|  17.5k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 137, False: 17.4k]
  |  Branch (48:26): [True: 137, False: 0]
  |  Branch (48:46): [True: 0, False: 17.4k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  17.4k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 17.4k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 17.4k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  17.4k|	return false;
   52|       |
   53|  17.4k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   154k|{
   59|       |	// ASCII following characters for an XML name.
   60|   154k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 87.6k, False: 66.6k]
  |  Branch (60:23): [True: 87.6k, False: 0]
  |  Branch (60:39): [True: 47.1k, False: 19.4k]
  |  Branch (60:54): [True: 19.4k, False: 0]
  ------------------
   61|      0|	return false;
   62|   154k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  17.4k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  17.4k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 17.3k, False: 135]
  |  Branch (69:24): [True: 135, False: 0]
  |  Branch (69:41): [True: 135, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  17.4k|}

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

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

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

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

_ZNK8XML_Node16IsWhitespaceNodeEv:
   39|   320k|{
   40|   320k|	if ( this->kind != kCDataNode ) return false;
  ------------------
  |  Branch (40:7): [True: 99.6k, False: 220k]
  ------------------
   41|       |
   42|   867k|	for ( size_t i = 0; i < this->value.size(); ++i ) {
  ------------------
  |  Branch (42:22): [True: 647k, False: 220k]
  ------------------
   43|   647k|		unsigned char ch = this->value[i];
   44|   647k|		if ( IsWhitespaceChar ( ch ) ) continue;
  ------------------
  |  |   45|   647k|#define IsWhitespaceChar(ch)	( ((ch) == ' ') || ((ch) == 0x09) || ((ch) == 0x0A) || ((ch) == 0x0D) )
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 534k, False: 112k]
  |  |  |  Branch (45:49): [True: 690, False: 111k]
  |  |  |  Branch (45:67): [True: 111k, False: 302]
  |  |  |  Branch (45:85): [True: 26, False: 276]
  |  |  ------------------
  ------------------
   45|       |		// *** Add checks for other whitespace characters.
   46|    276|		return false;	// All the checks failed, this isn't whitespace.
   47|   647k|	}
   48|       |
   49|   220k|	return true;
   50|       |
   51|   220k|}	// XML_Node::IsWhitespaceNode
_ZN8XML_Node11RemoveAttrsEv:
  427|   616k|{
  428|       |
  429|   705k|	for ( size_t i = 0, vLim = this->attrs.size(); i < vLim; ++i ) delete this->attrs[i];
  ------------------
  |  Branch (429:49): [True: 88.7k, False: 616k]
  ------------------
  430|   616k|	this->attrs.clear();
  431|       |
  432|   616k|}	// XML_Node::RemoveAttrs
_ZN8XML_Node13RemoveContentEv:
  439|   616k|{
  440|       |
  441|  1.14M|	for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) delete this->content[i];
  ------------------
  |  Branch (441:51): [True: 523k, False: 616k]
  ------------------
  442|   616k|	this->content.clear();
  443|       |
  444|   616k|}	// 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|   511k|	void XMP_EnterCriticalRegion ( XMP_Mutex & mutex ) {
  124|   511k|		int err = pthread_mutex_lock ( &mutex );
  125|   511k|		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: 511k]
  ------------------
  126|   511k|	}
_Z22XMP_ExitCriticalRegionR15pthread_mutex_t:
  128|   511k|	void XMP_ExitCriticalRegion ( XMP_Mutex & mutex ) {
  129|   511k|		int err = pthread_mutex_unlock ( &mutex );
  130|   511k|		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: 511k]
  ------------------
  131|   511k|	}
_Z16VerifySetOptionsjPKc:
  563|   155k|{
  564|       |
  565|   155k|	if ( options & kXMP_PropArrayIsAltText )   options |= kXMP_PropArrayIsAlternate;
  ------------------
  |  Branch (565:7): [True: 95, False: 155k]
  ------------------
  566|   155k|	if ( options & kXMP_PropArrayIsAlternate ) options |= kXMP_PropArrayIsOrdered;
  ------------------
  |  Branch (566:7): [True: 3.09k, False: 152k]
  ------------------
  567|   155k|	if ( options & kXMP_PropArrayIsOrdered )   options |= kXMP_PropValueIsArray;
  ------------------
  |  Branch (567:7): [True: 4.29k, False: 151k]
  ------------------
  568|       |	
  569|   155k|	if ( options & ~kXMP_AllSetOptionsMask ) {
  ------------------
  |  Branch (569:7): [True: 0, False: 155k]
  ------------------
  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|   155k|	if ( (options & kXMP_PropValueIsStruct) && (options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (573:7): [True: 6.18k, False: 149k]
  |  Branch (573:45): [True: 0, False: 6.18k]
  ------------------
  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|   155k|	if ( (options & kXMP_PropValueOptionsMask) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (577:7): [True: 0, False: 155k]
  |  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|   155k|	if ( (propValue != 0) && (options & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (581:7): [True: 143k, False: 12.6k]
  |  Branch (581:27): [True: 0, False: 143k]
  ------------------
  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|   155k|	return options;
  586|       |
  587|   155k|}	// VerifySetOptions
_Z11ExpandXPathPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  662|   401k|{
  663|   401k|	XMP_Assert ( (schemaNS != 0) && (propPath != 0) && (*propPath != 0) && (expandedXPath != 0) );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  664|       |	
  665|   401k|	XMP_StringPtr	stepBegin, stepEnd;
  666|   401k|	XMP_StringPtr	qualName, nameEnd;
  667|   401k|	XMP_VarString	currStep;
  668|       |		
  669|   401k|	qualName = nameEnd = NULL;
  670|   401k|	size_t resCount = 2;	// Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
  671|  79.2M|	for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
  ------------------
  |  Branch (671:28): [True: 78.8M, False: 401k]
  ------------------
  672|  78.8M|		if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
  ------------------
  |  Branch (672:8): [True: 131k, False: 78.7M]
  |  Branch (672:29): [True: 354k, False: 78.3M]
  ------------------
  673|  78.8M|	}
  674|       |	
  675|   401k|	expandedXPath->clear();
  676|   401k|	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|   401k|	stepBegin = propPath;
  683|   401k|	stepEnd = stepBegin;
  684|  53.4M|	while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (684:10): [True: 53.3M, False: 40.8k]
  |  Branch (684:29): [True: 53.3M, False: 6.33k]
  |  Branch (684:50): [True: 53.0M, False: 353k]
  |  Branch (684:71): [True: 53.0M, False: 0]
  ------------------
  685|   401k|	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: 401k]
  ------------------
  686|   401k|	currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  687|       |	
  688|   401k|	VerifyXPathRoot ( schemaNS, currStep.c_str(), expandedXPath );
  689|       |
  690|   401k|	XMP_OptionBits stepFlags = kXMP_StructFieldStep;	
  691|   401k|	if ( sRegisteredAliasMap->find ( (*expandedXPath)[kRootPropStep].step ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (691:7): [True: 0, False: 401k]
  ------------------
  692|      0|		stepFlags |= kXMP_StepIsAlias;
  693|      0|	}
  694|   401k|	(*expandedXPath)[kRootPropStep].options |= stepFlags;
  695|       |		
  696|       |	// -----------------------------------------------------
  697|       |	// Now continue to process the rest of the XPath string.
  698|       |
  699|   887k|	while ( *stepEnd != 0 ) {
  ------------------
  |  Branch (699:10): [True: 486k, False: 401k]
  ------------------
  700|       |
  701|   486k|		stepBegin = stepEnd;
  702|   486k|		if ( *stepBegin == '/' ) ++stepBegin;
  ------------------
  |  Branch (702:8): [True: 131k, False: 354k]
  ------------------
  703|   486k|		if ( *stepBegin == '*' ) {
  ------------------
  |  Branch (703:8): [True: 0, False: 486k]
  ------------------
  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|   486k|		stepEnd = stepBegin;
  708|       |
  709|   486k|		if ( *stepBegin != '[' ) {
  ------------------
  |  Branch (709:8): [True: 131k, False: 354k]
  ------------------
  710|       |		
  711|       |			// A struct field or qualifier.
  712|   131k|			qualName = stepBegin;
  713|  24.1M|			while ( (*stepEnd != 0) && (*stepEnd != '/') && (*stepEnd != '[') && (*stepEnd != '*') ) ++stepEnd;
  ------------------
  |  Branch (713:12): [True: 24.0M, False: 129k]
  |  Branch (713:31): [True: 24.0M, False: 954]
  |  Branch (713:52): [True: 24.0M, False: 1.10k]
  |  Branch (713:73): [True: 24.0M, False: 0]
  ------------------
  714|   131k|			nameEnd = stepEnd;
  715|   131k|			stepFlags = kXMP_StructFieldStep;	// ! Touch up later, also changing '@' to '?'.
  716|       |			
  717|   354k|		} else {
  718|       |		
  719|       |			// One of the array forms.
  720|       |		
  721|   354k|			++stepEnd;	// Look at the character after the leading '['.
  722|       |			
  723|   354k|			if ( ('0' <= *stepEnd) && (*stepEnd <= '9') ) {
  ------------------
  |  Branch (723:9): [True: 354k, False: 0]
  |  Branch (723:30): [True: 354k, False: 0]
  ------------------
  724|       |
  725|       |				// A numeric (decimal integer) array index.
  726|  1.37M|				while ( (*stepEnd != 0) && ('0' <= *stepEnd) && (*stepEnd <= '9') ) ++stepEnd;
  ------------------
  |  Branch (726:13): [True: 1.37M, False: 0]
  |  Branch (726:32): [True: 1.37M, False: 0]
  |  Branch (726:53): [True: 1.02M, False: 354k]
  ------------------
  727|   354k|				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: 354k]
  ------------------
  728|   354k|				stepFlags = kXMP_ArrayIndexStep;
  729|       |
  730|   354k|			} 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|   354k|			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: 354k]
  ------------------
  774|   354k|			++stepEnd;
  775|       |			
  776|   354k|		}
  777|       |
  778|   486k|		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: 486k]
  ------------------
  779|   486k|		currStep.assign ( stepBegin, (stepEnd - stepBegin) );
  780|       |
  781|   486k|		if ( GetStepKind ( stepFlags ) == kXMP_StructFieldStep ) {
  ------------------
  |  |  408|   486k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (781:8): [True: 131k, False: 354k]
  ------------------
  782|       |
  783|   131k|			if ( currStep[0] == '@' ) {
  ------------------
  |  Branch (783:9): [True: 0, False: 131k]
  ------------------
  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|   131k|			if ( currStep[0] == '?' ) {
  ------------------
  |  Branch (787:9): [True: 83.7k, False: 47.8k]
  ------------------
  788|  83.7k|				++qualName;
  789|  83.7k|				stepFlags = kXMP_QualifierStep;
  790|  83.7k|			}
  791|   131k|			VerifyQualName ( qualName, nameEnd );
  792|       |
  793|   354k|		} else if ( GetStepKind ( stepFlags ) == kXMP_FieldSelectorStep ) {
  ------------------
  |  |  408|   354k|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (793:15): [True: 0, False: 354k]
  ------------------
  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|   486k|		expandedXPath->push_back ( XPathStepInfo ( currStep, stepFlags ) );
  810|       |
  811|   486k|	}
  812|       |
  813|   401k|}	// ExpandXPath
_Z14FindSchemaNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  828|   451k|{
  829|   451k|	XMP_Node * schemaNode = 0;
  830|       |	
  831|   451k|	XMP_Assert ( xmpTree->parent == 0 );
  ------------------
  |  |  142|   451k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  832|       |	
  833|  1.18M|	for ( size_t schemaNum = 0, schemaLim = xmpTree->children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (833:68): [True: 1.14M, False: 41.2k]
  ------------------
  834|  1.14M|		XMP_Node * currSchema = xmpTree->children[schemaNum];
  835|  1.14M|		XMP_Assert ( currSchema->parent == xmpTree );
  ------------------
  |  |  142|  1.14M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  836|  1.14M|		if ( currSchema->name == nsURI ) {
  ------------------
  |  Branch (836:8): [True: 410k, False: 733k]
  ------------------
  837|   410k|			schemaNode = currSchema;
  838|   410k|			if ( ptrPos != 0 ) *ptrPos = xmpTree->children.begin() + schemaNum;
  ------------------
  |  Branch (838:9): [True: 389k, False: 20.7k]
  ------------------
  839|   410k|			break;
  840|   410k|		}
  841|  1.14M|	}
  842|       |	
  843|   451k|	if ( (schemaNode == 0) && createNodes ) {
  ------------------
  |  Branch (843:7): [True: 41.2k, False: 410k]
  |  Branch (843:28): [True: 16.3k, False: 24.9k]
  ------------------
  844|       |
  845|  16.3k|		schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|  16.3k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  846|  16.3k|		XMP_StringPtr prefixPtr;
  847|  16.3k|		XMP_StringLen prefixLen;
  848|  16.3k|        bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen );	// *** Use map directly?
  849|  16.3k|		XMP_Assert ( found );
  ------------------
  |  |  142|  16.3k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  850|  16.3k|		UNUSED(found);
  851|       |
  852|  16.3k|		schemaNode->value.assign ( prefixPtr, prefixLen );
  853|  16.3k|		xmpTree->children.push_back ( schemaNode );
  854|  16.3k|		if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;
  ------------------
  |  Branch (854:8): [True: 6.20k, False: 10.1k]
  ------------------
  855|       |
  856|       |		#if 0	// *** XMP_DebugBuild
  857|       |			schemaNode->_valuePtr = schemaNode->value.c_str();
  858|       |		#endif
  859|       |
  860|  16.3k|	}
  861|       |	
  862|   451k|	XMP_Assert ( (ptrPos == 0) || (schemaNode == 0) || (schemaNode == **ptrPos) );
  ------------------
  |  |  142|   451k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  863|   451k|	XMP_Assert ( (schemaNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   451k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  864|   451k|	return schemaNode;
  865|       |	
  866|   451k|}	// FindSchemaNode
_Z13FindChildNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  881|   491k|{
  882|   491k|	XMP_Node * childNode = 0;
  883|       |
  884|   491k|	if ( ! (parent->options & (kXMP_SchemaNode | kXMP_PropValueIsStruct)) ) {
  ------------------
  |  Branch (884:7): [True: 10, False: 491k]
  ------------------
  885|     10|		if ( ! (parent->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|     10|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (885:8): [True: 10, False: 0]
  ------------------
  886|     10|			XMP_Throw ( "Named children only allowed for schemas and structs", kXMPErr_BadXPath );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  887|      0|		}
  888|      0|		if ( parent->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|      0|			XMP_Throw ( "Named children not allowed for arrays", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  890|      0|		}
  891|      0|		if ( ! createNodes ) {	// *** Should be assert? If !createNodes, why is the parent a new implicit node?
  ------------------
  |  Branch (891:8): [True: 0, False: 0]
  ------------------
  892|      0|			XMP_Throw ( "Parent is new implicit node, but createNodes is false", kXMPErr_InternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  893|      0|		}
  894|      0|		parent->options |= kXMP_PropValueIsStruct;
  895|      0|	}
  896|       |	
  897|  2.12M|	for ( size_t childNum = 0, childLim = parent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (897:65): [True: 2.04M, False: 83.6k]
  ------------------
  898|  2.04M|		XMP_Node * currChild = parent->children[childNum];
  899|  2.04M|		XMP_Assert ( currChild->parent == parent );
  ------------------
  |  |  142|  2.04M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  900|  2.04M|		if ( currChild->name == childName ) {
  ------------------
  |  Branch (900:8): [True: 407k, False: 1.63M]
  ------------------
  901|   407k|			childNode = currChild;
  902|   407k|			if ( ptrPos != 0 ) *ptrPos = parent->children.begin() + childNum;
  ------------------
  |  Branch (902:9): [True: 407k, False: 316]
  ------------------
  903|   407k|			break;
  904|   407k|		}
  905|  2.04M|	}
  906|       |	
  907|   491k|	if ( (childNode == 0) && createNodes ) {
  ------------------
  |  Branch (907:7): [True: 83.6k, False: 407k]
  |  Branch (907:27): [True: 35.7k, False: 47.8k]
  ------------------
  908|  35.7k|		childNode = new XMP_Node ( parent, childName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  35.7k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  909|  35.7k|		parent->children.push_back ( childNode );
  910|  35.7k|		if ( ptrPos != 0 ) *ptrPos = parent->children.end() - 1;
  ------------------
  |  Branch (910:8): [True: 35.7k, False: 0]
  ------------------
  911|  35.7k|	}
  912|       |	
  913|   491k|	XMP_Assert ( (ptrPos == 0) || (childNode == 0) || (childNode == **ptrPos) );
  ------------------
  |  |  142|   491k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  914|   491k|	XMP_Assert ( (childNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   491k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  915|   491k|	return childNode;
  916|       |	
  917|   491k|}	// FindChildNode
_Z17FindQualifierNodeP8XMP_NodePKcbPNSt3__111__wrap_iterIPS0_EE:
  934|  83.7k|{
  935|  83.7k|	XMP_Node * qualNode = 0;
  936|       |	
  937|  83.7k|	XMP_Assert ( *qualName != '?' );
  ------------------
  |  |  142|  83.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  938|       |	
  939|  1.07M|	for ( size_t qualNum = 0, qualLim = parent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (939:65): [True: 1.03M, False: 39.0k]
  ------------------
  940|  1.03M|		XMP_Node * currQual = parent->qualifiers[qualNum];
  941|  1.03M|		XMP_Assert ( currQual->parent == parent );
  ------------------
  |  |  142|  1.03M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  942|  1.03M|		if ( currQual->name == qualName ) {
  ------------------
  |  Branch (942:8): [True: 44.6k, False: 993k]
  ------------------
  943|  44.6k|			qualNode = currQual;
  944|  44.6k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.begin() + qualNum;
  ------------------
  |  Branch (944:9): [True: 44.6k, False: 0]
  ------------------
  945|  44.6k|			break;
  946|  44.6k|		}
  947|  1.03M|	}
  948|       |	
  949|  83.7k|	if ( (qualNode == 0) && createNodes ) {
  ------------------
  |  Branch (949:7): [True: 39.0k, False: 44.6k]
  |  Branch (949:26): [True: 39.0k, False: 0]
  ------------------
  950|       |
  951|  39.0k|		qualNode = new XMP_Node ( parent, qualName, (static_cast<unsigned long>(kXMP_PropIsQualifier) | static_cast<unsigned long>(kXMP_NewImplicitNode)) );
  ------------------
  |  |  410|  39.0k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  952|  39.0k|		parent->options |= kXMP_PropHasQualifiers;
  953|       |
  954|  39.0k|		const bool isLang 	 = XMP_LitMatch ( qualName, "xml:lang" );
  ------------------
  |  |   96|  39.0k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  955|  39.0k|		const bool isType 	 = XMP_LitMatch ( qualName, "rdf:type" );
  ------------------
  |  |   96|  39.0k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  956|  39.0k|		const bool isSpecial = isLang | isType;
  957|       |
  958|  39.0k|		if ( isLang ) {
  ------------------
  |  Branch (958:8): [True: 5.44k, False: 33.6k]
  ------------------
  959|  5.44k|			parent->options |= kXMP_PropHasLang;
  960|  33.6k|		} else if ( isType ) {
  ------------------
  |  Branch (960:15): [True: 50, False: 33.5k]
  ------------------
  961|     50|			parent->options |= kXMP_PropHasType;
  962|     50|		}
  963|       |		
  964|  39.0k|		if ( parent->qualifiers.empty() || (! isSpecial) ) {
  ------------------
  |  Branch (964:8): [True: 6.89k, False: 32.1k]
  |  Branch (964:38): [True: 32.1k, False: 4]
  ------------------
  965|  39.0k|			parent->qualifiers.push_back ( qualNode );
  966|  39.0k|			if ( ptrPos != 0 ) *ptrPos = parent->qualifiers.end() - 1;
  ------------------
  |  Branch (966:9): [True: 39.0k, False: 0]
  ------------------
  967|  39.0k|		} else {
  968|      4|			XMP_NodePtrPos insertPos = parent->qualifiers.begin();	// ! Lang goes first, type after.
  969|      4|			if ( isType && (parent->options & kXMP_PropHasLang) ) ++insertPos;	// *** Does insert at end() work?
  ------------------
  |  Branch (969:9): [True: 4, False: 0]
  |  Branch (969:19): [True: 4, False: 0]
  ------------------
  970|      4|			insertPos = parent->qualifiers.insert ( insertPos, qualNode );
  971|      4|			if ( ptrPos != 0 ) *ptrPos = insertPos;
  ------------------
  |  Branch (971:9): [True: 4, False: 0]
  ------------------
  972|      4|		}
  973|       |
  974|  39.0k|	}
  975|       |	
  976|  83.7k|	XMP_Assert ( (ptrPos == 0) || (qualNode == 0) || (qualNode == **ptrPos) );
  ------------------
  |  |  142|  83.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  977|  83.7k|	XMP_Assert ( (qualNode != 0) || (! createNodes) );
  ------------------
  |  |  142|  83.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  978|  83.7k|	return qualNode;
  979|       |	
  980|  83.7k|}	// FindQualifierNode
_Z8FindNodeP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEbjPNS1_11__wrap_iterIPS0_EE:
 1062|   396k|{
 1063|   396k|	XMP_Node *     currNode = 0;
 1064|   396k|	XMP_NodePtrPos currPos;
 1065|   396k|	XMP_NodePtrPos newSubPos;	// Root of implicitly created subtree. Valid only if leaf is new.
 1066|   396k|	bool           leafIsNew = false;
 1067|       |	
 1068|   396k|	XMP_Assert ( (leafOptions == 0) || createNodes );
  ------------------
  |  |  142|   396k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|       |
 1070|   396k|	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: 396k]
  ------------------
 1071|       |	
 1072|   396k|	size_t stepNum = 1;	// By default start calling FollowXPathStep for the top level property step.
 1073|   396k|	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|   396k|	if ( ! (expandedXPath[kRootPropStep].options & kXMP_StepIsAlias) ) {
  ------------------
  |  Branch (1081:7): [True: 396k, False: 0]
  ------------------
 1082|       |		
 1083|   396k|		currNode = FindSchemaNode ( xmpTree, expandedXPath[kSchemaStep].step.c_str(), createNodes, &currPos );
 1084|   396k|		if ( currNode == 0 ) return 0;
  ------------------
  |  Branch (1084:8): [True: 315, False: 395k]
  ------------------
 1085|       |
 1086|   395k|		if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   395k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1086:8): [True: 6.20k, False: 389k]
  ------------------
 1087|  6.20k|			currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  6.20k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1088|  6.20k|			if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1088:9): [True: 6.20k, False: 0]
  ------------------
 1089|  6.20k|			leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1090|  6.20k|		}
 1091|       |
 1092|   395k|	} 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|   395k|	try {
 1138|  1.27M|		for ( ; stepNum < stepLim; ++stepNum ) {
  ------------------
  |  Branch (1138:11): [True: 879k, False: 395k]
  ------------------
 1139|   879k|			currNode = FollowXPathStep ( currNode, expandedXPath, stepNum, createNodes, &currPos );
 1140|   879k|			if ( currNode == 0 ) goto EXIT;
  ------------------
  |  Branch (1140:9): [True: 426, False: 879k]
  ------------------
 1141|   879k|			if ( currNode->options & kXMP_NewImplicitNode ) {
  ------------------
  |  |  410|   879k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (1141:9): [True: 150k, False: 728k]
  ------------------
 1142|   150k|				currNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|   150k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
 1143|   150k|				CheckImplicitStruct ( currNode, expandedXPath, stepNum+1, stepLim );
 1144|   150k|				if ( ! leafIsNew ) newSubPos = currPos;	// Save the top most implicit node.
  ------------------
  |  Branch (1144:10): [True: 144k, False: 6.20k]
  ------------------
 1145|   150k|				leafIsNew = true;	// If any parent is new, the leaf will be new also.
 1146|   150k|			}
 1147|   879k|		}
 1148|   395k|	} catch ( ... ) {
 1149|     27|		if ( leafIsNew ) DeleteSubtree ( newSubPos );
  ------------------
  |  Branch (1149:8): [True: 27, False: 0]
  ------------------
 1150|     27|		throw;
 1151|     27|	}
 1152|       |	
 1153|       |	// Done. Delete the implicitly created subtree if the eventual node was not found.
 1154|       |
 1155|   395k|EXIT:
 1156|       |
 1157|   395k|	XMP_Assert ( (currNode == 0) || (currNode == *currPos) );
  ------------------
  |  |  142|   395k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1158|   395k|	XMP_Assert ( (currNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   395k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1159|       |
 1160|   395k|	if ( leafIsNew ) {
  ------------------
  |  Branch (1160:7): [True: 150k, False: 244k]
  ------------------
 1161|   150k|		if ( currNode != 0 ) {
  ------------------
  |  Branch (1161:8): [True: 150k, False: 0]
  ------------------
 1162|   150k|			currNode->options |= leafOptions;
 1163|   150k|		} else {
 1164|      0|			DeleteSubtree ( newSubPos );
 1165|      0|		}
 1166|   150k|	}
 1167|       |
 1168|   395k|	if ( (currNode != 0) && (ptrPos != 0) ) *ptrPos = currPos;
  ------------------
  |  Branch (1168:7): [True: 395k, False: 426]
  |  Branch (1168:26): [True: 0, False: 395k]
  ------------------
 1169|   395k|	return currNode;
 1170|       |	
 1171|   395k|}	// FindNode
_Z18NormalizeLangValuePNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 1343|  14.4k|{
 1344|  14.4k|	char * tagStart;
 1345|  14.4k|	char * tagEnd;
 1346|       |
 1347|       |	// Find and process the primary subtag.
 1348|       |	
 1349|  14.4k|	tagStart = (char*) value->c_str();
 1350|  2.30M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1350:27): [True: 2.29M, False: 5.51k]
  |  Branch (1350:45): [True: 2.28M, False: 8.97k]
  ------------------
 1351|  2.28M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1351:8): [True: 2.18M, False: 104k]
  |  Branch (1351:28): [True: 6.14k, False: 2.17M]
  ------------------
 1352|  2.28M|	}
 1353|       |	
 1354|       |	// Find and process the secondary subtag.
 1355|       |	
 1356|  14.4k|	tagStart = tagEnd;
 1357|  14.4k|	if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1357:7): [True: 8.97k, False: 5.51k]
  ------------------
 1358|  1.19M|	for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1358:27): [True: 1.17M, False: 12.1k]
  |  Branch (1358:45): [True: 1.17M, False: 2.38k]
  ------------------
 1359|  1.17M|		if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1359:8): [True: 1.15M, False: 19.9k]
  |  Branch (1359:28): [True: 7.13k, False: 1.14M]
  ------------------
 1360|  1.17M|	}
 1361|  14.4k|	if ( tagEnd == tagStart+2 ) {
  ------------------
  |  Branch (1361:7): [True: 2.52k, False: 11.9k]
  ------------------
 1362|  2.52k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1362:8): [True: 1.20k, False: 1.32k]
  |  Branch (1362:30): [True: 1.04k, False: 153]
  ------------------
 1363|  2.52k|		++tagStart;
 1364|  2.52k|		if ( ('a' <= *tagStart) && (*tagStart <= 'z') ) *tagStart -= 0x20;
  ------------------
  |  Branch (1364:8): [True: 1.49k, False: 1.03k]
  |  Branch (1364:30): [True: 773, False: 717]
  ------------------
 1365|  2.52k|	}
 1366|       |	
 1367|       |	// Find and process the remaining subtags.
 1368|       |	
 1369|  17.5k|	while ( true ) {
  ------------------
  |  Branch (1369:10): [True: 17.5k, Folded]
  ------------------
 1370|  17.5k|		tagStart = tagEnd;
 1371|  17.5k|		if ( *tagStart == '-' ) ++tagStart;
  ------------------
  |  Branch (1371:8): [True: 3.11k, False: 14.4k]
  ------------------
 1372|  17.5k|		if ( *tagStart == 0 ) break;
  ------------------
  |  Branch (1372:8): [True: 14.4k, False: 3.07k]
  ------------------
 1373|  7.72M|		for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) {
  ------------------
  |  Branch (1373:28): [True: 7.72M, False: 2.33k]
  |  Branch (1373:46): [True: 7.72M, False: 737]
  ------------------
 1374|  7.72M|			if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20;
  ------------------
  |  Branch (1374:9): [True: 7.62M, False: 94.5k]
  |  Branch (1374:29): [True: 7.76k, False: 7.62M]
  ------------------
 1375|  7.72M|		}
 1376|  3.07k|	}
 1377|       |	
 1378|  14.4k|}	// NormalizeLangValue
_Z18NormalizeLangArrayP8XMP_Node:
 1390|    754|{
 1391|    754|	XMP_Assert ( XMP_ArrayIsAltText(array->options) );
  ------------------
  |  |  142|    754|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1392|       |	
 1393|    754|	size_t itemNum;
 1394|    754|	size_t itemLim = array->children.size();
 1395|    754|	bool   hasDefault = false;
 1396|       |	
 1397|  5.54k|	for ( itemNum = 0; itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1397:21): [True: 4.86k, False: 676]
  ------------------
 1398|       |	
 1399|  4.86k|		if ( array->children[itemNum]->qualifiers.empty() ||
  ------------------
  |  Branch (1399:8): [True: 0, False: 4.86k]
  ------------------
 1400|  4.86k|			 (array->children[itemNum]->qualifiers[0]->name != "xml:lang") ) {
  ------------------
  |  Branch (1400:5): [True: 0, False: 4.86k]
  ------------------
 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|  4.86k|		if ( array->children[itemNum]->qualifiers[0]->value == "x-default" ) {
  ------------------
  |  Branch (1404:8): [True: 78, False: 4.79k]
  ------------------
 1405|     78|			hasDefault = true;
 1406|     78|			break;
 1407|     78|		}
 1408|       |
 1409|  4.86k|	}
 1410|       |
 1411|    754|	if ( hasDefault ) {
  ------------------
  |  Branch (1411:7): [True: 78, False: 676]
  ------------------
 1412|       |
 1413|     78|		if ( itemNum != 0 ) {
  ------------------
  |  Branch (1413:8): [True: 32, False: 46]
  ------------------
 1414|     32|			XMP_Node * temp = array->children[0];
 1415|     32|			array->children[0] = array->children[itemNum];
 1416|     32|			array->children[itemNum] = temp;
 1417|     32|		}
 1418|       |
 1419|       |// 09-Oct-07, ahu: disabled to avoid unexpected behaviour
 1420|       |//		if ( itemLim == 2 ) array->children[1]->value = array->children[0]->value;
 1421|       |
 1422|     78|	}
 1423|       |	
 1424|    754|}	// NormalizeLangArray
_Z13DetectAltTextP8XMP_Node:
 1434|  1.44k|{
 1435|  1.44k|	XMP_Assert ( XMP_ArrayIsAlternate(xmpParent->options) );
  ------------------
  |  |  142|  1.44k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1436|       |
 1437|  1.44k|	size_t itemNum, itemLim;
 1438|       |	
 1439|  6.82k|	for ( itemNum = 0, itemLim = xmpParent->children.size(); itemNum < itemLim; ++itemNum ) {
  ------------------
  |  Branch (1439:59): [True: 6.02k, False: 803]
  ------------------
 1440|  6.02k|		XMP_OptionBits currOptions = xmpParent->children[itemNum]->options;
 1441|  6.02k|		if ( (currOptions & kXMP_PropCompositeMask) || (! (currOptions & kXMP_PropHasLang)) ) break;
  ------------------
  |  Branch (1441:8): [True: 19, False: 6.00k]
  |  Branch (1441:50): [True: 619, False: 5.38k]
  ------------------
 1442|  6.02k|	}
 1443|       |	
 1444|  1.44k|	if ( (itemLim != 0) && (itemNum == itemLim) ) {
  ------------------
  |  Branch (1444:7): [True: 1.39k, False: 49]
  |  Branch (1444:25): [True: 754, False: 638]
  ------------------
 1445|    754|		xmpParent->options |= kXMP_PropArrayIsAltText;
 1446|    754|		NormalizeLangArray ( xmpParent );
 1447|    754|	}
 1448|       |
 1449|  1.44k|}	// DetectAltText
XMPCore_Impl.cpp:_ZL15VerifyXPathRootPKcS0_PNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEE:
  154|   401k|{
  155|       |	// Do some basic checks on the URI and name. Try to lookup the URI. See if the name is qualified.
  156|       |	
  157|   401k|	XMP_Assert ( (schemaURI != 0) && (propName != 0) && (*propName != 0) );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  158|   401k|	XMP_Assert ( (expandedXPath != 0) && (expandedXPath->empty()) );
  ------------------
  |  |  142|   401k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  159|       |
  160|   401k|	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: 401k]
  ------------------
  161|       |
  162|   401k|	if ( (*propName == '?') || (*propName == '@') ) {
  ------------------
  |  Branch (162:7): [True: 0, False: 401k]
  |  Branch (162:29): [True: 0, False: 401k]
  ------------------
  163|      0|		XMP_Throw ( "Top level name must not be a qualifier", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  164|      0|	}
  165|  53.4M|	for ( XMP_StringPtr ch = propName; *ch != 0; ++ch ) {
  ------------------
  |  Branch (165:37): [True: 53.0M, False: 401k]
  ------------------
  166|  53.0M|		if ( (*ch == '/') || (*ch == '[') ) {
  ------------------
  |  Branch (166:8): [True: 0, False: 53.0M]
  |  Branch (166:24): [True: 0, False: 53.0M]
  ------------------
  167|      0|			XMP_Throw ( "Top level name must be simple", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  168|      0|		}
  169|  53.0M|	}
  170|       |
  171|   401k|	XMP_StringMapPos uriPos = sNamespaceURIToPrefixMap->find ( XMP_VarString ( schemaURI ) );
  172|   401k|	if ( uriPos == sNamespaceURIToPrefixMap->end() ) {
  ------------------
  |  Branch (172:7): [True: 0, False: 401k]
  ------------------
  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|   401k|	XMP_StringPtr colonPos = propName;
  177|  39.9M|	while ( (*colonPos != 0) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (177:10): [True: 39.7M, False: 161k]
  |  Branch (177:30): [True: 39.5M, False: 239k]
  ------------------
  178|   401k|	VerifySimpleXMLName ( propName, colonPos );	// Verify the part before any colon.
  179|       |
  180|       |	// Verify the various URI and prefix combinations. Initialize the expanded XPath.
  181|       |	
  182|   401k|	if ( *colonPos == 0 ) {
  ------------------
  |  Branch (182:7): [True: 161k, False: 239k]
  ------------------
  183|       |	
  184|       |		// The propName is unqualified, use the schemaURI and associated prefix.
  185|       |		
  186|   161k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  187|   161k|		expandedXPath->push_back ( XPathStepInfo ( uriPos->second, 0 ) );
  188|   161k|		(*expandedXPath)[kRootPropStep].step += propName;
  189|       |	
  190|   239k|	} else {
  191|       |
  192|       |		// The propName is qualified. Make sure the prefix is legit. Use the associated URI and qualified name.
  193|       |
  194|   239k|		size_t prefixLen = colonPos - propName + 1;	// ! Include the colon.
  195|   239k|		VerifySimpleXMLName ( colonPos+1, colonPos+strlen(colonPos) );
  196|       |
  197|   239k|		XMP_VarString prefix ( propName, prefixLen );
  198|   239k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  199|   239k|		if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (199:8): [True: 0, False: 239k]
  ------------------
  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|   239k|		if ( prefix != uriPos->second ) {
  ------------------
  |  Branch (202:8): [True: 82, False: 239k]
  ------------------
  203|     82|			XMP_Throw ( "Schema namespace URI and prefix mismatch", kXMPErr_BadSchema );
  ------------------
  |  |  199|     82|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  204|      0|		}
  205|       |
  206|   239k|		expandedXPath->push_back ( XPathStepInfo ( schemaURI, kXMP_SchemaNode ) );
  207|   239k|		expandedXPath->push_back ( XPathStepInfo ( propName, 0 ) );
  208|       |	
  209|   239k|	}
  210|       |
  211|   401k|}	// VerifyXPathRoot
XMPCore_Impl.cpp:_ZL14VerifyQualNamePKcS0_:
  219|   131k|{
  220|   131k|	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: 131k]
  ------------------
  221|       |
  222|   131k|	XMP_StringPtr colonPos = qualName;
  223|  17.7M|	while ( (colonPos < nameEnd) && (*colonPos != ':') ) ++colonPos;
  ------------------
  |  Branch (223:10): [True: 17.7M, False: 0]
  |  Branch (223:34): [True: 17.5M, False: 131k]
  ------------------
  224|   131k|	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: 131k]
  |  Branch (224:33): [True: 0, False: 131k]
  ------------------
  225|       |
  226|   131k|	VerifySimpleXMLName ( qualName, colonPos );
  227|   131k|	VerifySimpleXMLName ( colonPos+1, nameEnd );
  228|       |
  229|   131k|	size_t prefixLen = colonPos - qualName + 1;	// ! Include the colon.
  230|   131k|	XMP_VarString prefix ( qualName, prefixLen );
  231|   131k|	XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( prefix );
  232|   131k|	if ( prefixPos == sNamespacePrefixToURIMap->end() ) {
  ------------------
  |  Branch (232:7): [True: 115, False: 131k]
  ------------------
  233|    115|		XMP_Throw ( "Unknown namespace prefix for qualified name", kXMPErr_BadXPath );
  ------------------
  |  |  199|    115|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  234|      0|	}
  235|       |
  236|   131k|}	// VerifyQualName
XMPCore_Impl.cpp:_ZL15FollowXPathStepP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmbPNS1_11__wrap_iterIPS0_EEb:
  394|   879k|{
  395|   879k|	XMP_Node * nextNode = 0;
  396|   879k|	const XPathStepInfo & nextStep = fullPath[stepNum];
  397|   879k|	XMP_Index      index    = 0;
  398|   879k|	XMP_OptionBits stepKind = nextStep.options & kXMP_StepKindMask;
  399|       |	
  400|   879k|	XMP_Assert ( (kXMP_StructFieldStep <= stepKind) && (stepKind <= kXMP_FieldSelectorStep) );
  ------------------
  |  |  142|   879k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  401|       |
  402|   879k|	if ( stepKind == kXMP_StructFieldStep ) {
  ------------------
  |  Branch (402:7): [True: 443k, False: 435k]
  ------------------
  403|       |
  404|   443k|		nextNode = FindChildNode ( parentNode, nextStep.step.c_str(), createNodes, ptrPos );
  405|       |
  406|   443k|	} else if ( stepKind == kXMP_QualifierStep ) {
  ------------------
  |  Branch (406:14): [True: 83.7k, False: 352k]
  ------------------
  407|       |	
  408|  83.7k|		XMP_StringPtr qualStep = nextStep.step.c_str();
  409|  83.7k|		XMP_Assert ( *qualStep == '?' );
  ------------------
  |  |  142|  83.7k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  410|  83.7k|		++qualStep;
  411|  83.7k|		nextNode = FindQualifierNode ( parentNode, qualStep, createNodes, ptrPos );
  412|       |
  413|   352k|	} else {
  414|       |	
  415|       |		// This is an array indexing step. First get the index, then get the node.
  416|       |
  417|   352k|		if ( ! (parentNode->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (417:8): [True: 27, False: 352k]
  ------------------
  418|     27|			XMP_Throw ( "Indexing applied to non-array", kXMPErr_BadXPath );
  ------------------
  |  |  199|     27|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  419|      0|		}
  420|       |		
  421|   352k|		if ( stepKind == kXMP_ArrayIndexStep ) {
  ------------------
  |  Branch (421:8): [True: 352k, False: 0]
  ------------------
  422|   352k|			index = FindIndexedItem ( parentNode, nextStep.step, createNodes );
  423|   352k|		} 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|   352k|		if ( (0 <= index) && (index <= (XMP_Index)parentNode->children.size()) ) nextNode = parentNode->children[index];
  ------------------
  |  Branch (437:8): [True: 352k, False: 4]
  |  Branch (437:24): [True: 352k, False: 0]
  ------------------
  438|       |
  439|   352k|		if ( (index == -1) && createNodes && aliasedArrayItem && (stepKind == kXMP_QualSelectorStep) ) {
  ------------------
  |  Branch (439:8): [True: 4, False: 352k]
  |  Branch (439:25): [True: 4, False: 0]
  |  Branch (439:40): [True: 0, False: 4]
  |  Branch (439:60): [True: 0, False: 0]
  ------------------
  440|       |		
  441|       |			// An ugly special case without an obvious better place to be. We have an alias to the
  442|       |			// x-default item of an alt-text array. A simple reference via SetProperty must create
  443|       |			// the x-default item if it does not yet exist.
  444|       |			
  445|      0|			XMP_Assert ( parentNode->options & kXMP_PropArrayIsAltText );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  446|      0|			XMP_Assert ( (stepNum == 2) && (nextStep.step == "[?xml:lang=\"x-default\"]") );
  ------------------
  |  |  142|      0|	#define XMP_Assert(c)	((void) 0)
  ------------------
  447|       |
  448|      0|			nextNode = new XMP_Node ( parentNode, kXMP_ArrayItemName,
  ------------------
  |  |  293|      0|#define kXMP_ArrayItemName	"[]"
  ------------------
  449|      0|									  (kXMP_PropHasQualifiers | kXMP_PropHasLang | kXMP_NewImplicitNode) );
  ------------------
  |  |  410|      0|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  450|       |
  451|      0|			XMP_Node * langQual = new XMP_Node ( nextNode, "xml:lang", "x-default", kXMP_PropIsQualifier );
  452|      0|			nextNode->qualifiers.push_back ( langQual );
  453|       |
  454|      0|			if ( parentNode->children.empty() ) {
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  ------------------
  455|      0|				parentNode->children.push_back ( nextNode );
  456|      0|			} else {
  457|      0|				parentNode->children.insert ( parentNode->children.begin(), nextNode );
  458|      0|			}
  459|       |
  460|      0|			index = 0;	// ! C-style index! The x-default item is always first.
  461|       |
  462|      0|		}
  463|       |		
  464|   352k|		if ( (nextNode != 0) && (ptrPos != 0) ) *ptrPos = parentNode->children.begin() + index;
  ------------------
  |  Branch (464:8): [True: 352k, False: 4]
  |  Branch (464:27): [True: 352k, False: 0]
  ------------------
  465|       |	
  466|   352k|	}
  467|       |
  468|   879k|	if ( (nextNode != 0) && (nextNode->options & kXMP_NewImplicitNode) ) {
  ------------------
  |  |  410|   879k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (468:7): [True: 879k, False: 426]
  |  Branch (468:26): [True: 150k, False: 728k]
  ------------------
  469|   150k|		nextNode->options |= (nextStep.options & kXMP_PropArrayFormMask);
  470|   150k|	}
  471|       |	
  472|   879k|	XMP_Assert ( (ptrPos == 0) || (nextNode == 0) || (nextNode == **ptrPos) );
  ------------------
  |  |  142|   879k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  473|   879k|	XMP_Assert ( (nextNode != 0) || (! createNodes) );
  ------------------
  |  |  142|   879k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  474|   879k|	return nextNode;
  475|       |	
  476|   879k|}	// FollowXPathStep
XMPCore_Impl.cpp:_ZL15FindIndexedItemP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  248|   352k|{
  249|   352k|	XMP_Index index = 0;
  250|   352k|	size_t    chLim = indexStep.size() - 1;
  251|       |
  252|   352k|	XMP_Assert ( (chLim >= 2) && (indexStep[0] == '[') && (indexStep[chLim] == ']') );
  ------------------
  |  |  142|   352k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  253|       |	
  254|  1.36M|	for ( size_t chNum = 1; chNum != chLim; ++chNum ) {
  ------------------
  |  Branch (254:26): [True: 1.01M, False: 352k]
  ------------------
  255|  1.01M|		XMP_Assert ( ('0' <= indexStep[chNum]) && (indexStep[chNum] <= '9') );
  ------------------
  |  |  142|  1.01M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  256|  1.01M|		index = (index * 10) + (indexStep[chNum] - '0');
  257|  1.01M|		if ( index < 0 ) {
  ------------------
  |  Branch (257:8): [True: 0, False: 1.01M]
  ------------------
  258|      0|			XMP_Throw ( "Array index overflow", kXMPErr_BadXPath );	// ! Overflow, not truly negative.
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  259|      0|		}
  260|  1.01M|	}
  261|       |
  262|   352k|	--index;	// Change to a C-style, zero based index.
  263|   352k|	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: 352k]
  ------------------
  264|       |
  265|   352k|	if ( (index == (XMP_Index)arrayNode->children.size()) && createNodes ) {	// Append a new last+1 node.
  ------------------
  |  Branch (265:7): [True: 76.1k, False: 276k]
  |  Branch (265:59): [True: 76.1k, False: 0]
  ------------------
  266|  76.1k|		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  293|  76.1k|#define kXMP_ArrayItemName	"[]"
  ------------------
              		XMP_Node * newItem = new XMP_Node ( arrayNode, kXMP_ArrayItemName, kXMP_NewImplicitNode );
  ------------------
  |  |  410|  76.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  267|  76.1k|		arrayNode->children.push_back ( newItem );
  268|  76.1k|	}
  269|       |
  270|       |	// ! Don't throw here for a too large index. SetProperty will throw, GetProperty will not.
  271|   352k|	if ( index >= (XMP_Index)arrayNode->children.size() ) index = -1;
  ------------------
  |  Branch (271:7): [True: 4, False: 352k]
  ------------------
  272|   352k|	return index;
  273|       |	
  274|   352k|}	// FindIndexedItem
XMPCore_Impl.cpp:_ZL19CheckImplicitStructP8XMP_NodeRKNSt3__16vectorI13XPathStepInfoNS1_9allocatorIS3_EEEEmm:
  487|   150k|{
  488|       |
  489|   150k|	if ( (stepNum < stepLim) &&
  ------------------
  |  Branch (489:7): [True: 33, False: 150k]
  ------------------
  490|     33|		 ((node->options & kXMP_PropCompositeMask) == 0) &&
  ------------------
  |  Branch (490:4): [True: 33, False: 0]
  ------------------
  491|     33|		 (GetStepKind ( expandedXPath[stepNum].options ) == kXMP_StructFieldStep) ) {
  ------------------
  |  |  408|     33|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  |  Branch (491:4): [True: 0, False: 33]
  ------------------
  492|       |
  493|      0|		node->options |= kXMP_PropValueIsStruct;
  494|       |
  495|      0|	}
  496|       |
  497|   150k|}	// CheckImplicitStruct
XMPCore_Impl.cpp:_ZL13DeleteSubtreeNSt3__111__wrap_iterIPP8XMP_NodeEE:
  507|     27|{
  508|     27|	XMP_Node * rootNode   = *rootNodePos;
  509|     27|	XMP_Node * rootParent = rootNode->parent;
  510|       |
  511|     27|	if ( ! (rootNode->options & kXMP_PropIsQualifier) ) {
  ------------------
  |  Branch (511:7): [True: 27, False: 0]
  ------------------
  512|       |
  513|     27|		rootParent->children.erase ( rootNodePos );
  514|       |
  515|     27|	} 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|     27|	delete rootNode;
  533|       |
  534|     27|}	// DeleteSubtree

_ZN13XMP_AutoMutexC2Ev:
  222|   511k|	XMP_AutoMutex() : mutex(&sXMPCoreLock) { XMP_EnterCriticalRegion ( *mutex ); ReportLock(); };
  ------------------
  |  |  168|   511k|	#define ReportLock()			++sLockCount
  ------------------
_ZN13XMP_AutoMutexD2Ev:
  223|   511k|	~XMP_AutoMutex() { if ( mutex != 0 ) { ReportUnlock(); XMP_ExitCriticalRegion ( *mutex ); mutex = 0; } };
  ------------------
  |  |  169|   190k|	#define ReportUnlock()			--sLockCount
  ------------------
  |  Branch (223:26): [True: 190k, False: 320k]
  ------------------
_ZN13XMP_AutoMutex8KeepLockEv:
  224|   320k|	void KeepLock() { ReportKeepLock(); mutex = 0; };
_ZN13XPathStepInfoC2EPKcj:
  389|   640k|	XPathStepInfo ( XMP_StringPtr _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN13XPathStepInfoC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj:
  390|   647k|	XPathStepInfo ( XMP_VarString _step, XMP_OptionBits _options ) : step(_step), options(_options) {};
_ZN8XMP_NodeC2EPS_PKcj:
  434|   177k|		: options(_options), name(_name), parent(_parent)
  435|   177k|	{
  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|   177k|	};
_ZN8XMP_NodeC2EPS_PKcS2_j:
  456|   132k|		: options(_options), name(_name), value(_value), parent(_parent)
  457|   132k|	{
  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|   132k|	};
_ZN8XMP_NodeC2EPS_RKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_j:
  467|  42.8k|		: options(_options), name(_name), value(_value), parent(_parent)
  468|  42.8k|	{
  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|  42.8k|	};
_ZN8XMP_Node14RemoveChildrenEv:
  478|   367k|	{
  479|   628k|		for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (479:47): [True: 261k, False: 367k]
  ------------------
  480|   261k|			if ( children[i] != 0 ) delete children[i];
  ------------------
  |  Branch (480:9): [True: 260k, False: 101]
  ------------------
  481|   261k|		}
  482|   367k|		children.clear();
  483|   367k|	}
_ZN8XMP_Node16RemoveQualifiersEv:
  486|   358k|	{
  487|   442k|		for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
  ------------------
  |  Branch (487:49): [True: 84.0k, False: 358k]
  ------------------
  488|  84.0k|			if ( qualifiers[i] != 0 ) delete qualifiers[i];
  ------------------
  |  Branch (488:9): [True: 84.0k, False: 0]
  ------------------
  489|  84.0k|		}
  490|   358k|		qualifiers.clear();
  491|   358k|	}
_ZN8XMP_Node9ClearNodeEv:
  494|  5.77k|	{
  495|  5.77k|		options = 0;
  496|  5.77k|		name.erase();
  497|  5.77k|		value.erase();
  498|  5.77k|		this->RemoveChildren();
  499|  5.77k|		this->RemoveQualifiers();
  500|  5.77k|	}
_ZN8XMP_NodeD2Ev:
  502|   352k|	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|  5.33k|						   XMP_OptionBits  options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
  428|  5.33k|{
  429|  5.33k|	if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
  ------------------
  |  Branch (429:7): [True: 0, False: 5.33k]
  ------------------
  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|  5.33k|	if ( *propName != 0 ) {
  ------------------
  |  Branch (435:7): [True: 1.93k, False: 3.40k]
  ------------------
  436|       |
  437|       |		// An iterator rooted at a specific node.
  438|       |
  439|       |		#if TraceIterators
  440|       |			printf ( "\nNew XMP property iterator for \"%s\", options = %X\n    Schema = %s, root = %s\n",
  441|       |			         xmpObj.tree.name.c_str(), options, schemaNS, propName );
  442|       |		#endif
  443|       |		
  444|  1.93k|		XMP_ExpandedXPath propPath;
  445|  1.93k|		ExpandXPath ( schemaNS, propName, &propPath );
  446|  1.93k|		XMP_Node * propNode = FindConstNode ( &xmpObj.tree, propPath );	// If not found get empty iteration.
  ------------------
  |  |  301|  1.93k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  1.93k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  447|       |		
  448|  1.93k|		if ( propNode != 0 ) {
  ------------------
  |  Branch (448:8): [True: 1.93k, False: 0]
  ------------------
  449|       |
  450|  1.93k|			XMP_VarString rootName ( propPath[1].step );	// The schema is [0].
  451|  2.10k|			for ( size_t i = 2; i < propPath.size(); ++i ) {
  ------------------
  |  Branch (451:24): [True: 166, False: 1.93k]
  ------------------
  452|    166|				XMP_OptionBits stepKind = GetStepKind ( propPath[i].options );
  ------------------
  |  |  408|    166|#define GetStepKind(f)	((f) & kXMP_StepKindMask)
  ------------------
  453|    166|				if ( stepKind <= kXMP_QualifierStep ) rootName += '/';
  ------------------
  |  Branch (453:10): [True: 139, False: 27]
  ------------------
  454|    166|				rootName += propPath[i].step;
  455|    166|			}
  456|       |
  457|  1.93k|			propName = rootName.c_str();
  458|  1.93k|			size_t leafOffset = rootName.size();
  459|  31.9k|			while ( (leafOffset > 0) && (propName[leafOffset] != '/') && (propName[leafOffset] != '[') ) --leafOffset;
  ------------------
  |  Branch (459:12): [True: 30.0k, False: 1.85k]
  |  Branch (459:32): [True: 29.9k, False: 83]
  |  Branch (459:65): [True: 29.9k, False: 0]
  ------------------
  460|  1.93k|			if ( propName[leafOffset] == '/' ) ++leafOffset;
  ------------------
  |  Branch (460:9): [True: 83, False: 1.85k]
  ------------------
  461|       |
  462|  1.93k|			info.tree.children.push_back ( IterNode ( propNode->options, propName, leafOffset ) );
  463|  1.93k|			SetCurrSchema ( info, propPath[kSchemaStep].step.c_str() );
  464|  1.93k|			if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (464:9): [True: 0, False: 1.93k]
  ------------------
  465|      0|				AddNodeOffspring ( info, info.tree.children.back(), propNode );
  466|      0|			}
  467|       |
  468|  1.93k|		}
  469|       |	
  470|  3.40k|	} else if ( *schemaNS != 0 ) {
  ------------------
  |  Branch (470:14): [True: 0, False: 3.40k]
  ------------------
  471|       |
  472|       |		// An iterator for all properties in one schema.
  473|       |		
  474|       |		#if TraceIterators
  475|       |			printf ( "\nNew XMP schema iterator for \"%s\", options = %X\n    Schema = %s\n",
  476|       |			         xmpObj.tree.name.c_str(), options, schemaNS );
  477|       |		#endif
  478|       |		
  479|      0|		info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaNS, 0 ) );
  480|      0|		IterNode & iterSchema = info.tree.children.back();
  481|       |		
  482|      0|		XMP_Node * xmpSchema = FindConstSchema ( &xmpObj.tree, schemaNS );
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  483|      0|		if ( xmpSchema != 0 ) AddSchemaProps ( info, iterSchema, xmpSchema );
  ------------------
  |  Branch (483:8): [True: 0, False: 0]
  ------------------
  484|       |		
  485|      0|		if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, schemaNS );
  ------------------
  |  Branch (485:8): [True: 0, False: 0]
  ------------------
  486|       |		
  487|      0|		if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (487:8): [True: 0, False: 0]
  ------------------
  488|      0|			info.tree.children.pop_back();	// No properties, remove the schema node.
  489|      0|		} else {
  490|      0|			SetCurrSchema ( info, schemaNS );
  491|      0|		}
  492|       |	
  493|  3.40k|	} 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|  11.0k|		for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum != schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (506:72): [True: 7.64k, False: 3.40k]
  ------------------
  507|       |
  508|  7.64k|			const XMP_Node * xmpSchema = xmpObj.tree.children[schemaNum];
  509|  7.64k|			info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, xmpSchema->name, 0 ) );
  510|  7.64k|			IterNode & iterSchema = info.tree.children.back();
  511|       |
  512|  7.64k|			if ( ! (info.options & kXMP_IterJustChildren) ) {
  ------------------
  |  Branch (512:9): [True: 7.64k, False: 0]
  ------------------
  513|  7.64k|				AddSchemaProps ( info, iterSchema, xmpSchema );
  514|  7.64k|				if ( info.options & kXMP_IterIncludeAliases ) AddSchemaAliases ( info, iterSchema, xmpSchema->name.c_str() );
  ------------------
  |  Branch (514:10): [True: 0, False: 7.64k]
  ------------------
  515|  7.64k|				if ( iterSchema.children.empty() ) info.tree.children.pop_back();	// No properties, remove the schema node.
  ------------------
  |  Branch (515:10): [True: 0, False: 7.64k]
  ------------------
  516|  7.64k|			}
  517|       |
  518|  7.64k|		}
  519|       |		
  520|  3.40k|		if ( info.options & kXMP_IterIncludeAliases ) {
  ------------------
  |  Branch (520:8): [True: 0, False: 3.40k]
  ------------------
  521|       |
  522|       |			// Add the schema that only have aliases. The most convenient, and safest way, is to go
  523|       |			// through the registered namespaces, see if it exists, and let AddSchemaAliases do its
  524|       |			// thing if not. Don't combine with the above loop, it is nicer to have the "real" stuff
  525|       |			// be in storage order (not subject to the namespace map order).
  526|       |			
  527|       |			// ! We don't do the kXMP_IterJustChildren handing in the same way here as above. The
  528|       |			// ! existing schema (presumably) have actual children. We need to call AddSchemaAliases
  529|       |			// ! here to determine if the namespace has any aliases to existing properties. We then
  530|       |			// ! strip the children if necessary.
  531|       |
  532|      0|			XMP_cStringMapPos currNS = sNamespaceURIToPrefixMap->begin();
  533|      0|			XMP_cStringMapPos endNS  = sNamespaceURIToPrefixMap->end();
  534|      0|			for ( ; currNS != endNS; ++currNS ) {
  ------------------
  |  Branch (534:12): [True: 0, False: 0]
  ------------------
  535|      0|				XMP_StringPtr schemaName = currNS->first.c_str();
  536|      0|				if ( FindConstSchema ( &xmpObj.tree, schemaName ) != 0 ) continue;
  ------------------
  |  |  298|      0|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|      0|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  |  Branch (536:10): [True: 0, False: 0]
  ------------------
  537|      0|				info.tree.children.push_back ( IterNode ( kXMP_SchemaNode, schemaName, 0 ) );
  538|      0|				IterNode & iterSchema = info.tree.children.back();
  539|      0|				AddSchemaAliases ( info, iterSchema, schemaName );
  540|      0|				if ( iterSchema.children.empty() ) {
  ------------------
  |  Branch (540:10): [True: 0, False: 0]
  ------------------
  541|      0|					info.tree.children.pop_back();	// No aliases, remove the schema node.
  542|      0|				} else if ( info.options & kXMP_IterJustChildren ) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|					iterSchema.children.clear();	// Get rid of the children.
  544|      0|				}
  545|      0|			}
  546|       |
  547|      0|		}
  548|       |
  549|  3.40k|	}
  550|       |	
  551|       |	// Set the current iteration position to the first node to be visited.
  552|       |	
  553|  5.33k|	info.currPos = info.tree.children.begin();
  554|  5.33k|	info.endPos  = info.tree.children.end();
  555|       |	
  556|  5.33k|	if ( (info.options & kXMP_IterJustChildren) && (info.currPos != info.endPos) && (*schemaNS != 0) ) {
  ------------------
  |  Branch (556:7): [True: 0, False: 5.33k]
  |  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|  5.33k|}	// XMPIterator for XMPMeta objects
_ZN11XMPIteratorD2Ev:
  591|  5.33k|{
  592|  5.33k|	XMP_Assert ( this->clientRefs <= 0 );
  ------------------
  |  |  142|  5.33k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|       |	// Let everything else default.
  594|       |	
  595|  5.33k|}	// ~XMPIterator
_ZN11XMPIterator4NextEPPKcPjS2_S3_S2_S3_S3_:
  617|   247k|{
  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|   247k|	if ( info.currPos == info.endPos ) return false;	// Happens at the start of an empty iteration.
  ------------------
  |  Branch (623:7): [True: 593, False: 247k]
  ------------------
  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|   247k|	const XMP_Node * xmpNode = GetNextXMPNode ( info );
  631|   247k|	if ( xmpNode == 0 ) return false;
  ------------------
  |  Branch (631:7): [True: 4.32k, False: 242k]
  ------------------
  632|   242k|	bool isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  633|       |	
  634|   242k|	if ( info.options & kXMP_IterJustLeafNodes ) {
  ------------------
  |  Branch (634:7): [True: 0, False: 242k]
  ------------------
  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|   242k|	*schemaNS = info.currSchema.c_str();
  644|   242k|	*nsSize   = info.currSchema.size();
  645|       |
  646|   242k|	*propOptions = info.currPos->options;
  647|       |
  648|   242k|	*propPath  = "";
  649|   242k|	*pathSize  = 0;
  650|   242k|	*propValue = "";
  651|   242k|	*valueSize = 0;
  652|       |	
  653|   242k|	if ( ! (*propOptions & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (653:7): [True: 235k, False: 7.59k]
  ------------------
  654|       |
  655|   235k|		*propPath = info.currPos->fullPath.c_str();
  656|   235k|		*pathSize = info.currPos->fullPath.size();
  657|   235k|		if ( info.options & kXMP_IterJustLeafName ) {
  ------------------
  |  Branch (657:8): [True: 0, False: 235k]
  ------------------
  658|      0|			*propPath += info.currPos->leafOffset;
  659|      0|			*pathSize -= info.currPos->leafOffset;
  660|      0|		}
  661|       |		
  662|   235k|		if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
  ------------------
  |  Branch (662:8): [True: 223k, False: 12.0k]
  ------------------
  663|   223k|			*propValue = xmpNode->value.c_str();
  664|   223k|			*valueSize = xmpNode->value.size();
  665|   223k|		}
  666|       |
  667|   235k|	}
  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|   242k|	return true;
  675|       |
  676|   242k|}	// Next
_ZN11XMPIterator10UnlockIterEj:
  729|   242k|{
  730|   242k|	UNUSED(options);
  731|       |
  732|   242k|	XMPMeta::Unlock ( 0 );
  733|       |	
  734|   242k|}	// UnlockIter
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoPKc:
  181|  1.93k|{
  182|       |
  183|  1.93k|	info.currSchema = schemaName;
  184|       |	#if 0	// *** XMP_DebugBuild
  185|       |		info._schemaPtr = info.currSchema.c_str();
  186|       |	#endif
  187|       |
  188|  1.93k|}	// SetCurrSchema
XMPIterator.cpp:_ZL16AddNodeOffspringR8IterInfoR8IterNodePK8XMP_Node:
  114|   235k|{
  115|   235k|	XMP_VarString currPath ( iterParent.fullPath );
  116|   235k|	size_t        leafOffset = iterParent.fullPath.size();
  117|       |	
  118|   235k|	if ( (! xmpParent->qualifiers.empty()) && (! (info.options & kXMP_IterOmitQualifiers)) ) {
  ------------------
  |  Branch (118:7): [True: 12.1k, False: 223k]
  |  Branch (118:44): [True: 12.1k, False: 0]
  ------------------
  119|       |
  120|       |		#if TraceIterators
  121|       |			printf ( "    Adding qualifiers of %s\n", currPath.c_str() );
  122|       |		#endif
  123|       |
  124|  12.1k|		currPath += "/?";	// All qualifiers are named and use paths like "Prop/?Qual".
  125|  12.1k|		leafOffset += 2;
  126|       |		
  127|  56.9k|		for ( size_t qualNum = 0, qualLim = xmpParent->qualifiers.size(); qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (127:69): [True: 44.7k, False: 12.1k]
  ------------------
  128|  44.7k|			const XMP_Node * xmpQual = xmpParent->qualifiers[qualNum];
  129|  44.7k|			currPath += xmpQual->name;
  130|  44.7k|			iterParent.qualifiers.push_back ( IterNode ( xmpQual->options, currPath, leafOffset ) );
  131|  44.7k|			currPath.erase ( leafOffset );
  132|       |			#if TraceIterators
  133|       |				printf ( "        %s\n", xmpQual->name.c_str() );
  134|       |			#endif
  135|  44.7k|		}
  136|       |		
  137|  12.1k|		leafOffset -= 2;
  138|  12.1k|		currPath.erase ( leafOffset );
  139|       |
  140|  12.1k|	}
  141|       |
  142|   235k|	if ( ! xmpParent->children.empty() ) {
  ------------------
  |  Branch (142:7): [True: 11.9k, False: 223k]
  ------------------
  143|       |	
  144|       |		#if TraceIterators
  145|       |			printf ( "    Adding children of %s\n", currPath.c_str() );
  146|       |		#endif
  147|       |
  148|  11.9k|		XMP_Assert ( xmpParent->options & kXMP_PropCompositeMask );
  ------------------
  |  |  142|  11.9k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  149|       |		
  150|  11.9k|		if ( xmpParent->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (150:8): [True: 7.21k, False: 4.72k]
  ------------------
  151|  7.21k|			currPath += '/';
  152|  7.21k|			leafOffset += 1;
  153|  7.21k|		}
  154|       |		
  155|   195k|		for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (155:69): [True: 183k, False: 11.9k]
  ------------------
  156|   183k|			const XMP_Node * xmpChild = xmpParent->children[childNum];
  157|   183k|			if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) {
  ------------------
  |  Branch (157:9): [True: 24.9k, False: 158k]
  ------------------
  158|  24.9k|				currPath += xmpChild->name;
  159|   158k|			} else {
  160|   158k|				char buffer [32];	// AUDIT: Using sizeof(buffer) below for snprintf length is safe.
  161|   158k|				snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) );	// ! XPath indices are one-based.
  162|   158k|				currPath += buffer;
  163|   158k|			}
  164|   183k|			iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
  165|   183k|			currPath.erase ( leafOffset );
  166|       |			#if TraceIterators
  167|       |				printf ( "        %s\n", (iterParent.children.back().fullPath.c_str() + leafOffset) );
  168|       |			#endif
  169|   183k|		}
  170|       |	
  171|  11.9k|	}
  172|       |
  173|   235k|}	// AddNodeOffspring
XMPIterator.cpp:_ZL14AddSchemaPropsR8IterInfoR8IterNodePK8XMP_Node:
   48|  7.64k|{
   49|  7.64k|	UNUSED(info);
   50|       |	#if TraceIterators
   51|       |		printf ( "    Adding properties of %s\n", xmpSchema->name.c_str() );
   52|       |	#endif
   53|       |
   54|  24.4k|	for ( size_t propNum = 0, propLim = xmpSchema->children.size(); propNum != propLim; ++propNum ) {
  ------------------
  |  Branch (54:66): [True: 16.8k, False: 7.64k]
  ------------------
   55|  16.8k|		const XMP_Node * xmpProp = xmpSchema->children[propNum];
   56|       |		// *** set the has-aliases bit when appropriate
   57|  16.8k|		iterSchema.children.push_back ( IterNode ( xmpProp->options, xmpProp->name, 0 ) );
   58|       |		#if TraceIterators
   59|       |			printf ( "        %s\n", xmpProp->name.c_str() );
   60|       |		#endif
   61|  16.8k|	}
   62|       |
   63|  7.64k|}	// AddSchemaProps
XMPIterator.cpp:_ZL14GetNextXMPNodeR8IterInfo:
  308|   247k|{
  309|   247k|	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|   247k|	if ( info.currPos->visitStage != kIter_BeforeVisit ) AdvanceIterPos ( info );
  ------------------
  |  Branch (322:7): [True: 242k, False: 4.74k]
  ------------------
  323|       |	
  324|   247k|	bool isSchemaNode = false;
  325|   247k|	XMP_ExpandedXPath expPath;	// Keep outside the loop to avoid constant construct/destruct.
  326|       |	
  327|   247k|	while ( info.currPos != info.endPos ) {
  ------------------
  |  Branch (327:10): [True: 242k, False: 4.40k]
  ------------------
  328|       |
  329|   242k|		isSchemaNode = XMP_NodeIsSchema ( info.currPos->options );
  330|   242k|		if ( isSchemaNode ) {
  ------------------
  |  Branch (330:8): [True: 7.51k, False: 235k]
  ------------------
  331|  7.51k|			SetCurrSchema ( info, info.currPos->fullPath );
  332|  7.51k|			xmpNode = FindConstSchema ( &info.xmpObj->tree, info.currPos->fullPath.c_str() );
  ------------------
  |  |  298|  7.51k|#define FindConstSchema(t,u)	FindSchemaNode ( const_cast<XMP_Node*>(t), u, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|  7.51k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  333|  7.51k|			if ( xmpNode == 0 ) xmpNode = sDummySchema;
  ------------------
  |  Branch (333:9): [True: 0, False: 7.51k]
  ------------------
  334|   235k|		} else {
  335|   235k|			ExpandXPath ( info.currSchema.c_str(), info.currPos->fullPath.c_str(), &expPath );
  336|   235k|			xmpNode = FindConstNode ( &info.xmpObj->tree, expPath );
  ------------------
  |  |  301|   235k|#define FindConstNode(t,p)		FindNode ( const_cast<XMP_Node*>(t), p, kXMP_ExistingOnly, 0 )
  |  |  ------------------
  |  |  |  |  296|   235k|#define kXMP_ExistingOnly	false
  |  |  ------------------
  ------------------
  337|   235k|		}
  338|   242k|		if ( xmpNode != 0 ) break;	// Exit the loop, we found a live XMP node.
  ------------------
  |  Branch (338:8): [True: 242k, False: 82]
  ------------------
  339|       |
  340|     82|		info.currPos->visitStage = kIter_VisitChildren;	// Make AdvanceIterPos move to the next sibling.
  341|     82|		info.currPos->children.clear();
  342|     82|		info.currPos->qualifiers.clear();
  343|     82|		AdvanceIterPos ( info );
  344|       |
  345|     82|	}
  346|       |
  347|   247k|	if ( info.currPos == info.endPos ) return 0;
  ------------------
  |  Branch (347:7): [True: 4.32k, False: 242k]
  ------------------
  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|   242k|	XMP_Assert ( info.currPos->visitStage == kIter_BeforeVisit );
  ------------------
  |  |  142|   242k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  354|       |
  355|   242k|	if ( info.currPos->visitStage == kIter_BeforeVisit ) {
  ------------------
  |  Branch (355:7): [True: 242k, False: 82]
  ------------------
  356|   242k|		if ( (! isSchemaNode) && (! (info.options & kXMP_IterJustChildren)) ) {
  ------------------
  |  Branch (356:8): [True: 235k, False: 7.51k]
  |  Branch (356:28): [True: 235k, False: 0]
  ------------------
  357|   235k|			AddNodeOffspring ( info, *info.currPos, xmpNode );
  358|   235k|		}
  359|   242k|		info.currPos->visitStage = kIter_VisitSelf;
  360|   242k|	}
  361|       |	
  362|   242k|	return xmpNode;
  363|       |
  364|   247k|}	// GetNextXMPNode
XMPIterator.cpp:_ZL13SetCurrSchemaR8IterInfoRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  192|  12.2k|{
  193|       |
  194|  12.2k|	info.currSchema = schemaName;
  195|       |	#if 0	// *** XMP_DebugBuild
  196|       |		info._schemaPtr = info.currSchema.c_str();
  197|       |	#endif
  198|       |
  199|  12.2k|}	// SetCurrSchema
XMPIterator.cpp:_ZL14AdvanceIterPosR8IterInfo:
  212|   242k|{
  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|   515k|	while ( true ) {
  ------------------
  |  Branch (220:10): [True: 515k, Folded]
  ------------------
  221|       |	
  222|   515k|		if ( info.currPos == info.endPos ) {
  ------------------
  |  Branch (222:8): [True: 35.1k, False: 480k]
  ------------------
  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|  35.1k|			if ( info.ancestors.empty() ) break;	// We're at the end of the schema list.
  ------------------
  |  Branch (229:9): [True: 4.32k, False: 30.8k]
  ------------------
  230|       |
  231|  30.8k|			IterPosPair & parent = info.ancestors.back();
  232|  30.8k|			info.currPos = parent.first;
  233|  30.8k|			info.endPos  = parent.second;
  234|  30.8k|			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|   480k|		} 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|   480k|			if ( info.currPos->visitStage == kIter_BeforeVisit ) {		// Visit this node now.
  ------------------
  |  Branch (252:9): [True: 206k, False: 273k]
  ------------------
  253|   206k|				if ( info.currPos->options & kXMP_SchemaNode ) SetCurrSchema ( info, info.currPos->fullPath );
  ------------------
  |  Branch (253:10): [True: 4.70k, False: 202k]
  ------------------
  254|   206k|				break;
  255|   206k|			}
  256|       |
  257|   273k|			if ( info.currPos->visitStage == kIter_VisitSelf ) {		// Just finished visiting the value portion.
  ------------------
  |  Branch (257:9): [True: 242k, False: 30.8k]
  ------------------
  258|   242k|				info.currPos->visitStage = kIter_VisitQualifiers;		// Start visiting the qualifiers.
  259|   242k|				if ( ! info.currPos->qualifiers.empty() ) {
  ------------------
  |  Branch (259:10): [True: 11.9k, False: 230k]
  ------------------
  260|  11.9k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  261|  11.9k|					info.endPos  = info.currPos->qualifiers.end();		// ! Set the parent's endPos before changing currPos!
  262|  11.9k|					info.currPos = info.currPos->qualifiers.begin();
  263|  11.9k|					break;
  264|  11.9k|				}
  265|   242k|			}
  266|       |
  267|   261k|			if ( info.currPos->visitStage == kIter_VisitQualifiers ) {	// Just finished visiting the qualifiers.
  ------------------
  |  Branch (267:9): [True: 242k, False: 18.8k]
  ------------------
  268|   242k|				info.currPos->qualifiers.clear();
  269|   242k|				info.currPos->visitStage = kIter_VisitChildren;			// Start visiting the children.
  270|   242k|				if ( ! info.currPos->children.empty() ) {
  ------------------
  |  Branch (270:10): [True: 19.3k, False: 223k]
  ------------------
  271|  19.3k|					info.ancestors.push_back ( IterPosPair ( info.currPos, info.endPos ) );
  272|  19.3k|					info.endPos  = info.currPos->children.end();		// ! Set the parent's endPos before changing currPos!
  273|  19.3k|					info.currPos = info.currPos->children.begin();
  274|  19.3k|					break;
  275|  19.3k|				}
  276|   242k|			}
  277|       |
  278|   241k|			if ( info.currPos->visitStage == kIter_VisitChildren ) {	// Just finished visiting the children.
  ------------------
  |  Branch (278:9): [True: 241k, False: 0]
  ------------------
  279|   241k|				info.currPos->children.clear();
  280|   241k|				++info.currPos;											// Move to the next sibling.
  281|   241k|				continue;
  282|   241k|			}
  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|   241k|		}
  292|       |
  293|   515k|	}	// Loop to find the next node.
  294|       |	
  295|   242k|	XMP_Assert ( (info.currPos == info.endPos) || (info.currPos->visitStage == kIter_BeforeVisit) );
  ------------------
  |  |  142|   242k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  296|       |
  297|   242k|}	// AdvanceIterPos

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

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

_ZN7XMPMeta15ParseFromBufferEPKcjj:
 1096|  4.59k|{
 1097|  4.59k|	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: 4.59k]
  |  Branch (1097:24): [True: 0, False: 0]
  ------------------
 1098|  4.59k|	if ( xmpSize == kXMP_UseNullTermination ) xmpSize = strlen ( buffer );
  ------------------
  |  Branch (1098:7): [True: 0, False: 4.59k]
  ------------------
 1099|       |	
 1100|  4.59k|	const bool lastClientCall = ((options & kXMP_ParseMoreBuffers) == 0);	// *** Could use FlagIsSet & FlagIsClear macros.
 1101|       |	
 1102|  4.59k|	this->tree.ClearNode();	// Make sure the target XMP object is totally empty.
 1103|       |
 1104|  4.59k|	if ( this->xmlParser == 0 ) {
  ------------------
  |  Branch (1104:7): [True: 4.59k, False: 0]
  ------------------
 1105|  4.59k|		if ( (xmpSize == 0) && lastClientCall ) return;	// Tolerate empty parse. Expat complains if there are no XML elements.
  ------------------
  |  Branch (1105:8): [True: 0, False: 4.59k]
  |  Branch (1105:26): [True: 0, False: 0]
  ------------------
 1106|  4.59k|		this->xmlParser = XMP_NewExpatAdapter();
 1107|  4.59k|	}
 1108|       |	
 1109|  4.59k|	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|  4.59k|	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|  4.59k|		if ( parser.charEncoding == XMP_OptionBits(-1) ) {
  ------------------
  |  Branch (1126:8): [True: 4.59k, False: 0]
  ------------------
 1127|       |
 1128|  4.59k|			if ( (parser.pendingCount == 0) && (xmpSize >= kXMLPendingInputMax) ) {
  ------------------
  |  Branch (1128:9): [True: 4.59k, False: 0]
  |  Branch (1128:39): [True: 4.51k, False: 73]
  ------------------
 1129|       |
 1130|       |				// This ought to be the common case, the first buffer is big enough.
 1131|  4.51k|				parser.charEncoding = DetermineInputEncoding ( (XMP_Uns8*)buffer, xmpSize );
 1132|       |
 1133|  4.51k|			} else {
 1134|       |			
 1135|       |				// Try to fill the pendingInput buffer before calling DetermineInputEncoding.
 1136|       |
 1137|     73|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1138|     73|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1138:10): [True: 73, False: 0]
  ------------------
 1139|       |
 1140|     73|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1141|     73|				buffer += pendingOverlap;
 1142|     73|				xmpSize -= pendingOverlap;
 1143|     73|				parser.pendingCount += pendingOverlap;
 1144|       |
 1145|     73|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1145:10): [True: 0, False: 73]
  |  Branch (1145:32): [True: 0, False: 0]
  ------------------
 1146|     73|				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|     73|			}
 1153|       |
 1154|  4.59k|		}
 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|  4.59k|		XMP_Assert ( parser.charEncoding != XMP_OptionBits(-1) );
  ------------------
  |  |  142|  4.59k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1160|       |
 1161|  4.59k|		if ( parser.charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1161:8): [True: 0, False: 4.59k]
  ------------------
 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|  4.59k|		} 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|  4.66k|			while ( parser.pendingCount > 0 ) {
  ------------------
  |  Branch (1181:12): [True: 73, False: 4.59k]
  ------------------
 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|     73|				size_t pendingOverlap = kXMLPendingInputMax - parser.pendingCount;
 1189|     73|				if ( pendingOverlap > xmpSize ) pendingOverlap = xmpSize;
  ------------------
  |  Branch (1189:10): [True: 73, False: 0]
  ------------------
 1190|       |				
 1191|     73|				memcpy ( &parser.pendingInput[parser.pendingCount], buffer, pendingOverlap );	// AUDIT: Count is safe.
 1192|     73|				parser.pendingCount += pendingOverlap;
 1193|     73|				buffer += pendingOverlap;
 1194|     73|				xmpSize -= pendingOverlap;
 1195|       |
 1196|     73|				if ( (! lastClientCall) && (parser.pendingCount < kXMLPendingInputMax) ) return;
  ------------------
  |  Branch (1196:10): [True: 0, False: 73]
  |  Branch (1196:32): [True: 0, False: 0]
  ------------------
 1197|     73|				size_t bytesDone = ProcessUTF8Portion ( &parser, parser.pendingInput, parser.pendingCount, lastClientCall );
 1198|     73|				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|     73|				if ( bytesDone == parser.pendingCount ) {
  ------------------
  |  Branch (1204:10): [True: 73, False: 0]
  ------------------
 1205|       |
 1206|       |					// Done with all of the pending input, move on to the current buffer.
 1207|     73|					parser.pendingCount = 0;
 1208|       |
 1209|     73|				} 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|     73|			}
 1236|       |			
 1237|       |			// Done with the pending input, process the current buffer.
 1238|       |
 1239|  4.59k|			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|  4.59k|			if ( bytesDone < xmpSize ) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 4.59k]
  ------------------
 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|  4.59k|		}
 1258|       |		
 1259|  4.59k|		if ( lastClientCall ) {
  ------------------
  |  Branch (1259:8): [True: 4.51k, False: 73]
  ------------------
 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|  4.51k|			const XML_Node * xmlRoot = FindRootNode ( this, *this->xmlParser, options );
 1267|       |
 1268|  4.51k|			if ( xmlRoot != 0 ) {
  ------------------
  |  Branch (1268:9): [True: 4.07k, False: 438]
  ------------------
 1269|       |
 1270|  4.07k|				ProcessRDF ( &this->tree, *xmlRoot, options );
 1271|  4.07k|				NormalizeDCArrays ( &this->tree );
 1272|  4.07k|				if ( this->tree.options & kXMP_PropHasAliases ) MoveExplicitAliases ( &this->tree, options );
  ------------------
  |  Branch (1272:10): [True: 0, False: 4.07k]
  ------------------
 1273|  4.07k|				TouchUpDataModel ( this );
 1274|       |				
 1275|       |				// Delete empty schema nodes. Do this last, other cleanup can make empty schema.
 1276|  4.07k|				size_t schemaNum = 0;
 1277|  11.7k|				while ( schemaNum < this->tree.children.size() ) {
  ------------------
  |  Branch (1277:13): [True: 7.64k, False: 4.07k]
  ------------------
 1278|  7.64k|					XMP_Node * currSchema = this->tree.children[schemaNum];
 1279|  7.64k|					if ( currSchema->children.size() > 0 ) {
  ------------------
  |  Branch (1279:11): [True: 7.64k, False: 0]
  ------------------
 1280|  7.64k|						++schemaNum;
 1281|  7.64k|					} else {
 1282|      0|						delete this->tree.children[schemaNum];	// ! Delete the schema node itself.
 1283|      0|						this->tree.children.erase ( this->tree.children.begin() + schemaNum );
 1284|      0|					}
 1285|  7.64k|				}
 1286|       |				
 1287|  4.07k|			}
 1288|       |
 1289|  4.51k|			delete this->xmlParser;
 1290|  4.51k|			this->xmlParser = 0;
 1291|       |
 1292|  4.51k|		}
 1293|       |		
 1294|  4.59k|	} catch ( ... ) {
 1295|       |
 1296|  1.18k|		delete this->xmlParser;
 1297|  1.18k|		this->xmlParser = 0;
 1298|  1.18k|		prevTkVer = 0;
 1299|  1.18k|		this->tree.ClearNode();
 1300|  1.18k|		throw;
 1301|       |
 1302|  1.18k|	}
 1303|       |	
 1304|  4.59k|}	// ParseFromBuffer
XMPMeta-Parse.cpp:_ZL22DetermineInputEncodingPKhm:
  810|  4.59k|{
  811|  4.59k|	if ( length < 2 ) return kXMP_EncodeUTF8;
  ------------------
  |  Branch (811:7): [True: 0, False: 4.59k]
  ------------------
  812|       |	
  813|  4.59k|	XMP_Uns8 * uniChar = (XMP_Uns8*)buffer;	// ! Make sure comparisons are unsigned.
  814|       |	
  815|  4.59k|	if ( uniChar[0] == 0 ) {
  ------------------
  |  Branch (815:7): [True: 0, False: 4.59k]
  ------------------
  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|  4.59k|	} else if ( uniChar[0] < 0x80 ) {
  ------------------
  |  Branch (825:14): [True: 4.57k, 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|  4.57k|		if ( uniChar[1] != 0 )  return kXMP_EncodeUTF8;
  ------------------
  |  Branch (832:8): [True: 4.57k, 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|  4.59k|}	// DetermineInputEncoding
XMPMeta-Parse.cpp:_ZL18ProcessUTF8PortionP16XMLParserAdapterPKhmb:
  976|  4.66k|{
  977|  4.66k|	const XMP_Uns8 * bufEnd = buffer + length;
  978|       |	
  979|  4.66k|	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|  4.66k|	std::string copy;
  992|       |		
  993|  65.1M|	for ( spanEnd = buffer; spanEnd < bufEnd; ++spanEnd ) {
  ------------------
  |  Branch (993:26): [True: 65.1M, False: 4.66k]
  ------------------
  994|       |
  995|  65.1M|		if ( (0x20 <= *spanEnd) && (*spanEnd <= 0x7E) && (*spanEnd != '&') ) {
  ------------------
  |  Branch (995:8): [True: 64.8M, False: 289k]
  |  Branch (995:30): [True: 64.8M, False: 61.2k]
  |  Branch (995:52): [True: 64.4M, False: 422k]
  ------------------
  996|  64.4M|			copy.push_back(*spanEnd);
  997|  64.4M|			continue;	// A regular ASCII character.
  998|  64.4M|		}
  999|       |
 1000|   773k|		if ( *spanEnd >= 0x80 ) {
  ------------------
  |  Branch (1000:8): [True: 40.8k, False: 732k]
  ------------------
 1001|       |		
 1002|       |			// See if this is a multi-byte UTF-8 sequence, or a Latin-1 character to replace.
 1003|       |
 1004|  40.8k|			int uniLen = CountUTF8 ( spanEnd, bufEnd );
 1005|       |
 1006|  40.8k|			if ( uniLen > 0 ) {
  ------------------
  |  Branch (1006:9): [True: 40.8k, False: 0]
  ------------------
 1007|       |
 1008|       |				// A valid UTF-8 character, keep it as-is.
 1009|  40.8k|				copy.append((const char*)spanEnd, uniLen);
 1010|  40.8k|				spanEnd += uniLen - 1;	// ! The loop increment will put back the +1.
 1011|       |
 1012|  40.8k|			} else if ( (uniLen < 0) && (! last) ) {
  ------------------
  |  Branch (1012:16): [True: 0, False: 0]
  |  Branch (1012:32): [True: 0, False: 0]
  ------------------
 1013|       |
 1014|       |				// Have a partial UTF-8 character at the end of the buffer and more input coming.
 1015|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1016|      0|				return (spanEnd - buffer);
 1017|       |
 1018|      0|			} else {
 1019|       |
 1020|       |				// Not a valid UTF-8 sequence. Replace the first byte with the Latin-1 equivalent.
 1021|      0|				const char * replacement = kReplaceLatin1 [ *spanEnd - 0x80 ];
 1022|      0|				copy.append ( replacement );
 1023|       |
 1024|      0|			}
 1025|       |		
 1026|   732k|		} else if ( (*spanEnd < 0x20) || (*spanEnd == 0x7F) ) {
  ------------------
  |  Branch (1026:15): [True: 289k, False: 443k]
  |  Branch (1026:36): [True: 20.3k, False: 422k]
  ------------------
 1027|       |
 1028|       |			// Replace ASCII controls other than tab, LF, and CR with a space.
 1029|       |
 1030|   309k|			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  100|   309k|#define kTab ((char)0x09)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  101|   304k|#define kLF ((char)0x0A)
  ------------------
              			if ( (*spanEnd == kTab) || (*spanEnd == kLF) || (*spanEnd == kCR) ) {
  ------------------
  |  |  102|  26.1k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (1030:9): [True: 5.18k, False: 304k]
  |  Branch (1030:31): [True: 278k, False: 26.1k]
  |  Branch (1030:52): [True: 5.76k, False: 20.3k]
  ------------------
 1031|   289k|				copy.push_back(*spanEnd);
 1032|   289k|				continue;
 1033|   289k|			}
 1034|       |
 1035|  20.3k|			copy.push_back(' ');
 1036|       |		
 1037|   422k|		} else {
 1038|       |		
 1039|       |			// See if this is a numeric escape sequence for a prohibited ASCII control.
 1040|       |			
 1041|   422k|			XMP_Assert ( *spanEnd == '&' );
  ------------------
  |  |  142|   422k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1042|   422k|			int escLen = CountControlEscape ( spanEnd, bufEnd );
 1043|       |			
 1044|   422k|			if ( escLen < 0 ) {
  ------------------
  |  Branch (1044:9): [True: 14, False: 422k]
  ------------------
 1045|       |
 1046|       |				// Have a partial numeric escape in this buffer, wait for more input.
 1047|     14|				if ( last ) {
  ------------------
  |  Branch (1047:10): [True: 14, False: 0]
  ------------------
 1048|     14|					copy.push_back('&');
 1049|     14|					continue;	// No more buffers, not an escape, absorb as normal input.
 1050|     14|				}
 1051|      0|				xmlParser->ParseBuffer ( copy.c_str(), copy.size(), false );
 1052|      0|				return (spanEnd - buffer);
 1053|       |
 1054|   422k|			} else if ( escLen > 0 ) {
  ------------------
  |  Branch (1054:16): [True: 13.3k, False: 409k]
  ------------------
 1055|       |
 1056|       |				// Have a complete numeric escape to replace.
 1057|  13.3k|				copy.push_back(' ');
 1058|  13.3k|				spanEnd = spanEnd + escLen - 1;	// ! The loop continuation will increment spanEnd!
 1059|       |
 1060|   409k|			} else {
 1061|   409k|				copy.push_back('&');
 1062|   409k|			}
 1063|       |
 1064|   422k|		}
 1065|       |		
 1066|   773k|	}
 1067|       |	
 1068|  4.66k|	XMP_Assert ( spanEnd == bufEnd );
  ------------------
  |  |  142|  4.66k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1069|  4.66k|	copy.push_back(' ');
 1070|  4.66k|	xmlParser->ParseBuffer ( copy.c_str(), copy.size(), true );
 1071|  4.66k|	return length;
 1072|       |
 1073|  4.66k|}	// ProcessUTF8Portion
XMPMeta-Parse.cpp:_ZL9CountUTF8PKhS0_:
  867|  40.8k|{
  868|  40.8k|	XMP_Assert ( charStart < bufEnd );		// Catch this in debug builds.
  ------------------
  |  |  142|  40.8k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  869|  40.8k|	if ( charStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (869:7): [True: 0, False: 40.8k]
  ------------------
  870|  40.8k|	if ( (*charStart & 0xC0) != 0xC0 ) return 0;	// Must have at least 2 high bits set.
  ------------------
  |  Branch (870:7): [True: 0, False: 40.8k]
  ------------------
  871|       |	
  872|  40.8k|	int byteCount = 2;
  873|  40.8k|	XMP_Uns8 firstByte = *charStart;
  874|  46.7k|	for ( firstByte = firstByte << 2; (firstByte & 0x80) != 0; firstByte = firstByte << 1 ) ++byteCount;
  ------------------
  |  Branch (874:36): [True: 5.90k, False: 40.8k]
  ------------------
  875|       |	
  876|  40.8k|	if ( (charStart + byteCount) > bufEnd ) return -byteCount;
  ------------------
  |  Branch (876:7): [True: 0, False: 40.8k]
  ------------------
  877|       |
  878|  87.5k|	for ( int i = 1; i < byteCount; ++i ) {
  ------------------
  |  Branch (878:19): [True: 46.7k, False: 40.8k]
  ------------------
  879|  46.7k|		if ( (charStart[i] & 0xC0) != 0x80 ) return 0;
  ------------------
  |  Branch (879:8): [True: 0, False: 46.7k]
  ------------------
  880|  46.7k|	}
  881|       |	
  882|  40.8k|	return byteCount;
  883|       |	
  884|  40.8k|}	// CountUTF8
XMPMeta-Parse.cpp:_ZL18CountControlEscapePKhS0_:
  897|   422k|{
  898|   422k|	XMP_Assert ( escStart < bufEnd );	// Catch this in debug builds.
  ------------------
  |  |  142|   422k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  899|   422k|	if ( escStart >= bufEnd ) return 0;	// Don't run-on in release builds.
  ------------------
  |  Branch (899:7): [True: 0, False: 422k]
  ------------------
  900|   422k|	XMP_Assert ( *escStart == '&' );
  ------------------
  |  |  142|   422k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  901|       |	
  902|   422k|	size_t tailLen = bufEnd - escStart;
  903|   422k|	if ( tailLen < 5 ) return -1;	// Don't need a more thorough check, we'll catch it on the next pass.
  ------------------
  |  Branch (903:7): [True: 14, False: 422k]
  ------------------
  904|       |	
  905|   422k|	if ( strncmp ( (char*)escStart, "&#x", 3 ) != 0 ) return 0;
  ------------------
  |  Branch (905:7): [True: 205k, False: 216k]
  ------------------
  906|       |	
  907|   216k|	XMP_Uns8 escValue = 0;
  908|   216k|	const XMP_Uns8 * escPos = escStart + 3;
  909|       |	
  910|   216k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (910:7): [True: 212k, False: 4.26k]
  |  Branch (910:27): [True: 183k, False: 29.5k]
  ------------------
  911|   183k|		escValue = *escPos - '0';
  912|   183k|		++escPos;
  913|   183k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (913:14): [True: 27.4k, False: 6.35k]
  |  Branch (913:34): [True: 14.7k, False: 12.7k]
  ------------------
  914|  14.7k|		escValue = *escPos - 'A' + 10;
  915|  14.7k|		++escPos;
  916|  19.0k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (916:14): [True: 11.4k, False: 7.60k]
  |  Branch (916:34): [True: 3.63k, False: 7.83k]
  ------------------
  917|  3.63k|		escValue = *escPos - 'a' + 10;
  918|  3.63k|		++escPos;
  919|  3.63k|	}
  920|       |	
  921|   216k|	if ( ('0' <= *escPos) && (*escPos <= '9') ) {
  ------------------
  |  Branch (921:7): [True: 184k, False: 32.0k]
  |  Branch (921:27): [True: 62.5k, False: 122k]
  ------------------
  922|  62.5k|		escValue = (escValue << 4) + (*escPos - '0');
  923|  62.5k|		++escPos;
  924|   154k|	} else if ( ('A' <= *escPos) && (*escPos <= 'F') ) {
  ------------------
  |  Branch (924:14): [True: 34.3k, False: 120k]
  |  Branch (924:34): [True: 10.5k, False: 23.8k]
  ------------------
  925|  10.5k|		escValue = (escValue << 4) + (*escPos - 'A' + 10);
  926|  10.5k|		++escPos;
  927|   143k|	} else if ( ('a' <= *escPos) && (*escPos <= 'f') ) {
  ------------------
  |  Branch (927:14): [True: 19.7k, False: 124k]
  |  Branch (927:34): [True: 665, False: 19.1k]
  ------------------
  928|    665|		escValue = (escValue << 4) + (*escPos - 'a' + 10);
  929|    665|		++escPos;
  930|    665|	}
  931|       |	
  932|   216k|	if ( escPos == bufEnd ) return -1;	// Partial escape.
  ------------------
  |  Branch (932:7): [True: 0, False: 216k]
  ------------------
  933|   216k|	if ( *escPos != ';' ) return 0;
  ------------------
  |  Branch (933:7): [True: 129k, False: 87.6k]
  ------------------
  934|       |	
  935|  87.6k|	size_t escLen = escPos - escStart + 1;
  936|  87.6k|	if ( escLen < 5 ) return 0;	// ! Catch "&#x;".
  ------------------
  |  Branch (936:7): [True: 1.71k, False: 85.9k]
  ------------------
  937|       |	
  938|  85.9k|	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  100|  85.9k|#define kTab ((char)0x09)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  101|  14.2k|#define kLF ((char)0x0A)
  ------------------
              	if ( (escValue == kTab) || (escValue == kLF) || (escValue == kCR) ) return 0;	// An allowed escape.
  ------------------
  |  |  102|  13.5k|#define kCR ((char)0x0D)
  ------------------
  |  Branch (938:7): [True: 71.7k, False: 14.2k]
  |  Branch (938:29): [True: 678, False: 13.5k]
  |  Branch (938:50): [True: 252, False: 13.3k]
  ------------------
  939|       |	
  940|  13.3k|	return escLen;	// Found a full "prohibited" numeric escape.
  941|       |	
  942|  85.9k|}	// CountControlEscape
XMPMeta-Parse.cpp:_ZL12FindRootNodeP7XMPMetaRK16XMLParserAdapterj:
  151|  4.51k|{
  152|  4.51k|	const XML_Node * rootNode = xmlParser.rootNode;
  153|       |	
  154|  4.51k|	if ( xmlParser.rootCount > 1 ) rootNode = PickBestRoot ( xmlParser.tree, options );
  ------------------
  |  Branch (154:7): [True: 113, False: 4.40k]
  ------------------
  155|  4.51k|	if ( rootNode == 0 ) return 0;
  ------------------
  |  Branch (155:7): [True: 438, False: 4.07k]
  ------------------
  156|       |	
  157|       |	// We have a root node. Try to extract previous toolkit version number.
  158|       |	
  159|  4.07k|	XMP_StringPtr verStr = "";
  160|       |	
  161|  4.07k|		XMP_Assert ( rootNode->name == "rdf:RDF" );
  ------------------
  |  |  142|  4.07k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  162|       |	
  163|  4.07k|		if ( (options & kXMP_RequireXMPMeta) &&
  ------------------
  |  Branch (163:8): [True: 0, False: 4.07k]
  ------------------
  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|  4.41k|		for ( size_t attrNum = 0, attrLim = rootNode->parent->attrs.size(); attrNum < attrLim; ++attrNum ) {
  ------------------
  |  Branch (167:71): [True: 1.08k, False: 3.33k]
  ------------------
  168|  1.08k|			const XML_Node * currAttr =rootNode->parent->attrs[attrNum];
  169|  1.08k|			if ( (currAttr->name == "x:xmptk") || (currAttr->name == "x:xaptk") ) {
  ------------------
  |  Branch (169:9): [True: 686, False: 394]
  |  Branch (169:42): [True: 57, False: 337]
  ------------------
  170|    743|				verStr = currAttr->value.c_str();
  171|    743|				break;
  172|    743|			}
  173|  1.08k|		}
  174|       |		
  175|       |	// Decode the version number into MMmmuubbb digits. If any part is too big, peg it at 99 or 999.
  176|       |	
  177|  4.07k|	unsigned long part;
  178|  26.6k|	while ( (*verStr != 0) && ((*verStr < '0') || (*verStr > '9')) ) ++verStr;
  ------------------
  |  Branch (178:10): [True: 23.3k, False: 3.36k]
  |  Branch (178:29): [True: 2.26k, False: 21.0k]
  |  Branch (178:48): [True: 20.3k, False: 714]
  ------------------
  179|       |	
  180|  4.07k|	part = 0;
  181|  6.68k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (181:10): [True: 3.30k, False: 3.37k]
  |  Branch (181:28): [True: 2.74k, False: 564]
  |  Branch (181:48): [True: 2.60k, False: 138]
  ------------------
  182|  2.60k|		part = (part * 10) + (*verStr - '0');
  183|  2.60k|		++verStr;
  184|  2.60k|	}
  185|  4.07k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (185:7): [True: 78, False: 4.00k]
  ------------------
  186|  4.07k|	thiz->prevTkVer = part * 100*100*1000;
  187|       |	
  188|  4.07k|	part = 0;
  189|  4.07k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (189:7): [True: 426, False: 3.65k]
  ------------------
  190|  5.59k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (190:10): [True: 2.21k, False: 3.37k]
  |  Branch (190:28): [True: 1.66k, False: 555]
  |  Branch (190:48): [True: 1.51k, False: 145]
  ------------------
  191|  1.51k|		part = (part * 10) + (*verStr - '0');
  192|  1.51k|		++verStr;
  193|  1.51k|	}
  194|  4.07k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (194:7): [True: 77, False: 4.00k]
  ------------------
  195|  4.07k|	thiz->prevTkVer += part * 100*1000;
  196|       |	
  197|  4.07k|	part = 0;
  198|  4.07k|	if ( *verStr == '.' ) ++verStr;
  ------------------
  |  Branch (198:7): [True: 67, False: 4.01k]
  ------------------
  199|  4.99k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (199:10): [True: 1.60k, False: 3.38k]
  |  Branch (199:28): [True: 1.08k, False: 518]
  |  Branch (199:48): [True: 916, False: 173]
  ------------------
  200|    916|		part = (part * 10) + (*verStr - '0');
  201|    916|		++verStr;
  202|    916|	}
  203|  4.07k|	if ( part > 99 ) part = 99;
  ------------------
  |  Branch (203:7): [True: 32, False: 4.04k]
  ------------------
  204|  4.07k|	thiz->prevTkVer += part * 1000;
  205|       |	
  206|  4.07k|	part = 0;
  207|  4.07k|	if ( *verStr == '-' ) ++verStr;
  ------------------
  |  Branch (207:7): [True: 306, False: 3.77k]
  ------------------
  208|  4.49k|	while ( (*verStr != 0) && ('0' <= *verStr) && (*verStr <= '9') ) {
  ------------------
  |  Branch (208:10): [True: 1.09k, False: 3.39k]
  |  Branch (208:28): [True: 849, False: 246]
  |  Branch (208:48): [True: 412, False: 437]
  ------------------
  209|    412|		part = (part * 10) + (*verStr - '0');
  210|    412|		++verStr;
  211|    412|	}
  212|  4.07k|	if ( part > 999 ) part = 999;
  ------------------
  |  Branch (212:7): [True: 31, False: 4.04k]
  ------------------
  213|  4.07k|	thiz->prevTkVer += part;
  214|       |	
  215|  4.07k|	return rootNode;
  216|       |	
  217|  4.07k|}	// FindRootNode
XMPMeta-Parse.cpp:_ZL12PickBestRootRK8XML_Nodej:
  111|  7.61k|{
  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|  18.0k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (115:66): [True: 10.5k, False: 7.48k]
  ------------------
  116|  10.5k|		const XML_Node * childNode = xmlParent.content[childNum];
  117|  10.5k|		if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (117:8): [True: 8.69k, False: 1.83k]
  ------------------
  118|  1.83k|		if ( (childNode->name == "x:xmpmeta") || (childNode->name == "x:xapmeta") ) return PickBestRoot ( *childNode, 0 );
  ------------------
  |  Branch (118:8): [True: 127, False: 1.71k]
  |  Branch (118:44): [True: 0, False: 1.71k]
  ------------------
  119|  1.83k|	}
  120|       |	// Look among this parent's content for a bare rdf:RDF if that is allowed.
  121|  7.48k|	if ( ! (options & kXMP_RequireXMPMeta) ) {
  ------------------
  |  Branch (121:7): [True: 7.48k, False: 0]
  ------------------
  122|  17.3k|		for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (122:67): [True: 9.96k, False: 7.37k]
  ------------------
  123|  9.96k|			const XML_Node * childNode = xmlParent.content[childNum];
  124|  9.96k|			if ( childNode->kind != kElemNode ) continue;
  ------------------
  |  Branch (124:9): [True: 8.27k, False: 1.68k]
  ------------------
  125|  1.68k|			if ( childNode->name == "rdf:RDF" ) return childNode;
  ------------------
  |  Branch (125:9): [True: 105, False: 1.58k]
  ------------------
  126|  1.68k|		}
  127|  7.48k|	}
  128|       |	
  129|       |	// Recurse into the content.
  130|  14.7k|	for ( size_t childNum = 0, childLim = xmlParent.content.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (130:66): [True: 7.37k, False: 7.36k]
  ------------------
  131|  7.37k|		const XML_Node * foundRoot = PickBestRoot ( *xmlParent.content[childNum], options );
  132|  7.37k|		if ( foundRoot != 0 ) return foundRoot;
  ------------------
  |  Branch (132:8): [True: 11, False: 7.36k]
  ------------------
  133|  7.37k|	}
  134|       |	
  135|  7.36k|	return 0;
  136|       |
  137|  7.37k|}	// PickBestRoot
XMPMeta-Parse.cpp:_ZL17NormalizeDCArraysP8XMP_Node:
  231|  2.96k|{
  232|  2.96k|	XMP_Node * dcSchema = FindSchemaNode ( xmpTree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.96k|#define kXMP_ExistingOnly	false
  ------------------
  233|  2.96k|	if ( dcSchema == 0 ) return;
  ------------------
  |  Branch (233:7): [True: 2.55k, False: 405]
  ------------------
  234|       |	
  235|  1.60k|	for ( size_t propNum = 0, propLimit = dcSchema->children.size(); propNum < propLimit; ++propNum ) {
  ------------------
  |  Branch (235:67): [True: 1.19k, False: 405]
  ------------------
  236|  1.19k|		XMP_Node *     currProp  = dcSchema->children[propNum];
  237|  1.19k|		XMP_OptionBits arrayForm = 0;
  238|       |		
  239|  1.19k|		if ( ! XMP_PropIsSimple ( currProp->options ) ) continue;	// Nothing to do if not simple.
  ------------------
  |  Branch (239:8): [True: 261, False: 937]
  ------------------
  240|       |		
  241|    937|		if ( (currProp->name == "dc:creator" )     ||	// See if it is supposed to be an array.
  ------------------
  |  Branch (241:8): [True: 22, False: 915]
  ------------------
  242|    915|		     (currProp->name == "dc:date" ) ) {			// *** Think about an array of char* and a loop.
  ------------------
  |  Branch (242:8): [True: 0, False: 915]
  ------------------
  243|     22|			arrayForm = kXMP_PropArrayIsOrdered;
  244|    915|		} else if (
  245|    915|		     (currProp->name == "dc:description" ) ||
  ------------------
  |  Branch (245:8): [True: 7, False: 908]
  ------------------
  246|    908|		     (currProp->name == "dc:rights" )      ||
  ------------------
  |  Branch (246:8): [True: 60, False: 848]
  ------------------
  247|    848|		     (currProp->name == "dc:title" ) ) {
  ------------------
  |  Branch (247:8): [True: 28, False: 820]
  ------------------
  248|     95|			arrayForm = kXMP_PropArrayIsAltText;
  249|    820|		} else if (
  250|    820|		     (currProp->name == "dc:contributor" ) ||
  ------------------
  |  Branch (250:8): [True: 36, False: 784]
  ------------------
  251|    784|		     (currProp->name == "dc:language" )    ||
  ------------------
  |  Branch (251:8): [True: 24, False: 760]
  ------------------
  252|    760|		     (currProp->name == "dc:publisher" )   ||
  ------------------
  |  Branch (252:8): [True: 6, False: 754]
  ------------------
  253|    754|		     (currProp->name == "dc:relation" )    ||
  ------------------
  |  Branch (253:8): [True: 63, False: 691]
  ------------------
  254|    691|		     (currProp->name == "dc:subject" )     ||
  ------------------
  |  Branch (254:8): [True: 42, False: 649]
  ------------------
  255|    649|		     (currProp->name == "dc:type" ) ) {
  ------------------
  |  Branch (255:8): [True: 6, False: 643]
  ------------------
  256|    177|			arrayForm = kXMP_PropValueIsArray;
  257|    177|		}
  258|    937|		if ( arrayForm == 0 ) continue;	// Nothing to do if it isn't supposed to be an array.
  ------------------
  |  Branch (258:8): [True: 643, False: 294]
  ------------------
  259|       |		
  260|    294|		arrayForm = VerifySetOptions ( arrayForm, 0 );	// Set the implicit array bits.
  261|    294|		XMP_Node * newArray = new XMP_Node ( dcSchema, currProp->name.c_str(), arrayForm );
  262|    294|		dcSchema->children[propNum] = newArray;
  263|    294|		newArray->children.push_back ( currProp );
  264|    294|		currProp->parent = newArray;
  265|    294|		currProp->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|    294|#define kXMP_ArrayItemName	"[]"
  ------------------
  266|       |		
  267|    294|		if ( XMP_ArrayIsAltText ( arrayForm ) && (! (currProp->options & kXMP_PropHasLang)) ) {
  ------------------
  |  Branch (267:8): [True: 95, False: 199]
  |  Branch (267:44): [True: 67, False: 28]
  ------------------
  268|     67|			XMP_Node * newLang = new XMP_Node ( currProp, "xml:lang", "x-default", kXMP_PropIsQualifier );
  269|     67|			currProp->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  270|     67|			if ( currProp->qualifiers.empty() ) {	// *** Need a util?
  ------------------
  |  Branch (270:9): [True: 67, False: 0]
  ------------------
  271|     67|				currProp->qualifiers.push_back ( newLang );
  272|     67|			} else {
  273|      0|				currProp->qualifiers.insert ( currProp->qualifiers.begin(), newLang );
  274|      0|			}
  275|     67|		}
  276|       |
  277|    294|	}
  278|       |	
  279|    405|}	// NormalizeDCArrays
XMPMeta-Parse.cpp:_ZL16TouchUpDataModelP7XMPMeta:
  665|  2.96k|{
  666|  2.96k|	XMP_Node & tree = xmp->tree;
  667|       |	
  668|       |	// Do special case touch ups for certain schema.
  669|       |
  670|  2.96k|	XMP_Node * currSchema = 0;
  671|       |
  672|  2.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_EXIF, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.96k|#define kXMP_ExistingOnly	false
  ------------------
  673|  2.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (673:7): [True: 6, False: 2.95k]
  ------------------
  674|       |
  675|       |		// Do a special case fix for exif:GPSTimeStamp.
  676|      6|		XMP_Node * gpsDateTime = FindChildNode ( currSchema, "exif:GPSTimeStamp", kXMP_ExistingOnly );
  ------------------
  |  |  296|      6|#define kXMP_ExistingOnly	false
  ------------------
  677|      6|		if ( gpsDateTime != 0 ) FixGPSTimeStamp ( currSchema, gpsDateTime );
  ------------------
  |  Branch (677:8): [True: 0, False: 6]
  ------------------
  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|      6|		XMP_Node * userComment = FindChildNode ( currSchema, "exif:UserComment", kXMP_ExistingOnly );
  ------------------
  |  |  296|      6|#define kXMP_ExistingOnly	false
  ------------------
  682|      6|		if ( (userComment != 0) && XMP_PropIsSimple ( userComment->options ) ) {
  ------------------
  |  Branch (682:8): [True: 0, False: 6]
  |  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|      6|	}
  697|       |
  698|  2.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DM, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.96k|#define kXMP_ExistingOnly	false
  ------------------
  699|  2.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (699:7): [True: 0, False: 2.96k]
  ------------------
  700|       |		// Do a special case migration of xmpDM:copyright to dc:rights['x-default']. Do this before
  701|       |		// the dc: touch up since it can affect the dc: schema.
  702|      0|		XMP_Node * dmCopyright = FindChildNode ( currSchema, "xmpDM:copyright", kXMP_ExistingOnly );
  ------------------
  |  |  296|      0|#define kXMP_ExistingOnly	false
  ------------------
  703|      0|		if ( dmCopyright != 0 ) MigrateAudioCopyright ( xmp, dmCopyright );
  ------------------
  |  Branch (703:8): [True: 0, False: 0]
  ------------------
  704|      0|	}
  705|       |
  706|  2.96k|	currSchema = FindSchemaNode ( &tree, kXMP_NS_DC, kXMP_ExistingOnly );
  ------------------
  |  |  296|  2.96k|#define kXMP_ExistingOnly	false
  ------------------
  707|  2.96k|	if ( currSchema != 0 ) {
  ------------------
  |  Branch (707:7): [True: 405, False: 2.55k]
  ------------------
  708|       |		// Do a special case fix for dc:subject, make sure it is an unordered array.
  709|    405|		XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
  ------------------
  |  |  296|    405|#define kXMP_ExistingOnly	false
  ------------------
  710|    405|		if ( dcSubject != 0 ) {
  ------------------
  |  Branch (710:8): [True: 42, False: 363]
  ------------------
  711|     42|                        XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
  712|     42|			dcSubject->options &= keepMask;	// Make sure any ordered array bits are clear.
  713|     42|		}
  714|    405|	}
  715|       |	
  716|       |	// Fix any broken AltText arrays that we know about.
  717|       |	
  718|  2.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:description" );	// ! Note inclusion of prefixes for direct node lookup!
  719|  2.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:rights" );
  720|  2.96k|	RepairAltText ( tree, kXMP_NS_DC, "dc:title" );
  721|  2.96k|	RepairAltText ( tree, kXMP_NS_XMP_Rights, "xmpRights:UsageTerms" );
  722|  2.96k|	RepairAltText ( tree, kXMP_NS_EXIF, "exif:UserComment" );
  723|       |	
  724|       |	// Tweak old XMP: Move an instance ID from rdf:about to the xmpMM:InstanceID property. An old
  725|       |	// instance ID usually looks like "uuid:bac965c4-9d87-11d9-9a30-000d936b79c4", plus InDesign
  726|       |	// 3.0 wrote them like "bac965c4-9d87-11d9-9a30-000d936b79c4". If the name looks like a UUID
  727|       |	// simply move it to xmpMM:InstanceID, don't worry about any existing xmpMM:InstanceID. Both
  728|       |	// will only be present when a newer file with the xmpMM:InstanceID property is updated by an
  729|       |	// old app that uses rdf:about.
  730|       |	
  731|  2.96k|	if ( ! tree.name.empty() ) {
  ------------------
  |  Branch (731:7): [True: 249, False: 2.71k]
  ------------------
  732|       |
  733|    249|		bool nameIsUUID = false;
  734|    249|		XMP_StringPtr nameStr = tree.name.c_str();
  735|       |
  736|    249|		if ( XMP_LitNMatch ( nameStr, "uuid:", 5 ) ) {
  ------------------
  |  |   97|    249|#define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)
  |  |  ------------------
  |  |  |  Branch (97:30): [True: 31, False: 218]
  |  |  ------------------
  ------------------
  737|       |
  738|     31|			nameIsUUID = true;
  739|       |
  740|    218|		} else if ( tree.name.size() == 36 ) {
  ------------------
  |  Branch (740:15): [True: 108, False: 110]
  ------------------
  741|       |
  742|    108|			nameIsUUID = true;	// ! Assume true, we'll set it to false below if not.
  743|  1.84k|			for ( int i = 0;  i < 36; ++i ) {
  ------------------
  |  Branch (743:22): [True: 1.81k, False: 27]
  ------------------
  744|  1.81k|				char ch = nameStr[i];
  745|  1.81k|				if ( ch == '-' ) {
  ------------------
  |  Branch (745:10): [True: 100, False: 1.71k]
  ------------------
  746|    100|					if ( (i == 8) || (i == 13) || (i == 18) || (i == 23) ) continue;
  ------------------
  |  Branch (746:11): [True: 27, False: 73]
  |  Branch (746:23): [True: 18, False: 55]
  |  Branch (746:36): [True: 10, False: 45]
  |  Branch (746:49): [True: 26, False: 19]
  ------------------
  747|     19|					nameIsUUID = false;
  748|     19|					break;
  749|  1.71k|				} else {
  750|  1.71k|					if ( (('0' <= ch) && (ch <= '9')) || (('a' <= ch) && (ch <= 'z')) ) continue;
  ------------------
  |  Branch (750:12): [True: 1.69k, False: 21]
  |  Branch (750:27): [True: 421, False: 1.27k]
  |  Branch (750:44): [True: 1.23k, False: 56]
  |  Branch (750:59): [True: 1.23k, False: 6]
  ------------------
  751|     62|					nameIsUUID = false;
  752|     62|					break;
  753|  1.71k|				}
  754|  1.81k|			}
  755|       |
  756|    108|		}
  757|       |		
  758|    249|		if ( nameIsUUID ) {
  ------------------
  |  Branch (758:8): [True: 58, False: 191]
  ------------------
  759|       |
  760|     58|			XMP_ExpandedXPath expPath;
  761|     58|			ExpandXPath ( kXMP_NS_XMP_MM, "InstanceID", &expPath );
  762|     58|			XMP_Node * idNode = FindNode ( &tree, expPath, kXMP_CreateNodes, 0 );
  ------------------
  |  |  295|     58|#define kXMP_CreateNodes	true
  ------------------
  763|     58|			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: 58]
  ------------------
  764|       |
  765|     58|			idNode->options = 0;	// Clobber any existing xmpMM:InstanceID.
  766|     58|			idNode->value = tree.name;
  767|     58|			idNode->RemoveChildren();
  768|     58|			idNode->RemoveQualifiers();
  769|       |
  770|     58|			tree.name.erase();
  771|       |
  772|     58|		}
  773|       |
  774|    249|	}
  775|       |
  776|  2.96k|}	// TouchUpDataModel
XMPMeta-Parse.cpp:_ZL13RepairAltTextR8XMP_NodePKcS2_:
  609|  14.8k|{
  610|  14.8k|	XMP_Node * schemaNode = FindSchemaNode ( &tree, schemaNS, kXMP_ExistingOnly );
  ------------------
  |  |  296|  14.8k|#define kXMP_ExistingOnly	false
  ------------------
  611|  14.8k|	if ( schemaNode == 0 ) return;
  ------------------
  |  Branch (611:7): [True: 13.5k, False: 1.26k]
  ------------------
  612|       |	
  613|  1.26k|	XMP_Node * arrayNode = FindChildNode ( schemaNode, arrayName, kXMP_ExistingOnly );
  ------------------
  |  |  296|  1.26k|#define kXMP_ExistingOnly	false
  ------------------
  614|  1.26k|	if ( (arrayNode == 0) || XMP_ArrayIsAltText ( arrayNode->options ) ) return;	// Already OK.
  ------------------
  |  Branch (614:7): [True: 1.03k, False: 232]
  |  Branch (614:27): [True: 135, False: 97]
  ------------------
  615|       |	
  616|     97|	if ( ! XMP_PropIsArray ( arrayNode->options ) ) return;	// ! Not even an array, leave it alone.
  ------------------
  |  Branch (616:7): [True: 1, False: 96]
  ------------------
  617|       |	// *** Should probably change simple values to LangAlt with 'x-default' item.
  618|       |	
  619|     96|	arrayNode->options |= (kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
  620|       |	
  621|  2.17k|	for ( int i = arrayNode->children.size()-1; i >= 0; --i ) {	// ! Need a signed index type.
  ------------------
  |  Branch (621:46): [True: 2.07k, False: 96]
  ------------------
  622|       |
  623|  2.07k|		XMP_Node * currChild = arrayNode->children[i];
  624|       |
  625|  2.07k|		if ( ! XMP_PropIsSimple ( currChild->options ) ) {
  ------------------
  |  Branch (625:8): [True: 41, False: 2.03k]
  ------------------
  626|       |
  627|       |			// Delete non-simple children.
  628|     41|			delete ( currChild );
  629|     41|			arrayNode->children.erase ( arrayNode->children.begin() + i );
  630|       |
  631|  2.03k|		} else if ( ! XMP_PropHasLang ( currChild->options ) ) {
  ------------------
  |  Branch (631:15): [True: 1.99k, False: 47]
  ------------------
  632|       |		
  633|  1.99k|			if ( currChild->value.empty() ) {
  ------------------
  |  Branch (633:9): [True: 10, False: 1.98k]
  ------------------
  634|       |
  635|       |				// Delete empty valued children that have no xml:lang.
  636|     10|				delete ( currChild );
  637|     10|				arrayNode->children.erase ( arrayNode->children.begin() + i );
  638|       |
  639|  1.98k|			} else {
  640|       |
  641|       |				// Add an xml:lang qualifier with the value "x-repair".
  642|  1.98k|				XMP_Node * repairLang = new XMP_Node ( currChild, "xml:lang", "x-repair", kXMP_PropIsQualifier );
  643|  1.98k|				if ( currChild->qualifiers.empty() ) {
  ------------------
  |  Branch (643:10): [True: 1.96k, False: 20]
  ------------------
  644|  1.96k|					currChild->qualifiers.push_back ( repairLang );
  645|  1.96k|				} else {
  646|     20|					currChild->qualifiers.insert ( currChild->qualifiers.begin(), repairLang );
  647|     20|				}
  648|  1.98k|				currChild->options |= (kXMP_PropHasQualifiers | kXMP_PropHasLang);
  649|       |
  650|  1.98k|			}
  651|       |
  652|  1.99k|		}
  653|       |
  654|  2.07k|	}
  655|       |
  656|     96|}	// RepairAltText

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

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

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

