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

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

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

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

_ZN5Exiv25ErrorC2INSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_9ErrorCodeERKT_:
  243|  1.12k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.12k|    setMsg(1);
  245|  1.12k|  }
_ZN5Exiv213toBasicStringIcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS2_IT_NS3_IS8_EENS5_IS8_EEEERKT0_:
  153|  1.12k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.12k|  std::basic_ostringstream<charT> os;
  155|  1.12k|  os << arg;
  156|  1.12k|  return os.str();
  157|  1.12k|}
_ZN5Exiv213toBasicStringIcA4_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  4.05k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  4.05k|  std::basic_ostringstream<charT> os;
  155|  4.05k|  os << arg;
  156|  4.05k|  return os.str();
  157|  4.05k|}
_ZN5Exiv25ErrorC2IA10_cEENS_9ErrorCodeERKT_:
  243|    278|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|    278|    setMsg(1);
  245|    278|  }
_ZN5Exiv213toBasicStringIcA10_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|    278|std::basic_string<charT> toBasicString(const T& arg) {
  154|    278|  std::basic_ostringstream<charT> os;
  155|    278|  os << arg;
  156|    278|  return os.str();
  157|    278|}
_ZN5Exiv25ErrorC2IA5_cEENS_9ErrorCodeERKT_:
  243|  1.79k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  1.79k|    setMsg(1);
  245|  1.79k|  }
_ZN5Exiv213toBasicStringIcA5_cEENSt3__112basic_stringIT_NS2_11char_traitsIS4_EENS2_9allocatorIS4_EEEERKT0_:
  153|  1.79k|std::basic_string<charT> toBasicString(const T& arg) {
  154|  1.79k|  std::basic_ostringstream<charT> os;
  155|  1.79k|  os << arg;
  156|  1.79k|  return os.str();
  157|  1.79k|}
_ZN5Exiv25ErrorC2IA4_cEENS_9ErrorCodeERKT_:
  243|  4.05k|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|  4.05k|    setMsg(1);
  245|  4.05k|  }
_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|     75|std::basic_string<charT> toBasicString(const T& arg) {
  154|     75|  std::basic_ostringstream<charT> os;
  155|     75|  os << arg;
  156|     75|  return os.str();
  157|     75|}
_ZN5Exiv25ErrorC2IPKcEENS_9ErrorCodeERKT_:
  243|     75|  Error(ErrorCode code, const A& arg1) : code_(code), arg1_(toBasicString<char>(arg1)) {
  244|     75|    setMsg(1);
  245|     75|  }

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

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

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

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

_ZN5Exiv29MetadatumC2Ev:
  261|  11.9M|  Metadatum() = default;
_ZN5Exiv23KeyC2Ev:
   79|  17.9M|  Key() = default;
_ZN5Exiv23KeyC2ERKS0_:
   80|   532k|  Key(const Key&) = default;

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

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

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

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

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

_ZN5Exiv27DataBuf5beginEv:
  158|  6.66M|  [[nodiscard]] auto begin() noexcept {
  159|  6.66M|    return pData_.begin();
  160|  6.66M|  }
_ZN5Exiv27DataBuf3endEv:
  162|  69.9k|  [[nodiscard]] auto end() noexcept {
  163|  69.9k|    return pData_.end();
  164|  69.9k|  }
_ZNK5Exiv27DataBuf5beginEv:
  166|  35.2k|  [[nodiscard]] auto begin() const noexcept {
  167|  35.2k|    return pData_.begin();
  168|  35.2k|  }
_ZNK5Exiv27DataBuf3endEv:
  170|  35.0k|  [[nodiscard]] auto end() const noexcept {
  171|  35.0k|    return pData_.end();
  172|  35.0k|  }
_ZNK5Exiv27DataBuf4sizeEv:
  174|  8.28M|  [[nodiscard]] size_t size() const {
  175|  8.28M|    return pData_.size();
  176|  8.28M|  }
_ZNK5Exiv27DataBuf5emptyEv:
  207|  87.5k|  [[nodiscard]] bool empty() const {
  208|  87.5k|    return pData_.empty();
  209|  87.5k|  }
_ZN5Exiv27DataBufC2Ev:
  126|  2.53M|  DataBuf() = default;
_ZN5Exiv27DataBufaSEOS0_:
  134|  20.6k|  DataBuf& operator=(DataBuf&& other) = default;
image.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_18RegistryENS_9ImageTypeELm30EEEPKT_RAT1__S5_RKT0_:
  460|  63.7k|const T* find(T (&src)[N], const K& key) {
  461|  63.7k|  static_assert(N > 0, "Passed zero length find");
  462|  63.7k|  auto rc = std::find(src, src + N, key);
  463|  63.7k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 63.7k]
  ------------------
  464|  63.7k|}
_ZN5Exiv28toStringItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   117k|std::string toString(const T& arg) {
  480|   117k|  return toStringHelper(arg, std::is_integral<T>());
  481|   117k|}
_ZN5Exiv214toStringHelperItEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   117k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   117k|  return std::to_string(arg);
  470|   117k|}
_ZN5Exiv29getUShortIPKhEEtRKNS_5SliceIT_EENS_9ByteOrderE:
  240|  54.2M|uint16_t getUShort(const Slice<T>& buf, ByteOrder byteOrder) {
  241|  54.2M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (241:7): [True: 861k, False: 53.4M]
  ------------------
  242|   861k|    return static_cast<byte>(buf.at(1)) << 8 | static_cast<byte>(buf.at(0));
  243|   861k|  }
  244|  53.4M|  return static_cast<byte>(buf.at(0)) << 8 | static_cast<byte>(buf.at(1));
  245|  54.2M|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEhLm13EEEPKT_RAT1__S4_RKT0_:
  460|   633k|const T* find(T (&src)[N], const K& key) {
  461|   633k|  static_assert(N > 0, "Passed zero length find");
  462|   633k|  auto rc = std::find(src, src + N, key);
  463|   633k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 629k, False: 4.54k]
  ------------------
  464|   633k|}
types.cpp:_ZN5Exiv24findIKN12_GLOBAL__N_113TypeInfoTableENS_6TypeIdELm24EEEPKT_RAT1__S5_RKT0_:
  460|  11.3M|const T* find(T (&src)[N], const K& key) {
  461|  11.3M|  static_assert(N > 0, "Passed zero length find");
  462|  11.3M|  auto rc = std::find(src, src + N, key);
  463|  11.3M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.46M, False: 6.92M]
  ------------------
  464|  11.3M|}
_ZN5Exiv28stringToIlEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|     22|T stringTo(const std::string& s, bool& ok) {
  496|     22|  std::istringstream is(s);
  497|     22|  T tmp = T();
  498|     22|  ok = static_cast<bool>(is >> tmp);
  499|     22|  std::string rest;
  500|     22|  is >> std::skipws >> rest;
  501|     22|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 0, False: 22]
  ------------------
  502|      0|    ok = false;
  503|     22|  return tmp;
  504|     22|}
_ZN5Exiv28toStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  21.6k|std::string toString(const T& arg) {
  480|  21.6k|  return toStringHelper(arg, std::is_integral<T>());
  481|  21.6k|}
_ZN5Exiv214toStringHelperIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  21.6k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  21.6k|  return std::to_string(arg);
  470|  21.6k|}
_ZN5Exiv28toStringIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  3.06k|std::string toString(const T& arg) {
  480|  3.06k|  return toStringHelper(arg, std::is_integral<T>());
  481|  3.06k|}
_ZN5Exiv214toStringHelperIsEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  3.06k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  3.06k|  return std::to_string(arg);
  470|  3.06k|}
_ZN5Exiv28toStringIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   199k|std::string toString(const T& arg) {
  480|   199k|  return toStringHelper(arg, std::is_integral<T>());
  481|   199k|}
_ZN5Exiv214toStringHelperIiEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|   199k|std::string toStringHelper(const T& arg, std::true_type) {
  469|   199k|  return std::to_string(arg);
  470|   199k|}
_ZN5Exiv28toStringIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  4.09k|std::string toString(const T& arg) {
  480|  4.09k|  return toStringHelper(arg, std::is_integral<T>());
  481|  4.09k|}
_ZN5Exiv214toStringHelperIfEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|  4.09k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  4.09k|  std::ostringstream os;
  475|  4.09k|  os << arg;
  476|  4.09k|  return os.str();
  477|  4.09k|}
_ZN5Exiv28toStringIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|   186k|std::string toString(const T& arg) {
  480|   186k|  return toStringHelper(arg, std::is_integral<T>());
  481|   186k|}
_ZN5Exiv214toStringHelperIdEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb0EEE:
  473|   186k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   186k|  std::ostringstream os;
  475|   186k|  os << arg;
  476|   186k|  return os.str();
  477|   186k|}
_ZN5Exiv28toStringImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  29.1k|std::string toString(const T& arg) {
  480|  29.1k|  return toStringHelper(arg, std::is_integral<T>());
  481|  29.1k|}
_ZN5Exiv214toStringHelperImEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  29.1k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  29.1k|  return std::to_string(arg);
  470|  29.1k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm4EEEPKT_RAT1__S4_RKT0_:
  460|  1.47k|const T* find(T (&src)[N], const K& key) {
  461|  1.47k|  static_assert(N > 0, "Passed zero length find");
  462|  1.47k|  auto rc = std::find(src, src + N, key);
  463|  1.47k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.01k, False: 468]
  ------------------
  464|  1.47k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm6EEEPKT_RAT1__S4_RKT0_:
  460|    653|const T* find(T (&src)[N], const K& key) {
  461|    653|  static_assert(N > 0, "Passed zero length find");
  462|    653|  auto rc = std::find(src, src + N, key);
  463|    653|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 364, False: 289]
  ------------------
  464|    653|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm5EEEPKT_RAT1__S4_RKT0_:
  460|  1.24k|const T* find(T (&src)[N], const K& key) {
  461|  1.24k|  static_assert(N > 0, "Passed zero length find");
  462|  1.24k|  auto rc = std::find(src, src + N, key);
  463|  1.24k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.11k, False: 126]
  ------------------
  464|  1.24k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm198EEEPKT_RAT1__S4_RKT0_:
  460|   116k|const T* find(T (&src)[N], const K& key) {
  461|   116k|  static_assert(N > 0, "Passed zero length find");
  462|   116k|  auto rc = std::find(src, src + N, key);
  463|   116k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.09k, False: 114k]
  ------------------
  464|   116k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm2EEEPKT_RAT1__S4_RKT0_:
  460|  4.43k|const T* find(T (&src)[N], const K& key) {
  461|  4.43k|  static_assert(N > 0, "Passed zero length find");
  462|  4.43k|  auto rc = std::find(src, src + N, key);
  463|  4.43k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.33k, False: 2.10k]
  ------------------
  464|  4.43k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm3EEEPKT_RAT1__S4_RKT0_:
  460|  12.3k|const T* find(T (&src)[N], const K& key) {
  461|  12.3k|  static_assert(N > 0, "Passed zero length find");
  462|  12.3k|  auto rc = std::find(src, src + N, key);
  463|  12.3k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 10.6k, False: 1.79k]
  ------------------
  464|  12.3k|}
_ZN5Exiv24findIKNS_8Internal11MatroskaTagEmLm7EEEPKT_RAT1__S4_RKT0_:
  460|  6.38k|const T* find(T (&src)[N], const K& key) {
  461|  6.38k|  static_assert(N > 0, "Passed zero length find");
  462|  6.38k|  auto rc = std::find(src, src + N, key);
  463|  6.38k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 5.28k, False: 1.09k]
  ------------------
  464|  6.38k|}
_ZN5Exiv28toStringIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  479|  2.49k|std::string toString(const T& arg) {
  480|  2.49k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.49k|}
_ZN5Exiv214toStringHelperIPKhEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_NS3_17integral_constantIbLb0EEE:
  473|  2.49k|std::string toStringHelper(const T& arg, std::false_type) {
  474|  2.49k|  std::ostringstream os;
  475|  2.49k|  os << arg;
  476|  2.49k|  return os.str();
  477|  2.49k|}
_ZN5Exiv28toStringIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  479|  2.07k|std::string toString(const T& arg) {
  480|  2.07k|  return toStringHelper(arg, std::is_integral<T>());
  481|  2.07k|}
_ZN5Exiv214toStringHelperIlEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_NS1_17integral_constantIbLb1EEE:
  468|  2.07k|std::string toStringHelper(const T& arg, std::true_type) {
  469|  2.07k|  return std::to_string(arg);
  470|  2.07k|}
_ZN5Exiv28toStringIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  479|   538k|std::string toString(const T& arg) {
  480|   538k|  return toStringHelper(arg, std::is_integral<T>());
  481|   538k|}
_ZN5Exiv214toStringHelperIPhEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_NS2_17integral_constantIbLb0EEE:
  473|   538k|std::string toStringHelper(const T& arg, std::false_type) {
  474|   538k|  std::ostringstream os;
  475|   538k|  os << arg;
  476|   538k|  return os.str();
  477|   538k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm6EEEPKT_RAT1__S4_RKT0_:
  460|  1.47k|const T* find(T (&src)[N], const K& key) {
  461|  1.47k|  static_assert(N > 0, "Passed zero length find");
  462|  1.47k|  auto rc = std::find(src, src + N, key);
  463|  1.47k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 1.30k, False: 163]
  ------------------
  464|  1.47k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm32EEEPKT_RAT1__SB_RKT0_:
  460|  9.82k|const T* find(T (&src)[N], const K& key) {
  461|  9.82k|  static_assert(N > 0, "Passed zero length find");
  462|  9.82k|  auto rc = std::find(src, src + N, key);
  463|  9.82k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 6.90k, False: 2.92k]
  ------------------
  464|  9.82k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm61EEEPKT_RAT1__SB_RKT0_:
  460|  9.82k|const T* find(T (&src)[N], const K& key) {
  461|  9.82k|  static_assert(N > 0, "Passed zero length find");
  462|  9.82k|  auto rc = std::find(src, src + N, key);
  463|  9.82k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 8.69k, False: 1.12k]
  ------------------
  464|  9.82k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm2EEEPKT_RAT1__SB_RKT0_:
  460|  7.11k|const T* find(T (&src)[N], const K& key) {
  461|  7.11k|  static_assert(N > 0, "Passed zero length find");
  462|  7.11k|  auto rc = std::find(src, src + N, key);
  463|  7.11k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.08k, False: 3.02k]
  ------------------
  464|  7.11k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEjLm41EEEPKT_RAT1__S4_RKT0_:
  460|   110k|const T* find(T (&src)[N], const K& key) {
  461|   110k|  static_assert(N > 0, "Passed zero length find");
  462|   110k|  auto rc = std::find(src, src + N, key);
  463|   110k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 96.2k, False: 14.2k]
  ------------------
  464|   110k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm3EEEPKT_RAT1__S4_RKT0_:
  460|  33.6k|const T* find(T (&src)[N], const K& key) {
  461|  33.6k|  static_assert(N > 0, "Passed zero length find");
  462|  33.6k|  auto rc = std::find(src, src + N, key);
  463|  33.6k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 13.4k, False: 20.1k]
  ------------------
  464|  33.6k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm6EEEPKT_RAT1__S4_RKT0_:
  460|  5.36k|const T* find(T (&src)[N], const K& key) {
  461|  5.36k|  static_assert(N > 0, "Passed zero length find");
  462|  5.36k|  auto rc = std::find(src, src + N, key);
  463|  5.36k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 4.36k, False: 997]
  ------------------
  464|  5.36k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm11EEEPKT_RAT1__S4_RKT0_:
  460|  5.34k|const T* find(T (&src)[N], const K& key) {
  461|  5.34k|  static_assert(N > 0, "Passed zero length find");
  462|  5.34k|  auto rc = std::find(src, src + N, key);
  463|  5.34k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 3.12k, False: 2.22k]
  ------------------
  464|  5.34k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEiLm2EEEPKT_RAT1__S4_RKT0_:
  460|  1.12k|const T* find(T (&src)[N], const K& key) {
  461|  1.12k|  static_assert(N > 0, "Passed zero length find");
  462|  1.12k|  auto rc = std::find(src, src + N, key);
  463|  1.12k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 622, False: 499]
  ------------------
  464|  1.12k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm86EEEPKT_RAT1__SB_RKT0_:
  460|   147k|const T* find(T (&src)[N], const K& key) {
  461|   147k|  static_assert(N > 0, "Passed zero length find");
  462|   147k|  auto rc = std::find(src, src + N, key);
  463|   147k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 123k, False: 23.6k]
  ------------------
  464|   147k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm17EEEPKT_RAT1__SB_RKT0_:
  460|   114k|const T* find(T (&src)[N], const K& key) {
  461|   114k|  static_assert(N > 0, "Passed zero length find");
  462|   114k|  auto rc = std::find(src, src + N, key);
  463|   114k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 108k, False: 5.92k]
  ------------------
  464|   114k|}
_ZN5Exiv24findIKNS_8Internal10TagDetailsEtLm31EEEPKT_RAT1__S4_RKT0_:
  460|  5.07k|const T* find(T (&src)[N], const K& key) {
  461|  5.07k|  static_assert(N > 0, "Passed zero length find");
  462|  5.07k|  auto rc = std::find(src, src + N, key);
  463|  5.07k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 462, False: 4.61k]
  ------------------
  464|  5.07k|}
_ZN5Exiv24findIKNS_8Internal13TagVocabularyENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm16EEEPKT_RAT1__SB_RKT0_:
  460|  6.96k|const T* find(T (&src)[N], const K& key) {
  461|  6.96k|  static_assert(N > 0, "Passed zero length find");
  462|  6.96k|  auto rc = std::find(src, src + N, key);
  463|  6.96k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 2.23k, False: 4.73k]
  ------------------
  464|  6.96k|}
_ZN5Exiv24findIKNS_9GroupInfoENS_5IfdIdELm126EEEPKT_RAT1__S4_RKT0_:
  460|  11.2M|const T* find(T (&src)[N], const K& key) {
  461|  11.2M|  static_assert(N > 0, "Passed zero length find");
  462|  11.2M|  auto rc = std::find(src, src + N, key);
  463|  11.2M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 11.2M]
  ------------------
  464|  11.2M|}
_ZN5Exiv24findIKNS_9GroupInfoENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELm126EEEPKT_RAT1__SA_RKT0_:
  460|  7.98M|const T* find(T (&src)[N], const K& key) {
  461|  7.98M|  static_assert(N > 0, "Passed zero length find");
  462|  7.98M|  auto rc = std::find(src, src + N, key);
  463|  7.98M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 7.98M]
  ------------------
  464|  7.98M|}
_ZN5Exiv24findIKNS_8Internal15TiffMappingInfoENS2_3KeyELm5EEEPKT_RAT1__S5_RKT0_:
  460|  6.26M|const T* find(T (&src)[N], const K& key) {
  461|  6.26M|  static_assert(N > 0, "Passed zero length find");
  462|  6.26M|  auto rc = std::find(src, src + N, key);
  463|  6.26M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 6.25M, False: 15.9k]
  ------------------
  464|  6.26M|}
_ZN5Exiv27DataBufC2EOS0_:
  132|  6.89k|  DataBuf(DataBuf&&) = default;
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_2NsELm47EEEPKT_RAT1__S4_RKT0_:
  460|   164k|const T* find(T (&src)[N], const K& key) {
  461|   164k|  static_assert(N > 0, "Passed zero length find");
  462|   164k|  auto rc = std::find(src, src + N, key);
  463|   164k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 55.9k, False: 108k]
  ------------------
  464|   164k|}
_ZN5Exiv24findIKNS_9XmpNsInfoENS1_6PrefixELm47EEEPKT_RAT1__S4_RKT0_:
  460|  1.49M|const T* find(T (&src)[N], const K& key) {
  461|  1.49M|  static_assert(N > 0, "Passed zero length find");
  462|  1.49M|  auto rc = std::find(src, src + N, key);
  463|  1.49M|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 102, False: 1.49M]
  ------------------
  464|  1.49M|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELm26EEEPKT_RAT1__S9_RKT0_:
  460|  20.4k|const T* find(T (&src)[N], const K& key) {
  461|  20.4k|  static_assert(N > 0, "Passed zero length find");
  462|  20.4k|  auto rc = std::find(src, src + N, key);
  463|  20.4k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 6.94k, False: 13.5k]
  ------------------
  464|  20.4k|}
_ZN5Exiv24findIKNS_8Internal14TiffMnRegistryENS_5IfdIdELm26EEEPKT_RAT1__S5_RKT0_:
  460|  9.43k|const T* find(T (&src)[N], const K& key) {
  461|  9.43k|  static_assert(N > 0, "Passed zero length find");
  462|  9.43k|  auto rc = std::find(src, src + N, key);
  463|  9.43k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 0, False: 9.43k]
  ------------------
  464|  9.43k|}
_ZN5Exiv24findIKNS_8Internal13NikonArrayIdxENS2_3KeyELm34EEEPKT_RAT1__S5_RKT0_:
  460|  2.18k|const T* find(T (&src)[N], const K& key) {
  461|  2.18k|  static_assert(N > 0, "Passed zero length find");
  462|  2.18k|  auto rc = std::find(src, src + N, key);
  463|  2.18k|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 326, False: 1.85k]
  ------------------
  464|  2.18k|}
_ZN5Exiv28stringToIjEET_RKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERb:
  495|    254|T stringTo(const std::string& s, bool& ok) {
  496|    254|  std::istringstream is(s);
  497|    254|  T tmp = T();
  498|    254|  ok = static_cast<bool>(is >> tmp);
  499|    254|  std::string rest;
  500|    254|  is >> std::skipws >> rest;
  501|    254|  if (!rest.empty())
  ------------------
  |  Branch (501:7): [True: 113, False: 141]
  ------------------
  502|    113|    ok = false;
  503|    254|  return tmp;
  504|    254|}
_ZN5Exiv24findIKPKcNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEELm19EEEPKT_RAT1__SB_RKT0_:
  460|     92|const T* find(T (&src)[N], const K& key) {
  461|     92|  static_assert(N > 0, "Passed zero length find");
  462|     92|  auto rc = std::find(src, src + N, key);
  463|     92|  return rc == src + N ? nullptr : rc;
  ------------------
  |  Branch (463:10): [True: 82, False: 10]
  ------------------
  464|     92|}

_ZNK5Exiv25Value6typeIdEv:
   85|  10.2M|  TypeId typeId() const {
   86|  10.2M|    return type_;
   87|  10.2M|  }
_ZNK5Exiv25Value5cloneEv:
   93|  15.2M|  UniquePtr clone() const {
   94|  15.2M|    return UniquePtr(clone_());
   95|  15.2M|  }
_ZNK5Exiv25Value2okEv:
  181|  15.4k|  bool ok() const {
  182|  15.4k|    return ok_;
  183|  15.4k|  }
_ZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  795|  43.5k|  bool operator()(const std::string& str1, const std::string& str2) const {
  796|  43.5k|    if (str1.size() != str2.size())
  ------------------
  |  Branch (796:9): [True: 24.9k, False: 18.5k]
  ------------------
  797|  24.9k|      return str1.size() > str2.size();
  798|       |
  799|  18.5k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
  800|  18.5k|    return std::lexicographical_compare(str1.begin(), str1.end(), str2.begin(), str2.end(), f);
  801|  43.5k|  }
_ZN5Exiv27getTypeItEENS_6TypeIdEv:
 1083|   156k|inline TypeId getType<uint16_t>() {
 1084|   156k|  return unsignedShort;
 1085|   156k|}
_ZN5Exiv27getTypeIjEENS_6TypeIdEv:
 1088|  5.75k|inline TypeId getType<uint32_t>() {
 1089|  5.75k|  return unsignedLong;
 1090|  5.75k|}
_ZN5Exiv27getTypeINSt3__14pairIjjEEEENS_6TypeIdEv:
 1093|  14.5k|inline TypeId getType<URational>() {
 1094|  14.5k|  return unsignedRational;
 1095|  14.5k|}
_ZN5Exiv27getTypeIsEENS_6TypeIdEv:
 1098|  51.7k|inline TypeId getType<int16_t>() {
 1099|  51.7k|  return signedShort;
 1100|  51.7k|}
_ZN5Exiv27getTypeIiEENS_6TypeIdEv:
 1103|  44.8k|inline TypeId getType<int32_t>() {
 1104|  44.8k|  return signedLong;
 1105|  44.8k|}
_ZN5Exiv27getTypeINSt3__14pairIiiEEEENS_6TypeIdEv:
 1108|  16.7k|inline TypeId getType<Rational>() {
 1109|  16.7k|  return signedRational;
 1110|  16.7k|}
_ZN5Exiv27getTypeIfEENS_6TypeIdEv:
 1113|  9.05k|inline TypeId getType<float>() {
 1114|  9.05k|  return tiffFloat;
 1115|  9.05k|}
_ZN5Exiv27getTypeIdEENS_6TypeIdEv:
 1118|  16.5k|inline TypeId getType<double>() {
 1119|  16.5k|  return tiffDouble;
 1120|  16.5k|}
_ZN5Exiv28getValueItEET_PKhNS_9ByteOrderE:
 1314|  2.09M|inline uint16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1315|  2.09M|  return getUShort(buf, byteOrder);
 1316|  2.09M|}
_ZN5Exiv28getValueIjEET_PKhNS_9ByteOrderE:
 1319|  3.44M|inline uint32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1320|  3.44M|  return getULong(buf, byteOrder);
 1321|  3.44M|}
_ZN5Exiv28getValueINSt3__14pairIjjEEEET_PKhNS_9ByteOrderE:
 1324|   549k|inline URational getValue(const byte* buf, ByteOrder byteOrder) {
 1325|   549k|  return getURational(buf, byteOrder);
 1326|   549k|}
_ZN5Exiv28getValueIsEET_PKhNS_9ByteOrderE:
 1329|  1.52M|inline int16_t getValue(const byte* buf, ByteOrder byteOrder) {
 1330|  1.52M|  return getShort(buf, byteOrder);
 1331|  1.52M|}
_ZN5Exiv28getValueIiEET_PKhNS_9ByteOrderE:
 1334|   312k|inline int32_t getValue(const byte* buf, ByteOrder byteOrder) {
 1335|   312k|  return getLong(buf, byteOrder);
 1336|   312k|}
_ZN5Exiv28getValueINSt3__14pairIiiEEEET_PKhNS_9ByteOrderE:
 1339|   479k|inline Rational getValue(const byte* buf, ByteOrder byteOrder) {
 1340|   479k|  return getRational(buf, byteOrder);
 1341|   479k|}
_ZN5Exiv28getValueIfEET_PKhNS_9ByteOrderE:
 1344|   258k|inline float getValue(const byte* buf, ByteOrder byteOrder) {
 1345|   258k|  return getFloat(buf, byteOrder);
 1346|   258k|}
_ZN5Exiv28getValueIdEET_PKhNS_9ByteOrderE:
 1349|   538k|inline double getValue(const byte* buf, ByteOrder byteOrder) {
 1350|   538k|  return getDouble(buf, byteOrder);
 1351|   538k|}
_ZN5Exiv26toDataItEEmPhT_NS_9ByteOrderE:
 1372|  1.78M|inline size_t toData(byte* buf, uint16_t t, ByteOrder byteOrder) {
 1373|  1.78M|  return us2Data(buf, t, byteOrder);
 1374|  1.78M|}
_ZN5Exiv26toDataIjEEmPhT_NS_9ByteOrderE:
 1380|  1.64M|inline size_t toData(byte* buf, uint32_t t, ByteOrder byteOrder) {
 1381|  1.64M|  return ul2Data(buf, t, byteOrder);
 1382|  1.64M|}
_ZN5Exiv26toDataINSt3__14pairIjjEEEEmPhT_NS_9ByteOrderE:
 1388|   552k|inline size_t toData(byte* buf, URational t, ByteOrder byteOrder) {
 1389|   552k|  return ur2Data(buf, t, byteOrder);
 1390|   552k|}
_ZN5Exiv26toDataIsEEmPhT_NS_9ByteOrderE:
 1396|   650k|inline size_t toData(byte* buf, int16_t t, ByteOrder byteOrder) {
 1397|   650k|  return s2Data(buf, t, byteOrder);
 1398|   650k|}
_ZN5Exiv26toDataIiEEmPhT_NS_9ByteOrderE:
 1404|   136k|inline size_t toData(byte* buf, int32_t t, ByteOrder byteOrder) {
 1405|   136k|  return l2Data(buf, t, byteOrder);
 1406|   136k|}
_ZN5Exiv26toDataINSt3__14pairIiiEEEEmPhT_NS_9ByteOrderE:
 1412|   472k|inline size_t toData(byte* buf, Rational t, ByteOrder byteOrder) {
 1413|   472k|  return r2Data(buf, t, byteOrder);
 1414|   472k|}
_ZN5Exiv26toDataIfEEmPhT_NS_9ByteOrderE:
 1420|   227k|inline size_t toData(byte* buf, float t, ByteOrder byteOrder) {
 1421|   227k|  return f2Data(buf, t, byteOrder);
 1422|   227k|}
_ZN5Exiv26toDataIdEEmPhT_NS_9ByteOrderE:
 1428|   183k|inline size_t toData(byte* buf, double t, ByteOrder byteOrder) {
 1429|   183k|  return d2Data(buf, t, byteOrder);
 1430|   183k|}
_ZNK5Exiv29ValueTypeIdE7toInt64Em:
 1548|  4.60k|inline int64_t ValueType<double>::toInt64(size_t n) const {
 1549|  4.60k|  return float_to_integer_helper<int64_t>(n);
 1550|  4.60k|}
_ZNK5Exiv29ValueTypeIdE8toUint32Em:
 1553|  24.1k|inline uint32_t ValueType<double>::toUint32(size_t n) const {
 1554|  24.1k|  return float_to_integer_helper<uint32_t>(n);
 1555|  24.1k|}
_ZNK5Exiv29ValueTypeIfE7toInt64Em:
 1558|  11.5k|inline int64_t ValueType<float>::toInt64(size_t n) const {
 1559|  11.5k|  return float_to_integer_helper<int64_t>(n);
 1560|  11.5k|}
_ZNK5Exiv29ValueTypeIfE8toUint32Em:
 1562|  15.9k|inline uint32_t ValueType<float>::toUint32(size_t n) const {
 1563|  15.9k|  return float_to_integer_helper<uint32_t>(n);
 1564|  15.9k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE7toInt64Em:
 1567|  3.42k|inline int64_t ValueType<Rational>::toInt64(size_t n) const {
 1568|  3.42k|  return rational_to_integer_helper<int64_t>(n);
 1569|  3.42k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8toUint32Em:
 1571|  8.37k|inline uint32_t ValueType<Rational>::toUint32(size_t n) const {
 1572|  8.37k|  return rational_to_integer_helper<uint32_t>(n);
 1573|  8.37k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE7toInt64Em:
 1576|  2.24k|inline int64_t ValueType<URational>::toInt64(size_t n) const {
 1577|  2.24k|  return rational_to_integer_helper<int64_t>(n);
 1578|  2.24k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8toUint32Em:
 1580|  7.06k|inline uint32_t ValueType<URational>::toUint32(size_t n) const {
 1581|  7.06k|  return rational_to_integer_helper<uint32_t>(n);
 1582|  7.06k|}
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIlEET_m:
 1212|  4.60k|  I float_to_integer_helper(size_t n) const {
 1213|  4.60k|    const auto v = value_.at(n);
 1214|  4.60k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 3.84k, False: 759]
  ------------------
 1215|  3.84k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 2.81k, False: 1.03k]
  ------------------
 1216|  2.81k|      return static_cast<I>(std::lround(v));
 1217|  2.81k|    }
 1218|  1.79k|    return 0;
 1219|  4.60k|  }
_ZNK5Exiv29ValueTypeIdE23float_to_integer_helperIjEET_m:
 1212|  24.1k|  I float_to_integer_helper(size_t n) const {
 1213|  24.1k|    const auto v = value_.at(n);
 1214|  24.1k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 19.8k, False: 4.26k]
  ------------------
 1215|  19.8k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 14.2k, False: 5.64k]
  ------------------
 1216|  14.2k|      return static_cast<I>(std::lround(v));
 1217|  14.2k|    }
 1218|  9.90k|    return 0;
 1219|  24.1k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIlEET_m:
 1212|  11.5k|  I float_to_integer_helper(size_t n) const {
 1213|  11.5k|    const auto v = value_.at(n);
 1214|  11.5k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 10.3k, False: 1.13k]
  ------------------
 1215|  10.3k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 8.23k, False: 2.15k]
  ------------------
 1216|  8.23k|      return static_cast<I>(std::lround(v));
 1217|  8.23k|    }
 1218|  3.28k|    return 0;
 1219|  11.5k|  }
_ZNK5Exiv29ValueTypeIfE23float_to_integer_helperIjEET_m:
 1212|  15.9k|  I float_to_integer_helper(size_t n) const {
 1213|  15.9k|    const auto v = value_.at(n);
 1214|  15.9k|    if (static_cast<decltype(v)>(std::numeric_limits<I>::min()) <= v &&
  ------------------
  |  Branch (1214:9): [True: 13.5k, False: 2.44k]
  ------------------
 1215|  13.5k|        v <= static_cast<decltype(v)>(std::numeric_limits<I>::max())) {
  ------------------
  |  Branch (1215:9): [True: 10.9k, False: 2.62k]
  ------------------
 1216|  10.9k|      return static_cast<I>(std::lround(v));
 1217|  10.9k|    }
 1218|  5.06k|    return 0;
 1219|  15.9k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIlEET_m:
 1223|  3.42k|  I rational_to_integer_helper(size_t n) const {
 1224|  3.42k|    auto a = value_.at(n).first;
 1225|  3.42k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  3.42k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.40k, False: 2.01k]
  ------------------
 1229|  1.40k|      return 0;
 1230|  1.40k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  2.01k|#ifdef __cpp_if_constexpr
 1234|  2.01k|    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.01k|      const auto imin = std::numeric_limits<I>::min();
 1240|  2.01k|      const auto imax = std::numeric_limits<I>::max();
 1241|  2.01k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 2.01k]
  |  Branch (1241:23): [True: 0, False: 2.01k]
  |  Branch (1241:35): [True: 0, False: 2.01k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  2.01k|#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.01k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  3.42k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE26rational_to_integer_helperIjEET_m:
 1223|  8.37k|  I rational_to_integer_helper(size_t n) const {
 1224|  8.37k|    auto a = value_.at(n).first;
 1225|  8.37k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  8.37k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 1.89k, False: 6.47k]
  ------------------
 1229|  1.89k|      return 0;
 1230|  1.89k|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.47k|#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|  6.47k|    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|  6.47k|      const auto imax = std::numeric_limits<I>::max();
 1257|  6.47k|      if (a < 0) {
  ------------------
  |  Branch (1257:11): [True: 1.73k, False: 4.74k]
  ------------------
 1258|  1.73k|        return 0;
 1259|  1.73k|      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|  4.74k|      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|  4.74k|      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|  4.74k|      if (imax < b_u || imax < a_u) {
  ------------------
  |  Branch (1263:11): [True: 0, False: 4.74k]
  |  Branch (1263:25): [True: 0, False: 4.74k]
  ------------------
 1264|      0|        return 0;
 1265|      0|      }
 1266|  4.74k|    }
 1267|       |
 1268|  4.74k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  8.37k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIlEET_m:
 1223|  2.24k|  I rational_to_integer_helper(size_t n) const {
 1224|  2.24k|    auto a = value_.at(n).first;
 1225|  2.24k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  2.24k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 354, False: 1.89k]
  ------------------
 1229|    354|      return 0;
 1230|    354|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  1.89k|#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|  1.89k|    } 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|  1.89k|      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|  1.89k|      if (imax < b || imax < a) {
  ------------------
  |  Branch (1251:11): [True: 0, False: 1.89k]
  |  Branch (1251:23): [True: 0, False: 1.89k]
  ------------------
 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|  1.89k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  2.24k|  }
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE26rational_to_integer_helperIjEET_m:
 1223|  7.06k|  I rational_to_integer_helper(size_t n) const {
 1224|  7.06k|    auto a = value_.at(n).first;
 1225|  7.06k|    auto b = value_.at(n).second;
 1226|       |
 1227|       |    // Protect against divide-by-zero.
 1228|  7.06k|    if (b <= 0) {
  ------------------
  |  Branch (1228:9): [True: 914, False: 6.14k]
  ------------------
 1229|    914|      return 0;
 1230|    914|    }
 1231|       |
 1232|       |    // Check for integer overflow.
 1233|  6.14k|#ifdef __cpp_if_constexpr
 1234|  6.14k|    if constexpr (std::is_signed_v<I> == std::is_signed_v<decltype(a)>) {
 1235|       |#else
 1236|       |    if (std::is_signed<I>::value == std::is_signed<decltype(a)>::value) {
 1237|       |#endif
 1238|       |      // conversion does not change sign
 1239|  6.14k|      const auto imin = std::numeric_limits<I>::min();
 1240|  6.14k|      const auto imax = std::numeric_limits<I>::max();
 1241|  6.14k|      if (imax < b || a < imin || imax < a) {
  ------------------
  |  Branch (1241:11): [True: 0, False: 6.14k]
  |  Branch (1241:23): [True: 0, False: 6.14k]
  |  Branch (1241:35): [True: 0, False: 6.14k]
  ------------------
 1242|      0|        return 0;
 1243|      0|      }
 1244|  6.14k|#ifdef __cpp_if_constexpr
 1245|       |    } else if constexpr (std::is_signed_v<I>) {
 1246|       |#else
 1247|       |    } else if (std::is_signed<I>::value) {
 1248|       |#endif
 1249|       |      // conversion is from unsigned to signed
 1250|       |      const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
 1251|       |      if (imax < b || imax < a) {
 1252|       |        return 0;
 1253|       |      }
 1254|       |    } else {
 1255|       |      // conversion is from signed to unsigned
 1256|       |      const auto imax = std::numeric_limits<I>::max();
 1257|       |      if (a < 0) {
 1258|       |        return 0;
 1259|       |      }
 1260|       |      // Inputs are not negative so convert them to unsigned.
 1261|       |      const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
 1262|       |      const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
 1263|       |      if (imax < b_u || imax < a_u) {
 1264|       |        return 0;
 1265|       |      }
 1266|       |    }
 1267|       |
 1268|  6.14k|    return static_cast<I>(a) / static_cast<I>(b);
 1269|  7.06k|  }
_ZN5Exiv29ValueTypeItEC2Ev:
 1433|   156k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|   156k|}
_ZN5Exiv25ValueD2Ev:
   43|  19.7M|  virtual ~Value() = default;
_ZN5Exiv29ValueTypeItE4readEPKhmNS_9ByteOrderE:
 1467|   153k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|   153k|  value_.clear();
 1469|   153k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|   153k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 153k, False: 0]
  |  Branch (1470:17): [True: 617, False: 153k]
  ------------------
 1471|    617|    len = (len / ts) * ts;
 1472|  2.24M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 2.09M, False: 153k]
  ------------------
 1473|  2.09M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  2.09M|  }
 1475|   153k|  return 0;
 1476|   153k|}
_ZN5Exiv29ValueTypeItE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  2.51k|int ValueType<T>::read(const std::string& buf) {
 1480|  2.51k|  std::istringstream is(buf);
 1481|  2.51k|  T tmp;
 1482|  2.51k|  ValueList val;
 1483|  5.65k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 3.14k, False: 2.51k]
  ------------------
 1484|  3.14k|    val.push_back(tmp);
 1485|  2.51k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 4, False: 2.50k]
  ------------------
 1486|      4|    return 1;
 1487|  2.50k|  value_ = std::move(val);
 1488|  2.50k|  return 0;
 1489|  2.51k|}
_ZN5Exiv29ValueTypeItE11setDataAreaEPKhm:
 1649|  2.33k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  2.33k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 1.84k, False: 490]
  ------------------
 1651|  1.84k|    pDataArea_ = Blob(buf, buf + len);
 1652|    490|  else
 1653|    490|    pDataArea_.clear();
 1654|  2.33k|  return 0;
 1655|  2.33k|}
_ZNK5Exiv29ValueTypeItE4copyEPhNS_9ByteOrderE:
 1492|  49.2k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  49.2k|  size_t offset = 0;
 1494|  1.78M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.78M, False: 49.2k]
  ------------------
 1495|  1.78M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.78M|  }
 1497|  49.2k|  return offset;
 1498|  49.2k|}
_ZNK5Exiv29ValueTypeItE5countEv:
 1501|   485k|size_t ValueType<T>::count() const {
 1502|   485k|  return value_.size();
 1503|   485k|}
_ZNK5Exiv29ValueTypeItE4sizeEv:
 1506|   220k|size_t ValueType<T>::size() const {
 1507|   220k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   220k|}
_ZNK5Exiv29ValueTypeItE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    956|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    956|  auto end = value_.end();
 1518|    956|  auto i = value_.begin();
 1519|  4.51M|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 4.51M, False: 956]
  ------------------
 1520|  4.51M|    os << std::setprecision(15) << *i;
 1521|  4.51M|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 4.51M, False: 395]
  ------------------
 1522|  4.51M|      os << " ";
 1523|  4.51M|  }
 1524|    956|  return os;
 1525|    956|}
_ZNK5Exiv29ValueTypeItE7toInt64Em:
 1535|   193k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|   193k|  ok_ = true;
 1537|   193k|  return static_cast<int64_t>(value_.at(n));
 1538|   193k|}
_ZNK5Exiv29ValueTypeItE8toUint32Em:
 1540|   228k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   228k|  ok_ = true;
 1542|   228k|  return static_cast<uint32_t>(value_.at(n));
 1543|   228k|}
_ZNK5Exiv29ValueTypeItE12sizeDataAreaEv:
 1639|  9.43k|size_t ValueType<T>::sizeDataArea() const {
 1640|  9.43k|  return pDataArea_.size();
 1641|  9.43k|}
_ZNK5Exiv29ValueTypeItE8dataAreaEv:
 1644|  1.46k|DataBuf ValueType<T>::dataArea() const {
 1645|  1.46k|  return {pDataArea_.data(), pDataArea_.size()};
 1646|  1.46k|}
_ZNK5Exiv29ValueTypeItE6clone_Ev:
 1511|   366k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   366k|  return new ValueType<T>(*this);
 1513|   366k|}
_ZN5Exiv29ValueTypeItEC2ERKS1_:
 1447|   366k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   366k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 4.54k, False: 361k]
  ------------------
 1449|  4.54k|    pDataArea_ = rhs.pDataArea_;
 1450|   366k|}
_ZN5Exiv25ValueC2ERKS0_:
  225|  14.2M|  Value(const Value&) = default;
_ZN5Exiv29ValueTypeIjE4readEPKhmNS_9ByteOrderE:
 1467|  85.9k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  85.9k|  value_.clear();
 1469|  85.9k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  85.9k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 85.9k, False: 0]
  |  Branch (1470:17): [True: 117, False: 85.8k]
  ------------------
 1471|    117|    len = (len / ts) * ts;
 1472|  3.52M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 3.44M, False: 85.9k]
  ------------------
 1473|  3.44M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  3.44M|  }
 1475|  85.9k|  return 0;
 1476|  85.9k|}
_ZN5Exiv29ValueTypeIjE11setDataAreaEPKhm:
 1649|  1.38k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.38k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 976, False: 411]
  ------------------
 1651|    976|    pDataArea_ = Blob(buf, buf + len);
 1652|    411|  else
 1653|    411|    pDataArea_.clear();
 1654|  1.38k|  return 0;
 1655|  1.38k|}
_ZNK5Exiv29ValueTypeIjE4copyEPhNS_9ByteOrderE:
 1492|  57.0k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  57.0k|  size_t offset = 0;
 1494|  1.64M|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 1.64M, False: 57.0k]
  ------------------
 1495|  1.64M|    offset += toData(buf + offset, val, byteOrder);
 1496|  1.64M|  }
 1497|  57.0k|  return offset;
 1498|  57.0k|}
_ZNK5Exiv29ValueTypeIjE5countEv:
 1501|   255k|size_t ValueType<T>::count() const {
 1502|   255k|  return value_.size();
 1503|   255k|}
_ZNK5Exiv29ValueTypeIjE4sizeEv:
 1506|   322k|size_t ValueType<T>::size() const {
 1507|   322k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   322k|}
_ZNK5Exiv29ValueTypeIjE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|  5.48k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  5.48k|  auto end = value_.end();
 1518|  5.48k|  auto i = value_.begin();
 1519|  32.1k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 26.7k, False: 5.48k]
  ------------------
 1520|  26.7k|    os << std::setprecision(15) << *i;
 1521|  26.7k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 21.7k, False: 4.99k]
  ------------------
 1522|  21.7k|      os << " ";
 1523|  26.7k|  }
 1524|  5.48k|  return os;
 1525|  5.48k|}
_ZNK5Exiv29ValueTypeIjE7toInt64Em:
 1535|  8.06k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  8.06k|  ok_ = true;
 1537|  8.06k|  return static_cast<int64_t>(value_.at(n));
 1538|  8.06k|}
_ZNK5Exiv29ValueTypeIjE8toUint32Em:
 1540|   106k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   106k|  ok_ = true;
 1542|   106k|  return static_cast<uint32_t>(value_.at(n));
 1543|   106k|}
_ZNK5Exiv29ValueTypeIjE12sizeDataAreaEv:
 1639|  8.92k|size_t ValueType<T>::sizeDataArea() const {
 1640|  8.92k|  return pDataArea_.size();
 1641|  8.92k|}
_ZNK5Exiv29ValueTypeIjE8dataAreaEv:
 1644|    937|DataBuf ValueType<T>::dataArea() const {
 1645|    937|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    937|}
_ZNK5Exiv29ValueTypeIjE6clone_Ev:
 1511|   271k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   271k|  return new ValueType<T>(*this);
 1513|   271k|}
_ZN5Exiv29ValueTypeIjEC2ERKS1_:
 1447|   271k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   271k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.20k, False: 270k]
  ------------------
 1449|  1.20k|    pDataArea_ = rhs.pDataArea_;
 1450|   271k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2Ev:
 1433|  14.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  14.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE4readEPKhmNS_9ByteOrderE:
 1467|  14.0k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  14.0k|  value_.clear();
 1469|  14.0k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  14.0k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 14.0k, False: 0]
  |  Branch (1470:17): [True: 0, False: 14.0k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   563k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 549k, False: 14.0k]
  ------------------
 1473|   549k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   549k|  }
 1475|  14.0k|  return 0;
 1476|  14.0k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEE11setDataAreaEPKhm:
 1649|  1.43k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.43k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 764, False: 672]
  ------------------
 1651|    764|    pDataArea_ = Blob(buf, buf + len);
 1652|    672|  else
 1653|    672|    pDataArea_.clear();
 1654|  1.43k|  return 0;
 1655|  1.43k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4copyEPhNS_9ByteOrderE:
 1492|  10.5k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  10.5k|  size_t offset = 0;
 1494|   552k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 552k, False: 10.5k]
  ------------------
 1495|   552k|    offset += toData(buf + offset, val, byteOrder);
 1496|   552k|  }
 1497|  10.5k|  return offset;
 1498|  10.5k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5countEv:
 1501|  32.2k|size_t ValueType<T>::count() const {
 1502|  32.2k|  return value_.size();
 1503|  32.2k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE4sizeEv:
 1506|  28.1k|size_t ValueType<T>::size() const {
 1507|  28.1k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  28.1k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|    802|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    802|  auto end = value_.end();
 1518|    802|  auto i = value_.begin();
 1519|  10.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 9.96k, False: 802]
  ------------------
 1520|  9.96k|    os << std::setprecision(15) << *i;
 1521|  9.96k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 9.39k, False: 573]
  ------------------
 1522|  9.39k|      os << " ";
 1523|  9.96k|  }
 1524|    802|  return os;
 1525|    802|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE12sizeDataAreaEv:
 1639|  4.94k|size_t ValueType<T>::sizeDataArea() const {
 1640|  4.94k|  return pDataArea_.size();
 1641|  4.94k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE8dataAreaEv:
 1644|    467|DataBuf ValueType<T>::dataArea() const {
 1645|    467|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    467|}
_ZNK5Exiv29ValueTypeINSt3__14pairIjjEEE6clone_Ev:
 1511|  42.2k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  42.2k|  return new ValueType<T>(*this);
 1513|  42.2k|}
_ZN5Exiv29ValueTypeINSt3__14pairIjjEEEC2ERKS4_:
 1447|  42.2k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  42.2k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.07k, False: 41.1k]
  ------------------
 1449|  1.07k|    pDataArea_ = rhs.pDataArea_;
 1450|  42.2k|}
_ZN5Exiv29ValueTypeIsEC2Ev:
 1433|  51.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  51.7k|}
_ZN5Exiv29ValueTypeIsE4readEPKhmNS_9ByteOrderE:
 1467|  41.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  41.7k|  value_.clear();
 1469|  41.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  41.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 41.7k, False: 0]
  |  Branch (1470:17): [True: 63, False: 41.6k]
  ------------------
 1471|     63|    len = (len / ts) * ts;
 1472|  1.57M|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 1.52M, False: 41.7k]
  ------------------
 1473|  1.52M|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|  1.52M|  }
 1475|  41.7k|  return 0;
 1476|  41.7k|}
_ZN5Exiv29ValueTypeIsE4readERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1479|  10.0k|int ValueType<T>::read(const std::string& buf) {
 1480|  10.0k|  std::istringstream is(buf);
 1481|  10.0k|  T tmp;
 1482|  10.0k|  ValueList val;
 1483|  97.5k|  while (is >> tmp)
  ------------------
  |  Branch (1483:10): [True: 87.4k, False: 10.0k]
  ------------------
 1484|  87.4k|    val.push_back(tmp);
 1485|  10.0k|  if (!is.eof())
  ------------------
  |  Branch (1485:7): [True: 0, False: 10.0k]
  ------------------
 1486|      0|    return 1;
 1487|  10.0k|  value_ = std::move(val);
 1488|  10.0k|  return 0;
 1489|  10.0k|}
_ZN5Exiv29ValueTypeIsE11setDataAreaEPKhm:
 1649|  1.01k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.01k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 588, False: 431]
  ------------------
 1651|    588|    pDataArea_ = Blob(buf, buf + len);
 1652|    431|  else
 1653|    431|    pDataArea_.clear();
 1654|  1.01k|  return 0;
 1655|  1.01k|}
_ZNK5Exiv29ValueTypeIsE4copyEPhNS_9ByteOrderE:
 1492|  9.95k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  9.95k|  size_t offset = 0;
 1494|   650k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 650k, False: 9.95k]
  ------------------
 1495|   650k|    offset += toData(buf + offset, val, byteOrder);
 1496|   650k|  }
 1497|  9.95k|  return offset;
 1498|  9.95k|}
_ZNK5Exiv29ValueTypeIsE5countEv:
 1501|   127k|size_t ValueType<T>::count() const {
 1502|   127k|  return value_.size();
 1503|   127k|}
_ZNK5Exiv29ValueTypeIsE4sizeEv:
 1506|  42.8k|size_t ValueType<T>::size() const {
 1507|  42.8k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  42.8k|}
_ZNK5Exiv29ValueTypeIsE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    602|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    602|  auto end = value_.end();
 1518|    602|  auto i = value_.begin();
 1519|  49.8k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 49.2k, False: 602]
  ------------------
 1520|  49.2k|    os << std::setprecision(15) << *i;
 1521|  49.2k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 48.8k, False: 366]
  ------------------
 1522|  48.8k|      os << " ";
 1523|  49.2k|  }
 1524|    602|  return os;
 1525|    602|}
_ZNK5Exiv29ValueTypeIsE7toInt64Em:
 1535|  33.5k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  33.5k|  ok_ = true;
 1537|  33.5k|  return static_cast<int64_t>(value_.at(n));
 1538|  33.5k|}
_ZNK5Exiv29ValueTypeIsE8toUint32Em:
 1540|   149k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|   149k|  ok_ = true;
 1542|   149k|  return static_cast<uint32_t>(value_.at(n));
 1543|   149k|}
_ZNK5Exiv29ValueTypeIsE12sizeDataAreaEv:
 1639|  2.49k|size_t ValueType<T>::sizeDataArea() const {
 1640|  2.49k|  return pDataArea_.size();
 1641|  2.49k|}
_ZNK5Exiv29ValueTypeIsE8dataAreaEv:
 1644|    408|DataBuf ValueType<T>::dataArea() const {
 1645|    408|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    408|}
_ZNK5Exiv29ValueTypeIsE6clone_Ev:
 1511|   115k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   115k|  return new ValueType<T>(*this);
 1513|   115k|}
_ZN5Exiv29ValueTypeIsEC2ERKS1_:
 1447|   115k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   115k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.09k, False: 114k]
  ------------------
 1449|  1.09k|    pDataArea_ = rhs.pDataArea_;
 1450|   115k|}
_ZN5Exiv29ValueTypeIiEC2Ev:
 1433|  44.8k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  44.8k|}
_ZN5Exiv29ValueTypeIiE4readEPKhmNS_9ByteOrderE:
 1467|  44.8k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  44.8k|  value_.clear();
 1469|  44.8k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  44.8k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 44.8k, False: 0]
  |  Branch (1470:17): [True: 131, False: 44.7k]
  ------------------
 1471|    131|    len = (len / ts) * ts;
 1472|   357k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 312k, False: 44.8k]
  ------------------
 1473|   312k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   312k|  }
 1475|  44.8k|  return 0;
 1476|  44.8k|}
_ZN5Exiv29ValueTypeIiE11setDataAreaEPKhm:
 1649|  1.01k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.01k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 730, False: 282]
  ------------------
 1651|    730|    pDataArea_ = Blob(buf, buf + len);
 1652|    282|  else
 1653|    282|    pDataArea_.clear();
 1654|  1.01k|  return 0;
 1655|  1.01k|}
_ZNK5Exiv29ValueTypeIiE4copyEPhNS_9ByteOrderE:
 1492|  19.4k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  19.4k|  size_t offset = 0;
 1494|   136k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 136k, False: 19.4k]
  ------------------
 1495|   136k|    offset += toData(buf + offset, val, byteOrder);
 1496|   136k|  }
 1497|  19.4k|  return offset;
 1498|  19.4k|}
_ZNK5Exiv29ValueTypeIiE5countEv:
 1501|   154k|size_t ValueType<T>::count() const {
 1502|   154k|  return value_.size();
 1503|   154k|}
_ZNK5Exiv29ValueTypeIiE4sizeEv:
 1506|   110k|size_t ValueType<T>::size() const {
 1507|   110k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|   110k|}
_ZNK5Exiv29ValueTypeIiE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    783|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    783|  auto end = value_.end();
 1518|    783|  auto i = value_.begin();
 1519|  27.0k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 26.2k, False: 783]
  ------------------
 1520|  26.2k|    os << std::setprecision(15) << *i;
 1521|  26.2k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 25.6k, False: 582]
  ------------------
 1522|  25.6k|      os << " ";
 1523|  26.2k|  }
 1524|    783|  return os;
 1525|    783|}
_ZNK5Exiv29ValueTypeIiE7toInt64Em:
 1535|  19.7k|int64_t ValueType<T>::toInt64(size_t n) const {
 1536|  19.7k|  ok_ = true;
 1537|  19.7k|  return static_cast<int64_t>(value_.at(n));
 1538|  19.7k|}
_ZNK5Exiv29ValueTypeIiE8toUint32Em:
 1540|  31.9k|uint32_t ValueType<T>::toUint32(size_t n) const {
 1541|  31.9k|  ok_ = true;
 1542|  31.9k|  return static_cast<uint32_t>(value_.at(n));
 1543|  31.9k|}
_ZNK5Exiv29ValueTypeIiE12sizeDataAreaEv:
 1639|  10.1k|size_t ValueType<T>::sizeDataArea() const {
 1640|  10.1k|  return pDataArea_.size();
 1641|  10.1k|}
_ZNK5Exiv29ValueTypeIiE8dataAreaEv:
 1644|    832|DataBuf ValueType<T>::dataArea() const {
 1645|    832|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    832|}
_ZNK5Exiv29ValueTypeIiE6clone_Ev:
 1511|   120k|ValueType<T>* ValueType<T>::clone_() const {
 1512|   120k|  return new ValueType<T>(*this);
 1513|   120k|}
_ZN5Exiv29ValueTypeIiEC2ERKS1_:
 1447|   120k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|   120k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.87k, False: 118k]
  ------------------
 1449|  1.87k|    pDataArea_ = rhs.pDataArea_;
 1450|   120k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2Ev:
 1433|  16.7k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  16.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE4readEPKhmNS_9ByteOrderE:
 1467|  16.7k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  16.7k|  value_.clear();
 1469|  16.7k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  16.7k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 16.7k, False: 0]
  |  Branch (1470:17): [True: 0, False: 16.7k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   496k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 479k, False: 16.7k]
  ------------------
 1473|   479k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   479k|  }
 1475|  16.7k|  return 0;
 1476|  16.7k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEE11setDataAreaEPKhm:
 1649|  1.24k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.24k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 971, False: 277]
  ------------------
 1651|    971|    pDataArea_ = Blob(buf, buf + len);
 1652|    277|  else
 1653|    277|    pDataArea_.clear();
 1654|  1.24k|  return 0;
 1655|  1.24k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4copyEPhNS_9ByteOrderE:
 1492|  8.29k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  8.29k|  size_t offset = 0;
 1494|   472k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 472k, False: 8.29k]
  ------------------
 1495|   472k|    offset += toData(buf + offset, val, byteOrder);
 1496|   472k|  }
 1497|  8.29k|  return offset;
 1498|  8.29k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5countEv:
 1501|  40.0k|size_t ValueType<T>::count() const {
 1502|  40.0k|  return value_.size();
 1503|  40.0k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE4sizeEv:
 1506|  24.3k|size_t ValueType<T>::size() const {
 1507|  24.3k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  24.3k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE5writeERNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE:
 1516|  1.39k|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|  1.39k|  auto end = value_.end();
 1518|  1.39k|  auto i = value_.begin();
 1519|  12.7k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 11.3k, False: 1.39k]
  ------------------
 1520|  11.3k|    os << std::setprecision(15) << *i;
 1521|  11.3k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 10.9k, False: 385]
  ------------------
 1522|  10.9k|      os << " ";
 1523|  11.3k|  }
 1524|  1.39k|  return os;
 1525|  1.39k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE12sizeDataAreaEv:
 1639|  6.07k|size_t ValueType<T>::sizeDataArea() const {
 1640|  6.07k|  return pDataArea_.size();
 1641|  6.07k|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE8dataAreaEv:
 1644|    722|DataBuf ValueType<T>::dataArea() const {
 1645|    722|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    722|}
_ZNK5Exiv29ValueTypeINSt3__14pairIiiEEE6clone_Ev:
 1511|  47.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  47.5k|  return new ValueType<T>(*this);
 1513|  47.5k|}
_ZN5Exiv29ValueTypeINSt3__14pairIiiEEEC2ERKS4_:
 1447|  47.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  47.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 1.01k, False: 46.5k]
  ------------------
 1449|  1.01k|    pDataArea_ = rhs.pDataArea_;
 1450|  47.5k|}
_ZN5Exiv29ValueTypeIfEC2Ev:
 1433|  9.05k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  9.05k|}
_ZN5Exiv29ValueTypeIfE4readEPKhmNS_9ByteOrderE:
 1467|  9.05k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  9.05k|  value_.clear();
 1469|  9.05k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  9.05k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 9.05k, False: 0]
  |  Branch (1470:17): [True: 0, False: 9.05k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   267k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 258k, False: 9.05k]
  ------------------
 1473|   258k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   258k|  }
 1475|  9.05k|  return 0;
 1476|  9.05k|}
_ZN5Exiv29ValueTypeIfE11setDataAreaEPKhm:
 1649|  1.06k|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|  1.06k|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 829, False: 232]
  ------------------
 1651|    829|    pDataArea_ = Blob(buf, buf + len);
 1652|    232|  else
 1653|    232|    pDataArea_.clear();
 1654|  1.06k|  return 0;
 1655|  1.06k|}
_ZNK5Exiv29ValueTypeIfE4copyEPhNS_9ByteOrderE:
 1492|  5.95k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.95k|  size_t offset = 0;
 1494|   227k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 227k, False: 5.95k]
  ------------------
 1495|   227k|    offset += toData(buf + offset, val, byteOrder);
 1496|   227k|  }
 1497|  5.95k|  return offset;
 1498|  5.95k|}
_ZNK5Exiv29ValueTypeIfE5countEv:
 1501|  41.3k|size_t ValueType<T>::count() const {
 1502|  41.3k|  return value_.size();
 1503|  41.3k|}
_ZNK5Exiv29ValueTypeIfE4sizeEv:
 1506|  16.6k|size_t ValueType<T>::size() const {
 1507|  16.6k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  16.6k|}
_ZNK5Exiv29ValueTypeIfE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    836|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    836|  auto end = value_.end();
 1518|    836|  auto i = value_.begin();
 1519|   307k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 306k, False: 836]
  ------------------
 1520|   306k|    os << std::setprecision(15) << *i;
 1521|   306k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 306k, False: 551]
  ------------------
 1522|   306k|      os << " ";
 1523|   306k|  }
 1524|    836|  return os;
 1525|    836|}
_ZNK5Exiv29ValueTypeIfE12sizeDataAreaEv:
 1639|  5.75k|size_t ValueType<T>::sizeDataArea() const {
 1640|  5.75k|  return pDataArea_.size();
 1641|  5.75k|}
_ZNK5Exiv29ValueTypeIfE8dataAreaEv:
 1644|    218|DataBuf ValueType<T>::dataArea() const {
 1645|    218|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    218|}
_ZNK5Exiv29ValueTypeIfE6clone_Ev:
 1511|  31.3k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  31.3k|  return new ValueType<T>(*this);
 1513|  31.3k|}
_ZN5Exiv29ValueTypeIfEC2ERKS1_:
 1447|  31.3k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  31.3k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 958, False: 30.4k]
  ------------------
 1449|    958|    pDataArea_ = rhs.pDataArea_;
 1450|  31.3k|}
_ZN5Exiv29ValueTypeIdEC2Ev:
 1433|  16.5k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  16.5k|}
_ZN5Exiv29ValueTypeIdE4readEPKhmNS_9ByteOrderE:
 1467|  16.5k|int ValueType<T>::read(const byte* buf, size_t len, ByteOrder byteOrder) {
 1468|  16.5k|  value_.clear();
 1469|  16.5k|  size_t ts = TypeInfo::typeSize(typeId());
 1470|  16.5k|  if (ts > 0 && len % ts != 0)
  ------------------
  |  Branch (1470:7): [True: 16.5k, False: 0]
  |  Branch (1470:17): [True: 0, False: 16.5k]
  ------------------
 1471|      0|    len = (len / ts) * ts;
 1472|   554k|  for (size_t i = 0; i < len; i += ts) {
  ------------------
  |  Branch (1472:22): [True: 538k, False: 16.5k]
  ------------------
 1473|   538k|    value_.push_back(getValue<T>(buf + i, byteOrder));
 1474|   538k|  }
 1475|  16.5k|  return 0;
 1476|  16.5k|}
_ZN5Exiv29ValueTypeIdE11setDataAreaEPKhm:
 1649|    972|int ValueType<T>::setDataArea(const byte* buf, size_t len) {
 1650|    972|  if (len > 0)
  ------------------
  |  Branch (1650:7): [True: 540, False: 432]
  ------------------
 1651|    540|    pDataArea_ = Blob(buf, buf + len);
 1652|    432|  else
 1653|    432|    pDataArea_.clear();
 1654|    972|  return 0;
 1655|    972|}
_ZNK5Exiv29ValueTypeIdE4copyEPhNS_9ByteOrderE:
 1492|  5.85k|size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
 1493|  5.85k|  size_t offset = 0;
 1494|   183k|  for (const auto& val : value_) {
  ------------------
  |  Branch (1494:24): [True: 183k, False: 5.85k]
  ------------------
 1495|   183k|    offset += toData(buf + offset, val, byteOrder);
 1496|   183k|  }
 1497|  5.85k|  return offset;
 1498|  5.85k|}
_ZNK5Exiv29ValueTypeIdE5countEv:
 1501|  41.1k|size_t ValueType<T>::count() const {
 1502|  41.1k|  return value_.size();
 1503|  41.1k|}
_ZNK5Exiv29ValueTypeIdE4sizeEv:
 1506|  20.2k|size_t ValueType<T>::size() const {
 1507|  20.2k|  return TypeInfo::typeSize(typeId()) * value_.size();
 1508|  20.2k|}
_ZNK5Exiv29ValueTypeIdE5writeERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEE:
 1516|    586|std::ostream& ValueType<T>::write(std::ostream& os) const {
 1517|    586|  auto end = value_.end();
 1518|    586|  auto i = value_.begin();
 1519|  9.04k|  while (i != end) {
  ------------------
  |  Branch (1519:10): [True: 8.45k, False: 586]
  ------------------
 1520|  8.45k|    os << std::setprecision(15) << *i;
 1521|  8.45k|    if (++i != end)
  ------------------
  |  Branch (1521:9): [True: 8.07k, False: 383]
  ------------------
 1522|  8.07k|      os << " ";
 1523|  8.45k|  }
 1524|    586|  return os;
 1525|    586|}
_ZNK5Exiv29ValueTypeIdE12sizeDataAreaEv:
 1639|  7.41k|size_t ValueType<T>::sizeDataArea() const {
 1640|  7.41k|  return pDataArea_.size();
 1641|  7.41k|}
_ZNK5Exiv29ValueTypeIdE8dataAreaEv:
 1644|    503|DataBuf ValueType<T>::dataArea() const {
 1645|    503|  return {pDataArea_.data(), pDataArea_.size()};
 1646|    503|}
_ZNK5Exiv29ValueTypeIdE6clone_Ev:
 1511|  44.5k|ValueType<T>* ValueType<T>::clone_() const {
 1512|  44.5k|  return new ValueType<T>(*this);
 1513|  44.5k|}
_ZN5Exiv29ValueTypeIdEC2ERKS1_:
 1447|  44.5k|ValueType<T>::ValueType(const ValueType<T>& rhs) : Value(rhs.typeId()), value_(rhs.value_) {
 1448|  44.5k|  if (!rhs.pDataArea_.empty())
  ------------------
  |  Branch (1448:7): [True: 281, False: 44.2k]
  ------------------
 1449|    281|    pDataArea_ = rhs.pDataArea_;
 1450|  44.5k|}
_ZZNK5Exiv222LangAltValueComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ENKUlhhE_clEhh:
  799|   347k|    auto f = [](unsigned char a, unsigned char b) { return std::tolower(a) > std::tolower(b); };
_ZN5Exiv29ValueTypeIjEC2Ev:
 1433|  5.75k|ValueType<T>::ValueType() : Value(getType<T>()) {
 1434|  5.75k|}

_ZNK5Exiv27XmpData9usePacketEv:
  217|  24.5k|  [[nodiscard]] bool usePacket() const {
  218|  24.5k|    return usePacket_;
  219|  24.5k|  }
_ZN5Exiv27XmpData9usePacketEb:
  222|  74.4k|  bool usePacket(bool b) {
  223|  74.4k|    bool r = usePacket_;
  224|  74.4k|    usePacket_ = b;
  225|  74.4k|    return r;
  226|  74.4k|  }
_ZN5Exiv27XmpData9setPacketENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  228|  66.8k|  void setPacket(std::string xmpPacket) {
  229|  66.8k|    xmpPacket_ = std::move(xmpPacket);
  230|  66.8k|    usePacket(false);
  231|  66.8k|  }
_ZNK5Exiv27XmpData10nsBindingsEv:
  261|   144k|  [[nodiscard]] const std::map<std::string, std::string>& nsBindings() const {
  262|   144k|    return nsBindings_;
  263|   144k|  }
_ZN5Exiv27XmpDataC2Ev:
  141|  75.9k|  XmpData() = default;
_ZN5Exiv28XmpdatumaSINS_5ValueEEERS0_RKT_:
  396|  42.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|  42.4k|    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  42.4k|  return *this;
  406|  42.4k|}
_ZN5Exiv28XmpdatumaSINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
  396|  44.4k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|  44.4k|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|  44.4k|  return *this;
  406|  44.4k|}
_ZN5Exiv28XmpdatumaSIdEERS0_RKT_:
  396|   186k|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|   186k|    setValue(Exiv2::toString(value));
  405|   186k|  return *this;
  406|   186k|}
_ZN5Exiv28XmpdatumaSImEERS0_RKT_:
  396|  15.7k|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|  15.7k|    setValue(Exiv2::toString(value));
  405|  15.7k|  return *this;
  406|  15.7k|}
_ZN5Exiv28XmpdatumaSIjEERS0_RKT_:
  396|  21.6k|Xmpdatum& Xmpdatum::operator=(const T& value) {
  397|       |  if constexpr (std::is_same_v<T, bool>)
  398|       |    setValue(value ? "True" : "False");
  399|       |  else if constexpr (std::is_convertible_v<T, std::string>)
  400|       |    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|  21.6k|    setValue(Exiv2::toString(value));
  405|  21.6k|  return *this;
  406|  21.6k|}
_ZN5Exiv28XmpdatumaSIPKhEERS0_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|}
_ZN5Exiv28XmpdatumaSIA4_cEERS0_RKT_:
  396|  1.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|  1.49k|    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.49k|  return *this;
  406|  1.49k|}
_ZN5Exiv28XmpdatumaSIlEERS0_RKT_:
  396|  2.07k|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.07k|    setValue(Exiv2::toString(value));
  405|  2.07k|  return *this;
  406|  2.07k|}
_ZN5Exiv28XmpdatumaSIfEERS0_RKT_:
  396|  4.09k|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|  4.09k|    setValue(Exiv2::toString(value));
  405|  4.09k|  return *this;
  406|  4.09k|}
_ZN5Exiv28XmpdatumaSIA18_cEERS0_RKT_:
  396|    457|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|    457|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|    457|  return *this;
  406|    457|}
_ZN5Exiv28XmpdatumaSItEERS0_RKT_:
  396|   117k|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|   117k|    setValue(Exiv2::toString(value));
  405|   117k|  return *this;
  406|   117k|}
_ZN5Exiv28XmpdatumaSIsEERS0_RKT_:
  396|  3.06k|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.06k|    setValue(Exiv2::toString(value));
  405|  3.06k|  return *this;
  406|  3.06k|}
_ZN5Exiv28XmpdatumaSIPhEERS0_RKT_:
  396|   186k|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|   186k|    setValue(Exiv2::toString(value));
  405|   186k|  return *this;
  406|   186k|}
_ZN5Exiv28XmpdatumaSIPKcEERS0_RKT_:
  396|  39.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|  39.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|  39.9k|  return *this;
  406|  39.9k|}
_ZN5Exiv28XmpdatumaSIiEERS0_RKT_:
  396|   196k|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|   196k|    setValue(Exiv2::toString(value));
  405|   196k|  return *this;
  406|   196k|}
_ZN5Exiv28XmpdatumaSIA12_cEERS0_RKT_:
  396|     82|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|     82|    setValue(value);
  401|       |  else if constexpr (std::is_base_of_v<Value, T>)
  402|       |    setValue(&value);
  403|       |  else
  404|       |    setValue(Exiv2::toString(value));
  405|     82|  return *this;
  406|     82|}

_ZNK5Exiv28AsfVideo7GUIDTageqERKS1_:
   42|  16.3k|bool AsfVideo::GUIDTag::operator==(const AsfVideo::GUIDTag& other) const {
   43|  16.3k|  return data1_ == other.data1_ && data2_ == other.data2_ && data3_ == other.data3_ && data4_ == other.data4_;
  ------------------
  |  Branch (43:10): [True: 6.03k, False: 10.2k]
  |  Branch (43:36): [True: 5.98k, False: 58]
  |  Branch (43:62): [True: 5.93k, False: 48]
  |  Branch (43:88): [True: 5.92k, False: 5]
  ------------------
   44|  16.3k|}
_ZN5Exiv28AsfVideo7GUIDTagC2EPKh:
   46|  23.9k|AsfVideo::GUIDTag::GUIDTag(const uint8_t* bytes) {
   47|  23.9k|  data1_ = Exiv2::getULong(bytes, ByteOrder::littleEndian);
   48|  23.9k|  data2_ = Exiv2::getUShort(bytes + DWORD, ByteOrder::littleEndian);
   49|  23.9k|  data3_ = Exiv2::getUShort(bytes + DWORD + WORD, ByteOrder::littleEndian);
   50|  23.9k|  std::copy(bytes + QWORD, bytes + (2 * QWORD), data4_.begin());
   51|  23.9k|}
_ZNK5Exiv28AsfVideo7GUIDTag9to_stringEv:
   53|    439|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|    439|  return stringFormat("{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}", data1_, data2_, data3_,
  ------------------
  |  |   18|    439|#define stringFormat std::format
  ------------------
   58|    439|                      data4_[0], data4_[1], data4_[2], data4_[3], data4_[4], data4_[5], data4_[6], data4_[7]);
   59|    439|}
_ZNK5Exiv28AsfVideo7GUIDTagltERKS1_:
   61|  48.9k|bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
   62|  48.9k|  if (data1_ != other.data1_)
  ------------------
  |  Branch (62:7): [True: 35.9k, False: 13.0k]
  ------------------
   63|  35.9k|    return data1_ < other.data1_;
   64|  13.0k|  if (data2_ != other.data2_)
  ------------------
  |  Branch (64:7): [True: 279, False: 12.7k]
  ------------------
   65|    279|    return data2_ < other.data2_;
   66|  12.7k|  if (data3_ != other.data3_)
  ------------------
  |  Branch (66:7): [True: 735, False: 12.0k]
  ------------------
   67|    735|    return data3_ < other.data3_;
   68|  12.0k|  return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
   69|  12.7k|}
_ZN5Exiv28AsfVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  183|  1.97k|    Image(ImageType::asf, mdNone, std::move(io), params) {
  184|  1.97k|}  // AsfVideo::AsfVideo
_ZNK5Exiv28AsfVideo8mimeTypeEv:
  186|  1.97k|std::string AsfVideo::mimeType() const {
  187|  1.97k|  return "video/asf";
  188|  1.97k|}
_ZN5Exiv28AsfVideo13writeMetadataEv:
  190|      6|void AsfVideo::writeMetadata() {
  191|      6|}
_ZN5Exiv28AsfVideo12readMetadataEv:
  193|  1.97k|void AsfVideo::readMetadata() {
  194|  1.97k|  if (io_->open() != 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 1.97k]
  ------------------
  195|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  196|       |
  197|       |  // Ensure that this is the correct image type
  198|  1.97k|  if (!isAsfType(*io_, false)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1.97k]
  ------------------
  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.97k|  IoCloser closer(*io_);
  205|  1.97k|  clearMetadata();
  206|  1.97k|  io_->seek(0, BasicIo::beg);
  207|  1.97k|  height_ = width_ = 1;
  208|       |
  209|  1.97k|  xmpData()["Xmp.video.FileSize"] = io_->size() / 1048576.;
  210|  1.97k|  xmpData()["Xmp.video.MimeType"] = mimeType();
  211|       |
  212|  1.97k|  decodeBlock(0);
  213|       |
  214|  1.97k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  215|  1.97k|}  // AsfVideo::readMetadata
_ZN5Exiv28AsfVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  217|  6.79k|AsfVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
  218|  6.79k|  if (io->size() >= io->tell() + GUID + QWORD) {
  ------------------
  |  Branch (218:7): [True: 6.79k, False: 0]
  ------------------
  219|  6.79k|    io->readOrThrow(IdBuf_.data(), IdBuf_.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  220|       |
  221|  6.79k|    size_ = readQWORDTag(io);
  222|  6.79k|    if (size_ >= GUID + QWORD)
  ------------------
  |  Branch (222:9): [True: 3.75k, False: 3.03k]
  ------------------
  223|  3.75k|      remaining_size_ = size_ - GUID - QWORD;
  224|  6.79k|  }
  225|  6.79k|}
_ZN5Exiv28AsfVideo11decodeBlockEm:
  227|  6.92k|void AsfVideo::decodeBlock(size_t depth) {
  228|  6.92k|  Internal::enforce(GUID + QWORD <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  229|  6.92k|  HeaderReader objectHeader(io_);
  230|       |#ifdef EXIV2_DEBUG_MESSAGES
  231|       |  EXV_INFO << "decodeBlock = " << GUIDTag(objectHeader.getId().data()).to_string()
  232|       |           << "\tsize= " << objectHeader.getSize() << "\t " << io_->tell() << "/" << io_->size() << '\n';
  233|       |#endif
  234|  6.92k|  Internal::enforce(objectHeader.getSize() <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  235|  6.92k|  auto tag = GUIDReferenceTags.find(GUIDTag(objectHeader.getId().data()));
  236|       |
  237|  6.92k|  if (tag != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (237:7): [True: 5.29k, False: 1.63k]
  ------------------
  238|  5.29k|    if (tag->second == "Header")
  ------------------
  |  Branch (238:9): [True: 2.07k, False: 3.21k]
  ------------------
  239|  2.07k|      decodeHeader(depth + 1);
  240|  3.21k|    else if (tag->second == "File_Properties")
  ------------------
  |  Branch (240:14): [True: 450, False: 2.76k]
  ------------------
  241|    450|      fileProperties();
  242|  2.76k|    else if (tag->second == "Stream_Properties")
  ------------------
  |  Branch (242:14): [True: 690, False: 2.07k]
  ------------------
  243|    690|      streamProperties();
  244|  2.07k|    else if (tag->second == "Header_Extension")
  ------------------
  |  Branch (244:14): [True: 189, False: 1.88k]
  ------------------
  245|    189|      headerExtension();
  246|  1.88k|    else if (tag->second == "Codec_List")
  ------------------
  |  Branch (246:14): [True: 279, False: 1.60k]
  ------------------
  247|    279|      codecList();
  248|  1.60k|    else if (tag->second == "Extended_Content_Description")
  ------------------
  |  Branch (248:14): [True: 794, False: 811]
  ------------------
  249|    794|      extendedContentDescription();
  250|    811|    else if (tag->second == "Content_Description")
  ------------------
  |  Branch (250:14): [True: 488, False: 323]
  ------------------
  251|    488|      contentDescription();
  252|    323|    else if (tag->second == "Extended_Stream_Properties")
  ------------------
  |  Branch (252:14): [True: 153, False: 170]
  ------------------
  253|    153|      extendedStreamProperties();
  254|    170|    else if (tag->second == "Degradable_JPEG_Media")
  ------------------
  |  Branch (254:14): [True: 0, False: 170]
  ------------------
  255|      0|      DegradableJPEGMedia();
  256|    170|    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|    170|      const uint64_t remaining_size = objectHeader.getRemainingSize();
  260|    170|      Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  261|    170|      io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  262|    170|    }
  263|  5.29k|  } 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.63k|    const uint64_t remaining_size = objectHeader.getRemainingSize();
  267|  1.63k|    Internal::enforce(remaining_size > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
  268|  1.63k|    io_->seekOrThrow(io_->tell() + remaining_size, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  269|  1.63k|  }
  270|       |
  271|  6.92k|}  // AsfVideo::decodeBlock
_ZN5Exiv28AsfVideo12decodeHeaderEm:
  273|  2.07k|void AsfVideo::decodeHeader(size_t depth) {
  274|  2.07k|  Internal::enforce(depth <= max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  275|  2.07k|  DataBuf nbHeadersBuf(DWORD + 1);
  276|  2.07k|  io_->readOrThrow(nbHeadersBuf.data(), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  277|       |
  278|  2.07k|  uint32_t nb_headers = Exiv2::getULong(nbHeadersBuf.data(), littleEndian);
  279|  2.07k|  Internal::enforce(nb_headers < std::numeric_limits<uint32_t>::max(), Exiv2::ErrorCode::kerCorruptedMetadata);
  280|  2.07k|  io_->seekOrThrow(io_->tell() + (BYTE * 2), BasicIo::beg,
  281|  2.07k|                   ErrorCode::kerFailedToReadImageData);  // skip two reserved tags
  282|  7.02k|  for (uint32_t i = 0; i < nb_headers; i++) {
  ------------------
  |  Branch (282:24): [True: 4.95k, False: 2.07k]
  ------------------
  283|  4.95k|    decodeBlock(depth);
  284|  4.95k|  }
  285|  2.07k|}
_ZN5Exiv28AsfVideo24extendedStreamPropertiesEv:
  287|    153|void AsfVideo::extendedStreamProperties() {
  288|    153|  xmpData()["Xmp.video.StartTimecode"] = readQWORDTag(io_);  // Start Time
  289|    153|  xmpData()["Xmp.video.EndTimecode"] = readWORDTag(io_);     // End Time
  290|       |
  291|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Data Bitrate
  292|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Buffer Size
  293|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Initial Buffer Fullness
  294|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Data Bitrate
  295|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Buffer Size
  296|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Alternate Initial Buffer Fullness
  297|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Maximum Object Size
  298|    153|  io_->seek(io_->tell() + DWORD, BasicIo::beg);  // ignore Flags Buffer Size
  299|    153|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Flags Stream Number
  300|    153|  io_->seek(io_->tell() + WORD, BasicIo::beg);   // ignore Stream Language ID Index
  301|       |
  302|    153|  xmpData()["Xmp.video.FrameRate"] = readWORDTag(io_);  // Average Time Per Frame
  303|    153|  uint16_t stream_name_count = readWORDTag(io_);
  304|    153|  uint16_t payload_ext_sys_count = readWORDTag(io_);
  305|       |
  306|    725|  for (uint16_t i = 0; i < stream_name_count; i++) {
  ------------------
  |  Branch (306:24): [True: 572, False: 153]
  ------------------
  307|    572|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Language ID Index
  308|    572|    uint16_t stream_length = readWORDTag(io_);
  309|    572|    if (stream_length)
  ------------------
  |  Branch (309:9): [True: 302, False: 270]
  ------------------
  310|    302|      io_->seek(io_->tell() + stream_length, BasicIo::beg);  // ignore Stream name
  311|    572|  }
  312|       |
  313|    599|  for (uint16_t i = 0; i < payload_ext_sys_count; i++) {
  ------------------
  |  Branch (313:24): [True: 446, False: 153]
  ------------------
  314|    446|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Extension System ID
  315|    446|    io_->seek(io_->tell() + WORD, BasicIo::beg);  // ignore Extension Data Size
  316|    446|    uint16_t ext_sys_info_length = readWORDTag(io_);
  317|    446|    if (ext_sys_info_length)
  ------------------
  |  Branch (317:9): [True: 218, False: 228]
  ------------------
  318|    218|      io_->seek(io_->tell() + ext_sys_info_length, BasicIo::beg);  // ignore Extension System Info
  319|    446|  }
  320|    153|}  // AsfVideo::extendedStreamProperties
_ZN5Exiv28AsfVideo16streamPropertiesEv:
  337|    690|void AsfVideo::streamProperties() {
  338|    690|  DataBuf streamTypedBuf(GUID);
  339|    690|  io_->readOrThrow(streamTypedBuf.data(), streamTypedBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  340|       |
  341|    690|  enum class streamTypeInfo { Audio = 1, Video = 2 };
  342|    690|  auto stream = streamTypeInfo{0};
  343|       |
  344|    690|  auto tag_stream_type = GUIDReferenceTags.find(GUIDTag(streamTypedBuf.data()));
  345|    690|  if (tag_stream_type != GUIDReferenceTags.end()) {
  ------------------
  |  Branch (345:7): [True: 148, False: 542]
  ------------------
  346|    148|    if (tag_stream_type->second == "Audio_Media")
  ------------------
  |  Branch (346:9): [True: 12, False: 136]
  ------------------
  347|     12|      stream = streamTypeInfo::Audio;
  348|    136|    else if (tag_stream_type->second == "Video_Media")
  ------------------
  |  Branch (348:14): [True: 12, False: 124]
  ------------------
  349|     12|      stream = streamTypeInfo::Video;
  350|       |
  351|    148|    io_->seek(io_->tell() + GUID, BasicIo::beg);  // ignore Error Correction Type
  352|       |
  353|    148|    uint64_t time_offset = readQWORDTag(io_);
  354|    148|    if (stream == streamTypeInfo::Video)
  ------------------
  |  Branch (354:9): [True: 12, False: 136]
  ------------------
  355|     12|      xmpData()["Xmp.video.TimeOffset"] = time_offset;
  356|    136|    else if (stream == streamTypeInfo::Audio)
  ------------------
  |  Branch (356:14): [True: 12, False: 124]
  ------------------
  357|     12|      xmpData()["Xmp.audio.TimeOffset"] = time_offset;
  358|       |
  359|    148|    auto specific_data_length = readDWORDTag(io_);
  360|    148|    auto correction_data_length = readDWORDTag(io_);
  361|       |
  362|    148|    io_->seek(io_->tell() + WORD /*Flags*/ + DWORD /*Reserved*/ + specific_data_length + correction_data_length,
  363|    148|              BasicIo::beg);
  364|    148|  }
  365|       |
  366|    690|}  // AsfVideo::streamProperties
_ZN5Exiv28AsfVideo9codecListEv:
  368|    279|void AsfVideo::codecList() {
  369|    279|  io_->seek(io_->tell() + GUID /*reserved*/, BasicIo::beg);
  370|    279|  auto entries_count = readDWORDTag(io_);
  371|  1.32k|  for (uint32_t i = 0; i < entries_count; i++) {
  ------------------
  |  Branch (371:24): [True: 1.04k, False: 279]
  ------------------
  372|  1.04k|    uint16_t codec_type = readWORDTag(io_) * 2;
  373|  1.04k|    std::string codec = (codec_type == 1) ? "Xmp.video" : "Xmp.audio";
  ------------------
  |  Branch (373:25): [True: 0, False: 1.04k]
  ------------------
  374|       |
  375|  1.04k|    if (uint16_t codec_name_length = readWORDTag(io_) * 2)
  ------------------
  |  Branch (375:18): [True: 790, False: 259]
  ------------------
  376|    790|      xmpData()[codec + std::string(".CodecName")] = readStringWcharTag(io_, codec_name_length);
  377|       |
  378|  1.04k|    if (uint16_t codec_desc_length = readWORDTag(io_))
  ------------------
  |  Branch (378:18): [True: 767, False: 282]
  ------------------
  379|    767|      xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
  380|       |
  381|  1.04k|    uint16_t codec_info_length = readWORDTag(io_);
  382|  1.04k|    Internal::enforce(codec_info_length && codec_info_length < io_->size() - io_->tell(),
  ------------------
  |  Branch (382:23): [True: 853, False: 196]
  |  Branch (382:44): [True: 817, False: 36]
  ------------------
  383|  1.04k|                      Exiv2::ErrorCode::kerCorruptedMetadata);
  384|  1.04k|    xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
  385|  1.04k|  }
  386|    279|}  // AsfVideo::codecList
_ZNK5Exiv28AsfVideo15headerExtensionEv:
  388|    189|void AsfVideo::headerExtension() const {
  389|    189|  io_->seek(io_->tell() + GUID /*reserved1*/ + WORD /*Reserved2*/, BasicIo::beg);
  390|    189|  auto header_ext_data_length = readDWORDTag(io_);
  391|    189|  io_->seek(io_->tell() + header_ext_data_length, BasicIo::beg);
  392|    189|}  // AsfVideo::headerExtension
_ZN5Exiv28AsfVideo26extendedContentDescriptionEv:
  394|    794|void AsfVideo::extendedContentDescription() {
  395|    794|  uint16_t content_descriptor_count = readWORDTag(io_);
  396|    794|  std::string value;
  397|       |
  398|  11.8k|  for (uint16_t i = 0; i < content_descriptor_count; i++) {
  ------------------
  |  Branch (398:24): [True: 11.3k, False: 552]
  ------------------
  399|  11.3k|    if (uint16_t descriptor_name_length = readWORDTag(io_))
  ------------------
  |  Branch (399:18): [True: 4.31k, False: 7.00k]
  ------------------
  400|  4.31k|      value += readStringWcharTag(io_, descriptor_name_length);  // Descriptor Name
  401|       |
  402|  11.3k|    uint16_t descriptor_value_data_type = readWORDTag(io_);
  403|  11.3k|    if (uint16_t descriptor_value_length = readWORDTag(io_)) {
  ------------------
  |  Branch (403:18): [True: 4.63k, False: 6.68k]
  ------------------
  404|       |      // Descriptor Value
  405|  4.63k|      switch (descriptor_value_data_type) {
  ------------------
  |  Branch (405:15): [True: 3.44k, False: 1.18k]
  ------------------
  406|  1.46k|        case 0 /*Unicode string */:
  ------------------
  |  Branch (406:9): [True: 1.46k, False: 3.16k]
  ------------------
  407|  1.46k|          value += std::string(": ") + readStringWcharTag(io_, descriptor_value_length);
  408|  1.46k|          break;
  409|    134|        case 1 /*BYTE array  */:
  ------------------
  |  Branch (409:9): [True: 134, False: 4.50k]
  ------------------
  410|    134|          value += std::string(": ") + readStringTag(io_, descriptor_value_length);
  411|    134|          break;
  412|    115|        case 2 /*BOOL*/:
  ------------------
  |  Branch (412:9): [True: 115, False: 4.51k]
  ------------------
  413|    115|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  414|    115|          break;
  415|    150|        case 3 /*DWORD */:
  ------------------
  |  Branch (415:9): [True: 150, False: 4.48k]
  ------------------
  416|    150|          value += std::string(": ") + std::to_string(readDWORDTag(io_));
  417|    150|          break;
  418|  1.52k|        case 4 /*QWORD */:
  ------------------
  |  Branch (418:9): [True: 1.52k, False: 3.11k]
  ------------------
  419|  1.52k|          value += std::string(": ") + std::to_string(readQWORDTag(io_));
  420|  1.52k|          break;
  421|     53|        case 5 /*WORD*/:
  ------------------
  |  Branch (421:9): [True: 53, False: 4.58k]
  ------------------
  422|     53|          value += std::string(": ") + std::to_string(readWORDTag(io_));
  423|     53|          break;
  424|  4.63k|      }
  425|  4.63k|    }
  426|  11.0k|    value += std::string(", ");
  427|  11.0k|  }
  428|       |
  429|    552|  xmpData()["Xmp.video.ExtendedContentDescription"] = value;
  430|    552|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo18contentDescriptionEv:
  432|    488|void AsfVideo::contentDescription() {
  433|    488|  uint16_t title_length = readWORDTag(io_);
  434|    488|  uint16_t author_length = readWORDTag(io_);
  435|    488|  uint16_t copyright_length = readWORDTag(io_);
  436|    488|  uint16_t desc_length = readWORDTag(io_);
  437|    488|  uint16_t rating_length = readWORDTag(io_);
  438|       |
  439|    488|  if (title_length)
  ------------------
  |  Branch (439:7): [True: 315, False: 173]
  ------------------
  440|    315|    xmpData()["Xmp.video.Title"] = readStringWcharTag(io_, title_length);
  441|       |
  442|    488|  if (author_length)
  ------------------
  |  Branch (442:7): [True: 149, False: 339]
  ------------------
  443|    149|    xmpData()["Xmp.video.Author"] = readStringWcharTag(io_, author_length);
  444|       |
  445|    488|  if (copyright_length)
  ------------------
  |  Branch (445:7): [True: 190, False: 298]
  ------------------
  446|    190|    xmpData()["Xmp.video.Copyright"] = readStringWcharTag(io_, copyright_length);
  447|       |
  448|    488|  if (desc_length)
  ------------------
  |  Branch (448:7): [True: 169, False: 319]
  ------------------
  449|    169|    xmpData()["Xmp.video.Description"] = readStringWcharTag(io_, desc_length);
  450|       |
  451|    488|  if (rating_length)
  ------------------
  |  Branch (451:7): [True: 74, False: 414]
  ------------------
  452|     74|    xmpData()["Xmp.video.Rating"] = readStringWcharTag(io_, rating_length);
  453|       |
  454|    488|}  // AsfVideo::extendedContentDescription
_ZN5Exiv28AsfVideo14filePropertiesEv:
  456|    450|void AsfVideo::fileProperties() {
  457|    450|  DataBuf FileIddBuf(GUID);
  458|    450|  io_->readOrThrow(FileIddBuf.data(), FileIddBuf.size(), Exiv2::ErrorCode::kerCorruptedMetadata);
  459|    450|  xmpData()["Xmp.video.FileID"] = GUIDTag(FileIddBuf.data()).to_string();
  460|    450|  xmpData()["Xmp.video.FileLength"] = readQWORDTag(io_);
  461|    450|  xmpData()["Xmp.video.CreationDate"] = readQWORDTag(io_);
  462|    450|  xmpData()["Xmp.video.DataPackets"] = readQWORDTag(io_);
  463|    450|  xmpData()["Xmp.video.duration"] = readQWORDTag(io_);
  464|    450|  xmpData()["Xmp.video.SendDuration"] = readQWORDTag(io_);
  465|    450|  xmpData()["Xmp.video.Preroll"] = readQWORDTag(io_);
  466|       |
  467|    450|  io_->seek(io_->tell() + DWORD + DWORD + DWORD,
  468|    450|            BasicIo::beg);  // ignore Flags, Minimum Data Packet Size and Maximum Data Packet Size
  469|    450|  xmpData()["Xmp.video.MaxBitRate"] = readDWORDTag(io_);
  470|    450|}  // AsfVideo::fileProperties
_ZN5Exiv214newAsfInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  472|  1.97k|Image::UniquePtr newAsfInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  473|  1.97k|  auto image = std::make_unique<AsfVideo>(std::move(io), params);
  474|  1.97k|  if (!image->good()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 1.97k]
  ------------------
  475|      0|    return nullptr;
  476|      0|  }
  477|  1.97k|  return image;
  478|  1.97k|}
_ZN5Exiv29isAsfTypeERNS_7BasicIoEb:
  480|  16.8k|bool isAsfType(BasicIo& iIo, bool advance) {
  481|  16.8k|  byte buf[GUID];
  482|  16.8k|  iIo.read(buf, GUID);
  483|       |
  484|  16.8k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (484:7): [True: 0, False: 16.8k]
  |  Branch (484:22): [True: 567, False: 16.3k]
  ------------------
  485|    567|    return false;
  486|    567|  }
  487|       |
  488|  16.3k|  bool matched = isASFType(buf);
  489|  16.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (489:7): [True: 16.3k, False: 0]
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|  16.3k|    iIo.seek(0, BasicIo::beg);
  491|  16.3k|  }
  492|       |
  493|  16.3k|  return matched;
  494|  16.8k|}
asfvideo.cpp:_ZN5Exiv2L9isASFTypeEPKh:
  178|  16.3k|static bool isASFType(const byte buf[]) {
  179|  16.3k|  return Header == AsfVideo::GUIDTag(buf);
  180|  16.3k|}

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

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

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

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

_ZN5Exiv28Internal14CanonMakerNote7tagListEv:
   38|   244k|  static constexpr auto tagList() {
   39|   244k|    return tagInfo_;
   40|   244k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCsEv:
   42|  2.69k|  static constexpr auto tagListCs() {
   43|  2.69k|    return tagInfoCs_;
   44|  2.69k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListSiEv:
   46|  72.8k|  static constexpr auto tagListSi() {
   47|  72.8k|    return tagInfoSi_;
   48|  72.8k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListCfEv:
   54|  1.04k|  static constexpr auto tagListCf() {
   55|  1.04k|    return tagInfoCf_;
   56|  1.04k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPiEv:
   58|  1.52k|  static constexpr auto tagListPi() {
   59|  1.52k|    return tagInfoPi_;
   60|  1.52k|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListTiEv:
   62|    243|  static constexpr auto tagListTi() {
   63|    243|    return tagInfoTi_;
   64|    243|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListFiEv:
   66|    450|  static constexpr auto tagListFi() {
   67|    450|    return tagInfoFi_;
   68|    450|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPaEv:
   50|    304|  static constexpr auto tagListPa() {
   51|    304|    return tagInfoPa_;
   52|    304|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListPrEv:
   70|  2.55k|  static constexpr auto tagListPr() {
   71|  2.55k|    return tagInfoPr_;
   72|  2.55k|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListVigCor2Ev:
  134|    346|  static constexpr auto tagListVigCor2() {
  135|    346|    return tagInfoVigCor2_;
  136|    346|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListLiOpEv:
  138|    437|  static constexpr auto tagListLiOp() {
  139|    437|    return tagInfoLiOp_;
  140|    437|  }
_ZN5Exiv28Internal14CanonMakerNote14tagListAfMiAdjEv:
  126|    425|  static constexpr auto tagListAfMiAdj() {
  127|    425|    return tagInfoAfMiAdj_;
  128|    425|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListLeEv:
  142|    667|  static constexpr auto tagListLe() {
  143|    667|    return tagInfoLe_;
  144|    667|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListAmEv:
  146|    477|  static constexpr auto tagListAm() {
  147|    477|    return tagInfoAm_;
  148|    477|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListFilEv:
  154|    448|  static constexpr auto tagListFil() {
  155|    448|    return tagInfoFil_;
  156|    448|  }
_ZN5Exiv28Internal14CanonMakerNote9tagListMeEv:
  150|    333|  static constexpr auto tagListMe() {
  151|    333|    return tagInfoMe_;
  152|    333|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListHdrEv:
  158|    415|  static constexpr auto tagListHdr() {
  159|    415|    return tagInfoHdr_;
  160|    415|  }
_ZN5Exiv28Internal14CanonMakerNote10tagListAfCEv:
  162|    203|  static constexpr auto tagListAfC() {
  163|    203|    return tagInfoAfC_;
  164|    203|  }
_ZN5Exiv28Internal14CanonMakerNote11tagListRawBEv:
  166|    198|  static constexpr auto tagListRawB() {
  167|    198|    return tagInfoRawB_;
  168|    198|  }

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

_ZN5Exiv29ConverterC2ERNS_8ExifDataERNS_7XmpDataE:
  495|  5.98k|    exifData_(&exifData), iptcData_(nullptr), xmpData_(&xmpData), iptcCharset_(nullptr) {
  496|  5.98k|}
_ZN5Exiv29ConverterC2ERNS_8IptcDataERNS_7XmpDataEPKc:
  499|  5.89k|    exifData_(nullptr), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset) {
  500|  5.89k|}
_ZN5Exiv29Converter8cnvToXmpEv:
  502|  5.67k|void Converter::cnvToXmp() {
  503|   706k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (503:17): [True: 706k, False: 5.67k]
  ------------------
  504|   706k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (504:10): [True: 583k, False: 122k]
  |  Branch (504:37): [True: 292k, False: 290k]
  |  Branch (504:52): [True: 122k, False: 290k]
  |  Branch (504:79): [True: 61.3k, False: 61.4k]
  ------------------
  505|   354k|      std::invoke(c.key1ToKey2_, *this, c.key1_, c.key2_);
  506|   354k|    }
  507|   706k|  }
  508|  5.67k|}
_ZN5Exiv29Converter10cnvFromXmpEv:
  510|  6.19k|void Converter::cnvFromXmp() {
  511|   780k|  for (auto&& c : conversion_) {
  ------------------
  |  Branch (511:17): [True: 780k, False: 6.19k]
  ------------------
  512|   780k|    if ((c.metadataId_ == mdExif && exifData_) || (c.metadataId_ == mdIptc && iptcData_)) {
  ------------------
  |  Branch (512:10): [True: 643k, False: 136k]
  |  Branch (512:37): [True: 321k, False: 321k]
  |  Branch (512:52): [True: 136k, False: 321k]
  |  Branch (512:79): [True: 68.1k, False: 68.1k]
  ------------------
  513|   390k|      std::invoke(c.key2ToKey1_, *this, c.key2_, c.key1_);
  514|   390k|    }
  515|   780k|  }
  516|  6.19k|}
_ZN5Exiv29Converter7cnvNoneEPKcS2_:
  518|  5.57k|void Converter::cnvNone(const char*, const char*) {
  519|  5.57k|}
_ZN5Exiv29Converter17prepareExifTargetEPKcb:
  521|  7.40k|bool Converter::prepareExifTarget(const char* to, bool force) {
  522|  7.40k|  auto pos = exifData_->findKey(ExifKey(to));
  523|  7.40k|  if (pos == exifData_->end())
  ------------------
  |  Branch (523:7): [True: 7.40k, False: 0]
  ------------------
  524|  7.40k|    return true;
  525|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (525:7): [True: 0, False: 0]
  |  Branch (525:22): [True: 0, False: 0]
  ------------------
  526|      0|    return false;
  527|      0|  exifData_->erase(pos);
  528|      0|  return true;
  529|      0|}
_ZN5Exiv29Converter17prepareIptcTargetEPKcb:
  531|  1.34k|bool Converter::prepareIptcTarget(const char* to, bool force) {
  532|  1.34k|  auto pos = iptcData_->findKey(IptcKey(to));
  533|  1.34k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (533:7): [True: 1.34k, False: 0]
  ------------------
  534|  1.34k|    return true;
  535|      0|  if (!overwrite_ && !force)
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  |  Branch (535:22): [True: 0, False: 0]
  ------------------
  536|      0|    return false;
  537|      0|  while ((pos = iptcData_->findKey(IptcKey(to))) != iptcData_->end()) {
  ------------------
  |  Branch (537:10): [True: 0, False: 0]
  ------------------
  538|      0|    iptcData_->erase(pos);
  539|      0|  }
  540|      0|  return true;
  541|      0|}
_ZN5Exiv29Converter16prepareXmpTargetEPKcb:
  543|  1.11k|bool Converter::prepareXmpTarget(const char* to, bool force) {
  544|  1.11k|  auto pos = xmpData_->findKey(XmpKey(to));
  545|  1.11k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (545:7): [True: 0, False: 1.11k]
  ------------------
  546|      0|    return true;
  547|  1.11k|  if (!overwrite_ && !force)
  ------------------
  |  Branch (547:7): [True: 0, False: 1.11k]
  |  Branch (547:22): [True: 0, False: 0]
  ------------------
  548|      0|    return false;
  549|  1.11k|  xmpData_->erase(pos);
  550|  1.11k|  return true;
  551|  1.11k|}
_ZN5Exiv29Converter12cnvExifValueEPKcS2_:
  553|   253k|void Converter::cnvExifValue(const char* from, const char* to) {
  554|   253k|  auto pos = exifData_->findKey(ExifKey(from));
  555|   253k|  if (pos == exifData_->end())
  ------------------
  |  Branch (555:7): [True: 253k, False: 494]
  ------------------
  556|   253k|    return;
  557|    494|  std::string value = pos->toString();
  558|    494|  if (!pos->value().ok()) {
  ------------------
  |  Branch (558:7): [True: 0, False: 494]
  ------------------
  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|    494|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (564:7): [True: 0, False: 494]
  ------------------
  565|      0|    return;
  566|    494|  (*xmpData_)[to] = value;
  567|    494|  if (erase_)
  ------------------
  |  Branch (567:7): [True: 0, False: 494]
  ------------------
  568|      0|    exifData_->erase(pos);
  569|    494|}
_ZN5Exiv29Converter14cnvExifCommentEPKcS2_:
  571|  2.79k|void Converter::cnvExifComment(const char* from, const char* to) {
  572|  2.79k|  auto pos = exifData_->findKey(ExifKey(from));
  573|  2.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (573:7): [True: 2.79k, False: 0]
  ------------------
  574|  2.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|  2.79k|void Converter::cnvExifArray(const char* from, const char* to) {
  597|  2.79k|  auto pos = exifData_->findKey(ExifKey(from));
  598|  2.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (598:7): [True: 2.79k, False: 0]
  ------------------
  599|  2.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|  11.2k|void Converter::cnvExifDate(const char* from, const char* to) {
  617|  11.2k|  auto pos = exifData_->findKey(ExifKey(from));
  618|  11.2k|  if (pos == exifData_->end())
  ------------------
  |  Branch (618:7): [True: 11.0k, False: 180]
  ------------------
  619|  11.0k|    return;
  620|    180|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (620:7): [True: 0, False: 180]
  ------------------
  621|      0|    return;
  622|    180|  int year = 0;
  623|    180|  int month = 0;
  624|    180|  int day = 0;
  625|    180|  int hour = 0;
  626|    180|  int min = 0;
  627|    180|  int sec = 0;
  628|    180|  std::string subsec;
  629|       |
  630|    180|  if (std::string(from) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (630:7): [True: 180, False: 0]
  ------------------
  631|    180|    std::string value = pos->toString();
  632|    180|    if (!pos->value().ok()) {
  ------------------
  |  Branch (632:9): [True: 0, False: 180]
  ------------------
  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|    180|    if (sscanf(value.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec) != 6) {
  ------------------
  |  Branch (638:9): [True: 0, False: 180]
  ------------------
  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|    180|  } 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|    180|  const char* subsecTag = nullptr;
  711|    180|  if (std::string(from) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (711:7): [True: 11, False: 169]
  ------------------
  712|     11|    subsecTag = "Exif.Photo.SubSecTime";
  713|    169|  } else if (std::string(from) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (713:14): [True: 14, False: 155]
  ------------------
  714|     14|    subsecTag = "Exif.Photo.SubSecTimeOriginal";
  715|    155|  } else if (std::string(from) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (715:14): [True: 155, False: 0]
  ------------------
  716|    155|    subsecTag = "Exif.Photo.SubSecTimeDigitized";
  717|    155|  }
  718|       |
  719|    180|  if (subsecTag) {
  ------------------
  |  Branch (719:7): [True: 180, False: 0]
  ------------------
  720|    180|    auto subsec_pos = exifData_->findKey(ExifKey(subsecTag));
  721|    180|    if (subsec_pos != exifData_->end()) {
  ------------------
  |  Branch (721:9): [True: 22, False: 158]
  ------------------
  722|     22|      if (subsec_pos->typeId() == asciiString) {
  ------------------
  |  Branch (722:11): [True: 22, False: 0]
  ------------------
  723|     22|        std::string ss = subsec_pos->toString();
  724|     22|        if (!ss.empty()) {
  ------------------
  |  Branch (724:13): [True: 22, False: 0]
  ------------------
  725|     22|          bool ok = false;
  726|     22|          stringTo<long>(ss, ok);
  727|     22|          if (ok)
  ------------------
  |  Branch (727:15): [True: 22, False: 0]
  ------------------
  728|     22|            subsec = std::string(".") + ss;
  729|     22|        }
  730|     22|      }
  731|     22|      if (erase_)
  ------------------
  |  Branch (731:11): [True: 0, False: 22]
  ------------------
  732|      0|        exifData_->erase(subsec_pos);
  733|     22|    }
  734|    180|  }
  735|       |
  736|    180|  if (subsec.size() > 10)
  ------------------
  |  Branch (736:7): [True: 0, False: 180]
  ------------------
  737|      0|    subsec.resize(10);
  738|       |
  739|    180|  (*xmpData_)[to] = stringFormat("{:4}-{:02}-{:02}T{:02}:{:02}:{:02}{}", year, month, day, hour, min, sec, subsec);
  ------------------
  |  |   18|    180|#define stringFormat std::format
  ------------------
  740|    180|  if (erase_)
  ------------------
  |  Branch (740:7): [True: 0, False: 180]
  ------------------
  741|      0|    exifData_->erase(pos);
  742|    180|}
_ZN5Exiv29Converter14cnvExifVersionEPKcS2_:
  744|  5.58k|void Converter::cnvExifVersion(const char* from, const char* to) {
  745|  5.58k|  auto pos = exifData_->findKey(ExifKey(from));
  746|  5.58k|  if (pos == exifData_->end())
  ------------------
  |  Branch (746:7): [True: 5.58k, False: 0]
  ------------------
  747|  5.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|  2.79k|void Converter::cnvExifGPSVersion(const char* from, const char* to) {
  762|  2.79k|  auto pos = exifData_->findKey(ExifKey(from));
  763|  2.79k|  if (pos == exifData_->end())
  ------------------
  |  Branch (763:7): [True: 2.79k, False: 0]
  ------------------
  764|  2.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|  2.79k|void Converter::cnvExifFlash(const char* from, const char* to) {
  779|  2.79k|  auto pos = exifData_->findKey(ExifKey(from));
  780|  2.79k|  if (pos == exifData_->end() || pos->count() == 0)
  ------------------
  |  Branch (780:7): [True: 2.79k, False: 0]
  |  Branch (780:7): [True: 2.79k, False: 0]
  |  Branch (780:34): [True: 0, False: 0]
  ------------------
  781|  2.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|  11.1k|void Converter::cnvExifGPSCoord(const char* from, const char* to) {
  803|  11.1k|  auto pos = exifData_->findKey(ExifKey(from));
  804|  11.1k|  if (pos == exifData_->end())
  ------------------
  |  Branch (804:7): [True: 11.1k, False: 0]
  ------------------
  805|  11.1k|    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|   278k|void Converter::cnvXmpValue(const char* from, const char* to) {
  845|   278k|  auto pos = xmpData_->findKey(XmpKey(from));
  846|   278k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (846:7): [True: 277k, False: 703]
  ------------------
  847|   277k|    return;
  848|    703|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (848:7): [True: 0, False: 703]
  ------------------
  849|      0|    return;
  850|    703|  std::string value;
  851|    703|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (851:7): [True: 205, False: 498]
  ------------------
  852|    205|#ifndef SUPPRESS_WARNINGS
  853|    205|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    205|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 205]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    205|  LogMsg(LogMsg::warn).os()
  ------------------
  854|    205|#endif
  855|    205|    return;
  856|    205|  }
  857|       |  // Todo: Escape non-ASCII characters in XMP text values
  858|    498|  ExifKey key(to);
  859|    498|  if (auto ed = Exifdatum(key); ed.setValue(value) == 0) {
  ------------------
  |  Branch (859:33): [True: 494, False: 4]
  ------------------
  860|    494|    exifData_->add(ed);
  861|    494|  }
  862|    498|  if (erase_)
  ------------------
  |  Branch (862:7): [True: 0, False: 498]
  ------------------
  863|      0|    xmpData_->erase(pos);
  864|    498|}
_ZN5Exiv29Converter13cnvXmpCommentEPKcS2_:
  866|  3.09k|void Converter::cnvXmpComment(const char* from, const char* to) {
  867|  3.09k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (867:7): [True: 0, False: 3.09k]
  ------------------
  868|      0|    return;
  869|  3.09k|  auto pos = xmpData_->findKey(XmpKey(from));
  870|  3.09k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (870:7): [True: 3.09k, False: 0]
  ------------------
  871|  3.09k|    return;
  872|      0|  std::string value;
  873|      0|  if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef SUPPRESS_WARNINGS
  875|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  876|      0|#endif
  877|      0|    return;
  878|      0|  }
  879|       |  // Assumes the XMP value is encoded in UTF-8, as it should be
  880|      0|  (*exifData_)[to] = "charset=Unicode " + value;
  881|      0|  if (erase_)
  ------------------
  |  Branch (881:7): [True: 0, False: 0]
  ------------------
  882|      0|    xmpData_->erase(pos);
  883|      0|}
_ZN5Exiv29Converter11cnvXmpArrayEPKcS2_:
  885|  3.09k|void Converter::cnvXmpArray(const char* from, const char* to) {
  886|  3.09k|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (886:7): [True: 0, False: 3.09k]
  ------------------
  887|      0|    return;
  888|  3.09k|  auto pos = xmpData_->findKey(XmpKey(from));
  889|  3.09k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (889:7): [True: 3.09k, False: 0]
  ------------------
  890|  3.09k|    return;
  891|      0|  std::string array;
  892|      0|  for (size_t i = 0; i < pos->count(); ++i) {
  ------------------
  |  Branch (892:22): [True: 0, False: 0]
  ------------------
  893|      0|    std::string value = pos->toString(i);
  894|      0|    if (!pos->value().ok()) {
  ------------------
  |  Branch (894:9): [True: 0, False: 0]
  ------------------
  895|      0|#ifndef SUPPRESS_WARNINGS
  896|      0|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  897|      0|#endif
  898|      0|      return;
  899|      0|    }
  900|      0|    array += value;
  901|      0|    if (i != pos->count() - 1)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|      array += " ";
  903|      0|  }
  904|      0|  (*exifData_)[to] = array;
  905|      0|  if (erase_)
  ------------------
  |  Branch (905:7): [True: 0, False: 0]
  ------------------
  906|      0|    xmpData_->erase(pos);
  907|      0|}
_ZN5Exiv29Converter10cnvXmpDateEPKcS2_:
  909|  12.3k|void Converter::cnvXmpDate(const char* from, const char* to) {
  910|  12.3k|  auto pos = xmpData_->findKey(XmpKey(from));
  911|  12.3k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (911:7): [True: 11.8k, False: 492]
  ------------------
  912|  11.8k|    return;
  913|    492|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (913:7): [True: 0, False: 492]
  ------------------
  914|      0|    return;
  915|    492|#ifdef EXV_HAVE_XMP_TOOLKIT
  916|    492|  std::string value = pos->toString();
  917|    492|  if (!pos->value().ok()) {
  ------------------
  |  Branch (917:7): [True: 0, False: 492]
  ------------------
  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|    492|  XMP_DateTime datetime;
  924|    492|  try {
  925|    492|    SXMPUtils::ConvertToDate(value, &datetime);
  926|    492|    if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") {
  ------------------
  |  Branch (926:9): [True: 185, False: 307]
  ------------------
  927|    185|      SXMPUtils::ConvertToLocalTime(&datetime);
  928|       |
  929|    185|      (*exifData_)[to] = stringFormat("{:4}:{:02}:{:02} {:02}:{:02}:{:02}", datetime.year, datetime.month, datetime.day,
  ------------------
  |  |   18|    185|#define stringFormat std::format
  ------------------
  930|    185|                                      datetime.hour, datetime.minute, datetime.second);
  931|       |
  932|    185|      if (datetime.nanoSecond) {
  ------------------
  |  Branch (932:11): [True: 22, False: 163]
  ------------------
  933|     22|        const char* subsecTag = nullptr;
  934|     22|        if (std::string(to) == "Exif.Image.DateTime") {
  ------------------
  |  Branch (934:13): [True: 4, False: 18]
  ------------------
  935|      4|          subsecTag = "Exif.Photo.SubSecTime";
  936|     18|        } else if (std::string(to) == "Exif.Photo.DateTimeOriginal") {
  ------------------
  |  Branch (936:20): [True: 2, False: 16]
  ------------------
  937|      2|          subsecTag = "Exif.Photo.SubSecTimeOriginal";
  938|     16|        } else if (std::string(to) == "Exif.Photo.DateTimeDigitized") {
  ------------------
  |  Branch (938:20): [True: 16, False: 0]
  ------------------
  939|     16|          subsecTag = "Exif.Photo.SubSecTimeDigitized";
  940|     16|        }
  941|     22|        if (subsecTag) {
  ------------------
  |  Branch (941:13): [True: 22, False: 0]
  ------------------
  942|     22|          prepareExifTarget(subsecTag, true);
  943|     22|          (*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
  944|     22|        }
  945|     22|      }
  946|    307|    } else {  // "Exif.GPSInfo.GPSTimeStamp"
  947|       |      // Ignore the time zone, assuming the time is in UTC as it should be
  948|       |
  949|    307|      URational rhour(datetime.hour, 1);
  950|    307|      URational rmin(datetime.minute, 1);
  951|    307|      URational rsec(datetime.second, 1);
  952|    307|      if (datetime.nanoSecond != 0) {
  ------------------
  |  Branch (952:11): [True: 0, False: 307]
  ------------------
  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|    307|      std::ostringstream array;
  964|    307|      array << rhour << " " << rmin << " " << rsec;
  965|    307|      (*exifData_)[to] = array.str();
  966|       |
  967|    307|      prepareExifTarget("Exif.GPSInfo.GPSDateStamp", true);
  968|    307|      (*exifData_)["Exif.GPSInfo.GPSDateStamp"] =
  969|    307|          stringFormat("{:4}:{:02}:{:02}", datetime.year, datetime.month, datetime.day);
  ------------------
  |  |   18|    307|#define stringFormat std::format
  ------------------
  970|    307|    }
  971|    492|  }
  972|    492|#ifndef SUPPRESS_WARNINGS
  973|    492|  catch (const XMP_Error& e) {
  974|    312|    EXV_WARNING << "Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n";
  ------------------
  |  |  138|    312|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 312]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    312|  LogMsg(LogMsg::warn).os()
  ------------------
  975|    312|    return;
  976|    312|  }
  977|       |#else
  978|       |  catch (const XMP_Error&) {
  979|       |    return;
  980|       |  }
  981|       |#endif  // SUPPRESS_WARNINGS
  982|       |
  983|    180|  if (erase_)
  ------------------
  |  Branch (983:7): [True: 0, False: 180]
  ------------------
  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|    180|}
_ZN5Exiv29Converter13cnvXmpVersionEPKcS2_:
  992|  6.19k|void Converter::cnvXmpVersion(const char* from, const char* to) {
  993|  6.19k|  auto pos = xmpData_->findKey(XmpKey(from));
  994|  6.19k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (994:7): [True: 6.19k, False: 0]
  ------------------
  995|  6.19k|    return;
  996|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    return;
  998|      0|  std::string value = pos->toString();
  999|      0|  if (!pos->value().ok() || value.length() < 4) {
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  |  Branch (999:29): [True: 0, False: 0]
  ------------------
 1000|      0|#ifndef SUPPRESS_WARNINGS
 1001|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1002|      0|#endif
 1003|      0|    return;
 1004|      0|  }
 1005|       |
 1006|      0|  (*exifData_)[to] = stringFormat("{} {} {} {}", static_cast<int>(value[0]), static_cast<int>(value[1]),
  ------------------
  |  |   18|      0|#define stringFormat std::format
  ------------------
 1007|      0|                                  static_cast<int>(value[2]), static_cast<int>(value[3]));
 1008|      0|  if (erase_)
  ------------------
  |  Branch (1008:7): [True: 0, False: 0]
  ------------------
 1009|      0|    xmpData_->erase(pos);
 1010|      0|}
_ZN5Exiv29Converter16cnvXmpGPSVersionEPKcS2_:
 1012|  3.09k|void Converter::cnvXmpGPSVersion(const char* from, const char* to) {
 1013|  3.09k|  auto pos = xmpData_->findKey(XmpKey(from));
 1014|  3.09k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1014:7): [True: 3.09k, False: 0]
  ------------------
 1015|  3.09k|    return;
 1016|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1016:7): [True: 0, False: 0]
  ------------------
 1017|      0|    return;
 1018|      0|  std::string value = pos->toString();
 1019|      0|  if (!pos->value().ok()) {
  ------------------
  |  Branch (1019:7): [True: 0, False: 0]
  ------------------
 1020|      0|#ifndef SUPPRESS_WARNINGS
 1021|      0|    EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1022|      0|#endif
 1023|      0|    return;
 1024|      0|  }
 1025|       |
 1026|      0|  std::replace(value.begin(), value.end(), '.', ' ');
 1027|      0|  (*exifData_)[to] = value;
 1028|      0|  if (erase_)
  ------------------
  |  Branch (1028:7): [True: 0, False: 0]
  ------------------
 1029|      0|    xmpData_->erase(pos);
 1030|      0|}
_ZN5Exiv29Converter11cnvXmpFlashEPKcS2_:
 1032|  3.09k|void Converter::cnvXmpFlash(const char* from, const char* to) {
 1033|  3.09k|  auto pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Fired"));
 1034|  3.09k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1034:7): [True: 3.09k, False: 0]
  ------------------
 1035|  3.09k|    return;
 1036|      0|  if (!prepareExifTarget(to))
  ------------------
  |  Branch (1036:7): [True: 0, False: 0]
  ------------------
 1037|      0|    return;
 1038|      0|  unsigned short value = 0;
 1039|       |
 1040|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:7): [True: 0, False: 0]
  |  Branch (1040:33): [True: 0, False: 0]
  ------------------
 1041|      0|    auto fired = pos->toUint32();
 1042|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1042:9): [True: 0, False: 0]
  ------------------
 1043|      0|      value |= fired & 1;
 1044|      0|#ifndef SUPPRESS_WARNINGS
 1045|      0|    else
 1046|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Fired"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1047|      0|                  << " to " << to << "\n";
 1048|      0|#endif
 1049|      0|  }
 1050|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Return"));
 1051|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:7): [True: 0, False: 0]
  |  Branch (1051:33): [True: 0, False: 0]
  ------------------
 1052|      0|    auto ret = pos->toUint32();
 1053|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1053:9): [True: 0, False: 0]
  ------------------
 1054|      0|      value |= (ret & 3) << 1;
 1055|      0|#ifndef SUPPRESS_WARNINGS
 1056|      0|    else
 1057|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Return"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1058|      0|                  << " to " << to << "\n";
 1059|      0|#endif
 1060|      0|  }
 1061|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Mode"));
 1062|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:7): [True: 0, False: 0]
  |  Branch (1062:33): [True: 0, False: 0]
  ------------------
 1063|      0|    auto mode = pos->toUint32();
 1064|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      value |= (mode & 3) << 3;
 1066|      0|#ifndef SUPPRESS_WARNINGS
 1067|      0|    else
 1068|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Mode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1069|      0|                  << " to " << to << "\n";
 1070|      0|#endif
 1071|      0|  }
 1072|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:Function"));
 1073|      0|  if (pos != xmpData_->end() && pos->count() > 0) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:7): [True: 0, False: 0]
  |  Branch (1073:33): [True: 0, False: 0]
  ------------------
 1074|      0|    auto function = pos->toUint32();
 1075|      0|    if (pos->value().ok())
  ------------------
  |  Branch (1075:9): [True: 0, False: 0]
  ------------------
 1076|      0|      value |= (function & 1) << 5;
 1077|      0|#ifndef SUPPRESS_WARNINGS
 1078|      0|    else
 1079|      0|      EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:Function"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1080|      0|                  << " to " << to << "\n";
 1081|      0|#endif
 1082|      0|  }
 1083|      0|  pos = xmpData_->findKey(XmpKey(std::string(from) + "/exif:RedEyeMode"));
 1084|      0|  if (pos != xmpData_->end()) {
  ------------------
  |  Branch (1084:7): [True: 0, False: 0]
  ------------------
 1085|      0|    if (pos->count() > 0) {
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|      auto red = pos->toUint32();
 1087|      0|      if (pos->value().ok())
  ------------------
  |  Branch (1087:11): [True: 0, False: 0]
  ------------------
 1088|      0|        value |= (red & 1) << 6;
 1089|      0|#ifndef SUPPRESS_WARNINGS
 1090|      0|      else
 1091|      0|        EXV_WARNING << "Failed to convert " << std::string(from) << "/exif:RedEyeMode"
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
 1092|      0|                    << " to " << to << "\n";
 1093|      0|#endif
 1094|      0|    }
 1095|      0|    if (erase_)
  ------------------
  |  Branch (1095:9): [True: 0, False: 0]
  ------------------
 1096|      0|      xmpData_->erase(pos);
 1097|      0|  }
 1098|       |
 1099|      0|  (*exifData_)[to] = value;
 1100|      0|}
_ZN5Exiv29Converter14cnvXmpGPSCoordEPKcS2_:
 1102|  12.3k|void Converter::cnvXmpGPSCoord(const char* from, const char* to) {
 1103|  12.3k|  auto pos = xmpData_->findKey(XmpKey(from));
 1104|  12.3k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1104:7): [True: 12.3k, False: 0]
  ------------------
 1105|  12.3k|    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|  55.7k|void Converter::cnvIptcValue(const char* from, const char* to) {
 1166|  55.7k|  auto pos = iptcData_->findKey(IptcKey(from));
 1167|  55.7k|  if (pos == iptcData_->end())
  ------------------
  |  Branch (1167:7): [True: 55.3k, False: 436]
  ------------------
 1168|  55.3k|    return;
 1169|    436|  if (!prepareXmpTarget(to))
  ------------------
  |  Branch (1169:7): [True: 0, False: 436]
  ------------------
 1170|      0|    return;
 1171|  8.21k|  while (pos != iptcData_->end()) {
  ------------------
  |  Branch (1171:10): [True: 7.77k, False: 436]
  ------------------
 1172|  7.77k|    if (pos->key() == from) {
  ------------------
  |  Branch (1172:9): [True: 4.53k, False: 3.24k]
  ------------------
 1173|  4.53k|      std::string value = pos->toString();
 1174|  4.53k|      if (!pos->value().ok()) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 4.53k]
  ------------------
 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|  4.53k|      if (iptcCharset_)
  ------------------
  |  Branch (1181:11): [True: 4.53k, False: 0]
  ------------------
 1182|  4.53k|        convertStringCharset(value, iptcCharset_, "UTF-8");
 1183|  4.53k|      (*xmpData_)[to] = value;
 1184|  4.53k|      if (erase_) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 4.53k]
  ------------------
 1185|      0|        pos = iptcData_->erase(pos);
 1186|      0|        continue;
 1187|      0|      }
 1188|  4.53k|    }
 1189|  7.77k|    ++pos;
 1190|  7.77k|  }
 1191|    436|}
_ZN5Exiv29Converter17cnvXmpValueToIptcEPKcS2_:
 1193|  68.1k|void Converter::cnvXmpValueToIptc(const char* from, const char* to) {
 1194|  68.1k|  auto pos = xmpData_->findKey(XmpKey(from));
 1195|  68.1k|  if (pos == xmpData_->end())
  ------------------
  |  Branch (1195:7): [True: 66.7k, False: 1.34k]
  ------------------
 1196|  66.7k|    return;
 1197|  1.34k|  if (!prepareIptcTarget(to))
  ------------------
  |  Branch (1197:7): [True: 0, False: 1.34k]
  ------------------
 1198|      0|    return;
 1199|       |
 1200|  1.34k|  if (pos->typeId() == langAlt || pos->typeId() == xmpText) {
  ------------------
  |  Branch (1200:7): [True: 411, False: 935]
  |  Branch (1200:35): [True: 671, False: 264]
  ------------------
 1201|  1.08k|    std::string value;
 1202|  1.08k|    if (!getTextValue(value, pos)) {
  ------------------
  |  Branch (1202:9): [True: 227, False: 855]
  ------------------
 1203|    227|#ifndef SUPPRESS_WARNINGS
 1204|    227|      EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
  ------------------
  |  |  138|    227|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 227]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    227|  LogMsg(LogMsg::warn).os()
  ------------------
 1205|    227|#endif
 1206|    227|      return;
 1207|    227|    }
 1208|    855|    (*iptcData_)[to] = value;
 1209|    855|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1210|    855|    if (erase_)
  ------------------
  |  Branch (1210:9): [True: 0, False: 855]
  ------------------
 1211|      0|      xmpData_->erase(pos);
 1212|    855|    return;
 1213|  1.08k|  }
 1214|       |
 1215|    264|  size_t count = pos->count();
 1216|    264|  bool added = false;
 1217|  6.45k|  for (size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (1217:22): [True: 6.19k, False: 264]
  ------------------
 1218|  6.19k|    std::string value = pos->toString(i);
 1219|  6.19k|    if (!pos->value().ok()) {
  ------------------
  |  Branch (1219:9): [True: 0, False: 6.19k]
  ------------------
 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|  6.19k|    IptcKey key(to);
 1226|  6.19k|    Iptcdatum id(key);
 1227|  6.19k|    id.setValue(value);
 1228|  6.19k|    iptcData_->add(id);
 1229|  6.19k|    added = true;
 1230|  6.19k|  }
 1231|    264|  if (added)
  ------------------
  |  Branch (1231:7): [True: 251, False: 13]
  ------------------
 1232|    251|    (*iptcData_)["Iptc.Envelope.CharacterSet"] = "\033%G";  // indicate UTF-8 encoding
 1233|    264|  if (erase_)
  ------------------
  |  Branch (1233:7): [True: 0, False: 264]
  ------------------
 1234|      0|    xmpData_->erase(pos);
 1235|    264|}
_ZN5Exiv213copyExifToXmpERKNS_8ExifDataERNS_7XmpDataE:
 1316|  2.88k|void copyExifToXmp(const ExifData& exifData, XmpData& xmpData) {
 1317|       |  /// \todo the const_cast is "lying". We are modifying the input data. Check if this might have any bad side
 1318|       |  /// effect
 1319|  2.88k|  Converter converter(const_cast<ExifData&>(exifData), xmpData);
 1320|  2.88k|  converter.cnvToXmp();
 1321|  2.88k|}
_ZN5Exiv213copyXmpToExifERKNS_7XmpDataERNS_8ExifDataE:
 1330|  3.09k|void copyXmpToExif(const XmpData& xmpData, ExifData& exifData) {
 1331|  3.09k|  Converter converter(exifData, const_cast<XmpData&>(xmpData));
 1332|  3.09k|  converter.cnvFromXmp();
 1333|  3.09k|}
_ZN5Exiv213copyIptcToXmpERKNS_8IptcDataERNS_7XmpDataEPKc:
 1347|  2.79k|void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char* iptcCharset) {
 1348|  2.79k|  if (!iptcCharset)
  ------------------
  |  Branch (1348:7): [True: 2.79k, False: 0]
  ------------------
 1349|  2.79k|    iptcCharset = iptcData.detectCharset();
 1350|  2.79k|  if (!iptcCharset)
  ------------------
  |  Branch (1350:7): [True: 0, False: 2.79k]
  ------------------
 1351|      0|    iptcCharset = "ISO-8859-1";
 1352|       |
 1353|  2.79k|  Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
 1354|  2.79k|  converter.cnvToXmp();
 1355|  2.79k|}
_ZN5Exiv213copyXmpToIptcERKNS_7XmpDataERNS_8IptcDataE:
 1368|  3.09k|void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData) {
 1369|  3.09k|  Converter converter(iptcData, const_cast<XmpData&>(xmpData));
 1370|  3.09k|  converter.cnvFromXmp();
 1371|  3.09k|}
_ZN5Exiv220convertStringCharsetERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPKcS9_:
 1380|  14.4k|bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
 1381|  14.4k|  if (0 == strcmp(from, to))
  ------------------
  |  Branch (1381:7): [True: 4.53k, False: 9.89k]
  ------------------
 1382|  4.53k|    return true;  // nothing to do
 1383|  9.89k|#ifdef EXV_HAVE_ICONV
 1384|  9.89k|  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|  14.4k|}
convert.cpp:_ZN12_GLOBAL__N_125convertStringCharsetIconvERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_17basic_string_viewIcS3_EES9_:
 1402|  9.89k|bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
 1403|  9.89k|  if (from == to)
  ------------------
  |  Branch (1403:7): [True: 0, False: 9.89k]
  ------------------
 1404|      0|    return true;  // nothing to do
 1405|       |
 1406|  9.89k|  bool ret = true;
 1407|  9.89k|  auto cd = iconv_open(to.data(), from.data());
 1408|  9.89k|  if (cd == iconv_t(-1)) {
  ------------------
  |  Branch (1408:7): [True: 0, False: 9.89k]
  ------------------
 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|  9.89k|  std::string outstr;
 1415|       |#ifdef WINICONV_CONST
 1416|       |  auto inptr = (WINICONV_CONST char*)(str.c_str());
 1417|       |#else
 1418|  9.89k|  auto inptr = (EXV_ICONV_CONST char*)(str.c_str());
 1419|  9.89k|#endif
 1420|  9.89k|  size_t inbytesleft = str.length();
 1421|  31.1k|  while (inbytesleft) {
  ------------------
  |  Branch (1421:10): [True: 25.6k, False: 5.52k]
  ------------------
 1422|  25.6k|    char outbuf[256];
 1423|  25.6k|    char* outptr = outbuf;
 1424|  25.6k|    size_t outbytesleft = sizeof(outbuf);
 1425|  25.6k|    size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
 1426|  25.6k|    const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
 1427|  25.6k|    if (rc == std::numeric_limits<size_t>::max() && errno != E2BIG) {
  ------------------
  |  Branch (1427:9): [True: 20.9k, False: 4.67k]
  |  Branch (1427:53): [True: 4.36k, False: 16.6k]
  ------------------
 1428|  4.36k|#ifndef SUPPRESS_WARNINGS
 1429|  4.36k|      EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
  ------------------
  |  |  138|  4.36k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 4.36k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  4.36k|  LogMsg(LogMsg::warn).os()
  ------------------
 1430|  4.36k|#endif
 1431|  4.36k|      ret = false;
 1432|  4.36k|      break;
 1433|  4.36k|    }
 1434|  21.3k|    outstr.append(std::string(outbuf, outbytesProduced));
 1435|  21.3k|  }
 1436|       |
 1437|  9.89k|  if (cd)
  ------------------
  |  Branch (1437:7): [True: 9.89k, False: 0]
  ------------------
 1438|  9.89k|    iconv_close(cd);
 1439|       |
 1440|  9.89k|  if (ret)
  ------------------
  |  Branch (1440:7): [True: 5.52k, False: 4.36k]
  ------------------
 1441|  5.52k|    str = std::move(outstr);
 1442|  9.89k|  return ret;
 1443|  9.89k|}
convert.cpp:_ZN12_GLOBAL__N_112getTextValueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS0_11__wrap_iterIPN5Exiv28XmpdatumEEE:
 1592|  1.78k|bool getTextValue(std::string& value, XmpData::iterator pos) {
 1593|  1.78k|  if (pos->typeId() == langAlt) {
  ------------------
  |  Branch (1593:7): [True: 755, False: 1.03k]
  ------------------
 1594|       |    // get the default language entry without x-default qualifier
 1595|    755|    value = pos->toString(0);
 1596|    755|    if (!pos->value().ok() && pos->count() == 1) {
  ------------------
  |  Branch (1596:9): [True: 746, False: 9]
  |  Branch (1596:31): [True: 314, False: 432]
  ------------------
 1597|       |      // If there is no default but exactly one entry, take that
 1598|       |      // without the qualifier
 1599|    314|      value = pos->toString();
 1600|    314|      if (pos->value().ok() && value.starts_with("lang=")) {
  ------------------
  |  Branch (1600:11): [True: 314, False: 0]
  |  Branch (1600:32): [True: 314, False: 0]
  ------------------
 1601|    314|        const std::string::size_type first_space_pos = value.find_first_of(' ');
 1602|    314|        if (first_space_pos != std::string::npos) {
  ------------------
  |  Branch (1602:13): [True: 314, False: 0]
  ------------------
 1603|    314|          value = value.substr(first_space_pos + 1);
 1604|    314|        } else {
 1605|      0|          value.clear();
 1606|      0|        }
 1607|    314|      }
 1608|    314|    }
 1609|  1.03k|  } else {
 1610|  1.03k|    value = pos->toString();
 1611|  1.03k|  }
 1612|  1.78k|  return pos->value().ok();
 1613|  1.78k|}

_ZN5Exiv28Internal9Cr2HeaderC2ENS_9ByteOrderE:
   14|  64.1k|Cr2Header::Cr2Header(ByteOrder byteOrder) : TiffHeaderBase(42, 16, byteOrder, 0x00000010) {
   15|  64.1k|}
_ZN5Exiv28Internal9Cr2Header4readEPKhm:
   17|  64.1k|bool Cr2Header::read(const byte* pData, size_t size) {
   18|  64.1k|  if (!pData || size < 16) {
  ------------------
  |  Branch (18:7): [True: 0, False: 64.1k]
  |  Branch (18:17): [True: 0, False: 64.1k]
  ------------------
   19|      0|    return false;
   20|      0|  }
   21|       |
   22|  64.1k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (22:7): [True: 3.85k, False: 60.2k]
  |  Branch (22:26): [True: 3.71k, False: 132]
  ------------------
   23|  3.71k|    setByteOrder(littleEndian);
   24|  60.4k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (24:14): [True: 24.7k, False: 35.6k]
  |  Branch (24:33): [True: 24.6k, False: 102]
  ------------------
   25|  24.6k|    setByteOrder(bigEndian);
   26|  35.7k|  } else {
   27|  35.7k|    return false;
   28|  35.7k|  }
   29|  28.3k|  if (tag() != getUShort(pData + 2, byteOrder()))
  ------------------
  |  Branch (29:7): [True: 16.9k, False: 11.4k]
  ------------------
   30|  16.9k|    return false;
   31|  11.4k|  setOffset(getULong(pData + 4, byteOrder()));
   32|  11.4k|  if (!std::equal(cr2sig_, cr2sig_ + 4, pData + 8))
  ------------------
  |  Branch (32:7): [True: 9.17k, False: 2.26k]
  ------------------
   33|  9.17k|    return false;
   34|  2.26k|  offset2_ = getULong(pData + 12, byteOrder());
   35|       |
   36|  2.26k|  return true;
   37|  11.4k|}
_ZNK5Exiv28Internal9Cr2Header5writeEv:
   39|    151|DataBuf Cr2Header::write() const {
   40|    151|  DataBuf buf(16);
   41|    151|  switch (byteOrder()) {
   42|     82|    case littleEndian:
  ------------------
  |  Branch (42:5): [True: 82, False: 69]
  ------------------
   43|     82|      buf.write_uint8(0, 'I');
   44|     82|      break;
   45|     69|    case bigEndian:
  ------------------
  |  Branch (45:5): [True: 69, False: 82]
  ------------------
   46|     69|      buf.write_uint8(0, 'M');
   47|     69|      break;
   48|      0|    default:
  ------------------
  |  Branch (48:5): [True: 0, False: 151]
  ------------------
   49|      0|      break;
   50|    151|  }
   51|    151|  buf.write_uint8(1, buf.read_uint8(0));
   52|       |
   53|    151|  buf.write_uint16(2, tag(), byteOrder());
   54|    151|  buf.write_uint32(4, 0x00000010, byteOrder());
   55|    151|  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|    151|  buf.write_uint32(12, 0x00000000, byteOrder());
   58|    151|  return buf;
   59|    151|}  // Cr2Header::write
_ZNK5Exiv28Internal9Cr2Header10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
   61|  34.0k|bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& /*pPrimaryGroups*/) const {
   62|       |  // CR2 image tags are all IFD2 and IFD3 tags
   63|  34.0k|  if (group == IfdId::ifd2Id || group == IfdId::ifd3Id)
  ------------------
  |  Branch (63:7): [True: 569, False: 33.4k]
  |  Branch (63:33): [True: 420, False: 33.0k]
  ------------------
   64|    989|    return true;
   65|       |  // ...and any (IFD0) tag that is in the TIFF image tags list
   66|  33.0k|  return isTiffImageTag(tag, group);
   67|  34.0k|}

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

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

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

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

_ZNK5Exiv28Internal13CiffComponent5pDataEv:
  213|  10.4k|  [[nodiscard]] const byte* pData() const {
  214|  10.4k|    return pData_;
  215|  10.4k|  }
_ZNK5Exiv28Internal13CiffComponent4sizeEv:
  203|  8.34k|  [[nodiscard]] size_t size() const {
  204|  8.34k|    return size_;
  205|  8.34k|  }
_ZN5Exiv28Internal10CiffHeader9signatureEv:
  418|  29.5k|  static auto signature() {
  419|  29.5k|    return signature_;
  420|  29.5k|  }
_ZN5Exiv28Internal13CiffComponent6setDirEt:
  146|  23.2k|  void setDir(uint16_t dir) {
  147|  23.2k|    dir_ = dir;
  148|  23.2k|  }
_ZNK5Exiv28Internal13CiffComponent3dirEv:
  183|  7.69k|  [[nodiscard]] uint16_t dir() const {
  184|  7.69k|    return dir_;
  185|  7.69k|  }
_ZNK5Exiv28Internal13CiffComponent3tagEv:
  188|  93.4k|  [[nodiscard]] uint16_t tag() const {
  189|  93.4k|    return tag_;
  190|  93.4k|  }
_ZNK5Exiv28Internal13CiffComponent6offsetEv:
  208|  4.55k|  [[nodiscard]] size_t offset() const {
  209|  4.55k|    return offset_;
  210|  4.55k|  }
_ZNK5Exiv28Internal13CiffComponent5tagIdEv:
  218|  30.0k|  [[nodiscard]] uint16_t tagId() const {
  219|  30.0k|    return tag_ & 0x3fff;
  220|  30.0k|  }
_ZNK5Exiv28Internal13CiffComponent6typeIdEv:
  223|  2.54k|  [[nodiscard]] TypeId typeId() const {
  224|  2.54k|    return typeId(tag_);
  225|  2.54k|  }
_ZNK5Exiv28Internal13CiffComponent12dataLocationEv:
  228|  40.0k|  [[nodiscard]] DataLocId dataLocation() const {
  229|  40.0k|    return dataLocation(tag_);
  230|  40.0k|  }
_ZN5Exiv28Internal13CiffComponent7setSizeEm:
  253|  1.66k|  void setSize(size_t size) {
  254|  1.66k|    size_ = size;
  255|  1.66k|  }
_ZN5Exiv28Internal13CiffComponent9setOffsetEm:
  257|  1.66k|  void setOffset(size_t offset) {
  258|  1.66k|    offset_ = offset;
  259|  1.66k|  }
_ZNK5Exiv28Internal10CiffHeader9byteOrderEv:
  444|  1.47k|  [[nodiscard]] ByteOrder byteOrder() const {
  445|  1.47k|    return byteOrder_;
  446|  1.47k|  }
_ZN5Exiv28Internal13CiffComponentC2Ev:
   71|  24.3k|  CiffComponent() = default;
_ZN5Exiv28Internal13CiffComponentD2Ev:
   75|  24.9k|  virtual ~CiffComponent() = default;

_ZN5Exiv212IptcDataSets10dataSetIdxEtt:
  377|   218k|int IptcDataSets::dataSetIdx(uint16_t number, uint16_t recordId) {
  378|   218k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (378:7): [True: 160k, False: 58.3k]
  |  Branch (378:31): [True: 52.4k, False: 107k]
  ------------------
  379|  52.4k|    return -1;
  380|   166k|  const DataSet* dataSet = records_[recordId];
  381|   166k|  int idx;
  382|  3.52M|  for (idx = 0; dataSet[idx].number_ != number; ++idx) {
  ------------------
  |  Branch (382:17): [True: 3.36M, False: 151k]
  ------------------
  383|  3.36M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (383:9): [True: 14.4k, False: 3.35M]
  ------------------
  384|  14.4k|      return -1;
  385|  3.36M|  }
  386|   151k|  return idx;
  387|   166k|}
_ZN5Exiv212IptcDataSets10dataSetIdxERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  389|  68.0k|int IptcDataSets::dataSetIdx(const std::string& dataSetName, uint16_t recordId) {
  390|  68.0k|  if (recordId != envelope && recordId != application2)
  ------------------
  |  Branch (390:7): [True: 64.1k, False: 3.90k]
  |  Branch (390:31): [True: 0, False: 64.1k]
  ------------------
  391|      0|    return -1;
  392|  68.0k|  const DataSet* dataSet = records_[recordId];
  393|  68.0k|  int idx;
  394|  1.93M|  for (idx = 0; dataSet[idx].name_ != dataSetName; ++idx) {
  ------------------
  |  Branch (394:17): [True: 1.86M, False: 68.0k]
  ------------------
  395|  1.86M|    if (dataSet[idx].number_ == 0xffff)
  ------------------
  |  Branch (395:9): [True: 0, False: 1.86M]
  ------------------
  396|      0|      return -1;
  397|  1.86M|  }
  398|  68.0k|  return idx;
  399|  68.0k|}
_ZN5Exiv212IptcDataSets11dataSetTypeEtt:
  401|  53.3k|TypeId IptcDataSets::dataSetType(uint16_t number, uint16_t recordId) {
  402|  53.3k|  int idx = dataSetIdx(number, recordId);
  403|  53.3k|  if (idx == -1)
  ------------------
  |  Branch (403:7): [True: 22.2k, False: 31.0k]
  ------------------
  404|  22.2k|    return unknownDataSet.type_;
  405|  31.0k|  return records_[recordId][idx].type_;
  406|  53.3k|}
_ZN5Exiv212IptcDataSets11dataSetNameEtt:
  408|   113k|std::string IptcDataSets::dataSetName(uint16_t number, uint16_t recordId) {
  409|   113k|  if (int idx = dataSetIdx(number, recordId); idx != -1)
  ------------------
  |  Branch (409:47): [True: 91.2k, False: 22.2k]
  ------------------
  410|  91.2k|    return records_[recordId][idx].name_;
  411|       |
  412|  22.2k|  return stringFormat("0x{:04x}", number);
  ------------------
  |  |   18|  22.2k|#define stringFormat std::format
  ------------------
  413|   113k|}
_ZN5Exiv212IptcDataSets17dataSetRepeatableEtt:
  436|  51.6k|bool IptcDataSets::dataSetRepeatable(uint16_t number, uint16_t recordId) {
  437|  51.6k|  int idx = dataSetIdx(number, recordId);
  438|  51.6k|  if (idx == -1)
  ------------------
  |  Branch (438:7): [True: 22.2k, False: 29.4k]
  ------------------
  439|  22.2k|    return unknownDataSet.repeatable_;
  440|  29.4k|  return records_[recordId][idx].repeatable_;
  441|  51.6k|}
_ZN5Exiv212IptcDataSets7dataSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  443|  68.0k|uint16_t IptcDataSets::dataSet(const std::string& dataSetName, uint16_t recordId) {
  444|  68.0k|  if (int idx = dataSetIdx(dataSetName, recordId); idx != -1) {
  ------------------
  |  Branch (444:52): [True: 68.0k, False: 0]
  ------------------
  445|       |    // dataSetIdx checks the range of recordId
  446|  68.0k|    return records_[recordId][idx].number_;
  447|  68.0k|  }
  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|   113k|std::string IptcDataSets::recordName(uint16_t recordId) {
  454|   113k|  if (recordId == envelope || recordId == application2) {
  ------------------
  |  Branch (454:7): [True: 21.7k, False: 91.7k]
  |  Branch (454:31): [True: 74.2k, False: 17.4k]
  ------------------
  455|  96.0k|    return recordInfo_[recordId].name_;
  456|  96.0k|  }
  457|       |
  458|  17.4k|  return stringFormat("0x{:04x}", recordId);
  ------------------
  |  |   18|  17.4k|#define stringFormat std::format
  ------------------
  459|   113k|}
_ZN5Exiv212IptcDataSets8recordIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  468|  68.0k|uint16_t IptcDataSets::recordId(const std::string& recordName) {
  469|  68.0k|  uint16_t i;
  470|  71.9k|  for (i = IptcDataSets::application2; i > 0; --i) {
  ------------------
  |  Branch (470:40): [True: 71.9k, False: 0]
  ------------------
  471|  71.9k|    if (recordInfo_[i].name_ == recordName)
  ------------------
  |  Branch (471:9): [True: 68.0k, False: 3.90k]
  ------------------
  472|  68.0k|      break;
  473|  71.9k|  }
  474|  68.0k|  if (i == 0) {
  ------------------
  |  Branch (474:7): [True: 0, False: 68.0k]
  ------------------
  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|  68.0k|  return i;
  480|  68.0k|}
_ZN5Exiv27IptcKeyC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  490|  68.0k|IptcKey::IptcKey(std::string key) : tag_(0), record_(0), key_(std::move(key)) {
  491|  68.0k|  decomposeKey();
  492|  68.0k|}
_ZN5Exiv27IptcKeyC2Ett:
  494|  45.4k|IptcKey::IptcKey(uint16_t tag, uint16_t record) : tag_(tag), record_(record) {
  495|  45.4k|  makeKey();
  496|  45.4k|}
_ZNK5Exiv27IptcKey3keyEv:
  498|  7.77k|std::string IptcKey::key() const {
  499|  7.77k|  return key_;
  500|  7.77k|}
_ZNK5Exiv27IptcKey3tagEv:
  522|   464k|uint16_t IptcKey::tag() const {
  523|   464k|  return tag_;
  524|   464k|}
_ZNK5Exiv27IptcKey6recordEv:
  530|   801k|uint16_t IptcKey::record() const {
  531|   801k|  return record_;
  532|   801k|}
_ZNK5Exiv27IptcKey5cloneEv:
  534|   532k|IptcKey::UniquePtr IptcKey::clone() const {
  535|   532k|  return UniquePtr(clone_());
  536|   532k|}
_ZNK5Exiv27IptcKey6clone_Ev:
  538|   532k|IptcKey* IptcKey::clone_() const {
  539|   532k|  return new IptcKey(*this);
  540|   532k|}
_ZN5Exiv27IptcKey12decomposeKeyEv:
  542|  68.0k|void IptcKey::decomposeKey() {
  543|       |  // Check that the key has the expected format with RE
  544|  68.0k|  auto posDot1 = key_.find('.');
  545|  68.0k|  auto posDot2 = key_.find('.', posDot1 + 1);
  546|       |
  547|  68.0k|  if (posDot1 == std::string::npos || posDot2 == std::string::npos) {
  ------------------
  |  Branch (547:7): [True: 0, False: 68.0k]
  |  Branch (547:39): [True: 0, False: 68.0k]
  ------------------
  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|  68.0k|  const std::string familyName = key_.substr(0, posDot1);
  553|  68.0k|  if (familyName != familyName_)
  ------------------
  |  Branch (553:7): [True: 0, False: 68.0k]
  ------------------
  554|      0|    throw Error(ErrorCode::kerInvalidKey, key_);
  555|       |
  556|  68.0k|  std::string recordName = key_.substr(posDot1 + 1, posDot2 - posDot1 - 1);
  557|  68.0k|  std::string dataSetName = key_.substr(posDot2 + 1);
  558|       |
  559|       |  // Use the parts of the key to find dataSet and recordId
  560|  68.0k|  uint16_t recId = IptcDataSets::recordId(recordName);
  561|  68.0k|  uint16_t dataSet = IptcDataSets::dataSet(dataSetName, recId);
  562|       |
  563|       |  // Possibly translate hex name parts (0xabcd) to real names
  564|  68.0k|  recordName = IptcDataSets::recordName(recId);
  565|  68.0k|  dataSetName = IptcDataSets::dataSetName(dataSet, recId);
  566|       |
  567|  68.0k|  tag_ = dataSet;
  568|  68.0k|  record_ = recId;
  569|  68.0k|  key_ = familyName + "." + recordName + "." + dataSetName;
  570|  68.0k|}
_ZN5Exiv27IptcKey7makeKeyEv:
  572|  45.4k|void IptcKey::makeKey() {
  573|  45.4k|  key_ = std::string(familyName_) + "." + IptcDataSets::recordName(record_) + "." +
  574|  45.4k|         IptcDataSets::dataSetName(tag_, record_);
  575|  45.4k|}

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

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

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

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

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

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

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

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

_ZN5Exiv29IptcdatumC2ERKNS_7IptcKeyEPKNS_5ValueE:
   56|  53.3k|Iptcdatum::Iptcdatum(const IptcKey& key, const Value* pValue) : key_(key.clone()) {
   57|  53.3k|  if (pValue)
  ------------------
  |  Branch (57:7): [True: 45.4k, False: 7.88k]
  ------------------
   58|  45.4k|    value_ = pValue->clone();
   59|  53.3k|}
_ZN5Exiv29IptcdatumC2ERKS0_:
   61|   294k|Iptcdatum::Iptcdatum(const Iptcdatum& rhs) {
   62|   294k|  if (rhs.key_)
  ------------------
  |  Branch (62:7): [True: 294k, False: 0]
  ------------------
   63|   294k|    key_ = rhs.key_->clone();  // deep copy
   64|   294k|  if (rhs.value_)
  ------------------
  |  Branch (64:7): [True: 294k, False: 0]
  ------------------
   65|   294k|    value_ = rhs.value_->clone();  // deep copy
   66|   294k|}
_ZN5Exiv29IptcdatumD2Ev:
   68|   348k|Iptcdatum::~Iptcdatum() = default;
_ZNK5Exiv29Iptcdatum3keyEv:
   78|  7.77k|std::string Iptcdatum::key() const {
   79|  7.77k|  return key_ ? key_->key() : "";
  ------------------
  |  Branch (79:10): [True: 7.77k, False: 0]
  ------------------
   80|  7.77k|}
_ZNK5Exiv29Iptcdatum6recordEv:
   86|   739k|uint16_t Iptcdatum::record() const {
   87|   739k|  return key_ ? key_->record() : 0;
  ------------------
  |  Branch (87:10): [True: 739k, False: 0]
  ------------------
   88|   739k|}
_ZNK5Exiv29Iptcdatum3tagEv:
  110|   402k|uint16_t Iptcdatum::tag() const {
  111|   402k|  return key_ ? key_->tag() : 0;
  ------------------
  |  Branch (111:10): [True: 402k, False: 0]
  ------------------
  112|   402k|}
_ZNK5Exiv29Iptcdatum4sizeEv:
  130|   104k|size_t Iptcdatum::size() const {
  131|   104k|  return value_ ? value_->size() : 0;
  ------------------
  |  Branch (131:10): [True: 104k, False: 0]
  ------------------
  132|   104k|}
_ZNK5Exiv29Iptcdatum8toStringEv:
  134|  5.27k|std::string Iptcdatum::toString() const {
  135|  5.27k|  return value_ ? value_->toString() : "";
  ------------------
  |  Branch (135:10): [True: 5.27k, False: 0]
  ------------------
  136|  5.27k|}
_ZNK5Exiv29Iptcdatum5valueEv:
  158|  57.4k|const Value& Iptcdatum::value() const {
  159|  57.4k|  if (!value_)
  ------------------
  |  Branch (159:7): [True: 0, False: 57.4k]
  ------------------
  160|      0|    throw Error(ErrorCode::kerValueNotSet, key());
  161|  57.4k|  return *value_;
  162|  57.4k|}
_ZN5Exiv29IptcdatumaSERKS0_:
  164|   184k|Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) {
  165|   184k|  if (this == &rhs)
  ------------------
  |  Branch (165:7): [True: 0, False: 184k]
  ------------------
  166|      0|    return *this;
  167|       |
  168|   184k|  key_.reset();
  169|   184k|  if (rhs.key_)
  ------------------
  |  Branch (169:7): [True: 184k, False: 0]
  ------------------
  170|   184k|    key_ = rhs.key_->clone();  // deep copy
  171|       |
  172|   184k|  value_.reset();
  173|   184k|  if (rhs.value_)
  ------------------
  |  Branch (173:7): [True: 184k, False: 0]
  ------------------
  174|   184k|    value_ = rhs.value_->clone();  // deep copy
  175|       |
  176|   184k|  return *this;
  177|   184k|}  // Iptcdatum::operator=
_ZN5Exiv29IptcdatumaSERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  186|  1.96k|Iptcdatum& Iptcdatum::operator=(const std::string& value) {
  187|  1.96k|  setValue(value);
  188|  1.96k|  return *this;
  189|  1.96k|}
_ZN5Exiv29Iptcdatum8setValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  202|  8.15k|int Iptcdatum::setValue(const std::string& value) {
  203|  8.15k|  if (!value_) {
  ------------------
  |  Branch (203:7): [True: 7.88k, False: 272]
  ------------------
  204|  7.88k|    TypeId type = IptcDataSets::dataSetType(tag(), record());
  205|  7.88k|    value_ = Value::create(type);
  206|  7.88k|  }
  207|  8.15k|  return value_->read(value);
  208|  8.15k|}
_ZN5Exiv28IptcDataixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  210|  1.96k|Iptcdatum& IptcData::operator[](const std::string& key) {
  211|  1.96k|  IptcKey iptcKey(key);
  212|  1.96k|  auto pos = findKey(iptcKey);
  213|  1.96k|  if (pos == end()) {
  ------------------
  |  Branch (213:7): [True: 1.68k, False: 272]
  ------------------
  214|  1.68k|    return iptcMetadata_.emplace_back(iptcKey);
  215|  1.68k|  }
  216|    272|  return *pos;
  217|  1.96k|}
_ZNK5Exiv28IptcData4sizeEv:
  219|  1.75k|size_t IptcData::size() const {
  220|  1.75k|  size_t newSize = 0;
  221|  52.1k|  for (auto&& iptc : iptcMetadata_) {
  ------------------
  |  Branch (221:20): [True: 52.1k, False: 1.75k]
  ------------------
  222|       |    // marker, record Id, dataset num, first 2 bytes of size
  223|  52.1k|    newSize += 5;
  224|  52.1k|    size_t dataSize = iptc.size();
  225|  52.1k|    newSize += dataSize;
  226|  52.1k|    if (dataSize > 32767) {
  ------------------
  |  Branch (226:9): [True: 0, False: 52.1k]
  ------------------
  227|       |      // extended dataset (we always use 4 bytes)
  228|      0|      newSize += 4;
  229|      0|    }
  230|  52.1k|  }
  231|  1.75k|  return newSize;
  232|  1.75k|}
_ZN5Exiv28IptcData3addERKNS_7IptcKeyEPKNS_5ValueE:
  234|  45.4k|int IptcData::add(const IptcKey& key, const Value* value) {
  235|  45.4k|  return add(Iptcdatum(key, value));
  236|  45.4k|}
_ZN5Exiv28IptcData3addERKNS_9IptcdatumE:
  238|  51.6k|int IptcData::add(const Iptcdatum& iptcDatum) {
  239|  51.6k|  if (!IptcDataSets::dataSetRepeatable(iptcDatum.tag(), iptcDatum.record()) &&
  ------------------
  |  Branch (239:7): [True: 23.2k, False: 28.4k]
  |  Branch (239:7): [True: 17.9k, False: 33.7k]
  ------------------
  240|  23.2k|      findId(iptcDatum.tag(), iptcDatum.record()) != end()) {
  ------------------
  |  Branch (240:7): [True: 17.9k, False: 5.31k]
  ------------------
  241|  17.9k|    return 6;
  242|  17.9k|  }
  243|       |  // allow duplicates
  244|  33.7k|  iptcMetadata_.push_back(iptcDatum);
  245|  33.7k|  return 0;
  246|  51.6k|}
_ZNK5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  248|  2.79k|IptcData::const_iterator IptcData::findKey(const IptcKey& key) const {
  249|  2.79k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  250|  2.79k|}
_ZN5Exiv28IptcData7findKeyERKNS_7IptcKeyE:
  252|  59.0k|IptcData::iterator IptcData::findKey(const IptcKey& key) {
  253|  59.0k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(key.tag(), key.record()));
  254|  59.0k|}
_ZN5Exiv28IptcData6findIdEtt:
  260|  23.2k|IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record) {
  261|  23.2k|  return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(), FindIptcdatum(dataset, record));
  262|  23.2k|}
_ZNK5Exiv28IptcData13detectCharsetEv:
  304|  2.79k|const char* IptcData::detectCharset() const {
  305|  2.79k|  auto pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
  306|  2.79k|  if (pos != end()) {
  ------------------
  |  Branch (306:7): [True: 743, False: 2.05k]
  ------------------
  307|    743|    const std::string value = pos->toString();
  308|    743|    if (pos->value().ok() && value == "\033%G")
  ------------------
  |  Branch (308:9): [True: 743, False: 0]
  |  Branch (308:30): [True: 743, False: 0]
  ------------------
  309|    743|      return "UTF-8";
  310|    743|  }
  311|       |
  312|  2.05k|  bool ascii = true;
  313|  2.05k|  bool utf8 = true;
  314|       |
  315|  2.05k|  for (const auto& key : *this) {
  ------------------
  |  Branch (315:24): [True: 0, False: 2.05k]
  ------------------
  316|      0|    std::string value = key.toString();
  317|      0|    if (key.value().ok()) {
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|      int seqCount = 0;
  319|      0|      for (auto c : value) {
  ------------------
  |  Branch (319:19): [True: 0, False: 0]
  ------------------
  320|      0|        if (seqCount) {
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  ------------------
  321|      0|          if ((c & 0xc0) != 0x80) {
  ------------------
  |  Branch (321:15): [True: 0, False: 0]
  ------------------
  322|      0|            utf8 = false;
  323|      0|            break;
  324|      0|          }
  325|      0|          --seqCount;
  326|      0|        } else {
  327|      0|          if (c & 0x80)
  ------------------
  |  Branch (327:15): [True: 0, False: 0]
  ------------------
  328|      0|            ascii = false;
  329|      0|          else
  330|      0|            continue;  // ascii character
  331|       |
  332|      0|          if ((c & 0xe0) == 0xc0)
  ------------------
  |  Branch (332:15): [True: 0, False: 0]
  ------------------
  333|      0|            seqCount = 1;
  334|      0|          else if ((c & 0xf0) == 0xe0)
  ------------------
  |  Branch (334:20): [True: 0, False: 0]
  ------------------
  335|      0|            seqCount = 2;
  336|      0|          else if ((c & 0xf8) == 0xf0)
  ------------------
  |  Branch (336:20): [True: 0, False: 0]
  ------------------
  337|      0|            seqCount = 3;
  338|      0|          else if ((c & 0xfc) == 0xf8)
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      0|            seqCount = 4;
  340|      0|          else if ((c & 0xfe) == 0xfc)
  ------------------
  |  Branch (340:20): [True: 0, False: 0]
  ------------------
  341|      0|            seqCount = 5;
  342|      0|          else {
  343|      0|            utf8 = false;
  344|      0|            break;
  345|      0|          }
  346|      0|        }
  347|      0|      }
  348|      0|      if (seqCount)
  ------------------
  |  Branch (348:11): [True: 0, False: 0]
  ------------------
  349|      0|        utf8 = false;  // unterminated seq
  350|      0|      if (!utf8)
  ------------------
  |  Branch (350:11): [True: 0, False: 0]
  ------------------
  351|      0|        break;
  352|      0|    }
  353|      0|  }
  354|       |
  355|  2.05k|  if (ascii)
  ------------------
  |  Branch (355:7): [True: 2.05k, False: 0]
  ------------------
  356|  2.05k|    return "ASCII";
  357|      0|  if (utf8)
  ------------------
  |  Branch (357:7): [True: 0, False: 0]
  ------------------
  358|      0|    return "UTF-8";
  359|      0|  return nullptr;
  360|      0|}
_ZN5Exiv210IptcParser6decodeERNS_8IptcDataEPKhm:
  362|  3.45k|int IptcParser::decode(IptcData& iptcData, const byte* pData, size_t size) {
  363|       |#ifdef EXIV2_DEBUG_MESSAGES
  364|       |  std::cerr << "IptcParser::decode, size = " << size << "\n";
  365|       |#endif
  366|  3.45k|  auto pRead = pData;
  367|  3.45k|  const auto pEnd = pData + size;
  368|  3.45k|  iptcData.clear();
  369|       |
  370|  3.45k|  uint16_t record = 0;
  371|  3.45k|  uint16_t dataSet = 0;
  372|  3.45k|  uint32_t sizeData = 0;
  373|  3.45k|  byte extTest = 0;
  374|       |
  375|  1.94M|  while (6 <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (375:10): [True: 1.94M, False: 1.99k]
  ------------------
  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.94M|    if (*pRead++ != marker_)
  ------------------
  |  Branch (379:9): [True: 1.89M, False: 46.9k]
  ------------------
  380|  1.89M|      continue;
  381|  46.9k|    record = *pRead++;
  382|  46.9k|    dataSet = *pRead++;
  383|       |
  384|  46.9k|    extTest = *pRead;
  385|  46.9k|    if (extTest & 0x80) {
  ------------------
  |  Branch (385:9): [True: 2.43k, False: 44.5k]
  ------------------
  386|       |      // extended dataset
  387|  2.43k|      uint16_t sizeOfSize = (getUShort(pRead, bigEndian) & 0x7FFF);
  388|  2.43k|      if (sizeOfSize > 4)
  ------------------
  |  Branch (388:11): [True: 416, False: 2.01k]
  ------------------
  389|    416|        return 5;
  390|  2.01k|      pRead += 2;
  391|  2.01k|      if (sizeOfSize > pEnd - pRead)
  ------------------
  |  Branch (391:11): [True: 18, False: 2.00k]
  ------------------
  392|     18|        return 6;
  393|  2.00k|      sizeData = 0;
  394|  4.65k|      for (; sizeOfSize > 0; --sizeOfSize) {
  ------------------
  |  Branch (394:14): [True: 2.65k, False: 2.00k]
  ------------------
  395|  2.65k|        sizeData |= *pRead++ << (8 * (sizeOfSize - 1));
  396|  2.65k|      }
  397|  44.5k|    } else {
  398|       |      // standard dataset
  399|  44.5k|      sizeData = getUShort(pRead, bigEndian);
  400|  44.5k|      pRead += 2;
  401|  44.5k|    }
  402|  46.5k|    if (sizeData <= static_cast<size_t>(pEnd - pRead)) {
  ------------------
  |  Branch (402:9): [True: 45.4k, False: 1.02k]
  ------------------
  403|  45.4k|      int rc = readData(iptcData, dataSet, record, pRead, sizeData);
  404|  45.4k|      if (rc != 0) {
  ------------------
  |  Branch (404:11): [True: 0, False: 45.4k]
  ------------------
  405|      0|#ifndef SUPPRESS_WARNINGS
  406|      0|        EXV_WARNING << "Failed to read IPTC dataset " << IptcKey(dataSet, record) << " (rc = " << rc << "); skipped.\n";
  ------------------
  |  |  138|      0|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 0]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|      0|  LogMsg(LogMsg::warn).os()
  ------------------
  407|      0|#endif
  408|      0|      }
  409|  45.4k|    } else {
  410|  1.02k|#ifndef SUPPRESS_WARNINGS
  411|  1.02k|      EXV_WARNING << "IPTC dataset " << IptcKey(dataSet, record) << " has invalid size " << sizeData << "; skipped.\n";
  ------------------
  |  |  138|  1.02k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.02k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.02k|  LogMsg(LogMsg::warn).os()
  ------------------
  412|  1.02k|#endif
  413|  1.02k|      return 7;
  414|  1.02k|    }
  415|  45.4k|    pRead += sizeData;
  416|  45.4k|  }
  417|       |
  418|  1.99k|  return 0;
  419|  3.45k|}  // IptcParser::decode
_ZN5Exiv210IptcParser6encodeERKNS_8IptcDataE:
  421|  25.7k|DataBuf IptcParser::encode(const IptcData& iptcData) {
  422|  25.7k|  DataBuf buf;
  423|  25.7k|  if (iptcData.empty())
  ------------------
  |  Branch (423:7): [True: 23.9k, False: 1.75k]
  ------------------
  424|  23.9k|    return buf;
  425|       |
  426|  1.75k|  buf = DataBuf(iptcData.size());
  427|  1.75k|  byte* pWrite = buf.data();
  428|       |
  429|       |  // Copy the iptc data sets and sort them by record but preserve the order of datasets
  430|  1.75k|  IptcMetadata sortedIptcData(iptcData.begin(), iptcData.end());
  431|  1.75k|  std::stable_sort(sortedIptcData.begin(), sortedIptcData.end(),
  432|  1.75k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });
  433|       |
  434|  52.1k|  for (const auto& iter : sortedIptcData) {
  ------------------
  |  Branch (434:25): [True: 52.1k, False: 1.75k]
  ------------------
  435|       |    // marker, record Id, dataset num
  436|  52.1k|    *pWrite++ = marker_;
  437|  52.1k|    *pWrite++ = static_cast<byte>(iter.record());
  438|  52.1k|    *pWrite++ = static_cast<byte>(iter.tag());
  439|       |
  440|       |    // extended or standard dataset?
  441|  52.1k|    if (size_t dataSize = iter.size(); dataSize > 32767) {
  ------------------
  |  Branch (441:40): [True: 0, False: 52.1k]
  ------------------
  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|  52.1k|    } else {
  449|  52.1k|      us2Data(pWrite, static_cast<uint16_t>(dataSize), bigEndian);
  450|  52.1k|      pWrite += 2;
  451|  52.1k|    }
  452|  52.1k|    pWrite += iter.value().copy(pWrite, bigEndian);
  453|  52.1k|  }
  454|       |
  455|  1.75k|  return buf;
  456|  25.7k|}  // IptcParser::encode
iptc.cpp:_ZNK12_GLOBAL__N_113FindIptcdatumclERKN5Exiv29IptcdatumE:
   41|   267k|  bool operator()(const Exiv2::Iptcdatum& iptcdatum) const {
   42|   267k|    return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
  ------------------
  |  Branch (42:12): [True: 28.2k, False: 239k]
  |  Branch (42:43): [True: 19.4k, False: 8.87k]
  ------------------
   43|   267k|  }
iptc.cpp:_ZN12_GLOBAL__N_113FindIptcdatumC2Ett:
   35|  85.1k|  FindIptcdatum(uint16_t dataset, uint16_t record) : dataset_(dataset), record_(record) {
   36|  85.1k|  }
iptc.cpp:_ZN12_GLOBAL__N_18readDataERN5Exiv28IptcDataEttPKhj:
  463|  45.4k|int readData(Exiv2::IptcData& iptcData, uint16_t dataSet, uint16_t record, const Exiv2::byte* data, uint32_t sizeData) {
  464|  45.4k|  Exiv2::TypeId type = Exiv2::IptcDataSets::dataSetType(dataSet, record);
  465|  45.4k|  auto value = Exiv2::Value::create(type);
  466|  45.4k|  int rc = value->read(data, sizeData, Exiv2::bigEndian);
  467|  45.4k|  if (0 == rc) {
  ------------------
  |  Branch (467:7): [True: 31.2k, False: 14.2k]
  ------------------
  468|  31.2k|    Exiv2::IptcKey key(dataSet, record);
  469|  31.2k|    iptcData.add(key, value.get());
  470|  31.2k|  } else if (1 == rc) {
  ------------------
  |  Branch (470:14): [True: 14.2k, False: 0]
  ------------------
  471|       |    // If the first attempt failed, try with a string value
  472|  14.2k|    value = Exiv2::Value::create(Exiv2::string);
  473|  14.2k|    rc = value->read(data, sizeData, Exiv2::bigEndian);
  474|  14.2k|    if (0 == rc) {
  ------------------
  |  Branch (474:9): [True: 14.2k, False: 0]
  ------------------
  475|  14.2k|      Exiv2::IptcKey key(dataSet, record);
  476|  14.2k|      iptcData.add(key, value.get());
  477|  14.2k|    }
  478|  14.2k|  }
  479|  45.4k|  return rc;
  480|  45.4k|}
iptc.cpp:_ZZN5Exiv210IptcParser6encodeERKNS_8IptcDataEENK3$_0clINS_9IptcdatumES6_EEDaRKT_RKT0_:
  432|   288k|                   [](const auto& l, const auto& r) { return l.record() < r.record(); });

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

_ZN5Exiv28Internal18isValidBoxFileTypeERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
   13|    201|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|    201|  if (boxData.size() < 8 || ((boxData.size() - 8u) % 4u) != 0) {
  ------------------
  |  Branch (15:7): [True: 21, False: 180]
  |  Branch (15:29): [True: 21, False: 159]
  ------------------
   16|     42|    return false;
   17|     42|  }
   18|       |
   19|    159|  const size_t N = (boxData.size() - 8u) / 4u;
   20|    159|  const uint32_t brand = getULong(boxData.data(), bigEndian);
   21|    159|  const uint32_t minorVersion = getULong(boxData.data() + 4, bigEndian);
   22|       |
   23|    159|  bool clWithRightBrand = false;
   24|  1.76k|  for (size_t i = 0; i < N; i++) {
  ------------------
  |  Branch (24:22): [True: 1.63k, False: 130]
  ------------------
   25|  1.63k|    uint32_t compatibilityList = getULong(boxData.data() + 8 + (i * 4), bigEndian);
   26|  1.63k|    if ((brand == brandJp2 && compatibilityList == brandJp2) || (brand == brandJph && compatibilityList == brandJph)) {
  ------------------
  |  Branch (26:10): [True: 483, False: 1.15k]
  |  Branch (26:31): [True: 22, False: 461]
  |  Branch (26:66): [True: 291, False: 1.32k]
  |  Branch (26:87): [True: 7, False: 284]
  ------------------
   27|     29|      clWithRightBrand = true;
   28|     29|      break;
   29|     29|    }
   30|  1.63k|  }
   31|    159|  return (minorVersion == 0 && clWithRightBrand);
  ------------------
  |  Branch (31:11): [True: 43, False: 116]
  |  Branch (31:32): [True: 19, False: 24]
  ------------------
   32|    201|}

_ZN5Exiv28JpegBaseC2ENS_9ImageTypeENSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEERKNS_15ImageCtorParamsEPKhm:
  117|  3.02k|    Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
  118|  3.02k|  if (params.create()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 3.02k]
  ------------------
  119|      0|    initImage(initData, dataSize);
  120|      0|  }
  121|  3.02k|}
_ZNK5Exiv28JpegBase15advanceToMarkerENS_9ErrorCodeE:
  134|  4.06M|byte JpegBase::advanceToMarker(ErrorCode err) const {
  135|  4.06M|  int c = -1;
  136|       |  // Skips potential padding between markers
  137|  8.13M|  while ((c = io_->getb()) != 0xff) {
  ------------------
  |  Branch (137:10): [True: 4.07M, False: 4.06M]
  ------------------
  138|  4.07M|    if (c == EOF)
  ------------------
  |  Branch (138:9): [True: 1.69k, False: 4.07M]
  ------------------
  139|  1.69k|      throw Error(err);
  140|  4.07M|  }
  141|       |
  142|       |  // Markers can start with any number of 0xff
  143|  4.71M|  while ((c = io_->getb()) == 0xff) {
  ------------------
  |  Branch (143:10): [True: 648k, False: 4.06M]
  ------------------
  144|   648k|  }
  145|  4.06M|  if (c == EOF)
  ------------------
  |  Branch (145:7): [True: 154, False: 4.06M]
  ------------------
  146|    154|    throw Error(err);
  147|       |
  148|  4.06M|  return static_cast<byte>(c);
  149|  4.06M|}
_ZN5Exiv28JpegBase12readMetadataEv:
  151|  3.02k|void JpegBase::readMetadata() {
  152|  3.02k|  int rc = 0;  // Todo: this should be the return value
  153|       |
  154|  3.02k|  if (io_->open() != 0)
  ------------------
  |  Branch (154:7): [True: 0, False: 3.02k]
  ------------------
  155|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  156|  3.02k|  IoCloser closer(*io_);
  157|       |  // Ensure that this is the correct image type
  158|  3.02k|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (158:7): [True: 409, False: 2.62k]
  ------------------
  159|    409|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (159:9): [True: 0, False: 409]
  |  Branch (159:25): [True: 0, False: 409]
  ------------------
  160|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  161|    409|    throw Error(ErrorCode::kerNotAJpeg);
  162|    409|  }
  163|  2.62k|  clearMetadata();
  164|  2.62k|  int search = 6;  // Exif, ICC, XMP, Comment, IPTC, SOF
  165|  2.62k|  Blob psBlob;
  166|  2.62k|  bool foundCompletePsData = false;
  167|  2.62k|  bool foundExifData = false;
  168|  2.62k|  bool foundXmpData = false;
  169|  2.62k|  bool foundIccData = false;
  170|       |
  171|       |  // Read section marker
  172|  2.62k|  byte marker = advanceToMarker(ErrorCode::kerNotAJpeg);
  173|       |
  174|   634k|  while (marker != sos_ && marker != eoi_ && search > 0) {
  ------------------
  |  Branch (174:10): [True: 634k, False: 288]
  |  Branch (174:28): [True: 634k, False: 252]
  |  Branch (174:46): [True: 634k, False: 14]
  ------------------
  175|   634k|    const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  176|       |
  177|       |    // Read the rest of the segment.
  178|   634k|    DataBuf buf(size);
  179|       |    // check if the segment is not empty
  180|   634k|    if (size > 2) {
  ------------------
  |  Branch (180:9): [True: 61.3k, False: 572k]
  ------------------
  181|  61.3k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  182|  61.3k|      std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  183|  61.3k|    }
  184|       |
  185|   634k|    if (auto itSofMarker = Exiv2::find(jpegProcessMarkerTags, marker)) {
  ------------------
  |  Branch (185:14): [True: 4.54k, False: 629k]
  ------------------
  186|  4.54k|      sof_encoding_process_ = itSofMarker->label_;
  187|  4.54k|      if (size >= 7 && buf.c_data(7)) {
  ------------------
  |  Branch (187:11): [True: 2.48k, False: 2.05k]
  |  Branch (187:24): [True: 2.16k, False: 326]
  ------------------
  188|  2.16k|        num_color_components_ = *buf.c_data(7);
  189|  2.16k|      }
  190|  4.54k|    }
  191|       |
  192|   634k|    if (!foundExifData && marker == app1_ && size >= 8  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (192:9): [True: 633k, False: 869]
  |  Branch (192:27): [True: 2.24k, False: 631k]
  |  Branch (192:46): [True: 1.67k, False: 572]
  ------------------
  193|  1.67k|        && buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (193:12): [True: 191, False: 1.48k]
  ------------------
  194|    191|      const DecodeParams dp(max_recursion_depth_);
  195|    191|      ByteOrder bo = ExifParser::decode(exifData_, buf.c_data(8), size - 8, dp);
  196|    191|      setByteOrder(bo);
  197|    191|      if (size > 8 && byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (197:11): [True: 137, False: 54]
  |  Branch (197:23): [True: 0, False: 137]
  ------------------
  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|    191|      --search;
  204|    191|      foundExifData = true;
  205|   634k|    } else if (!foundXmpData && marker == app1_ && size >= 31  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (205:16): [True: 633k, False: 847]
  |  Branch (205:33): [True: 2.07k, False: 631k]
  |  Branch (205:52): [True: 1.22k, False: 856]
  ------------------
  206|  1.22k|               && buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (206:19): [True: 72, False: 1.14k]
  ------------------
  207|     72|      xmpPacket_.assign(buf.c_str(31), size - 31);
  208|     72|      const DecodeParams dp(max_recursion_depth_);
  209|     72|      if (!xmpPacket_.empty() && XmpParser::decode(xmpData_, xmpPacket_, dp)) {
  ------------------
  |  Branch (209:11): [True: 60, False: 12]
  |  Branch (209:34): [True: 26, False: 34]
  ------------------
  210|     26|#ifndef SUPPRESS_WARNINGS
  211|     26|        EXV_WARNING << "Failed to decode XMP metadata.\n";
  ------------------
  |  |  138|     26|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 26]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     26|  LogMsg(LogMsg::warn).os()
  ------------------
  212|     26|#endif
  213|     26|      }
  214|     72|      --search;
  215|     72|      foundXmpData = true;
  216|   633k|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (216:16): [True: 631k, False: 2.10k]
  |  Branch (216:40): [True: 45.4k, False: 586k]
  ------------------
  217|  45.4k|               size >= 16  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (217:16): [True: 45.1k, False: 343]
  ------------------
  218|  45.1k|               && buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (218:19): [True: 27.9k, False: 17.2k]
  ------------------
  219|       |#ifdef EXIV2_DEBUG_MESSAGES
  220|       |      std::cerr << "Found app13 segment, size = " << size << "\n";
  221|       |#endif
  222|  27.9k|      if (buf.size() > 16) {  // Append to psBlob
  ------------------
  |  Branch (222:11): [True: 26.0k, False: 1.91k]
  ------------------
  223|  26.0k|        append(psBlob, buf.c_data(16), size - 16);
  224|  26.0k|      }
  225|       |      // Check whether psBlob is complete
  226|  27.9k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (226:11): [True: 27.4k, False: 425]
  |  Branch (226:30): [True: 173, False: 27.3k]
  ------------------
  227|    173|        --search;
  228|    173|        foundCompletePsData = true;
  229|    173|      }
  230|   606k|    } else if (marker == com_ && comment_.empty()) {
  ------------------
  |  Branch (230:16): [True: 886, False: 605k]
  |  Branch (230:34): [True: 374, False: 512]
  ------------------
  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|    374|      comment_.assign(buf.c_str(2), size - 2);
  235|  1.33k|      while (!comment_.empty() && comment_.back() == '\0') {
  ------------------
  |  Branch (235:14): [True: 1.10k, False: 232]
  |  Branch (235:35): [True: 962, False: 142]
  ------------------
  236|    962|        comment_.pop_back();
  237|    962|      }
  238|    374|      --search;
  239|   605k|    } else if (marker == app2_ && size >= 13  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (239:16): [True: 27.6k, False: 578k]
  |  Branch (239:35): [True: 8.97k, False: 18.6k]
  ------------------
  240|  8.97k|               && buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (240:19): [True: 7.42k, False: 1.54k]
  ------------------
  241|  7.42k|      if (size < 2 + 14 + 4) {
  ------------------
  |  Branch (241:11): [True: 119, False: 7.30k]
  ------------------
  242|    119|        rc = 8;
  243|    119|        break;
  244|    119|      }
  245|       |      // ICC profile
  246|  7.30k|      if (!foundIccData) {
  ------------------
  |  Branch (246:11): [True: 209, False: 7.09k]
  ------------------
  247|    209|        foundIccData = true;
  248|    209|        --search;
  249|    209|      }
  250|  7.30k|      auto chunk = static_cast<int>(buf.read_uint8(2 + 12));
  251|  7.30k|      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|  7.30k|      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|  7.30k|      size_t icc_size = size - 2 - 14;
  263|  7.30k|      if (chunk == 1 && chunks == 1) {
  ------------------
  |  Branch (263:11): [True: 798, False: 6.50k]
  |  Branch (263:25): [True: 318, False: 480]
  ------------------
  264|    318|        enforce(s <= static_cast<uint32_t>(icc_size), ErrorCode::kerInvalidIccProfile);
  265|    318|        icc_size = s;
  266|    318|      }
  267|       |
  268|  7.30k|      appendIccProfile(buf.c_data(2 + 14), icc_size, chunk == chunks);
  269|   598k|    } else if (pixelHeight_ == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (269:16): [True: 524k, False: 73.9k]
  |  Branch (269:37): [True: 970, False: 523k]
  ------------------
  270|       |      // We hit a SOFn (start-of-frame) marker
  271|    970|      if (size < 8) {
  ------------------
  |  Branch (271:11): [True: 168, False: 802]
  ------------------
  272|    168|        rc = 7;
  273|    168|        break;
  274|    168|      }
  275|    802|      pixelHeight_ = buf.read_uint16(3, bigEndian);
  276|    802|      pixelWidth_ = buf.read_uint16(5, bigEndian);
  277|    802|      if (pixelHeight_ != 0)
  ------------------
  |  Branch (277:11): [True: 431, False: 371]
  ------------------
  278|    431|        --search;
  279|    802|    }
  280|       |
  281|       |    // Read the beginning of the next segment
  282|   633k|    try {
  283|   633k|      marker = advanceToMarker(ErrorCode::kerFailedToReadImageData);
  284|   633k|    } catch (const Error&) {
  285|  1.14k|      rc = 5;
  286|  1.14k|      break;
  287|  1.14k|    }
  288|   633k|  }  // while there are segments to process
  289|       |
  290|  1.98k|  if (!psBlob.empty()) {
  ------------------
  |  Branch (290:7): [True: 350, False: 1.63k]
  ------------------
  291|       |    // Find actual IPTC data within the psBlob
  292|    350|    Blob iptcBlob;
  293|    350|    const byte* record = nullptr;
  294|    350|    uint32_t sizeIptc = 0;
  295|    350|    uint32_t sizeHdr = 0;
  296|    350|    const byte* pCur = psBlob.data();
  297|    350|    const byte* pEnd = pCur + psBlob.size();
  298|  14.1k|    while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
  ------------------
  |  Branch (298:12): [True: 14.1k, False: 46]
  |  Branch (298:27): [True: 13.8k, False: 304]
  ------------------
  299|       |#ifdef EXIV2_DEBUG_MESSAGES
  300|       |      std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
  301|       |#endif
  302|  13.8k|      if (sizeIptc) {
  ------------------
  |  Branch (302:11): [True: 683, False: 13.1k]
  ------------------
  303|    683|        append(iptcBlob, record + sizeHdr, sizeIptc);
  304|    683|      }
  305|  13.8k|      pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
  306|  13.8k|    }
  307|    350|    if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
  ------------------
  |  Branch (307:9): [True: 97, False: 253]
  |  Branch (307:30): [True: 43, False: 54]
  ------------------
  308|     43|#ifndef SUPPRESS_WARNINGS
  309|     43|      EXV_WARNING << "Failed to decode IPTC 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()
  ------------------
  310|     43|#endif
  311|     43|      iptcData_.clear();
  312|     43|    }
  313|    350|  }
  314|       |
  315|  1.98k|  if (rc != 0) {
  ------------------
  |  Branch (315:7): [True: 1.43k, False: 554]
  ------------------
  316|  1.43k|#ifndef SUPPRESS_WARNINGS
  317|  1.43k|    EXV_WARNING << "JPEG format error, rc = " << rc << "\n";
  ------------------
  |  |  138|  1.43k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.43k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.43k|  LogMsg(LogMsg::warn).os()
  ------------------
  318|  1.43k|#endif
  319|  1.43k|  }
  320|  1.98k|}  // JpegBase::readMetadata
_ZN5Exiv28JpegBase13writeMetadataEv:
  578|    958|void JpegBase::writeMetadata() {
  579|    958|  if (io_->open() != 0) {
  ------------------
  |  Branch (579:7): [True: 0, False: 958]
  ------------------
  580|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  581|      0|  }
  582|    958|  IoCloser closer(*io_);
  583|    958|  MemIo tempIo;
  584|       |
  585|    958|  doWriteMetadata(tempIo);  // may throw
  586|    958|  io_->close();
  587|    958|  io_->transfer(tempIo);  // may throw
  588|    958|}
_ZN5Exiv28JpegBase15readNextSegmentEh:
  590|  3.42M|DataBuf JpegBase::readNextSegment(byte marker) {
  591|  3.42M|  const auto [sizebuf, size] = readSegmentSize(marker, *io_);
  592|       |
  593|       |  // Read the rest of the segment if not empty.
  594|  3.42M|  DataBuf buf(size);
  595|  3.42M|  if (size > 0) {
  ------------------
  |  Branch (595:7): [True: 132k, False: 3.29M]
  ------------------
  596|   132k|    std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
  597|   132k|    if (size > 2) {
  ------------------
  |  Branch (597:9): [True: 96.9k, False: 35.6k]
  ------------------
  598|  96.9k|      io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
  599|  96.9k|    }
  600|   132k|  }
  601|  3.42M|  return buf;
  602|  3.42M|}
_ZN5Exiv28JpegBase15doWriteMetadataERNS_7BasicIoE:
  604|    958|void JpegBase::doWriteMetadata(BasicIo& outIo) {
  605|    958|  if (!io_->isopen())
  ------------------
  |  Branch (605:7): [True: 0, False: 958]
  ------------------
  606|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  607|    958|  if (!outIo.isopen())
  ------------------
  |  Branch (607:7): [True: 0, False: 958]
  ------------------
  608|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  609|       |
  610|       |  // Ensure that this is the correct image type
  611|    958|  if (!isThisType(*io_, true)) {
  ------------------
  |  Branch (611:7): [True: 0, False: 958]
  ------------------
  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|    958|  static const size_t notfound = std::numeric_limits<size_t>::max();
  619|       |
  620|    958|  const size_t seek = io_->tell();
  621|    958|  size_t count = 0;
  622|    958|  size_t search = 0;
  623|    958|  size_t insertPos = 0;
  624|    958|  size_t comPos = 0;
  625|    958|  size_t skipApp1Exif = notfound;
  626|    958|  size_t skipApp1Xmp = notfound;
  627|    958|  bool foundCompletePsData = false;
  628|    958|  bool foundIccData = false;
  629|    958|  std::vector<size_t> skipApp13Ps3;
  630|    958|  std::vector<size_t> skipApp2Icc;
  631|    958|  size_t skipCom = notfound;
  632|    958|  Blob psBlob;
  633|    958|  DataBuf rawExif;
  634|    958|  xmpData().usePacket(writeXmpFromPacket());
  635|       |
  636|       |  // Write image header
  637|    958|  if (writeHeader(outIo))
  ------------------
  |  Branch (637:7): [True: 0, False: 958]
  ------------------
  638|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  639|       |
  640|       |  // Read section marker
  641|    958|  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: 729]
  |  Branch (646:28): [True: 1.97M, False: 216]
  |  Branch (646:46): [True: 1.97M, False: 13]
  ------------------
  647|  1.97M|    DataBuf buf = readNextSegment(marker);
  648|       |
  649|  1.97M|    if (marker == app0_) {
  ------------------
  |  Branch (649:9): [True: 734, False: 1.96M]
  ------------------
  650|    734|      insertPos = count + 1;
  651|  1.96M|    } else if (skipApp1Exif == notfound && marker == app1_ &&
  ------------------
  |  Branch (651:16): [True: 1.92M, False: 47.6k]
  |  Branch (651:44): [True: 2.22k, False: 1.91M]
  ------------------
  652|  2.22k|               buf.size() >= 8 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (652:16): [True: 1.53k, False: 692]
  ------------------
  653|  1.53k|               buf.cmpBytes(2, exifId_.data(), 6) == 0) {
  ------------------
  |  Branch (653:16): [True: 112, False: 1.41k]
  ------------------
  654|    112|      skipApp1Exif = count;
  655|    112|      ++search;
  656|    112|      if (buf.size() > 8) {
  ------------------
  |  Branch (656:11): [True: 101, False: 11]
  ------------------
  657|    101|        rawExif.alloc(buf.size() - 8);
  658|    101|        std::copy_n(buf.begin() + 8, rawExif.size(), rawExif.begin());
  659|    101|      }
  660|  1.96M|    } else if (skipApp1Xmp == notfound && marker == app1_ &&
  ------------------
  |  Branch (660:16): [True: 1.94M, False: 21.0k]
  |  Branch (660:43): [True: 2.27k, False: 1.94M]
  ------------------
  661|  2.27k|               buf.size() >= 31 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (661:16): [True: 1.31k, False: 964]
  ------------------
  662|  1.31k|               buf.cmpBytes(2, xmpId_.data(), 29) == 0) {
  ------------------
  |  Branch (662:16): [True: 60, False: 1.25k]
  ------------------
  663|     60|      skipApp1Xmp = count;
  664|     60|      ++search;
  665|  1.96M|    } else if (marker == app2_ && buf.size() >= 13 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (665:16): [True: 30.3k, False: 1.93M]
  |  Branch (665:35): [True: 13.0k, False: 17.3k]
  ------------------
  666|  13.0k|               buf.cmpBytes(2, iccId_, 11) == 0) {
  ------------------
  |  Branch (666:16): [True: 7.82k, False: 5.18k]
  ------------------
  667|  7.82k|      skipApp2Icc.push_back(count);
  668|  7.82k|      if (!foundIccData) {
  ------------------
  |  Branch (668:11): [True: 156, False: 7.66k]
  ------------------
  669|    156|        ++search;
  670|    156|        foundIccData = true;
  671|    156|      }
  672|  1.96M|    } else if (!foundCompletePsData && marker == app13_ &&
  ------------------
  |  Branch (672:16): [True: 1.95M, False: 1.87k]
  |  Branch (672:40): [True: 42.9k, False: 1.91M]
  ------------------
  673|  42.9k|               buf.size() >= 16 &&  // prevent out-of-bounds read in memcmp on next line
  ------------------
  |  Branch (673:16): [True: 42.5k, False: 344]
  ------------------
  674|  42.5k|               buf.cmpBytes(2, Photoshop::ps3Id_, 14) == 0) {
  ------------------
  |  Branch (674:16): [True: 25.7k, False: 16.8k]
  ------------------
  675|       |#ifdef EXIV2_DEBUG_MESSAGES
  676|       |      std::cerr << "Found APP13 Photoshop PS3 segment\n";
  677|       |#endif
  678|  25.7k|      skipApp13Ps3.push_back(count);
  679|       |      // Append to psBlob
  680|  25.7k|      append(psBlob, buf.c_data(16), buf.size() - 16);
  681|       |      // Check whether psBlob is complete
  682|  25.7k|      if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
  ------------------
  |  Branch (682:11): [True: 25.3k, False: 379]
  |  Branch (682:30): [True: 58, False: 25.3k]
  ------------------
  683|     58|        foundCompletePsData = true;
  684|     58|      }
  685|  1.93M|    } else if (marker == com_ && skipCom == notfound) {
  ------------------
  |  Branch (685:16): [True: 695, False: 1.93M]
  |  Branch (685:34): [True: 121, False: 574]
  ------------------
  686|       |      // Jpegs can have multiple comments, but for now only handle
  687|       |      // the first one (most jpegs only have one anyway).
  688|    121|      skipCom = count;
  689|    121|      ++search;
  690|    121|    }
  691|       |
  692|       |    // As in jpeg-6b/wrjpgcom.c:
  693|       |    // We will insert the new comment marker just before SOFn.
  694|       |    // This (a) causes the new comment to appear after, rather than before,
  695|       |    // existing comments; and (b) ensures that comments come after any JFIF
  696|       |    // or JFXX markers, as required by the JFIF specification.
  697|  1.97M|    if (comPos == 0 && inRange2(marker, sof0_, sof3_, sof5_, sof15_)) {
  ------------------
  |  Branch (697:9): [True: 667k, False: 1.30M]
  |  Branch (697:24): [True: 311, False: 667k]
  ------------------
  698|    311|      comPos = count;
  699|    311|      ++search;
  700|    311|    }
  701|  1.97M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  702|  1.97M|    ++count;
  703|  1.97M|  }
  704|       |
  705|    958|  if (!foundCompletePsData && !psBlob.empty())
  ------------------
  |  Branch (705:7): [True: 307, False: 651]
  |  Branch (705:31): [True: 17, False: 290]
  ------------------
  706|     17|    throw Error(ErrorCode::kerNoImageInInputData);
  707|    941|  search += skipApp13Ps3.size() + skipApp2Icc.size();
  708|       |
  709|    941|  if (comPos == 0) {
  ------------------
  |  Branch (709:7): [True: 277, False: 664]
  ------------------
  710|    277|    if (marker == eoi_)
  ------------------
  |  Branch (710:9): [True: 161, False: 116]
  ------------------
  711|    161|      comPos = count;
  712|    116|    else
  713|    116|      comPos = insertPos;
  714|    277|    ++search;
  715|    277|  }
  716|    941|  if (!exifData_.empty())
  ------------------
  |  Branch (716:7): [True: 70, False: 871]
  ------------------
  717|     70|    ++search;
  718|    941|  if (!writeXmpFromPacket() && !xmpData_.empty())
  ------------------
  |  Branch (718:7): [True: 335, False: 606]
  |  Branch (718:32): [True: 28, False: 307]
  ------------------
  719|     28|    ++search;
  720|    941|  if (writeXmpFromPacket() && !xmpPacket_.empty())
  ------------------
  |  Branch (720:7): [True: 0, False: 941]
  |  Branch (720:31): [True: 0, False: 0]
  ------------------
  721|      0|    ++search;
  722|    941|  if (foundCompletePsData || !iptcData_.empty())
  ------------------
  |  Branch (722:7): [True: 651, False: 290]
  |  Branch (722:30): [True: 0, False: 290]
  ------------------
  723|     45|    ++search;
  724|    941|  if (!comment_.empty())
  ------------------
  |  Branch (724:7): [True: 34, False: 907]
  ------------------
  725|     34|    ++search;
  726|       |
  727|    941|  io_->seekOrThrow(seek, BasicIo::beg, ErrorCode::kerNoImageInInputData);
  728|    941|  count = 0;
  729|    941|  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.45M|  while (marker != sos_ && search > 0) {
  ------------------
  |  Branch (735:10): [True: 1.45M, False: 697]
  |  Branch (735:28): [True: 1.45M, False: 60]
  ------------------
  736|  1.45M|    DataBuf buf = readNextSegment(marker);
  737|       |
  738|  1.45M|    if (insertPos == count) {
  ------------------
  |  Branch (738:9): [True: 327, False: 1.45M]
  ------------------
  739|       |      // Write Exif data first so that - if there is no app0 - we
  740|       |      // create "Exif images" according to the Exif standard.
  741|    327|      if (!exifData_.empty()) {
  ------------------
  |  Branch (741:11): [True: 70, False: 257]
  ------------------
  742|     70|        Blob blob;
  743|     70|        ByteOrder bo = byteOrder();
  744|     70|        if (bo == invalidByteOrder) {
  ------------------
  |  Branch (744:13): [True: 0, False: 70]
  ------------------
  745|      0|          bo = littleEndian;
  746|      0|          setByteOrder(bo);
  747|      0|        }
  748|     70|        const byte* pExifData = rawExif.c_data();
  749|     70|        size_t exifSize = rawExif.size();
  750|     70|        if (ExifParser::encode(blob, pExifData, exifSize, bo, exifData_) == wmIntrusive) {
  ------------------
  |  Branch (750:13): [True: 57, False: 13]
  ------------------
  751|     57|          pExifData = !blob.empty() ? blob.data() : nullptr;
  ------------------
  |  Branch (751:23): [True: 56, False: 1]
  ------------------
  752|     57|          exifSize = blob.size();
  753|     57|        }
  754|     70|        if (exifSize > 0) {
  ------------------
  |  Branch (754:13): [True: 68, False: 2]
  ------------------
  755|     68|          std::array<byte, 10> tmpBuf;
  756|       |          // Write APP1 marker, size of APP1 field, Exif id and Exif data
  757|     68|          tmpBuf[0] = 0xff;
  758|     68|          tmpBuf[1] = app1_;
  759|       |
  760|     68|          if (exifSize > 0xffff - 8)
  ------------------
  |  Branch (760:15): [True: 2, False: 66]
  ------------------
  761|      2|            throw Error(ErrorCode::kerTooLargeJpegSegment, "Exif");
  762|     66|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(exifSize + 8), bigEndian);
  763|     66|          std::copy(exifId_.begin(), exifId_.end(), tmpBuf.begin() + 4);
  764|     66|          if (outIo.write(tmpBuf.data(), 10) != 10)
  ------------------
  |  Branch (764:15): [True: 0, False: 66]
  ------------------
  765|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  766|       |
  767|       |          // Write new Exif data buffer
  768|     66|          if (outIo.write(pExifData, exifSize) != exifSize)
  ------------------
  |  Branch (768:15): [True: 0, False: 66]
  ------------------
  769|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  770|     66|          if (outIo.error())
  ------------------
  |  Branch (770:15): [True: 0, False: 66]
  ------------------
  771|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  772|     66|          --search;
  773|     66|        }
  774|     70|      }
  775|    325|      if (!writeXmpFromPacket() &&
  ------------------
  |  Branch (775:11): [True: 324, False: 1]
  ------------------
  776|    324|          XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {
  ------------------
  |  Branch (776:11): [True: 0, False: 324]
  ------------------
  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|    325|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (781:11): [True: 28, False: 297]
  ------------------
  782|     28|        std::array<byte, 33> tmpBuf;
  783|       |        // Write APP1 marker, size of APP1 field, XMP id and XMP packet
  784|     28|        tmpBuf[0] = 0xff;
  785|     28|        tmpBuf[1] = app1_;
  786|       |
  787|     28|        if (xmpPacket_.size() > 0xffff - 31)
  ------------------
  |  Branch (787:13): [True: 0, False: 28]
  ------------------
  788|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "XMP");
  789|     28|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(xmpPacket_.size() + 31), bigEndian);
  790|     28|        std::copy(xmpId_.begin(), xmpId_.end(), tmpBuf.begin() + 4);
  791|     28|        if (outIo.write(tmpBuf.data(), 33) != 33)
  ------------------
  |  Branch (791:13): [True: 0, False: 28]
  ------------------
  792|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  793|       |
  794|       |        // Write new XMP packet
  795|     28|        if (outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size()) != xmpPacket_.size())
  ------------------
  |  Branch (795:13): [True: 0, False: 28]
  ------------------
  796|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  797|     28|        if (outIo.error())
  ------------------
  |  Branch (797:13): [True: 0, False: 28]
  ------------------
  798|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  799|     28|        --search;
  800|     28|      }
  801|       |
  802|    325|      if (iccProfileDefined()) {
  ------------------
  |  Branch (802:11): [True: 36, False: 289]
  ------------------
  803|     36|        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|     36|        tmpBuf[0] = 0xff;
  807|     36|        tmpBuf[1] = app2_;
  808|       |
  809|     36|        const size_t chunk_size = (256 * 256) - 40;  // leave bytes for marker, header and padding
  810|     36|        size_t size = iccProfile_.size();
  811|     36|        if (size >= 255 * chunk_size)
  ------------------
  |  Branch (811:13): [True: 0, False: 36]
  ------------------
  812|      0|          throw Error(ErrorCode::kerTooLargeJpegSegment, "IccProfile");
  813|     36|        const size_t chunks = 1 + ((size - 1) / chunk_size);
  814|    121|        for (size_t chunk = 0; chunk < chunks; chunk++) {
  ------------------
  |  Branch (814:32): [True: 85, False: 36]
  ------------------
  815|     85|          auto bytes = std::min<size_t>(size, chunk_size);  // bytes to write
  816|     85|          size -= bytes;
  817|       |
  818|       |          // write JPEG marker (2 bytes)
  819|     85|          if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (819:15): [True: 0, False: 85]
  ------------------
  820|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Marker
  821|       |          // write length (2 bytes).  length includes the 2 bytes for the length
  822|     85|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(2 + 14 + bytes), bigEndian);
  823|     85|          if (outIo.write(tmpBuf.data() + 2, 2) != 2)
  ------------------
  |  Branch (823:15): [True: 0, False: 85]
  ------------------
  824|      0|            throw Error(ErrorCode::kerImageWriteFailed);  // JPEG Length
  825|       |
  826|       |          // write the ICC_PROFILE header (14 bytes)
  827|     85|          uint8_t pad[2];
  828|     85|          pad[0] = static_cast<uint8_t>(chunk + 1);
  829|     85|          pad[1] = static_cast<uint8_t>(chunks);
  830|     85|          outIo.write(reinterpret_cast<const byte*>(iccId_), 12);
  831|     85|          outIo.write(reinterpret_cast<const byte*>(pad), 2);
  832|     85|          if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes)
  ------------------
  |  Branch (832:15): [True: 0, False: 85]
  ------------------
  833|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  834|     85|          if (outIo.error())
  ------------------
  |  Branch (834:15): [True: 0, False: 85]
  ------------------
  835|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  836|     85|        }
  837|     36|        --search;
  838|     36|      }
  839|       |
  840|    325|      if (foundCompletePsData || !iptcData_.empty()) {
  ------------------
  |  Branch (840:11): [True: 46, False: 279]
  |  Branch (840:34): [True: 0, False: 279]
  ------------------
  841|       |        // Set the new IPTC IRB, keeps existing IRBs but removes the
  842|       |        // IPTC block if there is no new IPTC data to write
  843|     45|        DataBuf newPsData = Photoshop::setIptcIrb(psBlob.data(), psBlob.size(), iptcData_);
  844|     45|        const size_t maxChunkSize = 0xffff - 16;
  845|     45|        const byte* chunkStart = newPsData.empty() ? nullptr : newPsData.c_data();
  ------------------
  |  Branch (845:34): [True: 6, False: 39]
  ------------------
  846|     45|        const byte* chunkEnd = newPsData.empty() ? nullptr : newPsData.c_data(newPsData.size() - 1);
  ------------------
  |  Branch (846:32): [True: 6, False: 39]
  ------------------
  847|     95|        while (chunkStart < chunkEnd) {
  ------------------
  |  Branch (847:16): [True: 50, False: 45]
  ------------------
  848|       |          // Determine size of next chunk
  849|     50|          size_t chunkSize = (chunkEnd + 1 - chunkStart);
  850|     50|          if (chunkSize > maxChunkSize) {
  ------------------
  |  Branch (850:15): [True: 14, False: 36]
  ------------------
  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|     50|          std::array<byte, 18> tmpBuf;
  863|     50|          tmpBuf[0] = 0xff;
  864|     50|          tmpBuf[1] = app13_;
  865|     50|          us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(chunkSize + 16), bigEndian);
  866|     50|          std::copy_n(Photoshop::ps3Id_, 14, tmpBuf.begin() + 4);
  867|     50|          if (outIo.write(tmpBuf.data(), 18) != 18)
  ------------------
  |  Branch (867:15): [True: 0, False: 50]
  ------------------
  868|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  869|     50|          if (outIo.error())
  ------------------
  |  Branch (869:15): [True: 0, False: 50]
  ------------------
  870|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  871|       |
  872|       |          // Write next chunk of the Photoshop IRB data buffer
  873|     50|          if (outIo.write(chunkStart, chunkSize) != chunkSize)
  ------------------
  |  Branch (873:15): [True: 0, False: 50]
  ------------------
  874|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  875|     50|          if (outIo.error())
  ------------------
  |  Branch (875:15): [True: 0, False: 50]
  ------------------
  876|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  877|       |
  878|     50|          chunkStart += chunkSize;
  879|     50|        }
  880|     45|        --search;
  881|     45|      }
  882|    325|    }
  883|  1.45M|    if (comPos == count) {
  ------------------
  |  Branch (883:9): [True: 322, False: 1.45M]
  ------------------
  884|    322|      if (!comment_.empty()) {
  ------------------
  |  Branch (884:11): [True: 34, False: 288]
  ------------------
  885|     34|        std::array<byte, 4> tmpBuf;
  886|       |        // Write COM marker, size of comment, and string
  887|     34|        tmpBuf[0] = 0xff;
  888|     34|        tmpBuf[1] = com_;
  889|       |
  890|     34|        if (comment_.length() > 0xffff - 3)
  ------------------
  |  Branch (890:13): [True: 1, False: 33]
  ------------------
  891|      1|          throw Error(ErrorCode::kerTooLargeJpegSegment, "JPEG comment");
  892|     33|        us2Data(tmpBuf.data() + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
  893|       |
  894|     33|        if (outIo.write(tmpBuf.data(), 4) != 4)
  ------------------
  |  Branch (894:13): [True: 0, False: 33]
  ------------------
  895|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  896|     33|        if (outIo.write(reinterpret_cast<byte*>(comment_.data()), comment_.length()) != comment_.length())
  ------------------
  |  Branch (896:13): [True: 0, False: 33]
  ------------------
  897|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  898|     33|        if (outIo.putb(0) == EOF)
  ------------------
  |  Branch (898:13): [True: 0, False: 33]
  ------------------
  899|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  900|     33|        if (outIo.error())
  ------------------
  |  Branch (900:13): [True: 0, False: 33]
  ------------------
  901|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  902|     33|        --search;
  903|     33|      }
  904|    321|      --search;
  905|    321|    }
  906|  1.45M|    if (marker == eoi_) {
  ------------------
  |  Branch (906:9): [True: 181, False: 1.45M]
  ------------------
  907|    181|      break;
  908|    181|    }
  909|  1.45M|    if (skipApp1Exif == count || skipApp1Xmp == count ||
  ------------------
  |  Branch (909:9): [True: 100, False: 1.45M]
  |  Branch (909:9): [True: 17.1k, False: 1.44M]
  |  Branch (909:34): [True: 48, False: 1.45M]
  ------------------
  910|  1.45M|        std::find(skipApp13Ps3.begin(), skipApp13Ps3.end(), count) != skipApp13Ps3.end() ||
  ------------------
  |  Branch (910:9): [True: 12.7k, False: 1.44M]
  ------------------
  911|  1.44M|        std::find(skipApp2Icc.begin(), skipApp2Icc.end(), count) != skipApp2Icc.end() || skipCom == count) {
  ------------------
  |  Branch (911:9): [True: 4.22k, False: 1.44M]
  |  Branch (911:90): [True: 70, False: 1.44M]
  ------------------
  912|  17.1k|      --search;
  913|  1.44M|    } else {
  914|  1.44M|      std::array<byte, 2> tmpBuf;
  915|       |      // Write marker and a copy of the segment.
  916|  1.44M|      tmpBuf[0] = 0xff;
  917|  1.44M|      tmpBuf[1] = marker;
  918|  1.44M|      if (outIo.write(tmpBuf.data(), 2) != 2)
  ------------------
  |  Branch (918:11): [True: 0, False: 1.44M]
  ------------------
  919|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  920|  1.44M|      if (outIo.write(buf.c_data(), buf.size()) != buf.size())
  ------------------
  |  Branch (920:11): [True: 0, False: 1.44M]
  ------------------
  921|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  922|  1.44M|      if (outIo.error())
  ------------------
  |  Branch (922:11): [True: 0, False: 1.44M]
  ------------------
  923|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  924|  1.44M|    }
  925|       |
  926|       |    // Next marker
  927|  1.45M|    marker = advanceToMarker(ErrorCode::kerNoImageInInputData);
  928|  1.45M|    ++count;
  929|  1.45M|  }
  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|    938|  io_->populateFakeData();
  934|       |
  935|       |  // Write the final marker, then copy rest of the Io.
  936|    938|  byte tmpBuf[2];
  937|    938|  tmpBuf[0] = 0xff;
  938|    938|  tmpBuf[1] = marker;
  939|    938|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (939:7): [True: 0, False: 938]
  ------------------
  940|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  941|       |
  942|    938|  DataBuf buf(4096);
  943|    938|  size_t readSize = io_->read(buf.data(), buf.size());
  944|  1.38k|  while (readSize != 0) {
  ------------------
  |  Branch (944:10): [True: 449, False: 938]
  ------------------
  945|    449|    if (outIo.write(buf.c_data(), readSize) != readSize)
  ------------------
  |  Branch (945:9): [True: 0, False: 449]
  ------------------
  946|      0|      throw Error(ErrorCode::kerImageWriteFailed);
  947|    449|    readSize = io_->read(buf.data(), buf.size());
  948|    449|  }
  949|    938|  if (outIo.error())
  ------------------
  |  Branch (949:7): [True: 0, False: 938]
  ------------------
  950|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  951|       |
  952|    938|}  // JpegBase::doWriteMetadata
_ZN5Exiv29JpegImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  971|  2.98k|    JpegBase(ImageType::jpeg, std::move(io), params, blank_, sizeof(blank_)) {
  972|  2.98k|}
_ZNK5Exiv29JpegImage11writeHeaderERNS_7BasicIoE:
  978|    950|int JpegImage::writeHeader(BasicIo& outIo) const {
  979|       |  // Jpeg header
  980|    950|  byte tmpBuf[2];
  981|    950|  tmpBuf[0] = 0xff;
  982|    950|  tmpBuf[1] = soi_;
  983|    950|  if (outIo.write(tmpBuf, 2) != 2)
  ------------------
  |  Branch (983:7): [True: 0, False: 950]
  ------------------
  984|      0|    return 4;
  985|    950|  if (outIo.error())
  ------------------
  |  Branch (985:7): [True: 0, False: 950]
  ------------------
  986|      0|    return 4;
  987|    950|  return 0;
  988|    950|}
_ZNK5Exiv29JpegImage10isThisTypeERNS_7BasicIoEb:
  990|  3.93k|bool JpegImage::isThisType(BasicIo& iIo, bool advance) const {
  991|  3.93k|  return isJpegType(iIo, advance);
  992|  3.93k|}
_ZN5Exiv215newJpegInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  994|  2.53k|Image::UniquePtr newJpegInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  995|  2.53k|  auto image = std::make_unique<JpegImage>(std::move(io), params);
  996|  2.53k|  if (!image->good()) {
  ------------------
  |  Branch (996:7): [True: 0, False: 2.53k]
  ------------------
  997|      0|    return nullptr;
  998|      0|  }
  999|  2.53k|  return image;
 1000|  2.53k|}
_ZN5Exiv210isJpegTypeERNS_7BasicIoEb:
 1002|  71.5k|bool isJpegType(BasicIo& iIo, bool advance) {
 1003|  71.5k|  bool result = true;
 1004|  71.5k|  byte tmpBuf[2];
 1005|  71.5k|  iIo.read(tmpBuf, 2);
 1006|  71.5k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1006:7): [True: 0, False: 71.5k]
  |  Branch (1006:22): [True: 84, False: 71.4k]
  ------------------
 1007|     84|    return false;
 1008|       |
 1009|  71.4k|  if (0xff != tmpBuf[0] || soi_ != tmpBuf[1]) {
  ------------------
  |  Branch (1009:7): [True: 62.2k, False: 9.20k]
  |  Branch (1009:28): [True: 599, False: 8.60k]
  ------------------
 1010|  62.8k|    result = false;
 1011|  62.8k|  }
 1012|  71.4k|  if (!advance || !result)
  ------------------
  |  Branch (1012:7): [True: 67.5k, False: 3.93k]
  |  Branch (1012:19): [True: 409, False: 3.52k]
  ------------------
 1013|  67.9k|    iIo.seek(-2, BasicIo::cur);
 1014|  71.4k|  return result;
 1015|  71.5k|}
_ZN5Exiv28ExvImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
 1018|     42|    JpegBase(ImageType::exv, std::move(io), params, blank_, sizeof(blank_)) {
 1019|     42|}
_ZNK5Exiv28ExvImage11writeHeaderERNS_7BasicIoE:
 1025|      8|int ExvImage::writeHeader(BasicIo& outIo) const {
 1026|       |  // Exv header
 1027|      8|  auto tmpBuf = std::array<byte, 7>{0xff, 0x01};
 1028|      8|  std::copy_n(exiv2Id_, 5, tmpBuf.begin() + 2);
 1029|      8|  if (outIo.write(tmpBuf.data(), 7) != 7)
  ------------------
  |  Branch (1029:7): [True: 0, False: 8]
  ------------------
 1030|      0|    return 4;
 1031|      8|  if (outIo.error())
  ------------------
  |  Branch (1031:7): [True: 0, False: 8]
  ------------------
 1032|      0|    return 4;
 1033|      8|  return 0;
 1034|      8|}
_ZNK5Exiv28ExvImage10isThisTypeERNS_7BasicIoEb:
 1036|     50|bool ExvImage::isThisType(BasicIo& iIo, bool advance) const {
 1037|     50|  return isExvType(iIo, advance);
 1038|     50|}
_ZN5Exiv214newExvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1040|     42|Image::UniquePtr newExvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1041|     42|  auto image = std::make_unique<ExvImage>(std::move(io), params);
 1042|     42|  if (!image->good())
  ------------------
  |  Branch (1042:7): [True: 0, False: 42]
  ------------------
 1043|      0|    return nullptr;
 1044|     42|  return image;
 1045|     42|}
_ZN5Exiv29isExvTypeERNS_7BasicIoEb:
 1047|  62.6k|bool isExvType(BasicIo& iIo, bool advance) {
 1048|  62.6k|  bool result = true;
 1049|  62.6k|  byte tmpBuf[7];
 1050|  62.6k|  iIo.read(tmpBuf, 7);
 1051|  62.6k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (1051:7): [True: 0, False: 62.6k]
  |  Branch (1051:22): [True: 150, False: 62.4k]
  ------------------
 1052|    150|    return false;
 1053|       |
 1054|  62.4k|  if (0xff != tmpBuf[0] || 0x01 != tmpBuf[1] || memcmp(tmpBuf + 2, ExvImage::exiv2Id_, 5) != 0) {
  ------------------
  |  Branch (1054:7): [True: 62.0k, False: 438]
  |  Branch (1054:28): [True: 217, False: 221]
  |  Branch (1054:49): [True: 87, False: 134]
  ------------------
 1055|  62.3k|    result = false;
 1056|  62.3k|  }
 1057|  62.4k|  if (!advance || !result)
  ------------------
  |  Branch (1057:7): [True: 62.4k, False: 50]
  |  Branch (1057:19): [True: 0, False: 50]
  ------------------
 1058|  62.4k|    iIo.seek(-7, BasicIo::cur);
 1059|  62.4k|  return result;
 1060|  62.6k|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115readSegmentSizeEhRNS_7BasicIoE:
  103|  4.06M|std::pair<std::array<byte, 2>, uint16_t> readSegmentSize(const byte marker, BasicIo& io) {
  104|  4.06M|  std::array<byte, 2> buf{0, 0};  // 2-byte buffer for reading the size.
  105|  4.06M|  uint16_t size{0};               // Size of the segment, including the 2-byte size field
  106|  4.06M|  if (markerHasLength(marker)) {
  ------------------
  |  Branch (106:7): [True: 217k, False: 3.84M]
  ------------------
  107|   217k|    io.readOrThrow(buf.data(), buf.size(), ErrorCode::kerFailedToReadImageData);
  108|   217k|    size = getUShort(buf.data(), bigEndian);
  109|   217k|    enforce(size >= 2, ErrorCode::kerFailedToReadImageData);
  110|   217k|  }
  111|  4.06M|  return {buf, size};
  112|  4.06M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_18inRange2Eiiiii:
   91|  1.19M|constexpr bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) {
   92|  1.19M|  return inRange(lo1, value, hi1) || inRange(lo2, value, hi2);
  ------------------
  |  Branch (92:10): [True: 395, False: 1.19M]
  |  Branch (92:38): [True: 886, False: 1.19M]
  ------------------
   93|  1.19M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_17inRangeEiii:
   87|  2.38M|constexpr bool inRange(int lo, int value, int hi) {
   88|  2.38M|  return lo <= value && value <= hi;
  ------------------
  |  Branch (88:10): [True: 2.37M, False: 9.13k]
  |  Branch (88:25): [True: 1.28k, False: 2.37M]
  ------------------
   89|  2.38M|}
jpgimage.cpp:_ZN5Exiv212_GLOBAL__N_115markerHasLengthEh:
   98|  4.06M|bool markerHasLength(byte m) {
   99|  4.06M|  bool markerWithoutLength = m >= rst1_ && m <= eoi_;
  ------------------
  |  Branch (99:30): [True: 4.04M, False: 18.8k]
  |  Branch (99:44): [True: 3.84M, False: 198k]
  ------------------
  100|  4.06M|  return !markerWithoutLength;
  101|  4.06M|}

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

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

_ZN5Exiv213MatroskaVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  600|  3.91k|    Image(ImageType::mkv, mdNone, std::move(io), params) {
  601|  3.91k|}  // MatroskaVideo::MatroskaVideo
_ZNK5Exiv213MatroskaVideo8mimeTypeEv:
  603|  3.91k|std::string MatroskaVideo::mimeType() const {
  604|  3.91k|  return "video/matroska";
  605|  3.91k|}
_ZN5Exiv213MatroskaVideo13writeMetadataEv:
  607|  1.99k|void MatroskaVideo::writeMetadata() {
  608|  1.99k|}
_ZN5Exiv213MatroskaVideo12readMetadataEv:
  610|  3.91k|void MatroskaVideo::readMetadata() {
  611|  3.91k|  if (io_->open() != 0)
  ------------------
  |  Branch (611:7): [True: 0, False: 3.91k]
  ------------------
  612|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  613|       |
  614|       |  // Ensure that this is the correct image type
  615|  3.91k|  if (!isMkvType(*io_, false)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 3.91k]
  ------------------
  616|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  618|      0|    throw Error(ErrorCode::kerNotAnImage, "Matroska");
  619|      0|  }
  620|       |
  621|  3.91k|  IoCloser closer(*io_);
  622|  3.91k|  clearMetadata();
  623|  3.91k|  continueTraversing_ = true;
  624|  3.91k|  height_ = width_ = 1;
  625|       |
  626|  3.91k|  xmpData_["Xmp.video.FileSize"] = io_->size() / bytesMB;
  627|  3.91k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  628|       |
  629|   121k|  while (continueTraversing_)
  ------------------
  |  Branch (629:10): [True: 117k, False: 3.91k]
  ------------------
  630|   117k|    decodeBlock();
  631|       |
  632|  3.91k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  633|  3.91k|}
_ZN5Exiv213MatroskaVideo11decodeBlockEv:
  635|   117k|void MatroskaVideo::decodeBlock() {
  636|   117k|  byte buf[8];
  637|   117k|  io_->read(buf, 1);
  638|       |
  639|   117k|  if (io_->eof()) {
  ------------------
  |  Branch (639:7): [True: 487, False: 117k]
  ------------------
  640|    487|    continueTraversing_ = false;
  641|    487|    return;
  642|    487|  }
  643|       |
  644|   117k|  uint32_t block_size = findBlockSize(buf[0]);  // 0-8
  645|   117k|  if (block_size > 0)
  ------------------
  |  Branch (645:7): [True: 116k, False: 547]
  ------------------
  646|   116k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  647|       |
  648|   117k|  auto tag_id = returnTagValue(buf, block_size);
  649|   117k|  const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
  650|       |
  651|   117k|  if (!tag) {
  ------------------
  |  Branch (651:7): [True: 2.09k, False: 115k]
  ------------------
  652|  2.09k|    continueTraversing_ = false;
  653|  2.09k|    return;
  654|  2.09k|  }
  655|       |
  656|       |  // tag->dump(std::cout);
  657|       |
  658|   115k|  if (tag->_id == Cues || tag->_id == Cluster) {
  ------------------
  |  Branch (658:7): [True: 622, False: 114k]
  |  Branch (658:27): [True: 1, False: 114k]
  ------------------
  659|      2|    continueTraversing_ = false;
  660|      2|    return;
  661|      2|  }
  662|       |
  663|   115k|  io_->readOrThrow(buf, 1, ErrorCode::kerCorruptedMetadata);
  664|   115k|  block_size = findBlockSize(buf[0]);  // 0-8
  665|       |
  666|   115k|  if (block_size > 0)
  ------------------
  |  Branch (666:7): [True: 114k, False: 788]
  ------------------
  667|   114k|    io_->readOrThrow(buf + 1, block_size - 1, ErrorCode::kerCorruptedMetadata);
  668|   115k|  size_t size = returnTagValue(buf, block_size);
  669|       |
  670|   115k|  if (tag->isComposite() && !tag->isSkipped())
  ------------------
  |  Branch (670:7): [True: 62.4k, False: 52.9k]
  |  Branch (670:29): [True: 62.4k, False: 0]
  ------------------
  671|  62.4k|    return;
  672|       |
  673|  52.9k|  const size_t bufMaxSize = 200;
  674|       |
  675|  52.9k|#ifndef SUPPRESS_WARNINGS
  676|  52.9k|  if (!tag->isSkipped() && size > bufMaxSize) {
  ------------------
  |  Branch (676:7): [True: 50.7k, False: 2.17k]
  |  Branch (676:28): [True: 190, False: 50.5k]
  ------------------
  677|    190|    EXV_WARNING << "Size " << size << " of Matroska tag 0x" << std::hex << tag->_id << std::dec << " is greater than "
  ------------------
  |  |  138|    190|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 190]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    190|  LogMsg(LogMsg::warn).os()
  ------------------
  678|      0|                << bufMaxSize << ": ignoring it.\n";
  679|    190|  }
  680|  52.9k|#endif
  681|  52.9k|  if (tag->isSkipped() || size > bufMaxSize) {
  ------------------
  |  Branch (681:7): [True: 2.17k, False: 50.7k]
  |  Branch (681:27): [True: 190, False: 50.5k]
  ------------------
  682|  1.55k|    io_->seek(size, BasicIo::cur);
  683|  1.55k|    return;
  684|  1.55k|  }
  685|       |
  686|  51.3k|  DataBuf buf2(bufMaxSize + 1);
  687|  51.3k|  io_->readOrThrow(buf2.data(), size, ErrorCode::kerCorruptedMetadata);
  688|  51.3k|  switch (tag->_type) {
  689|  11.0k|    case InternalField:
  ------------------
  |  Branch (689:5): [True: 11.0k, False: 40.3k]
  ------------------
  690|  11.0k|      decodeInternalTags(tag, buf2.data());
  691|  11.0k|      break;
  692|  3.98k|    case String:
  ------------------
  |  Branch (692:5): [True: 3.98k, False: 47.3k]
  ------------------
  693|  3.98k|    case Utf8:
  ------------------
  |  Branch (693:5): [True: 0, False: 51.3k]
  ------------------
  694|  3.98k|      decodeStringTags(tag, buf2.data());
  695|  3.98k|      break;
  696|  9.14k|    case Integer:
  ------------------
  |  Branch (696:5): [True: 9.14k, False: 42.2k]
  ------------------
  697|  12.6k|    case UInteger:
  ------------------
  |  Branch (697:5): [True: 3.51k, False: 47.8k]
  ------------------
  698|  12.6k|      decodeIntegerTags(tag, buf2.data());
  699|  12.6k|      break;
  700|  17.9k|    case Boolean:
  ------------------
  |  Branch (700:5): [True: 17.9k, False: 33.3k]
  ------------------
  701|  17.9k|      decodeBooleanTags(tag, buf2.data());
  702|  17.9k|      break;
  703|  1.90k|    case Date:
  ------------------
  |  Branch (703:5): [True: 1.90k, False: 49.4k]
  ------------------
  704|  1.90k|      decodeDateTags(tag, buf2.data(), size);
  705|  1.90k|      break;
  706|  2.78k|    case Float:
  ------------------
  |  Branch (706:5): [True: 2.78k, False: 48.5k]
  ------------------
  707|  2.78k|      decodeFloatTags(tag, buf2.data());
  708|  2.78k|      break;
  709|      0|    case Binary:
  ------------------
  |  Branch (709:5): [True: 0, False: 51.3k]
  ------------------
  710|      0|      break;
  711|      0|    case Master:
  ------------------
  |  Branch (711:5): [True: 0, False: 51.3k]
  ------------------
  712|      0|      break;
  713|      0|    default:
  ------------------
  |  Branch (713:5): [True: 0, False: 51.3k]
  ------------------
  714|      0|      break;
  715|  51.3k|  }
  716|  51.3k|}  // MatroskaVideo::decodeBlock
_ZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKh:
  718|  11.0k|void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf) {
  719|  11.0k|  uint64_t key = getULongLong(buf, bigEndian);
  720|  11.0k|  if (!key)
  ------------------
  |  Branch (720:7): [True: 264, False: 10.7k]
  ------------------
  721|    264|    return;
  722|       |
  723|  10.7k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  10.7k|    switch (tag->_id) {
  725|  10.7k|      case Xmp_video_VideoScanTpye:
  726|  10.7k|        return Exiv2::find(videoScanType, key);
  727|  10.7k|      case Xmp_audio_ChannelType:
  728|  10.7k|        return Exiv2::find(audioChannels, key);
  729|  10.7k|      case Xmp_video_ContentCompressAlgo:
  730|  10.7k|        return Exiv2::find(compressionAlgorithm, key);
  731|  10.7k|      case Xmp_video_ContentEncryptAlgo:
  732|  10.7k|        return Exiv2::find(encryptionAlgorithm, key);
  733|  10.7k|      case Xmp_video_ContentSignAlgo_1:
  734|  10.7k|      case Xmp_video_ContentSignAlgo_2:
  735|  10.7k|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|  10.7k|      case Xmp_video_ContentSignHashAlgo_1:
  737|  10.7k|      case Xmp_video_ContentSignHashAlgo_2:
  738|  10.7k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|  10.7k|      case Xmp_video_ContentEncodingType:
  740|  10.7k|        return Exiv2::find(encodingType, key);
  741|  10.7k|      case Xmp_video_DisplayUnit:
  742|  10.7k|        return Exiv2::find(displayUnit, key);
  743|  10.7k|      case Xmp_video_AspectRatioType:
  744|  10.7k|        return Exiv2::find(aspectRatioType, key);
  745|  10.7k|      case Xmp_video_PhysicalEquivalent:
  746|  10.7k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|  10.7k|      case Xmp_video_TranslateCodec:
  748|  10.7k|        return Exiv2::find(chapterTranslateCodec, key);
  749|  10.7k|      case Video_Audio_CodecID:
  750|  10.7k|        return Exiv2::find(trackCodec, key);
  751|  10.7k|      case Video_Audio_CodecName:
  752|  10.7k|        return Exiv2::find(codecInfo, key);
  753|  10.7k|      case CodecDownloadURL:
  754|  10.7k|      case CodecInfoURL:
  755|  10.7k|        return Exiv2::find(codecDownloadUrl, key);
  756|  10.7k|    }
  757|  10.7k|    return nullptr;
  758|  10.7k|  }();
  759|  10.7k|  if (internalMt) {
  ------------------
  |  Branch (759:7): [True: 3.23k, False: 7.53k]
  ------------------
  760|  3.23k|    xmpData_[tag->_label] = internalMt->_label;
  761|  7.53k|  } else {
  762|  7.53k|    xmpData_[tag->_label] = key;
  763|  7.53k|  }
  764|  10.7k|}
_ZN5Exiv213MatroskaVideo16decodeStringTagsEPKNS_8Internal11MatroskaTagEPKh:
  766|  3.98k|void MatroskaVideo::decodeStringTags(const MatroskaTag* tag, const byte* buf) {
  767|  3.98k|  if (tag->_id == TrackNumber) {
  ------------------
  |  Branch (767:7): [True: 1.49k, False: 2.49k]
  ------------------
  768|  1.49k|    track_count_++;
  769|  1.49k|    xmpData_[tag->_label] = track_count_;
  770|  2.49k|  } else {
  771|  2.49k|    xmpData_[tag->_label] = buf;
  772|  2.49k|  }
  773|  3.98k|}
_ZN5Exiv213MatroskaVideo17decodeIntegerTagsEPKNS_8Internal11MatroskaTagEPKh:
  775|  12.6k|void MatroskaVideo::decodeIntegerTags(const MatroskaTag* tag, const byte* buf) {
  776|  12.6k|  uint64_t value = getULongLong(buf, bigEndian);
  777|  12.6k|  if (!value)
  ------------------
  |  Branch (777:7): [True: 9.89k, False: 2.76k]
  ------------------
  778|  9.89k|    return;
  779|       |
  780|  2.76k|  if (tag->_id == Xmp_video_Width_1 || tag->_id == Xmp_video_Width_2)
  ------------------
  |  Branch (780:7): [True: 1.37k, False: 1.38k]
  |  Branch (780:40): [True: 328, False: 1.06k]
  ------------------
  781|  1.70k|    width_ = value;
  782|  2.76k|  if (tag->_id == Xmp_video_Height_1 || tag->_id == Xmp_video_Height_2)
  ------------------
  |  Branch (782:7): [True: 499, False: 2.26k]
  |  Branch (782:41): [True: 518, False: 1.74k]
  ------------------
  783|  1.01k|    height_ = value;
  784|  2.76k|  xmpData_[tag->_label] = value;
  785|  2.76k|}
_ZN5Exiv213MatroskaVideo17decodeBooleanTagsEPKNS_8Internal11MatroskaTagEPKh:
  787|  17.9k|void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf) {
  788|  17.9k|  const MatroskaTag* internalMt = nullptr;
  789|  17.9k|  uint64_t key = getULongLong(buf, bigEndian);
  790|  17.9k|  if (!key)
  ------------------
  |  Branch (790:7): [True: 3.34k, False: 14.6k]
  ------------------
  791|  3.34k|    return;
  792|       |
  793|  14.6k|  switch (tag->_id) {
  794|  3.75k|    case TrackType:  // this tags is used internally only to deduce the type of track (video or audio)
  ------------------
  |  Branch (794:5): [True: 3.75k, False: 10.8k]
  ------------------
  795|  3.75k|      if (auto f = Exiv2::find(matroskaTrackType, key)) {
  ------------------
  |  Branch (795:16): [True: 449, False: 3.30k]
  ------------------
  796|    449|        stream_ = f->_id;
  797|    449|      }
  798|  3.75k|      break;
  799|    466|    case TrackUsed:
  ------------------
  |  Branch (799:5): [True: 466, False: 14.1k]
  ------------------
  800|    466|      internalMt = Exiv2::find(trackEnable, key);
  801|    466|      break;
  802|  1.73k|    case TrackDefault:
  ------------------
  |  Branch (802:5): [True: 1.73k, False: 12.9k]
  ------------------
  803|  1.73k|      internalMt = Exiv2::find(defaultOn, key);
  804|  1.73k|      break;
  805|  1.32k|    case TrackForced:
  ------------------
  |  Branch (805:5): [True: 1.32k, False: 13.3k]
  ------------------
  806|  1.32k|      internalMt = Exiv2::find(trackForced, key);
  807|  1.32k|      break;
  808|    528|    case TrackLacing:
  ------------------
  |  Branch (808:5): [True: 528, False: 14.1k]
  ------------------
  809|    528|      internalMt = Exiv2::find(trackLacing, key);
  810|    528|      break;
  811|  6.23k|    case CodecDecodeAll:
  ------------------
  |  Branch (811:5): [True: 6.23k, False: 8.40k]
  ------------------
  812|  6.23k|      internalMt = Exiv2::find(codecDecodeAll, key);
  813|  6.23k|      break;
  814|    406|    case CodecSettings:
  ------------------
  |  Branch (814:5): [True: 406, False: 14.2k]
  ------------------
  815|    406|      internalMt = Exiv2::find(codecSettings, key);
  816|    406|      break;
  817|    195|    case Xmp_video_TagDefault:
  ------------------
  |  Branch (817:5): [True: 195, False: 14.4k]
  ------------------
  818|    195|      internalMt = tag;
  819|    195|      break;
  820|      0|    default:
  ------------------
  |  Branch (820:5): [True: 0, False: 14.6k]
  ------------------
  821|      0|      break;
  822|  14.6k|  }
  823|       |
  824|  14.6k|  if (internalMt) {
  ------------------
  |  Branch (824:7): [True: 1.45k, False: 13.1k]
  ------------------
  825|  1.45k|    xmpData_[internalMt->_label] = "Yes";
  826|  1.45k|  }
  827|  14.6k|}
_ZN5Exiv213MatroskaVideo14decodeDateTagsEPKNS_8Internal11MatroskaTagEPKhm:
  829|  1.90k|void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size_t size) {
  830|  1.90k|  int64_t duration_in_ms = 0;
  831|  1.90k|  uint64_t value;
  832|  1.90k|  switch (tag->_id) {
  833|  1.16k|    case Xmp_video_Duration:
  ------------------
  |  Branch (833:5): [True: 1.16k, False: 743]
  ------------------
  834|  1.16k|      if (size <= 4) {
  ------------------
  |  Branch (834:11): [True: 1.00k, False: 158]
  ------------------
  835|  1.00k|        duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0);
  836|  1.00k|      } else {
  837|    158|        duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
  838|    158|      }
  839|  1.16k|      xmpData_[tag->_label] = duration_in_ms;
  840|  1.16k|      break;
  841|    138|    case Xmp_video_DateUTC:
  ------------------
  |  Branch (841:5): [True: 138, False: 1.76k]
  ------------------
  842|    138|      value = getULongLong(buf, bigEndian);
  843|    138|      if (!value)
  ------------------
  |  Branch (843:11): [True: 68, False: 70]
  ------------------
  844|     68|        return;
  845|     70|      duration_in_ms = value / 1000000000;
  846|     70|      xmpData_[tag->_label] = duration_in_ms;
  847|     70|      break;
  848|       |
  849|    605|    case TimecodeScale:
  ------------------
  |  Branch (849:5): [True: 605, False: 1.30k]
  ------------------
  850|    605|      value = getULongLong(buf, bigEndian);
  851|    605|      if (!value)
  ------------------
  |  Branch (851:11): [True: 228, False: 377]
  ------------------
  852|    228|        return;
  853|    377|      time_code_scale_ = static_cast<double>(value) / static_cast<double>(1000000000);
  854|    377|      xmpData_[tag->_label] = time_code_scale_;
  855|    377|      break;
  856|      0|    default:
  ------------------
  |  Branch (856:5): [True: 0, False: 1.90k]
  ------------------
  857|      0|      break;
  858|  1.90k|  }
  859|  1.90k|}
_ZN5Exiv213MatroskaVideo15decodeFloatTagsEPKNS_8Internal11MatroskaTagEPKh:
  861|  2.78k|void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf) {
  862|  2.78k|  xmpData_[tag->_label] = getFloat(buf, bigEndian);
  863|       |
  864|  2.78k|  switch (tag->_id) {
  865|  1.22k|    case Xmp_audio_SampleRate:
  ------------------
  |  Branch (865:5): [True: 1.22k, False: 1.56k]
  ------------------
  866|  1.30k|    case Xmp_audio_OutputSampleRate:
  ------------------
  |  Branch (866:5): [True: 77, False: 2.71k]
  ------------------
  867|  1.30k|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  868|  1.30k|      break;
  869|      0|    case VideoFrameRate_DefaultDuration:
  ------------------
  |  Branch (869:5): [True: 0, False: 2.78k]
  ------------------
  870|  1.48k|    case Xmp_video_FrameRate: {
  ------------------
  |  Branch (870:5): [True: 1.48k, False: 1.30k]
  ------------------
  871|  1.48k|      uint64_t key = getULongLong(buf, bigEndian);
  872|  1.48k|      if (!key)
  ------------------
  |  Branch (872:11): [True: 104, False: 1.38k]
  ------------------
  873|    104|        return;
  874|  1.38k|      if (auto internalMt = Exiv2::find(streamRate, key)) {
  ------------------
  |  Branch (874:16): [True: 936, False: 444]
  ------------------
  875|    936|        double frame_rate = 0;
  876|    936|        switch (stream_) {
  877|    367|          case 1:  // video
  ------------------
  |  Branch (877:11): [True: 367, False: 569]
  ------------------
  878|    367|            frame_rate = 1000000000.0 / static_cast<double>(key);
  879|    367|            break;
  880|    138|          case 2:  // audio
  ------------------
  |  Branch (880:11): [True: 138, False: 798]
  ------------------
  881|    138|            frame_rate = static_cast<double>(key) / 1000;
  882|    138|            break;
  883|    431|          default:
  ------------------
  |  Branch (883:11): [True: 431, False: 505]
  ------------------
  884|    431|            break;
  885|    936|        }
  886|    936|        if (std::isgreater(frame_rate, 0.0))
  ------------------
  |  Branch (886:13): [True: 505, False: 431]
  ------------------
  887|    505|          xmpData_[internalMt->_label] = frame_rate;
  888|    936|      } else
  889|    444|        xmpData_[tag->_label] = "Variable Bit Rate";
  890|  1.38k|    } break;
  891|  1.38k|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.78k]
  ------------------
  892|      0|      xmpData_[tag->_label] = getFloat(buf, bigEndian);
  893|      0|      break;
  894|  2.78k|  }
  895|  2.78k|}
_ZN5Exiv213MatroskaVideo13findBlockSizeEh:
  897|   232k|uint32_t MatroskaVideo::findBlockSize(byte b) {
  898|   232k|  if (b & 128)
  ------------------
  |  Branch (898:7): [True: 193k, False: 39.1k]
  ------------------
  899|   193k|    return 1;
  900|  39.1k|  if (b & 64)
  ------------------
  |  Branch (900:7): [True: 19.8k, False: 19.2k]
  ------------------
  901|  19.8k|    return 2;
  902|  19.2k|  if (b & 32)
  ------------------
  |  Branch (902:7): [True: 4.57k, False: 14.6k]
  ------------------
  903|  4.57k|    return 3;
  904|  14.6k|  if (b & 16)
  ------------------
  |  Branch (904:7): [True: 8.47k, False: 6.17k]
  ------------------
  905|  8.47k|    return 4;
  906|  6.17k|  if (b & 8)
  ------------------
  |  Branch (906:7): [True: 1.87k, False: 4.30k]
  ------------------
  907|  1.87k|    return 5;
  908|  4.30k|  if (b & 4)
  ------------------
  |  Branch (908:7): [True: 391, False: 3.90k]
  ------------------
  909|    391|    return 6;
  910|  3.90k|  if (b & 2)
  ------------------
  |  Branch (910:7): [True: 469, False: 3.44k]
  ------------------
  911|    469|    return 7;
  912|  3.44k|  if (b & 1)
  ------------------
  |  Branch (912:7): [True: 2.75k, False: 686]
  ------------------
  913|  2.75k|    return 8;
  914|    686|  return 0;
  915|  3.44k|}
_ZN5Exiv214newMkvInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  917|  3.91k|Image::UniquePtr newMkvInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  918|  3.91k|  auto image = std::make_unique<MatroskaVideo>(std::move(io), params);
  919|  3.91k|  if (!image->good()) {
  ------------------
  |  Branch (919:7): [True: 0, False: 3.91k]
  ------------------
  920|      0|    return nullptr;
  921|      0|  }
  922|  3.91k|  return image;
  923|  3.91k|}
_ZN5Exiv29isMkvTypeERNS_7BasicIoEb:
  925|  17.3k|bool isMkvType(BasicIo& iIo, bool advance) {
  926|  17.3k|  bool result = true;
  927|  17.3k|  byte tmpBuf[4];
  928|  17.3k|  iIo.read(tmpBuf, 4);
  929|       |
  930|  17.3k|  if (iIo.error() || iIo.eof())
  ------------------
  |  Branch (930:7): [True: 0, False: 17.3k]
  |  Branch (930:22): [True: 567, False: 16.7k]
  ------------------
  931|    567|    return false;
  932|       |
  933|  16.7k|  if (0x1a != tmpBuf[0] || 0x45 != tmpBuf[1] || 0xdf != tmpBuf[2] || 0xa3 != tmpBuf[3]) {
  ------------------
  |  Branch (933:7): [True: 4.82k, False: 11.9k]
  |  Branch (933:28): [True: 72, False: 11.8k]
  |  Branch (933:49): [True: 85, False: 11.8k]
  |  Branch (933:70): [True: 71, False: 11.7k]
  ------------------
  934|  5.05k|    result = false;
  935|  5.05k|  }
  936|       |
  937|  16.7k|  if (!advance || !result)
  ------------------
  |  Branch (937:7): [True: 16.7k, False: 0]
  |  Branch (937:19): [True: 0, False: 0]
  ------------------
  938|  16.7k|    iIo.seek(0, BasicIo::beg);
  939|  16.7k|  return result;
  940|  17.3k|}
matroskavideo.cpp:_ZN5Exiv28InternalL14returnTagValueEPKhm:
  582|   232k|[[nodiscard]] static size_t returnTagValue(const byte* buf, size_t size) {
  583|   232k|  enforce(size > 0 && size <= 8, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (583:11): [True: 231k, False: 686]
  |  Branch (583:23): [True: 231k, False: 0]
  ------------------
  584|       |
  585|   232k|  size_t b0 = buf[0] & (0xff >> size);
  586|   232k|  size_t tag = b0 << ((size - 1) * 8);
  587|   317k|  for (size_t i = 1; i < size; ++i) {
  ------------------
  |  Branch (587:22): [True: 85.6k, False: 232k]
  ------------------
  588|  85.6k|    tag |= static_cast<size_t>(buf[i]) << ((size - i - 1) * 8);
  589|  85.6k|  }
  590|       |
  591|   232k|  return tag;
  592|   232k|}
matroskavideo.cpp:_ZZN5Exiv213MatroskaVideo18decodeInternalTagsEPKNS_8Internal11MatroskaTagEPKhENK3$_0clEv:
  723|  10.7k|  auto internalMt = [=]() -> const MatroskaTag* {
  724|  10.7k|    switch (tag->_id) {
  ------------------
  |  Branch (724:13): [True: 10.7k, False: 0]
  ------------------
  725|    633|      case Xmp_video_VideoScanTpye:
  ------------------
  |  Branch (725:7): [True: 633, False: 10.1k]
  ------------------
  726|    633|        return Exiv2::find(videoScanType, key);
  727|  1.07k|      case Xmp_audio_ChannelType:
  ------------------
  |  Branch (727:7): [True: 1.07k, False: 9.68k]
  ------------------
  728|  1.07k|        return Exiv2::find(audioChannels, key);
  729|    404|      case Xmp_video_ContentCompressAlgo:
  ------------------
  |  Branch (729:7): [True: 404, False: 10.3k]
  ------------------
  730|    404|        return Exiv2::find(compressionAlgorithm, key);
  731|    653|      case Xmp_video_ContentEncryptAlgo:
  ------------------
  |  Branch (731:7): [True: 653, False: 10.1k]
  ------------------
  732|    653|        return Exiv2::find(encryptionAlgorithm, key);
  733|    213|      case Xmp_video_ContentSignAlgo_1:
  ------------------
  |  Branch (733:7): [True: 213, False: 10.5k]
  ------------------
  734|    949|      case Xmp_video_ContentSignAlgo_2:
  ------------------
  |  Branch (734:7): [True: 736, False: 10.0k]
  ------------------
  735|    949|        return Exiv2::find(contentSignatureAlgorithm, key);
  736|    147|      case Xmp_video_ContentSignHashAlgo_1:
  ------------------
  |  Branch (736:7): [True: 147, False: 10.6k]
  ------------------
  737|  1.04k|      case Xmp_video_ContentSignHashAlgo_2:
  ------------------
  |  Branch (737:7): [True: 895, False: 9.86k]
  ------------------
  738|  1.04k|        return Exiv2::find(contentSignatureHashAlgorithm, key);
  739|    629|      case Xmp_video_ContentEncodingType:
  ------------------
  |  Branch (739:7): [True: 629, False: 10.1k]
  ------------------
  740|    629|        return Exiv2::find(encodingType, key);
  741|  1.24k|      case Xmp_video_DisplayUnit:
  ------------------
  |  Branch (741:7): [True: 1.24k, False: 9.52k]
  ------------------
  742|  1.24k|        return Exiv2::find(displayUnit, key);
  743|    380|      case Xmp_video_AspectRatioType:
  ------------------
  |  Branch (743:7): [True: 380, False: 10.3k]
  ------------------
  744|    380|        return Exiv2::find(aspectRatioType, key);
  745|  2.63k|      case Xmp_video_PhysicalEquivalent:
  ------------------
  |  Branch (745:7): [True: 2.63k, False: 8.12k]
  ------------------
  746|  2.63k|        return Exiv2::find(chapterPhysicalEquivalent, key);
  747|    847|      case Xmp_video_TranslateCodec:
  ------------------
  |  Branch (747:7): [True: 847, False: 9.91k]
  ------------------
  748|    847|        return Exiv2::find(chapterTranslateCodec, key);
  749|      0|      case Video_Audio_CodecID:
  ------------------
  |  Branch (749:7): [True: 0, False: 10.7k]
  ------------------
  750|      0|        return Exiv2::find(trackCodec, key);
  751|    135|      case Video_Audio_CodecName:
  ------------------
  |  Branch (751:7): [True: 135, False: 10.6k]
  ------------------
  752|    135|        return Exiv2::find(codecInfo, key);
  753|      0|      case CodecDownloadURL:
  ------------------
  |  Branch (753:7): [True: 0, False: 10.7k]
  ------------------
  754|    141|      case CodecInfoURL:
  ------------------
  |  Branch (754:7): [True: 141, False: 10.6k]
  ------------------
  755|    141|        return Exiv2::find(codecDownloadUrl, key);
  756|  10.7k|    }
  757|      0|    return nullptr;
  758|  10.7k|  }();

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

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

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

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

_ZN5Exiv28Internal16OlympusMakerNote7tagListEv:
   33|   125k|  static constexpr auto tagList() {
   34|   125k|    return tagInfo_;
   35|   125k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListCsEv:
   37|  68.7k|  static constexpr auto tagListCs() {
   38|  68.7k|    return tagInfoCs_;
   39|  68.7k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListEqEv:
   41|    449|  static constexpr auto tagListEq() {
   42|    449|    return tagInfoEq_;
   43|    449|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRdEv:
   45|  3.53k|  static constexpr auto tagListRd() {
   46|  3.53k|    return tagInfoRd_;
   47|  3.53k|  }
_ZN5Exiv28Internal16OlympusMakerNote10tagListRd2Ev:
   49|    455|  static constexpr auto tagListRd2() {
   50|    455|    return tagInfoRd2_;
   51|    455|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListIpEv:
   53|    814|  static constexpr auto tagListIp() {
   54|    814|    return tagInfoIp_;
   55|    814|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFiEv:
   57|    478|  static constexpr auto tagListFi() {
   58|    478|    return tagInfoFi_;
   59|    478|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListFeEv:
   61|  3.01k|  static constexpr auto tagListFe() {
   62|  3.01k|    return tagInfoFe_;
   63|  3.01k|  }
_ZN5Exiv28Internal16OlympusMakerNote9tagListRiEv:
   65|    682|  static constexpr auto tagListRi() {
   66|    682|    return tagInfoRi_;
   67|    682|  }

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

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

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

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

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

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

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

_ZN5Exiv28PngImageC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
   56|  2.69k|    Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io), params) {
   57|  2.69k|  if (params.create() && io_->open() == 0) {
  ------------------
  |  Branch (57:7): [True: 459, False: 2.23k]
  |  Branch (57:26): [True: 459, False: 0]
  ------------------
   58|       |#ifdef EXIV2_DEBUG_MESSAGES
   59|       |    std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
   60|       |#endif
   61|    459|    IoCloser closer(*io_);
   62|    459|    if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank)) {
  ------------------
  |  Branch (62:9): [True: 0, False: 459]
  ------------------
   63|       |#ifdef EXIV2_DEBUG_MESSAGES
   64|       |      std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
   65|       |#endif
   66|      0|    }
   67|    459|  }
   68|  2.69k|}
_ZN5Exiv28PngImage12readMetadataEv:
  392|  2.23k|void PngImage::readMetadata() {
  393|       |#ifdef EXIV2_DEBUG_MESSAGES
  394|       |  std::cerr << "Exiv2::PngImage::readMetadata: Reading PNG file " << io_->path() << '\n';
  395|       |#endif
  396|  2.23k|  if (io_->open() != 0) {
  ------------------
  |  Branch (396:7): [True: 0, False: 2.23k]
  ------------------
  397|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  398|      0|  }
  399|  2.23k|  IoCloser closer(*io_);
  400|  2.23k|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (400:7): [True: 0, False: 2.23k]
  ------------------
  401|      0|    throw Error(ErrorCode::kerNotAnImage, "PNG");
  402|      0|  }
  403|  2.23k|  clearMetadata();
  404|       |
  405|  2.23k|  const size_t imgSize = io_->size();
  406|  2.23k|  DataBuf cheaderBuf(8);  // Chunk header: 4 bytes (data size) + 4 bytes (chunk type).
  407|  2.23k|  const DecodeParams dp(max_recursion_depth_);
  408|       |
  409|  43.3k|  while (!io_->eof()) {
  ------------------
  |  Branch (409:10): [True: 42.1k, False: 1.28k]
  ------------------
  410|  42.1k|    readChunk(cheaderBuf, *io_);  // Read chunk header.
  411|       |
  412|       |    // Decode chunk data length.
  413|  42.1k|    uint32_t chunkLength = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  414|  42.1k|    if (chunkLength > imgSize - io_->tell()) {
  ------------------
  |  Branch (414:9): [True: 424, False: 41.6k]
  ------------------
  415|    424|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  416|    424|    }
  417|       |
  418|  41.6k|    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|  41.6k|    if (chunkType == "IEND" || chunkType == "IHDR" || chunkType == "tEXt" || chunkType == "zTXt" ||
  ------------------
  |  Branch (425:9): [True: 410, False: 41.2k]
  |  Branch (425:32): [True: 6.05k, False: 35.2k]
  |  Branch (425:55): [True: 4.10k, False: 31.1k]
  |  Branch (425:78): [True: 405, False: 30.7k]
  ------------------
  426|  30.7k|        chunkType == "eXIf" || chunkType == "iTXt" || chunkType == "iCCP") {
  ------------------
  |  Branch (426:9): [True: 358, False: 30.3k]
  |  Branch (426:32): [True: 8.82k, False: 21.5k]
  |  Branch (426:55): [True: 618, False: 20.9k]
  ------------------
  427|  20.6k|      DataBuf chunkData(chunkLength);
  428|  20.6k|      if (chunkLength > 0) {
  ------------------
  |  Branch (428:11): [True: 14.1k, False: 6.45k]
  ------------------
  429|  14.1k|        readChunk(chunkData, *io_);  // Extract chunk data.
  430|  14.1k|      }
  431|       |
  432|  20.6k|      if (chunkType == "IEND") {
  ------------------
  |  Branch (432:11): [True: 242, False: 20.3k]
  ------------------
  433|    242|        return;  // Last chunk found: we stop parsing.
  434|    242|      }
  435|  20.3k|      if (chunkType == "IHDR" && chunkData.size() >= 8) {
  ------------------
  |  Branch (435:11): [True: 6.05k, False: 14.3k]
  |  Branch (435:34): [True: 102, False: 5.95k]
  ------------------
  436|    102|        PngChunk::decodeIHDRChunk(chunkData, &pixelWidth_, &pixelHeight_);
  437|  20.2k|      } else if (chunkType == "tEXt") {
  ------------------
  |  Branch (437:18): [True: 4.10k, False: 16.1k]
  ------------------
  438|  4.10k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::tEXt_Chunk, dp);
  439|  16.1k|      } else if (chunkType == "zTXt") {
  ------------------
  |  Branch (439:18): [True: 405, False: 15.7k]
  ------------------
  440|    405|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::zTXt_Chunk, dp);
  441|  15.7k|      } else if (chunkType == "iTXt") {
  ------------------
  |  Branch (441:18): [True: 8.82k, False: 6.92k]
  ------------------
  442|  8.82k|        PngChunk::decodeTXTChunk(this, chunkData, PngChunk::iTXt_Chunk, dp);
  443|  8.82k|      } else if (chunkType == "eXIf") {
  ------------------
  |  Branch (443:18): [True: 358, False: 6.57k]
  ------------------
  444|    358|        ByteOrder bo = TiffParser::decode(exifData(), iptcData(), xmpData(), chunkData.c_data(), chunkData.size(), dp);
  445|    358|        setByteOrder(bo);
  446|  6.57k|      } else if (chunkType == "iCCP") {
  ------------------
  |  Branch (446:18): [True: 618, False: 5.95k]
  ------------------
  447|       |        // The ICC profile name can vary from 1-79 characters.
  448|    618|        uint32_t iccOffset = 0;
  449|  6.45k|        do {
  450|  6.45k|          enforce(iccOffset < 80 && iccOffset < chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  ------------------
  |  Branch (450:19): [True: 6.45k, False: 3]
  |  Branch (450:37): [True: 6.43k, False: 16]
  ------------------
  451|  6.45k|        } while (chunkData.read_uint8(iccOffset++) != 0x00);
  ------------------
  |  Branch (451:18): [True: 5.83k, False: 618]
  ------------------
  452|       |
  453|    618|        profileName_ = std::string(chunkData.c_str(), iccOffset - 1);
  454|    618|        ++iccOffset;  // +1 = 'compressed' flag
  455|    618|        enforce(iccOffset <= chunkLength, Exiv2::ErrorCode::kerCorruptedMetadata);
  456|       |
  457|    618|        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|    618|      }
  463|       |
  464|       |      // Set chunkLength to 0 in case we have read a supported chunk type. Otherwise, we need to seek the
  465|       |      // file to the next chunk position.
  466|  20.3k|      chunkLength = 0;
  467|  20.3k|    }
  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|  41.4k|    io_->seek(chunkLength + 4, BasicIo::cur);
  474|  41.4k|    if (io_->error() || io_->eof()) {
  ------------------
  |  Branch (474:9): [True: 1.28k, False: 40.1k]
  |  Branch (474:25): [True: 289, False: 39.8k]
  ------------------
  475|    289|      throw Error(ErrorCode::kerFailedToReadImageData);
  476|    289|    }
  477|  41.4k|  }
  478|  2.23k|}  // PngImage::readMetadata
_ZN5Exiv28PngImage13writeMetadataEv:
  480|    690|void PngImage::writeMetadata() {
  481|    690|  if (io_->open() != 0) {
  ------------------
  |  Branch (481:7): [True: 0, False: 690]
  ------------------
  482|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  483|      0|  }
  484|    690|  IoCloser closer(*io_);
  485|    690|  MemIo tempIo;
  486|       |
  487|    690|  doWriteMetadata(tempIo);  // may throw
  488|    690|  io_->close();
  489|    690|  io_->transfer(tempIo);  // may throw
  490|       |
  491|    690|}  // PngImage::writeMetadata
_ZN5Exiv28PngImage15doWriteMetadataERNS_7BasicIoE:
  493|    690|void PngImage::doWriteMetadata(BasicIo& outIo) {
  494|    690|  if (!io_->isopen())
  ------------------
  |  Branch (494:7): [True: 0, False: 690]
  ------------------
  495|      0|    throw Error(ErrorCode::kerInputDataReadFailed);
  496|    690|  if (!outIo.isopen())
  ------------------
  |  Branch (496:7): [True: 0, False: 690]
  ------------------
  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|    690|  if (!isPngType(*io_, true)) {
  ------------------
  |  Branch (504:7): [True: 0, False: 690]
  ------------------
  505|      0|    throw Error(ErrorCode::kerNoImageInInputData);
  506|      0|  }
  507|       |
  508|       |  // Write PNG Signature.
  509|    690|  if (outIo.write(pngSignature.data(), 8) != 8)
  ------------------
  |  Branch (509:7): [True: 0, False: 690]
  ------------------
  510|      0|    throw Error(ErrorCode::kerImageWriteFailed);
  511|       |
  512|    690|  DataBuf cheaderBuf(8);  // Chunk header : 4 bytes (data size) + 4 bytes (chunk type).
  513|       |
  514|  18.3k|  while (!io_->eof()) {
  ------------------
  |  Branch (514:10): [True: 18.3k, False: 3]
  ------------------
  515|       |    // Read chunk header.
  516|  18.3k|    size_t bufRead = io_->read(cheaderBuf.data(), 8);
  517|  18.3k|    if (io_->error())
  ------------------
  |  Branch (517:9): [True: 0, False: 18.3k]
  ------------------
  518|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  519|  18.3k|    if (bufRead != 8)
  ------------------
  |  Branch (519:9): [True: 0, False: 18.3k]
  ------------------
  520|      0|      throw Error(ErrorCode::kerInputDataReadFailed);
  521|       |
  522|       |    // Decode chunk data length.
  523|       |
  524|  18.3k|    uint32_t dataOffset = cheaderBuf.read_uint32(0, Exiv2::bigEndian);
  525|  18.3k|    if (dataOffset > 0x7FFFFFFF)
  ------------------
  |  Branch (525:9): [True: 0, False: 18.3k]
  ------------------
  526|      0|      throw Exiv2::Error(ErrorCode::kerFailedToReadImageData);
  527|       |
  528|       |    // Read whole chunk : Chunk header + Chunk data (not fixed size - can be null) + CRC (4 bytes).
  529|       |
  530|  18.3k|    DataBuf chunkBuf(8 + dataOffset + 4);  // Chunk header (8 bytes) + Chunk data + CRC (4 bytes).
  531|  18.3k|    std::copy(cheaderBuf.begin(), cheaderBuf.end(), chunkBuf.begin());  // Copy header.
  532|  18.3k|    bufRead = io_->read(chunkBuf.data(8), dataOffset + 4);              // Extract chunk data + CRC
  533|  18.3k|    if (io_->error())
  ------------------
  |  Branch (533:9): [True: 0, False: 18.3k]
  ------------------
  534|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  535|  18.3k|    if (bufRead != dataOffset + 4)
  ------------------
  |  Branch (535:9): [True: 117, False: 18.2k]
  ------------------
  536|    117|      throw Error(ErrorCode::kerInputDataReadFailed);
  537|       |
  538|  18.2k|    const std::string szChunk(cheaderBuf.begin() + 4, cheaderBuf.end());
  539|       |
  540|  18.2k|    if (szChunk == "IEND") {
  ------------------
  |  Branch (540:9): [True: 570, False: 17.6k]
  ------------------
  541|       |      // Last chunk found: we write it and done.
  542|       |#ifdef EXIV2_DEBUG_MESSAGES
  543|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IEND chunk (length: " << dataOffset << ")\n";
  544|       |#endif
  545|    570|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (545:11): [True: 0, False: 570]
  ------------------
  546|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  547|    570|      return;
  548|    570|    }
  549|  17.6k|    if (szChunk == "eXIf" || szChunk == "iCCP") {
  ------------------
  |  Branch (549:9): [True: 32, False: 17.6k]
  |  Branch (549:30): [True: 102, False: 17.5k]
  ------------------
  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|  17.5k|    } else if (szChunk == "IHDR") {
  ------------------
  |  Branch (556:16): [True: 3.51k, False: 14.0k]
  ------------------
  557|       |#ifdef EXIV2_DEBUG_MESSAGES
  558|       |      std::cout << "Exiv2::PngImage::doWriteMetadata: Write IHDR chunk (length: " << dataOffset << ")\n";
  559|       |#endif
  560|  3.51k|      if (outIo.write(chunkBuf.data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (560:11): [True: 0, False: 3.51k]
  ------------------
  561|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  562|       |
  563|       |      // Write all updated metadata here, just after IHDR.
  564|  3.51k|      if (!comment_.empty()) {
  ------------------
  |  Branch (564:11): [True: 1.93k, False: 1.57k]
  ------------------
  565|       |        // Update Comment data to a new PNG chunk
  566|  1.93k|        std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
  567|  1.93k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (567:13): [True: 0, False: 1.93k]
  ------------------
  568|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  569|      0|        }
  570|  1.93k|      }
  571|       |
  572|  3.51k|      if (!exifData_.empty()) {
  ------------------
  |  Branch (572:11): [True: 269, False: 3.24k]
  ------------------
  573|       |        // Update Exif data to a new PNG chunk
  574|    269|        Blob blob;
  575|    269|        ExifParser::encode(blob, littleEndian, exifData_);
  576|    269|        if (!blob.empty()) {
  ------------------
  |  Branch (576:13): [True: 248, False: 21]
  ------------------
  577|    248|          byte length[4];
  578|    248|          ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
  579|       |
  580|       |          // calculate CRC
  581|    248|          uLong tmp = crc32(0L, Z_NULL, 0);
  582|    248|          tmp = crc32(tmp, typeExif, 4);
  583|    248|          tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
  584|    248|          byte crc[4];
  585|    248|          ul2Data(crc, tmp, bigEndian);
  586|       |
  587|    248|          if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
  ------------------
  |  Branch (587:15): [True: 0, False: 248]
  |  Branch (587:46): [True: 0, False: 248]
  ------------------
  588|    248|              outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (588:15): [True: 0, False: 248]
  |  Branch (588:71): [True: 0, False: 248]
  ------------------
  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|    248|        }
  596|    269|      }
  597|       |
  598|  3.51k|      if (!iptcData_.empty()) {
  ------------------
  |  Branch (598:11): [True: 113, False: 3.40k]
  ------------------
  599|       |        // Update IPTC data to a new PNG chunk
  600|    113|        DataBuf newPsData = Photoshop::setIptcIrb(nullptr, 0, iptcData_);
  601|    113|        if (!newPsData.empty()) {
  ------------------
  |  Branch (601:13): [True: 113, False: 0]
  ------------------
  602|    113|          std::string rawIptc(newPsData.c_str(), newPsData.size());
  603|    113|          std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
  604|    113|          if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (604:15): [True: 0, False: 113]
  ------------------
  605|      0|            throw Error(ErrorCode::kerImageWriteFailed);
  606|      0|          }
  607|    113|        }
  608|    113|      }
  609|       |
  610|  3.51k|      if (iccProfileDefined()) {
  ------------------
  |  Branch (610:11): [True: 297, False: 3.21k]
  ------------------
  611|    297|        DataBuf compressed;
  612|    297|        enforce(iccProfile_.size() <= std::numeric_limits<uLongf>::max(), ErrorCode::kerCorruptedMetadata);
  613|    297|        if (zlibToCompressed(iccProfile_.c_data(), static_cast<uLongf>(iccProfile_.size()), compressed)) {
  ------------------
  |  Branch (613:13): [True: 297, False: 0]
  ------------------
  614|    297|          const auto nameLength = static_cast<uint32_t>(profileName_.size());
  615|    297|          const uint32_t chunkLength = nameLength + 2 + static_cast<uint32_t>(compressed.size());
  616|    297|          byte length[4];
  617|    297|          ul2Data(length, chunkLength, bigEndian);
  618|       |
  619|       |          // calculate CRC
  620|    297|          uLong tmp = crc32(0L, Z_NULL, 0);
  621|    297|          tmp = crc32(tmp, typeICCP, 4);
  622|    297|          tmp = crc32(tmp, reinterpret_cast<const Bytef*>(profileName_.data()), nameLength);
  623|    297|          tmp = crc32(tmp, nullComp, 2);
  624|    297|          tmp = crc32(tmp, compressed.c_data(), static_cast<uint32_t>(compressed.size()));
  625|    297|          byte crc[4];
  626|    297|          ul2Data(crc, tmp, bigEndian);
  627|       |
  628|    297|          if (outIo.write(length, 4) != 4 || outIo.write(typeICCP, 4) != 4 ||
  ------------------
  |  Branch (628:15): [True: 0, False: 297]
  |  Branch (628:46): [True: 0, False: 297]
  ------------------
  629|    297|              outIo.write(reinterpret_cast<const byte*>(profileName_.data()), nameLength) != nameLength ||
  ------------------
  |  Branch (629:15): [True: 0, False: 297]
  ------------------
  630|    297|              outIo.write(nullComp, 2) != 2 ||
  ------------------
  |  Branch (630:15): [True: 0, False: 297]
  ------------------
  631|    297|              outIo.write(compressed.c_data(), compressed.size()) != compressed.size() || outIo.write(crc, 4) != 4) {
  ------------------
  |  Branch (631:15): [True: 0, False: 297]
  |  Branch (631:91): [True: 0, False: 297]
  ------------------
  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|    297|        }
  639|    297|      }
  640|       |
  641|  3.51k|      if (!writeXmpFromPacket() && XmpParser::encode(xmpPacket_, xmpData_) > 1) {
  ------------------
  |  Branch (641:11): [True: 3.51k, False: 3]
  |  Branch (641:36): [True: 49, False: 3.46k]
  ------------------
  642|     49|#ifndef SUPPRESS_WARNINGS
  643|     49|        EXV_ERROR << "Failed to encode XMP metadata.\n";
  ------------------
  |  |  142|     49|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 49]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     49|  LogMsg(LogMsg::error).os()
  ------------------
  644|     49|#endif
  645|     49|      }
  646|  3.51k|      if (!xmpPacket_.empty()) {
  ------------------
  |  Branch (646:11): [True: 2.08k, False: 1.42k]
  ------------------
  647|       |        // Update XMP data to a new PNG chunk
  648|  2.08k|        std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
  649|  2.08k|        if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) {
  ------------------
  |  Branch (649:13): [True: 0, False: 2.08k]
  ------------------
  650|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  651|      0|        }
  652|  2.08k|      }
  653|  14.0k|    } else if (szChunk == "tEXt" || szChunk == "zTXt" || szChunk == "iTXt") {
  ------------------
  |  Branch (653:16): [True: 1.94k, False: 12.0k]
  |  Branch (653:37): [True: 49, False: 12.0k]
  |  Branch (653:58): [True: 2.29k, False: 9.70k]
  ------------------
  654|  4.29k|      DataBuf key = PngChunk::keyTXTChunk(chunkBuf, true);
  655|  4.29k|      if (!key.empty() && (compare("Raw profile type exif", key) || compare("Raw profile type APP1", key) ||
  ------------------
  |  Branch (655:11): [True: 4.13k, False: 157]
  |  Branch (655:28): [True: 33, False: 4.10k]
  |  Branch (655:69): [True: 13, False: 4.09k]
  ------------------
  656|  4.09k|                           compare("Raw profile type iptc", key) || compare("Raw profile type xmp", key) ||
  ------------------
  |  Branch (656:28): [True: 692, False: 3.40k]
  |  Branch (656:69): [True: 8, False: 3.39k]
  ------------------
  657|  3.39k|                           compare("XML:com.adobe.xmp", key) || compare("Description", key))) {
  ------------------
  |  Branch (657:28): [True: 292, False: 3.10k]
  |  Branch (657:65): [True: 1.72k, False: 1.37k]
  ------------------
  658|       |#ifdef EXIV2_DEBUG_MESSAGES
  659|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
  660|       |                  << '\n';
  661|       |#endif
  662|  2.76k|      } else {
  663|       |#ifdef EXIV2_DEBUG_MESSAGES
  664|       |        std::cout << "Exiv2::PngImage::doWriteMetadata: write " << szChunk << " chunk (length: " << dataOffset << ")"
  665|       |                  << '\n';
  666|       |#endif
  667|  1.53k|        if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (667:13): [True: 0, False: 1.53k]
  ------------------
  668|      0|          throw Error(ErrorCode::kerImageWriteFailed);
  669|  1.53k|      }
  670|  9.70k|    } else {
  671|       |      // Write all others chunk as well.
  672|       |#ifdef EXIV2_DEBUG_MESSAGES
  673|       |      std::cout << "Exiv2::PngImage::doWriteMetadata:  copy " << szChunk << " chunk (length: " << dataOffset << ")"
  674|       |                << '\n';
  675|       |#endif
  676|  9.70k|      if (outIo.write(chunkBuf.c_data(), chunkBuf.size()) != chunkBuf.size())
  ------------------
  |  Branch (676:11): [True: 0, False: 9.70k]
  ------------------
  677|      0|        throw Error(ErrorCode::kerImageWriteFailed);
  678|  9.70k|    }
  679|  17.6k|  }
  680|       |
  681|    690|}  // PngImage::doWriteMetadata
_ZN5Exiv214newPngInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  685|  2.69k|Image::UniquePtr newPngInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  686|  2.69k|  auto image = std::make_unique<PngImage>(std::move(io), params);
  687|  2.69k|  if (!image->good()) {
  ------------------
  |  Branch (687:7): [True: 0, False: 2.69k]
  ------------------
  688|      0|    return nullptr;
  689|      0|  }
  690|  2.69k|  return image;
  691|  2.69k|}
_ZN5Exiv29isPngTypeERNS_7BasicIoEb:
  693|  40.3k|bool isPngType(BasicIo& iIo, bool advance) {
  694|  40.3k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (694:7): [True: 0, False: 40.3k]
  |  Branch (694:22): [True: 272, False: 40.1k]
  ------------------
  695|    272|    throw Error(ErrorCode::kerInputDataReadFailed);
  696|    272|  }
  697|  40.1k|  const int32_t len = 8;
  698|  40.1k|  std::array<byte, len> buf;
  699|  40.1k|  iIo.read(buf.data(), len);
  700|  40.1k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (700:7): [True: 0, False: 40.1k]
  |  Branch (700:22): [True: 0, False: 40.1k]
  ------------------
  701|      0|    return false;
  702|      0|  }
  703|  40.1k|  bool rc = buf == pngSignature;
  704|  40.1k|  if (!advance || !rc) {
  ------------------
  |  Branch (704:7): [True: 37.1k, False: 2.92k]
  |  Branch (704:19): [True: 0, False: 2.92k]
  ------------------
  705|  37.1k|    iIo.seek(-len, BasicIo::cur);
  706|  37.1k|  }
  707|       |
  708|  40.1k|  return rc;
  709|  40.1k|}
pngimage.cpp:_ZN5Exiv2L13zlibToDataBufEPKhmRNS_7DataBufE:
   74|    580|static bool zlibToDataBuf(const byte* bytes, uLongf length, DataBuf& result) {
   75|    580|  uLongf uncompressedLen = length;  // just a starting point
   76|    580|  int zlibResult = Z_BUF_ERROR;
   77|       |
   78|  1.34k|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (78:10): [True: 764, False: 580]
  ------------------
   79|    764|    result.alloc(uncompressedLen);
   80|    764|    zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   81|       |    // if result buffer is large than necessary, redo to fit perfectly.
   82|    764|    if (zlibResult == Z_OK && uncompressedLen < result.size()) {
  ------------------
  |  Branch (82:9): [True: 60, False: 704]
  |  Branch (82:31): [True: 4, False: 56]
  ------------------
   83|      4|      result.reset();
   84|       |
   85|      4|      result.alloc(uncompressedLen);
   86|      4|      zlibResult = uncompress(result.data(), &uncompressedLen, bytes, length);
   87|      4|    }
   88|    764|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (88:9): [True: 184, False: 580]
  ------------------
   89|       |      // the uncompressed buffer needs to be larger
   90|    184|      result.reset();
   91|       |
   92|       |      // Sanity - never bigger than 16mb
   93|    184|      if (uncompressedLen > 16 * 1024 * 1024)
  ------------------
  |  Branch (93:11): [True: 0, False: 184]
  ------------------
   94|      0|        zlibResult = Z_DATA_ERROR;
   95|    184|      else
   96|    184|        uncompressedLen *= 2;
   97|    184|    }
   98|    764|  }
   99|       |
  100|       |  return zlibResult == Z_OK;
  101|    580|}
pngimage.cpp:_ZN5Exiv2L9readChunkERNS_7DataBufERNS_7BasicIoE:
  379|  56.2k|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|  56.2k|  const size_t bufRead = io.read(buffer.data(), buffer.size());
  384|  56.2k|  if (io.error()) {
  ------------------
  |  Branch (384:7): [True: 0, False: 56.2k]
  ------------------
  385|      0|    throw Error(ErrorCode::kerFailedToReadImageData);
  386|      0|  }
  387|  56.2k|  if (bufRead != buffer.size()) {
  ------------------
  |  Branch (387:7): [True: 168, False: 56.0k]
  ------------------
  388|    168|    throw Error(ErrorCode::kerInputDataReadFailed);
  389|    168|  }
  390|  56.2k|}
pngimage.cpp:_ZN5Exiv2L16zlibToCompressedEPKhmRNS_7DataBufE:
  103|    297|static bool zlibToCompressed(const byte* bytes, uLongf length, DataBuf& result) {
  104|    297|  uLongf compressedLen = length;  // just a starting point
  105|    297|  int zlibResult = Z_BUF_ERROR;
  106|       |
  107|    680|  while (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (107:10): [True: 383, False: 297]
  ------------------
  108|    383|    result.alloc(compressedLen);
  109|    383|    zlibResult = compress(result.data(), &compressedLen, bytes, length);
  110|    383|    if (zlibResult == Z_BUF_ERROR) {
  ------------------
  |  Branch (110:9): [True: 86, False: 297]
  ------------------
  111|       |      // the compressedArray needs to be larger
  112|     86|      result.reset();
  113|     86|      compressedLen *= 2;
  114|    297|    } else {
  115|    297|      result.reset();
  116|    297|      result.alloc(compressedLen);
  117|    297|      zlibResult = compress(result.data(), &compressedLen, bytes, length);
  118|    297|    }
  119|    383|  }
  120|       |
  121|       |  return zlibResult == Z_OK;
  122|    297|}
pngimage.cpp:_ZN12_GLOBAL__N_17compareENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERKN5Exiv27DataBufE:
   44|  22.2k|bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
   45|  22.2k|  const auto minlen = std::min<size_t>(str.size(), buf.size());
   46|  22.2k|  return buf.cmpBytes(0, str.data(), minlen) == 0;
   47|  22.2k|}

_ZN5Exiv212PreviewImageC2ENS_17PreviewPropertiesEONS_7DataBufE:
  990|  3.35k|    properties_(std::move(properties)), preview_(std::move(data)) {
  991|  3.35k|}
_ZNK5Exiv212PreviewImage5pDataEv:
 1017|  3.35k|const byte* PreviewImage::pData() const {
 1018|  3.35k|  return preview_.c_data();
 1019|  3.35k|}
_ZNK5Exiv212PreviewImage4sizeEv:
 1021|  3.35k|uint32_t PreviewImage::size() const {
 1022|  3.35k|  return static_cast<uint32_t>(preview_.size());
 1023|  3.35k|}
_ZN5Exiv214PreviewManagerC2ERKNS_5ImageE:
 1045|  15.5k|PreviewManager::PreviewManager(const Image& image) : image_(image) {
 1046|  15.5k|}
_ZNK5Exiv214PreviewManager20getPreviewPropertiesEv:
 1048|  15.5k|PreviewPropertiesList PreviewManager::getPreviewProperties() const {
 1049|  15.5k|  PreviewPropertiesList list;
 1050|       |  // go through the loader table and store all successfully created loaders in the list
 1051|   537k|  for (PreviewId id = 0; id < Loader::getNumLoaders(); ++id) {
  ------------------
  |  Branch (1051:26): [True: 522k, False: 15.5k]
  ------------------
 1052|   522k|    auto loader = Loader::create(id, image_);
 1053|   522k|    if (loader && loader->readDimensions()) {
  ------------------
  |  Branch (1053:9): [True: 32.6k, False: 489k]
  |  Branch (1053:19): [True: 17.7k, False: 14.8k]
  ------------------
 1054|  17.7k|      PreviewProperties props = loader->getProperties();
 1055|  17.7k|      DataBuf buf = loader->getData();  // #16 getPreviewImage()
 1056|  17.7k|      props.size_ = buf.size();         //     update the size
 1057|  17.7k|      list.push_back(std::move(props));
 1058|  17.7k|    }
 1059|   522k|  }
 1060|  15.5k|  std::sort(list.begin(), list.end(),
 1061|  15.5k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });
 1062|       |
 1063|  15.5k|  return list;
 1064|  15.5k|}
_ZNK5Exiv214PreviewManager15getPreviewImageERKNS_17PreviewPropertiesE:
 1066|  3.35k|PreviewImage PreviewManager::getPreviewImage(const PreviewProperties& properties) const {
 1067|  3.35k|  auto loader = Loader::create(properties.id_, image_);
 1068|  3.35k|  DataBuf buf;
 1069|  3.35k|  if (loader) {
  ------------------
  |  Branch (1069:7): [True: 3.35k, False: 0]
  ------------------
 1070|  3.35k|    buf = loader->getData();
 1071|  3.35k|  }
 1072|       |
 1073|  3.35k|  return {properties, std::move(buf)};
 1074|  3.35k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader13getNumLoadersEv:
  350|  1.06M|PreviewId Loader::getNumLoaders() {
  351|  1.06M|  return PreviewId{std::size(loaderList_)};
  352|  1.06M|}
preview.cpp:_ZN12_GLOBAL__N_118createLoaderNativeEiRKN5Exiv25ImageEi:
  368|  62.0k|Loader::UniquePtr createLoaderNative(PreviewId id, const Image& image, int parIdx) {
  369|  62.0k|  return std::make_unique<LoaderNative>(id, image, parIdx);
  370|  62.0k|}
preview.cpp:_ZN12_GLOBAL__N_112LoaderNativeC2EiRKN5Exiv25ImageEi:
  354|  62.0k|LoaderNative::LoaderNative(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  355|  62.0k|  if (0 > parIdx || static_cast<size_t>(parIdx) >= image.nativePreviews().size())
  ------------------
  |  Branch (355:7): [True: 0, False: 62.0k]
  |  Branch (355:21): [True: 62.0k, False: 0]
  ------------------
  356|  62.0k|    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|   495k|Loader::Loader(PreviewId id, const Image& image) : id_(id), image_(image) {
  344|   495k|}
preview.cpp:_ZNK12_GLOBAL__N_16Loader13getPropertiesEv:
  346|  17.7k|PreviewProperties Loader::getProperties() const {
  347|  17.7k|  return {"", "", size_, width_, height_, id_};
  348|  17.7k|}
preview.cpp:_ZN12_GLOBAL__N_16Loader14readDimensionsEv:
   77|  2.94k|  virtual bool readDimensions() {
   78|  2.94k|    return true;
   79|  2.94k|  }
preview.cpp:_ZN12_GLOBAL__N_16LoaderD2Ev:
   54|   495k|  virtual ~Loader() = default;
preview.cpp:_ZNK12_GLOBAL__N_16Loader5validEv:
   66|   543k|  [[nodiscard]] virtual bool valid() const {
   67|   543k|    return valid_;
   68|   543k|  }
preview.cpp:_ZN12_GLOBAL__N_124createLoaderExifDataJpegEiRKN5Exiv25ImageEi:
  568|   186k|Loader::UniquePtr createLoaderExifDataJpeg(PreviewId id, const Image& image, int parIdx) {
  569|   186k|  return std::make_unique<LoaderExifDataJpeg>(id, image, parIdx);
  570|   186k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpegC2EiRKN5Exiv25ImageEi:
  555|   186k|    Loader(id, image), dataKey_(param_[parIdx].dataKey_) {
  556|   186k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (556:55): [True: 1.05k, False: 185k]
  ------------------
  557|  1.05k|    size_ = pos->sizeDataArea();  // indirect data
  558|  1.05k|    if (size_ == 0 && pos->typeId() == undefined)
  ------------------
  |  Branch (558:9): [True: 1.05k, False: 0]
  |  Branch (558:23): [True: 910, False: 146]
  ------------------
  559|    910|      size_ = pos->size();  // direct data
  560|  1.05k|  }
  561|       |
  562|   186k|  if (size_ == 0)
  ------------------
  |  Branch (562:7): [True: 185k, False: 909]
  ------------------
  563|   185k|    return;
  564|       |
  565|    909|  valid_ = true;
  566|    909|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg13getPropertiesEv:
  572|    297|PreviewProperties LoaderExifDataJpeg::getProperties() const {
  573|    297|  PreviewProperties prop = Loader::getProperties();
  574|    297|  prop.mimeType_ = "image/jpeg";
  575|    297|  prop.extension_ = ".jpg";
  576|    297|  return prop;
  577|    297|}
preview.cpp:_ZNK12_GLOBAL__N_118LoaderExifDataJpeg7getDataEv:
  579|  1.20k|DataBuf LoaderExifDataJpeg::getData() const {
  580|  1.20k|  DataBuf buf;
  581|       |
  582|  1.20k|  if (!valid())
  ------------------
  |  Branch (582:7): [True: 0, False: 1.20k]
  ------------------
  583|      0|    return buf;
  584|       |
  585|  1.20k|  if (auto pos = image_.exifData().findKey(dataKey_); pos != image_.exifData().end()) {
  ------------------
  |  Branch (585:55): [True: 1.20k, False: 0]
  ------------------
  586|  1.20k|    buf = pos->dataArea();  // indirect data
  587|       |
  588|  1.20k|    if (buf.empty()) {  // direct data
  ------------------
  |  Branch (588:9): [True: 1.20k, False: 0]
  ------------------
  589|  1.20k|      buf = DataBuf(pos->size());
  590|  1.20k|      pos->copy(buf.data(), invalidByteOrder);
  591|  1.20k|    }
  592|       |
  593|  1.20k|    buf.write_uint8(0, 0xff);  // fix Minolta thumbnails with invalid jpeg header
  594|  1.20k|    return buf;
  595|  1.20k|  }
  596|       |
  597|      0|  return buf;
  598|  1.20k|}
preview.cpp:_ZN12_GLOBAL__N_118LoaderExifDataJpeg14readDimensionsEv:
  600|    632|bool LoaderExifDataJpeg::readDimensions() {
  601|    632|  if (!valid())
  ------------------
  |  Branch (601:7): [True: 0, False: 632]
  ------------------
  602|      0|    return false;
  603|       |
  604|    632|  DataBuf buf = getData();
  605|    632|  if (buf.empty())
  ------------------
  |  Branch (605:7): [True: 0, False: 632]
  ------------------
  606|      0|    return false;
  607|       |
  608|    632|  try {
  609|    632|    auto image = ImageFactory::open(buf.c_data(), buf.size());
  610|    632|    if (!image)
  ------------------
  |  Branch (610:9): [True: 0, False: 632]
  ------------------
  611|      0|      return false;
  612|    632|    image->readMetadata();
  613|       |
  614|    632|    width_ = image->pixelWidth();
  615|    632|    height_ = image->pixelHeight();
  616|    632|  } catch (const Error& /* error */) {
  617|    335|    return false;
  618|    335|  }
  619|       |
  620|    297|  return true;
  621|    632|}
preview.cpp:_ZN12_GLOBAL__N_116createLoaderTiffEiRKN5Exiv25ImageEi:
  681|   107k|Loader::UniquePtr createLoaderTiff(PreviewId id, const Image& image, int parIdx) {
  682|   107k|  return std::make_unique<LoaderTiff>(id, image, parIdx);
  683|   107k|}
preview.cpp:_ZN12_GLOBAL__N_110LoaderTiffC2EiRKN5Exiv25ImageEi:
  624|   107k|    Loader(id, image), group_(param_[parIdx].group_) {
  625|   107k|  const ExifData& exifData = image_.exifData();
  626|       |
  627|   107k|  size_t offsetCount = 0;
  628|   107k|  ExifData::const_iterator pos;
  629|       |
  630|       |  // check if the group_ contains a preview image
  631|   107k|  if (param_[parIdx].checkTag_) {
  ------------------
  |  Branch (631:7): [True: 92.5k, False: 15.2k]
  ------------------
  632|  92.5k|    pos = exifData.findKey(ExifKey(param_[parIdx].checkTag_));
  633|  92.5k|    if (pos == exifData.end())
  ------------------
  |  Branch (633:9): [True: 86.7k, False: 5.73k]
  ------------------
  634|  86.7k|      return;
  635|  5.73k|    if (param_[parIdx].checkValue_ && pos->toString() != param_[parIdx].checkValue_)
  ------------------
  |  Branch (635:9): [True: 5.73k, False: 0]
  |  Branch (635:9): [True: 1.02k, False: 4.71k]
  |  Branch (635:39): [True: 1.02k, False: 4.71k]
  ------------------
  636|  1.02k|      return;
  637|  5.73k|  }
  638|       |
  639|  19.9k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".StripOffsets"));
  640|  19.9k|  if (pos != exifData.end()) {
  ------------------
  |  Branch (640:7): [True: 4.01k, False: 15.9k]
  ------------------
  641|  4.01k|    offsetTag_ = "StripOffsets";
  642|  4.01k|    sizeTag_ = "StripByteCounts";
  643|  4.01k|    offsetCount = pos->value().count();
  644|  15.9k|  } else {
  645|  15.9k|    pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".TileOffsets"));
  646|  15.9k|    if (pos == exifData.end())
  ------------------
  |  Branch (646:9): [True: 15.4k, False: 485]
  ------------------
  647|  15.4k|      return;
  648|    485|    offsetTag_ = "TileOffsets";
  649|    485|    sizeTag_ = "TileByteCounts";
  650|    485|    offsetCount = pos->value().count();
  651|    485|  }
  652|       |
  653|  4.49k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + '.' + sizeTag_));
  654|  4.49k|  if (pos == exifData.end())
  ------------------
  |  Branch (654:7): [True: 162, False: 4.33k]
  ------------------
  655|    162|    return;
  656|  4.33k|  if (offsetCount != pos->value().count())
  ------------------
  |  Branch (656:7): [True: 142, False: 4.19k]
  ------------------
  657|    142|    return;
  658|  30.1k|  for (size_t i = 0; i < offsetCount; i++) {
  ------------------
  |  Branch (658:22): [True: 25.9k, False: 4.19k]
  ------------------
  659|  25.9k|    size_ += pos->toUint32(i);
  660|  25.9k|  }
  661|       |
  662|  4.19k|  if (size_ == 0)
  ------------------
  |  Branch (662:7): [True: 216, False: 3.97k]
  ------------------
  663|    216|    return;
  664|       |
  665|  3.97k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageWidth"));
  666|  3.97k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (666:7): [True: 3.64k, False: 336]
  |  Branch (666:7): [True: 3.41k, False: 562]
  |  Branch (666:32): [True: 3.41k, False: 226]
  ------------------
  667|  3.41k|    width_ = pos->toUint32();
  668|  3.41k|  }
  669|       |
  670|  3.97k|  pos = exifData.findKey(ExifKey(std::string("Exif.") + group_ + ".ImageLength"));
  671|  3.97k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (671:7): [True: 3.60k, False: 372]
  |  Branch (671:7): [True: 3.44k, False: 535]
  |  Branch (671:32): [True: 3.44k, False: 163]
  ------------------
  672|  3.44k|    height_ = pos->toUint32();
  673|  3.44k|  }
  674|       |
  675|  3.97k|  if (width_ == 0 || height_ == 0)
  ------------------
  |  Branch (675:7): [True: 590, False: 3.38k]
  |  Branch (675:22): [True: 223, False: 3.16k]
  ------------------
  676|    682|    return;
  677|       |
  678|  3.29k|  valid_ = true;
  679|  3.29k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff13getPropertiesEv:
  685|  2.94k|PreviewProperties LoaderTiff::getProperties() const {
  686|  2.94k|  PreviewProperties prop = Loader::getProperties();
  687|  2.94k|  prop.mimeType_ = "image/tiff";
  688|  2.94k|  prop.extension_ = ".tif";
  689|  2.94k|  return prop;
  690|  2.94k|}
preview.cpp:_ZNK12_GLOBAL__N_110LoaderTiff7getDataEv:
  692|  3.16k|DataBuf LoaderTiff::getData() const {
  693|  3.16k|  const ExifData& exifData = image_.exifData();
  694|       |
  695|  3.16k|  ExifData preview;
  696|       |
  697|       |  // copy tags
  698|   388k|  for (auto&& pos : exifData) {
  ------------------
  |  Branch (698:19): [True: 388k, False: 3.16k]
  ------------------
  699|   388k|    if (pos.groupName() == group_) {
  ------------------
  |  Branch (699:9): [True: 89.9k, False: 299k]
  ------------------
  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|  89.9k|      uint16_t tag = pos.tag();
  708|  89.9k|      if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, IfdId::ifd0Id)) {
  ------------------
  |  Branch (708:11): [True: 86.4k, False: 3.44k]
  |  Branch (708:28): [True: 85.8k, False: 586]
  |  Branch (708:45): [True: 32.7k, False: 53.0k]
  ------------------
  709|  32.7k|        preview.add(ExifKey(tag, "Image"), &pos.value());
  710|  32.7k|      }
  711|  89.9k|    }
  712|   388k|  }
  713|       |
  714|  3.16k|  auto& dataValue = const_cast<Value&>(preview["Exif.Image." + offsetTag_].value());
  715|       |
  716|  3.16k|  if (dataValue.sizeDataArea() == 0) {
  ------------------
  |  Branch (716:7): [True: 3.16k, False: 0]
  ------------------
  717|       |    // image data are not available via exifData, read them from image_.io()
  718|  3.16k|    BasicIo& io = image_.io();
  719|       |
  720|  3.16k|    if (io.open() != 0) {
  ------------------
  |  Branch (720:9): [True: 0, False: 3.16k]
  ------------------
  721|      0|      throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  722|      0|    }
  723|  3.16k|    IoCloser closer(io);
  724|       |
  725|  3.16k|    const Exiv2::byte* base = io.mmap();
  726|       |
  727|  3.16k|    const Value& sizes = preview["Exif.Image." + sizeTag_].value();
  728|       |
  729|  3.16k|    if (sizes.count() == dataValue.count()) {
  ------------------
  |  Branch (729:9): [True: 3.16k, False: 0]
  ------------------
  730|  3.16k|      if (sizes.count() == 1) {
  ------------------
  |  Branch (730:11): [True: 2.24k, False: 917]
  ------------------
  731|       |        // this saves one copying of the buffer
  732|  2.24k|        uint32_t offset = dataValue.toUint32(0);
  733|  2.24k|        uint32_t size = sizes.toUint32(0);
  734|  2.24k|        if (Safe::add(offset, size) <= static_cast<uint32_t>(io.size()))
  ------------------
  |  Branch (734:13): [True: 233, False: 2.01k]
  ------------------
  735|    233|          dataValue.setDataArea(base + offset, size);
  736|  2.24k|      } else {
  737|       |        // FIXME: the buffer is probably copied twice, it should be optimized
  738|    917|        Internal::enforce(size_ <= io.size(), ErrorCode::kerCorruptedMetadata);
  739|    917|        DataBuf buf(size_);
  740|    917|        uint32_t idxBuf = 0;
  741|  12.5k|        for (size_t i = 0; i < sizes.count(); i++) {
  ------------------
  |  Branch (741:28): [True: 11.6k, False: 917]
  ------------------
  742|  11.6k|          uint32_t offset = dataValue.toUint32(i);
  743|  11.6k|          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|  11.6k|          Internal::enforce(Safe::add(idxBuf, size) <= size_, ErrorCode::kerCorruptedMetadata);
  750|  11.6k|          if (size != 0 && Safe::add(offset, size) <= static_cast<uint32_t>(io.size())) {
  ------------------
  |  Branch (750:15): [True: 6.25k, False: 5.38k]
  |  Branch (750:28): [True: 4.40k, False: 1.85k]
  ------------------
  751|  4.40k|            std::copy_n(base + offset, size, buf.begin() + idxBuf);
  752|  4.40k|          }
  753|       |
  754|  11.6k|          idxBuf += size;
  755|  11.6k|        }
  756|    917|        dataValue.setDataArea(buf.c_data(), buf.size());
  757|    917|      }
  758|  3.16k|    }
  759|  3.16k|  }
  760|       |
  761|       |  // Fix compression value in the CR2 IFD2 image
  762|  3.16k|  if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
  ------------------
  |  Branch (762:7): [True: 0, False: 3.16k]
  |  Branch (762:7): [True: 0, False: 3.16k]
  |  Branch (762:40): [True: 0, False: 0]
  ------------------
  763|      0|    preview["Exif.Image.Compression"] = std::uint16_t{1};
  764|      0|  }
  765|       |
  766|       |  // write new image
  767|  3.16k|  MemIo mio;
  768|  3.16k|  IptcData emptyIptc;
  769|  3.16k|  XmpData emptyXmp;
  770|  3.16k|  TiffParser::encode(mio, nullptr, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
  771|  3.16k|  return {mio.mmap(), mio.size()};
  772|  3.16k|}
preview.cpp:_ZN12_GLOBAL__N_120createLoaderExifJpegEiRKN5Exiv25ImageEi:
  496|   123k|Loader::UniquePtr createLoaderExifJpeg(PreviewId id, const Image& image, int parIdx) {
  497|   123k|  return std::make_unique<LoaderExifJpeg>(id, image, parIdx);
  498|   123k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpegC2EiRKN5Exiv25ImageEi:
  467|   123k|LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  468|   123k|  const ExifData& exifData = image_.exifData();
  469|   123k|  auto pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
  470|   123k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (470:7): [True: 34.2k, False: 89.5k]
  |  Branch (470:7): [True: 33.5k, False: 90.2k]
  |  Branch (470:32): [True: 33.5k, False: 692]
  ------------------
  471|  33.5k|    offset_ = pos->toUint32();
  472|  33.5k|  }
  473|       |
  474|   123k|  size_ = 0;
  475|   123k|  pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
  476|   123k|  if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (476:7): [True: 34.2k, False: 89.5k]
  |  Branch (476:7): [True: 32.9k, False: 90.9k]
  |  Branch (476:32): [True: 32.9k, False: 1.38k]
  ------------------
  477|  32.9k|    size_ = pos->toUint32();
  478|  32.9k|  }
  479|       |
  480|   123k|  if (offset_ == 0 || size_ == 0)
  ------------------
  |  Branch (480:7): [True: 90.6k, False: 33.2k]
  |  Branch (480:23): [True: 903, False: 32.3k]
  ------------------
  481|  91.2k|    return;
  482|       |
  483|  32.5k|  if (param_[parIdx].baseOffsetKey_) {
  ------------------
  |  Branch (483:7): [True: 0, False: 32.5k]
  ------------------
  484|      0|    pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
  485|      0|    if (pos != exifData.end() && pos->count() > 0) {
  ------------------
  |  Branch (485:9): [True: 0, False: 0]
  |  Branch (485:9): [True: 0, False: 0]
  |  Branch (485:34): [True: 0, False: 0]
  ------------------
  486|      0|      offset_ += pos->toUint32();
  487|      0|    }
  488|      0|  }
  489|       |
  490|  32.5k|  if (Safe::add(offset_, size_) > image_.io().size())
  ------------------
  |  Branch (490:7): [True: 355, False: 32.1k]
  ------------------
  491|    355|    return;
  492|       |
  493|  32.1k|  valid_ = true;
  494|  32.1k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg13getPropertiesEv:
  500|  14.5k|PreviewProperties LoaderExifJpeg::getProperties() const {
  501|  14.5k|  PreviewProperties prop = Loader::getProperties();
  502|  14.5k|  prop.mimeType_ = "image/jpeg";
  503|  14.5k|  prop.extension_ = ".jpg";
  504|  14.5k|  return prop;
  505|  14.5k|}
preview.cpp:_ZNK12_GLOBAL__N_114LoaderExifJpeg7getDataEv:
  507|  17.4k|DataBuf LoaderExifJpeg::getData() const {
  508|  17.4k|  if (!valid())
  ------------------
  |  Branch (508:7): [True: 0, False: 17.4k]
  ------------------
  509|      0|    return {};
  510|  17.4k|  BasicIo& io = image_.io();
  511|       |
  512|  17.4k|  if (io.open() != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 17.4k]
  ------------------
  513|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  514|      0|  }
  515|  17.4k|  IoCloser closer(io);
  516|       |
  517|  17.4k|  const Exiv2::byte* base = io.mmap();
  518|       |
  519|  17.4k|  return {base + offset_, size_};
  520|  17.4k|}
preview.cpp:_ZN12_GLOBAL__N_114LoaderExifJpeg14readDimensionsEv:
  522|  29.1k|bool LoaderExifJpeg::readDimensions() {
  523|  29.1k|  if (!valid())
  ------------------
  |  Branch (523:7): [True: 0, False: 29.1k]
  ------------------
  524|      0|    return false;
  525|  29.1k|  if (width_ || height_)
  ------------------
  |  Branch (525:7): [True: 0, False: 29.1k]
  |  Branch (525:17): [True: 0, False: 29.1k]
  ------------------
  526|      0|    return true;
  527|       |
  528|  29.1k|  BasicIo& io = image_.io();
  529|       |
  530|  29.1k|  if (io.open() != 0) {
  ------------------
  |  Branch (530:7): [True: 0, False: 29.1k]
  ------------------
  531|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io.path(), strError());
  532|      0|  }
  533|  29.1k|  IoCloser closer(io);
  534|  29.1k|  const Exiv2::byte* base = io.mmap();
  535|       |
  536|  29.1k|  try {
  537|  29.1k|    auto image = ImageFactory::open(base + offset_, size_);
  538|  29.1k|    if (!image)
  ------------------
  |  Branch (538:9): [True: 0, False: 29.1k]
  ------------------
  539|      0|      return false;
  540|  29.1k|    image->readMetadata();
  541|       |
  542|  29.1k|    width_ = image->pixelWidth();
  543|  29.1k|    height_ = image->pixelHeight();
  544|  29.1k|  } catch (const Error& /* error */) {
  545|  14.5k|#ifndef SUPPRESS_WARNINGS
  546|  14.5k|    EXV_WARNING << "Invalid JPEG preview image.\n";
  ------------------
  |  |  138|  14.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 14.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  14.5k|  LogMsg(LogMsg::warn).os()
  ------------------
  547|  14.5k|#endif
  548|  14.5k|    return false;
  549|  14.5k|  }
  550|       |
  551|  14.5k|  return true;
  552|  29.1k|}
preview.cpp:_ZN12_GLOBAL__N_119createLoaderXmpJpegEiRKN5Exiv25ImageEi:
  807|  15.0k|Loader::UniquePtr createLoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) {
  808|  15.0k|  return std::make_unique<LoaderXmpJpeg>(id, image, parIdx);
  809|  15.0k|}
preview.cpp:_ZN12_GLOBAL__N_113LoaderXmpJpegC2EiRKN5Exiv25ImageEi:
  774|  15.0k|LoaderXmpJpeg::LoaderXmpJpeg(PreviewId id, const Image& image, int parIdx) : Loader(id, image) {
  775|  15.0k|  (void)parIdx;
  776|       |
  777|  15.0k|  const XmpData& xmpData = image_.xmpData();
  778|       |
  779|  15.0k|  std::string prefix = "xmpGImg";
  780|  15.0k|  if (xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/xapGImg:image")) != xmpData.end()) {
  ------------------
  |  Branch (780:7): [True: 0, False: 15.0k]
  ------------------
  781|      0|    prefix = "xapGImg";
  782|      0|  }
  783|       |
  784|  15.0k|  auto imageDatum = xmpData.findKey(XmpKey("Xmp.xmp.Thumbnails[1]/" + prefix + ":image"));
  785|  15.0k|  if (imageDatum == xmpData.end())
  ------------------
  |  Branch (785:7): [True: 15.0k, False: 0]
  ------------------
  786|  15.0k|    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|   525k|Loader::UniquePtr Loader::create(PreviewId id, const Image& image) {
  329|   525k|  Loader::UniquePtr loader;
  330|   525k|  if (id < 0 || id >= Loader::getNumLoaders())
  ------------------
  |  Branch (330:7): [True: 0, False: 525k]
  |  Branch (330:17): [True: 0, False: 525k]
  ------------------
  331|      0|    return loader;
  332|       |
  333|   525k|  if (loaderList_[id].imageMimeType_ && std::string(loaderList_[id].imageMimeType_) != image.mimeType())
  ------------------
  |  Branch (333:7): [True: 46.1k, False: 479k]
  |  Branch (333:7): [True: 30.3k, False: 495k]
  |  Branch (333:41): [True: 30.3k, False: 15.7k]
  ------------------
  334|  30.3k|    return loader;
  335|       |
  336|   495k|  loader = loaderList_[id].create_(id, image, loaderList_[id].parIdx_);
  337|   495k|  if (!loader->valid())
  ------------------
  |  Branch (337:7): [True: 458k, False: 36.3k]
  ------------------
  338|   458k|    loader = nullptr;
  339|       |
  340|   495k|  return loader;
  341|   525k|}
preview.cpp:_ZZNK5Exiv214PreviewManager20getPreviewPropertiesEvENK3$_0clINS_17PreviewPropertiesES3_EEDaRKT_RKT0_:
 1061|  11.7k|            [](const auto& lhs, const auto& rhs) { return lhs.width_ * lhs.height_ < rhs.width_ * rhs.height_; });

_ZNK5Exiv29XmpNsInfoeqERKNS0_2NsE:
 4939|  3.34M|bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
 4940|  3.34M|  return ns_ == ns.ns_;
 4941|  3.34M|}
_ZNK5Exiv29XmpNsInfoeqERKNS0_6PrefixE:
 4943|   112M|bool XmpNsInfo::operator==(const XmpNsInfo::Prefix& prefix) const {
 4944|   112M|  return prefix_ == prefix.prefix_;
 4945|   112M|}
_ZN5Exiv213XmpProperties8getMutexEv:
 4952|  2.65M|std::mutex& XmpProperties::getMutex() {
 4953|  2.65M|  static std::mutex m;
 4954|  2.65M|  return m;
 4955|  2.65M|}
_ZN5Exiv213XmpProperties24lookupNsRegistryUnlockedERKNS_9XmpNsInfo6PrefixERKNS0_7XmpLockE:
 4963|  2.95M|const XmpNsInfo* XmpProperties::lookupNsRegistryUnlocked(const XmpNsInfo::Prefix& prefix, const XmpLock&) {
 4964|  76.1M|  for (const auto& [_, p] : nsRegistry_) {
  ------------------
  |  Branch (4964:27): [True: 76.1M, False: 2.92M]
  ------------------
 4965|  76.1M|    if (p == prefix)
  ------------------
  |  Branch (4965:9): [True: 28.3k, False: 76.1M]
  ------------------
 4966|  28.3k|      return &p;
 4967|  76.1M|  }
 4968|  2.92M|  return nullptr;
 4969|  2.95M|}
_ZN5Exiv213XmpProperties18registerNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS0_7XmpLockE:
 4976|     34|void XmpProperties::registerNsUnlocked(const std::string& ns, const std::string& prefix, const XmpLock& lock) {
 4977|     34|  if (ns.empty())
  ------------------
  |  Branch (4977:7): [True: 0, False: 34]
  ------------------
 4978|      0|    return;
 4979|     34|  std::string ns2 = ns;
 4980|     34|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (4980:7): [True: 12, False: 22]
  |  Branch (4980:28): [True: 11, False: 1]
  ------------------
 4981|     11|    ns2 += '/';
 4982|       |
 4983|       |  // 1. Check if this URI is already registered with this exact prefix
 4984|     34|  auto it = nsRegistry_.find(ns2);
 4985|     34|  if (it != nsRegistry_.end() && std::strcmp(it->second.prefix_, prefix.c_str()) == 0) {
  ------------------
  |  Branch (4985:7): [True: 0, False: 34]
  |  Branch (4985:7): [True: 0, False: 34]
  |  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|     34|  if (auto xnp = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock)) {
  ------------------
  |  Branch (4990:12): [True: 0, False: 34]
  ------------------
 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|     34|  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|     34|  XmpNsInfo xn;
 5005|     34|  auto c = new char[ns2.size() + 1];
 5006|     34|  std::strcpy(c, ns2.c_str());
 5007|     34|  xn.ns_ = c;
 5008|     34|  c = new char[prefix.size() + 1];
 5009|     34|  std::strcpy(c, prefix.c_str());
 5010|     34|  xn.prefix_ = c;
 5011|     34|  xn.xmpPropertyInfo_ = nullptr;
 5012|     34|  xn.desc_ = "";
 5013|     34|  nsRegistry_[ns2] = xn;
 5014|     34|}
_ZN5Exiv213XmpProperties20unregisterNsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5021|     34|void XmpProperties::unregisterNsUnlocked(const std::string& ns, const XmpLock&) {
 5022|     34|  unregisterNsNoLock(ns, LifetimeKey{});
 5023|     34|}
_ZN5Exiv213XmpProperties18unregisterNsNoLockERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS0_11LifetimeKeyE:
 5025|     68|void XmpProperties::unregisterNsNoLock(const std::string& ns, LifetimeKey) {
 5026|     68|  auto i = nsRegistry_.find(ns);
 5027|     68|  if (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5027:7): [True: 34, False: 34]
  ------------------
 5028|     34|    delete[] i->second.prefix_;
 5029|     34|    delete[] i->second.ns_;
 5030|     34|    nsRegistry_.erase(i);
 5031|     34|  }
 5032|     68|}
_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|     35|  while (i != nsRegistry_.end()) {
  ------------------
  |  Branch (5045:10): [True: 34, False: 1]
  ------------------
 5046|     34|    auto kill = i++;
 5047|     34|    unregisterNsNoLock(kill->first, LifetimeKey{});
 5048|     34|  }
 5049|      1|}
_ZN5Exiv213XmpProperties14prefixUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5056|   168k|std::string XmpProperties::prefixUnlocked(const std::string& ns, const XmpLock&) {
 5057|   168k|  std::string ns2 = ns;
 5058|   168k|  if (ns2.back() != '/' && ns2.back() != '#')
  ------------------
  |  Branch (5058:7): [True: 28.2k, False: 140k]
  |  Branch (5058:28): [True: 18.2k, False: 9.99k]
  ------------------
 5059|  18.2k|    ns2 += '/';
 5060|       |
 5061|   168k|  auto i = nsRegistry_.find(ns2);
 5062|   168k|  std::string p;
 5063|   168k|  if (i != nsRegistry_.end())
  ------------------
  |  Branch (5063:7): [True: 3.82k, False: 164k]
  ------------------
 5064|  3.82k|    p = i->second.prefix_;
 5065|   164k|  else if (auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{std::move(ns2)}))
  ------------------
  |  Branch (5065:17): [True: 108k, False: 55.9k]
  ------------------
 5066|   108k|    p = std::string(xn->prefix_);
 5067|   168k|  return p;
 5068|   168k|}
_ZN5Exiv213XmpProperties10nsUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5075|  1.45M|std::string XmpProperties::nsUnlocked(const std::string& prefix, const XmpLock& lock) {
 5076|  1.45M|  if (auto xn = lookupNsRegistryUnlocked(XmpNsInfo::Prefix{prefix}, lock))
  ------------------
  |  Branch (5076:12): [True: 23.5k, False: 1.42M]
  ------------------
 5077|  23.5k|    return xn->ns_;
 5078|  1.42M|  return nsInfoUnlocked(prefix, lock)->ns_;
 5079|  1.45M|}
_ZN5Exiv213XmpProperties21prefixIsBoundUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5081|  9.56k|bool XmpProperties::prefixIsBoundUnlocked(const std::string& prefix, const XmpLock& lock) {
 5082|  9.56k|  const auto pf = XmpNsInfo::Prefix{prefix};
 5083|  9.56k|  return lookupNsRegistryUnlocked(pf, lock) != nullptr || Exiv2::find(xmpNsInfo, pf) != nullptr;
  ------------------
  |  Branch (5083:10): [True: 4.83k, False: 4.73k]
  |  Branch (5083:59): [True: 4.69k, False: 34]
  ------------------
 5084|  9.56k|}
_ZN5Exiv213XmpProperties20propertyTypeUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5111|  66.3k|TypeId XmpProperties::propertyTypeUnlocked(const XmpKey& key, const XmpLock& lock) {
 5112|  66.3k|  const XmpPropertyInfo* pi = propertyInfoUnlocked(key, lock);
 5113|  66.3k|  return pi ? pi->typeId_ : xmpText;
  ------------------
  |  Branch (5113:10): [True: 64.2k, False: 2.06k]
  ------------------
 5114|  66.3k|}
_ZN5Exiv213XmpProperties20propertyInfoUnlockedERKNS_6XmpKeyERKNS0_7XmpLockE:
 5121|  66.3k|const XmpPropertyInfo* XmpProperties::propertyInfoUnlocked(const XmpKey& key, const XmpLock& lock) {
 5122|  66.3k|  std::string prefix = key.groupName();
 5123|  66.3k|  std::string property = key.tagName();
 5124|       |  // If property is a path for a nested property, determines the innermost element
 5125|  66.3k|  if (auto i = property.find_last_of('/'); i != std::string::npos) {
  ------------------
  |  Branch (5125:44): [True: 0, False: 66.3k]
  ------------------
 5126|      0|    i = std::distance(property.begin(), std::find_if(property.begin() + i, property.end(), isalpha));
 5127|      0|    property = property.substr(i);
 5128|      0|    i = property.find_first_of(':');
 5129|      0|    if (i != std::string::npos) {
  ------------------
  |  Branch (5129:9): [True: 0, False: 0]
  ------------------
 5130|      0|      prefix = property.substr(0, i);
 5131|      0|      property = property.substr(i + 1);
 5132|      0|    }
 5133|       |#ifdef EXIV2_DEBUG_MESSAGES
 5134|       |    std::cout << "Nested key: " << key.key() << ", prefix: " << prefix << ", property: " << property << "\n";
 5135|       |#endif
 5136|      0|  }
 5137|  66.3k|  if (auto pl = propertyListUnlocked(prefix, lock)) {
  ------------------
  |  Branch (5137:12): [True: 66.3k, False: 0]
  ------------------
 5138|  8.64M|    for (size_t j = 0; pl[j].name_; ++j) {
  ------------------
  |  Branch (5138:24): [True: 8.63M, False: 2.06k]
  ------------------
 5139|  8.63M|      if (property == pl[j].name_) {
  ------------------
  |  Branch (5139:11): [True: 64.2k, False: 8.57M]
  ------------------
 5140|  64.2k|        return pl + j;
 5141|  64.2k|      }
 5142|  8.63M|    }
 5143|  66.3k|  }
 5144|  2.06k|  return nullptr;
 5145|  66.3k|}
_ZN5Exiv213XmpProperties20propertyListUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5162|  66.3k|const XmpPropertyInfo* XmpProperties::propertyListUnlocked(const std::string& prefix, const XmpLock& lock) {
 5163|  66.3k|  return nsInfoUnlocked(prefix, lock)->xmpPropertyInfo_;
 5164|  66.3k|}
_ZN5Exiv213XmpProperties14nsInfoUnlockedERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS0_7XmpLockE:
 5171|  1.49M|const XmpNsInfo* XmpProperties::nsInfoUnlocked(const std::string& prefix, const XmpLock& lock) {
 5172|  1.49M|  const auto pf = XmpNsInfo::Prefix{prefix};
 5173|  1.49M|  const XmpNsInfo* xn = lookupNsRegistryUnlocked(pf, lock);
 5174|  1.49M|  if (!xn)
  ------------------
  |  Branch (5174:7): [True: 1.49M, False: 0]
  ------------------
 5175|  1.49M|    xn = Exiv2::find(xmpNsInfo, pf);
 5176|  1.49M|  if (!xn)
  ------------------
  |  Branch (5176:7): [True: 68, False: 1.49M]
  ------------------
 5177|     68|    throw Error(ErrorCode::kerNoNamespaceInfoForXmpPrefix, prefix);
 5178|  1.49M|  return xn;
 5179|  1.49M|}
_ZN5Exiv26XmpKey4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKNS_13XmpProperties7XmpLockE:
 5250|   155k|XmpKey::Impl::Impl(const std::string& prefix, const std::string& property, const XmpProperties::XmpLock& lock) {
 5251|       |  // Validate prefix unlocked (must hold lock)
 5252|   155k|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5252:7): [True: 0, False: 155k]
  ------------------
 5253|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5254|       |
 5255|   155k|  property_ = property;
 5256|   155k|  prefix_ = prefix;
 5257|   155k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5259|   426k|XmpKey::XmpKey(const std::string& key) : p_(std::make_unique<Impl>()) {
 5260|   426k|  p_->decomposeKey(key);
 5261|   426k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5263|   867k|XmpKey::XmpKey(const std::string& key, const XmpProperties::XmpLock& lock) : p_(std::make_unique<Impl>()) {
 5264|   867k|  p_->decomposeKeyUnlocked(key, lock);
 5265|   867k|}
_ZN5Exiv26XmpKeyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_13XmpProperties7XmpLockE:
 5271|   155k|    p_(std::make_unique<Impl>(prefix, property, lock)) {
 5272|   155k|}
_ZN5Exiv26XmpKeyD2Ev:
 5274|  2.00M|XmpKey::~XmpKey() = default;
_ZN5Exiv26XmpKeyC2ERKS0_:
 5276|   555k|XmpKey::XmpKey(const XmpKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
 5277|   555k|}
_ZNK5Exiv26XmpKey5cloneEv:
 5286|   555k|XmpKey::UniquePtr XmpKey::clone() const {
 5287|   555k|  return UniquePtr(clone_());
 5288|   555k|}
_ZNK5Exiv26XmpKey6clone_Ev:
 5290|   555k|XmpKey* XmpKey::clone_() const {
 5291|   555k|  return new XmpKey(*this);
 5292|   555k|}
_ZNK5Exiv26XmpKey3keyEv:
 5294|  20.8M|std::string XmpKey::key() const {
 5295|  20.8M|  return std::string(Exiv2::XmpKey::Impl::familyName_) + "." + p_->prefix_ + "." + p_->property_;
 5296|  20.8M|}
_ZNK5Exiv26XmpKey9groupNameEv:
 5302|   210k|std::string XmpKey::groupName() const {
 5303|   210k|  return p_->prefix_;
 5304|   210k|}
_ZNK5Exiv26XmpKey7tagNameEv:
 5306|   376k|std::string XmpKey::tagName() const {
 5307|   376k|  return p_->property_;
 5308|   376k|}
_ZN5Exiv26XmpKey4Impl12decomposeKeyERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 5335|   426k|void XmpKey::Impl::decomposeKey(const std::string& key) {
 5336|   426k|  XmpProperties::XmpLock lock;
 5337|   426k|  decomposeKeyUnlocked(key, lock);
 5338|   426k|}  // XmpKey::Impl::decomposeKey
_ZN5Exiv26XmpKey4Impl20decomposeKeyUnlockedERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS_13XmpProperties7XmpLockE:
 5340|  1.29M|void XmpKey::Impl::decomposeKeyUnlocked(const std::string& key, const XmpProperties::XmpLock& lock) {
 5341|       |  // Get the family name, prefix and property name parts of the key
 5342|  1.29M|  if (!key.starts_with(familyName_))
  ------------------
  |  Branch (5342:7): [True: 276, False: 1.29M]
  ------------------
 5343|    276|    throw Error(ErrorCode::kerInvalidKey, key);
 5344|  1.29M|  std::string::size_type pos1 = key.find('.');
 5345|  1.29M|  std::string::size_type pos0 = pos1 + 1;
 5346|  1.29M|  pos1 = key.find('.', pos0);
 5347|  1.29M|  if (pos1 == std::string::npos)
  ------------------
  |  Branch (5347:7): [True: 0, False: 1.29M]
  ------------------
 5348|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5349|  1.29M|  std::string prefix = key.substr(pos0, pos1 - pos0);
 5350|  1.29M|  if (prefix.empty())
  ------------------
  |  Branch (5350:7): [True: 0, False: 1.29M]
  ------------------
 5351|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5352|  1.29M|  std::string property = key.substr(pos1 + 1);
 5353|  1.29M|  if (property.empty())
  ------------------
  |  Branch (5353:7): [True: 0, False: 1.29M]
  ------------------
 5354|      0|    throw Error(ErrorCode::kerInvalidKey, key);
 5355|       |
 5356|       |  // Validate prefix unlocked (must hold lock)
 5357|  1.29M|  if (XmpProperties::nsUnlocked(prefix, lock).empty())
  ------------------
  |  Branch (5357:7): [True: 0, False: 1.29M]
  ------------------
 5358|      0|    throw Error(ErrorCode::kerNoNamespaceForPrefix, prefix);
 5359|       |
 5360|  1.29M|  property_ = std::move(property);
 5361|  1.29M|  prefix_ = std::move(prefix);
 5362|  1.29M|}  // XmpKey::Impl::decomposeKeyUnlocked
_ZN5Exiv26XmpKey4ImplC2Ev:
 5224|  1.29M|  Impl() = default;                                                                             //!< Default constructor

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

_ZN5Exiv214QuickTimeVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  540|  5.68k|    Image(ImageType::qtime, mdNone, std::move(io), params), mvhdTimeScale_(1), mdhdTimeScale_(1), currentStream_(Null) {
  541|  5.68k|}  // QuickTimeVideo::QuickTimeVideo
_ZNK5Exiv214QuickTimeVideo8mimeTypeEv:
  543|  5.67k|std::string QuickTimeVideo::mimeType() const {
  544|  5.67k|  return "video/quicktime";
  545|  5.67k|}
_ZN5Exiv214QuickTimeVideo13writeMetadataEv:
  547|    324|void QuickTimeVideo::writeMetadata() {
  548|    324|}
_ZN5Exiv214QuickTimeVideo12readMetadataEv:
  550|  5.67k|void QuickTimeVideo::readMetadata() {
  551|  5.67k|  if (io_->open() != 0)
  ------------------
  |  Branch (551:7): [True: 0, False: 5.67k]
  ------------------
  552|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  553|       |
  554|       |  // Ensure that this is the correct image type
  555|  5.67k|  if (!isQTimeType(*io_, false)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 5.67k]
  ------------------
  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|  5.67k|  IoCloser closer(*io_);
  562|  5.67k|  clearMetadata();
  563|  5.67k|  continueTraversing_ = true;
  564|  5.67k|  height_ = width_ = 1;
  565|       |
  566|  5.67k|  xmpData_["Xmp.video.FileSize"] = static_cast<double>(io_->size()) / 1048576.0;
  567|  5.67k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  568|       |
  569|  75.3k|  while (continueTraversing_)
  ------------------
  |  Branch (569:10): [True: 69.6k, False: 5.67k]
  ------------------
  570|  69.6k|    decodeBlock(0);
  571|       |
  572|  5.67k|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width_, height_);
  573|  5.67k|}  // QuickTimeVideo::readMetadata
_ZN5Exiv214QuickTimeVideo11decodeBlockEmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  575|  84.5k|void QuickTimeVideo::decodeBlock(size_t recursion_depth, std::string const& entered_from) {
  576|  84.5k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  577|       |
  578|  84.5k|  const long bufMinSize = 4;
  579|  84.5k|  DataBuf buf(bufMinSize + 1);
  580|  84.5k|  uint64_t size = 0;
  581|  84.5k|  buf.data()[4] = '\0';
  582|       |
  583|  84.5k|  io_->read(buf.data(), 4);
  584|  84.5k|  if (io_->eof()) {
  ------------------
  |  Branch (584:7): [True: 523, False: 84.0k]
  ------------------
  585|    523|    continueTraversing_ = false;
  586|    523|    return;
  587|    523|  }
  588|       |
  589|  84.0k|  size = buf.read_uint32(0, bigEndian);
  590|       |
  591|  84.0k|  io_->readOrThrow(buf.data(), 4);
  592|       |
  593|       |  // we have read 2x 4 bytes
  594|  84.0k|  size_t hdrsize = 8;
  595|       |
  596|  84.0k|  if (size == 1) {
  ------------------
  |  Branch (596:7): [True: 160, False: 83.8k]
  ------------------
  597|       |    // The box size is encoded as a uint64_t, so we need to read another 8 bytes.
  598|    160|    DataBuf data(8);
  599|    160|    hdrsize += 8;
  600|    160|    io_->readOrThrow(data.data(), data.size());
  601|    160|    size = data.read_uint64(0, bigEndian);
  602|  83.8k|  } else if (size == 0 && entered_from == "meta") {
  ------------------
  |  Branch (602:14): [True: 593, False: 83.2k]
  |  Branch (602:27): [True: 334, False: 259]
  ------------------
  603|    334|    size = buf.read_uint32(0, bigEndian);
  604|    334|    io_->readOrThrow(buf.data(), 4, Exiv2::ErrorCode::kerCorruptedMetadata);
  605|    334|  }
  606|       |
  607|  84.0k|  enforce(size >= hdrsize, Exiv2::ErrorCode::kerCorruptedMetadata);
  608|  84.0k|  enforce(size - hdrsize <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  609|  84.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|  84.0k|  const auto newsize = static_cast<size_t>(size - hdrsize);
  613|  84.0k|  if (ignoreList(buf)) {
  ------------------
  |  Branch (613:7): [True: 11.2k, False: 72.7k]
  ------------------
  614|  11.2k|    discard(newsize);
  615|  11.2k|    return;
  616|  11.2k|  }
  617|  72.7k|  tagDecoder(buf, newsize, recursion_depth + 1);
  618|  72.7k|}  // QuickTimeVideo::decodeBlock
_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEmm:
  628|  69.9k|void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth) {
  629|  69.9k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  630|  69.9k|  assert(buf.size() > 4);
  631|       |
  632|  69.9k|  if (ignoreList(buf))
  ------------------
  |  Branch (632:7): [True: 0, False: 69.9k]
  ------------------
  633|      0|    discard(size);
  634|       |
  635|  69.9k|  else if (dataIgnoreList(buf)) {
  ------------------
  |  Branch (635:12): [True: 12.5k, False: 57.4k]
  ------------------
  636|  12.5k|    decodeBlock(recursion_depth + 1, Exiv2::toString(buf.data()));
  637|  57.4k|  } else if (equalsQTimeTag(buf, "ftyp"))
  ------------------
  |  Branch (637:14): [True: 3.53k, False: 53.8k]
  ------------------
  638|  3.53k|    fileTypeDecoder(size);
  639|       |
  640|  53.8k|  else if (equalsQTimeTag(buf, "trak"))
  ------------------
  |  Branch (640:12): [True: 5.92k, False: 47.9k]
  ------------------
  641|  5.92k|    setMediaStream(size);
  642|       |
  643|  47.9k|  else if (equalsQTimeTag(buf, "mvhd"))
  ------------------
  |  Branch (643:12): [True: 165, False: 47.8k]
  ------------------
  644|    165|    movieHeaderDecoder(size);
  645|       |
  646|  47.8k|  else if (equalsQTimeTag(buf, "tkhd"))
  ------------------
  |  Branch (646:12): [True: 1.28k, False: 46.5k]
  ------------------
  647|  1.28k|    trackHeaderDecoder(size);
  648|       |
  649|  46.5k|  else if (equalsQTimeTag(buf, "mdhd"))
  ------------------
  |  Branch (649:12): [True: 2.17k, False: 44.3k]
  ------------------
  650|  2.17k|    mediaHeaderDecoder(size);
  651|       |
  652|  44.3k|  else if (equalsQTimeTag(buf, "hdlr"))
  ------------------
  |  Branch (652:12): [True: 6.97k, False: 37.3k]
  ------------------
  653|  6.97k|    handlerDecoder(size);
  654|       |
  655|  37.3k|  else if (equalsQTimeTag(buf, "vmhd"))
  ------------------
  |  Branch (655:12): [True: 5.19k, False: 32.1k]
  ------------------
  656|  5.19k|    videoHeaderDecoder(size);
  657|       |
  658|  32.1k|  else if (equalsQTimeTag(buf, "udta"))
  ------------------
  |  Branch (658:12): [True: 8.68k, False: 23.4k]
  ------------------
  659|  8.68k|    userDataDecoder(size, recursion_depth + 1);
  660|       |
  661|  23.4k|  else if (equalsQTimeTag(buf, "dref"))
  ------------------
  |  Branch (661:12): [True: 2.08k, False: 21.4k]
  ------------------
  662|  2.08k|    multipleEntriesDecoder(recursion_depth + 1);
  663|       |
  664|  21.4k|  else if (equalsQTimeTag(buf, "stsd"))
  ------------------
  |  Branch (664:12): [True: 1.66k, False: 19.7k]
  ------------------
  665|  1.66k|    sampleDesc(size);
  666|       |
  667|  19.7k|  else if (equalsQTimeTag(buf, "stts"))
  ------------------
  |  Branch (667:12): [True: 2.03k, False: 17.7k]
  ------------------
  668|  2.03k|    timeToSampleDecoder();
  669|       |
  670|  17.7k|  else if (equalsQTimeTag(buf, "pnot"))
  ------------------
  |  Branch (670:12): [True: 1.45k, False: 16.2k]
  ------------------
  671|  1.45k|    previewTagDecoder(size);
  672|       |
  673|  16.2k|  else if (equalsQTimeTag(buf, "tapt"))
  ------------------
  |  Branch (673:12): [True: 1.96k, False: 14.2k]
  ------------------
  674|  1.96k|    trackApertureTagDecoder(size);
  675|       |
  676|  14.2k|  else if (equalsQTimeTag(buf, "keys"))
  ------------------
  |  Branch (676:12): [True: 486, False: 13.8k]
  ------------------
  677|    486|    keysTagDecoder(size);
  678|       |
  679|  13.8k|  else if (equalsQTimeTag(buf, "url ")) {
  ------------------
  |  Branch (679:12): [True: 630, False: 13.1k]
  ------------------
  680|    630|    if (currentStream_ == Video)
  ------------------
  |  Branch (680:9): [True: 290, False: 340]
  ------------------
  681|    290|      xmpData_["Xmp.video.URL"] = readString(*io_, size);
  682|    340|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (682:14): [True: 133, False: 207]
  ------------------
  683|    133|      xmpData_["Xmp.audio.URL"] = readString(*io_, size);
  684|    207|    else
  685|    207|      discard(size);
  686|    630|  }
  687|       |
  688|  13.1k|  else if (equalsQTimeTag(buf, "urn ")) {
  ------------------
  |  Branch (688:12): [True: 482, False: 12.6k]
  ------------------
  689|    482|    if (currentStream_ == Video)
  ------------------
  |  Branch (689:9): [True: 130, False: 352]
  ------------------
  690|    130|      xmpData_["Xmp.video.URN"] = readString(*io_, size);
  691|    352|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (691:14): [True: 315, False: 37]
  ------------------
  692|    315|      xmpData_["Xmp.audio.URN"] = readString(*io_, size);
  693|     37|    else
  694|     37|      discard(size);
  695|    482|  }
  696|       |
  697|  12.6k|  else if (equalsQTimeTag(buf, "dcom")) {
  ------------------
  |  Branch (697:12): [True: 221, False: 12.4k]
  ------------------
  698|    221|    xmpData_["Xmp.video.Compressor"] = readString(*io_, size);
  699|    221|  }
  700|       |
  701|  12.4k|  else if (equalsQTimeTag(buf, "smhd")) {
  ------------------
  |  Branch (701:12): [True: 782, False: 11.6k]
  ------------------
  702|    782|    io_->readOrThrow(buf.data(), 4);
  703|    782|    io_->readOrThrow(buf.data(), 4);
  704|    782|    xmpData_["Xmp.audio.Balance"] = buf.read_uint16(0, bigEndian);
  705|    782|  }
  706|       |
  707|  11.6k|  else {
  708|  11.6k|    discard(size);
  709|  11.6k|  }
  710|  69.9k|}  // QuickTimeVideo::tagDecoder
_ZN5Exiv214QuickTimeVideo7discardEm:
  712|  23.2k|void QuickTimeVideo::discard(size_t size) {
  713|  23.2k|  size_t cur_pos = io_->tell();
  714|  23.2k|  io_->seek(cur_pos + size, BasicIo::beg);
  715|  23.2k|}  // QuickTimeVideo::discard
_ZN5Exiv214QuickTimeVideo17previewTagDecoderEm:
  717|  1.45k|void QuickTimeVideo::previewTagDecoder(size_t size) {
  718|  1.45k|  DataBuf buf(5);
  719|  1.45k|  size_t cur_pos = io_->tell();
  720|  1.45k|  io_->readOrThrow(buf.data(), 4);
  721|  1.45k|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  722|  1.45k|  io_->readOrThrow(buf.data(), 2);
  723|  1.45k|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  724|       |
  725|  1.45k|  io_->readOrThrow(buf.data(), 4);
  726|  1.45k|  buf.write_uint8(4, 0);  // nul-terminate string
  727|  1.45k|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (727:7): [True: 3, False: 1.44k]
  ------------------
  728|      3|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  729|  1.44k|  else
  730|  1.44k|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  731|       |
  732|  1.45k|  io_->seek(cur_pos + size, BasicIo::beg);
  733|  1.45k|}  // QuickTimeVideo::previewTagDecoder
_ZN5Exiv214QuickTimeVideo14keysTagDecoderEm:
  735|    486|void QuickTimeVideo::keysTagDecoder(size_t size) {
  736|    486|  DataBuf buf(5);
  737|    486|  size_t cur_pos = io_->tell();
  738|    486|  io_->readOrThrow(buf.data(), 4);
  739|    486|  xmpData_["Xmp.video.PreviewDate"] = buf.read_uint32(0, bigEndian);
  740|    486|  io_->readOrThrow(buf.data(), 2);
  741|    486|  xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.data(), bigEndian);
  742|       |
  743|    486|  io_->readOrThrow(buf.data(), 4);
  744|    486|  buf.write_uint8(4, 0);  // nul-terminate string
  745|    486|  if (equalsQTimeTag(buf, "PICT"))
  ------------------
  |  Branch (745:7): [True: 10, False: 476]
  ------------------
  746|     10|    xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
  747|    476|  else
  748|    476|    xmpData_["Xmp.video.PreviewAtomType"] = buf.data();
  749|       |
  750|    486|  io_->seek(cur_pos + size, BasicIo::beg);
  751|    486|}  // QuickTimeVideo::keysTagDecoder
_ZN5Exiv214QuickTimeVideo23trackApertureTagDecoderEm:
  753|  1.96k|void QuickTimeVideo::trackApertureTagDecoder(size_t size) {
  754|  1.96k|  DataBuf buf(4);
  755|  1.96k|  DataBuf buf2(2);
  756|  1.96k|  size_t cur_pos = io_->tell();
  757|  1.96k|  byte n = 3;
  758|       |
  759|  7.83k|  while (n--) {
  ------------------
  |  Branch (759:10): [True: 5.87k, False: 1.96k]
  ------------------
  760|  5.87k|    io_->seek(4L, BasicIo::cur);
  761|  5.87k|    io_->readOrThrow(buf.data(), 4);
  762|       |
  763|  5.87k|    if (equalsQTimeTag(buf, "clef")) {
  ------------------
  |  Branch (763:9): [True: 214, False: 5.66k]
  ------------------
  764|    214|      io_->seek(4L, BasicIo::cur);
  765|    214|      io_->readOrThrow(buf.data(), 2);
  766|    214|      io_->readOrThrow(buf2.data(), 2);
  767|    214|      xmpData_["Xmp.video.CleanApertureWidth"] =
  768|    214|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    214|#define stringFormat std::format
  ------------------
  769|    214|      io_->readOrThrow(buf.data(), 2);
  770|    214|      io_->readOrThrow(buf2.data(), 2);
  771|    214|      xmpData_["Xmp.video.CleanApertureHeight"] =
  772|    214|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    214|#define stringFormat std::format
  ------------------
  773|    214|    }
  774|       |
  775|  5.66k|    else if (equalsQTimeTag(buf, "prof")) {
  ------------------
  |  Branch (775:14): [True: 28, False: 5.63k]
  ------------------
  776|     28|      io_->seek(4L, BasicIo::cur);
  777|     28|      io_->readOrThrow(buf.data(), 2);
  778|     28|      io_->readOrThrow(buf2.data(), 2);
  779|     28|      xmpData_["Xmp.video.ProductionApertureWidth"] =
  780|     28|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     28|#define stringFormat std::format
  ------------------
  781|     28|      io_->readOrThrow(buf.data(), 2);
  782|     28|      io_->readOrThrow(buf2.data(), 2);
  783|     28|      xmpData_["Xmp.video.ProductionApertureHeight"] =
  784|     28|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     28|#define stringFormat std::format
  ------------------
  785|     28|    }
  786|       |
  787|  5.63k|    else if (equalsQTimeTag(buf, "enof")) {
  ------------------
  |  Branch (787:14): [True: 12, False: 5.62k]
  ------------------
  788|     12|      io_->seek(4L, BasicIo::cur);
  789|     12|      io_->readOrThrow(buf.data(), 2);
  790|     12|      io_->readOrThrow(buf2.data(), 2);
  791|     12|      xmpData_["Xmp.video.EncodedPixelsWidth"] =
  792|     12|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     12|#define stringFormat std::format
  ------------------
  793|     12|      io_->readOrThrow(buf.data(), 2);
  794|     12|      io_->readOrThrow(buf2.data(), 2);
  795|     12|      xmpData_["Xmp.video.EncodedPixelsHeight"] =
  796|     12|          stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|     12|#define stringFormat std::format
  ------------------
  797|     12|    }
  798|  5.87k|  }
  799|  1.96k|  io_->seek(cur_pos + size, BasicIo::beg);
  800|  1.96k|}  // QuickTimeVideo::trackApertureTagDecoder
_ZN5Exiv214QuickTimeVideo17CameraTagsDecoderEm:
  802|  1.97k|void QuickTimeVideo::CameraTagsDecoder(size_t size) {
  803|  1.97k|  size_t cur_pos = io_->tell();
  804|  1.97k|  DataBuf buf(49);
  805|  1.97k|  DataBuf buf2(4);
  806|       |
  807|  1.97k|  io_->readOrThrow(buf.data(), 4);
  808|  1.97k|  if (equalsQTimeTag(buf, "NIKO")) {
  ------------------
  |  Branch (808:7): [True: 1.49k, False: 484]
  ------------------
  809|  1.49k|    io_->seek(cur_pos, BasicIo::beg);
  810|       |
  811|  1.49k|    io_->readOrThrow(buf.data(), 24);
  812|  1.49k|    buf.write_uint8(24, 0);  // nul-terminate string
  813|  1.49k|    xmpData_["Xmp.video.Make"] = buf.data();
  814|  1.49k|    io_->readOrThrow(buf.data(), 14);
  815|  1.49k|    buf.write_uint8(14, 0);  // nul-terminate string
  816|  1.49k|    xmpData_["Xmp.video.Model"] = buf.data();
  817|  1.49k|    io_->readOrThrow(buf.data(), 4);
  818|  1.49k|    xmpData_["Xmp.video.ExposureTime"] = stringFormat("1/{}", std::ceil(buf.read_uint32(0, littleEndian) / 10.0));
  ------------------
  |  |   18|  1.49k|#define stringFormat std::format
  ------------------
  819|  1.49k|    io_->readOrThrow(buf.data(), 4);
  820|  1.49k|    io_->readOrThrow(buf2.data(), 4);
  821|  1.49k|    xmpData_["Xmp.video.FNumber"] =
  822|  1.49k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  823|  1.49k|    io_->readOrThrow(buf.data(), 4);
  824|  1.49k|    io_->readOrThrow(buf2.data(), 4);
  825|  1.49k|    xmpData_["Xmp.video.ExposureCompensation"] =
  826|  1.49k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  827|  1.49k|    io_->readOrThrow(buf.data(), 10);
  828|  1.49k|    io_->readOrThrow(buf.data(), 4);
  829|  1.49k|    if (auto td = Exiv2::find(whiteBalance, buf.read_uint32(0, littleEndian)))
  ------------------
  |  Branch (829:14): [True: 163, False: 1.33k]
  ------------------
  830|    163|      xmpData_["Xmp.video.WhiteBalance"] = _(td->label_);
  ------------------
  |  |   40|    163|#define _(String) (String)
  ------------------
  831|  1.49k|    io_->readOrThrow(buf.data(), 4);
  832|  1.49k|    io_->readOrThrow(buf2.data(), 4);
  833|  1.49k|    xmpData_["Xmp.video.FocalLength"] =
  834|  1.49k|        buf.read_uint32(0, littleEndian) / static_cast<double>(buf2.read_uint32(0, littleEndian));
  835|  1.49k|    io_->seek(95L, BasicIo::cur);
  836|  1.49k|    io_->readOrThrow(buf.data(), 48);
  837|  1.49k|    buf.write_uint8(48, 0);
  838|  1.49k|    xmpData_["Xmp.video.Software"] = buf.data();
  839|  1.49k|    io_->readOrThrow(buf.data(), 4);
  840|  1.49k|    xmpData_["Xmp.video.ISO"] = buf.read_uint32(0, littleEndian);
  841|  1.49k|  }
  842|       |
  843|  1.97k|  io_->seek(cur_pos + size, BasicIo::beg);
  844|  1.97k|}  // QuickTimeVideo::CameraTagsDecoder
_ZN5Exiv214QuickTimeVideo15userDataDecoderEmm:
  846|  9.18k|void QuickTimeVideo::userDataDecoder(size_t outer_size, size_t recursion_depth) {
  847|  9.18k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
  848|  9.18k|  const size_t start_pos = io_->tell();
  849|  9.18k|  const TagVocabulary* td;
  850|  9.18k|  const TagVocabulary* tv;
  851|  9.18k|  const TagVocabulary* tv_internal;
  852|       |
  853|  9.18k|  const long bufMinSize = 100;
  854|  9.18k|  DataBuf buf(bufMinSize);
  855|  9.18k|  size_t size_internal = outer_size;
  856|  9.18k|  std::memset(buf.data(), 0x0, buf.size());
  857|       |
  858|  17.1k|  while ((size_internal / 4 != 0) && (size_internal > 0)) {
  ------------------
  |  Branch (858:10): [True: 12.4k, False: 4.67k]
  |  Branch (858:38): [True: 12.4k, False: 0]
  ------------------
  859|  12.4k|    const size_t loop_start_pos = io_->tell();
  860|  12.4k|    buf.data()[4] = '\0';
  861|  12.4k|    io_->readOrThrow(buf.data(), 4);
  862|  12.4k|    const size_t size = buf.read_uint32(0, bigEndian);
  863|  12.4k|    if (size > size_internal)
  ------------------
  |  Branch (863:9): [True: 2.60k, False: 9.82k]
  ------------------
  864|  2.60k|      break;
  865|  9.82k|    size_internal -= size;
  866|  9.82k|    io_->readOrThrow(buf.data(), 4);
  867|       |
  868|  9.82k|    if (buf.data()[0] == 169)
  ------------------
  |  Branch (868:9): [True: 34, False: 9.79k]
  ------------------
  869|     34|      buf.data()[0] = ' ';
  870|  9.82k|    td = Exiv2::find(userDatatags, Exiv2::toString(buf.data()));
  871|       |
  872|  9.82k|    tv = Exiv2::find(userDataReferencetags, Exiv2::toString(buf.data()));
  873|       |
  874|  9.82k|    if (size <= 12)
  ------------------
  |  Branch (874:9): [True: 1.91k, False: 7.91k]
  ------------------
  875|  1.91k|      break;
  876|       |
  877|  7.91k|    if (equalsQTimeTag(buf, "DcMD") || equalsQTimeTag(buf, "NCDT"))
  ------------------
  |  Branch (877:9): [True: 384, False: 7.53k]
  |  Branch (877:40): [True: 114, False: 7.41k]
  ------------------
  878|    498|      userDataDecoder(size - 8, recursion_depth + 1);
  879|       |
  880|  7.41k|    else if (equalsQTimeTag(buf, "NCTG"))
  ------------------
  |  Branch (880:14): [True: 1.82k, False: 5.59k]
  ------------------
  881|  1.82k|      NikonTagsDecoder(size - 8);
  882|       |
  883|  5.59k|    else if (equalsQTimeTag(buf, "TAGS"))
  ------------------
  |  Branch (883:14): [True: 1.97k, False: 3.61k]
  ------------------
  884|  1.97k|      CameraTagsDecoder(size - 8);
  885|       |
  886|  3.61k|    else if (equalsQTimeTag(buf, "CNCV") || equalsQTimeTag(buf, "CNFV") || equalsQTimeTag(buf, "CNMN") ||
  ------------------
  |  Branch (886:14): [True: 22, False: 3.58k]
  |  Branch (886:45): [True: 179, False: 3.41k]
  |  Branch (886:76): [True: 39, False: 3.37k]
  ------------------
  887|  3.37k|             equalsQTimeTag(buf, "NCHD") || equalsQTimeTag(buf, "FFMV")) {
  ------------------
  |  Branch (887:14): [True: 106, False: 3.26k]
  |  Branch (887:45): [True: 210, False: 3.05k]
  ------------------
  888|    556|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  889|    556|      xmpData_[_(tv->label_)] = readString(*io_, size - 8);
  ------------------
  |  |   40|    556|#define _(String) (String)
  ------------------
  890|    556|    }
  891|       |
  892|  3.05k|    else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
  ------------------
  |  Branch (892:14): [True: 147, False: 2.90k]
  |  Branch (892:45): [True: 0, False: 2.90k]
  ------------------
  893|    147|      enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
  894|    147|      io_->readOrThrow(buf.data(), 2);
  895|    147|      buf.data()[2] = '\0';
  896|    147|      tv_internal = Exiv2::find(cameraByteOrderTags, Exiv2::toString(buf.data()));
  897|       |
  898|    147|      if (tv_internal)
  ------------------
  |  Branch (898:11): [True: 88, False: 59]
  ------------------
  899|     88|        xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     88|#define _(String) (String)
  ------------------
                      xmpData_[_(tv->label_)] = _(tv_internal->label_);
  ------------------
  |  |   40|     88|#define _(String) (String)
  ------------------
  900|     59|      else
  901|     59|        xmpData_[_(tv->label_)] = buf.data();
  ------------------
  |  |   40|     59|#define _(String) (String)
  ------------------
  902|    147|    }
  903|       |
  904|  2.90k|    else if (tv) {
  ------------------
  |  Branch (904:14): [True: 430, False: 2.47k]
  ------------------
  905|    430|      io_->readOrThrow(buf.data(), 4);
  906|    430|      xmpData_[_(tv->label_)] = readString(*io_, size - 12);
  ------------------
  |  |   40|    430|#define _(String) (String)
  ------------------
  907|    430|    }
  908|       |
  909|  2.47k|    else if (td)
  ------------------
  |  Branch (909:14): [True: 374, False: 2.10k]
  ------------------
  910|    374|      tagDecoder(buf, size - 8, recursion_depth + 1);
  911|       |
  912|  7.91k|    enforce(io_->tell() <= loop_start_pos + size, Exiv2::ErrorCode::kerCorruptedMetadata);
  913|  7.91k|  }
  914|       |
  915|  9.18k|  io_->seek(start_pos + outer_size, BasicIo::beg);
  916|  9.18k|}  // QuickTimeVideo::userDataDecoder
_ZN5Exiv214QuickTimeVideo16NikonTagsDecoderEm:
  918|  1.82k|void QuickTimeVideo::NikonTagsDecoder(size_t size) {
  919|  1.82k|  size_t cur_pos = io_->tell();
  920|  1.82k|  DataBuf buf(201);
  921|  1.82k|  DataBuf buf2(4 + 1);
  922|  1.82k|  uint32_t TagID = 0;
  923|  1.82k|  uint16_t dataLength = 0;
  924|  1.82k|  uint16_t dataType = 2;
  925|  1.82k|  const TagDetails* td;
  926|  1.82k|  const TagDetails* td2;
  927|       |
  928|   112k|  for (int i = 0; i < 100; i++) {
  ------------------
  |  Branch (928:19): [True: 110k, False: 1.82k]
  ------------------
  929|   110k|    io_->readOrThrow(buf.data(), 4);
  930|   110k|    TagID = buf.read_uint32(0, bigEndian);
  931|   110k|    td = Exiv2::find(NikonNCTGTags, TagID);
  932|       |
  933|   110k|    io_->readOrThrow(buf.data(), 2);
  934|   110k|    dataType = buf.read_uint16(0, bigEndian);
  935|       |
  936|   110k|    std::memset(buf.data(), 0x0, buf.size());
  937|   110k|    io_->readOrThrow(buf.data(), 2);
  938|       |
  939|   110k|    if (TagID == 0x2000023) {
  ------------------
  |  Branch (939:9): [True: 5.58k, False: 105k]
  ------------------
  940|  5.58k|      size_t local_pos = io_->tell();
  941|  5.58k|      dataLength = buf.read_uint16(0, bigEndian);
  942|  5.58k|      std::memset(buf.data(), 0x0, buf.size());
  943|       |
  944|  5.58k|      io_->readOrThrow(buf.data(), 4);
  945|  5.58k|      xmpData_["Xmp.video.PictureControlVersion"] = buf.data();
  946|  5.58k|      io_->readOrThrow(buf.data(), 20);
  947|  5.58k|      xmpData_["Xmp.video.PictureControlName"] = buf.data();
  948|  5.58k|      io_->readOrThrow(buf.data(), 20);
  949|  5.58k|      xmpData_["Xmp.video.PictureControlBase"] = buf.data();
  950|  5.58k|      io_->readOrThrow(buf.data(), 4);
  951|  5.58k|      std::memset(buf.data(), 0x0, buf.size());
  952|       |
  953|  5.58k|      io_->readOrThrow(buf.data(), 1);
  954|  5.58k|      td2 = Exiv2::find(PictureControlAdjust, static_cast<int>(buf.data()[0]) & 7);
  955|  5.58k|      if (td2)
  ------------------
  |  Branch (955:11): [True: 3.24k, False: 2.34k]
  ------------------
  956|  3.24k|        xmpData_["Xmp.video.PictureControlAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.24k|#define _(String) (String)
  ------------------
  957|  2.34k|      else
  958|  2.34k|        xmpData_["Xmp.video.PictureControlAdjust"] = static_cast<int>(buf.data()[0]) & 7;
  959|       |
  960|  5.58k|      io_->readOrThrow(buf.data(), 1);
  961|  5.58k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  962|  5.58k|      if (td2)
  ------------------
  |  Branch (962:11): [True: 3.62k, False: 1.95k]
  ------------------
  963|  3.62k|        xmpData_["Xmp.video.PictureControlQuickAdjust"] = _(td2->label_);
  ------------------
  |  |   40|  3.62k|#define _(String) (String)
  ------------------
  964|       |
  965|  5.58k|      io_->readOrThrow(buf.data(), 1);
  966|  5.58k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  967|  5.58k|      if (td2)
  ------------------
  |  Branch (967:11): [True: 3.28k, False: 2.30k]
  ------------------
  968|  3.28k|        xmpData_["Xmp.video.Sharpness"] = _(td2->label_);
  ------------------
  |  |   40|  3.28k|#define _(String) (String)
  ------------------
  969|  2.30k|      else
  970|  2.30k|        xmpData_["Xmp.video.Sharpness"] = static_cast<int>(buf.data()[0]) & 7;
  971|       |
  972|  5.58k|      io_->readOrThrow(buf.data(), 1);
  973|  5.58k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  974|  5.58k|      if (td2)
  ------------------
  |  Branch (974:11): [True: 2.61k, False: 2.96k]
  ------------------
  975|  2.61k|        xmpData_["Xmp.video.Contrast"] = _(td2->label_);
  ------------------
  |  |   40|  2.61k|#define _(String) (String)
  ------------------
  976|  2.96k|      else
  977|  2.96k|        xmpData_["Xmp.video.Contrast"] = static_cast<int>(buf.data()[0]) & 7;
  978|       |
  979|  5.58k|      io_->readOrThrow(buf.data(), 1);
  980|  5.58k|      td2 = Exiv2::find(NormalSoftHard, static_cast<int>(buf.data()[0]) & 7);
  981|  5.58k|      if (td2)
  ------------------
  |  Branch (981:11): [True: 3.14k, False: 2.43k]
  ------------------
  982|  3.14k|        xmpData_["Xmp.video.Brightness"] = _(td2->label_);
  ------------------
  |  |   40|  3.14k|#define _(String) (String)
  ------------------
  983|  2.43k|      else
  984|  2.43k|        xmpData_["Xmp.video.Brightness"] = static_cast<int>(buf.data()[0]) & 7;
  985|       |
  986|  5.58k|      io_->readOrThrow(buf.data(), 1);
  987|  5.58k|      td2 = Exiv2::find(Saturation, static_cast<int>(buf.data()[0]) & 7);
  988|  5.58k|      if (td2)
  ------------------
  |  Branch (988:11): [True: 3.33k, False: 2.24k]
  ------------------
  989|  3.33k|        xmpData_["Xmp.video.Saturation"] = _(td2->label_);
  ------------------
  |  |   40|  3.33k|#define _(String) (String)
  ------------------
  990|  2.24k|      else
  991|  2.24k|        xmpData_["Xmp.video.Saturation"] = static_cast<int>(buf.data()[0]) & 7;
  992|       |
  993|  5.58k|      io_->readOrThrow(buf.data(), 1);
  994|  5.58k|      xmpData_["Xmp.video.HueAdjustment"] = static_cast<int>(buf.data()[0]) & 7;
  995|       |
  996|  5.58k|      io_->readOrThrow(buf.data(), 1);
  997|  5.58k|      td2 = Exiv2::find(FilterEffect, static_cast<int>(buf.data()[0]));
  998|  5.58k|      if (td2)
  ------------------
  |  Branch (998:11): [True: 997, False: 4.58k]
  ------------------
  999|    997|        xmpData_["Xmp.video.FilterEffect"] = _(td2->label_);
  ------------------
  |  |   40|    997|#define _(String) (String)
  ------------------
 1000|  4.58k|      else
 1001|  4.58k|        xmpData_["Xmp.video.FilterEffect"] = static_cast<int>(buf.data()[0]);
 1002|       |
 1003|  5.58k|      io_->readOrThrow(buf.data(), 1);
 1004|  5.58k|      td2 = Exiv2::find(ToningEffect, static_cast<int>(buf.data()[0]));
 1005|  5.58k|      if (td2)
  ------------------
  |  Branch (1005:11): [True: 2.22k, False: 3.36k]
  ------------------
 1006|  2.22k|        xmpData_["Xmp.video.ToningEffect"] = _(td2->label_);
  ------------------
  |  |   40|  2.22k|#define _(String) (String)
  ------------------
 1007|  3.36k|      else
 1008|  3.36k|        xmpData_["Xmp.video.ToningEffect"] = static_cast<int>(buf.data()[0]);
 1009|       |
 1010|  5.58k|      io_->readOrThrow(buf.data(), 1);
 1011|  5.58k|      xmpData_["Xmp.video.ToningSaturation"] = static_cast<int>(buf.data()[0]);
 1012|       |
 1013|  5.58k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1014|  5.58k|    }
 1015|       |
 1016|   105k|    else if (TagID == 0x2000024) {
  ------------------
  |  Branch (1016:14): [True: 1.12k, False: 104k]
  ------------------
 1017|  1.12k|      size_t local_pos = io_->tell();
 1018|  1.12k|      dataLength = buf.read_uint16(0, bigEndian);
 1019|  1.12k|      std::memset(buf.data(), 0x0, buf.size());
 1020|       |
 1021|  1.12k|      io_->readOrThrow(buf.data(), 2);
 1022|  1.12k|      xmpData_["Xmp.video.TimeZone"] = Exiv2::getShort(buf.data(), bigEndian);
 1023|  1.12k|      io_->readOrThrow(buf.data(), 1);
 1024|  1.12k|      td2 = Exiv2::find(YesNo, static_cast<int>(buf.data()[0]));
 1025|  1.12k|      if (td2)
  ------------------
  |  Branch (1025:11): [True: 499, False: 628]
  ------------------
 1026|    499|        xmpData_["Xmp.video.DayLightSavings"] = _(td2->label_);
  ------------------
  |  |   40|    499|#define _(String) (String)
  ------------------
 1027|       |
 1028|  1.12k|      io_->readOrThrow(buf.data(), 1);
 1029|  1.12k|      td2 = Exiv2::find(DateDisplayFormat, static_cast<int>(buf.data()[0]));
 1030|  1.12k|      if (td2)
  ------------------
  |  Branch (1030:11): [True: 935, False: 192]
  ------------------
 1031|    935|        xmpData_["Xmp.video.DateDisplayFormat"] = _(td2->label_);
  ------------------
  |  |   40|    935|#define _(String) (String)
  ------------------
 1032|       |
 1033|  1.12k|      io_->seek(local_pos + dataLength, BasicIo::beg);
 1034|  1.12k|    }
 1035|       |
 1036|   104k|    else if (dataType == 2 || dataType == 7) {
  ------------------
  |  Branch (1036:14): [True: 2.06k, False: 102k]
  |  Branch (1036:31): [True: 236, False: 101k]
  ------------------
 1037|  1.61k|      dataLength = buf.read_uint16(0, bigEndian);
 1038|  1.61k|      std::memset(buf.data(), 0x0, buf.size());
 1039|       |
 1040|       |      // Sanity check with an "unreasonably" large number
 1041|  1.61k|      if (dataLength >= buf.size()) {
  ------------------
  |  Branch (1041:11): [True: 709, False: 908]
  ------------------
 1042|    709|#ifndef SUPPRESS_WARNINGS
 1043|    709|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be larger than 200."
  ------------------
  |  |  142|    709|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 709]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    709|  LogMsg(LogMsg::error).os()
  ------------------
 1044|      0|                  << " Entries considered invalid. Not Processed.\n";
 1045|    709|#endif
 1046|    709|        io_->seek(io_->tell() + dataLength, BasicIo::beg);
 1047|    709|        buf.data()[0] = '\0';
 1048|    908|      } else {
 1049|    908|        io_->readOrThrow(buf.data(), dataLength);
 1050|    908|        buf.data()[dataLength] = '\0';
 1051|    908|      }
 1052|       |
 1053|  1.61k|      if (td) {
  ------------------
  |  Branch (1053:11): [True: 429, False: 1.18k]
  ------------------
 1054|    429|        xmpData_[_(td->label_)] = buf.data();
  ------------------
  |  |   40|    429|#define _(String) (String)
  ------------------
 1055|    429|      }
 1056|   102k|    } else if (dataType == 4) {
  ------------------
  |  Branch (1056:16): [True: 1.15k, False: 101k]
  ------------------
 1057|  1.15k|      dataLength = buf.read_uint16(0, bigEndian) * 4;
 1058|  1.15k|      std::memset(buf.data(), 0x0, buf.size());
 1059|  1.15k|      io_->readOrThrow(buf.data(), 4);
 1060|  1.15k|      if (td)
  ------------------
  |  Branch (1060:11): [True: 495, False: 664]
  ------------------
 1061|    495|        xmpData_[_(td->label_)] = buf.read_uint32(0, bigEndian);
  ------------------
  |  |   40|    495|#define _(String) (String)
  ------------------
 1062|       |
 1063|       |      // Sanity check with an "unreasonably" large number
 1064|  1.15k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1064:11): [True: 471, False: 688]
  |  Branch (1064:31): [True: 402, False: 286]
  ------------------
 1065|    872|#ifndef SUPPRESS_WARNINGS
 1066|    872|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    872|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 872]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    872|  LogMsg(LogMsg::error).os()
  ------------------
 1067|      0|                  << " Entries considered invalid. Not Processed.\n";
 1068|    872|#endif
 1069|    872|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1070|    872|      } else
 1071|    287|        io_->readOrThrow(buf.data(), dataLength - 4);
 1072|   101k|    } else if (dataType == 3) {
  ------------------
  |  Branch (1072:16): [True: 3.55k, False: 97.7k]
  ------------------
 1073|  3.55k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1074|  3.55k|      std::memset(buf.data(), 0x0, buf.size());
 1075|  3.55k|      io_->readOrThrow(buf.data(), 2);
 1076|  3.55k|      if (td)
  ------------------
  |  Branch (1076:11): [True: 1.55k, False: 2.00k]
  ------------------
 1077|  1.55k|        xmpData_[_(td->label_)] = buf.read_uint16(0, bigEndian);
  ------------------
  |  |   40|  1.55k|#define _(String) (String)
  ------------------
 1078|       |
 1079|       |      // Sanity check with an "unreasonably" large number
 1080|  3.55k|      if (dataLength > 200 || dataLength < 2) {
  ------------------
  |  Branch (1080:11): [True: 2.54k, False: 1.01k]
  |  Branch (1080:31): [True: 734, False: 277]
  ------------------
 1081|  3.27k|#ifndef SUPPRESS_WARNINGS
 1082|  3.27k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  3.27k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 3.27k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  3.27k|  LogMsg(LogMsg::error).os()
  ------------------
 1083|      0|                  << " Entries considered invalid. Not Processed.\n";
 1084|  3.27k|#endif
 1085|  3.27k|        io_->seek(io_->tell() + dataLength - 2, BasicIo::beg);
 1086|  3.27k|      } else
 1087|    278|        io_->readOrThrow(buf.data(), dataLength - 2);
 1088|  97.7k|    } else if (dataType == 5) {
  ------------------
  |  Branch (1088:16): [True: 1.41k, False: 96.3k]
  ------------------
 1089|  1.41k|      dataLength = buf.read_uint16(0, bigEndian) * 8;
 1090|  1.41k|      std::memset(buf.data(), 0x0, buf.size());
 1091|  1.41k|      io_->readOrThrow(buf.data(), 4);
 1092|  1.41k|      io_->readOrThrow(buf2.data(), 4);
 1093|  1.41k|      if (td)
  ------------------
  |  Branch (1093:11): [True: 695, False: 718]
  ------------------
 1094|    695|        xmpData_[_(td->label_)] =
  ------------------
  |  |   40|    695|#define _(String) (String)
  ------------------
 1095|    695|            static_cast<double>(buf.read_uint32(0, bigEndian)) / static_cast<double>(buf2.read_uint32(0, bigEndian));
 1096|       |
 1097|       |      // Sanity check with an "unreasonably" large number
 1098|  1.41k|      if (dataLength > 200 || dataLength < 8) {
  ------------------
  |  Branch (1098:11): [True: 650, False: 763]
  |  Branch (1098:31): [True: 435, False: 328]
  ------------------
 1099|  1.08k|#ifndef SUPPRESS_WARNINGS
 1100|  1.08k|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|  1.08k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 1.08k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  1.08k|  LogMsg(LogMsg::error).os()
  ------------------
 1101|      0|                  << " Entries considered invalid. Not Processed.\n";
 1102|  1.08k|#endif
 1103|  1.08k|        io_->seek(io_->tell() + dataLength - 8, BasicIo::beg);
 1104|  1.08k|      } else
 1105|    332|        io_->readOrThrow(buf.data(), dataLength - 8);
 1106|  96.3k|    } else if (dataType == 8) {
  ------------------
  |  Branch (1106:16): [True: 1.49k, False: 94.8k]
  ------------------
 1107|  1.49k|      dataLength = buf.read_uint16(0, bigEndian) * 2;
 1108|  1.49k|      std::memset(buf.data(), 0x0, buf.size());
 1109|  1.49k|      io_->readOrThrow(buf.data(), 2);
 1110|  1.49k|      io_->readOrThrow(buf2.data(), 2);
 1111|  1.49k|      if (td)
  ------------------
  |  Branch (1111:11): [True: 258, False: 1.23k]
  ------------------
 1112|    258|        xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   40|    258|#define _(String) (String)
  ------------------
                      xmpData_[_(td->label_)] = stringFormat("{}.{}", buf.read_uint16(0, bigEndian), buf2.read_uint16(0, bigEndian));
  ------------------
  |  |   18|    258|#define stringFormat std::format
  ------------------
 1113|       |
 1114|       |      // Sanity check with an "unreasonably" large number
 1115|  1.49k|      if (dataLength > 200 || dataLength < 4) {
  ------------------
  |  Branch (1115:11): [True: 702, False: 788]
  |  Branch (1115:31): [True: 154, False: 634]
  ------------------
 1116|    853|#ifndef SUPPRESS_WARNINGS
 1117|    853|        EXV_ERROR << "Xmp.video Nikon Tags, dataLength was found to be of inappropriate size."
  ------------------
  |  |  142|    853|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 853]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    853|  LogMsg(LogMsg::error).os()
  ------------------
 1118|      0|                  << " Entries considered invalid. Not Processed.\n";
 1119|    853|#endif
 1120|    853|        io_->seek(io_->tell() + dataLength - 4, BasicIo::beg);
 1121|    853|      } else
 1122|    637|        io_->readOrThrow(buf.data(), dataLength - 4);
 1123|  1.49k|    }
 1124|   110k|  }
 1125|       |
 1126|  1.82k|  io_->seek(cur_pos + size, BasicIo::beg);
 1127|  1.82k|}  // QuickTimeVideo::NikonTagsDecoder
_ZN5Exiv214QuickTimeVideo14setMediaStreamEm:
 1129|  5.92k|void QuickTimeVideo::setMediaStream(size_t atom_size) {
 1130|  5.92k|  size_t current_position = io_->tell();
 1131|  5.92k|  size_t search_end = Safe::add(current_position, atom_size);
 1132|  5.92k|  if (search_end > io_->size())
  ------------------
  |  Branch (1132:7): [True: 0, False: 5.92k]
  ------------------
 1133|      0|    search_end = io_->size();
 1134|  5.92k|  DataBuf buf(4 + 1);
 1135|       |
 1136|   110k|  while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) {
  ------------------
  |  Branch (1136:10): [True: 110k, False: 0]
  |  Branch (1136:25): [True: 108k, False: 1.37k]
  ------------------
 1137|   108k|    io_->readOrThrow(buf.data(), 4);
 1138|   108k|    if (equalsQTimeTag(buf, "hdlr")) {
  ------------------
  |  Branch (1138:9): [True: 4.55k, False: 104k]
  ------------------
 1139|  4.55k|      if (Safe::add(io_->tell(), size_t{12}) > search_end)
  ------------------
  |  Branch (1139:11): [True: 331, False: 4.22k]
  ------------------
 1140|    331|        break;
 1141|  4.22k|      io_->readOrThrow(buf.data(), 4);
 1142|  4.22k|      io_->readOrThrow(buf.data(), 4);
 1143|  4.22k|      io_->readOrThrow(buf.data(), 4);
 1144|       |
 1145|  4.22k|      if (equalsQTimeTag(buf, "vide"))
  ------------------
  |  Branch (1145:11): [True: 95, False: 4.12k]
  ------------------
 1146|     95|        currentStream_ = Video;
 1147|  4.12k|      else if (equalsQTimeTag(buf, "soun"))
  ------------------
  |  Branch (1147:16): [True: 904, False: 3.22k]
  ------------------
 1148|    904|        currentStream_ = Audio;
 1149|  3.22k|      else if (equalsQTimeTag(buf, "hint"))
  ------------------
  |  Branch (1149:16): [True: 657, False: 2.56k]
  ------------------
 1150|    657|        currentStream_ = Hint;
 1151|  2.56k|      else
 1152|  2.56k|        currentStream_ = GenMediaHeader;
 1153|  4.22k|      break;
 1154|  4.55k|    }
 1155|   108k|  }
 1156|       |
 1157|  5.92k|  io_->seek(current_position, BasicIo::beg);
 1158|  5.92k|}  // QuickTimeVideo::setMediaStream
_ZN5Exiv214QuickTimeVideo19timeToSampleDecoderEv:
 1160|  2.03k|void QuickTimeVideo::timeToSampleDecoder() {
 1161|  2.03k|  DataBuf buf(4 + 1);
 1162|  2.03k|  io_->readOrThrow(buf.data(), 4);
 1163|  2.03k|  io_->readOrThrow(buf.data(), 4);
 1164|  2.03k|  uint64_t totalframes = 0;
 1165|  2.03k|  uint64_t timeOfFrames = 0;
 1166|  2.03k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1167|       |
 1168|  4.77k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1168:24): [True: 2.73k, False: 2.03k]
  ------------------
 1169|  2.73k|    io_->readOrThrow(buf.data(), 4);
 1170|  2.73k|    const uint64_t temp = buf.read_uint32(0, bigEndian);
 1171|  2.73k|    totalframes = Safe::add(totalframes, temp);
 1172|  2.73k|    io_->readOrThrow(buf.data(), 4);
 1173|  2.73k|    timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
 1174|  2.73k|  }
 1175|  2.03k|  if (currentStream_ == Video) {
  ------------------
  |  Branch (1175:7): [True: 331, False: 1.70k]
  ------------------
 1176|    331|    if (timeOfFrames == 0)
  ------------------
  |  Branch (1176:9): [True: 90, False: 241]
  ------------------
 1177|     90|      timeOfFrames = 1;
 1178|    331|    xmpData_["Xmp.video.FrameRate"] =
 1179|    331|        static_cast<double>(totalframes) * static_cast<double>(mdhdTimeScale_) / static_cast<double>(timeOfFrames);
 1180|    331|  }
 1181|  2.03k|}  // QuickTimeVideo::timeToSampleDecoder
_ZN5Exiv214QuickTimeVideo10sampleDescEm:
 1183|  1.66k|void QuickTimeVideo::sampleDesc(size_t size) {
 1184|  1.66k|  DataBuf buf(100);
 1185|  1.66k|  size_t cur_pos = io_->tell();
 1186|  1.66k|  io_->readOrThrow(buf.data(), 4);
 1187|  1.66k|  io_->readOrThrow(buf.data(), 4);
 1188|  1.66k|  const uint32_t noOfEntries = buf.read_uint32(0, bigEndian);
 1189|       |
 1190|   109k|  for (uint32_t i = 0; i < noOfEntries; i++) {
  ------------------
  |  Branch (1190:24): [True: 108k, False: 1.08k]
  ------------------
 1191|   108k|    if (currentStream_ == Video)
  ------------------
  |  Branch (1191:9): [True: 57.5k, False: 50.7k]
  ------------------
 1192|  57.5k|      imageDescDecoder();
 1193|  50.7k|    else if (currentStream_ == Audio)
  ------------------
  |  Branch (1193:14): [True: 50.2k, False: 586]
  ------------------
 1194|  50.2k|      audioDescDecoder();
 1195|    586|    else
 1196|    586|      break;
 1197|   108k|  }
 1198|  1.66k|  io_->seek(Safe::add(cur_pos, size), BasicIo::beg);
 1199|  1.66k|}  // QuickTimeVideo::sampleDesc
_ZN5Exiv214QuickTimeVideo16audioDescDecoderEv:
 1201|  50.2k|void QuickTimeVideo::audioDescDecoder() {
 1202|  50.2k|  DataBuf buf(40);
 1203|  50.2k|  std::memset(buf.data(), 0x0, buf.size());
 1204|  50.2k|  buf.data()[4] = '\0';
 1205|  50.2k|  io_->readOrThrow(buf.data(), 4);
 1206|  50.2k|  size_t size = 82;
 1207|       |
 1208|  50.2k|  const TagVocabulary* td;
 1209|       |
 1210|  1.05M|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1210:19): [True: 1.00M, False: 50.0k]
  ------------------
 1211|  1.00M|    io_->readOrThrow(buf.data(), 4);
 1212|  1.00M|    switch (i) {
 1213|  50.1k|      case AudioFormat:
  ------------------
  |  Branch (1213:7): [True: 50.1k, False: 951k]
  ------------------
 1214|  50.1k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1215|  50.1k|        if (td)
  ------------------
  |  Branch (1215:13): [True: 938, False: 49.2k]
  ------------------
 1216|    938|          xmpData_["Xmp.audio.Compressor"] = _(td->label_);
  ------------------
  |  |   40|    938|#define _(String) (String)
  ------------------
 1217|  49.2k|        else
 1218|  49.2k|          xmpData_["Xmp.audio.Compressor"] = buf.data();
 1219|  50.1k|        break;
 1220|  50.1k|      case AudioVendorID:
  ------------------
  |  Branch (1220:7): [True: 50.1k, False: 951k]
  ------------------
 1221|  50.1k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1222|  50.1k|        if (td)
  ------------------
  |  Branch (1222:13): [True: 1.54k, False: 48.5k]
  ------------------
 1223|  1.54k|          xmpData_["Xmp.audio.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.54k|#define _(String) (String)
  ------------------
 1224|  50.1k|        break;
 1225|  50.1k|      case AudioChannels:
  ------------------
  |  Branch (1225:7): [True: 50.1k, False: 951k]
  ------------------
 1226|  50.1k|        xmpData_["Xmp.audio.ChannelType"] = buf.read_uint16(0, bigEndian);
 1227|  50.1k|        xmpData_["Xmp.audio.BitsPerSample"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1228|  50.1k|        break;
 1229|  50.0k|      case AudioSampleRate:
  ------------------
  |  Branch (1229:7): [True: 50.0k, False: 951k]
  ------------------
 1230|  50.0k|        xmpData_["Xmp.audio.SampleRate"] =
 1231|  50.0k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1232|  50.0k|        break;
 1233|   801k|      default:
  ------------------
  |  Branch (1233:7): [True: 801k, False: 200k]
  ------------------
 1234|   801k|        break;
 1235|  1.00M|    }
 1236|  1.00M|  }
 1237|  50.0k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));  // cause size is so small, this cast should be right.
 1238|  50.0k|}  // QuickTimeVideo::audioDescDecoder
_ZN5Exiv214QuickTimeVideo16imageDescDecoderEv:
 1240|  57.5k|void QuickTimeVideo::imageDescDecoder() {
 1241|  57.5k|  DataBuf buf(40);
 1242|  57.5k|  std::memset(buf.data(), 0x0, buf.size());
 1243|  57.5k|  buf.data()[4] = '\0';
 1244|  57.5k|  io_->readOrThrow(buf.data(), 4);
 1245|  57.5k|  size_t size = 82;
 1246|       |
 1247|  57.5k|  const TagVocabulary* td;
 1248|       |
 1249|   689k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1249:19): [True: 632k, False: 57.4k]
  ------------------
 1250|   632k|    io_->readOrThrow(buf.data(), 4);
 1251|   632k|    buf.write_uint8(4, 0);  // nul-terminate string
 1252|       |
 1253|   632k|    switch (i) {
 1254|  57.5k|      case codec:
  ------------------
  |  Branch (1254:7): [True: 57.5k, False: 574k]
  ------------------
 1255|  57.5k|        td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1256|  57.5k|        if (td)
  ------------------
  |  Branch (1256:13): [True: 602, False: 56.9k]
  ------------------
 1257|    602|          xmpData_["Xmp.video.Codec"] = _(td->label_);
  ------------------
  |  |   40|    602|#define _(String) (String)
  ------------------
 1258|  56.9k|        else
 1259|  56.9k|          xmpData_["Xmp.video.Codec"] = buf.data();
 1260|  57.5k|        break;
 1261|  57.5k|      case VendorID:
  ------------------
  |  Branch (1261:7): [True: 57.5k, False: 575k]
  ------------------
 1262|  57.5k|        td = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1263|  57.5k|        if (td)
  ------------------
  |  Branch (1263:13): [True: 1.15k, False: 56.3k]
  ------------------
 1264|  1.15k|          xmpData_["Xmp.video.VendorID"] = _(td->label_);
  ------------------
  |  |   40|  1.15k|#define _(String) (String)
  ------------------
 1265|  57.5k|        break;
 1266|  57.4k|      case SourceImageWidth_Height:
  ------------------
  |  Branch (1266:7): [True: 57.4k, False: 575k]
  ------------------
 1267|  57.4k|        xmpData_["Xmp.video.SourceImageWidth"] = buf.read_uint16(0, bigEndian);
 1268|  57.4k|        xmpData_["Xmp.video.SourceImageHeight"] = ((buf.data()[2] * 256) + buf.data()[3]);
 1269|  57.4k|        break;
 1270|  57.4k|      case XResolution:
  ------------------
  |  Branch (1270:7): [True: 57.4k, False: 575k]
  ------------------
 1271|  57.4k|        xmpData_["Xmp.video.XResolution"] =
 1272|  57.4k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1273|  57.4k|        break;
 1274|  57.4k|      case YResolution:
  ------------------
  |  Branch (1274:7): [True: 57.4k, False: 575k]
  ------------------
 1275|  57.4k|        xmpData_["Xmp.video.YResolution"] =
 1276|  57.4k|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1277|  57.4k|        io_->readOrThrow(buf.data(), 3);
 1278|  57.4k|        size -= 3;
 1279|  57.4k|        break;
 1280|  57.4k|      case CompressorName:
  ------------------
  |  Branch (1280:7): [True: 57.4k, False: 575k]
  ------------------
 1281|  57.4k|        io_->readOrThrow(buf.data(), 32);
 1282|  57.4k|        size -= 32;
 1283|  57.4k|        xmpData_["Xmp.video.Compressor"] = buf.data();
 1284|  57.4k|        break;
 1285|   287k|      default:
  ------------------
  |  Branch (1285:7): [True: 287k, False: 344k]
  ------------------
 1286|   287k|        break;
 1287|   632k|    }
 1288|   632k|  }
 1289|  57.4k|  io_->readOrThrow(buf.data(), static_cast<long>(size % 4));
 1290|  57.4k|  xmpData_["Xmp.video.BitDepth"] = static_cast<int>(buf.read_uint8(0));
 1291|  57.4k|}  // QuickTimeVideo::imageDescDecoder
_ZN5Exiv214QuickTimeVideo22multipleEntriesDecoderEm:
 1293|  2.08k|void QuickTimeVideo::multipleEntriesDecoder(size_t recursion_depth) {
 1294|  2.08k|  enforce(recursion_depth < max_recursion_depth_, Exiv2::ErrorCode::kerCorruptedMetadata);
 1295|  2.08k|  DataBuf buf(4 + 1);
 1296|  2.08k|  io_->readOrThrow(buf.data(), 4);
 1297|  2.08k|  io_->readOrThrow(buf.data(), 4);
 1298|  2.08k|  uint32_t noOfEntries;
 1299|       |
 1300|  2.08k|  noOfEntries = buf.read_uint32(0, bigEndian);
 1301|       |
 1302|  4.41k|  for (uint32_t i = 0; i < noOfEntries && continueTraversing_; i++) {
  ------------------
  |  Branch (1302:24): [True: 2.64k, False: 1.77k]
  |  Branch (1302:43): [True: 2.32k, False: 318]
  ------------------
 1303|  2.32k|    decodeBlock(recursion_depth + 1);
 1304|  2.32k|  }
 1305|  2.08k|}  // QuickTimeVideo::multipleEntriesDecoder
_ZN5Exiv214QuickTimeVideo18videoHeaderDecoderEm:
 1307|  5.19k|void QuickTimeVideo::videoHeaderDecoder(size_t size) {
 1308|  5.19k|  DataBuf buf(3);
 1309|  5.19k|  std::memset(buf.data(), 0x0, buf.size());
 1310|  5.19k|  buf.data()[2] = '\0';
 1311|  5.19k|  currentStream_ = Video;
 1312|       |
 1313|  5.19k|  const TagDetails* td;
 1314|       |
 1315|  32.0k|  for (int i = 0; size / 2 != 0; size -= 2, i++) {
  ------------------
  |  Branch (1315:19): [True: 26.8k, False: 5.19k]
  ------------------
 1316|  26.8k|    io_->readOrThrow(buf.data(), 2);
 1317|       |
 1318|  26.8k|    switch (i) {
 1319|  5.07k|      case GraphicsMode:
  ------------------
  |  Branch (1319:7): [True: 5.07k, False: 21.8k]
  ------------------
 1320|  5.07k|        td = Exiv2::find(graphicsModetags, buf.read_uint16(0, bigEndian));
 1321|  5.07k|        if (td)
  ------------------
  |  Branch (1321:13): [True: 4.61k, False: 462]
  ------------------
 1322|  4.61k|          xmpData_["Xmp.video.GraphicsMode"] = _(td->label_);
  ------------------
  |  |   40|  4.61k|#define _(String) (String)
  ------------------
 1323|  5.07k|        break;
 1324|  5.07k|      case OpColor:
  ------------------
  |  Branch (1324:7): [True: 5.07k, False: 21.8k]
  ------------------
 1325|  5.07k|        xmpData_["Xmp.video.OpColor"] = buf.read_uint16(0, bigEndian);
 1326|  5.07k|        break;
 1327|  16.7k|      default:
  ------------------
  |  Branch (1327:7): [True: 16.7k, False: 10.1k]
  ------------------
 1328|  16.7k|        break;
 1329|  26.8k|    }
 1330|  26.8k|  }
 1331|  5.19k|  io_->readOrThrow(buf.data(), size % 2);
 1332|  5.19k|}  // QuickTimeVideo::videoHeaderDecoder
_ZN5Exiv214QuickTimeVideo14handlerDecoderEm:
 1334|  6.97k|void QuickTimeVideo::handlerDecoder(size_t size) {
 1335|  6.97k|  size_t cur_pos = io_->tell();
 1336|  6.97k|  DataBuf buf(5);
 1337|  6.97k|  std::memset(buf.data(), 0x0, buf.size());
 1338|  6.97k|  buf.data()[4] = '\0';
 1339|       |
 1340|  6.97k|  const TagVocabulary* tv;
 1341|       |
 1342|  41.8k|  for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1342:19): [True: 34.8k, False: 6.96k]
  ------------------
 1343|  34.8k|    io_->readOrThrow(buf.data(), 4);
 1344|       |
 1345|  34.8k|    switch (i) {
  ------------------
  |  Branch (1345:13): [True: 20.8k, False: 13.9k]
  ------------------
 1346|  6.96k|      case HandlerClass:
  ------------------
  |  Branch (1346:7): [True: 6.96k, False: 27.8k]
  ------------------
 1347|  6.96k|        tv = Exiv2::find(handlerClassTags, Exiv2::toString(buf.data()));
 1348|  6.96k|        if (tv) {
  ------------------
  |  Branch (1348:13): [True: 2.94k, False: 4.02k]
  ------------------
 1349|  2.94k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1349:15): [True: 176, False: 2.76k]
  ------------------
 1350|    176|            xmpData_["Xmp.video.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    176|#define _(String) (String)
  ------------------
 1351|  2.76k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1351:20): [True: 962, False: 1.80k]
  ------------------
 1352|    962|            xmpData_["Xmp.audio.HandlerClass"] = _(tv->label_);
  ------------------
  |  |   40|    962|#define _(String) (String)
  ------------------
 1353|  2.94k|        }
 1354|  6.96k|        break;
 1355|  6.96k|      case HandlerType:
  ------------------
  |  Branch (1355:7): [True: 6.96k, False: 27.8k]
  ------------------
 1356|  6.96k|        tv = Exiv2::find(handlerTypeTags, Exiv2::toString(buf.data()));
 1357|  6.96k|        if (tv) {
  ------------------
  |  Branch (1357:13): [True: 4.73k, False: 2.23k]
  ------------------
 1358|  4.73k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1358:15): [True: 325, False: 4.40k]
  ------------------
 1359|    325|            xmpData_["Xmp.video.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|    325|#define _(String) (String)
  ------------------
 1360|  4.40k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1360:20): [True: 1.39k, False: 3.01k]
  ------------------
 1361|  1.39k|            xmpData_["Xmp.audio.HandlerType"] = _(tv->label_);
  ------------------
  |  |   40|  1.39k|#define _(String) (String)
  ------------------
 1362|  4.73k|        }
 1363|  6.96k|        break;
 1364|  6.96k|      case HandlerVendorID:
  ------------------
  |  Branch (1364:7): [True: 6.96k, False: 27.8k]
  ------------------
 1365|  6.96k|        tv = Exiv2::find(vendorIDTags, Exiv2::toString(buf.data()));
 1366|  6.96k|        if (tv) {
  ------------------
  |  Branch (1366:13): [True: 3.23k, False: 3.73k]
  ------------------
 1367|  3.23k|          if (currentStream_ == Video)
  ------------------
  |  Branch (1367:15): [True: 157, False: 3.07k]
  ------------------
 1368|    157|            xmpData_["Xmp.video.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    157|#define _(String) (String)
  ------------------
 1369|  3.07k|          else if (currentStream_ == Audio)
  ------------------
  |  Branch (1369:20): [True: 945, False: 2.13k]
  ------------------
 1370|    945|            xmpData_["Xmp.audio.HandlerVendorID"] = _(tv->label_);
  ------------------
  |  |   40|    945|#define _(String) (String)
  ------------------
 1371|  3.23k|        }
 1372|  6.96k|        break;
 1373|  34.8k|    }
 1374|  34.8k|  }
 1375|  6.96k|  io_->seek(cur_pos + size, BasicIo::beg);
 1376|  6.96k|}  // QuickTimeVideo::handlerDecoder
_ZN5Exiv214QuickTimeVideo15fileTypeDecoderEm:
 1378|  3.53k|void QuickTimeVideo::fileTypeDecoder(size_t size) {
 1379|  3.53k|  DataBuf buf(5);
 1380|  3.53k|  std::memset(buf.data(), 0x0, buf.size());
 1381|  3.53k|  buf.data()[4] = '\0';
 1382|  3.53k|  Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpSeq);
 1383|  3.53k|  const TagVocabulary* td;
 1384|       |
 1385|  22.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1385:19): [True: 18.8k, False: 3.53k]
  ------------------
 1386|  18.8k|    io_->readOrThrow(buf.data(), 4);
 1387|  18.8k|    td = Exiv2::find(qTimeFileType, Exiv2::toString(buf.data()));
 1388|       |
 1389|  18.8k|    switch (i) {
 1390|  3.45k|      case 0:
  ------------------
  |  Branch (1390:7): [True: 3.45k, False: 15.3k]
  ------------------
 1391|  3.45k|        if (td)
  ------------------
  |  Branch (1391:13): [True: 2.99k, False: 467]
  ------------------
 1392|  2.99k|          xmpData_["Xmp.video.MajorBrand"] = _(td->label_);
  ------------------
  |  |   40|  2.99k|#define _(String) (String)
  ------------------
 1393|  3.45k|        break;
 1394|  1.08k|      case 1:
  ------------------
  |  Branch (1394:7): [True: 1.08k, False: 17.7k]
  ------------------
 1395|  1.08k|        xmpData_["Xmp.video.MinorVersion"] = buf.read_uint32(0, bigEndian);
 1396|  1.08k|        break;
 1397|  14.2k|      default:
  ------------------
  |  Branch (1397:7): [True: 14.2k, False: 4.54k]
  ------------------
 1398|  14.2k|        if (td)
  ------------------
  |  Branch (1398:13): [True: 2.10k, False: 12.1k]
  ------------------
 1399|  2.10k|          v->read(_(td->label_));
  ------------------
  |  |   40|  2.10k|#define _(String) (String)
  ------------------
 1400|  12.1k|        else
 1401|  12.1k|          v->read(Exiv2::toString(buf.data()));
 1402|  14.2k|        break;
 1403|  18.8k|    }
 1404|  18.8k|  }
 1405|  3.53k|  xmpData_.add(Exiv2::XmpKey("Xmp.video.CompatibleBrands"), v.get());
 1406|  3.53k|  io_->readOrThrow(buf.data(), size % 4);
 1407|  3.53k|}  // QuickTimeVideo::fileTypeDecoder
_ZN5Exiv214QuickTimeVideo18mediaHeaderDecoderEm:
 1409|  2.17k|void QuickTimeVideo::mediaHeaderDecoder(size_t size) {
 1410|  2.17k|  DataBuf buf(5);
 1411|  2.17k|  std::memset(buf.data(), 0x0, buf.size());
 1412|  2.17k|  buf.data()[4] = '\0';
 1413|  2.17k|  int64_t time_scale = 1;
 1414|       |
 1415|  11.7k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1415:19): [True: 9.55k, False: 2.17k]
  ------------------
 1416|  9.55k|    io_->readOrThrow(buf.data(), 4);
 1417|       |
 1418|  9.55k|    switch (i) {
 1419|  1.68k|      case MediaHeaderVersion:
  ------------------
  |  Branch (1419:7): [True: 1.68k, False: 7.86k]
  ------------------
 1420|  1.68k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1420:13): [True: 178, False: 1.50k]
  ------------------
 1421|    178|          xmpData_["Xmp.video.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1422|  1.50k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1422:18): [True: 475, False: 1.03k]
  ------------------
 1423|    475|          xmpData_["Xmp.audio.MediaHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1424|  1.68k|        break;
 1425|  1.65k|      case MediaCreateDate:
  ------------------
  |  Branch (1425:7): [True: 1.65k, False: 7.89k]
  ------------------
 1426|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1427|  1.65k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1427:13): [True: 156, False: 1.50k]
  ------------------
 1428|    156|          xmpData_["Xmp.video.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1429|  1.50k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1429:18): [True: 475, False: 1.02k]
  ------------------
 1430|    475|          xmpData_["Xmp.audio.MediaCreateDate"] = buf.read_uint32(0, bigEndian);
 1431|  1.65k|        break;
 1432|  1.43k|      case MediaModifyDate:
  ------------------
  |  Branch (1432:7): [True: 1.43k, False: 8.12k]
  ------------------
 1433|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1434|  1.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1434:13): [True: 94, False: 1.33k]
  ------------------
 1435|     94|          xmpData_["Xmp.video.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1436|  1.33k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1436:18): [True: 475, False: 861]
  ------------------
 1437|    475|          xmpData_["Xmp.audio.MediaModifyDate"] = buf.read_uint32(0, bigEndian);
 1438|  1.43k|        break;
 1439|  1.43k|      case MediaTimeScale:
  ------------------
  |  Branch (1439:7): [True: 1.43k, False: 8.12k]
  ------------------
 1440|  1.43k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1440:13): [True: 94, False: 1.33k]
  ------------------
 1441|     94|          xmpData_["Xmp.video.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1442|  1.33k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1442:18): [True: 475, False: 861]
  ------------------
 1443|    475|          xmpData_["Xmp.audio.MediaTimeScale"] = buf.read_uint32(0, bigEndian);
 1444|  1.43k|        time_scale = std::max(1U, buf.read_uint32(0, bigEndian));
 1445|  1.43k|        mdhdTimeScale_ = time_scale;
 1446|  1.43k|        break;
 1447|  1.42k|      case MediaDuration:
  ------------------
  |  Branch (1447:7): [True: 1.42k, False: 8.12k]
  ------------------
 1448|  1.42k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1448:13): [True: 93, False: 1.33k]
  ------------------
 1449|     93|          xmpData_["Xmp.video.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1449:49): [True: 93, False: 0]
  ------------------
 1450|  1.33k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1450:18): [True: 475, False: 861]
  ------------------
 1451|    475|          xmpData_["Xmp.audio.MediaDuration"] = time_scale ? buf.read_uint32(0, bigEndian) / time_scale : 0;
  ------------------
  |  Branch (1451:49): [True: 475, False: 0]
  ------------------
 1452|  1.42k|        break;
 1453|  1.42k|      case MediaLanguageCode:
  ------------------
  |  Branch (1453:7): [True: 1.42k, False: 8.12k]
  ------------------
 1454|  1.42k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1454:13): [True: 93, False: 1.33k]
  ------------------
 1455|     93|          xmpData_["Xmp.video.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1456|  1.33k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1456:18): [True: 475, False: 861]
  ------------------
 1457|    475|          xmpData_["Xmp.audio.MediaLangCode"] = buf.read_uint16(0, bigEndian);
 1458|  1.42k|        break;
 1459|       |
 1460|    493|      default:
  ------------------
  |  Branch (1460:7): [True: 493, False: 9.06k]
  ------------------
 1461|    493|        break;
 1462|  9.55k|    }
 1463|  9.55k|  }
 1464|  2.17k|  io_->readOrThrow(buf.data(), size % 4);
 1465|  2.17k|}  // QuickTimeVideo::mediaHeaderDecoder
_ZN5Exiv214QuickTimeVideo18trackHeaderDecoderEm:
 1467|  1.28k|void QuickTimeVideo::trackHeaderDecoder(size_t size) {
 1468|  1.28k|  DataBuf buf(5);
 1469|  1.28k|  std::memset(buf.data(), 0x0, buf.size());
 1470|  1.28k|  buf.data()[4] = '\0';
 1471|  1.28k|  int64_t temp = 0;
 1472|       |
 1473|  26.3k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1473:19): [True: 25.0k, False: 1.28k]
  ------------------
 1474|  25.0k|    io_->readOrThrow(buf.data(), 4);
 1475|       |
 1476|  25.0k|    switch (i) {
 1477|  1.18k|      case TrackHeaderVersion:
  ------------------
  |  Branch (1477:7): [True: 1.18k, False: 23.8k]
  ------------------
 1478|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1478:13): [True: 153, False: 1.03k]
  ------------------
 1479|    153|          xmpData_["Xmp.video.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1480|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1480:18): [True: 497, False: 538]
  ------------------
 1481|    497|          xmpData_["Xmp.audio.TrackHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1482|  1.18k|        break;
 1483|  1.18k|      case TrackCreateDate:
  ------------------
  |  Branch (1483:7): [True: 1.18k, False: 23.8k]
  ------------------
 1484|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1485|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1485:13): [True: 153, False: 1.03k]
  ------------------
 1486|    153|          xmpData_["Xmp.video.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1487|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1487:18): [True: 497, False: 537]
  ------------------
 1488|    497|          xmpData_["Xmp.audio.TrackCreateDate"] = buf.read_uint32(0, bigEndian);
 1489|  1.18k|        break;
 1490|  1.18k|      case TrackModifyDate:
  ------------------
  |  Branch (1490:7): [True: 1.18k, False: 23.8k]
  ------------------
 1491|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1492|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1492:13): [True: 153, False: 1.03k]
  ------------------
 1493|    153|          xmpData_["Xmp.video.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1494|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1494:18): [True: 497, False: 536]
  ------------------
 1495|    497|          xmpData_["Xmp.audio.TrackModifyDate"] = buf.read_uint32(0, bigEndian);
 1496|  1.18k|        break;
 1497|  1.18k|      case TrackID:
  ------------------
  |  Branch (1497:7): [True: 1.18k, False: 23.8k]
  ------------------
 1498|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1498:13): [True: 153, False: 1.03k]
  ------------------
 1499|    153|          xmpData_["Xmp.video.TrackID"] = buf.read_uint32(0, bigEndian);
 1500|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1500:18): [True: 497, False: 534]
  ------------------
 1501|    497|          xmpData_["Xmp.audio.TrackID"] = buf.read_uint32(0, bigEndian);
 1502|  1.18k|        break;
 1503|  1.18k|      case TrackDuration:
  ------------------
  |  Branch (1503:7): [True: 1.18k, False: 23.8k]
  ------------------
 1504|  1.18k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1504:13): [True: 153, False: 1.03k]
  ------------------
 1505|    153|          xmpData_["Xmp.video.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1505:49): [True: 153, False: 0]
  ------------------
 1506|  1.03k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1506:18): [True: 497, False: 533]
  ------------------
 1507|    497|          xmpData_["Xmp.audio.TrackDuration"] = mvhdTimeScale_ ? buf.read_uint32(0, bigEndian) / mvhdTimeScale_ : 0;
  ------------------
  |  Branch (1507:49): [True: 497, False: 0]
  ------------------
 1508|  1.18k|        break;
 1509|  1.17k|      case TrackLayer:
  ------------------
  |  Branch (1509:7): [True: 1.17k, False: 23.8k]
  ------------------
 1510|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1510:13): [True: 146, False: 1.02k]
  ------------------
 1511|    146|          xmpData_["Xmp.video.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1512|  1.02k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1512:18): [True: 497, False: 530]
  ------------------
 1513|    497|          xmpData_["Xmp.audio.TrackLayer"] = buf.read_uint16(0, bigEndian);
 1514|  1.17k|        break;
 1515|  1.17k|      case TrackVolume:
  ------------------
  |  Branch (1515:7): [True: 1.17k, False: 23.8k]
  ------------------
 1516|  1.17k|        if (currentStream_ == Video)
  ------------------
  |  Branch (1516:13): [True: 146, False: 1.02k]
  ------------------
 1517|    146|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1518|  1.02k|        else if (currentStream_ == Audio)
  ------------------
  |  Branch (1518:18): [True: 497, False: 530]
  ------------------
 1519|    497|          xmpData_["Xmp.video.TrackVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1520|  1.17k|        break;
 1521|  1.15k|      case ImageWidth:
  ------------------
  |  Branch (1521:7): [True: 1.15k, False: 23.8k]
  ------------------
 1522|  1.15k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1522:13): [True: 135, False: 1.02k]
  ------------------
 1523|    135|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1524|    135|          xmpData_["Xmp.video.Width"] = temp;
 1525|    135|          width_ = temp;
 1526|    135|        }
 1527|  1.15k|        break;
 1528|  1.15k|      case ImageHeight:
  ------------------
  |  Branch (1528:7): [True: 1.15k, False: 23.8k]
  ------------------
 1529|  1.15k|        if (currentStream_ == Video) {
  ------------------
  |  Branch (1529:13): [True: 135, False: 1.02k]
  ------------------
 1530|    135|          temp = buf.read_uint16(0, bigEndian) + static_cast<int64_t>((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1531|    135|          xmpData_["Xmp.video.Height"] = temp;
 1532|    135|          height_ = temp;
 1533|    135|        }
 1534|  1.15k|        break;
 1535|  14.4k|      default:
  ------------------
  |  Branch (1535:7): [True: 14.4k, False: 10.5k]
  ------------------
 1536|  14.4k|        break;
 1537|  25.0k|    }
 1538|  25.0k|  }
 1539|  1.28k|  io_->readOrThrow(buf.data(), size % 4);
 1540|  1.28k|}  // QuickTimeVideo::trackHeaderDecoder
_ZN5Exiv214QuickTimeVideo18movieHeaderDecoderEm:
 1542|    165|void QuickTimeVideo::movieHeaderDecoder(size_t size) {
 1543|    165|  DataBuf buf(5);
 1544|    165|  std::memset(buf.data(), 0x0, buf.size());
 1545|    165|  buf.data()[4] = '\0';
 1546|       |
 1547|  1.49k|  for (int i = 0; size / 4 != 0; size -= 4, i++) {
  ------------------
  |  Branch (1547:19): [True: 1.32k, False: 165]
  ------------------
 1548|  1.32k|    io_->readOrThrow(buf.data(), 4);
 1549|       |
 1550|  1.32k|    switch (i) {
 1551|    122|      case MovieHeaderVersion:
  ------------------
  |  Branch (1551:7): [True: 122, False: 1.20k]
  ------------------
 1552|    122|        xmpData_["Xmp.video.MovieHeaderVersion"] = static_cast<int>(buf.read_uint8(0));
 1553|    122|        break;
 1554|    121|      case CreateDate:
  ------------------
  |  Branch (1554:7): [True: 121, False: 1.20k]
  ------------------
 1555|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1556|    121|        xmpData_["Xmp.video.DateUTC"] = buf.read_uint32(0, bigEndian);
 1557|    121|        break;
 1558|     84|      case ModifyDate:
  ------------------
  |  Branch (1558:7): [True: 84, False: 1.24k]
  ------------------
 1559|       |        // A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the movie atom was created.
 1560|     84|        xmpData_["Xmp.video.ModificationDate"] = buf.read_uint32(0, bigEndian);
 1561|     84|        break;
 1562|     83|      case TimeScale:
  ------------------
  |  Branch (1562:7): [True: 83, False: 1.24k]
  ------------------
 1563|     83|        xmpData_["Xmp.video.TimeScale"] = buf.read_uint32(0, bigEndian);
 1564|     83|        mvhdTimeScale_ = std::max(1U, buf.read_uint32(0, bigEndian));
 1565|     83|        break;
 1566|     80|      case Duration:
  ------------------
  |  Branch (1566:7): [True: 80, False: 1.24k]
  ------------------
 1567|     80|        if (mvhdTimeScale_ != 0) {  // To prevent division by zero
  ------------------
  |  Branch (1567:13): [True: 80, False: 0]
  ------------------
 1568|     80|          xmpData_["Xmp.video.Duration"] = buf.read_uint32(0, bigEndian) * 1000 / mvhdTimeScale_;
 1569|     80|        }
 1570|     80|        break;
 1571|     80|      case PreferredRate:
  ------------------
  |  Branch (1571:7): [True: 80, False: 1.24k]
  ------------------
 1572|     80|        xmpData_["Xmp.video.PreferredRate"] =
 1573|     80|            buf.read_uint16(0, bigEndian) + ((buf.data()[2] * 256 + buf.data()[3]) * 0.01);
 1574|     80|        break;
 1575|     78|      case PreferredVolume:
  ------------------
  |  Branch (1575:7): [True: 78, False: 1.24k]
  ------------------
 1576|     78|        xmpData_["Xmp.video.PreferredVolume"] = (static_cast<int>(buf.read_uint8(0)) + (buf.data()[2] * 0.1)) * 100;
 1577|     78|        break;
 1578|     25|      case PreviewTime:
  ------------------
  |  Branch (1578:7): [True: 25, False: 1.30k]
  ------------------
 1579|     25|        xmpData_["Xmp.video.PreviewTime"] = buf.read_uint32(0, bigEndian);
 1580|     25|        break;
 1581|     25|      case PreviewDuration:
  ------------------
  |  Branch (1581:7): [True: 25, False: 1.30k]
  ------------------
 1582|     25|        xmpData_["Xmp.video.PreviewDuration"] = buf.read_uint32(0, bigEndian);
 1583|     25|        break;
 1584|     25|      case PosterTime:
  ------------------
  |  Branch (1584:7): [True: 25, False: 1.30k]
  ------------------
 1585|     25|        xmpData_["Xmp.video.PosterTime"] = buf.read_uint32(0, bigEndian);
 1586|     25|        break;
 1587|     24|      case SelectionTime:
  ------------------
  |  Branch (1587:7): [True: 24, False: 1.30k]
  ------------------
 1588|     24|        xmpData_["Xmp.video.SelectionTime"] = buf.read_uint32(0, bigEndian);
 1589|     24|        break;
 1590|     24|      case SelectionDuration:
  ------------------
  |  Branch (1590:7): [True: 24, False: 1.30k]
  ------------------
 1591|     24|        xmpData_["Xmp.video.SelectionDuration"] = buf.read_uint32(0, bigEndian);
 1592|     24|        break;
 1593|     10|      case CurrentTime:
  ------------------
  |  Branch (1593:7): [True: 10, False: 1.31k]
  ------------------
 1594|     10|        xmpData_["Xmp.video.CurrentTime"] = buf.read_uint32(0, bigEndian);
 1595|     10|        break;
 1596|     10|      case NextTrackID:
  ------------------
  |  Branch (1596:7): [True: 10, False: 1.31k]
  ------------------
 1597|     10|        xmpData_["Xmp.video.NextTrackID"] = buf.read_uint32(0, bigEndian);
 1598|     10|        break;
 1599|    535|      default:
  ------------------
  |  Branch (1599:7): [True: 535, False: 791]
  ------------------
 1600|    535|        break;
 1601|  1.32k|    }
 1602|  1.32k|  }
 1603|    165|  io_->readOrThrow(buf.data(), size % 4);
 1604|    165|}  // QuickTimeVideo::movieHeaderDecoder
_ZN5Exiv216newQTimeInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
 1606|  5.68k|Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
 1607|  5.68k|  auto image = std::make_unique<QuickTimeVideo>(std::move(io), params);
 1608|  5.68k|  if (!image->good()) {
  ------------------
  |  Branch (1608:7): [True: 10, False: 5.67k]
  ------------------
 1609|     10|    return nullptr;
 1610|     10|  }
 1611|  5.67k|  return image;
 1612|  5.68k|}
_ZN5Exiv211isQTimeTypeERNS_7BasicIoEb:
 1614|  29.9k|bool isQTimeType(BasicIo& iIo, bool advance) {
 1615|  29.9k|  auto buf = DataBuf(12 + 1);
 1616|  29.9k|  iIo.read(buf.data(), 12);
 1617|  29.9k|  buf.write_uint8(12, 0);  // nul-terminate string
 1618|       |
 1619|  29.9k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 29.9k]
  |  Branch (1619:22): [True: 567, False: 29.3k]
  ------------------
 1620|    567|    return false;
 1621|    567|  }
 1622|  29.3k|  auto qTimeTags = std::array{"PICT", "free", "ftyp", "junk", "mdat", "moov", "pict", "pnot", "skip", "uuid", "wide"};
 1623|       |
 1624|  29.3k|  bool matched = false;
 1625|       |
 1626|   215k|  for (auto const& tag : qTimeTags) {
  ------------------
  |  Branch (1626:24): [True: 215k, False: 8.59k]
  ------------------
 1627|   215k|    auto tmp = buf.cmpBytes(4, tag, 4);
 1628|   215k|    if (tmp == 0) {
  ------------------
  |  Branch (1628:9): [True: 20.7k, False: 194k]
  ------------------
 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|  20.7k|      if (Exiv2::find(qTimeFileType, Exiv2::toString(buf.data(8)))) {
  ------------------
  |  Branch (1632:11): [True: 17.0k, False: 3.77k]
  ------------------
 1633|  17.0k|        matched = true;
 1634|  17.0k|      }
 1635|  20.7k|      break;
 1636|  20.7k|    }
 1637|   215k|  }
 1638|       |
 1639|  29.3k|  if (!advance || !matched) {
  ------------------
  |  Branch (1639:7): [True: 29.3k, False: 0]
  |  Branch (1639:19): [True: 0, False: 0]
  ------------------
 1640|  29.3k|    iIo.seek(0L, BasicIo::beg);
 1641|  29.3k|  }
 1642|       |
 1643|  29.3k|  return matched;
 1644|  29.9k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL10ignoreListERNS_7DataBufE:
  503|   150k|static bool ignoreList(Exiv2::DataBuf& buf) {
  504|   150k|  const char ignoreList[13][5] = {
  505|   150k|      "mdat", "edts", "junk", "iods", "alis", "stsc", "stsz", "stco", "ctts", "stss", "skip", "wide", "cmvd",
  506|   150k|  };
  507|       |
  508|   150k|  for (auto i : ignoreList)
  ------------------
  |  Branch (508:15): [True: 1.89M, False: 139k]
  ------------------
  509|  1.89M|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (509:9): [True: 11.2k, False: 1.88M]
  ------------------
  510|  11.2k|      return true;
  511|       |
  512|   139k|  return false;
  513|   150k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14dataIgnoreListERNS_7DataBufE:
  522|  69.9k|static bool dataIgnoreList(Exiv2::DataBuf& buf) {
  523|  69.9k|  const char ignoreList[8][5] = {
  524|  69.9k|      "moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov", "meta",
  525|  69.9k|  };
  526|       |
  527|  69.9k|  for (auto i : ignoreList)
  ------------------
  |  Branch (527:15): [True: 528k, False: 57.4k]
  ------------------
  528|   528k|    if (equalsQTimeTag(buf, i))
  ------------------
  |  Branch (528:9): [True: 12.5k, False: 516k]
  ------------------
  529|  12.5k|      return true;
  530|       |
  531|  57.4k|  return false;
  532|  69.9k|}
quicktimevideo.cpp:_ZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKc:
  492|  3.15M|static bool equalsQTimeTag(Exiv2::DataBuf& buf, const char str[5]) {
  493|  3.15M|  return std::equal(buf.begin(), buf.begin() + 4, str,
  494|  3.15M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
  495|  3.15M|}
quicktimevideo.cpp:_ZZN5Exiv28InternalL14equalsQTimeTagERNS_7DataBufEPKcENK3$_0clIhcEEDaT_T0_:
  494|  3.73M|                    [](auto b, auto s) { return std::tolower(b) == std::tolower(s); });
quicktimevideo.cpp:_ZN5Exiv2L10readStringERNS_7BasicIoEm:
  620|  2.06k|static std::string readString(BasicIo& io, size_t size) {
  621|  2.06k|  enforce(size <= io.size() - io.tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
  622|  2.06k|  Exiv2::DataBuf str(size + 1);
  623|  2.06k|  io.readOrThrow(str.data(), size);
  624|  2.06k|  str.write_uint8(size, 0);  // nul-terminate string
  625|  2.06k|  return Exiv2::toString(str.data());
  626|  2.06k|}

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

_ZN5Exiv29RiffVideoC2ENSt3__110unique_ptrINS_7BasicIoENS1_14default_deleteIS3_EEEERKNS_15ImageCtorParamsE:
  365|  1.40k|    Image(ImageType::riff, mdNone, std::move(io), params) {
  366|  1.40k|}  // RiffVideo::RiffVideo
_ZNK5Exiv29RiffVideo8mimeTypeEv:
  368|  1.40k|std::string RiffVideo::mimeType() const {
  369|  1.40k|  return "video/riff";
  370|  1.40k|}
_ZN5Exiv29RiffVideo13writeMetadataEv:
  372|     26|void RiffVideo::writeMetadata() {
  373|     26|}  // RiffVideo::writeMetadata
_ZN5Exiv29RiffVideo12readMetadataEv:
  375|  1.40k|void RiffVideo::readMetadata() {
  376|  1.40k|  if (io_->open() != 0)
  ------------------
  |  Branch (376:7): [True: 0, False: 1.40k]
  ------------------
  377|      0|    throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
  378|       |
  379|       |  // Ensure that this is the correct image type
  380|  1.40k|  if (!isRiffType(*io_, false)) {
  ------------------
  |  Branch (380:7): [True: 0, False: 1.40k]
  ------------------
  381|      0|    if (io_->error() || io_->eof())
  ------------------
  |  Branch (381:9): [True: 0, False: 0]
  |  Branch (381:25): [True: 0, False: 0]
  ------------------
  382|      0|      throw Error(ErrorCode::kerFailedToReadImageData);
  383|      0|    throw Error(ErrorCode::kerNotAnImage, "RIFF");
  384|      0|  }
  385|       |
  386|  1.40k|  IoCloser closer(*io_);
  387|  1.40k|  clearMetadata();
  388|       |
  389|  1.40k|  xmpData_["Xmp.video.FileSize"] = io_->size();
  390|  1.40k|  xmpData_["Xmp.video.MimeType"] = mimeType();
  391|       |
  392|  1.40k|  HeaderReader header(io_);
  393|  1.40k|  xmpData_["Xmp.video.Container"] = header.getId();
  394|       |
  395|  1.40k|  xmpData_["Xmp.video.FileType"] = readStringTag(io_);
  396|       |
  397|  1.40k|  decodeBlocks();
  398|  1.40k|}  // RiffVideo::readMetadata
_ZN5Exiv29RiffVideo12HeaderReaderC2ERKNSt3__110unique_ptrINS_7BasicIoENS2_14default_deleteIS4_EEEE:
  400|  11.8k|RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
  401|  11.8k|  Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
  402|  11.8k|  id_ = readStringTag(io);
  403|  11.8k|  size_ = readDWORDTag(io);
  404|  11.8k|}
_ZN5Exiv29RiffVideo5equalERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  406|  60.1k|bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
  407|  60.1k|  if (str1.size() != str2.size())
  ------------------
  |  Branch (407:7): [True: 22.7k, False: 37.3k]
  ------------------
  408|  22.7k|    return false;
  409|       |
  410|  37.3k|  return Internal::upper(str1) == str2;
  411|  60.1k|}
_ZN5Exiv29RiffVideo8readListERKNS0_12HeaderReaderE:
  413|  2.41k|void RiffVideo::readList(const HeaderReader& header_) {
  414|  2.41k|  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|  2.41k|  if (equal(chunk_type, CHUNK_ID_INFO))
  ------------------
  |  Branch (421:7): [True: 2.13k, False: 272]
  ------------------
  422|  2.13k|    readInfoListChunk(header_.getSize());
  423|    272|  else if (equal(chunk_type, CHUNK_ID_MOVI)) {
  ------------------
  |  Branch (423:12): [True: 4, False: 268]
  ------------------
  424|      4|    readMoviList(header_.getSize());
  425|      4|  }
  426|  2.41k|}
_ZN5Exiv29RiffVideo9readChunkERKNS0_12HeaderReaderE:
  428|  7.80k|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|  7.80k|  if (equal(header_.getId(), CHUNK_ID_AVIH))
  ------------------
  |  Branch (435:7): [True: 682, False: 7.12k]
  ------------------
  436|    682|    readAviHeader();
  437|  7.12k|  else if (equal(header_.getId(), CHUNK_ID_STRH))
  ------------------
  |  Branch (437:12): [True: 1.21k, False: 5.90k]
  ------------------
  438|  1.21k|    readStreamHeader();
  439|  5.90k|  else if (equal(header_.getId(), CHUNK_ID_STRF))
  ------------------
  |  Branch (439:12): [True: 1.65k, False: 4.25k]
  ------------------
  440|  1.65k|    readStreamFormat(header_.getSize());
  441|  4.25k|  else if (equal(header_.getId(), CHUNK_ID_FMT)) {
  ------------------
  |  Branch (441:12): [True: 412, False: 3.84k]
  ------------------
  442|    412|    streamType_ = Audio;
  443|    412|    readStreamFormat(header_.getSize());
  444|  3.84k|  } else if (equal(header_.getId(), CHUNK_ID_STRD))
  ------------------
  |  Branch (444:14): [True: 26, False: 3.81k]
  ------------------
  445|     26|    readStreamData(header_.getSize());
  446|  3.81k|  else if (equal(header_.getId(), CHUNK_ID_STRN))
  ------------------
  |  Branch (446:12): [True: 70, False: 3.74k]
  ------------------
  447|     70|    StreamName(header_.getSize());
  448|  3.74k|  else if (equal(header_.getId(), CHUNK_ID_VPRP))
  ------------------
  |  Branch (448:12): [True: 248, False: 3.50k]
  ------------------
  449|    248|    readVPRPChunk(header_.getSize());
  450|  3.50k|  else if (equal(header_.getId(), CHUNK_ID_IDX1))
  ------------------
  |  Branch (450:12): [True: 310, False: 3.19k]
  ------------------
  451|    310|    readIndexChunk(header_.getSize());
  452|  3.19k|  else if (equal(header_.getId(), CHUNK_ID_DATA))
  ------------------
  |  Branch (452:12): [True: 379, False: 2.81k]
  ------------------
  453|    379|    readDataChunk(header_.getSize());
  454|  2.81k|  else if (equal(header_.getId(), CHUNK_ID_JUNK))
  ------------------
  |  Branch (454:12): [True: 170, False: 2.64k]
  ------------------
  455|    170|    readJunk(header_.getSize());
  456|  2.64k|  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|  2.64k|    io_->seekOrThrow(io_->tell() + header_.getSize(), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  463|  2.64k|  }
  464|  7.80k|}
_ZN5Exiv29RiffVideo12decodeBlocksEv:
  466|  1.40k|void RiffVideo::decodeBlocks() {
  467|  10.4k|  do {
  468|  10.4k|    if (HeaderReader header(io_); equal(header.getId(), CHUNK_ID_LIST)) {
  ------------------
  |  Branch (468:35): [True: 2.41k, False: 8.02k]
  ------------------
  469|  2.41k|      readList(header);
  470|  8.02k|    } else {
  471|  8.02k|      readChunk(header);
  472|  8.02k|    }
  473|  10.4k|  } while (!io_->eof() && io_->tell() < io_->size());
  ------------------
  |  Branch (473:12): [True: 9.11k, False: 1.32k]
  |  Branch (473:27): [True: 9.02k, False: 85]
  ------------------
  474|  1.40k|}  // RiffVideo::decodeBlock
_ZN5Exiv29RiffVideo13readAviHeaderEv:
  476|    682|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|    682|  uint32_t TimeBetweenFrames = readDWORDTag(io_);
  497|    682|  xmpData_["Xmp.video.MicroSecPerFrame"] = TimeBetweenFrames;
  498|    682|  double frame_rate = 1000000. / TimeBetweenFrames;
  499|       |
  500|    682|  xmpData_["Xmp.video.MaxDataRate"] = readDWORDTag(io_);  // MaximumDataRate
  501|       |
  502|    682|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg,
  503|    682|                   ErrorCode::kerFailedToReadImageData);  // ignore PaddingGranularity and Flags
  504|       |
  505|    682|  uint32_t frame_count = readDWORDTag(io_);  // TotalNumberOfFrames
  506|    682|  xmpData_["Xmp.video.FrameCount"] = frame_count;
  507|       |
  508|    682|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg,
  509|    682|                   ErrorCode::kerFailedToReadImageData);  // ignore NumberOfInitialFrames
  510|       |
  511|    682|  xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));  // NumberOfStreams
  512|       |
  513|    682|  xmpData_["Xmp.video.StreamCount"] = readDWORDTag(io_);  // SuggestedBufferSize
  514|       |
  515|    682|  uint32_t width = readDWORDTag(io_);
  516|    682|  xmpData_["Xmp.video.Width"] = width;
  517|       |
  518|    682|  uint32_t height = readDWORDTag(io_);
  519|    682|  xmpData_["Xmp.video.Height"] = height;
  520|       |
  521|    682|  io_->seekOrThrow(io_->tell() + (DWORD * 4), BasicIo::beg,
  522|    682|                   ErrorCode::kerFailedToReadImageData);  // TimeScale, DataRate, StartTime, DataLength
  523|       |
  524|    682|  xmpData_["Xmp.video.AspectRatio"] = getAspectRatio(width, height);
  525|       |
  526|    682|  fillDuration(frame_rate, frame_count);
  527|    682|}
_ZN5Exiv29RiffVideo16readStreamHeaderEv:
  529|  1.21k|void RiffVideo::readStreamHeader() {
  530|  1.21k|  std::string stream = readStringTag(io_);
  531|  1.21k|  streamType_ = (equal(stream, "VIDS")) ? Video : Audio;
  ------------------
  |  Branch (531:17): [True: 244, False: 973]
  ------------------
  532|       |
  533|       |#ifdef EXIV2_DEBUG_MESSAGES
  534|       |  EXV_INFO << "--> fccType                = " << stream << '\n';
  535|       |  EXV_INFO << "--> fccHandler             = " << readStringTag(io_) << '\n';
  536|       |  EXV_INFO << "--> dwFlags                = " << readDWORDTag(io_) << '\n';
  537|       |  EXV_INFO << "--> wPriority              = " << readWORDTag(io_) << '\n';
  538|       |  EXV_INFO << "--> wLanguage              = " << readWORDTag(io_) << '\n';
  539|       |  EXV_INFO << "--> dwInitialFrames        = " << readDWORDTag(io_) << '\n';  // 20
  540|       |  EXV_INFO << "--> dwScale                = " << readDWORDTag(io_) << '\n';
  541|       |  EXV_INFO << "--> dwRate                 = " << readDWORDTag(io_) << '\n';
  542|       |  EXV_INFO << "--> dwStart                = " << readDWORDTag(io_) << '\n';
  543|       |  EXV_INFO << "--> dwLength               = " << readDWORDTag(io_) << '\n';
  544|       |  EXV_INFO << "--> dwSuggestedBufferSize  = " << readDWORDTag(io_) << '\n';  // 40
  545|       |  EXV_INFO << "--> dwSampleSize           = " << readDWORDTag(io_) << '\n';
  546|       |  EXV_INFO << "--> Left                   = " << readWORDTag(io_) << '\n';
  547|       |  EXV_INFO << "--> top                    = " << readWORDTag(io_) << '\n';
  548|       |  EXV_INFO << "--> right                  = " << readWORDTag(io_) << '\n';
  549|       |  EXV_INFO << "--> bottom                 = " << readWORDTag(io_) << '\n';
  550|       |  EXV_INFO << "--> XXXXXX                 = " << readDWORDTag(io_) << '\n';  // 56
  551|       |  if (LogMsg::info >= LogMsg::level() && LogMsg::handler())
  552|       |    io_->seekOrThrow(io_->tell() - DWORD * 13, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  553|       |#endif
  554|       |
  555|  1.21k|  xmpData_["Xmp.video.Codec"] = readStringTag(io_);  // DataHandler
  556|       |
  557|  1.21k|  io_->seekOrThrow(io_->tell() + (DWORD * 2) + (WORD * 2), BasicIo::beg,
  558|  1.21k|                   ErrorCode::kerFailedToReadImageData);  // dwFlags, wPriority, wLanguage, dwInitialFrames
  559|       |
  560|  1.21k|  uint32_t divisor = readDWORDTag(io_);  // TimeScale
  561|       |
  562|  1.21k|  if (divisor) {
  ------------------
  |  Branch (562:7): [True: 960, False: 257]
  ------------------
  563|    960|    auto rate = static_cast<double>(readDWORDTag(io_)) / divisor;
  564|    960|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameRate" : "Xmp.audio.SampleRate"] = rate;
  ------------------
  |  Branch (564:14): [True: 141, False: 819]
  ------------------
  565|    960|  }
  566|  1.21k|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwStart
  567|       |
  568|  1.21k|  if (divisor) {
  ------------------
  |  Branch (568:7): [True: 920, False: 297]
  ------------------
  569|    920|    auto frame_count = static_cast<double>(readDWORDTag(io_)) / divisor;  // DataLength
  570|    920|    xmpData_[(streamType_ == Video) ? "Xmp.video.FrameCount" : "Xmp.audio.FrameCount"] = frame_count;
  ------------------
  |  Branch (570:14): [True: 141, False: 779]
  ------------------
  571|    920|  }
  572|       |
  573|  1.21k|  io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // dwSuggestedBufferSize
  574|       |
  575|  1.21k|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoQuality" : "Xmp.video.StreamQuality"] = readDWORDTag(io_);
  ------------------
  |  Branch (575:12): [True: 242, False: 975]
  ------------------
  576|       |
  577|  1.21k|  xmpData_[(streamType_ == Video) ? "Xmp.video.VideoSampleSize" : "Xmp.video.StreamSampleSize"] = readDWORDTag(io_);
  ------------------
  |  Branch (577:12): [True: 241, False: 976]
  ------------------
  578|  1.21k|  io_->seekOrThrow(io_->tell() + (DWORD * 2), BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  579|  1.21k|}
_ZN5Exiv29RiffVideo16readStreamFormatEm:
  581|  2.06k|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.06k|  if (streamType_ == Video) {
  ------------------
  |  Branch (612:7): [True: 246, False: 1.81k]
  ------------------
  613|    246|    io_->seekOrThrow(io_->tell() + (DWORD * 3), BasicIo::beg,
  614|    246|                     ErrorCode::kerFailedToReadImageData);  // ignore biSize, biWidth, biHeight
  615|    246|    xmpData_["Xmp.video.Planes"] = readWORDTag(io_);
  616|    246|    xmpData_["Xmp.video.PixelDepth"] = readWORDTag(io_);
  617|    246|    xmpData_["Xmp.video.Compressor"] = readStringTag(io_);
  618|    246|    xmpData_["Xmp.video.ImageLength"] = readDWORDTag(io_);
  619|    246|    xmpData_["Xmp.video.PixelPerMeterX"] = readQWORDTag(io_);
  620|    246|    xmpData_["Xmp.video.PixelPerMeterY"] = readQWORDTag(io_);
  621|    246|    if (uint32_t NumOfColours = readDWORDTag(io_))
  ------------------
  |  Branch (621:18): [True: 152, False: 94]
  ------------------
  622|    152|      xmpData_["Xmp.video.NumOfColours"] = NumOfColours;
  623|     94|    else
  624|     94|      xmpData_["Xmp.video.NumOfColours"] = "Unspecified";
  625|    246|    if (uint32_t NumIfImpColours = readDWORDTag(io_))
  ------------------
  |  Branch (625:18): [True: 188, False: 58]
  ------------------
  626|    188|      xmpData_["Xmp.video.NumIfImpColours"] = NumIfImpColours;
  627|     58|    else
  628|     58|      xmpData_["Xmp.video.NumIfImpColours"] = "All";
  629|  1.81k|  } else if (streamType_ == Audio) {
  ------------------
  |  Branch (629:14): [True: 1.48k, False: 331]
  ------------------
  630|  1.48k|    uint16_t format_tag = readWORDTag(io_);
  631|  1.48k|    if (auto it = Internal::audioEncodingValues.find(format_tag); it != Internal::audioEncodingValues.end())
  ------------------
  |  Branch (631:67): [True: 935, False: 551]
  ------------------
  632|    935|      xmpData_["Xmp.audio.Compressor"] = it->second;
  633|    551|    else
  634|    551|      xmpData_["Xmp.audio.Compressor"] = format_tag;
  635|       |
  636|  1.48k|    xmpData_["Xmp.audio.ChannelType"] = getStreamType(readDWORDTag(io_));
  637|  1.48k|    xmpData_["Xmp.audio.SampleRate"] = readDWORDTag(io_);                                      // nSamplesPerSec
  638|  1.48k|    io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // nAvgBytesPerSec
  639|  1.48k|    xmpData_["Xmp.audio.SampleType"] = readDWORDTag(io_);                                      // nBlockAlign
  640|  1.48k|    xmpData_["Xmp.audio.BitsPerSample"] = readDWORDTag(io_);                                   // wBitsPerSample
  641|  1.48k|    if (xmpData_["Xmp.video.FileType"].toString() == "AVI ")
  ------------------
  |  Branch (641:9): [True: 30, False: 1.45k]
  ------------------
  642|     30|      io_->seekOrThrow(io_->tell() + DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);  // cbSize
  643|  1.48k|  } else {
  644|    331|    io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  645|    331|  }
  646|  2.06k|}
_ZNK5Exiv29RiffVideo14readStreamDataEm:
  648|     26|void RiffVideo::readStreamData(uint64_t size_) const {
  649|     26|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  650|     26|}
_ZNK5Exiv29RiffVideo10StreamNameEm:
  652|     70|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|     70|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  655|     70|}
_ZN5Exiv29RiffVideo17readInfoListChunkEm:
  657|  2.13k|void RiffVideo::readInfoListChunk(uint64_t size_) {
  658|  2.13k|  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|  2.13k|  std::map<std::string, std::string> table;
  663|  7.42k|  while (current_size < size_) {
  ------------------
  |  Branch (663:10): [True: 5.28k, False: 2.13k]
  ------------------
  664|  5.28k|    std::string type = readStringTag(io_);
  665|  5.28k|    size_t size = readDWORDTag(io_);
  666|  5.28k|    std::string content = readStringTag(io_, size);
  667|  5.28k|    if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
  ------------------
  |  Branch (667:50): [True: 2.79k, False: 2.49k]
  ------------------
  668|       |      // Check that it isn't a duplicate.
  669|  2.79k|      Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
  670|  2.79k|      table[it->second] = content;
  671|  2.79k|    }
  672|  5.28k|    current_size += DWORD * 2;
  673|  5.28k|    current_size += size;
  674|  5.28k|  }
  675|       |  // Copy the elements from the temporary table to xmpData_.
  676|  2.71k|  for (const auto& it : table) {
  ------------------
  |  Branch (676:23): [True: 2.71k, False: 2.13k]
  ------------------
  677|  2.71k|    xmpData_[it.first] = it.second;
  678|  2.71k|  }
  679|  2.13k|}
_ZNK5Exiv29RiffVideo12readMoviListEm:
  681|      4|void RiffVideo::readMoviList(uint64_t size_) const {
  682|      4|  io_->seekOrThrow(io_->tell() + size_ - DWORD, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  683|      4|}
_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|    310|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|    310|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  729|    310|}
_ZNK5Exiv29RiffVideo13readDataChunkEm:
  731|    379|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|    379|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  743|    379|  if (size_ % 2 != 0)
  ------------------
  |  Branch (743:7): [True: 206, False: 173]
  ------------------
  744|    206|    io_->seekOrThrow(io_->tell() + 1, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  745|    379|}
_ZNK5Exiv29RiffVideo8readJunkEm:
  747|    170|void RiffVideo::readJunk(uint64_t size_) const {
  748|    170|  io_->seekOrThrow(io_->tell() + size_, BasicIo::beg, ErrorCode::kerFailedToReadImageData);
  749|    170|}
_ZN5Exiv29RiffVideo13getStreamTypeEj:
  751|  2.12k|std::string RiffVideo::getStreamType(uint32_t stream) {
  752|  2.12k|  if (stream == 1)
  ------------------
  |  Branch (752:7): [True: 190, False: 1.93k]
  ------------------
  753|    190|    return "Mono";
  754|  1.93k|  if (stream == 2)
  ------------------
  |  Branch (754:7): [True: 692, False: 1.24k]
  ------------------
  755|    692|    return "Stereo";
  756|  1.24k|  if (stream == 5)
  ------------------
  |  Branch (756:7): [True: 147, False: 1.09k]
  ------------------
  757|    147|    return "5.1 Surround Sound";
  758|  1.09k|  if (stream == 7)
  ------------------
  |  Branch (758:7): [True: 243, False: 851]
  ------------------
  759|    243|    return "7.1 Surround Sound";
  760|    851|  return "Mono";
  761|  1.09k|}
_ZN5Exiv29RiffVideo12fillDurationEdm:
  763|    599|void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {
  764|    599|  if (frame_rate == 0)
  ------------------
  |  Branch (764:7): [True: 0, False: 599]
  ------------------
  765|      0|    return;
  766|       |
  767|    599|  auto duration = static_cast<uint64_t>(frame_count * 1000. / frame_rate);
  768|    599|  xmpData_["Xmp.video.FileDataRate"] = io_->size() / (1048576. * duration);
  769|    599|  xmpData_["Xmp.video.Duration"] = duration;  // Duration in number of seconds
  770|    599|}  // RiffVideo::fillDuration
_ZN5Exiv215newRiffInstanceENSt3__110unique_ptrINS_7BasicIoENS0_14default_deleteIS2_EEEERKNS_15ImageCtorParamsE:
  772|  1.40k|Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, const ImageCtorParams& params) {
  773|  1.40k|  auto image = std::make_unique<RiffVideo>(std::move(io), params);
  774|  1.40k|  if (!image->good()) {
  ------------------
  |  Branch (774:7): [True: 0, False: 1.40k]
  ------------------
  775|      0|    return nullptr;
  776|      0|  }
  777|  1.40k|  return image;
  778|  1.40k|}
_ZN5Exiv210isRiffTypeERNS_7BasicIoEb:
  780|  13.7k|bool isRiffType(BasicIo& iIo, bool advance) {
  781|  13.7k|  constexpr int len = 4;
  782|  13.7k|  const std::array<byte, len> RiffVideoId{'R', 'I', 'F', 'F'};
  783|  13.7k|  std::array<byte, len> buf;
  784|  13.7k|  iIo.read(buf.data(), len);
  785|  13.7k|  if (iIo.error() || iIo.eof()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 13.7k]
  |  Branch (785:22): [True: 567, False: 13.1k]
  ------------------
  786|    567|    return false;
  787|    567|  }
  788|  13.1k|  bool matched = buf == RiffVideoId;
  789|  13.1k|  if (!advance || !matched) {
  ------------------
  |  Branch (789:7): [True: 13.1k, False: 0]
  |  Branch (789:19): [True: 0, False: 0]
  ------------------
  790|  13.1k|    iIo.seek(-1 * len, BasicIo::cur);
  791|  13.1k|  }
  792|  13.1k|  return matched;
  793|  13.7k|}

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

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

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

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

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

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

_ZN5Exiv28Internal13SonyMakerNote7tagListEv:
   29|  20.8k|  static constexpr auto tagList() {
   30|  20.8k|    return tagInfo_;
   31|  20.8k|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListCsEv:
   33|  9.65k|  static constexpr auto tagListCs() {
   34|  9.65k|    return tagInfoCs_;
   35|  9.65k|  }
_ZN5Exiv28Internal13SonyMakerNote10tagListCs2Ev:
   37|    365|  static constexpr auto tagListCs2() {
   38|    365|    return tagInfoCs2_;
   39|    365|  }
_ZN5Exiv28Internal13SonyMakerNote9tagListFpEv:
   41|  20.8k|  static constexpr auto tagListFp() {
   42|  20.8k|    return tagInfoFp_;
   43|  20.8k|  }
_ZN5Exiv28Internal13SonyMakerNote16tagListSonyMisc1Ev:
   45|  1.15k|  static constexpr auto tagListSonyMisc1() {
   46|  1.15k|    return tagInfoSonyMisc1_;
   47|  1.15k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc2bEv:
   49|  1.18k|  static constexpr auto tagListSonyMisc2b() {
   50|  1.18k|    return tagInfoSonyMisc2b_;
   51|  1.18k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonyMisc3cEv:
   53|  81.9k|  static constexpr auto tagListSonyMisc3c() {
   54|  81.9k|    return tagInfoSonyMisc3c_;
   55|  81.9k|  }
_ZN5Exiv28Internal13SonyMakerNote17tagListSonySInfo1Ev:
   57|   758k|  static constexpr auto tagListSonySInfo1() {
   58|   758k|    return tagInfoSonySInfo1_;
   59|   758k|  }
_ZN5Exiv28Internal13SonyMakerNote12tagList2010eEv:
   61|  1.30k|  static constexpr auto tagList2010e() {
   62|  1.30k|    return tagInfo2010e_;
   63|  1.30k|  }

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

_ZN5Exiv28Internal10ifdTagListEv:
 1778|  3.22M|const TagInfo* ifdTagList() {
 1779|  3.22M|  return ifdTagInfo;
 1780|  3.22M|}
_ZN5Exiv28Internal11exifTagListEv:
 2216|   417k|const TagInfo* exifTagList() {
 2217|   417k|  return exifTagInfo;
 2218|   417k|}
_ZN5Exiv28Internal10gpsTagListEv:
 2432|   268k|const TagInfo* gpsTagList() {
 2433|   268k|  return gpsTagInfo;
 2434|   268k|}
_ZN5Exiv28Internal10iopTagListEv:
 2507|   162k|const TagInfo* iopTagList() {
 2508|   162k|  return iopTagInfo;
 2509|   162k|}
_ZN5Exiv28Internal9mnTagListEv:
 2523|  21.1k|const TagInfo* mnTagList() {
 2524|  21.1k|  return mnTagInfo;
 2525|  21.1k|}
_ZN5Exiv28Internal10isMakerIfdENS_5IfdIdE:
 2527|  1.62M|bool isMakerIfd(IfdId ifdId) {
 2528|  1.62M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2528:12): [True: 1.62M, False: 0]
  ------------------
 2529|  1.62M|    return std::string_view("Makernote") == ii->ifdName_;
 2530|      0|  return false;
 2531|  1.62M|}
_ZN5Exiv28Internal9isExifIfdENS_5IfdIdE:
 2533|  4.83M|bool isExifIfd(IfdId ifdId) {
 2534|  4.83M|  switch (ifdId) {
 2535|   585k|    case IfdId::ifd0Id:
  ------------------
  |  Branch (2535:5): [True: 585k, False: 4.24M]
  ------------------
 2536|   800k|    case IfdId::exifId:
  ------------------
  |  Branch (2536:5): [True: 215k, False: 4.61M]
  ------------------
 2537|   966k|    case IfdId::gpsId:
  ------------------
  |  Branch (2537:5): [True: 165k, False: 4.66M]
  ------------------
 2538|  1.12M|    case IfdId::iopId:
  ------------------
  |  Branch (2538:5): [True: 154k, False: 4.68M]
  ------------------
 2539|  1.20M|    case IfdId::ifd1Id:
  ------------------
  |  Branch (2539:5): [True: 86.0k, False: 4.74M]
  ------------------
 2540|  1.24M|    case IfdId::ifd2Id:
  ------------------
  |  Branch (2540:5): [True: 34.0k, False: 4.80M]
  ------------------
 2541|  1.24M|    case IfdId::ifd3Id:
  ------------------
  |  Branch (2541:5): [True: 966, False: 4.83M]
  ------------------
 2542|  1.24M|    case IfdId::mpfId:
  ------------------
  |  Branch (2542:5): [True: 0, False: 4.83M]
  ------------------
 2543|  1.85M|    case IfdId::subImage1Id:
  ------------------
  |  Branch (2543:5): [True: 618k, False: 4.21M]
  ------------------
 2544|  2.25M|    case IfdId::subImage2Id:
  ------------------
  |  Branch (2544:5): [True: 392k, False: 4.44M]
  ------------------
 2545|  2.50M|    case IfdId::subImage3Id:
  ------------------
  |  Branch (2545:5): [True: 255k, False: 4.57M]
  ------------------
 2546|  2.72M|    case IfdId::subImage4Id:
  ------------------
  |  Branch (2546:5): [True: 216k, False: 4.61M]
  ------------------
 2547|  2.74M|    case IfdId::subImage5Id:
  ------------------
  |  Branch (2547:5): [True: 17.5k, False: 4.81M]
  ------------------
 2548|  2.75M|    case IfdId::subImage6Id:
  ------------------
  |  Branch (2548:5): [True: 12.9k, False: 4.82M]
  ------------------
 2549|  2.77M|    case IfdId::subImage7Id:
  ------------------
  |  Branch (2549:5): [True: 17.1k, False: 4.81M]
  ------------------
 2550|  2.77M|    case IfdId::subImage8Id:
  ------------------
  |  Branch (2550:5): [True: 5.21k, False: 4.82M]
  ------------------
 2551|  2.78M|    case IfdId::subImage9Id:
  ------------------
  |  Branch (2551:5): [True: 8.85k, False: 4.82M]
  ------------------
 2552|  2.83M|    case IfdId::subThumb1Id:
  ------------------
  |  Branch (2552:5): [True: 46.0k, False: 4.78M]
  ------------------
 2553|  3.20M|    case IfdId::panaRawId:
  ------------------
  |  Branch (2553:5): [True: 373k, False: 4.46M]
  ------------------
 2554|  3.20M|      return true;
 2555|  1.62M|    default:
  ------------------
  |  Branch (2555:5): [True: 1.62M, False: 3.20M]
  ------------------
 2556|  1.62M|      return false;
 2557|  4.83M|  }
 2558|  4.83M|}
_ZN5Exiv28Internal7tagListENS_5IfdIdE:
 2568|  6.40M|const TagInfo* tagList(IfdId ifdId) {
 2569|  6.40M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2569:12): [True: 6.40M, False: 0]
  ------------------
 2570|  6.40M|    if (ii->tagList_)
  ------------------
  |  Branch (2570:9): [True: 6.40M, False: 0]
  ------------------
 2571|  6.40M|      return ii->tagList_();
 2572|      0|  return nullptr;
 2573|  6.40M|}  // tagList
_ZN5Exiv28Internal7tagInfoEtNS_5IfdIdE:
 2575|  4.83M|const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
 2576|  4.83M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2576:12): [True: 4.83M, False: 0]
  ------------------
 2577|  4.83M|    int idx = 0;
 2578|   430M|    for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2578:19): [True: 428M, False: 2.93M]
  ------------------
 2579|   428M|      if (ti[idx].tag_ == tag)
  ------------------
  |  Branch (2579:11): [True: 1.90M, False: 426M]
  ------------------
 2580|  1.90M|        break;
 2581|   428M|    }
 2582|  4.83M|    return ti + idx;
 2583|  4.83M|  }
 2584|      0|  return nullptr;
 2585|  4.83M|}  // tagInfo
_ZN5Exiv28Internal7tagInfoERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2587|  1.56M|const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
 2588|  1.56M|  if (tagName.empty())
  ------------------
  |  Branch (2588:7): [True: 0, False: 1.56M]
  ------------------
 2589|      0|    return nullptr;
 2590|  1.56M|  if (auto ti = tagList(ifdId)) {
  ------------------
  |  Branch (2590:12): [True: 1.56M, False: 0]
  ------------------
 2591|  93.6M|    for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
  ------------------
  |  Branch (2591:23): [True: 93.4M, False: 165k]
  ------------------
 2592|  93.4M|      if (tagName == ti[idx].name_) {
  ------------------
  |  Branch (2592:11): [True: 1.40M, False: 92.0M]
  ------------------
 2593|  1.40M|        return ti + idx;
 2594|  1.40M|      }
 2595|  93.4M|    }
 2596|  1.56M|  }
 2597|   165k|  return nullptr;
 2598|  1.56M|}  // tagInfo
_ZN5Exiv28Internal7groupIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2600|  7.96M|IfdId groupId(const std::string& groupName) {
 2601|  7.96M|  if (auto ii = Exiv2::find(groupInfo, groupName))
  ------------------
  |  Branch (2601:12): [True: 7.96M, False: 0]
  ------------------
 2602|  7.96M|    return IfdId{ii->ifdId_};
 2603|      0|  return IfdId::ifdIdNotSet;
 2604|  7.96M|}
_ZN5Exiv28Internal9groupNameENS_5IfdIdE:
 2612|  3.23M|const char* groupName(IfdId ifdId) {
 2613|  3.23M|  if (auto ii = Exiv2::find(groupInfo, ifdId))
  ------------------
  |  Branch (2613:12): [True: 3.23M, False: 0]
  ------------------
 2614|  3.23M|    return ii->groupName_;
 2615|      0|  return groupInfo[0].groupName_;
 2616|  3.23M|}
_ZN5Exiv28Internal7fnumberEf:
 2647|    253|float fnumber(float apertureValue) {
 2648|    253|  float result = std::exp2(apertureValue / 2.F);
 2649|    253|  if (std::abs(result - 3.5F) < 0.1F) {
  ------------------
  |  Branch (2649:7): [True: 6, False: 247]
  ------------------
 2650|      6|    result = 3.5F;
 2651|      6|  }
 2652|    253|  return result;
 2653|    253|}
_ZN5Exiv28Internal12exposureTimeEf:
 2655|    253|URational exposureTime(float shutterSpeedValue) {
 2656|    253|  URational ur(1, 1);
 2657|    253|  const double tmp = std::exp2(shutterSpeedValue);
 2658|    253|  if (tmp > 1) {
  ------------------
  |  Branch (2658:7): [True: 139, False: 114]
  ------------------
 2659|    139|    const double x = std::round(tmp);
 2660|       |    // Check that x is within the range of a uint32_t before casting.
 2661|    139|    if (x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2661:9): [True: 73, False: 66]
  ------------------
 2662|     73|      ur.second = static_cast<uint32_t>(x);
 2663|     73|    }
 2664|    139|  } else {
 2665|    114|    const double x = std::round(1 / tmp);
 2666|       |    // Check that x is within the range of a uint32_t before casting.
 2667|    114|    if (0 <= x && x <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (2667:9): [True: 114, False: 0]
  |  Branch (2667:19): [True: 114, False: 0]
  ------------------
 2668|    114|      ur.first = static_cast<uint32_t>(x);
 2669|    114|    }
 2670|    114|  }
 2671|    253|  return ur;
 2672|    253|}
_ZN5Exiv28Internal9tagNumberERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_5IfdIdE:
 2674|  1.56M|uint16_t tagNumber(const std::string& tagName, IfdId ifdId) {
 2675|  1.56M|  auto ti = tagInfo(tagName, ifdId);
 2676|  1.56M|  if (ti && ti->tag_ != 0xffff)
  ------------------
  |  Branch (2676:7): [True: 1.40M, False: 165k]
  |  Branch (2676:13): [True: 1.40M, False: 0]
  ------------------
 2677|  1.40M|    return ti->tag_;
 2678|   165k|  if (!isHex(tagName, 4, "0x"))
  ------------------
  |  Branch (2678:7): [True: 0, False: 165k]
  ------------------
 2679|      0|    throw Error(ErrorCode::kerInvalidTag, tagName, ifdId);
 2680|   165k|  return static_cast<uint16_t>(std::stoi(tagName, nullptr, 16));
 2681|   165k|}  // tagNumber
_ZN5Exiv28Internal7tagListERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3294|  12.5k|const TagInfo* tagList(const std::string& groupName) {
 3295|  12.5k|  auto ii = Exiv2::find(groupInfo, groupName);
 3296|  12.5k|  if (!ii || !ii->tagList_) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 12.5k]
  |  Branch (3296:14): [True: 0, False: 12.5k]
  ------------------
 3297|      0|    return nullptr;
 3298|      0|  }
 3299|  12.5k|  return ii->tagList_();
 3300|  12.5k|}

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

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

_ZNK5Exiv28Internal15TiffMappingInfoeqERKNS1_3KeyE:
   41|  31.3M|bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
   42|  31.3M|  return (make_ == "*" || key.m_.starts_with(make_)) && (Tag::all == extendedTag_ || key.e_ == extendedTag_) &&
  ------------------
  |  Branch (42:11): [True: 31.3M, False: 0]
  |  Branch (42:27): [True: 0, False: 0]
  |  Branch (42:58): [True: 6.26M, False: 25.0M]
  |  Branch (42:86): [True: 22.8k, False: 25.0M]
  ------------------
   43|  6.29M|         key.g_ == group_;
  ------------------
  |  Branch (43:10): [True: 15.9k, False: 6.27M]
  ------------------
   44|  31.3M|}
_ZN5Exiv28Internal9IoWrapperC2ERNS_7BasicIoEPKhmPNS0_12OffsetWriterE:
   47|  25.0k|    io_(io), pHeader_(pHeader), size_(size), pow_(pow) {
   48|  25.0k|  if (!pHeader_ || size_ == 0)
  ------------------
  |  Branch (48:7): [True: 7.49k, False: 17.5k]
  |  Branch (48:20): [True: 0, False: 17.5k]
  ------------------
   49|  7.49k|    wroteHeader_ = true;
   50|  25.0k|}
_ZN5Exiv28Internal9IoWrapper5writeEPKhm:
   52|  4.61M|size_t IoWrapper::write(const byte* pData, size_t wcount) {
   53|  4.61M|  if (!wroteHeader_ && wcount > 0) {
  ------------------
  |  Branch (53:7): [True: 17.3k, False: 4.59M]
  |  Branch (53:24): [True: 17.3k, False: 0]
  ------------------
   54|  17.3k|    io_.write(pHeader_, size_);
   55|  17.3k|    wroteHeader_ = true;
   56|  17.3k|  }
   57|  4.61M|  return io_.write(pData, wcount);
   58|  4.61M|}
_ZN5Exiv28Internal9IoWrapper4putbEh:
   60|  57.5k|int IoWrapper::putb(byte data) {
   61|  57.5k|  if (!wroteHeader_) {
  ------------------
  |  Branch (61:7): [True: 0, False: 57.5k]
  ------------------
   62|      0|    io_.write(pHeader_, size_);
   63|      0|    wroteHeader_ = true;
   64|      0|  }
   65|  57.5k|  return io_.putb(data);
   66|  57.5k|}
_ZN5Exiv28Internal9IoWrapper9setTargetEim:
   68|     51|void IoWrapper::setTarget(int id, size_t target) {
   69|     51|  if (target > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (69:7): [True: 0, False: 51]
  ------------------
   70|      0|    throw Error(ErrorCode::kerOffsetOutOfRange);
   71|      0|  }
   72|     51|  if (pow_)
  ------------------
  |  Branch (72:7): [True: 13, False: 38]
  ------------------
   73|     13|    pow_->setTarget(static_cast<OffsetWriter::OffsetId>(id), static_cast<uint32_t>(target));
   74|     51|}
_ZN5Exiv28Internal13TiffDirectoryC2EtNS_5IfdIdEb:
   76|   218k|TiffDirectory::TiffDirectory(uint16_t tag, IfdId group, bool hasNext) : TiffComponent(tag, group), hasNext_(hasNext) {
   77|   218k|}
_ZN5Exiv28Internal10TiffSubIfdC2EtNS_5IfdIdES2_:
   80|  64.2k|    TiffEntryBase(tag, group, ttUnsignedLong), newGroup_(newGroup) {
   81|  64.2k|}
_ZN5Exiv28Internal16TiffIfdMakernoteC2EtNS_5IfdIdES2_NSt3__110unique_ptrINS0_8MnHeaderENS3_14default_deleteIS5_EEEEb:
   85|  18.0k|    TiffComponent(tag, group), pHeader_(std::move(pHeader)), ifd_(tag, mnGroup, hasNext) {
   86|  18.0k|}
_ZN5Exiv28Internal16TiffIfdMakernoteD2Ev:
   88|  18.0k|TiffIfdMakernote::~TiffIfdMakernote() = default;
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdERKNS0_8ArrayCfgEPKNS0_8ArrayDefEm:
   92|  29.0k|    TiffEntryBase(tag, group, arrayCfg.elTiffType_), arrayCfg_(&arrayCfg), arrayDef_(arrayDef), defSize_(defSize) {
   93|  29.0k|}
_ZN5Exiv28Internal15TiffBinaryArrayC2EtNS_5IfdIdEPKNS0_8ArraySetEmPFitPKhmPNS0_13TiffComponentEE:
   97|  6.24k|    TiffEntryBase(tag, group),  // Todo: Does it make a difference that there is no type?
   98|  6.24k|    cfgSelFct_(cfgSelFct),
   99|  6.24k|    arraySet_(arraySet),
  100|  6.24k|    setSize_(setSize) {
  101|       |  // We'll figure out the correct cfg later
  102|  6.24k|}
_ZN5Exiv28Internal13TiffEntryBaseC2EtNS_5IfdIdENS0_8TiffTypeE:
  118|  9.82M|    TiffComponent(tag, group), tiffType_(tiffType) {
  119|  9.82M|}
_ZN5Exiv28Internal13TiffEntryBaseD2Ev:
  121|  9.87M|TiffEntryBase::~TiffEntryBase() = default;
_ZN5Exiv28Internal13TiffEntryBaseC2ERKS1_:
  124|  50.8k|    TiffComponent(rhs),
  125|  50.8k|    tiffType_(rhs.tiffType_),
  126|  50.8k|    count_(rhs.count_),
  127|  50.8k|    offset_(rhs.offset_),
  128|  50.8k|    size_(rhs.size_),
  129|  50.8k|    pData_(rhs.pData_),
  130|  50.8k|    idx_(rhs.idx_),
  131|  50.8k|    pValue_(rhs.pValue_ ? rhs.pValue_->clone().release() : nullptr),
  ------------------
  |  Branch (131:13): [True: 28.1k, False: 22.6k]
  ------------------
  132|  50.8k|    storage_(rhs.storage_) {
  133|  50.8k|}
_ZN5Exiv28Internal10TiffSubIfdC2ERKS1_:
  138|    521|TiffSubIfd::TiffSubIfd(const TiffSubIfd& rhs) : TiffEntryBase(rhs), newGroup_(rhs.newGroup_) {
  139|    521|}
_ZN5Exiv28Internal17TiffDataEntryBaseC2EtNS_5IfdIdEtS2_:
  142|   115k|    TiffEntryBase(tag, group), szTag_(szTag), szGroup_(szGroup) {
  143|   115k|}
_ZN5Exiv28Internal13TiffSizeEntryC2EtNS_5IfdIdEtS2_:
  148|   127k|    TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {
  149|   127k|}
_ZN5Exiv28Internal11TiffMnEntryC2EtNS_5IfdIdES2_:
  152|  41.9k|    TiffEntryBase(tag, group, ttUndefined), mnGroup_(mnGroup) {
  153|  41.9k|}
_ZN5Exiv28Internal11TiffMnEntryD2Ev:
  155|  41.9k|TiffMnEntry::~TiffMnEntry() = default;
_ZNK5Exiv28Internal13TiffComponent5cloneEv:
  157|  50.8k|TiffComponent::UniquePtr TiffComponent::clone() const {
  158|  50.8k|  return UniquePtr(doClone());
  159|  50.8k|}
_ZNK5Exiv28Internal9TiffEntry7doCloneEv:
  161|  40.5k|TiffEntry* TiffEntry::doClone() const {
  162|  40.5k|  return new TiffEntry(*this);
  163|  40.5k|}
_ZNK5Exiv28Internal13TiffDataEntry7doCloneEv:
  165|    609|TiffDataEntry* TiffDataEntry::doClone() const {
  166|    609|  return new TiffDataEntry(*this);
  167|    609|}
_ZNK5Exiv28Internal14TiffImageEntry7doCloneEv:
  169|  2.52k|TiffImageEntry* TiffImageEntry::doClone() const {
  170|  2.52k|  return new TiffImageEntry(*this);
  171|  2.52k|}
_ZNK5Exiv28Internal13TiffSizeEntry7doCloneEv:
  173|  6.63k|TiffSizeEntry* TiffSizeEntry::doClone() const {
  174|  6.63k|  return new TiffSizeEntry(*this);
  175|  6.63k|}
_ZNK5Exiv28Internal10TiffSubIfd7doCloneEv:
  181|    521|TiffSubIfd* TiffSubIfd::doClone() const {
  182|    521|  return new TiffSubIfd(*this);
  183|    521|}
_ZNK5Exiv28Internal13TiffEntryBase3idxEv:
  205|  19.6M|int TiffEntryBase::idx() const {
  206|  19.6M|  return idx_;
  207|  19.6M|}
_ZN5Exiv28Internal13TiffEntryBase7setDataENSt3__110shared_ptrINS_7DataBufEEE:
  209|   810k|void TiffEntryBase::setData(std::shared_ptr<DataBuf> buf) {
  210|   810k|  storage_ = std::move(buf);
  211|   810k|  pData_ = storage_->data();
  212|   810k|  size_ = storage_->size();
  213|   810k|}
_ZN5Exiv28Internal13TiffEntryBase7setDataEPhmNSt3__110shared_ptrINS_7DataBufEEE:
  215|  4.08M|void TiffEntryBase::setData(byte* pData, size_t size, std::shared_ptr<DataBuf> storage) {
  216|  4.08M|  pData_ = pData;
  217|  4.08M|  size_ = size;
  218|  4.08M|  storage_ = std::move(storage);
  219|  4.08M|  if (!pData_)
  ------------------
  |  Branch (219:7): [True: 0, False: 4.08M]
  ------------------
  220|      0|    size_ = 0;
  221|  4.08M|}
_ZN5Exiv28Internal13TiffEntryBase11updateValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEENS_9ByteOrderE:
  223|  3.14M|void TiffEntryBase::updateValue(Value::UniquePtr value, ByteOrder byteOrder) {
  224|  3.14M|  if (!value)
  ------------------
  |  Branch (224:7): [True: 0, False: 3.14M]
  ------------------
  225|      0|    return;
  226|  3.14M|  if (size_t newSize = value->size(); newSize > size_) {
  ------------------
  |  Branch (226:39): [True: 809k, False: 2.33M]
  ------------------
  227|   809k|    auto d = std::make_shared<DataBuf>(newSize);
  228|   809k|    setData(std::move(d));
  229|   809k|  }
  230|  3.14M|  if (pData_) {
  ------------------
  |  Branch (230:7): [True: 901k, False: 2.23M]
  ------------------
  231|   901k|    memset(pData_, 0x0, size_);
  232|   901k|  }
  233|  3.14M|  size_ = value->copy(pData_, byteOrder);
  234|  3.14M|  setValue(std::move(value));
  235|  3.14M|}
_ZN5Exiv28Internal13TiffEntryBase8setValueENSt3__110unique_ptrINS_5ValueENS2_14default_deleteIS4_EEEE:
  237|  7.30M|void TiffEntryBase::setValue(Value::UniquePtr value) {
  238|  7.30M|  if (!value)
  ------------------
  |  Branch (238:7): [True: 0, False: 7.30M]
  ------------------
  239|      0|    return;
  240|  7.30M|  tiffType_ = toTiffType(value->typeId());
  241|  7.30M|  count_ = value->count();
  242|  7.30M|  pValue_ = std::move(value);
  243|  7.30M|}
_ZN5Exiv28Internal13TiffDataEntry9setStripsEPKNS_5ValueEPKhmm:
  245|  18.1k|void TiffDataEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  246|  18.1k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (246:7): [True: 798, False: 17.3k]
  |  Branch (246:20): [True: 397, False: 16.9k]
  ------------------
  247|  1.19k|#ifndef SUPPRESS_WARNINGS
  248|  1.19k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.19k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.19k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.19k|  LogMsg(LogMsg::warn).os()
  ------------------
  249|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  250|  1.19k|#endif
  251|  1.19k|    return;
  252|  1.19k|  }
  253|  16.9k|  if (pValue()->count() == 0) {
  ------------------
  |  Branch (253:7): [True: 2.33k, False: 14.6k]
  ------------------
  254|  2.33k|#ifndef SUPPRESS_WARNINGS
  255|  2.33k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  2.33k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 2.33k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  2.33k|  LogMsg(LogMsg::warn).os()
  ------------------
  256|      0|                << tag() << ": Data offset entry value is empty, ignoring it.\n";
  257|  2.33k|#endif
  258|  2.33k|    return;
  259|  2.33k|  }
  260|  14.6k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (260:7): [True: 1.95k, False: 12.6k]
  ------------------
  261|  1.95k|#ifndef SUPPRESS_WARNINGS
  262|  1.95k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.95k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.95k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.95k|  LogMsg(LogMsg::warn).os()
  ------------------
  263|      0|                << tag() << ": Size and data offset entries have different"
  264|      0|                << " number of components, ignoring them.\n";
  265|  1.95k|#endif
  266|  1.95k|    return;
  267|  1.95k|  }
  268|  12.6k|  size_t size = 0;
  269|  32.6k|  for (size_t i = 0; i < pSize->count(); ++i) {
  ------------------
  |  Branch (269:22): [True: 19.9k, False: 12.6k]
  ------------------
  270|  19.9k|    size = Safe::add<size_t>(size, pSize->toUint32(i));
  271|  19.9k|  }
  272|  12.6k|  const size_t offset = pValue()->toUint32(0);
  273|  12.6k|  if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (273:7): [True: 970, False: 11.6k]
  |  Branch (273:26): [True: 884, False: 10.8k]
  |  Branch (273:54): [True: 26, False: 10.7k]
  ------------------
  274|  1.88k|#ifndef SUPPRESS_WARNINGS
  275|  1.88k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  1.88k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 1.88k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  1.88k|  LogMsg(LogMsg::warn).os()
  ------------------
  276|      0|                << tag() << ": Data area exceeds data buffer, ignoring it.\n";
  277|  1.88k|#endif
  278|  1.88k|    return;
  279|  1.88k|  }
  280|       |  // Todo: Remove limitation of JPEG writer: strips must be contiguous
  281|       |  // Until then we check: last offset + last size - first offset == size?
  282|  10.7k|  if (pValue()->toUint32(pValue()->count() - 1) + pSize->toUint32(pSize->count() - 1) != size + offset) {
  ------------------
  |  Branch (282:7): [True: 386, False: 10.3k]
  ------------------
  283|    386|#ifndef SUPPRESS_WARNINGS
  284|    386|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|    386|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 386]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|    386|  LogMsg(LogMsg::warn).os()
  ------------------
  285|      0|                << tag() << ": Data area is not contiguous, ignoring it.\n";
  286|    386|#endif
  287|    386|    return;
  288|    386|  }
  289|  10.3k|  pDataArea_ = const_cast<byte*>(pData) + baseOffset + offset;
  290|  10.3k|  sizeDataArea_ = size;
  291|  10.3k|  const_cast<Value*>(pValue())->setDataArea(pDataArea_, sizeDataArea_);
  292|  10.3k|}  // TiffDataEntry::setStrips
_ZN5Exiv28Internal14TiffImageEntry9setStripsEPKNS_5ValueEPKhmm:
  294|  75.9k|void TiffImageEntry::setStrips(const Value* pSize, const byte* pData, size_t sizeData, size_t baseOffset) {
  295|  75.9k|  if (!pValue() || !pSize) {
  ------------------
  |  Branch (295:7): [True: 3.20k, False: 72.7k]
  |  Branch (295:20): [True: 2.83k, False: 69.8k]
  ------------------
  296|  6.04k|#ifndef SUPPRESS_WARNINGS
  297|  6.04k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  6.04k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 6.04k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  6.04k|  LogMsg(LogMsg::warn).os()
  ------------------
  298|      0|                << tag() << ": Size or data offset value not set, ignoring them.\n";
  299|  6.04k|#endif
  300|  6.04k|    return;
  301|  6.04k|  }
  302|  69.8k|  if (pValue()->count() != pSize->count()) {
  ------------------
  |  Branch (302:7): [True: 20.5k, False: 49.3k]
  ------------------
  303|  20.5k|#ifndef SUPPRESS_WARNINGS
  304|  20.5k|    EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|  20.5k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 20.5k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  20.5k|  LogMsg(LogMsg::warn).os()
  ------------------
  305|      0|                << tag() << ": Size and data offset entries have different"
  306|      0|                << " number of components, ignoring them.\n";
  307|  20.5k|#endif
  308|  20.5k|    return;
  309|  20.5k|  }
  310|  6.28M|  for (size_t i = 0; i < pValue()->count(); ++i) {
  ------------------
  |  Branch (310:22): [True: 6.23M, False: 49.3k]
  ------------------
  311|  6.23M|    const size_t offset = pValue()->toUint32(i);
  312|  6.23M|    const size_t size = pSize->toUint32(i);
  313|       |
  314|  6.23M|    if (size > sizeData || offset > sizeData - size || baseOffset > sizeData - size - offset) {
  ------------------
  |  Branch (314:9): [True: 33.6k, False: 6.19M]
  |  Branch (314:28): [True: 76.6k, False: 6.12M]
  |  Branch (314:56): [True: 228, False: 6.12M]
  ------------------
  315|   110k|#ifndef SUPPRESS_WARNINGS
  316|   110k|      EXV_WARNING << "Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0') << std::hex
  ------------------
  |  |  138|   110k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 110k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|   110k|  LogMsg(LogMsg::warn).os()
  ------------------
  317|      0|                  << tag() << ": Strip " << std::dec << i << " is outside of the data area; ignored.\n";
  318|   110k|#endif
  319|  6.12M|    } else if (size != 0) {
  ------------------
  |  Branch (319:16): [True: 5.51M, False: 609k]
  ------------------
  320|  5.51M|      const byte* pStrip = pData + baseOffset + offset;
  321|  5.51M|      strips_.emplace_back(pStrip, size);
  322|  5.51M|    }
  323|  6.23M|  }
  324|  49.3k|}  // TiffImageEntry::setStrips
_ZNK5Exiv28Internal16TiffIfdMakernote9ifdOffsetEv:
  326|  7.87k|size_t TiffIfdMakernote::ifdOffset() const {
  327|  7.87k|  if (!pHeader_)
  ------------------
  |  Branch (327:7): [True: 3.15k, False: 4.72k]
  ------------------
  328|  3.15k|    return 0;
  329|  4.72k|  return pHeader_->ifdOffset();
  330|  7.87k|}
_ZNK5Exiv28Internal16TiffIfdMakernote9byteOrderEv:
  332|  32.1k|ByteOrder TiffIfdMakernote::byteOrder() const {
  333|  32.1k|  if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
  ------------------
  |  Branch (333:7): [True: 6.70k, False: 25.4k]
  |  Branch (333:20): [True: 21.6k, False: 3.82k]
  ------------------
  334|  28.3k|    return imageByteOrder_;
  335|  28.3k|  }
  336|  3.82k|  return pHeader_->byteOrder();
  337|  32.1k|}
_ZNK5Exiv28Internal16TiffIfdMakernote8mnOffsetEv:
  339|  4.65k|size_t TiffIfdMakernote::mnOffset() const {
  340|  4.65k|  return mnOffset_;
  341|  4.65k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10baseOffsetEv:
  343|  17.2k|size_t TiffIfdMakernote::baseOffset() const {
  344|  17.2k|  if (!pHeader_)
  ------------------
  |  Branch (344:7): [True: 3.75k, False: 13.4k]
  ------------------
  345|  3.75k|    return 0;
  346|  13.4k|  return pHeader_->baseOffset(mnOffset_);
  347|  17.2k|}
_ZN5Exiv28Internal16TiffIfdMakernote10readHeaderEPKhmNS_9ByteOrderE:
  349|  8.61k|bool TiffIfdMakernote::readHeader(const byte* pData, size_t size, ByteOrder byteOrder) {
  350|  8.61k|  if (!pHeader_)
  ------------------
  |  Branch (350:7): [True: 3.15k, False: 5.46k]
  ------------------
  351|  3.15k|    return true;
  352|  5.46k|  return pHeader_->read(pData, size, byteOrder);
  353|  8.61k|}
_ZN5Exiv28Internal16TiffIfdMakernote12setByteOrderENS_9ByteOrderE:
  355|  7.47k|void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder) {
  356|  7.47k|  if (pHeader_)
  ------------------
  |  Branch (356:7): [True: 6.87k, False: 599]
  ------------------
  357|  6.87k|    pHeader_->setByteOrder(byteOrder);
  358|  7.47k|}
_ZNK5Exiv28Internal16TiffIfdMakernote10sizeHeaderEv:
  360|  77.7k|size_t TiffIfdMakernote::sizeHeader() const {
  361|  77.7k|  if (!pHeader_)
  ------------------
  |  Branch (361:7): [True: 5.87k, False: 71.9k]
  ------------------
  362|  5.87k|    return 0;
  363|  71.9k|  return pHeader_->size();
  364|  77.7k|}
_ZNK5Exiv28Internal16TiffIfdMakernote11writeHeaderERNS0_9IoWrapperENS_9ByteOrderE:
  366|  9.37k|size_t TiffIfdMakernote::writeHeader(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
  367|  9.37k|  if (!pHeader_)
  ------------------
  |  Branch (367:7): [True: 597, False: 8.77k]
  ------------------
  368|    597|    return 0;
  369|  8.77k|  return pHeader_->write(ioWrapper, byteOrder);
  370|  9.37k|}
_ZNK5Exiv28Internal8ArrayDef4sizeEtNS_5IfdIdE:
  372|  5.29M|size_t ArrayDef::size(uint16_t tag, IfdId group) const {
  373|  5.29M|  TypeId typeId = toTypeId(tiffType_, tag, group);
  374|  5.29M|  return count_ * TypeInfo::typeSize(typeId);
  375|  5.29M|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeENS_5IfdIdE:
  377|  1.42M|bool TiffBinaryArray::initialize(IfdId group) {
  378|  1.42M|  if (arrayCfg_)
  ------------------
  |  Branch (378:7): [True: 1.42M, False: 979]
  ------------------
  379|  1.42M|    return true;  // Not a complex array or already initialized
  380|       |
  381|  2.72k|  for (size_t idx = 0; idx < setSize_; ++idx) {
  ------------------
  |  Branch (381:24): [True: 2.72k, False: 0]
  ------------------
  382|  2.72k|    if (arraySet_[idx].cfg_.group_ == group) {
  ------------------
  |  Branch (382:9): [True: 979, False: 1.74k]
  ------------------
  383|    979|      arrayCfg_ = &arraySet_[idx].cfg_;
  384|    979|      arrayDef_ = arraySet_[idx].def_;
  385|    979|      defSize_ = arraySet_[idx].defSize_;
  386|    979|      return true;
  387|    979|    }
  388|  2.72k|  }
  389|      0|  return false;
  390|    979|}
_ZN5Exiv28Internal15TiffBinaryArray10initializeEPNS0_13TiffComponentE:
  392|  4.60k|bool TiffBinaryArray::initialize(TiffComponent* pRoot) {
  393|  4.60k|  if (!cfgSelFct_)
  ------------------
  |  Branch (393:7): [True: 2.32k, False: 2.27k]
  ------------------
  394|  2.32k|    return true;  // Not a complex array
  395|       |
  396|  2.27k|  int idx = cfgSelFct_(tag(), pData(), TiffEntryBase::doSize(), pRoot);
  397|  2.27k|  if (idx > -1) {
  ------------------
  |  Branch (397:7): [True: 1.47k, False: 797]
  ------------------
  398|  1.47k|    arrayCfg_ = &arraySet_[idx].cfg_;
  399|  1.47k|    arrayDef_ = arraySet_[idx].def_;
  400|  1.47k|    defSize_ = arraySet_[idx].defSize_;
  401|  1.47k|  }
  402|  2.27k|  return idx > -1;
  403|  4.60k|}
_ZN5Exiv28Internal15TiffBinaryArray14iniOrigDataBufEv:
  405|  14.5k|void TiffBinaryArray::iniOrigDataBuf() {
  406|  14.5k|  origData_ = const_cast<byte*>(pData());
  407|  14.5k|  origSize_ = TiffEntryBase::doSize();
  408|  14.5k|}
_ZN5Exiv28Internal15TiffBinaryArray14updOrigDataBufEPKhm:
  410|     91|bool TiffBinaryArray::updOrigDataBuf(const byte* pData, size_t size) {
  411|     91|  if (origSize_ != size)
  ------------------
  |  Branch (411:7): [True: 0, False: 91]
  ------------------
  412|      0|    return false;
  413|     91|  if (origData_ == pData)
  ------------------
  |  Branch (413:7): [True: 48, False: 43]
  ------------------
  414|     48|    return true;
  415|     43|  std::memcpy(origData_, pData, origSize_);
  416|     43|  return true;
  417|     91|}
_ZN5Exiv28Internal15TiffBinaryArray10addElementEmRKNS0_8ArrayDefE:
  419|  1.73M|size_t TiffBinaryArray::addElement(size_t idx, const ArrayDef& def) {
  420|  1.73M|  auto tag = static_cast<uint16_t>(idx / cfg()->tagStep());
  421|  1.73M|  auto sz = std::min<size_t>(def.size(tag, cfg()->group_), TiffEntryBase::doSize() - idx);
  422|  1.73M|  auto tc = TiffCreator::create(tag, cfg()->group_);
  423|  1.73M|  auto tp = dynamic_cast<TiffBinaryElement*>(tc.get());
  424|  1.73M|  if (!tp)
  ------------------
  |  Branch (424:7): [True: 0, False: 1.73M]
  ------------------
  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.73M|  tp->setStart(pData() + idx);
  429|  1.73M|  auto s = storage();
  430|  1.73M|  tp->setData(const_cast<byte*>(pData() + idx), sz, std::move(s));
  431|  1.73M|  tp->setElDef(def);
  432|  1.73M|  tp->setElByteOrder(cfg()->byteOrder_);
  433|  1.73M|  addChild(std::move(tc));
  434|  1.73M|  return sz;
  435|  1.73M|}  // TiffBinaryArray::addElement
_ZN5Exiv28Internal13TiffComponent7addPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  438|  19.0M|                                      TiffComponent::UniquePtr object) {
  439|  19.0M|  return doAddPath(tag, tiffPath, pRoot, std::move(object));
  440|  19.0M|}  // TiffComponent::addPath
_ZN5Exiv28Internal13TiffComponent9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPS1_NS2_10unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  443|  3.09M|                                        TiffComponent::UniquePtr /*object*/) {
  444|  3.09M|  return this;
  445|  3.09M|}  // TiffComponent::doAddPath
_ZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  448|  7.74M|                                        TiffComponent::UniquePtr object) {
  449|  7.74M|  tiffPath.pop();
  450|  7.74M|  const TiffPathItem tpi = tiffPath.top();
  451|       |
  452|  7.74M|  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|  7.74M|  if (tiffPath.size() > 1 || (tpi.extendedTag() == 0x927c && tpi.group() == IfdId::exifId)) {
  ------------------
  |  Branch (457:7): [True: 6.02M, False: 1.71M]
  |  Branch (457:31): [True: 1.20k, False: 1.71M]
  |  Branch (457:62): [True: 1.08k, False: 121]
  ------------------
  458|  6.02M|    if (tpi.extendedTag() == Tag::next) {
  ------------------
  |  Branch (458:9): [True: 44.7k, False: 5.98M]
  ------------------
  459|  44.7k|      tc = pNext_.get();
  460|  5.98M|    } else {
  461|  46.9M|      for (auto&& component : components_) {
  ------------------
  |  Branch (461:29): [True: 46.9M, False: 27.9k]
  ------------------
  462|  46.9M|        if (component->tag() == tpi.tag() && component->group() == tpi.group()) {
  ------------------
  |  Branch (462:13): [True: 6.06M, False: 40.8M]
  |  Branch (462:46): [True: 5.95M, False: 109k]
  ------------------
  463|  5.95M|          tc = component.get();
  464|  5.95M|          break;
  465|  5.95M|        }
  466|  46.9M|      }
  467|  5.98M|    }
  468|  6.02M|  }
  469|       |
  470|  7.74M|  if (tc)
  ------------------
  |  Branch (470:7): [True: 5.99M, False: 1.74M]
  ------------------
  471|  5.99M|    return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  472|       |
  473|  1.74M|  auto atc = [&] {
  474|  1.74M|    if (tiffPath.size() == 1 && object) {
  475|  1.74M|      return std::move(object);
  476|  1.74M|    }
  477|  1.74M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.74M|  }();
  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.74M|  if (tiffPath.size() == 1 && dynamic_cast<const TiffSubIfd*>(atc.get()))
  ------------------
  |  Branch (482:7): [True: 1.71M, False: 28.8k]
  |  Branch (482:31): [True: 19.9k, False: 1.69M]
  ------------------
  483|  19.9k|    return nullptr;
  484|       |
  485|  1.72M|  tc = [&] {
  486|  1.72M|    if (tpi.extendedTag() == Tag::next)
  487|  1.72M|      return this->addNext(std::move(atc));
  488|  1.72M|    return this->addChild(std::move(atc));
  489|  1.72M|  }();
  490|  1.72M|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  491|  1.74M|}  // TiffDirectory::doAddPath
_ZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  494|  2.36M|                                     TiffComponent::UniquePtr object) {
  495|  2.36M|  const TiffPathItem tpi1 = tiffPath.top();
  496|  2.36M|  tiffPath.pop();
  497|  2.36M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (497:7): [True: 0, False: 2.36M]
  ------------------
  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.36M|  const TiffPathItem tpi2 = tiffPath.top();
  503|  2.36M|  tiffPath.push(tpi1);
  504|  2.36M|  for (const auto& ifd : ifds_)
  ------------------
  |  Branch (504:24): [True: 2.56M, False: 16.6k]
  ------------------
  505|  2.56M|    if (ifd->group() == tpi2.group())
  ------------------
  |  Branch (505:9): [True: 2.34M, False: 215k]
  ------------------
  506|  2.34M|      return ifd->addPath(tag, tiffPath, pRoot, std::move(object));
  507|       |
  508|  16.6k|  auto tc = [&] {
  509|  16.6k|    if (tiffPath.size() == 1 && object) {
  510|  16.6k|      return addChild(std::move(object));
  511|  16.6k|    }
  512|  16.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  16.6k|  }();
  514|  16.6k|  setCount(ifds_.size());
  515|  16.6k|  return tc->addPath(tag, tiffPath, pRoot, nullptr);
  516|  2.36M|}  // TiffSubIfd::doAddPath
_ZN5Exiv28Internal11TiffMnEntry9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  519|  2.20M|                                      TiffComponent::UniquePtr object) {
  520|  2.20M|  const TiffPathItem tpi1 = tiffPath.top();
  521|  2.20M|  tiffPath.pop();
  522|  2.20M|  if (tiffPath.empty()) {
  ------------------
  |  Branch (522:7): [True: 13.9k, False: 2.19M]
  ------------------
  523|       |    // If the last element in the path is the makernote tag itself we're done
  524|  13.9k|    return this;
  525|  13.9k|  }
  526|  2.19M|  const TiffPathItem tpi2 = tiffPath.top();
  527|  2.19M|  tiffPath.push(tpi1);
  528|  2.19M|  if (!mn_) {
  ------------------
  |  Branch (528:7): [True: 9.43k, False: 2.18M]
  ------------------
  529|  9.43k|    mnGroup_ = tpi2.group();
  530|  9.43k|    mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_);
  531|  9.43k|  }
  532|  2.19M|  return mn_->addPath(tag, tiffPath, pRoot, std::move(object));
  533|  2.20M|}  // TiffMnEntry::doAddPath
_ZN5Exiv28Internal16TiffIfdMakernote9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  536|  2.19M|                                           TiffComponent::UniquePtr object) {
  537|  2.19M|  return ifd_.addPath(tag, tiffPath, pRoot, std::move(object));
  538|  2.19M|}
_ZN5Exiv28Internal15TiffBinaryArray9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEE:
  541|  1.44M|                                          TiffComponent::UniquePtr object) {
  542|  1.44M|  pRoot_ = pRoot;
  543|  1.44M|  if (tiffPath.size() == 1) {
  ------------------
  |  Branch (543:7): [True: 13.2k, False: 1.42M]
  ------------------
  544|       |    // An unknown complex binary array has no children and acts like a standard TIFF entry
  545|  13.2k|    return this;
  546|  13.2k|  }
  547|  1.42M|  tiffPath.pop();
  548|  1.42M|  const TiffPathItem tpi = tiffPath.top();
  549|       |  // Initialize the binary array (if it is a complex array)
  550|  1.42M|  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.42M|  if (tiffPath.size() > 1) {
  ------------------
  |  Branch (554:7): [True: 0, False: 1.42M]
  ------------------
  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.42M|  if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (560:7): [True: 1.42M, False: 0]
  |  Branch (560:31): [True: 0, False: 1.42M]
  ------------------
  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.42M|  auto tc = addChild(TiffCreator::create(tpi.extendedTag(), tpi.group()));
  567|  1.42M|  setCount(elements_.size());
  568|  1.42M|  return tc->addPath(tag, tiffPath, pRoot, std::move(object));
  569|  1.42M|}  // TiffBinaryArray::doAddPath
_ZN5Exiv28Internal13TiffComponent8addChildENSt3__110shared_ptrIS1_EE:
  571|  9.99M|TiffComponent* TiffComponent::addChild(TiffComponent::SharedPtr tiffComponent) {
  572|  9.99M|  return doAddChild(std::move(tiffComponent));
  573|  9.99M|}  // TiffComponent::addChild
_ZN5Exiv28Internal13TiffDirectory10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  579|  6.69M|TiffComponent* TiffDirectory::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  580|  6.69M|  return components_.emplace_back(std::move(tiffComponent)).get();
  581|  6.69M|}  // TiffDirectory::doAddChild
_ZN5Exiv28Internal10TiffSubIfd10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  583|   140k|TiffComponent* TiffSubIfd::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  584|   140k|  auto d = std::dynamic_pointer_cast<TiffDirectory>(std::move(tiffComponent));
  585|   140k|  if (!d)
  ------------------
  |  Branch (585:7): [True: 0, False: 140k]
  ------------------
  586|      0|    throw Error(ErrorCode::kerErrorMessage, "dynamic_pointer_cast to TiffDirectory failed");
  587|       |
  588|   140k|  return ifds_.emplace_back(std::move(d)).get();
  589|   140k|}  // TiffSubIfd::doAddChild
_ZN5Exiv28Internal15TiffBinaryArray10doAddChildENSt3__110shared_ptrINS0_13TiffComponentEEE:
  602|  3.16M|TiffComponent* TiffBinaryArray::doAddChild(TiffComponent::SharedPtr tiffComponent) {
  603|  3.16M|  setDecoded(true);
  604|  3.16M|  return elements_.emplace_back(std::move(tiffComponent)).get();
  605|  3.16M|}  // TiffBinaryArray::doAddChild
_ZN5Exiv28Internal13TiffComponent7addNextENSt3__110unique_ptrIS1_NS2_14default_deleteIS1_EEEE:
  607|  3.96k|TiffComponent* TiffComponent::addNext(TiffComponent::UniquePtr tiffComponent) {
  608|  3.96k|  return doAddNext(std::move(tiffComponent));
  609|  3.96k|}  // TiffComponent::addNext
_ZN5Exiv28Internal13TiffDirectory9doAddNextENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
  615|  3.96k|TiffComponent* TiffDirectory::doAddNext(TiffComponent::UniquePtr tiffComponent) {
  616|  3.96k|  if (hasNext_) {
  ------------------
  |  Branch (616:7): [True: 3.96k, False: 0]
  ------------------
  617|  3.96k|    pNext_ = std::move(tiffComponent);
  618|  3.96k|    return pNext_.get();
  619|  3.96k|  }
  620|      0|  return nullptr;
  621|  3.96k|}  // TiffDirectory::doAddNext
_ZN5Exiv28Internal13TiffComponent6acceptERNS0_11TiffVisitorE:
  634|  66.7M|void TiffComponent::accept(TiffVisitor& visitor) {
  635|  66.7M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (635:7): [True: 66.7M, False: 13.8k]
  ------------------
  636|  66.7M|    doAccept(visitor);  // one for NVI :)
  637|  66.7M|}  // TiffComponent::accept
_ZN5Exiv28Internal9TiffEntry8doAcceptERNS0_11TiffVisitorE:
  639|  41.6M|void TiffEntry::doAccept(TiffVisitor& visitor) {
  640|  41.6M|  visitor.visitEntry(this);
  641|  41.6M|}  // TiffEntry::doAccept
_ZN5Exiv28Internal13TiffDataEntry8doAcceptERNS0_11TiffVisitorE:
  643|   270k|void TiffDataEntry::doAccept(TiffVisitor& visitor) {
  644|   270k|  visitor.visitDataEntry(this);
  645|   270k|}  // TiffDataEntry::doAccept
_ZN5Exiv28Internal14TiffImageEntry8doAcceptERNS0_11TiffVisitorE:
  647|  2.01M|void TiffImageEntry::doAccept(TiffVisitor& visitor) {
  648|  2.01M|  visitor.visitImageEntry(this);
  649|  2.01M|}  // TiffImageEntry::doAccept
_ZN5Exiv28Internal13TiffSizeEntry8doAcceptERNS0_11TiffVisitorE:
  651|  2.62M|void TiffSizeEntry::doAccept(TiffVisitor& visitor) {
  652|  2.62M|  visitor.visitSizeEntry(this);
  653|  2.62M|}  // TiffSizeEntry::doAccept
_ZN5Exiv28Internal13TiffDirectory8doAcceptERNS0_11TiffVisitorE:
  655|  2.10M|void TiffDirectory::doAccept(TiffVisitor& visitor) {
  656|  2.10M|  visitor.visitDirectory(this);
  657|  47.9M|  for (auto&& component : components_) {
  ------------------
  |  Branch (657:25): [True: 47.9M, False: 1.77M]
  ------------------
  658|  47.9M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (658:9): [True: 338k, False: 47.6M]
  ------------------
  659|   338k|      break;
  660|  47.6M|    component->accept(visitor);
  661|  47.6M|  }
  662|  2.10M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (662:7): [True: 1.75M, False: 354k]
  ------------------
  663|  1.75M|    visitor.visitDirectoryNext(this);
  664|  2.10M|  if (pNext_)
  ------------------
  |  Branch (664:7): [True: 62.7k, False: 2.04M]
  ------------------
  665|  62.7k|    pNext_->accept(visitor);
  666|  2.10M|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (666:7): [True: 1.73M, False: 377k]
  ------------------
  667|  1.73M|    visitor.visitDirectoryEnd(this);
  668|  2.10M|}  // TiffDirectory::doAccept
_ZN5Exiv28Internal10TiffSubIfd8doAcceptERNS0_11TiffVisitorE:
  670|   402k|void TiffSubIfd::doAccept(TiffVisitor& visitor) {
  671|   402k|  visitor.visitSubIfd(this);
  672|  1.59M|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (672:19): [True: 1.59M, False: 321k]
  ------------------
  673|  1.59M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (673:9): [True: 81.5k, False: 1.51M]
  ------------------
  674|  81.5k|      break;
  675|  1.51M|    ifd->accept(visitor);
  676|  1.51M|  }
  677|   402k|}  // TiffSubIfd::doAccept
_ZN5Exiv28Internal11TiffMnEntry8doAcceptERNS0_11TiffVisitorE:
  679|   248k|void TiffMnEntry::doAccept(TiffVisitor& visitor) {
  680|   248k|  visitor.visitMnEntry(this);
  681|   248k|  if (mn_)
  ------------------
  |  Branch (681:7): [True: 94.3k, False: 153k]
  ------------------
  682|  94.3k|    mn_->accept(visitor);
  683|   248k|  if (!visitor.go(TiffVisitor::geKnownMakernote)) {
  ------------------
  |  Branch (683:7): [True: 1.36k, False: 246k]
  ------------------
  684|  1.36k|    mn_ = nullptr;
  685|  1.36k|  }
  686|       |
  687|   248k|}  // TiffMnEntry::doAccept
_ZN5Exiv28Internal16TiffIfdMakernote8doAcceptERNS0_11TiffVisitorE:
  689|  86.9k|void TiffIfdMakernote::doAccept(TiffVisitor& visitor) {
  690|  86.9k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (690:7): [True: 86.9k, False: 0]
  ------------------
  691|  86.9k|    visitor.visitIfdMakernote(this);
  692|  86.9k|  if (visitor.go(TiffVisitor::geKnownMakernote))
  ------------------
  |  Branch (692:7): [True: 86.0k, False: 815]
  ------------------
  693|  86.0k|    ifd_.accept(visitor);
  694|  86.9k|  if (visitor.go(TiffVisitor::geKnownMakernote) && visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (694:7): [True: 86.0k, False: 815]
  |  Branch (694:52): [True: 67.9k, False: 18.1k]
  ------------------
  695|  67.9k|    visitor.visitIfdMakernoteEnd(this);
  696|  86.9k|}
_ZN5Exiv28Internal15TiffBinaryArray8doAcceptERNS0_11TiffVisitorE:
  698|   170k|void TiffBinaryArray::doAccept(TiffVisitor& visitor) {
  699|   170k|  visitor.visitBinaryArray(this);
  700|  16.8M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (700:23): [True: 16.8M, False: 168k]
  ------------------
  701|  16.8M|    if (!visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (701:9): [True: 1.37k, False: 16.8M]
  ------------------
  702|  1.37k|      break;
  703|  16.8M|    element->accept(visitor);
  704|  16.8M|  }
  705|   170k|  if (visitor.go(TiffVisitor::geTraverse))
  ------------------
  |  Branch (705:7): [True: 156k, False: 13.7k]
  ------------------
  706|   156k|    visitor.visitBinaryArrayEnd(this);
  707|   170k|}
_ZN5Exiv28Internal17TiffBinaryElement8doAcceptERNS0_11TiffVisitorE:
  709|  17.2M|void TiffBinaryElement::doAccept(TiffVisitor& visitor) {
  710|  17.2M|  visitor.visitBinaryElement(this);
  711|  17.2M|}
_ZN5Exiv28Internal13TiffEntryBase6encodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  713|  3.17M|void TiffEntryBase::encode(TiffEncoder& encoder, const Exifdatum* datum) {
  714|  3.17M|  doEncode(encoder, datum);
  715|  3.17M|}
_ZN5Exiv28Internal17TiffBinaryElement8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  717|  1.48M|void TiffBinaryElement::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  718|  1.48M|  encoder.encodeBinaryElement(this, datum);
  719|  1.48M|}
_ZN5Exiv28Internal15TiffBinaryArray8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  721|  13.6k|void TiffBinaryArray::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  722|  13.6k|  encoder.encodeBinaryArray(this, datum);
  723|  13.6k|}
_ZN5Exiv28Internal13TiffDataEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  725|  10.0k|void TiffDataEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  726|  10.0k|  encoder.encodeDataEntry(this, datum);
  727|  10.0k|}
_ZN5Exiv28Internal9TiffEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  729|  1.60M|void TiffEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  730|  1.60M|  encoder.encodeTiffEntry(this, datum);
  731|  1.60M|}
_ZN5Exiv28Internal14TiffImageEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  733|  19.0k|void TiffImageEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  734|  19.0k|  encoder.encodeImageEntry(this, datum);
  735|  19.0k|}
_ZN5Exiv28Internal11TiffMnEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  737|  14.3k|void TiffMnEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  738|  14.3k|  encoder.encodeMnEntry(this, datum);
  739|  14.3k|}
_ZN5Exiv28Internal13TiffSizeEntry8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  741|  28.2k|void TiffSizeEntry::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  742|  28.2k|  encoder.encodeSizeEntry(this, datum);
  743|  28.2k|}
_ZN5Exiv28Internal10TiffSubIfd8doEncodeERNS0_11TiffEncoderEPKNS_9ExifdatumE:
  745|  2.26k|void TiffSubIfd::doEncode(TiffEncoder& encoder, const Exifdatum* datum) {
  746|  2.26k|  encoder.encodeSubIfd(this, datum);
  747|  2.26k|}
_ZNK5Exiv28Internal13TiffComponent5countEv:
  749|  2.12M|size_t TiffComponent::count() const {
  750|  2.12M|  return doCount();
  751|  2.12M|}
_ZNK5Exiv28Internal13TiffDirectory7doCountEv:
  753|   218k|size_t TiffDirectory::doCount() const {
  754|   218k|  return components_.size();
  755|   218k|}
_ZNK5Exiv28Internal13TiffEntryBase7doCountEv:
  757|  1.88M|size_t TiffEntryBase::doCount() const {
  758|  1.88M|  return count_;
  759|  1.88M|}
_ZNK5Exiv28Internal11TiffMnEntry7doCountEv:
  761|  20.7k|size_t TiffMnEntry::doCount() const {
  762|  20.7k|  if (!mn_) {
  ------------------
  |  Branch (762:7): [True: 11.0k, False: 9.68k]
  ------------------
  763|  11.0k|    return TiffEntryBase::doCount();
  764|  11.0k|  }
  765|  9.68k|#ifndef SUPPRESS_WARNINGS
  766|       |  // Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
  767|       |  // Makernote in bytes
  768|  9.68k|  if (tiffType() != ttUndefined && tiffType() != ttUnsignedByte && tiffType() != ttSignedByte) {
  ------------------
  |  Branch (768:7): [True: 2.18k, False: 7.50k]
  |  Branch (768:36): [True: 2.12k, False: 53]
  |  Branch (768:68): [True: 2.04k, False: 83]
  ------------------
  769|  2.04k|    EXV_ERROR << stringFormat(
  ------------------
  |  |  142|  2.04k|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 2.04k]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|  2.04k|  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|  2.04k|  }
  773|  9.68k|#endif
  774|  9.68k|  return mn_->size();
  775|  20.7k|}
_ZNK5Exiv28Internal15TiffBinaryArray7doCountEv:
  781|  20.9k|size_t TiffBinaryArray::doCount() const {
  782|  20.9k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (782:7): [True: 1.76k, False: 19.1k]
  |  Branch (782:17): [True: 11.6k, False: 7.57k]
  ------------------
  783|  13.3k|    return TiffEntryBase::doCount();
  784|       |
  785|  7.57k|  if (elements_.empty())
  ------------------
  |  Branch (785:7): [True: 0, False: 7.57k]
  ------------------
  786|      0|    return 0;
  787|       |
  788|  7.57k|  TypeId typeId = toTypeId(tiffType(), tag(), group());
  789|  7.57k|  size_t typeSize = TypeInfo::typeSize(typeId);
  790|  7.57k|  if (0 == typeSize) {
  ------------------
  |  Branch (790:7): [True: 71, False: 7.50k]
  ------------------
  791|     71|#ifndef SUPPRESS_WARNINGS
  792|     71|    EXV_WARNING << stringFormat("Directory {}, entry 0x{:04x} has unknown Exif (TIFF) type {}; setting type size 1.\n",
  ------------------
  |  |  138|     71|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 71]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|     71|  LogMsg(LogMsg::warn).os()
  ------------------
                  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|     71|#endif
  795|     71|    typeSize = 1;
  796|     71|  }
  797|       |
  798|  7.57k|  return size() / typeSize;
  799|  7.57k|}
_ZNK5Exiv28Internal17TiffBinaryElement7doCountEv:
  801|    781|size_t TiffBinaryElement::doCount() const {
  802|    781|  return elDef_.count_;
  803|    781|}
_ZN5Exiv28Internal13TiffComponent5writeERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  806|  3.18M|                            size_t& imageIdx) {
  807|  3.18M|  return doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  808|  3.18M|}  // TiffComponent::write
_ZN5Exiv28Internal13TiffDirectory7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  811|  44.2k|                              size_t& imageIdx) {
  812|  44.2k|  bool isRootDir = (imageIdx == std::string::npos);
  813|       |
  814|       |  // Number of components to write
  815|  44.2k|  const size_t compCount = count();
  816|  44.2k|  if (compCount > 0xffff)
  ------------------
  |  Branch (816:7): [True: 0, False: 44.2k]
  ------------------
  817|      0|    throw Error(ErrorCode::kerTooManyTiffDirectoryEntries, groupName(group()));
  818|       |
  819|       |  // Size of next IFD, if any
  820|  44.2k|  size_t sizeNext = 0;
  821|  44.2k|  if (pNext_)
  ------------------
  |  Branch (821:7): [True: 1.05k, False: 43.2k]
  ------------------
  822|  1.05k|    sizeNext = pNext_->size();
  823|       |
  824|       |  // Nothing to do if there are no entries and the size of the next IFD is 0
  825|  44.2k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (825:7): [True: 686, False: 43.6k]
  |  Branch (825:25): [True: 222, False: 464]
  ------------------
  826|    222|    return 0;
  827|       |
  828|       |  // Remember the offset of the CR2 RAW IFD
  829|  44.0k|  if (group() == IfdId::ifd3Id) {
  ------------------
  |  Branch (829:7): [True: 51, False: 44.0k]
  ------------------
  830|       |#ifdef EXIV2_DEBUG_MESSAGES
  831|       |    std::cerr << "Directory " << groupName(group()) << " offset is 0x" << std::setw(8) << std::setfill('0') << std::hex
  832|       |              << offset << std::dec << "\n";
  833|       |#endif
  834|     51|    ioWrapper.setTarget(OffsetWriter::cr2RawIfdOffset, offset);
  835|     51|  }
  836|       |  // Size of all directory entries, without values and additional data
  837|  44.0k|  const size_t sizeDir = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (837:50): [True: 43.8k, False: 184]
  ------------------
  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|  44.0k|  if (group() < IfdId::mnId) {
  ------------------
  |  Branch (841:7): [True: 31.1k, False: 12.9k]
  ------------------
  842|  31.1k|    std::sort(components_.begin(), components_.end(), cmpTagLt);
  843|  31.1k|  }
  844|       |  // Size of IFD values and additional data
  845|  44.0k|  size_t sizeValue = 0;
  846|  44.0k|  size_t sizeData = 0;
  847|  1.70M|  for (auto&& component : components_) {
  ------------------
  |  Branch (847:25): [True: 1.70M, False: 44.0k]
  ------------------
  848|  1.70M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (848:40): [True: 98.9k, False: 1.60M]
  ------------------
  849|  98.9k|      sv += sv & 1;  // Align value to word boundary
  850|  98.9k|      sizeValue += sv;
  851|  98.9k|    }
  852|       |    // Also add the size of data, but only if needed
  853|  1.70M|    if (isRootDir) {
  ------------------
  |  Branch (853:9): [True: 787k, False: 920k]
  ------------------
  854|   787k|      auto sd = component->sizeData();
  855|   787k|      sd += sd & 1;  // Align data to word boundary
  856|   787k|      sizeData += sd;
  857|   787k|    }
  858|  1.70M|  }
  859|       |
  860|  44.0k|  size_t idx = 0;                 // Current IFD index / bytes written
  861|  44.0k|  valueIdx = sizeDir;             // Offset to the current IFD value
  862|  44.0k|  dataIdx = sizeDir + sizeValue;  // Offset to the entry's data area
  863|  44.0k|  if (isRootDir) {                // Absolute offset to the image data
  ------------------
  |  Branch (863:7): [True: 17.3k, False: 26.6k]
  ------------------
  864|  17.3k|    imageIdx = offset + dataIdx + sizeData + sizeNext;
  865|  17.3k|    imageIdx += imageIdx & 1;  // Align image data to word boundary
  866|  17.3k|  }
  867|       |
  868|       |  // 1st: Write the IFD, a) Number of directory entries
  869|  44.0k|  byte buf[4];
  870|  44.0k|  us2Data(buf, static_cast<uint16_t>(compCount), byteOrder);
  871|  44.0k|  ioWrapper.write(buf, 2);
  872|  44.0k|  idx += 2;
  873|       |  // b) Directory entries - may contain pointers to the value or data
  874|  1.70M|  for (auto&& component : components_) {
  ------------------
  |  Branch (874:25): [True: 1.70M, False: 44.0k]
  ------------------
  875|  1.70M|    idx += writeDirEntry(ioWrapper, byteOrder, offset, component.get(), valueIdx, dataIdx, imageIdx);
  876|  1.70M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (876:40): [True: 98.2k, False: 1.60M]
  ------------------
  877|  98.2k|      sv += sv & 1;  // Align value to word boundary
  878|  98.2k|      valueIdx += sv;
  879|  98.2k|    }
  880|  1.70M|    auto sd = component->sizeData();
  881|  1.70M|    sd += sd & 1;  // Align data to word boundary
  882|  1.70M|    dataIdx += sd;
  883|  1.70M|  }
  884|       |  // c) Pointer to the next IFD
  885|  44.0k|  if (hasNext_) {
  ------------------
  |  Branch (885:7): [True: 43.7k, False: 366]
  ------------------
  886|  43.7k|    memset(buf, 0x0, 4);
  887|  43.7k|    if (pNext_ && sizeNext) {
  ------------------
  |  Branch (887:9): [True: 1.05k, False: 42.6k]
  |  Branch (887:19): [True: 1.05k, False: 1]
  ------------------
  888|  1.05k|      l2Data(buf, static_cast<uint32_t>(offset + dataIdx), byteOrder);
  889|  1.05k|    }
  890|  43.7k|    ioWrapper.write(buf, 4);
  891|  43.7k|    idx += 4;
  892|  43.7k|  }
  893|       |
  894|       |  // 2nd: Write IFD values - may contain pointers to additional data
  895|  44.0k|  valueIdx = sizeDir;
  896|  44.0k|  dataIdx = sizeDir + sizeValue;
  897|  1.69M|  for (auto&& component : components_) {
  ------------------
  |  Branch (897:25): [True: 1.69M, False: 44.0k]
  ------------------
  898|  1.69M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (898:40): [True: 96.7k, False: 1.59M]
  ------------------
  899|  96.7k|      size_t d = component->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  900|  96.7k|      enforce(sv == d, ErrorCode::kerImageWriteFailed);
  901|  96.7k|      if ((sv & 1) == 1) {
  ------------------
  |  Branch (901:11): [True: 17.4k, False: 79.2k]
  ------------------
  902|  17.4k|        ioWrapper.putb(0x0);  // Align value to word boundary
  903|  17.4k|        sv += 1;
  904|  17.4k|      }
  905|  96.7k|      idx += sv;
  906|  96.7k|      valueIdx += sv;
  907|  96.7k|    }
  908|  1.69M|    auto sd = component->sizeData();
  909|  1.69M|    sd += sd & 1;  // Align data to word boundary
  910|  1.69M|    dataIdx += sd;
  911|  1.69M|  }
  912|       |
  913|       |  // 3rd: Write data - may contain offsets too (eg sub-IFD)
  914|  44.0k|  dataIdx = sizeDir + sizeValue;
  915|  44.0k|  idx += writeData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
  916|       |
  917|       |  // 4th: Write next-IFD
  918|  44.0k|  if (pNext_ && sizeNext) {
  ------------------
  |  Branch (918:7): [True: 1.03k, False: 43.0k]
  |  Branch (918:17): [True: 1.03k, False: 1]
  ------------------
  919|  1.03k|    idx += pNext_->write(ioWrapper, byteOrder, offset + idx, std::string::npos, std::string::npos, imageIdx);
  920|  1.03k|  }
  921|       |
  922|       |  // 5th, at the root directory level only: write image data
  923|  44.0k|  if (isRootDir) {
  ------------------
  |  Branch (923:7): [True: 16.8k, False: 27.2k]
  ------------------
  924|  16.8k|    idx += writeImage(ioWrapper, byteOrder);
  925|  16.8k|  }
  926|       |
  927|  44.0k|  return idx;
  928|  44.2k|}
_ZN5Exiv28Internal13TiffDirectory13writeDirEntryERNS0_9IoWrapperENS_9ByteOrderEmPNS0_13TiffComponentEmmRm:
  931|  1.70M|                                    TiffComponent* pTiffComponent, size_t valueIdx, size_t dataIdx, size_t& imageIdx) {
  932|  1.70M|  auto pDirEntry = dynamic_cast<TiffEntryBase*>(pTiffComponent);
  933|  1.70M|  if (!pDirEntry)
  ------------------
  |  Branch (933:7): [True: 0, False: 1.70M]
  ------------------
  934|      0|    return 0;
  935|  1.70M|  byte buf[8];
  936|  1.70M|  us2Data(buf, pDirEntry->tag(), byteOrder);
  937|  1.70M|  us2Data(buf + 2, pDirEntry->tiffType(), byteOrder);
  938|  1.70M|  ul2Data(buf + 4, static_cast<uint32_t>(pDirEntry->count()), byteOrder);
  939|  1.70M|  ioWrapper.write(buf, 8);
  940|  1.70M|  if (pDirEntry->size() > 4) {
  ------------------
  |  Branch (940:7): [True: 98.2k, False: 1.60M]
  ------------------
  941|  98.2k|    pDirEntry->setOffset(Safe::add<size_t>(offset, valueIdx));
  942|  98.2k|    ul2Data(buf, static_cast<uint32_t>(pDirEntry->offset()), byteOrder);
  943|  98.2k|    ioWrapper.write(buf, 4);
  944|  1.60M|  } else {
  945|  1.60M|    const size_t len = pDirEntry->write(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
  946|  1.60M|#ifndef SUPPRESS_WARNINGS
  947|  1.60M|    if (len > 4) {
  ------------------
  |  Branch (947:9): [True: 53, False: 1.60M]
  ------------------
  948|     53|      EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == " << len << ".\n";
  ------------------
  |  |  142|     53|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 53]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|     53|  LogMsg(LogMsg::error).os()
  ------------------
  949|     53|    }
  950|  1.60M|#endif
  951|  1.60M|    if (len < 4) {
  ------------------
  |  Branch (951:9): [True: 1.58M, False: 24.5k]
  ------------------
  952|  1.58M|      memset(buf, 0x0, 4);
  953|  1.58M|      ioWrapper.write(buf, 4 - len);
  954|  1.58M|    }
  955|  1.60M|  }
  956|  1.70M|  return 12;
  957|  1.70M|}  // TiffDirectory::writeDirEntry
_ZN5Exiv28Internal13TiffEntryBase7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  960|  1.64M|                              size_t /*dataIdx*/, size_t& /*imageIdx*/) {
  961|  1.64M|  if (!pValue_ || pValue_->size() == 0)
  ------------------
  |  Branch (961:7): [True: 21.4k, False: 1.62M]
  |  Branch (961:19): [True: 1.51M, False: 114k]
  ------------------
  962|  1.53M|    return 0;
  963|       |
  964|   114k|  DataBuf buf(pValue_->size());
  965|   114k|  pValue_->copy(buf.data(), byteOrder);
  966|   114k|  ioWrapper.write(buf.c_data(), buf.size());
  967|   114k|  return buf.size();
  968|  1.64M|}  // TiffEntryBase::doWrite
_ZN5Exiv28Internal13TiffEntryBase11writeOffsetEPhmNS0_8TiffTypeENS_9ByteOrderE:
  970|  94.5k|size_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType, ByteOrder byteOrder) {
  971|  94.5k|  size_t rc = 0;
  972|  94.5k|  switch (tiffType) {
  973|  3.71k|    case ttUnsignedShort:
  ------------------
  |  Branch (973:5): [True: 3.71k, False: 90.8k]
  ------------------
  974|  6.78k|    case ttSignedShort:
  ------------------
  |  Branch (974:5): [True: 3.07k, False: 91.4k]
  ------------------
  975|  6.78k|      if (offset > std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (975:11): [True: 22, False: 6.76k]
  ------------------
  976|     22|        throw Error(ErrorCode::kerOffsetOutOfRange);
  977|  6.76k|      rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
  978|  6.76k|      break;
  979|  83.9k|    case ttUnsignedLong:
  ------------------
  |  Branch (979:5): [True: 83.9k, False: 10.5k]
  ------------------
  980|  87.3k|    case ttSignedLong:
  ------------------
  |  Branch (980:5): [True: 3.38k, False: 91.1k]
  ------------------
  981|  87.3k|      if (offset > std::numeric_limits<uint32_t>::max())
  ------------------
  |  Branch (981:11): [True: 11, False: 87.3k]
  ------------------
  982|     11|        throw Error(ErrorCode::kerOffsetOutOfRange);
  983|  87.3k|      rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
  984|  87.3k|      break;
  985|    372|    default:
  ------------------
  |  Branch (985:5): [True: 372, False: 94.1k]
  ------------------
  986|    372|      throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
  987|  94.5k|  }
  988|  94.1k|  return rc;
  989|  94.5k|}  // TiffEntryBase::writeOffset
_ZN5Exiv28Internal13TiffDataEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
  992|  7.12k|                              size_t dataIdx, size_t& /*imageIdx*/) {
  993|  7.12k|  if (!pValue() || pValue()->count() == 0)
  ------------------
  |  Branch (993:7): [True: 192, False: 6.93k]
  |  Branch (993:20): [True: 4.51k, False: 2.42k]
  ------------------
  994|  4.70k|    return 0;
  995|       |
  996|  2.42k|  DataBuf buf(pValue()->size());
  997|  2.42k|  size_t idx = 0;
  998|  2.42k|  const size_t prevOffset = pValue()->toUint32(0);
  999|  6.11k|  for (size_t i = 0; i < count(); ++i) {
  ------------------
  |  Branch (999:22): [True: 3.69k, False: 2.42k]
  ------------------
 1000|  3.69k|    const size_t iOffset = pValue()->toUint32(i);
 1001|  3.69k|    enforce(prevOffset <= iOffset, ErrorCode::kerOffsetOutOfRange);
 1002|  3.69k|    const auto newDataIdx = Safe::add<size_t>(iOffset - prevOffset, dataIdx);
 1003|  3.69k|    idx += writeOffset(buf.data(idx), Safe::add(offset, newDataIdx), tiffType(), byteOrder);
 1004|  3.69k|  }
 1005|  2.42k|  ioWrapper.write(buf.c_data(), buf.size());
 1006|  2.42k|  return buf.size();
 1007|  7.12k|}
_ZN5Exiv28Internal14TiffImageEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1010|  18.4k|                               size_t dataIdx, size_t& imageIdx) {
 1011|  18.4k|  size_t o2 = imageIdx;
 1012|       |  // For makernotes, write TIFF image data to the data area
 1013|  18.4k|  if (group() > IfdId::mnId)
  ------------------
  |  Branch (1013:7): [True: 312, False: 18.1k]
  ------------------
 1014|    312|    o2 = Safe::add<size_t>(offset, dataIdx);
 1015|       |#ifdef EXIV2_DEBUG_MESSAGES
 1016|       |  std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1017|       |            << std::hex << tag() << std::dec << ": Writing offset " << o2 << "\n";
 1018|       |#endif
 1019|  18.4k|  DataBuf buf(strips_.size() * 4);
 1020|  18.4k|  size_t idx = 0;
 1021|  74.3k|  for (const auto& [_, off] : strips_) {
  ------------------
  |  Branch (1021:29): [True: 74.3k, False: 18.4k]
  ------------------
 1022|  74.3k|    idx += writeOffset(buf.data(idx), o2, tiffType(), byteOrder);
 1023|       |    // Align strip data to word boundary
 1024|  74.3k|    const auto sz = Safe::add(off, off & 1);
 1025|  74.3k|    o2 = Safe::add(o2, sz);
 1026|  74.3k|    if (group() <= IfdId::mnId)
  ------------------
  |  Branch (1026:9): [True: 73.2k, False: 1.07k]
  ------------------
 1027|  73.2k|      imageIdx = Safe::add(imageIdx, sz);
 1028|  74.3k|  }
 1029|  18.4k|  ioWrapper.write(buf.c_data(), buf.size());
 1030|  18.4k|  return buf.size();
 1031|  18.4k|}  // TiffImageEntry::doWrite
_ZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1034|  12.8k|                           size_t dataIdx, size_t& /*imageIdx*/) {
 1035|  12.8k|  DataBuf buf(ifds_.size() * 4);
 1036|  12.8k|  size_t idx = 0;
 1037|       |  // Sort IFDs by group, needed if image data tags were copied first
 1038|  12.8k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
 1039|  16.5k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1039:19): [True: 16.5k, False: 12.8k]
  ------------------
 1040|  16.5k|    idx += writeOffset(buf.data(idx), offset + dataIdx, tiffType(), byteOrder);
 1041|  16.5k|    dataIdx += ifd->size();
 1042|  16.5k|  }
 1043|  12.8k|  ioWrapper.write(buf.c_data(), buf.size());
 1044|  12.8k|  return buf.size();
 1045|  12.8k|}  // TiffSubIfd::doWrite
_ZN5Exiv28Internal11TiffMnEntry7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1048|  20.3k|                            size_t& imageIdx) {
 1049|  20.3k|  if (!mn_) {
  ------------------
  |  Branch (1049:7): [True: 10.9k, False: 9.37k]
  ------------------
 1050|  10.9k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1051|  10.9k|  }
 1052|  9.37k|  return mn_->write(ioWrapper, byteOrder, offset + valueIdx, std::string::npos, std::string::npos, imageIdx);
 1053|  20.3k|}  // TiffMnEntry::doWrite
_ZN5Exiv28Internal16TiffIfdMakernote7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1056|  9.37k|                                 size_t /*dataIdx*/, size_t& imageIdx) {
 1057|  9.37k|  mnOffset_ = offset;
 1058|  9.37k|  setImageByteOrder(byteOrder);
 1059|  9.37k|  auto len = writeHeader(ioWrapper, this->byteOrder());
 1060|  9.37k|  len += ifd_.write(ioWrapper, this->byteOrder(), offset - baseOffset() + len, std::string::npos, std::string::npos,
 1061|  9.37k|                    imageIdx);
 1062|  9.37k|  return len;
 1063|  9.37k|}  // TiffIfdMakernote::doWrite
_ZN5Exiv28Internal15TiffBinaryArray7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1066|  20.6k|                                size_t dataIdx, size_t& imageIdx) {
 1067|  20.6k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1067:7): [True: 1.69k, False: 18.9k]
  |  Branch (1067:17): [True: 11.4k, False: 7.49k]
  ------------------
 1068|  13.1k|    return TiffEntryBase::doWrite(ioWrapper, byteOrder, offset, valueIdx, dataIdx, imageIdx);
 1069|  7.49k|  if (cfg()->byteOrder_ != invalidByteOrder)
  ------------------
  |  Branch (1069:7): [True: 1.02k, False: 6.46k]
  ------------------
 1070|  1.02k|    byteOrder = cfg()->byteOrder_;
 1071|       |  // Tags must be sorted in ascending order
 1072|  7.49k|  std::sort(elements_.begin(), elements_.end(), cmpTagLt);
 1073|  7.49k|  size_t idx = 0;
 1074|  7.49k|  MemIo mio;  // memory stream in which to store data
 1075|  7.49k|  IoWrapper mioWrapper(mio, nullptr, 0, nullptr);
 1076|       |  // Some array entries need to have the size in the first element
 1077|  7.49k|  if (cfg()->hasSize_) {
  ------------------
  |  Branch (1077:7): [True: 168, False: 7.32k]
  ------------------
 1078|    168|    byte buf[4];
 1079|    168|    size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
 1080|    168|    switch (elSize) {
 1081|     81|      case 2:
  ------------------
  |  Branch (1081:7): [True: 81, False: 87]
  ------------------
 1082|     81|        idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
 1083|     81|        break;
 1084|     87|      case 4:
  ------------------
  |  Branch (1084:7): [True: 87, False: 81]
  ------------------
 1085|     87|        idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
 1086|     87|        break;
 1087|      0|      default:
  ------------------
  |  Branch (1087:7): [True: 0, False: 168]
  ------------------
 1088|      0|        break;
 1089|    168|    }
 1090|    168|    mioWrapper.write(buf, elSize);
 1091|    168|  }
 1092|       |  // write all tags of the array (Todo: assumes that there are no duplicates, need check)
 1093|  1.42M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1093:23): [True: 1.42M, False: 7.49k]
  ------------------
 1094|       |    // Skip the manufactured tag, if it exists
 1095|  1.42M|    if (cfg()->hasSize_ && element->tag() == 0)
  ------------------
  |  Branch (1095:9): [True: 9.78k, False: 1.41M]
  |  Branch (1095:28): [True: 168, False: 9.62k]
  ------------------
 1096|    168|      continue;
 1097|  1.42M|    size_t newIdx = element->tag() * cfg()->tagStep();
 1098|  1.42M|    idx += fillGap(mioWrapper, idx, newIdx);
 1099|  1.42M|    idx += element->write(mioWrapper, byteOrder, offset + newIdx, valueIdx, dataIdx, imageIdx);
 1100|  1.42M|  }
 1101|  7.49k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1101:7): [True: 6.22k, False: 1.26k]
  |  Branch (1101:29): [True: 6.22k, False: 0]
  ------------------
 1102|  6.22k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1103|  6.22k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1104|  6.22k|    idx += fillGap(mioWrapper, idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1105|  6.22k|  }
 1106|       |
 1107|  7.49k|  if (cfg()->cryptFct_) {
  ------------------
  |  Branch (1107:7): [True: 918, False: 6.57k]
  ------------------
 1108|       |    // Select sonyTagEncipher
 1109|    918|    CryptFct cryptFct = cfg()->cryptFct_;
 1110|    918|    if (cryptFct == &sonyTagDecipher) {
  ------------------
  |  Branch (1110:9): [True: 203, False: 715]
  ------------------
 1111|    203|      cryptFct = sonyTagEncipher;
 1112|    203|    }
 1113|    918|    DataBuf buf = cryptFct(tag(), mio.mmap(), mio.size(), pRoot_);
 1114|    918|    if (!buf.empty()) {
  ------------------
  |  Branch (1114:9): [True: 230, False: 688]
  ------------------
 1115|    230|      mio.seek(0, Exiv2::BasicIo::beg);
 1116|    230|      mio.write(buf.c_data(), buf.size());
 1117|    230|    }
 1118|    918|  }
 1119|  7.49k|  ioWrapper.write(mio.mmap(), mio.size());
 1120|       |
 1121|  7.49k|  return idx;
 1122|  7.49k|}  // TiffBinaryArray::doWrite
_ZN5Exiv28Internal17TiffBinaryElement7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRm:
 1125|  1.42M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) {
 1126|  1.42M|  auto pv = pValue();
 1127|  1.42M|  if (!pv || pv->count() == 0)
  ------------------
  |  Branch (1127:7): [True: 0, False: 1.42M]
  |  Branch (1127:14): [True: 747k, False: 678k]
  ------------------
 1128|   747k|    return 0;
 1129|   678k|  DataBuf buf(pv->size());
 1130|   678k|  pv->copy(buf.data(), byteOrder);
 1131|   678k|  ioWrapper.write(buf.c_data(), buf.size());
 1132|   678k|  return buf.size();
 1133|  1.42M|}  // TiffBinaryElement::doWrite
_ZNK5Exiv28Internal13TiffComponent9writeDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1136|  1.72M|                                size_t& imageIdx) const {
 1137|  1.72M|  return doWriteData(ioWrapper, byteOrder, offset, dataIdx, imageIdx);
 1138|  1.72M|}  // TiffComponent::writeData
_ZNK5Exiv28Internal13TiffDirectory11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1141|  43.4k|                                  size_t& imageIdx) const {
 1142|  43.4k|  size_t len = 0;
 1143|  1.68M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1143:25): [True: 1.68M, False: 43.4k]
  ------------------
 1144|  1.68M|    len += component->writeData(ioWrapper, byteOrder, offset, dataIdx + len, imageIdx);
 1145|  1.68M|  }
 1146|  43.4k|  return len;
 1147|  43.4k|}  // TiffDirectory::doWriteData
_ZNK5Exiv28Internal13TiffEntryBase11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1150|  1.64M|                                  size_t /*dataIdx*/, size_t& /*imageIdx*/) const {
 1151|  1.64M|  return 0;
 1152|  1.64M|}  // TiffEntryBase::doWriteData
_ZNK5Exiv28Internal14TiffImageEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1155|  18.0k|                                   size_t& /*imageIdx*/) const {
 1156|  18.0k|  size_t len = 0;
 1157|       |  // For makernotes, write TIFF image data to the data area
 1158|  18.0k|  if (group() > IfdId::mnId) {  // Todo: FIX THIS HACK!!!
  ------------------
  |  Branch (1158:7): [True: 294, False: 17.7k]
  ------------------
 1159|    294|    len = writeImage(ioWrapper, byteOrder);
 1160|    294|  }
 1161|  18.0k|  return len;
 1162|  18.0k|}  // TiffImageEntry::doWriteData
_ZNK5Exiv28Internal13TiffDataEntry11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1165|  5.98k|                                  size_t& /*imageIdx*/) const {
 1166|  5.98k|  if (!pValue())
  ------------------
  |  Branch (1166:7): [True: 187, False: 5.79k]
  ------------------
 1167|    187|    return 0;
 1168|       |
 1169|  5.79k|  DataBuf buf = pValue()->dataArea();
 1170|  5.79k|  if (!buf.empty())
  ------------------
  |  Branch (1170:7): [True: 792, False: 5.00k]
  ------------------
 1171|    792|    ioWrapper.write(buf.c_data(), buf.size());
 1172|       |  // Align data to word boundary
 1173|  5.79k|  size_t align = (buf.size() & 1);
 1174|  5.79k|  if (align)
  ------------------
  |  Branch (1174:7): [True: 350, False: 5.44k]
  ------------------
 1175|    350|    ioWrapper.putb(0x0);
 1176|       |
 1177|  5.79k|  return buf.size() + align;
 1178|  5.98k|}  // TiffDataEntry::doWriteData
_ZNK5Exiv28Internal10TiffSubIfd11doWriteDataERNS0_9IoWrapperENS_9ByteOrderEmmRm:
 1181|  12.7k|                               size_t& imageIdx) const {
 1182|  12.7k|  size_t len = 0;
 1183|  16.2k|  for (auto&& ifd : ifds_) {
  ------------------
  |  Branch (1183:19): [True: 16.2k, False: 12.7k]
  ------------------
 1184|  16.2k|    len += ifd->write(ioWrapper, byteOrder, offset + dataIdx + len, std::string::npos, std::string::npos, imageIdx);
 1185|  16.2k|  }
 1186|       |  // Align data to word boundary
 1187|  12.7k|  size_t align = (len & 1);
 1188|  12.7k|  if (align)
  ------------------
  |  Branch (1188:7): [True: 0, False: 12.7k]
  ------------------
 1189|      0|    ioWrapper.putb(0x0);
 1190|       |
 1191|  12.7k|  return len + align;
 1192|  12.7k|}  // TiffSubIfd::doWriteData
_ZNK5Exiv28Internal13TiffComponent10writeImageERNS0_9IoWrapperENS_9ByteOrderE:
 1199|   953k|size_t TiffComponent::writeImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1200|   953k|  return doWriteImage(ioWrapper, byteOrder);
 1201|   953k|}  // TiffComponent::writeImage
_ZNK5Exiv28Internal13TiffDirectory12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1203|  30.0k|size_t TiffDirectory::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1204|  30.0k|  size_t len = 0;
 1205|  30.0k|  const TiffComponent* pSubIfd = nullptr;
 1206|   923k|  for (const auto& component : components_) {
  ------------------
  |  Branch (1206:30): [True: 923k, False: 30.0k]
  ------------------
 1207|   923k|    if (component->tag() == 0x014a) {
  ------------------
  |  Branch (1207:9): [True: 1.68k, False: 922k]
  ------------------
 1208|       |      // Hack: delay writing of sub-IFD image data to get the order correct
 1209|  1.68k|#ifndef SUPPRESS_WARNINGS
 1210|  1.68k|      if (pSubIfd) {
  ------------------
  |  Branch (1210:11): [True: 338, False: 1.34k]
  ------------------
 1211|    338|        EXV_ERROR << "Multiple sub-IFD image data tags found\n";
  ------------------
  |  |  142|    338|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 338]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|    338|  LogMsg(LogMsg::error).os()
  ------------------
 1212|    338|      }
 1213|  1.68k|#endif
 1214|  1.68k|      pSubIfd = component.get();
 1215|  1.68k|      continue;
 1216|  1.68k|    }
 1217|   922k|    len += component->writeImage(ioWrapper, byteOrder);
 1218|   922k|  }
 1219|  30.0k|  if (pSubIfd) {
  ------------------
  |  Branch (1219:7): [True: 1.31k, False: 28.6k]
  ------------------
 1220|  1.31k|    len += pSubIfd->writeImage(ioWrapper, byteOrder);
 1221|  1.31k|  }
 1222|  30.0k|  if (pNext_) {
  ------------------
  |  Branch (1222:7): [True: 800, False: 29.2k]
  ------------------
 1223|    800|    len += pNext_->writeImage(ioWrapper, byteOrder);
 1224|    800|  }
 1225|  30.0k|  return len;
 1226|  30.0k|}  // TiffDirectory::doWriteImage
_ZNK5Exiv28Internal13TiffEntryBase12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1228|   897k|size_t TiffEntryBase::doWriteImage(IoWrapper& /*ioWrapper*/, ByteOrder /*byteOrder*/) const {
 1229|   897k|  return 0;
 1230|   897k|}  // TiffEntryBase::doWriteImage
_ZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1232|  9.03k|size_t TiffSubIfd::doWriteImage(IoWrapper& ioWrapper, ByteOrder byteOrder) const {
 1233|  9.03k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(),
 1234|  9.03k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
 1235|  9.03k|}  // TiffSubIfd::doWriteImage
_ZNK5Exiv28Internal14TiffImageEntry12doWriteImageERNS0_9IoWrapperENS_9ByteOrderE:
 1245|  16.6k|size_t TiffImageEntry::doWriteImage(IoWrapper& ioWrapper, ByteOrder /*byteOrder*/) const {
 1246|  16.6k|  if (!pValue())
  ------------------
  |  Branch (1246:7): [True: 166, False: 16.5k]
  ------------------
 1247|    166|    throw Error(ErrorCode::kerImageWriteFailed);  // #1296
 1248|       |
 1249|  16.5k|  size_t len = pValue()->sizeDataArea();
 1250|  16.5k|  if (len > 0) {
  ------------------
  |  Branch (1250:7): [True: 297, False: 16.2k]
  ------------------
 1251|       |#ifdef EXIV2_DEBUG_MESSAGES
 1252|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1253|       |              << std::hex << tag() << std::dec << ": Writing data area, size = " << len;
 1254|       |#endif
 1255|    297|    DataBuf buf = pValue()->dataArea();
 1256|    297|    ioWrapper.write(buf.c_data(), buf.size());
 1257|    297|    size_t align = len & 1;  // Align image data to word boundary
 1258|    297|    if (align)
  ------------------
  |  Branch (1258:9): [True: 184, False: 113]
  ------------------
 1259|    184|      ioWrapper.putb(0x0);
 1260|    297|    len += align;
 1261|  16.2k|  } else {
 1262|       |#ifdef EXIV2_DEBUG_MESSAGES
 1263|       |    std::cerr << "TiffImageEntry, Directory " << groupName(group()) << ", entry 0x" << std::setw(4) << std::setfill('0')
 1264|       |              << std::hex << tag() << std::dec << ": Writing " << strips_.size() << " strips";
 1265|       |#endif
 1266|  16.2k|    len = 0;
 1267|  68.9k|    for (auto&& [f, s] : strips_) {
  ------------------
  |  Branch (1267:24): [True: 68.9k, False: 16.2k]
  ------------------
 1268|  68.9k|      ioWrapper.write(f, s);
 1269|  68.9k|      len += s;
 1270|  68.9k|      size_t align = s & 1;  // Align strip data to word boundary
 1271|  68.9k|      if (align)
  ------------------
  |  Branch (1271:11): [True: 39.5k, False: 29.3k]
  ------------------
 1272|  39.5k|        ioWrapper.putb(0x0);
 1273|  68.9k|      len += align;
 1274|  68.9k|    }
 1275|  16.2k|  }
 1276|       |#ifdef EXIV2_DEBUG_MESSAGES
 1277|       |  std::cerr << ", len = " << len << " bytes\n";
 1278|       |#endif
 1279|  16.5k|  return len;
 1280|  16.6k|}  // TiffImageEntry::doWriteImage
_ZNK5Exiv28Internal13TiffComponent4sizeEv:
 1282|  18.5M|size_t TiffComponent::size() const {
 1283|  18.5M|  return doSize();
 1284|  18.5M|}
_ZNK5Exiv28Internal13TiffDirectory6doSizeEv:
 1286|   174k|size_t TiffDirectory::doSize() const {
 1287|   174k|  size_t compCount = count();
 1288|       |  // Size of the directory, without values and additional data
 1289|   174k|  size_t len = 2 + (12 * compCount) + (hasNext_ ? 4 : 0);
  ------------------
  |  Branch (1289:40): [True: 172k, False: 1.67k]
  ------------------
 1290|       |  // Size of IFD values and data
 1291|  7.47M|  for (auto&& component : components_) {
  ------------------
  |  Branch (1291:25): [True: 7.47M, False: 174k]
  ------------------
 1292|  7.47M|    if (size_t sv = component->size(); sv > 4) {
  ------------------
  |  Branch (1292:40): [True: 330k, False: 7.14M]
  ------------------
 1293|   330k|      sv += sv & 1;  // Align value to word boundary
 1294|   330k|      len += sv;
 1295|   330k|    }
 1296|  7.47M|    auto sd = component->sizeData();
 1297|  7.47M|    sd += sd & 1;  // Align data to word boundary
 1298|  7.47M|    len += sd;
 1299|  7.47M|  }
 1300|       |  // Size of next-IFD, if any
 1301|   174k|  size_t sizeNext = 0;
 1302|   174k|  if (pNext_) {
  ------------------
  |  Branch (1302:7): [True: 267, False: 173k]
  ------------------
 1303|    267|    sizeNext = pNext_->size();
 1304|    267|    len += sizeNext;
 1305|    267|  }
 1306|       |  // Reset size of IFD if it has no entries and no or empty next IFD.
 1307|   174k|  if (compCount == 0 && sizeNext == 0)
  ------------------
  |  Branch (1307:7): [True: 1.07k, False: 173k]
  |  Branch (1307:25): [True: 949, False: 127]
  ------------------
 1308|    949|    len = 0;
 1309|   174k|  return len;
 1310|   174k|}
_ZNK5Exiv28Internal13TiffEntryBase6doSizeEv:
 1312|  19.2M|size_t TiffEntryBase::doSize() const {
 1313|  19.2M|  return size_;
 1314|  19.2M|}
_ZNK5Exiv28Internal14TiffImageEntry6doSizeEv:
 1316|   109k|size_t TiffImageEntry::doSize() const {
 1317|   109k|  return strips_.size() * 4;
 1318|   109k|}
_ZNK5Exiv28Internal10TiffSubIfd6doSizeEv:
 1320|  84.7k|size_t TiffSubIfd::doSize() const {
 1321|  84.7k|  return ifds_.size() * 4;
 1322|  84.7k|}
_ZNK5Exiv28Internal11TiffMnEntry6doSizeEv:
 1324|   112k|size_t TiffMnEntry::doSize() const {
 1325|   112k|  if (!mn_) {
  ------------------
  |  Branch (1325:7): [True: 44.2k, False: 68.1k]
  ------------------
 1326|  44.2k|    return TiffEntryBase::doSize();
 1327|  44.2k|  }
 1328|  68.1k|  return mn_->size();
 1329|   112k|}
_ZNK5Exiv28Internal16TiffIfdMakernote6doSizeEv:
 1331|  77.7k|size_t TiffIfdMakernote::doSize() const {
 1332|  77.7k|  return sizeHeader() + ifd_.size();
 1333|  77.7k|}
_ZNK5Exiv28Internal15TiffBinaryArray6doSizeEv:
 1335|   277k|size_t TiffBinaryArray::doSize() const {
 1336|   277k|  if (!cfg() || !decoded())
  ------------------
  |  Branch (1336:7): [True: 22.3k, False: 255k]
  |  Branch (1336:17): [True: 149k, False: 105k]
  ------------------
 1337|   172k|    return TiffEntryBase::doSize();
 1338|       |
 1339|   105k|  if (elements_.empty())
  ------------------
  |  Branch (1339:7): [True: 0, False: 105k]
  ------------------
 1340|      0|    return 0;
 1341|       |
 1342|       |  // Remaining assumptions:
 1343|       |  // - array elements don't "overlap"
 1344|       |  // - no duplicate tags in the array
 1345|   105k|  size_t idx = 0;
 1346|   105k|  size_t sz = cfg()->tagStep();
 1347|  20.1M|  for (auto&& element : elements_) {
  ------------------
  |  Branch (1347:23): [True: 20.1M, False: 105k]
  ------------------
 1348|  20.1M|    if (element->tag() > idx) {
  ------------------
  |  Branch (1348:9): [True: 3.95M, False: 16.2M]
  ------------------
 1349|  3.95M|      idx = element->tag();
 1350|  3.95M|      sz = element->size();
 1351|  3.95M|    }
 1352|  20.1M|  }
 1353|   105k|  idx *= cfg()->tagStep();
 1354|   105k|  idx += sz;
 1355|       |
 1356|   105k|  if (cfg()->hasFillers_ && def()) {
  ------------------
  |  Branch (1356:7): [True: 87.3k, False: 18.0k]
  |  Branch (1356:29): [True: 87.3k, False: 0]
  ------------------
 1357|  87.3k|    const ArrayDef* lastDef = def() + defSize() - 1;
 1358|  87.3k|    auto lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
 1359|  87.3k|    idx = std::max<size_t>(idx, lastDef->idx_ + lastDef->size(lastTag, cfg()->group_));
 1360|  87.3k|  }
 1361|   105k|  return idx;
 1362|       |
 1363|   105k|}  // TiffBinaryArray::doSize
_ZNK5Exiv28Internal17TiffBinaryElement6doSizeEv:
 1365|  3.95M|size_t TiffBinaryElement::doSize() const {
 1366|  3.95M|  if (!pValue())
  ------------------
  |  Branch (1366:7): [True: 0, False: 3.95M]
  ------------------
 1367|      0|    return 0;
 1368|  3.95M|  return pValue()->size();
 1369|  3.95M|}
_ZNK5Exiv28Internal13TiffComponent8sizeDataEv:
 1371|  11.6M|size_t TiffComponent::sizeData() const {
 1372|  11.6M|  return doSizeData();
 1373|  11.6M|}
_ZNK5Exiv28Internal13TiffEntryBase10doSizeDataEv:
 1379|  11.4M|size_t TiffEntryBase::doSizeData() const {
 1380|  11.4M|  return 0;
 1381|  11.4M|}
_ZNK5Exiv28Internal14TiffImageEntry10doSizeDataEv:
 1383|  82.5k|size_t TiffImageEntry::doSizeData() const {
 1384|  82.5k|  size_t len = 0;
 1385|       |  // For makernotes, TIFF image data is written to the data area
 1386|  82.5k|  if (group() > IfdId::mnId) {  // Todo: Fix this hack!!
  ------------------
  |  Branch (1386:7): [True: 5.28k, False: 77.2k]
  ------------------
 1387|  5.28k|    len = sizeImage();
 1388|  5.28k|  }
 1389|  82.5k|  return len;
 1390|  82.5k|}
_ZNK5Exiv28Internal13TiffDataEntry10doSizeDataEv:
 1392|  48.0k|size_t TiffDataEntry::doSizeData() const {
 1393|  48.0k|  if (!pValue())
  ------------------
  |  Branch (1393:7): [True: 574, False: 47.4k]
  ------------------
 1394|    574|    return 0;
 1395|  47.4k|  return pValue()->sizeDataArea();
 1396|  48.0k|}
_ZNK5Exiv28Internal10TiffSubIfd10doSizeDataEv:
 1398|  67.4k|size_t TiffSubIfd::doSizeData() const {
 1399|  67.4k|  return std::transform_reduce(ifds_.begin(), ifds_.end(), size_t{}, std::plus(), std::mem_fn(&TiffSubIfd::size));
 1400|  67.4k|}
_ZNK5Exiv28Internal13TiffComponent9sizeImageEv:
 1406|  5.28k|size_t TiffComponent::sizeImage() const {
 1407|  5.28k|  return doSizeImage();
 1408|  5.28k|}
_ZNK5Exiv28Internal14TiffImageEntry11doSizeImageEv:
 1428|  5.28k|size_t TiffImageEntry::doSizeImage() const {
 1429|  5.28k|  if (!pValue())
  ------------------
  |  Branch (1429:7): [True: 0, False: 5.28k]
  ------------------
 1430|      0|    return 0;
 1431|  5.28k|  auto len = pValue()->sizeDataArea();
 1432|  5.28k|  if (len != 0)
  ------------------
  |  Branch (1432:7): [True: 0, False: 5.28k]
  ------------------
 1433|      0|    return len;
 1434|       |
 1435|  5.28k|  return std::transform_reduce(strips_.begin(), strips_.end(), len, std::plus(),
 1436|  5.28k|                               [](const auto& s) { return s.second; });
 1437|  5.28k|}  // TiffImageEntry::doSizeImage
_ZN5Exiv28Internal8toTypeIdENS0_8TiffTypeEtNS_5IfdIdE:
 1454|  12.0M|TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group) {
 1455|  12.0M|  auto ti = static_cast<TypeId>(tiffType);
 1456|       |  // On the fly type conversion for Exif.Photo.UserComment, Exif.GPSProcessingMethod, GPSAreaInformation
 1457|  12.0M|  if (const TagInfo* pTag = ti == undefined ? findTagInfo(tag, group) : nullptr) {
  ------------------
  |  Branch (1457:22): [True: 9.70k, False: 11.9M]
  ------------------
 1458|  9.70k|    if (pTag->typeId_ == comment) {
  ------------------
  |  Branch (1458:9): [True: 6.57k, False: 3.13k]
  ------------------
 1459|  6.57k|      ti = comment;
 1460|  6.57k|    }
 1461|  9.70k|  }
 1462|       |  // http://dev.exiv2.org/boards/3/topics/1337 change unsignedByte to signedByte
 1463|       |  // Exif.NikonAFT.AFFineTuneAdj || Exif.Pentax.Temperature
 1464|  12.0M|  if (ti == Exiv2::unsignedByte &&
  ------------------
  |  Branch (1464:7): [True: 5.63M, False: 6.37M]
  ------------------
 1465|  5.63M|      ((tag == 0x0002 && group == IfdId::nikonAFTId) || (tag == 0x0047 && group == IfdId::pentaxId))) {
  ------------------
  |  Branch (1465:9): [True: 5.13k, False: 5.62M]
  |  Branch (1465:26): [True: 1.37k, False: 3.76k]
  |  Branch (1465:58): [True: 2.52k, False: 5.62M]
  |  Branch (1465:75): [True: 18, False: 2.50k]
  ------------------
 1466|  1.39k|    ti = Exiv2::signedByte;
 1467|  1.39k|  }
 1468|  12.0M|  return ti;
 1469|  12.0M|}
_ZN5Exiv28Internal10toTiffTypeENS_6TypeIdE:
 1471|  7.30M|TiffType toTiffType(TypeId typeId) {
 1472|  7.30M|  if (static_cast<uint32_t>(typeId) > 0xffff) {
  ------------------
  |  Branch (1472:7): [True: 0, False: 7.30M]
  ------------------
 1473|      0|#ifndef SUPPRESS_WARNINGS
 1474|      0|    EXV_ERROR << "'" << TypeInfo::typeName(typeId) << "' is not a valid Exif (TIFF) type; using type '"
  ------------------
  |  |  142|      0|  if (LogMsg::error >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (142:7): [True: 0, False: 0]
  |  |  |  Branch (142:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|  LogMsg(LogMsg::error).os()
  ------------------
 1475|      0|              << TypeInfo::typeName(undefined) << "'.\n";
 1476|      0|#endif
 1477|      0|    return ttUndefined;
 1478|      0|  }
 1479|  7.30M|  return static_cast<TiffType>(typeId);
 1480|  7.30M|}
_ZN5Exiv28Internal8cmpTagLtERKNSt3__110shared_ptrINS0_13TiffComponentEEES6_:
 1482|  27.1M|bool cmpTagLt(const TiffComponent::SharedPtr& lhs, const TiffComponent::SharedPtr& rhs) {
 1483|  27.1M|  if (lhs->tag() != rhs->tag())
  ------------------
  |  Branch (1483:7): [True: 18.9M, False: 8.20M]
  ------------------
 1484|  18.9M|    return lhs->tag() < rhs->tag();
 1485|  8.20M|  return lhs->idx() < rhs->idx();
 1486|  27.1M|}
_ZN5Exiv28Internal12newTiffEntryEtNS_5IfdIdE:
 1488|  6.23M|TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group) {
 1489|  6.23M|  return std::make_unique<TiffEntry>(tag, group);
 1490|  6.23M|}
_ZN5Exiv28Internal14newTiffMnEntryEtNS_5IfdIdE:
 1492|  41.9k|TiffComponent::UniquePtr newTiffMnEntry(uint16_t tag, IfdId group) {
 1493|  41.9k|  return std::make_unique<TiffMnEntry>(tag, group, IfdId::mnId);
 1494|  41.9k|}
_ZN5Exiv28Internal20newTiffBinaryElementEtNS_5IfdIdE:
 1496|  3.20M|TiffComponent::UniquePtr newTiffBinaryElement(uint16_t tag, IfdId group) {
 1497|  3.20M|  return std::make_unique<TiffBinaryElement>(tag, group);
 1498|  3.20M|}
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  473|  1.74M|  auto atc = [&] {
  474|  1.74M|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (474:9): [True: 1.71M, False: 28.8k]
  |  Branch (474:33): [True: 49.8k, False: 1.66M]
  ------------------
  475|  49.8k|      return std::move(object);
  476|  49.8k|    }
  477|  1.69M|    return TiffCreator::create(tpi.extendedTag(), tpi.group());
  478|  1.74M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal13TiffDirectory9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_1clEv:
  485|  1.72M|  tc = [&] {
  486|  1.72M|    if (tpi.extendedTag() == Tag::next)
  ------------------
  |  Branch (486:9): [True: 1.06k, False: 1.72M]
  ------------------
  487|  1.06k|      return this->addNext(std::move(atc));
  488|  1.72M|    return this->addChild(std::move(atc));
  489|  1.72M|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd9doAddPathEtRNSt3__15stackINS0_12TiffPathItemENS2_5dequeIS4_NS2_9allocatorIS4_EEEEEEPNS0_13TiffComponentENS2_10unique_ptrISB_NS2_14default_deleteISB_EEEEENK3$_0clEv:
  508|  16.6k|  auto tc = [&] {
  509|  16.6k|    if (tiffPath.size() == 1 && object) {
  ------------------
  |  Branch (509:9): [True: 0, False: 16.6k]
  |  Branch (509:33): [True: 0, False: 0]
  ------------------
  510|      0|      return addChild(std::move(object));
  511|      0|    }
  512|  16.6k|    return addChild(std::make_unique<TiffDirectory>(tpi1.tag(), tpi2.group()));
  513|  16.6k|  }();
tiffcomposite_int.cpp:_ZZN5Exiv28Internal10TiffSubIfd7doWriteERNS0_9IoWrapperENS_9ByteOrderEmmmRmENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEESB_EEDaRKT_RKT0_:
 1038|  4.34k|  std::sort(ifds_.begin(), ifds_.end(), [](const auto& lhs, const auto& rhs) { return lhs->group() < rhs->group(); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal10TiffSubIfd12doWriteImageERNS0_9IoWrapperENS_9ByteOrderEENK3$_0clINSt3__110shared_ptrINS0_13TiffDirectoryEEEEEDaRKT_:
 1234|  12.3k|                               [&](const auto& ifd) { return ifd->writeImage(ioWrapper, byteOrder); });
tiffcomposite_int.cpp:_ZZNK5Exiv28Internal14TiffImageEntry11doSizeImageEvENK3$_0clINSt3__14pairIPKhmEEEEDaRKT_:
 1436|  46.8k|                               [](const auto& s) { return s.second; });
tiffcomposite_int.cpp:_ZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdE:
 1439|  79.3k|static const TagInfo* findTagInfo(uint16_t tag, IfdId group) {
 1440|  79.3k|  const TagInfo* tags = [=] {
 1441|  79.3k|    if (group == IfdId::gpsId)
 1442|  79.3k|      return Internal::gpsTagList();
 1443|  79.3k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
 1444|  79.3k|  }();
 1445|  79.3k|  if (tags)
  ------------------
  |  Branch (1445:7): [True: 11.1k, False: 68.1k]
  ------------------
 1446|   363k|    for (size_t idx = 0; tags[idx].tag_ != 0xffff; ++idx)
  ------------------
  |  Branch (1446:26): [True: 361k, False: 1.42k]
  ------------------
 1447|   361k|      if (tags[idx].tag_ == tag)
  ------------------
  |  Branch (1447:11): [True: 9.70k, False: 351k]
  ------------------
 1448|  9.70k|        return tags + idx;
 1449|  69.6k|  return nullptr;
 1450|  79.3k|}
tiffcomposite_int.cpp:_ZZN5Exiv28InternalL11findTagInfoEtNS_5IfdIdEENK3$_0clEv:
 1440|  79.3k|  const TagInfo* tags = [=] {
 1441|  79.3k|    if (group == IfdId::gpsId)
  ------------------
  |  Branch (1441:9): [True: 7.47k, False: 71.8k]
  ------------------
 1442|  7.47k|      return Internal::gpsTagList();
 1443|  71.8k|    return group == IfdId::exifId ? Internal::exifTagList() : nullptr;
  ------------------
  |  Branch (1443:12): [True: 3.66k, False: 68.1k]
  ------------------
 1444|  79.3k|  }();
tiffcomposite_int.cpp:_ZN12_GLOBAL__N_17fillGapERN5Exiv28Internal9IoWrapperEmm:
 1505|  1.43M|size_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, size_t curr, size_t tobe) {
 1506|  1.43M|  if (curr < tobe) {
  ------------------
  |  Branch (1506:7): [True: 233k, False: 1.19M]
  ------------------
 1507|   233k|    Exiv2::DataBuf buf(tobe - curr);
 1508|   233k|    ioWrapper.write(buf.c_data(), buf.size());
 1509|   233k|    return tobe - curr;
 1510|   233k|  }
 1511|  1.19M|  return 0;
 1512|  1.43M|}

_ZN5Exiv28Internal12TiffPathItemC2EjNS_5IfdIdE:
   74|  12.3M|  constexpr TiffPathItem(uint32_t extendedTag, IfdId group) : extendedTag_(extendedTag), group_(group) {
   75|  12.3M|  }
_ZNK5Exiv28Internal12TiffPathItem3tagEv:
   81|  46.9M|  [[nodiscard]] uint16_t tag() const {
   82|  46.9M|    return static_cast<uint16_t>(extendedTag_);
   83|  46.9M|  }
_ZNK5Exiv28Internal12TiffPathItem11extendedTagEv:
   85|  12.5M|  [[nodiscard]] uint32_t extendedTag() const {
   86|  12.5M|    return extendedTag_;
   87|  12.5M|  }
_ZNK5Exiv28Internal12TiffPathItem5groupEv:
   89|  13.2M|  [[nodiscard]] IfdId group() const {
   90|  13.2M|    return group_;
   91|  13.2M|  }
_ZN5Exiv28Internal13TiffComponentC2EtNS_5IfdIdE:
  170|  10.0M|  constexpr TiffComponent(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
  171|  10.0M|  }
_ZN5Exiv28Internal13TiffComponent8setStartEPKh:
  216|  6.88M|  void setStart(const byte* pStart) {
  217|  6.88M|    pStart_ = const_cast<byte*>(pStart);
  218|  6.88M|  }
_ZNK5Exiv28Internal13TiffComponent3tagEv:
  240|   242M|  [[nodiscard]] uint16_t tag() const {
  241|   242M|    return tag_;
  242|   242M|  }
_ZNK5Exiv28Internal13TiffComponent5groupEv:
  244|  40.0M|  [[nodiscard]] IfdId group() const {
  245|  40.0M|    return group_;
  246|  40.0M|  }
_ZNK5Exiv28Internal13TiffComponent5startEv:
  248|  7.07M|  [[nodiscard]] byte* start() const {
  249|  7.07M|    return pStart_;
  250|  7.07M|  }
_ZN5Exiv28Internal13TiffEntryBase9setOffsetEm:
  416|  4.22M|  void setOffset(size_t offset) {
  417|  4.22M|    offset_ = offset;
  418|  4.22M|  }
_ZNK5Exiv28Internal13TiffEntryBase8tiffTypeEv:
  458|  1.89M|  [[nodiscard]] TiffType tiffType() const {
  459|  1.89M|    return tiffType_;
  460|  1.89M|  }
_ZNK5Exiv28Internal13TiffEntryBase6offsetEv:
  465|  98.2k|  [[nodiscard]] size_t offset() const {
  466|  98.2k|    return offset_;
  467|  98.2k|  }
_ZNK5Exiv28Internal13TiffEntryBase5pDataEv:
  476|  3.66M|  [[nodiscard]] const byte* pData() const {
  477|  3.66M|    return pData_;
  478|  3.66M|  }
_ZNK5Exiv28Internal13TiffEntryBase6pValueEv:
  480|  31.6M|  [[nodiscard]] const Value* pValue() const {
  481|  31.6M|    return pValue_.get();
  482|  31.6M|  }
_ZN5Exiv28Internal13TiffEntryBase8setCountEm:
  497|  1.44M|  void setCount(size_t count) {
  498|  1.44M|    count_ = count;
  499|  1.44M|  }
_ZN5Exiv28Internal13TiffEntryBase6setIdxEi:
  501|  4.12M|  void setIdx(int idx) {
  502|  4.12M|    idx_ = idx;
  503|  4.12M|  }
_ZNK5Exiv28Internal13TiffEntryBase7storageEv:
  540|  1.73M|  [[nodiscard]] std::shared_ptr<DataBuf> storage() const {
  541|  1.73M|    return storage_;
  542|  1.73M|  }
_ZNK5Exiv28Internal17TiffDataEntryBase5szTagEv:
  623|  89.6k|  [[nodiscard]] uint16_t szTag() const {
  624|  89.6k|    return szTag_;
  625|  89.6k|  }
_ZNK5Exiv28Internal17TiffDataEntryBase7szGroupEv:
  627|  89.6k|  [[nodiscard]] IfdId szGroup() const {
  628|  89.6k|    return szGroup_;
  629|  89.6k|  }
_ZNK5Exiv28Internal13TiffSizeEntry5dtTagEv:
  789|   101k|  [[nodiscard]] uint16_t dtTag() const {
  790|   101k|    return dtTag_;
  791|   101k|  }
_ZNK5Exiv28Internal13TiffSizeEntry7dtGroupEv:
  793|   101k|  [[nodiscard]] IfdId dtGroup() const {
  794|   101k|    return dtGroup_;
  795|   101k|  }
_ZNK5Exiv28Internal13TiffDirectory7hasNextEv:
  842|  45.8k|  [[nodiscard]] bool hasNext() const {
  843|  45.8k|    return hasNext_;
  844|  45.8k|  }
_ZN5Exiv28Internal16TiffIfdMakernote17setImageByteOrderENS_9ByteOrderE:
 1106|  17.9k|  void setImageByteOrder(ByteOrder byteOrder) {
 1107|  17.9k|    imageByteOrder_ = byteOrder;
 1108|  17.9k|  }
_ZNK5Exiv28Internal8ArrayDefeqEm:
 1217|  8.08M|  bool operator==(size_t idx) const {
 1218|  8.08M|    return idx_ == idx;
 1219|  8.08M|  }
_ZNK5Exiv28Internal8ArrayCfg7tagStepEv:
 1234|  3.46M|  [[nodiscard]] size_t tagStep() const {
 1235|  3.46M|    return elDefaultDef_.size(0, group_);
 1236|  3.46M|  }
_ZN5Exiv28Internal15TiffBinaryArray10setDecodedEb:
 1310|  3.16M|  void setDecoded(bool decoded) {
 1311|  3.16M|    decoded_ = decoded;
 1312|  3.16M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3cfgEv:
 1318|  10.6M|  [[nodiscard]] const ArrayCfg* cfg() const {
 1319|  10.6M|    return arrayCfg_;
 1320|  10.6M|  }
_ZNK5Exiv28Internal15TiffBinaryArray3defEv:
 1322|   190k|  [[nodiscard]] const ArrayDef* def() const {
 1323|   190k|    return arrayDef_;
 1324|   190k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7defSizeEv:
 1326|  97.2k|  [[nodiscard]] size_t defSize() const {
 1327|  97.2k|    return defSize_;
 1328|  97.2k|  }
_ZNK5Exiv28Internal15TiffBinaryArray7decodedEv:
 1330|   301k|  [[nodiscard]] bool decoded() const {
 1331|   301k|    return decoded_;
 1332|   301k|  }
_ZN5Exiv28Internal17TiffBinaryElement8setElDefERKNS0_8ArrayDefE:
 1404|  1.73M|  void setElDef(const ArrayDef& def) {
 1405|  1.73M|    elDef_ = def;
 1406|  1.73M|  }
_ZN5Exiv28Internal17TiffBinaryElement14setElByteOrderENS_9ByteOrderE:
 1410|  1.73M|  void setElByteOrder(ByteOrder byteOrder) {
 1411|  1.73M|    elByteOrder_ = byteOrder;
 1412|  1.73M|  }
_ZNK5Exiv28Internal17TiffBinaryElement5elDefEv:
 1420|  1.78M|  [[nodiscard]] const ArrayDef* elDef() const {
 1421|  1.78M|    return &elDef_;
 1422|  1.78M|  }
_ZNK5Exiv28Internal17TiffBinaryElement11elByteOrderEv:
 1426|  1.83M|  [[nodiscard]] ByteOrder elByteOrder() const {
 1427|  1.83M|    return elByteOrder_;
 1428|  1.83M|  }
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  36.3k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  36.3k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  36.3k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     23|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     23|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     23|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE56EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    338|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    338|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    338|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    102|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    102|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    102|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE21EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    436|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    436|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    436|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|     95|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|     95|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|     95|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE5EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  14.7k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  14.7k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  14.7k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE6EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  16.3k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  16.3k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  16.3k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  4.05k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  4.05k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  4.05k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.03k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.03k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.03k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    657|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    657|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    657|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.81k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.81k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.81k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  11.8k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  11.8k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  11.8k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE1EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  16.5k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  16.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  16.5k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  4.69k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  4.69k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  4.69k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  6.09k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  6.09k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  6.09k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  2.18k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  2.18k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  2.18k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.98k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.98k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.98k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    395|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    395|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    395|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.45k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.45k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.45k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  18.5k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  18.5k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  18.5k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE9EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  19.6k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  19.6k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  19.6k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.61k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.61k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.61k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.81k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.81k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.81k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    435|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    435|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    435|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.02k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.02k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.02k|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  13.3k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  13.3k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  13.3k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE10EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  17.6k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  17.6k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  17.6k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.76k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.76k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.76k|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  1.60k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  1.60k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  1.60k|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    525|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    525|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    525|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    771|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    771|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    771|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  13.4k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  13.4k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  13.4k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE11EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  14.5k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  14.5k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  14.5k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    603|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    603|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    603|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    594|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    594|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    594|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    432|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    432|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    432|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    810|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    810|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    810|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  6.47k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  6.47k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  6.47k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE12EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  7.31k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  7.31k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  7.31k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    345|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    345|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    345|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    316|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    316|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    316|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    551|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    551|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    551|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    481|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    481|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    481|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.98k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.98k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.98k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE13EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  3.85k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  3.85k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  3.85k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    257|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    257|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    257|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    208|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    208|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    208|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE14EEENSt3__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|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    541|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    541|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    541|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.05k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.05k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.05k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE14EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  2.69k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  2.69k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  2.69k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    277|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    277|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    277|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    345|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    345|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    345|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    306|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    306|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    306|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    428|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    428|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    428|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  3.39k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  3.39k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  3.39k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE15EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|  4.23k|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|  4.23k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|  4.23k|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    214|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    214|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    214|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    244|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    244|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    244|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    214|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    214|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    214|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    298|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    298|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    298|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.03k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.03k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.03k|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE16EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    723|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    723|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    723|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    387|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    387|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    387|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    266|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    266|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    266|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    327|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    327|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    327|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    352|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    352|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    352|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    281|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    281|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    281|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE17EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    635|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    635|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    635|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE7EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    344|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    344|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    344|}
_ZN5Exiv28Internal16newTiffThumbDataILt279ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    377|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    377|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    377|}
_ZN5Exiv28Internal16newTiffThumbSizeILt273ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    397|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    397|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    397|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    235|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    235|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    235|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    330|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    330|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    330|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.11k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.11k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.11k|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  18.0k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  18.0k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  18.0k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE2EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  12.7k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  12.7k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  12.7k|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    642|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    642|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    642|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    272|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    272|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    272|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     91|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     91|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     91|}
_ZN5Exiv28Internal16newTiffImageDataILt325ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|     84|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|     84|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|     84|}
_ZN5Exiv28Internal16newTiffImageSizeILt324ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    256|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    256|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    256|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    248|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    248|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    248|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE18EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    299|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    299|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    299|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    216|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    216|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    216|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    208|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    208|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    208|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    306|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    306|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    306|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE3EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    299|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    299|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    299|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|    212|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|    212|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|    212|}
_ZN5Exiv28Internal16newTiffImageDataILt279ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    251|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    251|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    251|}
_ZN5Exiv28Internal16newTiffImageSizeILt273ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|     81|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|     81|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|     81|}
_ZN5Exiv28Internal16newTiffImageDataILt514ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|    364|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|    364|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|    364|}
_ZN5Exiv28Internal16newTiffImageSizeILt513ELNS_5IfdIdE4EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    269|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    269|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    269|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  9.35k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  9.35k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  9.35k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10minoCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.75k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.75k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.75k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE100EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    110|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    110|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    110|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.97k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.97k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.97k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE101EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    409|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    409|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    409|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE102EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    109|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    109|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    109|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE103EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    318|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    318|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    318|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE104EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    234|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    234|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    234|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE105EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    317|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    317|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    317|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE106EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    602|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    602|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    602|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE107EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    599|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    599|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    599|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE108EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    262|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    262|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    262|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE109EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.17k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.17k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.17k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE110EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    755|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    755|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    755|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE111EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    445|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    445|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    445|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE112EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  6.34k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  6.34k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  6.34k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE113EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  2.35k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  2.35k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  2.35k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE114EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|  3.97k|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|  3.97k|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|  3.97k|}
_ZN5Exiv28Internal16newTiffImageDataILt258ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1531|  1.25k|TiffComponent::UniquePtr newTiffImageData(uint16_t tag, IfdId group) {
 1532|  1.25k|  return std::make_unique<TiffImageEntry>(tag, group, szTag, szGroup);
 1533|  1.25k|}
_ZN5Exiv28Internal16newTiffImageSizeILt257ELNS_5IfdIdE99EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1537|    816|TiffComponent::UniquePtr newTiffImageSize(uint16_t tag, IfdId group) {
 1538|       |  // Todo: Same as newTiffThumbSize - consolidate (rename)?
 1539|    816|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1540|    816|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonCsCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonCsDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  2.25k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  2.25k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  2.25k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  2.25k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonSiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|  1.07k|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|  1.07k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|  1.07k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPaCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    340|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    340|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    340|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonCfCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    137|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    137|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    137|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    405|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    405|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    405|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonTiCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    345|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    345|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    345|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonFiCfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonFiDefEEEENSt3__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:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonPrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    313|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    313|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    313|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonAfMiAdjCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    102|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    102|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L15canonVigCor2CfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     97|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     97|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     97|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonLiOpCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     46|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     46|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     46|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10canonLeCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10canonLeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    476|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    476|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    476|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    476|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonAmCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    106|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    106|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    106|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L10canonMeCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    112|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    112|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    112|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonFilCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    174|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    174|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    174|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonHdrCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    269|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    269|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    269|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L11canonAfCCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    140|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    140|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    140|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12canonRawBCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     92|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     92|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     92|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    547|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    547|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    547|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonVrCfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonVrDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    328|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    328|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    328|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    328|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonPcCfgEELm13ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonPcDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    135|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    135|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    135|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    135|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonWtCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonWtDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    144|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    144|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    144|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    144|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonIiCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonIiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    535|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    535|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    535|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    535|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonAfCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonAfDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    541|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    541|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    541|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    541|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonSiSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    727|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    727|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    727|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    727|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm6ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonCbSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    855|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    855|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    855|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    855|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm4ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonLdSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    394|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    394|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    394|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    394|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm5ETnRAT__KNS0_8ArraySetEL_ZNS0_L10nikonFlSetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|  1.28k|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|  1.28k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|  1.28k|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|  1.28k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonMeCfgEELm4ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonMeDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    235|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    235|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    235|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    235|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L11nikonAf2SetEEXadL_ZNS0_13nikonSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    608|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    608|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    608|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    608|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10nikonFiCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10nikonFiDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    333|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    333|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    333|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    333|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L11nikonAFTCfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L11nikonAFTDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    431|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    431|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    431|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    431|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     81|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     81|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     81|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE65EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    251|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    251|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    251|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.14k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.14k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.14k|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE117EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    951|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    951|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    951|}
_ZN5Exiv28Internal16newTiffThumbSizeILt4ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|    515|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|    515|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|    515|}
_ZN5Exiv28Internal16newTiffThumbDataILt3ELNS_5IfdIdE116EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    916|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    916|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    916|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12samsungPwCfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12samsungPwDefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  5.85k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  5.85k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  5.85k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  5.85k|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    931|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    931|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    931|}
_ZN5Exiv28Internal16newTiffThumbDataILt514ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|  1.92k|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|  1.92k|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|  1.92k|}
_ZN5Exiv28Internal16newTiffThumbSizeILt513ELNS_5IfdIdE119EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|  1.11k|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|  1.11k|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|  1.11k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L12sony2010eSetEEXadL_ZNS0_17sony2010eSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    143|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    143|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    143|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    143|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2FpSetEEXadL_ZNS0_15sony2FpSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    657|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    657|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    657|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    657|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc2bSetEEXadL_ZNS0_18sonyMisc2bSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    253|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    253|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    253|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    253|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm1ETnRAT__KNS0_8ArraySetEL_ZNS0_L13sonyMisc3cSetEEXadL_ZNS0_18sonyMisc3cSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    783|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    783|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    783|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    783|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sonyMisc1CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L12sonyMisc1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    200|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    200|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    200|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    200|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L13sonySInfo1CfgEELm5ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L13sonySInfo1DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|  1.73k|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|  1.73k|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|  1.73k|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|  1.73k|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony1CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    220|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    220|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    220|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    220|}
_ZN5Exiv28Internal13newTiffSubIfdILNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1493|    131|TiffComponent::UniquePtr newTiffSubIfd(uint16_t tag, IfdId group) {
 1494|    131|  return std::make_unique<TiffSubIfd>(tag, group, newGroup);
 1495|    131|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray2ILm2ETnRAT__KNS0_8ArraySetEL_ZNS0_L10sony2CsSetEEXadL_ZNS0_14sonyCsSelectorEtPKhmPNS0_13TiffComponentEEEEENSt3__110unique_ptrIS8_NSA_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1512|    321|TiffComponent::UniquePtr newTiffBinaryArray2(uint16_t tag, IfdId group) {
 1513|    321|  static_assert(N > 0, "Passed zero length newTiffBinaryArray2");
 1514|    321|  return std::make_unique<TiffBinaryArray>(tag, group, arraySet, N, cfgSelFct);
 1515|    321|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsoCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|    221|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|    221|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|    221|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray1IL_ZNS0_L12sony1MCsnCfgEEEENSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEEtNS_5IfdIdE:
 1506|     93|TiffComponent::UniquePtr newTiffBinaryArray1(uint16_t tag, IfdId group) {
 1507|     93|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, nullptr, 0);
 1508|     93|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L12sony1MCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    123|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    123|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    123|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    123|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|     62|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|     62|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|     62|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE124EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1525|     33|TiffComponent::UniquePtr newTiffThumbSize(uint16_t tag, IfdId group) {
 1526|     33|  return std::make_unique<TiffSizeEntry>(tag, group, dtTag, dtGroup);
 1527|     33|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L15sony1MCsA100CfgEELm3ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L15sony1MCsA100DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    129|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    129|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    129|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    129|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs7CfgEELm2ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs7DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    214|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    214|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    214|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    214|}
_ZN5Exiv28Internal16newTiffThumbDataILt137ELNS_5IfdIdE57EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1519|    669|TiffComponent::UniquePtr newTiffThumbData(uint16_t tag, IfdId group) {
 1520|    669|  return std::make_unique<TiffDataEntry>(tag, group, szTag, szGroup);
 1521|    669|}
_ZN5Exiv28Internal16newTiffThumbSizeILt136ELNS_5IfdIdE57EEENSt3__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|}
tiffimage_int.cpp:_ZN5Exiv28Internal19newTiffBinaryArray0IL_ZNS0_L10minoCs5CfgEELm1ETnRAT0__KNS0_8ArrayDefEL_ZNS0_L10minoCs5DefEEEENSt3__110unique_ptrINS0_13TiffComponentENS6_14default_deleteIS8_EEEEtNS_5IfdIdE:
 1499|    102|TiffComponent::UniquePtr newTiffBinaryArray0(uint16_t tag, IfdId group) {
 1500|    102|  static_assert(N > 0, "Passed zero length newTiffBinaryArray0");
 1501|    102|  return std::make_unique<TiffBinaryArray>(tag, group, arrayCfg, arrayDef, N);
 1502|    102|}
_ZN5Exiv28Internal16newTiffDirectoryILNS_5IfdIdE19EEENSt3__110unique_ptrINS0_13TiffComponentENS3_14default_deleteIS5_EEEEtS2_:
 1487|  15.5k|TiffComponent::UniquePtr newTiffDirectory(uint16_t tag, IfdId /*group*/) {
 1488|  15.5k|  return std::make_unique<TiffDirectory>(tag, newGroup);
 1489|  15.5k|}
_ZN5Exiv28Internal13TiffComponentD2Ev:
  173|  10.1M|  virtual ~TiffComponent() = default;
_ZN5Exiv28Internal13TiffDirectoryD2Ev:
  830|   218k|  ~TiffDirectory() override = default;
_ZN5Exiv28Internal10TiffSubIfdD2Ev:
  937|  64.7k|  ~TiffSubIfd() override = default;
_ZN5Exiv28Internal15TiffBinaryArrayD2Ev:
 1269|  35.3k|  ~TiffBinaryArray() override = default;

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

_ZNK5Exiv28Internal13FindExifdatumclERKNS_9ExifdatumE:
   29|  16.5M|bool FindExifdatum::operator()(const Exiv2::Exifdatum& md) const {
   30|  16.5M|  return ifdId_ == md.ifdId();
   31|  16.5M|}
_ZN5Exiv28Internal11TiffMapping11findDecoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 1991|  3.09M|DecoderFct TiffMapping::findDecoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 1992|  3.09M|  DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
 1993|  3.09M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (1993:12): [True: 9.59k, False: 3.08M]
  ------------------
 1994|       |    // This may set decoderFct to 0, meaning that the tag should not be decoded
 1995|  9.59k|    decoderFct = td->decoderFct_;
 1996|  9.59k|  }
 1997|  3.09M|  return decoderFct;
 1998|  3.09M|}
_ZN5Exiv28Internal11TiffMapping11findEncoderENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEjNS_5IfdIdE:
 2000|  3.17M|EncoderFct TiffMapping::findEncoder(std::string_view make, uint32_t extendedTag, IfdId group) {
 2001|  3.17M|  EncoderFct encoderFct = nullptr;
 2002|  3.17M|  if (auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group})) {
  ------------------
  |  Branch (2002:12): [True: 6.32k, False: 3.16M]
  ------------------
 2003|       |    // Returns 0 if no special encoder function is found
 2004|  6.32k|    encoderFct = td->encoderFct_;
 2005|  6.32k|  }
 2006|  3.17M|  return encoderFct;
 2007|  3.17M|}
_ZN5Exiv28Internal11TiffCreator6createEjNS_5IfdIdE:
 2009|  10.2M|TiffComponent::UniquePtr TiffCreator::create(uint32_t extendedTag, IfdId group) {
 2010|  10.2M|  auto tag = static_cast<uint16_t>(extendedTag);
 2011|  10.2M|  auto i = tiffGroupTable_.find(TiffGroupKey(extendedTag, group));
 2012|       |  // If the lookup failed then try again with Tag::all.
 2013|  10.2M|  if (i == tiffGroupTable_.end()) {
  ------------------
  |  Branch (2013:7): [True: 9.78M, False: 475k]
  ------------------
 2014|  9.78M|    i = tiffGroupTable_.find(TiffGroupKey(Tag::all, group));
 2015|  9.78M|  }
 2016|  10.2M|  if (i != tiffGroupTable_.end() && i->second) {
  ------------------
  |  Branch (2016:7): [True: 9.91M, False: 341k]
  |  Branch (2016:7): [True: 9.88M, False: 372k]
  |  Branch (2016:37): [True: 9.88M, False: 31.6k]
  ------------------
 2017|  9.88M|    return i->second(tag, group);
 2018|  9.88M|  }
 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|   372k|  return nullptr;
 2028|  10.2M|}  // TiffCreator::create
_ZN5Exiv28Internal11TiffCreator7getPathEjNS_5IfdIdEj:
 2030|  3.14M|TiffPath TiffCreator::getPath(uint32_t extendedTag, IfdId group, uint32_t root) {
 2031|  3.14M|  TiffPath ret;
 2032|  12.3M|  while (true) {
  ------------------
  |  Branch (2032:10): [True: 12.3M, Folded]
  ------------------
 2033|  12.3M|    ret.emplace(extendedTag, group);
 2034|  12.3M|    const auto ts = tiffTreeTable_.find(TiffGroupKey(root, group));
 2035|  12.3M|    assert(ts != tiffTreeTable_.end());
 2036|  12.3M|    extendedTag = ts->second.second;
 2037|  12.3M|    group = ts->second.first;
 2038|  12.3M|    if (ts->first == TiffGroupKey(root, IfdId::ifdIdNotSet)) {
  ------------------
  |  Branch (2038:9): [True: 3.14M, False: 9.16M]
  ------------------
 2039|  3.14M|      break;
 2040|  3.14M|    }
 2041|  12.3M|  }
 2042|  3.14M|  return ret;
 2043|  3.14M|}
_ZN5Exiv28Internal16TiffParserWorker6decodeERNS_8ExifDataERNS_8IptcDataERNS_7XmpDataEPKhmjPFMNS0_11TiffDecoderEFvPKNS0_13TiffEntryBaseEENSt3__117basic_string_viewIcNSG_11char_traitsIcEEEEjNS_5IfdIdEERKNS_12DecodeParamsEPNS0_14TiffHeaderBaseE:
 2047|  29.0k|                                   TiffHeaderBase* pHeader) {
 2048|       |  // Create standard TIFF header if necessary
 2049|  29.0k|  std::unique_ptr<TiffHeaderBase> ph;
 2050|  29.0k|  if (!pHeader) {
  ------------------
  |  Branch (2050:7): [True: 12.8k, False: 16.1k]
  ------------------
 2051|  12.8k|    ph = std::make_unique<TiffHeader>();
 2052|  12.8k|    pHeader = ph.get();
 2053|  12.8k|  }
 2054|       |
 2055|  29.0k|  if (auto rootDir = parse(pData, size, root, pHeader)) {
  ------------------
  |  Branch (2055:12): [True: 27.9k, False: 1.08k]
  ------------------
 2056|  27.9k|    auto decoder = TiffDecoder(exifData, iptcData, xmpData, rootDir.get(), findDecoderFct, dp);
 2057|  27.9k|    rootDir->accept(decoder);
 2058|  27.9k|  }
 2059|  29.0k|  return pHeader->byteOrder();
 2060|       |
 2061|  29.0k|}  // TiffParserWorker::decode
_ZN5Exiv28Internal16TiffParserWorker6encodeERNS_7BasicIoEPKhmRKNS_8ExifDataERKNS_8IptcDataERKNS_7XmpDataEjPFMNS0_11TiffEncoderEFvPNS0_13TiffEntryBaseEPKNS_9ExifdatumEENSt3__117basic_string_viewIcNSN_11char_traitsIcEEEEjNS_5IfdIdEEPNS0_14TiffHeaderBaseEPNS0_12OffsetWriterE:
 2066|  18.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|  18.5k|  WriteMethod writeMethod = wmIntrusive;
 2075|  18.5k|  auto parsedTree = parse(pData, size, root, pHeader);
 2076|  18.5k|  auto primaryGroups = findPrimaryGroups(parsedTree);
 2077|  18.5k|  if (parsedTree) {
  ------------------
  |  Branch (2077:7): [True: 6.96k, False: 11.5k]
  ------------------
 2078|       |    // Attempt to update existing TIFF components based on metadata entries
 2079|  6.96k|    TiffEncoder encoder(exifData, iptcData, xmpData, parsedTree.get(), false, primaryGroups, pHeader, findEncoderFct);
 2080|  6.96k|    parsedTree->accept(encoder);
 2081|  6.96k|    if (!encoder.dirty())
  ------------------
  |  Branch (2081:9): [True: 938, False: 6.03k]
  ------------------
 2082|    938|      writeMethod = wmNonIntrusive;
 2083|  6.96k|  }
 2084|  18.5k|  if (writeMethod == wmIntrusive) {
  ------------------
  |  Branch (2084:7): [True: 17.5k, False: 943]
  ------------------
 2085|  17.5k|    auto createdTree = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2086|  17.5k|    if (parsedTree) {
  ------------------
  |  Branch (2086:9): [True: 6.02k, False: 11.5k]
  ------------------
 2087|       |      // Copy image tags from the original image to the composite
 2088|  6.02k|      TiffCopier copier(createdTree.get(), root, pHeader, primaryGroups);
 2089|  6.02k|      parsedTree->accept(copier);
 2090|  6.02k|    }
 2091|       |    // Add entries from metadata to composite
 2092|  17.5k|    TiffEncoder encoder(exifData, iptcData, xmpData, createdTree.get(), !parsedTree, std::move(primaryGroups), pHeader,
 2093|  17.5k|                        findEncoderFct);
 2094|  17.5k|    encoder.add(createdTree.get(), std::move(parsedTree), root);
 2095|       |    // Write binary representation from the composite tree
 2096|  17.5k|    DataBuf header = pHeader->write();
 2097|  17.5k|    auto tempIo = MemIo();
 2098|  17.5k|    IoWrapper ioWrapper(tempIo, header.c_data(), header.size(), pOffsetWriter);
 2099|  17.5k|    auto imageIdx(std::string::npos);
 2100|  17.5k|    createdTree->write(ioWrapper, pHeader->byteOrder(), header.size(), std::string::npos, std::string::npos, imageIdx);
 2101|  17.5k|    if (pOffsetWriter)
  ------------------
  |  Branch (2101:9): [True: 145, False: 17.4k]
  ------------------
 2102|    145|      pOffsetWriter->writeOffsets(tempIo);
 2103|  17.5k|    io.transfer(tempIo);  // may throw
 2104|  17.5k|#ifndef SUPPRESS_WARNINGS
 2105|  17.5k|    EXV_INFO << "Write strategy: Intrusive\n";
  ------------------
  |  |  134|  17.5k|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 17.5k]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|  17.5k|  LogMsg(LogMsg::info).os()
  ------------------
 2106|  17.5k|#endif
 2107|  17.5k|  }
 2108|    943|#ifndef SUPPRESS_WARNINGS
 2109|    943|  else {
 2110|    943|    EXV_INFO << "Write strategy: Non-intrusive\n";
  ------------------
  |  |  134|    943|  if (LogMsg::info >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (134:7): [True: 0, False: 943]
  |  |  |  Branch (134:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  135|    943|  LogMsg(LogMsg::info).os()
  ------------------
 2111|    943|  }
 2112|  18.5k|#endif
 2113|  18.5k|  return writeMethod;
 2114|  18.5k|}  // TiffParserWorker::encode
_ZN5Exiv28Internal16TiffParserWorker5parseEPKhmjPNS0_14TiffHeaderBaseE:
 2117|  47.5k|                                                 TiffHeaderBase* pHeader) {
 2118|  47.5k|  TiffComponent::UniquePtr rootDir;
 2119|  47.5k|  if (!pData || size == 0)
  ------------------
  |  Branch (2119:7): [True: 11.9k, False: 35.6k]
  |  Branch (2119:17): [True: 0, False: 35.6k]
  ------------------
 2120|  11.9k|    return rootDir;
 2121|  35.6k|  if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
  ------------------
  |  Branch (2121:7): [True: 279, False: 35.3k]
  |  Branch (2121:38): [True: 412, False: 34.9k]
  ------------------
 2122|    691|    throw Error(ErrorCode::kerNotAnImage, "TIFF");
 2123|    691|  }
 2124|  34.9k|  rootDir = TiffCreator::create(root, IfdId::ifdIdNotSet);
 2125|  34.9k|  if (rootDir) {
  ------------------
  |  Branch (2125:7): [True: 34.9k, False: 0]
  ------------------
 2126|  34.9k|    rootDir->setStart(pData + pHeader->offset());
 2127|  34.9k|    auto state = TiffRwState{pHeader->byteOrder(), 0};
 2128|  34.9k|    auto reader = TiffReader{pData, size, rootDir.get(), state};
 2129|  34.9k|    rootDir->accept(reader);
 2130|  34.9k|    reader.postProcess();
 2131|  34.9k|  }
 2132|  34.9k|  return rootDir;
 2133|       |
 2134|  35.6k|}  // TiffParserWorker::parse
_ZN5Exiv28Internal16TiffParserWorker17findPrimaryGroupsERKNSt3__110unique_ptrINS0_13TiffComponentENS2_14default_deleteIS4_EEEE:
 2136|  18.5k|PrimaryGroups TiffParserWorker::findPrimaryGroups(const TiffComponent::UniquePtr& pSourceDir) {
 2137|  18.5k|  PrimaryGroups ret;
 2138|  18.5k|  if (!pSourceDir)
  ------------------
  |  Branch (2138:7): [True: 11.5k, False: 6.96k]
  ------------------
 2139|  11.5k|    return ret;
 2140|       |
 2141|  6.96k|  static constexpr auto imageGroups = std::array{
 2142|  6.96k|      IfdId::ifd0Id,      IfdId::ifd1Id,      IfdId::ifd2Id,      IfdId::ifd3Id,      IfdId::subImage1Id,
 2143|  6.96k|      IfdId::subImage2Id, IfdId::subImage3Id, IfdId::subImage4Id, IfdId::subImage5Id, IfdId::subImage6Id,
 2144|  6.96k|      IfdId::subImage7Id, IfdId::subImage8Id, IfdId::subImage9Id,
 2145|  6.96k|  };
 2146|       |
 2147|  90.5k|  for (auto imageGroup : imageGroups) {
  ------------------
  |  Branch (2147:24): [True: 90.5k, False: 6.96k]
  ------------------
 2148|  90.5k|    TiffFinder finder(0x00fe, imageGroup);
 2149|  90.5k|    pSourceDir->accept(finder);
 2150|  90.5k|    auto te = dynamic_cast<const TiffEntryBase*>(finder.result());
 2151|  90.5k|    if (!te)
  ------------------
  |  Branch (2151:9): [True: 89.0k, False: 1.57k]
  ------------------
 2152|  89.0k|      continue;
 2153|  1.57k|    const Value* pV = te->pValue();
 2154|  1.57k|    if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toInt64() & 1) == 0) {
  ------------------
  |  Branch (2154:9): [True: 1.40k, False: 176]
  |  Branch (2154:15): [True: 1.20k, False: 199]
  |  Branch (2154:47): [True: 1.13k, False: 69]
  |  Branch (2154:67): [True: 991, False: 144]
  ------------------
 2155|    991|      ret.push_back(te->group());
 2156|    991|    }
 2157|  1.57k|  }
 2158|  6.96k|  return ret;
 2159|  18.5k|}  // TiffParserWorker::findPrimaryGroups
_ZN5Exiv28Internal14TiffHeaderBaseC2EtjNS_9ByteOrderEj:
 2162|   590k|    tag_(tag), size_(size), byteOrder_(byteOrder), offset_(offset) {
 2163|   590k|}
_ZN5Exiv28Internal14TiffHeaderBase4readEPKhm:
 2165|   481k|bool TiffHeaderBase::read(const byte* pData, size_t size) {
 2166|   481k|  if (!pData || size < 8)
  ------------------
  |  Branch (2166:7): [True: 0, False: 481k]
  |  Branch (2166:17): [True: 62, False: 481k]
  ------------------
 2167|     62|    return false;
 2168|       |
 2169|   481k|  if (pData[0] == 'I' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2169:7): [True: 13.3k, False: 467k]
  |  Branch (2169:26): [True: 12.2k, False: 1.07k]
  ------------------
 2170|  12.2k|    byteOrder_ = littleEndian;
 2171|   468k|  } else if (pData[0] == 'M' && pData[0] == pData[1]) {
  ------------------
  |  Branch (2171:14): [True: 193k, False: 275k]
  |  Branch (2171:33): [True: 192k, False: 815]
  ------------------
 2172|   192k|    byteOrder_ = bigEndian;
 2173|   276k|  } else {
 2174|   276k|    return false;
 2175|   276k|  }
 2176|   204k|  uint16_t t = getUShort(pData + 2, byteOrder_);
 2177|   204k|  if (t != 444 && t != 17234 && tag_ != t)
  ------------------
  |  Branch (2177:7): [True: 204k, False: 34]
  |  Branch (2177:19): [True: 204k, False: 114]
  |  Branch (2177:33): [True: 80.6k, False: 124k]
  ------------------
 2178|  80.6k|    return false;  // 444 is for the JPEG-XR; 17234 is for DCP
 2179|   124k|  tag_ = t;
 2180|   124k|  offset_ = getULong(pData + 4, byteOrder_);
 2181|       |
 2182|   124k|  return true;
 2183|   204k|}
_ZNK5Exiv28Internal14TiffHeaderBase5writeEv:
 2185|  18.2k|DataBuf TiffHeaderBase::write() const {
 2186|  18.2k|  DataBuf buf(8);
 2187|  18.2k|  switch (byteOrder_) {
  ------------------
  |  Branch (2187:11): [True: 18.2k, False: 0]
  ------------------
 2188|  12.5k|    case littleEndian:
  ------------------
  |  Branch (2188:5): [True: 12.5k, False: 5.70k]
  ------------------
 2189|  12.5k|      buf.write_uint8(0, 'I');
 2190|  12.5k|      break;
 2191|  5.70k|    case bigEndian:
  ------------------
  |  Branch (2191:5): [True: 5.70k, False: 12.5k]
  ------------------
 2192|  5.70k|      buf.write_uint8(0, 'M');
 2193|  5.70k|      break;
 2194|      0|    case invalidByteOrder:
  ------------------
  |  Branch (2194:5): [True: 0, False: 18.2k]
  ------------------
 2195|      0|      break;
 2196|  18.2k|  }
 2197|  18.2k|  buf.write_uint8(1, buf.read_uint8(0));
 2198|  18.2k|  buf.write_uint16(2, tag_, byteOrder_);
 2199|  18.2k|  buf.write_uint32(4, 0x00000008, byteOrder_);
 2200|  18.2k|  return buf;
 2201|  18.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase9byteOrderEv:
 2219|   150k|ByteOrder TiffHeaderBase::byteOrder() const {
 2220|   150k|  return byteOrder_;
 2221|   150k|}
_ZN5Exiv28Internal14TiffHeaderBase12setByteOrderENS_9ByteOrderE:
 2223|  29.2k|void TiffHeaderBase::setByteOrder(ByteOrder byteOrder) {
 2224|  29.2k|  byteOrder_ = byteOrder;
 2225|  29.2k|}
_ZNK5Exiv28Internal14TiffHeaderBase6offsetEv:
 2227|  71.3k|uint32_t TiffHeaderBase::offset() const {
 2228|  71.3k|  return offset_;
 2229|  71.3k|}
_ZN5Exiv28Internal14TiffHeaderBase9setOffsetEj:
 2231|  12.0k|void TiffHeaderBase::setOffset(uint32_t offset) {
 2232|  12.0k|  offset_ = offset;
 2233|  12.0k|}
_ZNK5Exiv28Internal14TiffHeaderBase3tagEv:
 2239|  30.4k|uint16_t TiffHeaderBase::tag() const {
 2240|  30.4k|  return tag_;
 2241|  30.4k|}
_ZNK5Exiv28Internal14TiffHeaderBase10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2243|  1.13k|bool TiffHeaderBase::isImageTag(uint16_t /*tag*/, IfdId /*group*/, const PrimaryGroups& /*primaryGroups*/) const {
 2244|  1.13k|  return false;
 2245|  1.13k|}
_ZN5Exiv28Internal14isTiffImageTagEtNS_5IfdIdE:
 2325|  3.12M|bool isTiffImageTag(uint16_t tag, IfdId group) {
 2326|  3.12M|  const bool result = isTiffImageTagLookup(tag, group);
 2327|       |#ifdef EXIV2_DEBUG_MESSAGES
 2328|       |  if (result) {
 2329|       |    ExifKey key(tag, groupName(group));
 2330|       |    std::cerr << "Image tag: " << key << " (3)\n";
 2331|       |  } else {
 2332|       |    std::cerr << "Not an image tag: " << tag << " (4)\n";
 2333|       |  }
 2334|       |#endif
 2335|  3.12M|  return result;
 2336|  3.12M|}
_ZN5Exiv28Internal10TiffHeaderC2ENS_9ByteOrderEjb:
 2339|   394k|    TiffHeaderBase(42, 8, byteOrder, offset), hasImageTags_(hasImageTags) {
 2340|   394k|}
_ZNK5Exiv28Internal10TiffHeader10isImageTagEtNS_5IfdIdERKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEE:
 2342|  3.17M|bool TiffHeader::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const {
 2343|  3.17M|  if (!hasImageTags_) {
  ------------------
  |  Branch (2343:7): [True: 88.7k, False: 3.08M]
  ------------------
 2344|       |#ifdef EXIV2_DEBUG_MESSAGES
 2345|       |    std::cerr << "No image tags in this image\n";
 2346|       |#endif
 2347|  88.7k|    return false;
 2348|  88.7k|  }
 2349|       |#ifdef EXIV2_DEBUG_MESSAGES
 2350|       |  ExifKey key(tag, groupName(group));
 2351|       |#endif
 2352|       |  // If there are primary groups and none matches group, we're done
 2353|  3.08M|  if (!pPrimaryGroups.empty() &&
  ------------------
  |  Branch (2353:7): [True: 74.2k, False: 3.01M]
  |  Branch (2353:7): [True: 23.6k, False: 3.06M]
  ------------------
 2354|  74.2k|      std::find(pPrimaryGroups.begin(), pPrimaryGroups.end(), group) == pPrimaryGroups.end()) {
  ------------------
  |  Branch (2354:7): [True: 23.6k, False: 50.6k]
  ------------------
 2355|       |#ifdef EXIV2_DEBUG_MESSAGES
 2356|       |    std::cerr << "Not an image tag: " << key << " (1)\n";
 2357|       |#endif
 2358|  23.6k|    return false;
 2359|  23.6k|  }
 2360|       |  // All tags of marked primary groups other than IFD0 are considered
 2361|       |  // image tags. That should take care of NEFs until we know better.
 2362|  3.06M|  if (!pPrimaryGroups.empty() && group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2362:7): [True: 50.6k, False: 3.01M]
  |  Branch (2362:34): [True: 50.0k, False: 603]
  ------------------
 2363|       |#ifdef EXIV2_DEBUG_MESSAGES
 2364|       |    ExifKey key(tag, groupName(group));
 2365|       |    std::cerr << "Image tag: " << key << " (2)\n";
 2366|       |#endif
 2367|  50.0k|    return true;
 2368|  50.0k|  }
 2369|       |  // Finally, if tag, group is one of the TIFF image tags -> bingo!
 2370|  3.01M|  return isTiffImageTag(tag, group);
 2371|  3.06M|}  // TiffHeader::isImageTag
_ZN5Exiv28Internal12OffsetWriter9setOriginENS1_8OffsetIdEjNS_9ByteOrderE:
 2373|    175|void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder) {
 2374|    175|  offsetList_[id] = OffsetData{origin, 0, byteOrder};
 2375|    175|}
_ZN5Exiv28Internal12OffsetWriter9setTargetENS1_8OffsetIdEj:
 2377|     13|void OffsetWriter::setTarget(OffsetId id, uint32_t target) {
 2378|     13|  auto it = offsetList_.find(id);
 2379|     13|  if (it != offsetList_.end())
  ------------------
  |  Branch (2379:7): [True: 13, False: 0]
  ------------------
 2380|     13|    it->second.target_ = target;
 2381|     13|}
_ZNK5Exiv28Internal12OffsetWriter12writeOffsetsERNS_7BasicIoE:
 2383|    145|void OffsetWriter::writeOffsets(BasicIo& io) const {
 2384|    145|  for (const auto& [_, off] : offsetList_) {
  ------------------
  |  Branch (2384:29): [True: 145, False: 145]
  ------------------
 2385|    145|    io.seek(off.origin_, BasicIo::beg);
 2386|    145|    byte buf[4] = {0, 0, 0, 0};
 2387|    145|    l2Data(buf, off.target_, off.byteOrder_);
 2388|    145|    io.write(buf, 4);
 2389|    145|  }
 2390|    145|}
tiffimage_int.cpp:_ZN5Exiv28InternalL20isTiffImageTagLookupEtNS_5IfdIdE:
 2247|  3.12M|static bool isTiffImageTagLookup(uint16_t tag, IfdId group) {
 2248|  3.12M|  if (group != IfdId::ifd0Id) {
  ------------------
  |  Branch (2248:7): [True: 2.61M, False: 515k]
  ------------------
 2249|  2.61M|    return false;
 2250|  2.61M|  }
 2251|       |  //! List of TIFF image tags
 2252|   515k|  switch (tag) {
 2253|    706|    case 0x00fe:  // Exif.Image.NewSubfileType
  ------------------
  |  Branch (2253:5): [True: 706, False: 515k]
  ------------------
 2254|  1.89k|    case 0x00ff:  // Exif.Image.SubfileType
  ------------------
  |  Branch (2254:5): [True: 1.18k, False: 514k]
  ------------------
 2255|  12.6k|    case 0x0100:  // Exif.Image.ImageWidth
  ------------------
  |  Branch (2255:5): [True: 10.7k, False: 505k]
  ------------------
 2256|  20.3k|    case 0x0101:  // Exif.Image.ImageLength
  ------------------
  |  Branch (2256:5): [True: 7.77k, False: 508k]
  ------------------
 2257|  24.6k|    case 0x0102:  // Exif.Image.BitsPerSample
  ------------------
  |  Branch (2257:5): [True: 4.31k, False: 511k]
  ------------------
 2258|  25.4k|    case 0x0103:  // Exif.Image.Compression
  ------------------
  |  Branch (2258:5): [True: 707, False: 515k]
  ------------------
 2259|  25.8k|    case 0x0106:  // Exif.Image.PhotometricInterpretation
  ------------------
  |  Branch (2259:5): [True: 422, False: 515k]
  ------------------
 2260|  26.0k|    case 0x010a:  // Exif.Image.FillOrder
  ------------------
  |  Branch (2260:5): [True: 257, False: 515k]
  ------------------
 2261|  29.6k|    case 0x0111:  // Exif.Image.StripOffsets
  ------------------
  |  Branch (2261:5): [True: 3.57k, False: 512k]
  ------------------
 2262|  29.8k|    case 0x0115:  // Exif.Image.SamplesPerPixel
  ------------------
  |  Branch (2262:5): [True: 219, False: 515k]
  ------------------
 2263|  30.2k|    case 0x0116:  // Exif.Image.RowsPerStrip
  ------------------
  |  Branch (2263:5): [True: 423, False: 515k]
  ------------------
 2264|  33.9k|    case 0x0117:  // Exif.Image.StripByteCounts
  ------------------
  |  Branch (2264:5): [True: 3.66k, False: 512k]
  ------------------
 2265|  34.3k|    case 0x011a:  // Exif.Image.XResolution
  ------------------
  |  Branch (2265:5): [True: 424, False: 515k]
  ------------------
 2266|  34.8k|    case 0x011b:  // Exif.Image.YResolution
  ------------------
  |  Branch (2266:5): [True: 436, False: 515k]
  ------------------
 2267|  35.2k|    case 0x011c:  // Exif.Image.PlanarConfiguration
  ------------------
  |  Branch (2267:5): [True: 447, False: 515k]
  ------------------
 2268|  35.3k|    case 0x0122:  // Exif.Image.GrayResponseUnit
  ------------------
  |  Branch (2268:5): [True: 85, False: 515k]
  ------------------
 2269|  35.4k|    case 0x0123:  // Exif.Image.GrayResponseCurve
  ------------------
  |  Branch (2269:5): [True: 109, False: 515k]
  ------------------
 2270|  35.6k|    case 0x0124:  // Exif.Image.T4Options
  ------------------
  |  Branch (2270:5): [True: 196, False: 515k]
  ------------------
 2271|  36.3k|    case 0x0125:  // Exif.Image.T6Options
  ------------------
  |  Branch (2271:5): [True: 650, False: 515k]
  ------------------
 2272|  36.6k|    case 0x0128:  // Exif.Image.ResolutionUnit
  ------------------
  |  Branch (2272:5): [True: 359, False: 515k]
  ------------------
 2273|  36.9k|    case 0x0129:  // Exif.Image.PageNumber
  ------------------
  |  Branch (2273:5): [True: 276, False: 515k]
  ------------------
 2274|  37.1k|    case 0x012d:  // Exif.Image.TransferFunction
  ------------------
  |  Branch (2274:5): [True: 195, False: 515k]
  ------------------
 2275|  37.3k|    case 0x013d:  // Exif.Image.Predictor
  ------------------
  |  Branch (2275:5): [True: 174, False: 515k]
  ------------------
 2276|  37.5k|    case 0x013e:  // Exif.Image.WhitePoint
  ------------------
  |  Branch (2276:5): [True: 273, False: 515k]
  ------------------
 2277|  37.9k|    case 0x013f:  // Exif.Image.PrimaryChromaticities
  ------------------
  |  Branch (2277:5): [True: 331, False: 515k]
  ------------------
 2278|  38.1k|    case 0x0140:  // Exif.Image.ColorMap
  ------------------
  |  Branch (2278:5): [True: 263, False: 515k]
  ------------------
 2279|  38.2k|    case 0x0141:  // Exif.Image.HalftoneHints
  ------------------
  |  Branch (2279:5): [True: 112, False: 515k]
  ------------------
 2280|  38.4k|    case 0x0142:  // Exif.Image.TileWidth
  ------------------
  |  Branch (2280:5): [True: 207, False: 515k]
  ------------------
 2281|  38.5k|    case 0x0143:  // Exif.Image.TileLength
  ------------------
  |  Branch (2281:5): [True: 94, False: 515k]
  ------------------
 2282|  39.0k|    case 0x0144:  // Exif.Image.TileOffsets
  ------------------
  |  Branch (2282:5): [True: 455, False: 515k]
  ------------------
 2283|  40.3k|    case 0x0145:  // Exif.Image.TileByteCounts
  ------------------
  |  Branch (2283:5): [True: 1.33k, False: 514k]
  ------------------
 2284|  40.4k|    case 0x014c:  // Exif.Image.InkSet
  ------------------
  |  Branch (2284:5): [True: 79, False: 515k]
  ------------------
 2285|  40.7k|    case 0x014d:  // Exif.Image.InkNames
  ------------------
  |  Branch (2285:5): [True: 325, False: 515k]
  ------------------
 2286|  40.8k|    case 0x014e:  // Exif.Image.NumberOfInks
  ------------------
  |  Branch (2286:5): [True: 102, False: 515k]
  ------------------
 2287|  41.1k|    case 0x0150:  // Exif.Image.DotRange
  ------------------
  |  Branch (2287:5): [True: 276, False: 515k]
  ------------------
 2288|  41.2k|    case 0x0151:  // Exif.Image.TargetPrinter
  ------------------
  |  Branch (2288:5): [True: 135, False: 515k]
  ------------------
 2289|  41.5k|    case 0x0152:  // Exif.Image.ExtraSamples
  ------------------
  |  Branch (2289:5): [True: 208, False: 515k]
  ------------------
 2290|  41.6k|    case 0x0153:  // Exif.Image.SampleFormat
  ------------------
  |  Branch (2290:5): [True: 131, False: 515k]
  ------------------
 2291|  41.6k|    case 0x0154:  // Exif.Image.SMinSampleValue
  ------------------
  |  Branch (2291:5): [True: 47, False: 515k]
  ------------------
 2292|  41.9k|    case 0x0155:  // Exif.Image.SMaxSampleValue
  ------------------
  |  Branch (2292:5): [True: 306, False: 515k]
  ------------------
 2293|  42.0k|    case 0x0156:  // Exif.Image.TransferRange
  ------------------
  |  Branch (2293:5): [True: 94, False: 515k]
  ------------------
 2294|  42.1k|    case 0x0157:  // Exif.Image.ClipPath
  ------------------
  |  Branch (2294:5): [True: 90, False: 515k]
  ------------------
 2295|  42.3k|    case 0x0158:  // Exif.Image.XClipPathUnits
  ------------------
  |  Branch (2295:5): [True: 171, False: 515k]
  ------------------
 2296|  42.5k|    case 0x0159:  // Exif.Image.YClipPathUnits
  ------------------
  |  Branch (2296:5): [True: 209, False: 515k]
  ------------------
 2297|  42.8k|    case 0x015a:  // Exif.Image.Indexed
  ------------------
  |  Branch (2297:5): [True: 268, False: 515k]
  ------------------
 2298|  42.9k|    case 0x015b:  // Exif.Image.JPEGTables
  ------------------
  |  Branch (2298:5): [True: 86, False: 515k]
  ------------------
 2299|  44.4k|    case 0x0200:  // Exif.Image.JPEGProc
  ------------------
  |  Branch (2299:5): [True: 1.56k, False: 514k]
  ------------------
 2300|  52.8k|    case 0x0201:  // Exif.Image.JPEGInterchangeFormat
  ------------------
  |  Branch (2300:5): [True: 8.42k, False: 507k]
  ------------------
 2301|  64.0k|    case 0x0202:  // Exif.Image.JPEGInterchangeFormatLength
  ------------------
  |  Branch (2301:5): [True: 11.1k, False: 504k]
  ------------------
 2302|  64.4k|    case 0x0203:  // Exif.Image.JPEGRestartInterval
  ------------------
  |  Branch (2302:5): [True: 329, False: 515k]
  ------------------
 2303|  64.4k|    case 0x0205:  // Exif.Image.JPEGLosslessPredictors
  ------------------
  |  Branch (2303:5): [True: 81, False: 515k]
  ------------------
 2304|  64.7k|    case 0x0206:  // Exif.Image.JPEGPointTransforms
  ------------------
  |  Branch (2304:5): [True: 266, False: 515k]
  ------------------
 2305|  64.8k|    case 0x0207:  // Exif.Image.JPEGQTables
  ------------------
  |  Branch (2305:5): [True: 83, False: 515k]
  ------------------
 2306|  65.0k|    case 0x0208:  // Exif.Image.JPEGDCTables
  ------------------
  |  Branch (2306:5): [True: 217, False: 515k]
  ------------------
 2307|  65.2k|    case 0x0209:  // Exif.Image.JPEGACTables
  ------------------
  |  Branch (2307:5): [True: 148, False: 515k]
  ------------------
 2308|  65.4k|    case 0x0211:  // Exif.Image.YCbCrCoefficients
  ------------------
  |  Branch (2308:5): [True: 203, False: 515k]
  ------------------
 2309|  65.7k|    case 0x0212:  // Exif.Image.YCbCrSubSampling
  ------------------
  |  Branch (2309:5): [True: 292, False: 515k]
  ------------------
 2310|  65.7k|    case 0x0213:  // Exif.Image.YCbCrPositioning
  ------------------
  |  Branch (2310:5): [True: 73, False: 515k]
  ------------------
 2311|  66.0k|    case 0x0214:  // Exif.Image.ReferenceBlackWhite
  ------------------
  |  Branch (2311:5): [True: 286, False: 515k]
  ------------------
 2312|  66.2k|    case 0x828d:  // Exif.Image.CFARepeatPatternDim
  ------------------
  |  Branch (2312:5): [True: 204, False: 515k]
  ------------------
 2313|  66.3k|    case 0x828e:  // Exif.Image.CFAPattern
  ------------------
  |  Branch (2313:5): [True: 35, False: 515k]
  ------------------
 2314|       |    // case 0x8773:  // Exif.Image.InterColorProfile
 2315|  66.3k|    case 0x8824:  // Exif.Image.SpectralSensitivity
  ------------------
  |  Branch (2315:5): [True: 76, False: 515k]
  ------------------
 2316|  66.4k|    case 0x8828:  // Exif.Image.OECF
  ------------------
  |  Branch (2316:5): [True: 66, False: 515k]
  ------------------
 2317|  66.5k|    case 0x9102:  // Exif.Image.CompressedBitsPerPixel
  ------------------
  |  Branch (2317:5): [True: 136, False: 515k]
  ------------------
 2318|  66.6k|    case 0x9217:  // Exif.Image.SensingMethod
  ------------------
  |  Branch (2318:5): [True: 68, False: 515k]
  ------------------
 2319|  66.6k|      return true;
 2320|   449k|    default:
  ------------------
  |  Branch (2320:5): [True: 449k, False: 66.6k]
  ------------------
 2321|   449k|      return false;
 2322|   515k|  }
 2323|   515k|}

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

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

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

_ZN5Exiv28TypeInfo8typeSizeENS_6TypeIdE:
   96|  11.3M|size_t TypeInfo::typeSize(TypeId typeId) {
   97|  11.3M|  if (auto tit = Exiv2::find(typeInfoTable, typeId))
  ------------------
  |  Branch (97:12): [True: 6.92M, False: 4.46M]
  ------------------
   98|  6.92M|    return tit->size_;
   99|  4.46M|  return 0;
  100|  11.3M|}
_ZN5Exiv27DataBufC2Em:
  102|  6.62M|DataBuf::DataBuf(size_t size) : pData_(size) {
  103|  6.62M|}
_ZN5Exiv27DataBufC2EPKhm:
  105|  92.6k|DataBuf::DataBuf(const byte* pData, size_t size) : pData_(pData, pData + size) {
  106|  92.6k|}
_ZN5Exiv27DataBuf5allocEm:
  108|  35.7k|void DataBuf::alloc(size_t size) {
  109|  35.7k|  pData_.resize(size);
  110|  35.7k|}
_ZN5Exiv27DataBuf6resizeEm:
  112|   138k|void DataBuf::resize(size_t size) {
  113|   138k|  pData_.resize(size);
  114|   138k|}
_ZN5Exiv27DataBuf5resetEv:
  116|  56.2k|void DataBuf::reset() {
  117|  56.2k|  pData_.clear();
  118|  56.2k|}
_ZNK5Exiv27DataBuf10read_uint8Em:
  120|  2.85M|uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
  121|  2.85M|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (121:7): [True: 0, False: 2.85M]
  ------------------
  122|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint8");
  123|      0|  }
  124|  2.85M|  return pData_[offset];
  125|  2.85M|}
_ZN5Exiv27DataBuf11write_uint8Emh:
  127|   871k|void Exiv2::DataBuf::write_uint8(size_t offset, uint8_t x) {
  128|   871k|  if (offset >= pData_.size()) {
  ------------------
  |  Branch (128:7): [True: 0, False: 871k]
  ------------------
  129|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint8");
  130|      0|  }
  131|   871k|  pData_[offset] = x;
  132|   871k|}
_ZNK5Exiv27DataBuf11read_uint16EmNS_9ByteOrderE:
  134|   474k|uint16_t Exiv2::DataBuf::read_uint16(size_t offset, ByteOrder byteOrder) const {
  135|   474k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 474k]
  |  Branch (135:28): [True: 2, False: 474k]
  ------------------
  136|      2|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint16");
  137|      2|  }
  138|   474k|  return getUShort(&pData_[offset], byteOrder);
  139|   474k|}
_ZN5Exiv27DataBuf12write_uint16EmtNS_9ByteOrderE:
  141|  18.5k|void Exiv2::DataBuf::write_uint16(size_t offset, uint16_t x, ByteOrder byteOrder) {
  142|  18.5k|  if (pData_.size() < 2 || offset > (pData_.size() - 2)) {
  ------------------
  |  Branch (142:7): [True: 0, False: 18.5k]
  |  Branch (142:28): [True: 0, False: 18.5k]
  ------------------
  143|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint16");
  144|      0|  }
  145|  18.5k|  us2Data(&pData_[offset], x, byteOrder);
  146|  18.5k|}
_ZNK5Exiv27DataBuf11read_uint32EmNS_9ByteOrderE:
  148|   412k|uint32_t Exiv2::DataBuf::read_uint32(size_t offset, ByteOrder byteOrder) const {
  149|   412k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (149:7): [True: 1, False: 412k]
  |  Branch (149:28): [True: 2, False: 412k]
  ------------------
  150|      3|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint32");
  151|      3|  }
  152|   412k|  return getULong(&pData_[offset], byteOrder);
  153|   412k|}
_ZN5Exiv27DataBuf12write_uint32EmjNS_9ByteOrderE:
  155|  18.5k|void Exiv2::DataBuf::write_uint32(size_t offset, uint32_t x, ByteOrder byteOrder) {
  156|  18.5k|  if (pData_.size() < 4 || offset > (pData_.size() - 4)) {
  ------------------
  |  Branch (156:7): [True: 0, False: 18.5k]
  |  Branch (156:28): [True: 0, False: 18.5k]
  ------------------
  157|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::write_uint32");
  158|      0|  }
  159|  18.5k|  ul2Data(&pData_[offset], x, byteOrder);
  160|  18.5k|}
_ZNK5Exiv27DataBuf11read_uint64EmNS_9ByteOrderE:
  162|  11.7k|uint64_t Exiv2::DataBuf::read_uint64(size_t offset, ByteOrder byteOrder) const {
  163|  11.7k|  if (pData_.size() < 8 || offset > (pData_.size() - 8)) {
  ------------------
  |  Branch (163:7): [True: 0, False: 11.7k]
  |  Branch (163:28): [True: 0, False: 11.7k]
  ------------------
  164|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::read_uint64");
  165|      0|  }
  166|  11.7k|  return getULongLong(&pData_[offset], byteOrder);
  167|  11.7k|}
_ZNK5Exiv27DataBuf8cmpBytesEmPKvm:
  176|   566k|int Exiv2::DataBuf::cmpBytes(size_t offset, const void* buf, size_t bufsize) const {
  177|   566k|  if (pData_.size() < bufsize || offset > pData_.size() - bufsize) {
  ------------------
  |  Branch (177:7): [True: 0, False: 566k]
  |  Branch (177:34): [True: 0, False: 566k]
  ------------------
  178|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::cmpBytes");
  179|      0|  }
  180|   566k|  return memcmp(&pData_[offset], buf, bufsize);
  181|   566k|}
_ZN5Exiv27DataBuf4dataEm:
  183|  7.00M|byte* Exiv2::DataBuf::data(size_t offset) {
  184|  7.00M|  return const_cast<byte*>(c_data(offset));
  185|  7.00M|}
_ZNK5Exiv27DataBuf6c_dataEm:
  187|  9.81M|const byte* Exiv2::DataBuf::c_data(size_t offset) const {
  188|  9.81M|  if (pData_.empty() || offset == pData_.size()) {
  ------------------
  |  Branch (188:7): [True: 1.45M, False: 8.36M]
  |  Branch (188:25): [True: 9.92k, False: 8.35M]
  ------------------
  189|  1.46M|    return nullptr;
  190|  1.46M|  }
  191|  8.35M|  if (offset > pData_.size()) {
  ------------------
  |  Branch (191:7): [True: 0, False: 8.35M]
  ------------------
  192|      0|    throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
  193|      0|  }
  194|  8.35M|  return &pData_[offset];
  195|  8.35M|}
_ZNK5Exiv27DataBuf5c_strEm:
  197|  71.6k|const char* Exiv2::DataBuf::c_str(size_t offset) const {
  198|  71.6k|  return reinterpret_cast<const char*>(c_data(offset));
  199|  71.6k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIiiEE:
  220|  11.3k|std::ostream& operator<<(std::ostream& os, const Rational& r) {
  221|  11.3k|  return os << r.first << "/" << r.second;
  222|  11.3k|}
_ZN5Exiv2lsERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEERKNS0_4pairIjjEE:
  249|  9.96k|std::ostream& operator<<(std::ostream& os, const URational& r) {
  250|  9.96k|  return os << r.first << "/" << r.second;
  251|  9.96k|}
_ZN5Exiv29getUShortEPKhNS_9ByteOrderE:
  257|  54.2M|uint16_t getUShort(const byte* buf, ByteOrder byteOrder) {
  258|  54.2M|  return getUShort(makeSliceUntil(buf, 2), byteOrder);
  259|  54.2M|}
_ZN5Exiv28getULongEPKhNS_9ByteOrderE:
  261|  54.0M|uint32_t getULong(const byte* buf, ByteOrder byteOrder) {
  262|  54.0M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (262:7): [True: 677k, False: 53.3M]
  ------------------
  263|   677k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  264|   677k|  }
  265|  53.3M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  266|  54.0M|}
_ZN5Exiv212getULongLongEPKhNS_9ByteOrderE:
  268|  55.6k|uint64_t getULongLong(const byte* buf, ByteOrder byteOrder) {
  269|  55.6k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (269:7): [True: 11.3k, False: 44.2k]
  ------------------
  270|  11.3k|    return static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  271|  11.3k|           static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  272|  11.3k|           static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  273|  11.3k|           static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]);
  274|  11.3k|  }
  275|  44.2k|  return static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  276|  44.2k|         static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  277|  44.2k|         static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  278|  44.2k|         static_cast<uint64_t>(buf[6]) << 8 | static_cast<uint64_t>(buf[7]);
  279|  55.6k|}
_ZN5Exiv212getURationalEPKhNS_9ByteOrderE:
  281|   549k|URational getURational(const byte* buf, ByteOrder byteOrder) {
  282|   549k|  uint32_t nominator = getULong(buf, byteOrder);
  283|   549k|  uint32_t denominator = getULong(buf + 4, byteOrder);
  284|   549k|  return {nominator, denominator};
  285|   549k|}
_ZN5Exiv28getShortEPKhNS_9ByteOrderE:
  287|  1.53M|int16_t getShort(const byte* buf, ByteOrder byteOrder) {
  288|  1.53M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (288:7): [True: 661k, False: 871k]
  ------------------
  289|   661k|    return buf[1] << 8 | buf[0];
  290|   661k|  }
  291|   871k|  return buf[0] << 8 | buf[1];
  292|  1.53M|}
_ZN5Exiv27getLongEPKhNS_9ByteOrderE:
  294|  1.27M|int32_t getLong(const byte* buf, ByteOrder byteOrder) {
  295|  1.27M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (295:7): [True: 8.55k, False: 1.26M]
  ------------------
  296|  8.55k|    return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
  297|  8.55k|  }
  298|  1.26M|  return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  299|  1.27M|}
_ZN5Exiv211getRationalEPKhNS_9ByteOrderE:
  301|   479k|Rational getRational(const byte* buf, ByteOrder byteOrder) {
  302|   479k|  int32_t nominator = getLong(buf, byteOrder);
  303|   479k|  int32_t denominator = getLong(buf + 4, byteOrder);
  304|   479k|  return {nominator, denominator};
  305|   479k|}
_ZN5Exiv28getFloatEPKhNS_9ByteOrderE:
  307|   263k|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|   263k|#ifdef __cpp_lib_bit_cast
  312|   263k|  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|   263k|}
_ZN5Exiv29getDoubleEPKhNS_9ByteOrderE:
  323|   538k|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|   538k|#ifdef __cpp_lib_bit_cast
  328|   538k|  if (byteOrder == littleEndian)
  ------------------
  |  Branch (328:7): [True: 153k, False: 384k]
  ------------------
  329|   153k|    return std::bit_cast<double>(static_cast<uint64_t>(buf[7]) << 56 | static_cast<uint64_t>(buf[6]) << 48 |
  330|   153k|                                 static_cast<uint64_t>(buf[5]) << 40 | static_cast<uint64_t>(buf[4]) << 32 |
  331|   153k|                                 static_cast<uint64_t>(buf[3]) << 24 | static_cast<uint64_t>(buf[2]) << 16 |
  332|   153k|                                 static_cast<uint64_t>(buf[1]) << 8 | static_cast<uint64_t>(buf[0]));
  333|   384k|  return std::bit_cast<double>(static_cast<uint64_t>(buf[0]) << 56 | static_cast<uint64_t>(buf[1]) << 48 |
  334|   384k|                               static_cast<uint64_t>(buf[2]) << 40 | static_cast<uint64_t>(buf[3]) << 32 |
  335|   384k|                               static_cast<uint64_t>(buf[4]) << 24 | static_cast<uint64_t>(buf[5]) << 16 |
  336|   384k|                               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|   538k|}
_ZN5Exiv27us2DataEPhtNS_9ByteOrderE:
  358|  5.34M|size_t us2Data(byte* buf, uint16_t s, ByteOrder byteOrder) {
  359|  5.34M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (359:7): [True: 2.96M, False: 2.37M]
  ------------------
  360|  2.96M|    buf[0] = static_cast<byte>(s & 0x00ffU);
  361|  2.96M|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  362|  2.96M|  } else {
  363|  2.37M|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  364|  2.37M|    buf[1] = static_cast<byte>(s & 0x00ffU);
  365|  2.37M|  }
  366|  5.34M|  return 2;
  367|  5.34M|}
_ZN5Exiv27ul2DataEPhjNS_9ByteOrderE:
  369|  4.86M|size_t ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder) {
  370|  4.86M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (370:7): [True: 1.88M, False: 2.97M]
  ------------------
  371|  1.88M|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  372|  1.88M|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  373|  1.88M|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  374|  1.88M|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  375|  2.97M|  } else {
  376|  2.97M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  377|  2.97M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  378|  2.97M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  379|  2.97M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  380|  2.97M|  }
  381|  4.86M|  return 4;
  382|  4.86M|}
_ZN5Exiv27ur2DataEPhNSt3__14pairIjjEENS_9ByteOrderE:
  399|   552k|size_t ur2Data(byte* buf, URational l, ByteOrder byteOrder) {
  400|   552k|  size_t o = ul2Data(buf, l.first, byteOrder);
  401|   552k|  o += ul2Data(buf + o, l.second, byteOrder);
  402|   552k|  return o;
  403|   552k|}
_ZN5Exiv26s2DataEPhsNS_9ByteOrderE:
  405|   650k|size_t s2Data(byte* buf, int16_t s, ByteOrder byteOrder) {
  406|   650k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (406:7): [True: 395k, False: 255k]
  ------------------
  407|   395k|    buf[0] = static_cast<byte>(s & 0x00ffU);
  408|   395k|    buf[1] = static_cast<byte>((s & 0xff00U) >> 8);
  409|   395k|  } else {
  410|   255k|    buf[0] = static_cast<byte>((s & 0xff00U) >> 8);
  411|   255k|    buf[1] = static_cast<byte>(s & 0x00ffU);
  412|   255k|  }
  413|   650k|  return 2;
  414|   650k|}
_ZN5Exiv26l2DataEPhiNS_9ByteOrderE:
  416|  1.16M|size_t l2Data(byte* buf, int32_t l, ByteOrder byteOrder) {
  417|  1.16M|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (417:7): [True: 96.0k, False: 1.07M]
  ------------------
  418|  96.0k|    buf[0] = static_cast<byte>(l & 0x000000ffU);
  419|  96.0k|    buf[1] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  420|  96.0k|    buf[2] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  421|  96.0k|    buf[3] = static_cast<byte>((l & 0xff000000U) >> 24);
  422|  1.07M|  } else {
  423|  1.07M|    buf[0] = static_cast<byte>((l & 0xff000000U) >> 24);
  424|  1.07M|    buf[1] = static_cast<byte>((l & 0x00ff0000U) >> 16);
  425|  1.07M|    buf[2] = static_cast<byte>((l & 0x0000ff00U) >> 8);
  426|  1.07M|    buf[3] = static_cast<byte>(l & 0x000000ffU);
  427|  1.07M|  }
  428|  1.16M|  return 4;
  429|  1.16M|}
_ZN5Exiv26r2DataEPhNSt3__14pairIiiEENS_9ByteOrderE:
  431|   472k|size_t r2Data(byte* buf, Rational l, ByteOrder byteOrder) {
  432|   472k|  size_t o = l2Data(buf, l.first, byteOrder);
  433|   472k|  o += l2Data(buf + o, l.second, byteOrder);
  434|   472k|  return o;
  435|   472k|}
_ZN5Exiv26f2DataEPhfNS_9ByteOrderE:
  437|   227k|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|   227k|#ifdef __cpp_lib_bit_cast
  442|   227k|  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|   227k|}
_ZN5Exiv26d2DataEPhdNS_9ByteOrderE:
  453|   183k|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|   183k|  union {
  458|   183k|    uint64_t ull_;
  459|   183k|    double d_;
  460|   183k|  } u;
  461|   183k|  u.d_ = d;
  462|   183k|  uint64_t m = 0xff;
  463|   183k|  if (byteOrder == littleEndian) {
  ------------------
  |  Branch (463:7): [True: 175k, False: 8.43k]
  ------------------
  464|   175k|    buf[0] = static_cast<byte>(u.ull_ & m);
  465|   175k|    buf[1] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  466|   175k|    buf[2] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  467|   175k|    buf[3] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  468|   175k|    buf[4] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  469|   175k|    buf[5] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  470|   175k|    buf[6] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  471|   175k|    buf[7] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  472|   175k|  } else {
  473|  8.43k|    buf[0] = static_cast<byte>((u.ull_ & (m << 56)) >> 56);
  474|  8.43k|    buf[1] = static_cast<byte>((u.ull_ & (m << 48)) >> 48);
  475|  8.43k|    buf[2] = static_cast<byte>((u.ull_ & (m << 40)) >> 40);
  476|  8.43k|    buf[3] = static_cast<byte>((u.ull_ & (m << 32)) >> 32);
  477|  8.43k|    buf[4] = static_cast<byte>((u.ull_ & (m << 24)) >> 24);
  478|  8.43k|    buf[5] = static_cast<byte>((u.ull_ & (m << 16)) >> 16);
  479|  8.43k|    buf[6] = static_cast<byte>((u.ull_ & (m << 8)) >> 8);
  480|  8.43k|    buf[7] = static_cast<byte>(u.ull_ & m);
  481|  8.43k|  }
  482|   183k|  return 8;
  483|   183k|}
_ZN5Exiv25isHexERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmS8_:
  512|   165k|bool isHex(const std::string& str, size_t size, const std::string& prefix) {
  513|   165k|  if (!str.starts_with(prefix))
  ------------------
  |  Branch (513:7): [True: 0, False: 165k]
  ------------------
  514|      0|    return false;
  515|   165k|  if (size > 0 && str.size() != size + prefix.size())
  ------------------
  |  Branch (515:7): [True: 165k, False: 0]
  |  Branch (515:19): [True: 0, False: 165k]
  ------------------
  516|      0|    return false;
  517|       |
  518|   165k|  return std::all_of(str.begin() + prefix.size(), str.end(), ::isxdigit);
  519|   165k|}  // isHex
_ZN5Exiv28exifTimeEPKcP2tm:
  521|     11|int exifTime(const char* buf, tm* tm) {
  522|     11|  int rc = 1;
  523|     11|  int year = 0;
  524|     11|  int mon = 0;
  525|     11|  int mday = 0;
  526|     11|  int hour = 0;
  527|     11|  int min = 0;
  528|     11|  int sec = 0;
  529|     11|  if (std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d", &year, &mon, &mday, &hour, &min, &sec) == 6) {
  ------------------
  |  Branch (529:7): [True: 8, False: 3]
  ------------------
  530|      8|    tm->tm_year = year - 1900;
  531|      8|    tm->tm_mon = mon - 1;
  532|      8|    tm->tm_mday = mday;
  533|      8|    tm->tm_hour = hour;
  534|      8|    tm->tm_min = min;
  535|      8|    tm->tm_sec = sec;
  536|      8|    rc = 0;
  537|      8|  }
  538|     11|  return rc;
  539|     11|}  // exifTime
_ZN5Exiv219floatToRationalCastEf:
  667|    253|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|    253|  const double d = f;
  672|       |  // Beware: primitive conversion algorithm
  673|    253|  int32_t den;
  674|    253|  if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 1000000) {
  ------------------
  |  Branch (674:7): [True: 131, False: 122]
  ------------------
  675|    131|    den = 1000000;
  676|    131|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 10000) {
  ------------------
  |  Branch (676:14): [True: 32, False: 90]
  ------------------
  677|     32|    den = 10000;
  678|     90|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max() / 100) {
  ------------------
  |  Branch (678:14): [True: 28, False: 62]
  ------------------
  679|     28|    den = 100;
  680|     62|  } else if (std::fabs(d) <= std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (680:14): [True: 10, False: 52]
  ------------------
  681|     10|    den = 1;
  682|     52|  } else {
  683|     52|    return {d > 0 ? 1 : -1, 0};
  ------------------
  |  Branch (683:13): [True: 52, False: 0]
  ------------------
  684|     52|  }
  685|    201|  const auto nom = static_cast<int32_t>(std::lround(d * den));
  686|    201|  const int32_t g = std::gcd(nom, den);
  687|       |
  688|    201|  return {nom / g, den / g};
  689|    253|}
types.cpp:_ZNK12_GLOBAL__N_113TypeInfoTableeqEN5Exiv26TypeIdE:
   44|   131M|  bool operator==(Exiv2::TypeId typeId) const {
   45|   131M|    return typeId_ == typeId;
   46|   131M|  }

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

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

_ZN5Exiv25ValueC2ENS_6TypeIdE:
   20|  5.49M|Value::Value(TypeId typeId) : type_(typeId) {
   21|  5.49M|}
_ZN5Exiv25Value6createENS_6TypeIdE:
   23|  4.28M|Value::UniquePtr Value::create(TypeId typeId) {
   24|  4.28M|  switch (typeId) {
   25|      0|    case invalidTypeId:
  ------------------
  |  Branch (25:5): [True: 0, False: 4.28M]
  ------------------
   26|  4.53k|    case signedByte:
  ------------------
  |  Branch (26:5): [True: 4.53k, False: 4.28M]
  ------------------
   27|  1.65M|    case unsignedByte:
  ------------------
  |  Branch (27:5): [True: 1.64M, False: 2.63M]
  ------------------
   28|  1.65M|      return std::make_unique<DataValue>(typeId);
   29|  55.9k|    case asciiString:
  ------------------
  |  Branch (29:5): [True: 55.9k, False: 4.22M]
  ------------------
   30|  55.9k|      return std::make_unique<AsciiValue>();
   31|   148k|    case unsignedShort:
  ------------------
  |  Branch (31:5): [True: 148k, False: 4.13M]
  ------------------
   32|   148k|      return std::make_unique<ValueType<uint16_t>>();
   33|  63.3k|    case unsignedLong:
  ------------------
  |  Branch (33:5): [True: 63.3k, False: 4.22M]
  ------------------
   34|  85.9k|    case tiffIfd:
  ------------------
  |  Branch (34:5): [True: 22.5k, False: 4.26M]
  ------------------
   35|  85.9k|      return std::make_unique<ValueType<uint32_t>>(typeId);
   36|  14.0k|    case unsignedRational:
  ------------------
  |  Branch (36:5): [True: 14.0k, False: 4.27M]
  ------------------
   37|  14.0k|      return std::make_unique<ValueType<URational>>();
   38|  68.6k|    case undefined:
  ------------------
  |  Branch (38:5): [True: 68.6k, False: 4.21M]
  ------------------
   39|  68.6k|      return std::make_unique<DataValue>();
   40|  51.7k|    case signedShort:
  ------------------
  |  Branch (40:5): [True: 51.7k, False: 4.23M]
  ------------------
   41|  51.7k|      return std::make_unique<ValueType<int16_t>>();
   42|  44.8k|    case signedLong:
  ------------------
  |  Branch (42:5): [True: 44.8k, False: 4.24M]
  ------------------
   43|  44.8k|      return std::make_unique<ValueType<int32_t>>();
   44|  16.7k|    case signedRational:
  ------------------
  |  Branch (44:5): [True: 16.7k, False: 4.26M]
  ------------------
   45|  16.7k|      return std::make_unique<ValueType<Rational>>();
   46|  9.05k|    case tiffFloat:
  ------------------
  |  Branch (46:5): [True: 9.05k, False: 4.27M]
  ------------------
   47|  9.05k|      return std::make_unique<ValueType<float>>();
   48|  16.5k|    case tiffDouble:
  ------------------
  |  Branch (48:5): [True: 16.5k, False: 4.26M]
  ------------------
   49|  16.5k|      return std::make_unique<ValueType<double>>();
   50|  46.3k|    case string:
  ------------------
  |  Branch (50:5): [True: 46.3k, False: 4.23M]
  ------------------
   51|  46.3k|      return std::make_unique<StringValue>();
   52|  7.10k|    case date:
  ------------------
  |  Branch (52:5): [True: 7.10k, False: 4.27M]
  ------------------
   53|  7.10k|      return std::make_unique<DateValue>();
   54|  11.0k|    case time:
  ------------------
  |  Branch (54:5): [True: 11.0k, False: 4.27M]
  ------------------
   55|  11.0k|      return std::make_unique<TimeValue>();
   56|  6.44k|    case comment:
  ------------------
  |  Branch (56:5): [True: 6.44k, False: 4.27M]
  ------------------
   57|  6.44k|      return std::make_unique<CommentValue>();
   58|  65.3k|    case xmpText:
  ------------------
  |  Branch (58:5): [True: 65.3k, False: 4.21M]
  ------------------
   59|  65.3k|      return std::make_unique<XmpTextValue>();
   60|      7|    case xmpBag:
  ------------------
  |  Branch (60:5): [True: 7, False: 4.28M]
  ------------------
   61|  3.94k|    case xmpSeq:
  ------------------
  |  Branch (61:5): [True: 3.93k, False: 4.28M]
  ------------------
   62|  3.94k|    case xmpAlt:
  ------------------
  |  Branch (62:5): [True: 0, False: 4.28M]
  ------------------
   63|  3.94k|      return std::make_unique<XmpArrayValue>(typeId);
   64|    591|    case langAlt:
  ------------------
  |  Branch (64:5): [True: 591, False: 4.28M]
  ------------------
   65|    591|      return std::make_unique<LangAltValue>();
   66|  1.97M|    default:
  ------------------
  |  Branch (66:5): [True: 1.97M, False: 2.30M]
  ------------------
   67|  1.97M|      return std::make_unique<DataValue>(typeId);
   68|  4.28M|  }
   69|  4.28M|}  // Value::create
_ZN5Exiv25Value11setDataAreaEPKhm:
   71|  1.08k|int Value::setDataArea(const byte* /*buf*/, size_t /*len*/) {
   72|  1.08k|  return -1;
   73|  1.08k|}
_ZNK5Exiv25Value8toStringEv:
   75|   307k|std::string Value::toString() const {
   76|   307k|  std::ostringstream os;
   77|   307k|  write(os);
   78|   307k|  ok_ = !os.fail();
   79|   307k|  return os.str();
   80|   307k|}
_ZNK5Exiv25Value8toStringEm:
   82|   244k|std::string Value::toString(size_t /*n*/) const {
   83|   244k|  return toString();
   84|   244k|}
_ZNK5Exiv25Value12sizeDataAreaEv:
   86|  38.9k|size_t Value::sizeDataArea() const {
   87|  38.9k|  return 0;
   88|  38.9k|}
_ZNK5Exiv25Value8dataAreaEv:
   90|  3.31k|DataBuf Value::dataArea() const {
   91|  3.31k|  return {nullptr, 0};
   92|  3.31k|}
_ZN5Exiv29DataValueC2ENS_6TypeIdE:
   94|  3.70M|DataValue::DataValue(TypeId typeId) : Value(typeId) {
   95|  3.70M|}
_ZN5Exiv29DataValueC2EPKhmNS_9ByteOrderENS_6TypeIdE:
   97|     14|DataValue::DataValue(const byte* buf, size_t len, ByteOrder byteOrder, TypeId typeId) : Value(typeId) {
   98|     14|  read(buf, len, byteOrder);
   99|     14|}
_ZNK5Exiv29DataValue5countEv:
  101|  14.4M|size_t DataValue::count() const {
  102|  14.4M|  return size();
  103|  14.4M|}
_ZN5Exiv29DataValue4readEPKhmNS_9ByteOrderE:
  105|  3.70M|int DataValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  106|       |  // byteOrder not needed
  107|  3.70M|  value_.assign(buf, buf + len);
  108|  3.70M|  return 0;
  109|  3.70M|}
_ZNK5Exiv29DataValue4copyEPhNS_9ByteOrderE:
  123|  3.71M|size_t DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  124|       |  // byteOrder not needed
  125|  3.71M|  return std::copy(value_.begin(), value_.end(), buf) - buf;
  126|  3.71M|}
_ZNK5Exiv29DataValue4sizeEv:
  128|  28.1M|size_t DataValue::size() const {
  129|  28.1M|  return value_.size();
  130|  28.1M|}
_ZNK5Exiv29DataValue6clone_Ev:
  132|  12.9M|DataValue* DataValue::clone_() const {
  133|  12.9M|  return new DataValue(*this);
  134|  12.9M|}
_ZNK5Exiv29DataValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  136|  3.23k|std::ostream& DataValue::write(std::ostream& os) const {
  137|  3.23k|  if (!value_.empty()) {
  ------------------
  |  Branch (137:7): [True: 1.83k, False: 1.40k]
  ------------------
  138|  1.83k|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<int>(os, " "));
  139|  1.83k|    os << static_cast<int>(value_.back());
  140|  1.83k|  }
  141|  3.23k|  return os;
  142|  3.23k|}
_ZNK5Exiv29DataValue7toInt64Em:
  149|   229k|int64_t DataValue::toInt64(size_t n) const {
  150|   229k|  ok_ = true;
  151|   229k|  return value_.at(n);
  152|   229k|}
_ZNK5Exiv29DataValue8toUint32Em:
  154|  12.1M|uint32_t DataValue::toUint32(size_t n) const {
  155|  12.1M|  ok_ = true;
  156|  12.1M|  return value_.at(n);
  157|  12.1M|}
_ZN5Exiv215StringValueBase4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  173|  7.68k|int StringValueBase::read(const std::string& buf) {
  174|  7.68k|  value_ = buf;
  175|  7.68k|  return 0;
  176|  7.68k|}
_ZN5Exiv215StringValueBase4readEPKhmNS_9ByteOrderE:
  178|  98.0k|int StringValueBase::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  179|       |  // byteOrder not needed
  180|  98.0k|  if (buf)
  ------------------
  |  Branch (180:7): [True: 98.0k, False: 0]
  ------------------
  181|  98.0k|    value_ = std::string(reinterpret_cast<const char*>(buf), len);
  182|  98.0k|  return 0;
  183|  98.0k|}
_ZNK5Exiv215StringValueBase4copyEPhNS_9ByteOrderE:
  185|   102k|size_t StringValueBase::copy(byte* buf, ByteOrder /*byteOrder*/) const {
  186|   102k|  if (value_.empty())
  ------------------
  |  Branch (186:7): [True: 62.6k, False: 40.1k]
  ------------------
  187|  62.6k|    return 0;
  188|       |  // byteOrder not needed
  189|  40.1k|  return value_.copy(reinterpret_cast<char*>(buf), value_.size());
  190|   102k|}
_ZNK5Exiv215StringValueBase5countEv:
  192|   109k|size_t StringValueBase::count() const {
  193|   109k|  return size();
  194|   109k|}
_ZNK5Exiv215StringValueBase4sizeEv:
  196|   373k|size_t StringValueBase::size() const {
  197|   373k|  return value_.size();
  198|   373k|}
_ZNK5Exiv215StringValueBase5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  200|  5.27k|std::ostream& StringValueBase::write(std::ostream& os) const {
  201|  5.27k|  return os << value_;
  202|  5.27k|}
_ZNK5Exiv215StringValueBase7toInt64Em:
  204|  1.72k|int64_t StringValueBase::toInt64(size_t n) const {
  205|  1.72k|  ok_ = true;
  206|  1.72k|  return static_cast<signed char>(value_.at(n));
  207|  1.72k|}
_ZNK5Exiv215StringValueBase8toUint32Em:
  209|  7.43k|uint32_t StringValueBase::toUint32(size_t n) const {
  210|  7.43k|  ok_ = true;
  211|  7.43k|  return static_cast<unsigned char>(value_.at(n));
  212|  7.43k|}
_ZN5Exiv211StringValueC2Ev:
  224|  46.3k|StringValue::StringValue() : StringValueBase(string) {
  225|  46.3k|}
_ZNK5Exiv211StringValue6clone_Ev:
  230|   510k|StringValue* StringValue::clone_() const {
  231|   510k|  return new StringValue(*this);
  232|   510k|}
_ZN5Exiv210AsciiValueC2Ev:
  234|  55.9k|AsciiValue::AsciiValue() : StringValueBase(asciiString) {
  235|  55.9k|}
_ZN5Exiv210AsciiValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  240|  5.35k|int AsciiValue::read(const std::string& buf) {
  241|  5.35k|  value_ = buf;
  242|       |  // ensure count>0 and nul terminated # https://github.com/Exiv2/exiv2/issues/1484
  243|  5.35k|  if (value_.empty() || value_.back() != '\0') {
  ------------------
  |  Branch (243:7): [True: 12, False: 5.34k]
  |  Branch (243:25): [True: 5.34k, False: 0]
  ------------------
  244|  5.35k|    value_ += '\0';
  245|  5.35k|  }
  246|  5.35k|  return 0;
  247|  5.35k|}
_ZNK5Exiv210AsciiValue6clone_Ev:
  249|   182k|AsciiValue* AsciiValue::clone_() const {
  250|   182k|  return new AsciiValue(*this);
  251|   182k|}
_ZNK5Exiv210AsciiValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  253|  36.2k|std::ostream& AsciiValue::write(std::ostream& os) const {
  254|       |  // Write only up to the first '\0' (if any)
  255|  36.2k|  std::string::size_type pos = value_.find_first_of('\0');
  256|  36.2k|  if (pos == std::string::npos)
  ------------------
  |  Branch (256:7): [True: 5.68k, False: 30.5k]
  ------------------
  257|  5.68k|    pos = value_.size();
  258|  36.2k|  return os << value_.substr(0, pos);
  259|  36.2k|}
_ZN5Exiv212CommentValue11CharsetInfo15charsetIdByCodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  286|  5.43k|CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::string& code) {
  287|  5.43k|  int i = 0;
  288|  18.4k|  for (; charsetTable_[i].charsetId_ != lastCharsetId && std::string(charsetTable_[i].code_, 8) != code; ++i) {
  ------------------
  |  Branch (288:10): [True: 16.9k, False: 1.49k]
  |  Branch (288:10): [True: 13.0k, False: 5.43k]
  |  Branch (288:58): [True: 13.0k, False: 3.93k]
  ------------------
  289|  13.0k|  }
  290|  5.43k|  return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
  ------------------
  |  Branch (290:10): [True: 1.49k, False: 3.93k]
  ------------------
  291|  5.43k|}
_ZN5Exiv212CommentValueC2Ev:
  293|  6.44k|CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
  294|  6.44k|}
_ZN5Exiv212CommentValue4readEPKhmNS_9ByteOrderE:
  330|  6.44k|int CommentValue::read(const byte* buf, size_t len, ByteOrder byteOrder) {
  331|  6.44k|  byteOrder_ = byteOrder;
  332|  6.44k|  return StringValueBase::read(buf, len, byteOrder);
  333|  6.44k|}
_ZNK5Exiv212CommentValue4copyEPhNS_9ByteOrderE:
  335|  6.81k|size_t CommentValue::copy(byte* buf, ByteOrder byteOrder) const {
  336|  6.81k|  std::string c = value_;
  337|  6.81k|  if (charsetId() == unicode) {
  ------------------
  |  Branch (337:7): [True: 1.77k, False: 5.04k]
  ------------------
  338|  1.77k|    c = value_.substr(8);
  339|  1.77k|    [[maybe_unused]] const size_t sz = c.size();
  340|  1.77k|    if (byteOrder_ == littleEndian && byteOrder == bigEndian) {
  ------------------
  |  Branch (340:9): [True: 73, False: 1.70k]
  |  Branch (340:39): [True: 0, False: 73]
  ------------------
  341|      0|      convertStringCharset(c, "UCS-2LE", "UCS-2BE");
  342|  1.77k|    } else if (byteOrder_ == bigEndian && byteOrder == littleEndian) {
  ------------------
  |  Branch (342:16): [True: 1.70k, False: 73]
  |  Branch (342:43): [True: 88, False: 1.61k]
  ------------------
  343|     88|      convertStringCharset(c, "UCS-2BE", "UCS-2LE");
  344|     88|    }
  345|  1.77k|    c = value_.substr(0, 8) + c;
  346|  1.77k|  }
  347|  6.81k|  if (c.empty())
  ------------------
  |  Branch (347:7): [True: 1.14k, False: 5.67k]
  ------------------
  348|  1.14k|    return 0;
  349|  5.67k|  return c.copy(reinterpret_cast<char*>(buf), c.size());
  350|  6.81k|}
_ZNK5Exiv212CommentValue9charsetIdEv:
  382|  6.81k|CommentValue::CharsetId CommentValue::charsetId() const {
  383|  6.81k|  CharsetId charsetId = undefined;
  384|  6.81k|  if (value_.length() >= 8) {
  ------------------
  |  Branch (384:7): [True: 5.43k, False: 1.38k]
  ------------------
  385|  5.43k|    const std::string code = value_.substr(0, 8);
  386|  5.43k|    charsetId = CharsetInfo::charsetIdByCode(code);
  387|  5.43k|  }
  388|  6.81k|  return charsetId;
  389|  6.81k|}
_ZNK5Exiv212CommentValue6clone_Ev:
  411|  17.7k|CommentValue* CommentValue::clone_() const {
  412|  17.7k|  return new CommentValue(*this);
  413|  17.7k|}
_ZN5Exiv28XmpValue15setXmpArrayTypeENS0_12XmpArrayTypeE:
  415|  21.1k|void XmpValue::setXmpArrayType(XmpArrayType xmpArrayType) {
  416|  21.1k|  xmpArrayType_ = xmpArrayType;
  417|  21.1k|}
_ZN5Exiv28XmpValue12setXmpStructENS0_9XmpStructE:
  419|  13.3k|void XmpValue::setXmpStruct(XmpStruct xmpStruct) {
  420|  13.3k|  xmpStruct_ = xmpStruct;
  421|  13.3k|}
_ZNK5Exiv28XmpValue12xmpArrayTypeEv:
  423|   660k|XmpValue::XmpArrayType XmpValue::xmpArrayType() const {
  424|   660k|  return xmpArrayType_;
  425|   660k|}
_ZN5Exiv28XmpValue12xmpArrayTypeENS_6TypeIdE:
  427|  19.4k|XmpValue::XmpArrayType XmpValue::xmpArrayType(TypeId typeId) {
  428|  19.4k|  XmpArrayType xa = xaNone;
  429|  19.4k|  switch (typeId) {
  430|    453|    case xmpAlt:
  ------------------
  |  Branch (430:5): [True: 453, False: 19.0k]
  ------------------
  431|    453|      xa = xaAlt;
  432|    453|      break;
  433|    392|    case xmpBag:
  ------------------
  |  Branch (433:5): [True: 392, False: 19.0k]
  ------------------
  434|    392|      xa = xaBag;
  435|    392|      break;
  436|  6.19k|    case xmpSeq:
  ------------------
  |  Branch (436:5): [True: 6.19k, False: 13.2k]
  ------------------
  437|  6.19k|      xa = xaSeq;
  438|  6.19k|      break;
  439|  12.4k|    default:
  ------------------
  |  Branch (439:5): [True: 12.4k, False: 7.03k]
  ------------------
  440|  12.4k|      break;
  441|  19.4k|  }
  442|  19.4k|  return xa;
  443|  19.4k|}
_ZNK5Exiv28XmpValue9xmpStructEv:
  445|   677k|XmpValue::XmpStruct XmpValue::xmpStruct() const {
  446|   677k|  return xmpStruct_;
  447|   677k|}
_ZN5Exiv212XmpTextValueC2Ev:
  469|   217k|XmpTextValue::XmpTextValue() : XmpValue(xmpText) {
  470|   217k|}
_ZN5Exiv212XmpTextValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  476|   955k|int XmpTextValue::read(const std::string& buf) {
  477|       |  // support a type=Alt,Bag,Seq,Struct indicator
  478|   955k|  std::string b = buf;
  479|   955k|  std::string type;
  480|   955k|  if (buf.starts_with("type=")) {
  ------------------
  |  Branch (480:7): [True: 3.39k, False: 952k]
  ------------------
  481|  3.39k|    std::string::size_type pos = buf.find_first_of(' ');
  482|  3.39k|    type = buf.substr(5, pos - 5);
  483|       |    // Strip quotes (so you can also specify the type without quotes)
  484|  3.39k|    if (!type.empty() && type.front() == '"')
  ------------------
  |  Branch (484:9): [True: 2.81k, False: 580]
  |  Branch (484:26): [True: 2.19k, False: 613]
  ------------------
  485|  2.19k|      type = type.substr(1);
  486|  3.39k|    if (!type.empty() && type.back() == '"')
  ------------------
  |  Branch (486:9): [True: 2.71k, False: 675]
  |  Branch (486:26): [True: 1.94k, False: 772]
  ------------------
  487|  1.94k|      type.pop_back();
  488|  3.39k|    b.clear();
  489|  3.39k|    if (pos != std::string::npos)
  ------------------
  |  Branch (489:9): [True: 1.96k, False: 1.42k]
  ------------------
  490|  1.96k|      b = buf.substr(pos + 1);
  491|  3.39k|  }
  492|   955k|  if (!type.empty()) {
  ------------------
  |  Branch (492:7): [True: 2.71k, False: 953k]
  ------------------
  493|  2.71k|    if (type == "Alt") {
  ------------------
  |  Branch (493:9): [True: 234, False: 2.47k]
  ------------------
  494|    234|      setXmpArrayType(XmpValue::xaAlt);
  495|  2.47k|    } else if (type == "Bag") {
  ------------------
  |  Branch (495:16): [True: 41, False: 2.43k]
  ------------------
  496|     41|      setXmpArrayType(XmpValue::xaBag);
  497|  2.43k|    } else if (type == "Seq") {
  ------------------
  |  Branch (497:16): [True: 1.40k, False: 1.03k]
  ------------------
  498|  1.40k|      setXmpArrayType(XmpValue::xaSeq);
  499|  1.40k|    } else if (type == "Struct") {
  ------------------
  |  Branch (499:16): [True: 348, False: 683]
  ------------------
  500|    348|      setXmpStruct();
  501|    683|    } else {
  502|    683|      throw Error(ErrorCode::kerInvalidXmpText, type);
  503|    683|    }
  504|  2.71k|  }
  505|   955k|  value_ = std::move(b);
  506|   955k|  return 0;
  507|   955k|}
_ZNK5Exiv212XmpTextValue4sizeEv:
  513|   141k|size_t XmpTextValue::size() const {
  514|   141k|  std::ostringstream os;
  515|   141k|  write(os);
  516|   141k|  return os.str().size();
  517|   141k|}
_ZNK5Exiv212XmpTextValue5countEv:
  519|   141k|size_t XmpTextValue::count() const {
  520|   141k|  return size();
  521|   141k|}
_ZNK5Exiv212XmpTextValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  523|   391k|std::ostream& XmpTextValue::write(std::ostream& os) const {
  524|   391k|  bool del = false;
  525|   391k|  if (xmpArrayType() != XmpValue::xaNone) {
  ------------------
  |  Branch (525:7): [True: 1.84k, False: 389k]
  ------------------
  526|  1.84k|    switch (xmpArrayType()) {
  ------------------
  |  Branch (526:13): [True: 1.84k, False: 0]
  ------------------
  527|    121|      case XmpValue::xaAlt:
  ------------------
  |  Branch (527:7): [True: 121, False: 1.72k]
  ------------------
  528|    121|        os << "type=\"Alt\"";
  529|    121|        break;
  530|     20|      case XmpValue::xaBag:
  ------------------
  |  Branch (530:7): [True: 20, False: 1.82k]
  ------------------
  531|     20|        os << "type=\"Bag\"";
  532|     20|        break;
  533|  1.70k|      case XmpValue::xaSeq:
  ------------------
  |  Branch (533:7): [True: 1.70k, False: 141]
  ------------------
  534|  1.70k|        os << "type=\"Seq\"";
  535|  1.70k|        break;
  536|      0|      case XmpValue::xaNone:
  ------------------
  |  Branch (536:7): [True: 0, False: 1.84k]
  ------------------
  537|      0|        break;  // just to suppress the warning
  538|  1.84k|    }
  539|  1.84k|    del = true;
  540|   389k|  } else if (xmpStruct() != XmpValue::xsNone) {
  ------------------
  |  Branch (540:14): [True: 10.4k, False: 379k]
  ------------------
  541|  10.4k|    switch (xmpStruct()) {
  ------------------
  |  Branch (541:13): [True: 10.4k, False: 0]
  ------------------
  542|  10.4k|      case XmpValue::xsStruct:
  ------------------
  |  Branch (542:7): [True: 10.4k, False: 0]
  ------------------
  543|  10.4k|        os << "type=\"Struct\"";
  544|  10.4k|        break;
  545|      0|      case XmpValue::xsNone:
  ------------------
  |  Branch (545:7): [True: 0, False: 10.4k]
  ------------------
  546|      0|        break;  // just to suppress the warning
  547|  10.4k|    }
  548|  10.4k|    del = true;
  549|  10.4k|  }
  550|   391k|  if (del && !value_.empty())
  ------------------
  |  Branch (550:7): [True: 12.3k, False: 379k]
  |  Branch (550:14): [True: 1.09k, False: 11.2k]
  ------------------
  551|  1.09k|    os << " ";
  552|   391k|  return os << value_;
  553|   391k|}
_ZNK5Exiv212XmpTextValue6clone_Ev:
  571|   495k|XmpTextValue* XmpTextValue::clone_() const {
  572|   495k|  return new XmpTextValue(*this);
  573|   495k|}
_ZN5Exiv213XmpArrayValueC2ENS_6TypeIdE:
  575|  6.50k|XmpArrayValue::XmpArrayValue(TypeId typeId) : XmpValue(typeId) {
  576|  6.50k|  setXmpArrayType(xmpArrayType(typeId));
  577|  6.50k|}
_ZN5Exiv213XmpArrayValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|  33.8k|int XmpArrayValue::read(const std::string& buf) {
  580|  33.8k|  if (!buf.empty())
  ------------------
  |  Branch (580:7): [True: 29.6k, False: 4.18k]
  ------------------
  581|  29.6k|    value_.push_back(buf);
  582|  33.8k|  return 0;
  583|  33.8k|}
_ZNK5Exiv213XmpArrayValue5countEv:
  589|  15.4k|size_t XmpArrayValue::count() const {
  590|  15.4k|  return value_.size();
  591|  15.4k|}
_ZNK5Exiv213XmpArrayValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  593|    220|std::ostream& XmpArrayValue::write(std::ostream& os) const {
  594|    220|  if (!value_.empty()) {
  ------------------
  |  Branch (594:7): [True: 210, False: 10]
  ------------------
  595|    210|    std::copy(value_.begin(), value_.end() - 1, std::ostream_iterator<std::string>(os, ", "));
  596|    210|    os << value_.back();
  597|    210|  }
  598|    220|  return os;
  599|    220|}
_ZNK5Exiv213XmpArrayValue8toStringEm:
  601|  32.9k|std::string XmpArrayValue::toString(size_t n) const {
  602|  32.9k|  ok_ = true;
  603|  32.9k|  return value_.at(n);
  604|  32.9k|}
_ZNK5Exiv213XmpArrayValue6clone_Ev:
  622|  11.6k|XmpArrayValue* XmpArrayValue::clone_() const {
  623|  11.6k|  return new XmpArrayValue(*this);
  624|  11.6k|}
_ZN5Exiv212LangAltValueC2Ev:
  626|  2.13k|LangAltValue::LangAltValue() : XmpValue(langAlt) {
  627|  2.13k|}
_ZN5Exiv212LangAltValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  633|    611|int LangAltValue::read(const std::string& buf) {
  634|    611|  std::string b = buf;
  635|    611|  std::string lang = "x-default";
  636|    611|  if (buf.starts_with("lang=")) {
  ------------------
  |  Branch (636:7): [True: 190, False: 421]
  ------------------
  637|    190|    static constexpr auto ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  638|       |
  639|    190|    const std::string::size_type pos = buf.find_first_of(' ');
  640|    190|    if (pos == std::string::npos) {
  ------------------
  |  Branch (640:9): [True: 51, False: 139]
  ------------------
  641|     51|      lang = buf.substr(5);
  642|    139|    } else {
  643|    139|      lang = buf.substr(5, pos - 5);
  644|    139|    }
  645|    190|    if (lang.empty())
  ------------------
  |  Branch (645:9): [True: 2, False: 188]
  ------------------
  646|      2|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  647|       |    // Strip quotes (so you can also specify the language without quotes)
  648|    188|    if (lang.front() == '"') {
  ------------------
  |  Branch (648:9): [True: 67, False: 121]
  ------------------
  649|     67|      lang = lang.substr(1);
  650|       |
  651|     67|      if (lang.empty() || lang.back() != '"')
  ------------------
  |  Branch (651:11): [True: 3, False: 64]
  |  Branch (651:27): [True: 34, False: 30]
  ------------------
  652|     37|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  653|       |
  654|     30|      lang.pop_back();
  655|     30|    }
  656|       |
  657|    151|    if (lang.empty())
  ------------------
  |  Branch (657:9): [True: 1, False: 150]
  ------------------
  658|      1|      throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  659|       |
  660|       |    // Check language is in the correct format (see https://www.ietf.org/rfc/rfc3066.txt)
  661|    150|    if (auto charPos = lang.find_first_not_of(ALPHA); charPos != std::string::npos) {
  ------------------
  |  Branch (661:55): [True: 90, False: 60]
  ------------------
  662|     90|      static constexpr auto ALPHA_NUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  663|     90|      if (lang.at(charPos) != '-' || lang.find_first_not_of(ALPHA_NUM, charPos + 1) != std::string::npos)
  ------------------
  |  Branch (663:11): [True: 42, False: 48]
  |  Branch (663:38): [True: 16, False: 32]
  ------------------
  664|     58|        throw Error(ErrorCode::kerInvalidLangAltValue, buf);
  665|     90|    }
  666|       |
  667|     92|    b.clear();
  668|     92|    if (pos != std::string::npos)
  ------------------
  |  Branch (668:9): [True: 77, False: 15]
  ------------------
  669|     77|      b = buf.substr(pos + 1);
  670|     92|  }
  671|       |
  672|    513|  value_[lang] = std::move(b);
  673|    513|  return 0;
  674|    611|}
_ZNK5Exiv212LangAltValue5countEv:
  680|    746|size_t LangAltValue::count() const {
  681|    746|  return value_.size();
  682|    746|}
_ZNK5Exiv212LangAltValue5writeERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE:
  684|    314|std::ostream& LangAltValue::write(std::ostream& os) const {
  685|    314|  bool first = true;
  686|       |
  687|       |  // Write the default entry first
  688|    314|  if (auto i = value_.find("x-default"); i != value_.end()) {
  ------------------
  |  Branch (688:42): [True: 0, False: 314]
  ------------------
  689|      0|    os << "lang=\"" << i->first << "\" " << i->second;
  690|      0|    first = false;
  691|      0|  }
  692|       |
  693|       |  // Write the others
  694|    314|  for (const auto& [lang, s] : value_) {
  ------------------
  |  Branch (694:30): [True: 314, False: 314]
  ------------------
  695|    314|    if (lang != "x-default") {
  ------------------
  |  Branch (695:9): [True: 314, False: 0]
  ------------------
  696|    314|      if (!first)
  ------------------
  |  Branch (696:11): [True: 0, False: 314]
  ------------------
  697|      0|        os << ", ";
  698|    314|      os << "lang=\"" << lang << "\" " << s;
  699|    314|      first = false;
  700|    314|    }
  701|    314|  }
  702|    314|  return os;
  703|    314|}
_ZNK5Exiv212LangAltValue8toStringEm:
  705|    755|std::string LangAltValue::toString(size_t /*n*/) const {
  706|    755|  return toString("x-default");
  707|    755|}
_ZNK5Exiv212LangAltValue8toStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  709|    755|std::string LangAltValue::toString(const std::string& qualifier) const {
  710|    755|  if (auto i = value_.find(qualifier); i != value_.end()) {
  ------------------
  |  Branch (710:40): [True: 9, False: 746]
  ------------------
  711|      9|    ok_ = true;
  712|      9|    return i->second;
  713|      9|  }
  714|    746|  ok_ = false;
  715|    746|  return "";
  716|    755|}
_ZNK5Exiv212LangAltValue6clone_Ev:
  738|  3.22k|LangAltValue* LangAltValue::clone_() const {
  739|  3.22k|  return new LangAltValue(*this);
  740|  3.22k|}
_ZN5Exiv29DateValueC2Ev:
  742|  7.10k|DateValue::DateValue() : Value(date) {
  743|  7.10k|  date_ = {};
  744|  7.10k|}
_ZN5Exiv29DateValue4readEPKhmNS_9ByteOrderE:
  750|  6.63k|int DateValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  751|  6.63k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  752|  6.63k|  return read(str);
  753|  6.63k|}
_ZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  755|  7.10k|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|  7.10k|  size_t monthPos = 0;
  759|  7.10k|  size_t dayPos = 0;
  760|       |
  761|  7.10k|  auto printWarning = [] {
  762|  7.10k|#ifndef SUPPRESS_WARNINGS
  763|  7.10k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  764|  7.10k|#endif
  765|  7.10k|  };
  766|       |
  767|  7.10k|  if (buf.size() < 8) {
  ------------------
  |  Branch (767:7): [True: 974, False: 6.13k]
  ------------------
  768|    974|    printWarning();
  769|    974|    return 1;
  770|    974|  }
  771|       |
  772|  6.13k|  if ((buf.size() >= 10 && buf[4] == '-' && buf[7] == '-') || (buf.size() == 8)) {
  ------------------
  |  Branch (772:8): [True: 2.86k, False: 3.26k]
  |  Branch (772:28): [True: 1.32k, False: 1.54k]
  |  Branch (772:45): [True: 188, False: 1.13k]
  |  Branch (772:63): [True: 3.24k, False: 2.69k]
  ------------------
  773|  3.43k|    if (buf.size() >= 10) {
  ------------------
  |  Branch (773:9): [True: 188, False: 3.24k]
  ------------------
  774|    188|      monthPos = 5;
  775|    188|      dayPos = 8;
  776|  3.24k|    } else {
  777|  3.24k|      monthPos = 4;
  778|  3.24k|      dayPos = 6;
  779|  3.24k|    }
  780|       |
  781|  3.43k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  3.43k|      for (size_t i = start; i < start + count; ++i) {
  783|  3.43k|        if (!std::isdigit(buf[i])) {
  784|  3.43k|          printWarning();
  785|  3.43k|          return 1;
  786|  3.43k|        }
  787|  3.43k|      }
  788|  3.43k|      dest = std::stoul(buf.substr(start, count));
  789|  3.43k|      return 0;
  790|  3.43k|    };
  791|       |
  792|  3.43k|    if (checkDigits(0, 4, date_.year) || checkDigits(monthPos, 2, date_.month) || checkDigits(dayPos, 2, date_.day)) {
  ------------------
  |  Branch (792:9): [True: 1.33k, False: 2.09k]
  |  Branch (792:42): [True: 740, False: 1.35k]
  |  Branch (792:83): [True: 600, False: 757]
  ------------------
  793|  2.67k|      printWarning();
  794|  2.67k|      return 1;
  795|  2.67k|    }
  796|       |
  797|    757|    if (date_.month > 12 || date_.day > 31) {
  ------------------
  |  Branch (797:9): [True: 417, False: 340]
  |  Branch (797:29): [True: 152, False: 188]
  ------------------
  798|    569|      date_.month = 0;
  799|    569|      date_.day = 0;
  800|    569|      printWarning();
  801|    569|      return 1;
  802|    569|    }
  803|    188|    return 0;
  804|    757|  }
  805|  2.69k|  printWarning();
  806|  2.69k|  return 1;
  807|  6.13k|}
_ZNK5Exiv29DateValue4copyEPhNS_9ByteOrderE:
  813|    105|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|    105|  auto out = reinterpret_cast<char*>(buf);
  818|    105|  auto it = stringFormatTo(out, "{:04}{:02}{:02}", date_.year, date_.month, date_.day);
  ------------------
  |  |   19|    105|#define stringFormatTo std::format_to
  ------------------
  819|       |
  820|    105|  return it - out;
  821|    105|}
_ZNK5Exiv29DateValue4sizeEv:
  831|    210|size_t DateValue::size() const {
  832|    210|  return 8;
  833|    210|}
_ZNK5Exiv29DateValue6clone_Ev:
  835|  1.15k|DateValue* DateValue::clone_() const {
  836|  1.15k|  return new DateValue(*this);
  837|  1.15k|}
_ZN5Exiv29TimeValueC2Ev:
  878|  11.0k|TimeValue::TimeValue() : Value(time) {
  879|  11.0k|  time_ = {};
  880|  11.0k|}
_ZN5Exiv29TimeValue4readEPKhmNS_9ByteOrderE:
  886|  11.0k|int TimeValue::read(const byte* buf, size_t len, ByteOrder /*byteOrder*/) {
  887|  11.0k|  const std::string str(reinterpret_cast<const char*>(buf), len);
  888|  11.0k|  return read(str);
  889|  11.0k|}
_ZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  891|  11.0k|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|  11.0k|  auto printWarning = [] {
  897|  11.0k|#ifndef SUPPRESS_WARNINGS
  898|  11.0k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  899|  11.0k|#endif
  900|  11.0k|    return 1;
  901|  11.0k|  };
  902|       |
  903|  11.0k|  if (buf.size() < 2)
  ------------------
  |  Branch (903:7): [True: 1.60k, False: 9.44k]
  ------------------
  904|  1.60k|    return printWarning();
  905|       |
  906|  9.44k|  for (auto c : buf)
  ------------------
  |  Branch (906:15): [True: 135k, False: 7.19k]
  ------------------
  907|   135k|    if (c != ':' && c != '+' && c != '-' && c != 'Z' && !std::isdigit(c))
  ------------------
  |  Branch (907:9): [True: 131k, False: 3.47k]
  |  Branch (907:21): [True: 128k, False: 3.58k]
  |  Branch (907:33): [True: 120k, False: 7.15k]
  |  Branch (907:45): [True: 117k, False: 3.33k]
  |  Branch (907:57): [True: 2.25k, False: 115k]
  ------------------
  908|  2.25k|      return printWarning();
  909|       |
  910|  7.19k|  size_t mpos;
  911|  7.19k|  size_t spos;
  912|  7.19k|  if (buf.find(':') != std::string::npos) {
  ------------------
  |  Branch (912:7): [True: 2.72k, False: 4.47k]
  ------------------
  913|  2.72k|    mpos = 3;
  914|  2.72k|    spos = 6;
  915|  4.47k|  } else {
  916|  4.47k|    mpos = 2;
  917|  4.47k|    spos = 4;
  918|  4.47k|  }
  919|       |
  920|  7.19k|  try {
  921|  7.19k|    auto hi = std::stoi(buf.substr(0, 2));
  922|  7.19k|    if (hi < 0 || hi > 23)
  ------------------
  |  Branch (922:9): [True: 183, False: 7.01k]
  |  Branch (922:19): [True: 72, False: 6.94k]
  ------------------
  923|    183|      return printWarning();
  924|  7.01k|    time_.hour = hi;
  925|  7.01k|    if (buf.size() > 3) {
  ------------------
  |  Branch (925:9): [True: 6.67k, False: 339]
  ------------------
  926|  6.67k|      auto mi = std::stoi(buf.substr(mpos, 2));
  927|  6.67k|      if (mi < 0 || mi > 59)
  ------------------
  |  Branch (927:11): [True: 255, False: 6.41k]
  |  Branch (927:21): [True: 46, False: 6.37k]
  ------------------
  928|    262|        return printWarning();
  929|  6.41k|      time_.minute = std::stoi(buf.substr(mpos, 2));
  930|  6.41k|    } else {
  931|    339|      time_.minute = 0;
  932|    339|    }
  933|  6.75k|    if (buf.size() > 5) {
  ------------------
  |  Branch (933:9): [True: 4.90k, False: 1.84k]
  ------------------
  934|  4.90k|      auto si = std::stoi(buf.substr(spos, 2));
  935|  4.90k|      if (si < 0 || si > 60)
  ------------------
  |  Branch (935:11): [True: 254, False: 4.64k]
  |  Branch (935:21): [True: 146, False: 4.50k]
  ------------------
  936|    295|        return printWarning();
  937|  4.60k|      time_.second = std::stoi(buf.substr(spos, 2));
  938|  4.60k|    } else {
  939|  1.84k|      time_.second = 0;
  940|  1.84k|    }
  941|       |
  942|  6.45k|    auto fpos = buf.find('+');
  943|  6.45k|    if (fpos == std::string::npos)
  ------------------
  |  Branch (943:9): [True: 4.07k, False: 2.38k]
  ------------------
  944|  4.07k|      fpos = buf.find('-');
  945|       |
  946|  6.45k|    if (fpos != std::string::npos) {
  ------------------
  |  Branch (946:9): [True: 5.60k, False: 850]
  ------------------
  947|  5.60k|      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|  5.60k|      const bool negative = format.at(0) == '-';
  953|  5.60k|      auto posColon = format.find(':');
  954|  5.60k|      if (posColon == std::string::npos) {
  ------------------
  |  Branch (954:11): [True: 3.31k, False: 2.29k]
  ------------------
  955|       |        // Extended format
  956|  3.31k|        auto tzhi = std::stoi(format.substr(0, 3));
  957|  3.31k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (957:13): [True: 410, False: 2.90k]
  |  Branch (957:27): [True: 107, False: 2.79k]
  ------------------
  958|    444|          return printWarning();
  959|  2.86k|        time_.tzHour = tzhi;
  960|  2.86k|        if (format.size() > 3) {
  ------------------
  |  Branch (960:13): [True: 2.26k, False: 598]
  ------------------
  961|  2.26k|          int minute = std::stoi(format.substr(3));
  962|  2.26k|          if (minute < 0 || minute > 59)
  ------------------
  |  Branch (962:15): [True: 486, False: 1.78k]
  |  Branch (962:29): [True: 424, False: 1.35k]
  ------------------
  963|    488|            return printWarning();
  964|  1.78k|          time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (964:28): [True: 900, False: 881]
  ------------------
  965|  1.78k|        }
  966|  2.86k|      } else {
  967|       |        // Basic format
  968|  2.29k|        auto tzhi = std::stoi(format.substr(0, posColon));
  969|  2.29k|        if (tzhi < -23 || tzhi > 23)
  ------------------
  |  Branch (969:13): [True: 297, False: 1.99k]
  |  Branch (969:27): [True: 73, False: 1.92k]
  ------------------
  970|    318|          return printWarning();
  971|  1.97k|        time_.tzHour = tzhi;
  972|  1.97k|        int minute = std::stoi(format.substr(posColon + 1));
  973|  1.97k|        if (minute < 0 || minute > 59)
  ------------------
  |  Branch (973:13): [True: 700, False: 1.27k]
  |  Branch (973:27): [True: 509, False: 768]
  ------------------
  974|    827|          return printWarning();
  975|  1.15k|        time_.tzMinute = negative ? -minute : minute;
  ------------------
  |  Branch (975:26): [True: 254, False: 896]
  ------------------
  976|  1.15k|      }
  977|  5.60k|    }
  978|  6.45k|  } catch (std::exception&) {
  979|       |    // std::stoi might throw an exception if the syntax is invalid.
  980|  1.09k|    return printWarning();
  981|  1.09k|  }
  982|  3.28k|  return 0;
  983|  7.19k|}
_ZNK5Exiv29TimeValue4copyEPhNS_9ByteOrderE:
  990|    419|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|    419|  char plusMinus = '+';
  994|    419|  if (time_.tzHour < 0 || time_.tzMinute < 0)
  ------------------
  |  Branch (994:7): [True: 128, False: 291]
  |  Branch (994:27): [True: 55, False: 236]
  ------------------
  995|    183|    plusMinus = '-';
  996|       |
  997|    419|  auto out = reinterpret_cast<char*>(buf);
  998|    419|  auto it = stringFormatTo(out, "{:02}{:02}{:02}{}{:02}{:02}", time_.hour, time_.minute, time_.second, plusMinus,
  ------------------
  |  |   19|    419|#define stringFormatTo std::format_to
  ------------------
  999|    419|                           std::abs(time_.tzHour), std::abs(time_.tzMinute));
 1000|       |
 1001|    419|  auto wrote = static_cast<size_t>(it - out);
 1002|    419|  Internal::enforce(wrote == 11, Exiv2::ErrorCode::kerUnsupportedTimeFormat);
 1003|    419|  return wrote;
 1004|    419|}
_ZNK5Exiv29TimeValue4sizeEv:
 1014|    838|size_t TimeValue::size() const {
 1015|    838|  return 11;
 1016|    838|}
_ZNK5Exiv29TimeValue6clone_Ev:
 1018|  5.29k|TimeValue* TimeValue::clone_() const {
 1019|  5.29k|  return new TimeValue(*this);
 1020|  5.29k|}
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  761|  9.59k|  auto printWarning = [] {
  762|  9.59k|#ifndef SUPPRESS_WARNINGS
  763|  9.59k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedDateFormat) << "\n";
  ------------------
  |  |  138|  9.59k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 9.59k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  9.59k|  LogMsg(LogMsg::warn).os()
  ------------------
  764|  9.59k|#endif
  765|  9.59k|  };
value.cpp:_ZZN5Exiv29DateValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmmRi:
  781|  6.89k|    auto checkDigits = [&buf, &printWarning](size_t start, size_t count, int32_t& dest) {
  782|  22.4k|      for (size_t i = start; i < start + count; ++i) {
  ------------------
  |  Branch (782:30): [True: 18.2k, False: 4.21k]
  ------------------
  783|  18.2k|        if (!std::isdigit(buf[i])) {
  ------------------
  |  Branch (783:13): [True: 2.67k, False: 15.5k]
  ------------------
  784|  2.67k|          printWarning();
  785|  2.67k|          return 1;
  786|  2.67k|        }
  787|  18.2k|      }
  788|  4.21k|      dest = std::stoul(buf.substr(start, count));
  789|  4.21k|      return 0;
  790|  6.89k|    };
value.cpp:_ZZN5Exiv29TimeValue4readERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEv:
  896|  7.76k|  auto printWarning = [] {
  897|  7.76k|#ifndef SUPPRESS_WARNINGS
  898|  7.76k|    EXV_WARNING << Error(ErrorCode::kerUnsupportedTimeFormat) << "\n";
  ------------------
  |  |  138|  7.76k|  if (LogMsg::warn >= LogMsg::level() && LogMsg::handler()) \
  |  |  ------------------
  |  |  |  Branch (138:7): [True: 0, False: 7.76k]
  |  |  |  Branch (138:42): [True: 0, False: 0]
  |  |  ------------------
  |  |  139|  7.76k|  LogMsg(LogMsg::warn).os()
  ------------------
  899|  7.76k|#endif
  900|  7.76k|    return 1;
  901|  7.76k|  };

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

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

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

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

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

XMP_NewExpatAdapter:
   68|  7.65k|{
   69|  7.65k|	return new ExpatAdapter;
   70|  7.65k|}	// XMP_NewExpatAdapter
_ZN12ExpatAdapterC2Ev:
   74|  7.65k|ExpatAdapter::ExpatAdapter() : parser(0)
   75|  7.65k|{
   76|       |
   77|       |	#if XMP_DebugBuild
   78|       |		this->elemNesting = 0;
   79|       |		#if DumpXMLParseEvents
   80|       |			if ( this->parseLog == 0 ) this->parseLog = stdout;
   81|       |		#endif
   82|       |	#endif
   83|       |
   84|  7.65k|	this->parser = XML_ParserCreateNS ( 0, FullNameSeparator );
  ------------------
  |  |   33|  7.65k|#define FullNameSeparator	'@'
  ------------------
   85|  7.65k|	if ( this->parser == 0 ) XMP_Throw ( "Failure creating Expat parser", kXMPErr_ExternalFailure );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (85:7): [True: 0, False: 7.65k]
  ------------------
   86|       |	
   87|  7.65k|	XML_SetUserData ( this->parser, this );
   88|       |	
   89|  7.65k|	XML_SetNamespaceDeclHandler ( this->parser, StartNamespaceDeclHandler, EndNamespaceDeclHandler );
   90|  7.65k|	XML_SetElementHandler ( this->parser, StartElementHandler, EndElementHandler );
   91|       |
   92|  7.65k|	XML_SetCharacterDataHandler ( this->parser, CharacterDataHandler );
   93|  7.65k|	XML_SetCdataSectionHandler ( this->parser, StartCdataSectionHandler, EndCdataSectionHandler );
   94|       |
   95|  7.65k|	XML_SetProcessingInstructionHandler ( this->parser, ProcessingInstructionHandler );
   96|  7.65k|	XML_SetCommentHandler ( this->parser, CommentHandler );
   97|       |
   98|  7.65k|	#if BanAllEntityUsage
   99|  7.65k|		XML_SetStartDoctypeDeclHandler ( this->parser, StartDoctypeDeclHandler );
  100|  7.65k|		isAborted = false;
  101|  7.65k|	#endif
  102|       |
  103|  7.65k|	this->parseStack.push_back ( &this->tree );	// Push the XML root node.
  104|       |
  105|  7.65k|}	// ExpatAdapter::ExpatAdapter
_ZN12ExpatAdapterD2Ev:
  110|  7.65k|{
  111|       |
  112|  7.65k|	if ( this->parser != 0 ) XML_ParserFree ( this->parser );
  ------------------
  |  Branch (112:7): [True: 7.65k, False: 0]
  ------------------
  113|  7.65k|	this->parser = 0;
  114|       |
  115|  7.65k|}	// ExpatAdapter::~ExpatAdapter
_ZN12ExpatAdapter11ParseBufferEPKvmb:
  126|  7.70k|{
  127|  7.70k|	enum XML_Status status;
  128|       |	
  129|  7.70k|	if ( length == 0 ) {	// Expat does not like empty buffers.
  ------------------
  |  Branch (129:7): [True: 0, False: 7.70k]
  ------------------
  130|      0|		if ( ! last ) return;
  ------------------
  |  Branch (130:8): [True: 0, False: 0]
  ------------------
  131|      0|		buffer = kOneSpace;
  132|      0|		length = 1;
  133|      0|	}
  134|       |	
  135|  7.70k|	status = XML_Parse ( this->parser, (const char *)buffer, length, last );
  136|       |	
  137|  7.70k|	#if BanAllEntityUsage
  138|  7.70k|		if ( this->isAborted ) XMP_Throw ( "DOCTYPE is not allowed", kXMPErr_BadXML );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (138:8): [True: 0, False: 7.70k]
  ------------------
  139|  7.70k|	#endif
  140|       |
  141|  7.70k|	if ( status != XML_STATUS_OK ) {
  ------------------
  |  Branch (141:7): [True: 55, False: 7.65k]
  ------------------
  142|       |	
  143|     55|		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|     55|		XMP_Throw ( errMsg, kXMPErr_BadXML );
  ------------------
  |  |  199|     55|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  167|       |
  168|      0|	}
  169|       |	
  170|  7.70k|}	// ExpatAdapter::ParseBuffer
ExpatAdapter.cpp:_ZL25StartNamespaceDeclHandlerPvPKcS1_:
  242|  48.6k|{
  243|  48.6k|	IgnoreParam(userData);
  ------------------
  |  |  117|  48.6k|#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|  48.6k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (252:7): [True: 509, False: 48.1k]
  ------------------
  253|  48.6k|	if ( uri == 0 ) return;	// Ignore, have xmlns:pre="", no URI to register.
  ------------------
  |  Branch (253:7): [True: 104, False: 48.5k]
  ------------------
  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|  48.5k|	if ( XMP_LitMatch ( uri, "http://purl.org/dc/1.1/" ) ) uri = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  |   96|  48.5k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  |  |  ------------------
  |  |  |  Branch (96:28): [True: 113, False: 48.4k]
  |  |  ------------------
  ------------------
  263|  48.5k|	XMPMeta::RegisterNamespace ( uri, prefix );
  264|       |
  265|  48.5k|}	// StartNamespaceDeclHandler
ExpatAdapter.cpp:_ZL23EndNamespaceDeclHandlerPvPKc:
  270|  48.6k|{
  271|  48.6k|	IgnoreParam(userData);
  ------------------
  |  |  117|  48.6k|#define IgnoreParam(p)	(void)p
  ------------------
  272|       |
  273|       |	#if XMP_DebugBuild & DumpXMLParseEvents		// Avoid unused variable warning.
  274|       |		ExpatAdapter * thiz = (ExpatAdapter*)userData;
  275|       |	#endif
  276|       |
  277|  48.6k|	if ( prefix == 0 ) prefix = "_dflt_";	// Have default namespace.
  ------------------
  |  Branch (277:7): [True: 509, False: 48.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|  48.6k|}	// EndNamespaceDeclHandler
ExpatAdapter.cpp:_ZL19StartElementHandlerPvPKcPS1_:
  293|   104k|{
  294|   104k|	XMP_Assert ( attrs != 0 );
  ------------------
  |  |  142|   104k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  295|   104k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  296|       |	
  297|   104k|	size_t attrCount = 0;
  298|   395k|	for ( XMP_StringPtr* a = attrs; *a != 0; ++a ) ++attrCount;
  ------------------
  |  Branch (298:34): [True: 290k, False: 104k]
  ------------------
  299|   104k|	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: 104k]
  ------------------
  300|   104k|	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|   104k|	XML_Node * parentNode = thiz->parseStack.back();
  316|   104k|	XML_Node * elemNode   = new XML_Node ( parentNode, "", kElemNode );
  317|       |	
  318|   104k|	SetQualName ( name, elemNode );
  319|       |	
  320|   250k|	for ( XMP_StringPtr* attr = attrs; *attr != 0; attr += 2 ) {
  ------------------
  |  Branch (320:37): [True: 145k, False: 104k]
  ------------------
  321|       |
  322|   145k|		XMP_StringPtr attrName = *attr;
  323|   145k|		XMP_StringPtr attrValue = *(attr+1);
  324|   145k|		XML_Node * attrNode = new XML_Node ( elemNode, "", kAttrNode );
  325|       |
  326|   145k|		SetQualName ( attrName, attrNode );
  327|   145k|		attrNode->value = attrValue;
  328|   145k|		if ( attrNode->name == "xml:lang" ) NormalizeLangValue ( &attrNode->value );
  ------------------
  |  Branch (328:8): [True: 18.5k, False: 126k]
  ------------------
  329|   145k|		elemNode->attrs.push_back ( attrNode );
  330|       |
  331|   145k|	}
  332|       |	
  333|   104k|	parentNode->content.push_back ( elemNode );
  334|   104k|	thiz->parseStack.push_back ( elemNode );
  335|       |	
  336|   104k|	if ( elemNode->name == "rdf:RDF" ) {
  ------------------
  |  Branch (336:7): [True: 7.16k, False: 97.4k]
  ------------------
  337|  7.16k|		thiz->rootNode = elemNode;
  338|  7.16k|		++thiz->rootCount;
  339|  7.16k|	}
  340|       |	#if XMP_DebugBuild
  341|       |		++thiz->elemNesting;
  342|       |	#endif
  343|       |
  344|   104k|}	// StartElementHandler
ExpatAdapter.cpp:_ZL11SetQualNamePKcP8XML_Node:
  187|   250k|{
  188|       |	// Expat delivers the full name as a catenation of namespace URI, separator, and local name.
  189|       |
  190|       |	// As a compatibility hack, an "about" or "ID" attribute of an rdf:Description element is
  191|       |	// changed to "rdf:about" or rdf:ID. Easier done here than in the RDF recognizer.
  192|       |	
  193|       |	// As a bug fix hack, change a URI of "http://purl.org/dc/1.1/" to ""http://purl.org/dc/elements/1.1/.
  194|       |	// Early versions of Flash that put XMP in SWF used a bad URI for the dc: namespace.
  195|       |
  196|       |	// ! This code presumes the RDF namespace prefix is "rdf".
  197|       |
  198|   250k|	size_t sepPos = strlen(fullName);
  199|  16.8M|	for ( --sepPos; sepPos > 0; --sepPos ) {
  ------------------
  |  Branch (199:18): [True: 16.8M, False: 5.12k]
  ------------------
  200|  16.8M|		if ( fullName[sepPos] == FullNameSeparator ) break;
  ------------------
  |  |   33|  16.8M|#define FullNameSeparator	'@'
  ------------------
  |  Branch (200:8): [True: 244k, False: 16.6M]
  ------------------
  201|  16.8M|	}
  202|       |
  203|   250k|	if ( fullName[sepPos] == FullNameSeparator ) {
  ------------------
  |  |   33|   250k|#define FullNameSeparator	'@'
  ------------------
  |  Branch (203:7): [True: 244k, False: 5.12k]
  ------------------
  204|       |
  205|   244k|		XMP_StringPtr prefix;
  206|   244k|		XMP_StringLen prefixLen;
  207|   244k|		XMP_StringPtr localPart = fullName + sepPos + 1;
  208|       |
  209|   244k|		node->ns.assign ( fullName, sepPos );
  210|   244k|		if ( node->ns == "http://purl.org/dc/1.1/" ) node->ns = "http://purl.org/dc/elements/1.1/";
  ------------------
  |  Branch (210:8): [True: 398, False: 244k]
  ------------------
  211|       |
  212|   244k|		bool found = XMPMeta::GetNamespacePrefix ( node->ns.c_str(), &prefix, &prefixLen );
  213|   244k|		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: 244k]
  ------------------
  214|   244k|		node->nsPrefixLen = prefixLen;	// ! Includes the ':'.
  215|       |		
  216|   244k|		node->name = prefix;
  217|   244k|		node->name += localPart;
  218|       |
  219|   244k|	} else {
  220|       |
  221|  5.12k|		node->name = fullName;	// The name is not in a namespace.
  222|       |	
  223|  5.12k|		if ( node->parent->name == "rdf:Description" ) {
  ------------------
  |  Branch (223:8): [True: 2.02k, False: 3.09k]
  ------------------
  224|  2.02k|			if ( node->name == "about" ) {
  ------------------
  |  Branch (224:9): [True: 76, False: 1.95k]
  ------------------
  225|     76|				node->ns   = kXMP_NS_RDF;
  226|     76|				node->name = "rdf:about";
  227|     76|				node->nsPrefixLen = 4;	// ! Include the ':'.
  228|  1.95k|			} else if ( node->name == "ID" ) {
  ------------------
  |  Branch (228:16): [True: 127, False: 1.82k]
  ------------------
  229|    127|				node->ns   = kXMP_NS_RDF;
  230|    127|				node->name = "rdf:ID";
  231|    127|				node->nsPrefixLen = 4;	// ! Include the ':'.
  232|    127|			}
  233|  2.02k|		}
  234|       |		
  235|  5.12k|	}
  236|       |
  237|   250k|}	// SetQualName
ExpatAdapter.cpp:_ZL17EndElementHandlerPvPKc:
  349|   104k|{
  350|   104k|	IgnoreParam(name);
  ------------------
  |  |  117|   104k|#define IgnoreParam(p)	(void)p
  ------------------
  351|       |	
  352|   104k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  353|       |
  354|       |	#if XMP_DebugBuild
  355|       |		--thiz->elemNesting;
  356|       |	#endif
  357|   104k|	(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|   104k|}	// EndElementHandler
ExpatAdapter.cpp:_ZL20CharacterDataHandlerPvPKci:
  371|  2.30M|{
  372|  2.30M|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  373|       |	
  374|  2.30M|	if ( (cData == 0) || (len == 0) ) { cData = ""; len = 0; }
  ------------------
  |  Branch (374:7): [True: 0, False: 2.30M]
  |  Branch (374:23): [True: 0, False: 2.30M]
  ------------------
  375|       |	
  376|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  377|       |		if ( thiz->parseLog != 0 ) {
  378|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  379|       |			fprintf ( thiz->parseLog, "CharContent: \"" );
  380|       |			for ( int i = 0; i < len; ++i ) fprintf ( thiz->parseLog, "%c", cData[i] );
  381|       |			fprintf ( thiz->parseLog, "\"\n" );
  382|       |		}
  383|       |	#endif
  384|       |	
  385|  2.30M|	XML_Node * parentNode = thiz->parseStack.back();
  386|  2.30M|	XML_Node * cDataNode  = new XML_Node ( parentNode, "", kCDataNode );
  387|       |	
  388|  2.30M|	cDataNode->value.assign ( cData, len );
  389|  2.30M|	parentNode->content.push_back ( cDataNode );
  390|       |	
  391|  2.30M|}	// CharacterDataHandler
ExpatAdapter.cpp:_ZL28ProcessingInstructionHandlerPvPKcS1_:
  436|  3.39k|{
  437|  3.39k|	XMP_Assert ( target != 0 );
  ------------------
  |  |  142|  3.39k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  438|  3.39k|	ExpatAdapter * thiz = (ExpatAdapter*)userData;
  439|       |
  440|  3.39k|	if ( ! XMP_LitMatch ( target, "xpacket" ) ) return;	// Ignore all PIs except the XMP packet wrapper.
  ------------------
  |  |   96|  3.39k|#define XMP_LitMatch(s,l)		(std::strcmp((s),(l)) == 0)
  ------------------
  |  Branch (440:7): [True: 868, False: 2.52k]
  ------------------
  441|  2.52k|	if ( data == 0 ) data = "";
  ------------------
  |  Branch (441:7): [True: 0, False: 2.52k]
  ------------------
  442|       |	
  443|       |	#if XMP_DebugBuild & DumpXMLParseEvents
  444|       |		if ( thiz->parseLog != 0 ) {
  445|       |			PrintIndent ( thiz->parseLog, thiz->elemNesting );
  446|       |			fprintf ( thiz->parseLog, "PI: %s - \"%s\"\n", target, data );
  447|       |		}
  448|       |	#endif
  449|       |	
  450|  2.52k|	XML_Node * parentNode = thiz->parseStack.back();
  451|  2.52k|	XML_Node * piNode  = new XML_Node ( parentNode, target, kPINode );
  452|       |	
  453|  2.52k|	piNode->value.assign ( data );
  454|  2.52k|	parentNode->content.push_back ( piNode );
  455|       |	
  456|  2.52k|}	// ProcessingInstructionHandler

_Z10ProcessRDFP8XMP_NodeRK8XML_Nodej:
  624|  6.93k|{
  625|  6.93k|	IgnoreParam(options);
  ------------------
  |  |  117|  6.93k|#define IgnoreParam(p)	(void)p
  ------------------
  626|       |	
  627|  6.93k|	RDF_RDF ( xmpTree, rdfNode );
  628|       |
  629|  6.93k|}	// ProcessRDF
ParseRDF.cpp:_ZL7RDF_RDFP8XMP_NodeRK8XML_Node:
  646|  6.93k|{
  647|       |
  648|  6.93k|	if ( ! xmlNode.attrs.empty() ) XMP_Throw ( "Invalid attributes of rdf:RDF element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (648:7): [True: 10, False: 6.92k]
  ------------------
  649|  6.92k|	RDF_NodeElementList ( xmpTree, xmlNode, kIsTopLevel );
  650|       |
  651|  6.92k|}	// RDF_RDF
ParseRDF.cpp:_ZL19RDF_NodeElementListP8XMP_NodeRK8XML_Nodeb:
  663|  6.92k|{
  664|  6.92k|	XMP_Assert ( isTopLevel );
  ------------------
  |  |  142|  6.92k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  665|       |	
  666|  6.92k|	XML_cNodePos currChild = xmlParent.content.begin();	// *** Change these loops to the indexed pattern.
  667|  6.92k|	XML_cNodePos endChild  = xmlParent.content.end();
  668|       |
  669|  31.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (669:10): [True: 24.7k, False: 6.92k]
  ------------------
  670|  24.7k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (670:8): [True: 17.5k, False: 7.16k]
  ------------------
  671|  7.16k|		RDF_NodeElement ( xmpParent, **currChild, isTopLevel );
  672|  7.16k|	}
  673|       |
  674|  6.92k|}	// RDF_NodeElementList
ParseRDF.cpp:_ZL15RDF_NodeElementP8XMP_NodeRK8XML_Nodeb:
  694|  12.7k|{
  695|  12.7k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  696|  12.7k|	if ( (nodeTerm != kRDFTerm_Description) && (nodeTerm != kRDFTerm_Other) ) {
  ------------------
  |  Branch (696:7): [True: 5.56k, False: 7.16k]
  |  Branch (696:45): [True: 9, False: 5.55k]
  ------------------
  697|      9|		XMP_Throw ( "Node element must be rdf:Description or typedNode", kXMPErr_BadRDF );
  ------------------
  |  |  199|      9|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  698|      0|	}
  699|       |
  700|  12.7k|	if ( isTopLevel && (nodeTerm == kRDFTerm_Other) ) {
  ------------------
  |  Branch (700:7): [True: 7.15k, False: 5.57k]
  |  Branch (700:21): [True: 139, False: 7.01k]
  ------------------
  701|    139|		XMP_Throw ( "Top level typedNode not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    139|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  702|  12.5k|	} else {
  703|  12.5k|		RDF_NodeElementAttrs ( xmpParent, xmlNode, isTopLevel );
  704|  12.5k|		RDF_PropertyElementList ( xmpParent, xmlNode, isTopLevel );
  705|  12.5k|	}
  706|       |
  707|  12.7k|}	// RDF_NodeElement
ParseRDF.cpp:_ZL14GetRDFTermKindRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  264|   295k|{
  265|   295k|	RDFTermKind term = kRDFTerm_Other;
  266|       |
  267|       |	// Arranged to hopefully minimize the parse time for large XMP.
  268|       |
  269|   295k|	if ( (name.size() > 4) && (strncmp ( name.c_str(), "rdf:", 4 ) == 0) ) {
  ------------------
  |  Branch (269:7): [True: 295k, False: 406]
  |  Branch (269:28): [True: 81.2k, False: 214k]
  ------------------
  270|       |
  271|  81.2k|		if ( name == "rdf:li" ) {
  ------------------
  |  Branch (271:8): [True: 50.7k, False: 30.4k]
  ------------------
  272|  50.7k|			term = kRDFTerm_li;
  273|  50.7k|		} else if ( name == "rdf:parseType" ) {
  ------------------
  |  Branch (273:15): [True: 25, False: 30.4k]
  ------------------
  274|     25|			term = kRDFTerm_parseType;
  275|  30.4k|		} else if ( name == "rdf:Description" ) {
  ------------------
  |  Branch (275:15): [True: 7.17k, False: 23.2k]
  ------------------
  276|  7.17k|			term = kRDFTerm_Description;
  277|  23.2k|		} else if ( name == "rdf:about" ) {
  ------------------
  |  Branch (277:15): [True: 1.45k, False: 21.7k]
  ------------------
  278|  1.45k|			term = kRDFTerm_about;
  279|  21.7k|		} else if ( name == "rdf:resource" ) {
  ------------------
  |  Branch (279:15): [True: 55, False: 21.7k]
  ------------------
  280|     55|			term = kRDFTerm_resource;
  281|  21.7k|		} else if ( name == "rdf:RDF" ) {
  ------------------
  |  Branch (281:15): [True: 29, False: 21.7k]
  ------------------
  282|     29|			term = kRDFTerm_RDF;
  283|  21.7k|		} else if ( name == "rdf:ID" ) {
  ------------------
  |  Branch (283:15): [True: 541, False: 21.1k]
  ------------------
  284|    541|			term = kRDFTerm_ID;
  285|  21.1k|		} else if ( name == "rdf:nodeID" ) {
  ------------------
  |  Branch (285:15): [True: 130, False: 21.0k]
  ------------------
  286|    130|			term = kRDFTerm_nodeID;
  287|  21.0k|		} else if ( name == "rdf:datatype" ) {
  ------------------
  |  Branch (287:15): [True: 6, False: 21.0k]
  ------------------
  288|      6|			term = kRDFTerm_datatype;
  289|  21.0k|		} else if ( name == "rdf:aboutEach" ) {
  ------------------
  |  Branch (289:15): [True: 10, False: 21.0k]
  ------------------
  290|     10|			term = kRDFTerm_aboutEach;
  291|  21.0k|		} else if ( name == "rdf:aboutEachPrefix" ) {
  ------------------
  |  Branch (291:15): [True: 0, False: 21.0k]
  ------------------
  292|      0|			term = kRDFTerm_aboutEachPrefix;
  293|  21.0k|		} else if ( name == "rdf:bagID" ) {
  ------------------
  |  Branch (293:15): [True: 12, False: 21.0k]
  ------------------
  294|     12|			term = kRDFTerm_bagID;
  295|     12|		}
  296|       |
  297|  81.2k|	}
  298|       |
  299|   295k|	return term;
  300|       |
  301|   295k|}	// GetRDFTermKind
ParseRDF.cpp:_ZL20RDF_NodeElementAttrsP8XMP_NodeRK8XML_Nodeb:
  731|  12.5k|{
  732|  12.5k|	XMP_OptionBits exclusiveAttrs = 0;	// Used to detect attributes that are mutually exclusive.
  733|       |
  734|  12.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  735|  12.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  736|       |
  737|  36.3k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (737:10): [True: 24.2k, False: 12.1k]
  ------------------
  738|       |
  739|  24.2k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
  740|       |
  741|  24.2k|		switch ( attrTerm ) {
  742|       |
  743|    445|			case kRDFTerm_ID     :
  ------------------
  |  Branch (743:4): [True: 445, False: 23.8k]
  ------------------
  744|    477|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (744:4): [True: 32, False: 24.2k]
  ------------------
  745|  1.91k|			case kRDFTerm_about  :
  ------------------
  |  Branch (745:4): [True: 1.43k, False: 22.8k]
  ------------------
  746|       |
  747|  1.91k|				if ( exclusiveAttrs & kExclusiveAttrMask ) XMP_Throw ( "Mutally exclusive about, ID, nodeID attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (747:10): [True: 10, False: 1.90k]
  ------------------
  748|  1.90k|				exclusiveAttrs |= (1 << attrTerm);
  749|       |
  750|  1.90k|				if ( isTopLevel && (attrTerm == kRDFTerm_about) ) {
  ------------------
  |  Branch (750:10): [True: 1.84k, False: 61]
  |  Branch (750:24): [True: 1.43k, False: 413]
  ------------------
  751|       |					// This is the rdf:about attribute on a top level node. Set the XMP tree name if
  752|       |					// it doesn't have a name yet. Make sure this name matches the XMP tree name.
  753|  1.43k|					XMP_Assert ( xmpParent->parent == 0 );	// Must be the tree root node.
  ------------------
  |  |  142|  1.43k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  754|  1.43k|					if ( xmpParent->name.empty() ) {
  ------------------
  |  Branch (754:11): [True: 1.28k, False: 144]
  ------------------
  755|  1.28k|						xmpParent->name = (*currAttr)->value;
  756|  1.28k|					} else if ( ! (*currAttr)->value.empty() ) {
  ------------------
  |  Branch (756:18): [True: 136, False: 8]
  ------------------
  757|    136|						if ( xmpParent->name != (*currAttr)->value ) XMP_Throw ( "Mismatched top level rdf:about values", kXMPErr_BadXMP );
  ------------------
  |  |  199|     96|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (757:12): [True: 96, False: 40]
  ------------------
  758|     40|					}
  759|  1.43k|				}
  760|       |
  761|  1.80k|				break;
  762|       |
  763|  22.2k|			case kRDFTerm_Other :
  ------------------
  |  Branch (763:4): [True: 22.2k, False: 1.96k]
  ------------------
  764|  22.2k|				AddChildNode ( xmpParent, **currAttr, (*currAttr)->value.c_str(), isTopLevel );
  765|  22.2k|				break;
  766|       |
  767|     45|			default :
  ------------------
  |  Branch (767:4): [True: 45, False: 24.2k]
  ------------------
  768|     45|				XMP_Throw ( "Invalid nodeElement attribute", kXMPErr_BadRDF );
  ------------------
  |  |  199|     45|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  769|       |
  770|  24.2k|		}
  771|       |
  772|  24.2k|	}
  773|       |
  774|  12.5k|}	// RDF_NodeElementAttrs
ParseRDF.cpp:_ZL12AddChildNodeP8XMP_NodeRK8XML_NodePKcb:
  362|   125k|{
  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|   125k|	if ( xmlNode.ns.empty() ) {
  ------------------
  |  Branch (370:7): [True: 386, False: 124k]
  ------------------
  371|    386|		XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|    386|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  372|      0|	}
  373|       |		
  374|   124k|	XMP_StringPtr  childName    = xmlNode.name.c_str();
  375|   124k|	const bool     isArrayItem  = (xmlNode.name == "rdf:li");
  376|   124k|	const bool     isValueNode  = (xmlNode.name == "rdf:value");
  377|   124k|	XMP_OptionBits childOptions = 0;
  378|       |	
  379|   124k|	if ( isTopLevel ) {
  ------------------
  |  Branch (379:7): [True: 32.1k, False: 92.6k]
  ------------------
  380|       |
  381|       |		// Lookup the schema node, adjust the XMP parent pointer.
  382|  32.1k|		XMP_Assert ( xmpParent->parent == 0 );	// Incoming parent must be the tree root.
  ------------------
  |  |  142|  32.1k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  383|  32.1k|		XMP_Node * schemaNode = FindSchemaNode ( xmpParent, xmlNode.ns.c_str(), kXMP_CreateNodes );
  ------------------
  |  |  295|  32.1k|#define kXMP_CreateNodes	true
  ------------------
  384|  32.1k|		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  32.1k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
              		if ( schemaNode->options & kXMP_NewImplicitNode ) schemaNode->options ^= kXMP_NewImplicitNode;	// Clear the implicit node bit.
  ------------------
  |  |  410|  15.5k|#define kXMP_NewImplicitNode	kXMP_InsertAfterItem
  ------------------
  |  Branch (384:8): [True: 15.5k, False: 16.5k]
  ------------------
  385|       |			// *** Should use "opt &= ~flag" (no conditional), need runtime check for proper 32 bit code.
  386|  32.1k|		xmpParent = schemaNode;
  387|       |		
  388|       |		// If this is an alias set the isAlias flag in the node and the hasAliases flag in the tree.
  389|  32.1k|		if ( sRegisteredAliasMap->find ( xmlNode.name ) != sRegisteredAliasMap->end() ) {
  ------------------
  |  Branch (389:8): [True: 0, False: 32.1k]
  ------------------
  390|      0|			childOptions |= kXMP_PropIsAlias;
  391|      0|			schemaNode->parent->options |= kXMP_PropHasAliases;
  392|      0|		}
  393|       |		
  394|  32.1k|	}
  395|       |
  396|       |	// Make sure that this is not a duplicate of a named node.
  397|   124k|	if ( ! (isArrayItem | isValueNode) ) {
  ------------------
  |  Branch (397:7): [True: 73.9k, False: 50.8k]
  ------------------
  398|  73.9k|		if ( FindChildNode ( xmpParent, childName, kXMP_ExistingOnly ) != 0 ) {
  ------------------
  |  |  296|  73.9k|#define kXMP_ExistingOnly	false
  ------------------
  |  Branch (398:8): [True: 44, False: 73.9k]
  ------------------
  399|     44|			XMP_Throw ( "Duplicate property or field node", kXMPErr_BadXMP );
  ------------------
  |  |  199|     44|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  400|      0|		}
  401|       |		
  402|  73.9k|	}
  403|       |	
  404|       |	// Add the new child to the XMP parent node.
  405|   124k|	XMP_Node * newChild = new XMP_Node ( xmpParent, childName, value, childOptions );
  406|   124k|	if ( (! isValueNode) || xmpParent->children.empty() ) {
  ------------------
  |  Branch (406:7): [True: 124k, False: 175]
  |  Branch (406:26): [True: 106, False: 69]
  ------------------
  407|   124k|		 xmpParent->children.push_back ( newChild );
  408|   124k|	} else {
  409|    103|		 xmpParent->children.insert ( xmpParent->children.begin(), newChild );
  410|    103|	}
  411|   124k|	if ( isValueNode ) {
  ------------------
  |  Branch (411:7): [True: 175, False: 124k]
  ------------------
  412|    175|		if ( isTopLevel || (! (xmpParent->options & kXMP_PropValueIsStruct)) ) XMP_Throw ( "Misplaced rdf:value element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     19|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (412:8): [True: 19, False: 156]
  |  Branch (412:22): [True: 0, False: 156]
  ------------------
  413|    156|		xmpParent->options |= kRDF_HasValueElem;
  414|    156|	}
  415|       |	
  416|   124k|	if ( isArrayItem ) {
  ------------------
  |  Branch (416:7): [True: 50.6k, False: 74.0k]
  ------------------
  417|  50.6k|		if ( ! (xmpParent->options & kXMP_PropValueIsArray) ) XMP_Throw ( "Misplaced rdf:li element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      3|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (417:8): [True: 3, False: 50.6k]
  ------------------
  418|  50.6k|		newChild->name = kXMP_ArrayItemName;
  ------------------
  |  |  293|  50.6k|#define kXMP_ArrayItemName	"[]"
  ------------------
  419|       |		#if 0	// *** XMP_DebugBuild
  420|       |			newChild->_namePtr = newChild->name.c_str();
  421|       |		#endif
  422|  50.6k|	}
  423|       |	
  424|   124k|	return newChild;
  425|       |
  426|   124k|}	// AddChildNode
ParseRDF.cpp:_ZL23RDF_PropertyElementListP8XMP_NodeRK8XML_Nodeb:
  786|  12.5k|{
  787|  12.5k|	XML_cNodePos currChild = xmlParent.content.begin();
  788|  12.5k|	XML_cNodePos endChild  = xmlParent.content.end();
  789|       |
  790|   213k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (790:10): [True: 200k, False: 12.3k]
  ------------------
  791|   200k|		if ( (*currChild)->IsWhitespaceNode() ) continue;
  ------------------
  |  Branch (791:8): [True: 136k, False: 63.9k]
  ------------------
  792|  63.9k|		if ( (*currChild)->kind != kElemNode ) {
  ------------------
  |  Branch (792:8): [True: 168, False: 63.7k]
  ------------------
  793|    168|			XMP_Throw ( "Expected property element node not found", kXMPErr_BadRDF );
  ------------------
  |  |  199|    168|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  794|      0|		}
  795|  63.7k|		RDF_PropertyElement ( xmpParent, **currChild, isTopLevel );
  796|  63.7k|	}
  797|       |
  798|  12.5k|}	// RDF_PropertyElementList
ParseRDF.cpp:_ZL19RDF_PropertyElementP8XMP_NodeRK8XML_Nodeb:
  853|  63.7k|{
  854|  63.7k|	RDFTermKind nodeTerm = GetRDFTermKind ( xmlNode.name );
  855|  63.7k|	if ( ! IsPropertyElementName ( nodeTerm ) ) XMP_Throw ( "Invalid property element name", kXMPErr_BadRDF );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (855:7): [True: 35, False: 63.7k]
  ------------------
  856|       |	
  857|  63.7k|	if ( xmlNode.attrs.size() > 3 ) {
  ------------------
  |  Branch (857:7): [True: 7.55k, False: 56.1k]
  ------------------
  858|       |
  859|       |		// Only an emptyPropertyElt can have more than 3 attributes.
  860|  7.55k|		RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  861|       |
  862|  56.1k|	} 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|  56.1k|		XML_cNodePos currAttr = xmlNode.attrs.begin();
  868|  56.1k|		XML_cNodePos endAttr  = xmlNode.attrs.end();
  869|  56.1k|		XMP_VarString * attrName = 0;
  870|       |
  871|  73.9k|		for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (871:11): [True: 26.2k, False: 47.6k]
  ------------------
  872|  26.2k|			attrName = &((*currAttr)->name);
  873|  26.2k|			if ( (*attrName != "xml:lang") && (*attrName != "rdf:ID") ) break;
  ------------------
  |  Branch (873:9): [True: 8.50k, False: 17.7k]
  |  Branch (873:38): [True: 8.48k, False: 16]
  ------------------
  874|  26.2k|		}
  875|       |
  876|  56.1k|		if ( currAttr != endAttr ) {
  ------------------
  |  Branch (876:8): [True: 8.48k, False: 47.6k]
  ------------------
  877|       |
  878|  8.48k|			XMP_Assert ( attrName != 0 );
  ------------------
  |  |  142|  8.48k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  879|  8.48k|			XMP_VarString& attrValue = (*currAttr)->value;
  880|       |
  881|  8.48k|			if ( *attrName == "rdf:datatype" ) {
  ------------------
  |  Branch (881:9): [True: 83, False: 8.40k]
  ------------------
  882|     83|				RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  883|  8.40k|			} else if ( *attrName != "rdf:parseType" ) {
  ------------------
  |  Branch (883:16): [True: 7.84k, False: 560]
  ------------------
  884|  7.84k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  885|  7.84k|			} else if ( attrValue == "Literal" ) {
  ------------------
  |  Branch (885:16): [True: 6, False: 554]
  ------------------
  886|      6|				RDF_ParseTypeLiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  887|    554|			} else if ( attrValue == "Resource" ) {
  ------------------
  |  Branch (887:16): [True: 415, False: 139]
  ------------------
  888|    415|				RDF_ParseTypeResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  889|    415|			} else if ( attrValue == "Collection" ) {
  ------------------
  |  Branch (889:16): [True: 10, False: 129]
  ------------------
  890|     10|				RDF_ParseTypeCollectionPropertyElement ( xmpParent, xmlNode, isTopLevel );
  891|    129|			} else {
  892|    129|				RDF_ParseTypeOtherPropertyElement ( xmpParent, xmlNode, isTopLevel );
  893|    129|			}
  894|       |
  895|  47.6k|		} else {
  896|       |
  897|       |			// Only rdf:ID and xml:lang, could be a resourcePropertyElt, a literalPropertyElt, or an.
  898|       |			// emptyPropertyElt. Look at the child XML nodes to decide which.
  899|       |
  900|  47.6k|			if ( xmlNode.content.empty() ) {
  ------------------
  |  Branch (900:9): [True: 1.51k, False: 46.1k]
  ------------------
  901|       |
  902|  1.51k|				RDF_EmptyPropertyElement ( xmpParent, xmlNode, isTopLevel );
  903|       |
  904|  46.1k|			} else {
  905|       |			
  906|  46.1k|				XML_cNodePos currChild = xmlNode.content.begin();
  907|  46.1k|				XML_cNodePos endChild  = xmlNode.content.end();
  908|       |
  909|  2.10M|				for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (909:13): [True: 2.06M, False: 40.4k]
  ------------------
  910|  2.06M|					if ( (*currChild)->kind != kCDataNode ) break;
  ------------------
  |  Branch (910:11): [True: 5.67k, False: 2.05M]
  ------------------
  911|  2.06M|				}
  912|       |				
  913|  46.1k|				if ( currChild == endChild ) {
  ------------------
  |  Branch (913:10): [True: 40.4k, False: 5.67k]
  ------------------
  914|  40.4k|					RDF_LiteralPropertyElement ( xmpParent, xmlNode, isTopLevel );
  915|  40.4k|				} else {
  916|  5.67k|					RDF_ResourcePropertyElement ( xmpParent, xmlNode, isTopLevel );
  917|  5.67k|				}
  918|       |			
  919|  46.1k|			}
  920|       |
  921|  47.6k|		}
  922|       |		
  923|  56.1k|	}
  924|       |
  925|  63.7k|}	// RDF_PropertyElement
ParseRDF.cpp:_ZL21IsPropertyElementNameh:
  349|  63.7k|{
  350|       |
  351|  63.7k|	if 	( (term == kRDFTerm_Description) || IsOldTerm ( term ) ) return false;
  ------------------
  |  Branch (351:8): [True: 14, False: 63.7k]
  |  Branch (351:42): [True: 0, False: 63.7k]
  ------------------
  352|  63.7k|	return (! IsCoreSyntaxTerm ( term ));
  353|       |
  354|  63.7k|}	// IsPropertyElementName
ParseRDF.cpp:_ZL9IsOldTermh:
  333|  63.7k|{
  334|       |
  335|  63.7k|	if 	( (kRDFTerm_FirstOld <= term) && (term <= kRDFTerm_LastOld) ) return true;
  ------------------
  |  Branch (335:8): [True: 0, False: 63.7k]
  |  Branch (335:39): [True: 0, False: 0]
  ------------------
  336|  63.7k|	return false;
  337|       |
  338|  63.7k|}	// IsOldTerm
ParseRDF.cpp:_ZL16IsCoreSyntaxTermh:
  316|  63.7k|{
  317|       |
  318|  63.7k|	if 	( (kRDFTerm_FirstCore <= term) && (term <= kRDFTerm_LastCore) ) return true;
  ------------------
  |  Branch (318:8): [True: 50.7k, False: 12.9k]
  |  Branch (318:40): [True: 21, False: 50.7k]
  ------------------
  319|  63.7k|	return false;
  320|       |
  321|  63.7k|}	// IsCoreSyntaxTerm
ParseRDF.cpp:_ZL24RDF_EmptyPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1189|  16.9k|{
 1190|  16.9k|	bool hasPropertyAttrs = false;
 1191|  16.9k|	bool hasResourceAttr  = false;
 1192|  16.9k|	bool hasNodeIDAttr    = false;
 1193|  16.9k|	bool hasValueAttr     = false;
 1194|       |	
 1195|  16.9k|	const XML_Node * valueNode = 0;	// ! Can come from rdf:value or rdf:resource.
 1196|       |	
 1197|  16.9k|	if ( ! xmlNode.content.empty() ) XMP_Throw ( "Nested content not allowed with rdf:resource or property attributes", kXMPErr_BadRDF );
  ------------------
  |  |  199|     67|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1197:7): [True: 67, False: 16.8k]
  ------------------
 1198|       |	
 1199|       |	// First figure out what XMP this maps to and remember the XML node for a simple value.
 1200|       |	
 1201|  16.8k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1202|  16.8k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1203|       |
 1204|   115k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1204:10): [True: 98.9k, False: 16.7k]
  ------------------
 1205|       |
 1206|  98.9k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1207|       |
 1208|  98.9k|		switch ( attrTerm ) {
 1209|       |
 1210|     48|			case kRDFTerm_ID :
  ------------------
  |  Branch (1210:4): [True: 48, False: 98.8k]
  ------------------
 1211|       |				// Nothing to do.
 1212|     48|				break;
 1213|       |
 1214|     55|			case kRDFTerm_resource :
  ------------------
  |  Branch (1214:4): [True: 55, False: 98.8k]
  ------------------
 1215|     55|				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: 55]
  ------------------
 1216|     55|				if ( hasValueAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1216:10): [True: 10, False: 45]
  ------------------
 1217|     45|				hasResourceAttr = true;
 1218|     45|				if ( ! hasValueAttr ) valueNode = *currAttr;
  ------------------
  |  Branch (1218:10): [True: 45, False: 0]
  ------------------
 1219|     45|				break;
 1220|       |
 1221|     54|			case kRDFTerm_nodeID :
  ------------------
  |  Branch (1221:4): [True: 54, False: 98.8k]
  ------------------
 1222|     54|				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: 44]
  ------------------
 1223|     44|				hasNodeIDAttr = true;
 1224|     44|				break;
 1225|       |
 1226|  98.7k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1226:4): [True: 98.7k, False: 192]
  ------------------
 1227|  98.7k|				if ( (*currAttr)->name == "rdf:value" ) {
  ------------------
  |  Branch (1227:10): [True: 2.47k, False: 96.2k]
  ------------------
 1228|  2.47k|					if ( hasResourceAttr ) XMP_Throw ( "Empty property element can't have both rdf:value and rdf:resource", kXMPErr_BadXMP );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1228:11): [True: 0, False: 2.47k]
  ------------------
 1229|  2.47k|					hasValueAttr = true;
 1230|  2.47k|					valueNode = *currAttr;
 1231|  96.2k|				} else if ( (*currAttr)->name != "xml:lang" ) {
  ------------------
  |  Branch (1231:17): [True: 95.2k, False: 1.04k]
  ------------------
 1232|  95.2k|					hasPropertyAttrs = true;
 1233|  95.2k|				}
 1234|  98.7k|				break;
 1235|       |
 1236|  98.7k|			default :
  ------------------
  |  Branch (1236:4): [True: 35, False: 98.9k]
  ------------------
 1237|     35|				XMP_Throw ( "Unrecognized attribute of empty property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     35|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1238|      0|				break;
 1239|       |
 1240|  98.9k|		}
 1241|       |
 1242|  98.9k|	}
 1243|       |	
 1244|       |	// Create the right kind of child node and visit the attributes again to add the fields or qualifiers.
 1245|       |	// ! Because of implementation vagaries, the xmpParent is the tree root for top level properties.
 1246|       |	// ! The schema is found, created if necessary, by AddChildNode.
 1247|       |	
 1248|  16.7k|	XMP_Node * childNode = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1249|  16.7k|	bool childIsStruct = false;
 1250|       |	
 1251|  16.7k|	if ( hasValueAttr | hasResourceAttr ) {
  ------------------
  |  Branch (1251:7): [True: 2.49k, False: 14.2k]
  ------------------
 1252|  2.49k|		childNode->value = valueNode->value;
 1253|  2.49k|		if ( ! hasValueAttr ) childNode->options |= kXMP_PropValueIsURI;	// ! Might have both rdf:value and rdf:resource.
  ------------------
  |  Branch (1253:8): [True: 35, False: 2.46k]
  ------------------
 1254|  14.2k|	} else if ( hasPropertyAttrs ) {
  ------------------
  |  Branch (1254:14): [True: 12.6k, False: 1.61k]
  ------------------
 1255|  12.6k|		childNode->options |= kXMP_PropValueIsStruct;
 1256|  12.6k|		childIsStruct = true;
 1257|  12.6k|	}
 1258|       |		
 1259|  16.7k|	currAttr = xmlNode.attrs.begin();
 1260|  16.7k|	endAttr  = xmlNode.attrs.end();
 1261|       |
 1262|   115k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1262:10): [True: 98.6k, False: 16.6k]
  ------------------
 1263|       |
 1264|  98.6k|		if ( *currAttr == valueNode ) continue;	// Skip the rdf:value or rdf:resource attribute holding the value.
  ------------------
  |  Branch (1264:8): [True: 2.48k, False: 96.1k]
  ------------------
 1265|  96.1k|		RDFTermKind attrTerm = GetRDFTermKind ( (*currAttr)->name );
 1266|       |
 1267|  96.1k|		switch ( attrTerm ) {
 1268|       |
 1269|     48|			case kRDFTerm_ID       :
  ------------------
  |  Branch (1269:4): [True: 48, False: 96.1k]
  ------------------
 1270|     92|			case kRDFTerm_nodeID   :
  ------------------
  |  Branch (1270:4): [True: 44, False: 96.1k]
  ------------------
 1271|     92|				break;	// Ignore all rdf:ID and rdf:nodeID attributes.w
 1272|       |				
 1273|      0|			case kRDFTerm_resource :
  ------------------
  |  Branch (1273:4): [True: 0, False: 96.1k]
  ------------------
 1274|      0|				AddQualifierNode ( childNode, **currAttr );
 1275|      0|				break;
 1276|       |
 1277|  96.0k|			case kRDFTerm_Other :
  ------------------
  |  Branch (1277:4): [True: 96.0k, False: 92]
  ------------------
 1278|  96.0k|				if ( (! childIsStruct) || (*currAttr)->name == "xml:lang" ) {
  ------------------
  |  Branch (1278:10): [True: 56.6k, False: 39.4k]
  |  Branch (1278:31): [True: 13, False: 39.4k]
  ------------------
 1279|  56.6k|					AddQualifierNode ( childNode, **currAttr );
 1280|  56.6k|				} else {
 1281|  39.4k|					AddChildNode ( childNode, **currAttr, (*currAttr)->value.c_str(), false );
 1282|  39.4k|				}
 1283|  96.0k|				break;
 1284|       |
 1285|      0|			default :
  ------------------
  |  Branch (1285:4): [True: 0, False: 96.1k]
  ------------------
 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|  96.1k|		}
 1290|       |
 1291|  96.1k|	}
 1292|       |
 1293|  16.7k|}	// RDF_EmptyPropertyElement
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRK8XML_Node:
  483|  73.3k|{
  484|  73.3k|	if ( attr.ns.empty() ) {
  ------------------
  |  Branch (484:7): [True: 24, False: 73.3k]
  ------------------
  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|  73.3k|	return AddQualifierNode ( xmpParent, attr.name, attr.value );
  489|       |
  490|  73.3k|}	// AddQualifierNode
ParseRDF.cpp:_ZL16AddQualifierNodeP8XMP_NodeRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  435|  73.6k|{
  436|       |
  437|       |	#if 0
  438|       |		cout << "AddQualifierNode, parent = " << xmpParent->name << ", name = " << name;
  439|       |		cout << ", value = \"" << value << '"' << endl;
  440|       |	#endif
  441|       |	
  442|  73.6k|	const bool isLang = (name == "xml:lang");
  443|  73.6k|	const bool isType = (name == "rdf:type");
  444|       |
  445|  73.6k|	XMP_Node * newQual = 0;
  446|       |
  447|  73.6k|		newQual = new XMP_Node ( xmpParent, name, value, kXMP_PropIsQualifier );
  448|       |
  449|  73.6k|		if ( ! (isLang | isType) ) {
  ------------------
  |  Branch (449:8): [True: 55.5k, False: 18.0k]
  ------------------
  450|  55.5k|			xmpParent->qualifiers.push_back ( newQual );
  451|  55.5k|		} else if ( isLang ) {
  ------------------
  |  Branch (451:15): [True: 17.7k, False: 299]
  ------------------
  452|  17.7k|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (452:9): [True: 17.7k, False: 13]
  ------------------
  453|  17.7k|				xmpParent->qualifiers.push_back ( newQual );
  454|  17.7k|			} else {
  455|     13|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), newQual );
  456|     13|			}
  457|  17.7k|			xmpParent->options |= kXMP_PropHasLang;
  458|  17.7k|		} else {
  459|    299|			XMP_Assert ( isType );
  ------------------
  |  |  142|    299|	#define XMP_Assert(c)	((void) 0)
  ------------------
  460|    299|			if ( xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (460:9): [True: 159, False: 140]
  ------------------
  461|    159|				xmpParent->qualifiers.push_back ( newQual );
  462|    159|			} else {
  463|    140|				size_t offset = 0;
  464|    140|				if ( XMP_PropHasLang ( xmpParent->options ) ) offset = 1;
  ------------------
  |  Branch (464:10): [True: 126, False: 14]
  ------------------
  465|    140|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin()+offset, newQual );
  466|    140|			}
  467|    299|			xmpParent->options |= kXMP_PropHasType;
  468|    299|		}
  469|       |
  470|  73.6k|		xmpParent->options |= kXMP_PropHasQualifiers;
  471|       |
  472|  73.6k|	return newQual;
  473|       |
  474|  73.6k|}	// AddQualifierNode
ParseRDF.cpp:_ZL26RDF_LiteralPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1014|  40.5k|{
 1015|  40.5k|	XMP_Node * newChild = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1016|       |	
 1017|  40.5k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1018|  40.5k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1019|       |
 1020|  57.2k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1020:10): [True: 16.6k, False: 40.5k]
  ------------------
 1021|  16.6k|		XMP_VarString & attrName = (*currAttr)->name;
 1022|  16.6k|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (1022:8): [True: 16.5k, False: 130]
  ------------------
 1023|  16.5k|			AddQualifierNode ( newChild, **currAttr );
 1024|  16.5k|		} else if ( (attrName == "rdf:ID") || (attrName == "rdf:datatype") ) {
  ------------------
  |  Branch (1024:15): [True: 3, False: 127]
  |  Branch (1024:41): [True: 83, False: 44]
  ------------------
 1025|     86|			continue;	// Ignore all rdf:ID and rdf:datatype attributes.
 1026|     86|		} else {
 1027|     44|			XMP_Throw ( "Invalid attribute for literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     44|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1028|      0|		}
 1029|  16.6k|	}
 1030|       |	
 1031|  40.5k|	XML_cNodePos currChild = xmlNode.content.begin();
 1032|  40.5k|	XML_cNodePos endChild  = xmlNode.content.end();
 1033|  40.5k|	size_t      textSize  = 0;
 1034|       |
 1035|  2.08M|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1035:10): [True: 2.04M, False: 40.5k]
  ------------------
 1036|  2.04M|		if ( (*currChild)->kind != kCDataNode ) XMP_Throw ( "Invalid child of literal property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1036:8): [True: 10, False: 2.04M]
  ------------------
 1037|  2.04M|		textSize += (*currChild)->value.size();
 1038|  2.04M|	}
 1039|       |	
 1040|  40.5k|	newChild->value.reserve ( textSize );
 1041|       |
 1042|  2.08M|	for ( currChild = xmlNode.content.begin(); currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (1042:45): [True: 2.04M, False: 40.5k]
  ------------------
 1043|  2.04M|		newChild->value += (*currChild)->value;
 1044|  2.04M|	}
 1045|       |
 1046|       |	#if 0	// *** XMP_DebugBuild
 1047|       |		newChild->_valuePtr = newChild->value.c_str();
 1048|       |	#endif
 1049|       |	
 1050|  40.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|    415|{
 1087|       |
 1088|    415|	XMP_Node * newStruct = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
 1089|    415|	newStruct->options  |= kXMP_PropValueIsStruct;
 1090|       |	
 1091|    415|	XML_cNodePos currAttr = xmlNode.attrs.begin();
 1092|    415|	XML_cNodePos endAttr  = xmlNode.attrs.end();
 1093|       |
 1094|    830|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (1094:10): [True: 415, False: 415]
  ------------------
 1095|    415|		XMP_VarString & attrName = (*currAttr)->name;
 1096|    415|		if ( attrName == "rdf:parseType" ) {
  ------------------
  |  Branch (1096:8): [True: 415, False: 0]
  ------------------
 1097|    415|			continue;	// ! The caller ensured the value is "Resource".
 1098|    415|		} 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|    415|	}
 1106|       |
 1107|    415|	RDF_PropertyElementList ( newStruct, xmlNode, kNotTopLevel );
 1108|       |
 1109|    415|	if ( newStruct->options & kRDF_HasValueElem ) FixupQualifiedNode ( newStruct );
  ------------------
  |  Branch (1109:7): [True: 0, False: 415]
  ------------------
 1110|       |	
 1111|       |	// *** Need to look for arrays using rdf:Description and rdf:type.
 1112|       |
 1113|    415|}	// RDF_ParseTypeResourcePropertyElement
ParseRDF.cpp:_ZL18FixupQualifiedNodeP8XMP_Node:
  504|    155|{
  505|    155|	size_t qualNum, qualLim;
  506|    155|	size_t childNum, childLim;
  507|       |
  508|    155|	XMP_Enforce ( (xmpParent->options & kXMP_PropValueIsStruct) && (! xmpParent->children.empty()) );
  ------------------
  |  |  148|    310|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:11): [True: 155, False: 0]
  |  |  |  Branch (148:11): [True: 155, 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|    155|	XMP_Node * valueNode = xmpParent->children[0];
  511|    155|	XMP_Enforce ( valueNode->name == "rdf:value" );
  ------------------
  |  |  148|    155|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 155]
  |  |  ------------------
  |  |  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|    155|	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|    155|	qualNum = 0;
  521|    155|	qualLim = valueNode->qualifiers.size();
  522|       |	
  523|    155|	if ( valueNode->options & kXMP_PropHasLang ) {
  ------------------
  |  Branch (523:7): [True: 0, False: 155]
  ------------------
  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|    155|	for ( ; qualNum != qualLim; ++qualNum ) {
  ------------------
  |  Branch (544:10): [True: 0, False: 155]
  ------------------
  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|    155|	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|    688|	for ( childNum = 1, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (562:61): [True: 544, False: 144]
  ------------------
  563|       |
  564|    544|		XMP_Node * currQual = xmpParent->children[childNum];
  565|       |	
  566|    544|			bool isLang = (currQual->name == "xml:lang");
  567|       |			
  568|    544|			currQual->options |= kXMP_PropIsQualifier;
  569|    544|			currQual->parent = xmpParent;
  570|       |
  571|    544|			if ( isLang ) {
  ------------------
  |  Branch (571:9): [True: 19, False: 525]
  ------------------
  572|     19|				if ( xmpParent->options & kXMP_PropHasLang ) XMP_Throw ( "Duplicate xml:lang qualifier", kXMPErr_BadXMP );
  ------------------
  |  |  199|     11|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (572:10): [True: 11, False: 8]
  ------------------
  573|      8|				xmpParent->options |= kXMP_PropHasLang;
  574|    525|			} else if ( currQual->name == "rdf:type" ) {
  ------------------
  |  Branch (574:16): [True: 20, False: 505]
  ------------------
  575|     20|				xmpParent->options |= kXMP_PropHasType;
  576|     20|			}
  577|       |
  578|    533|			if ( (! isLang) || xmpParent->qualifiers.empty() ) {
  ------------------
  |  Branch (578:9): [True: 525, False: 8]
  |  Branch (578:23): [True: 1, False: 7]
  ------------------
  579|    526|				xmpParent->qualifiers.push_back ( currQual );
  580|    526|			} else {
  581|      7|				xmpParent->qualifiers.insert ( xmpParent->qualifiers.begin(), currQual );
  582|      7|			}
  583|    533|			xmpParent->children[childNum] = 0;	// We just moved it to the qualifers.
  584|       |		
  585|    533|	}
  586|       |	
  587|    144|	if ( ! xmpParent->qualifiers.empty() ) xmpParent->options |= kXMP_PropHasQualifiers;
  ------------------
  |  Branch (587:7): [True: 144, 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|    144|	XMP_Assert ( xmpParent->options & (kXMP_PropValueIsStruct | kRDF_HasValueElem) );
  ------------------
  |  |  142|    144|	#define XMP_Assert(c)	((void) 0)
  ------------------
  593|    144|	xmpParent->options &= ~ (static_cast<unsigned long>(kXMP_PropValueIsStruct) | static_cast<unsigned long>(kRDF_HasValueElem));
  594|    144|	xmpParent->options |= valueNode->options;
  595|       |	
  596|    144|	xmpParent->value.swap ( valueNode->value );
  597|       |	#if 0	// *** XMP_DebugBuild
  598|       |		xmpParent->_valuePtr = xmpParent->value.c_str();
  599|       |	#endif
  600|       |
  601|    144|	xmpParent->children[0] = 0;	// ! Remove the value node itself before the swap.
  602|    144|	xmpParent->children.swap ( valueNode->children );
  603|       |	
  604|    144|	for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
  ------------------
  |  Branch (604:68): [True: 0, False: 144]
  ------------------
  605|      0|		XMP_Node * currChild = xmpParent->children[childNum];
  606|      0|		currChild->parent = xmpParent;
  607|      0|	}
  608|       |
  609|    144|	delete valueNode;
  610|       |	
  611|    144|}	// FixupQualifiedNode
ParseRDF.cpp:_ZL38RDF_ParseTypeCollectionPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1127|     10|{
 1128|     10|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|     10|#define IgnoreParam(p)	(void)p
  ------------------
 1129|       |
 1130|     10|	XMP_Throw ( "ParseTypeCollection property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|     10|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1131|       |
 1132|      0|}	// RDF_ParseTypeCollectionPropertyElement
ParseRDF.cpp:_ZL33RDF_ParseTypeOtherPropertyElementP8XMP_NodeRK8XML_Nodeb:
 1146|    129|{
 1147|    129|	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    129|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    129|#define IgnoreParam(p)	(void)p
  ------------------
              	IgnoreParam(xmpParent); IgnoreParam(xmlNode); IgnoreParam(isTopLevel); 
  ------------------
  |  |  117|    129|#define IgnoreParam(p)	(void)p
  ------------------
 1148|       |
 1149|    129|	XMP_Throw ( "ParseTypeOther property element not allowed", kXMPErr_BadXMP );
  ------------------
  |  |  199|    129|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1150|       |
 1151|      0|}	// RDF_ParseTypeOtherPropertyElement
ParseRDF.cpp:_ZL27RDF_ResourcePropertyElementP8XMP_NodeRK8XML_Nodeb:
  942|  5.67k|{
  943|  5.67k|	if ( isTopLevel && (xmlNode.name == "iX:changes") ) return;	// Strip old "punchcard" chaff.
  ------------------
  |  Branch (943:7): [True: 5.09k, False: 578]
  |  Branch (943:21): [True: 0, False: 5.09k]
  ------------------
  944|       |	
  945|  5.67k|	XMP_Node * newCompound = AddChildNode ( xmpParent, xmlNode, "", isTopLevel );
  946|       |	
  947|  5.67k|	XML_cNodePos currAttr = xmlNode.attrs.begin();
  948|  5.67k|	XML_cNodePos endAttr  = xmlNode.attrs.end();
  949|       |
  950|  5.86k|	for ( ; currAttr != endAttr; ++currAttr ) {
  ------------------
  |  Branch (950:10): [True: 187, False: 5.67k]
  ------------------
  951|    187|		XMP_VarString & attrName = (*currAttr)->name;
  952|    187|		if ( attrName == "xml:lang" ) {
  ------------------
  |  Branch (952:8): [True: 183, False: 4]
  ------------------
  953|    183|			AddQualifierNode ( newCompound, **currAttr );
  954|    183|		} else if ( attrName == "rdf:ID" ) {
  ------------------
  |  Branch (954:15): [True: 4, False: 0]
  ------------------
  955|      4|			continue;	// Ignore all rdf:ID attributes.
  956|      4|		} 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|    187|	}
  960|       |	
  961|  5.67k|	XML_cNodePos currChild = xmlNode.content.begin();
  962|  5.67k|	XML_cNodePos endChild  = xmlNode.content.end();
  963|       |
  964|  16.6k|	for ( ; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (964:10): [True: 16.6k, False: 0]
  ------------------
  965|  16.6k|		if ( ! (*currChild)->IsWhitespaceNode() ) break;
  ------------------
  |  Branch (965:8): [True: 5.67k, False: 10.9k]
  ------------------
  966|  16.6k|	}
  967|  5.67k|	if ( currChild == endChild ) XMP_Throw ( "Missing child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (967:7): [True: 0, False: 5.67k]
  ------------------
  968|  5.67k|	if ( (*currChild)->kind != kElemNode ) XMP_Throw ( "Children of resource property element must be XML elements", kXMPErr_BadRDF );
  ------------------
  |  |  199|     66|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (968:7): [True: 66, False: 5.61k]
  ------------------
  969|       |
  970|  5.61k|	if ( (*currChild)->name == "rdf:Bag" ) {
  ------------------
  |  Branch (970:7): [True: 161, False: 5.45k]
  ------------------
  971|    161|		newCompound->options |= kXMP_PropValueIsArray;
  972|  5.45k|	} else if ( (*currChild)->name == "rdf:Seq" ) {
  ------------------
  |  Branch (972:14): [True: 2.54k, False: 2.90k]
  ------------------
  973|  2.54k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered;
  974|  2.90k|	} else if ( (*currChild)->name == "rdf:Alt" ) {
  ------------------
  |  Branch (974:14): [True: 2.43k, False: 464]
  ------------------
  975|  2.43k|		newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
  976|  2.43k|	} else {
  977|    464|		newCompound->options |= kXMP_PropValueIsStruct;
  978|    464|		if ( (*currChild)->name != "rdf:Description" ) {
  ------------------
  |  Branch (978:8): [True: 314, False: 150]
  ------------------
  979|    314|			XMP_VarString typeName ( (*currChild)->ns );
  980|    314|			size_t        colonPos = (*currChild)->name.find_first_of(':');
  981|    314|			if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
  ------------------
  |  |  199|     40|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (981:9): [True: 40, False: 274]
  ------------------
  982|    274|			typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
  983|    274|			AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
  984|    274|		}
  985|    464|	}
  986|       |
  987|  5.57k|	RDF_NodeElement ( newCompound, **currChild, kNotTopLevel );
  988|  5.57k|	if ( newCompound->options & kRDF_HasValueElem ) {
  ------------------
  |  Branch (988:7): [True: 155, False: 5.41k]
  ------------------
  989|    155|		FixupQualifiedNode ( newCompound );
  990|  5.41k|	} else if ( newCompound->options & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (990:14): [True: 2.02k, False: 3.39k]
  ------------------
  991|  2.02k|		DetectAltText ( newCompound );
  992|  2.02k|	}
  993|       |
  994|  15.2k|	for ( ++currChild; currChild != endChild; ++currChild ) {
  ------------------
  |  Branch (994:21): [True: 9.83k, False: 5.42k]
  ------------------
  995|  9.83k|		if ( ! (*currChild)->IsWhitespaceNode() ) XMP_Throw ( "Invalid child of resource property element", kXMPErr_BadRDF );
  ------------------
  |  |  199|    143|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (995:8): [True: 143, False: 9.69k]
  ------------------
  996|  9.69k|	}
  997|       |
  998|  5.57k|}	// 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|  58.3k|{
  568|  58.3k|	UTF8Unit inUnit;	// ! Don't read until we know there is input.
  569|  58.3k|	size_t unitCount = 0;
  570|       |
  571|  58.3k|	UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
  572|  58.3k|	if ( utf8Len == 0 ) goto Done;
  ------------------
  |  Branch (572:7): [True: 0, False: 58.3k]
  ------------------
  573|  58.3k|	inUnit = *utf8In;
  574|  58.3k|	if ( inUnit >= 0x80 ) goto MultiByte;	// ! Force linear execution path for ASCII.
  ------------------
  |  Branch (574:7): [True: 58.3k, 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|  58.3k|MultiByte:
  584|  58.3k|	CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
  585|  58.3k|	return;
  586|       |	
  587|      0|}	// CodePoint_from_UTF8
UnicodeConversions.cpp:_ZL25CodePoint_from_UTF8_MultiPKhmPjPm:
  516|  58.3k|{
  517|  58.3k|	UTF8Unit  inUnit = *utf8In;
  518|  58.3k|	size_t    unitCount = 0;
  519|  58.3k|	UTF32Unit cp;	// ! Avoid gcc complaints about declarations after goto's.
  520|  58.3k|	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|  58.3k|	size_t bytesNeeded = 0;	// Count the leading 1 bits in the first byte.
  535|   179k|	for ( UTF8Unit temp = inUnit; temp > 0x7F; temp = temp << 1 ) ++bytesNeeded;
  ------------------
  |  Branch (535:32): [True: 120k, False: 58.3k]
  ------------------
  536|       |		// *** Consider CPU-specific assembly inline, e.g. cntlzw on PowerPC.
  537|       |	
  538|  58.3k|	if ( (bytesNeeded < 2) || (bytesNeeded > 4) ) UC_Throw ( "Invalid UTF-8 sequence length", kXMPErr_BadParam );
  ------------------
  |  |   18|     26|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (538:7): [True: 18, False: 58.3k]
  |  Branch (538:28): [True: 8, False: 58.2k]
  ------------------
  539|  58.2k|	if ( bytesNeeded > utf8Len ) goto Done;	// Not enough input in this buffer.
  ------------------
  |  Branch (539:7): [True: 0, False: 58.2k]
  ------------------
  540|  58.2k|	unitCount = bytesNeeded;
  541|       |	
  542|  58.2k|	cp = inUnit & ((1 << (7-unitCount)) - 1);	// Isolate the initial data bits in the bottom of cp.
  543|       |	
  544|  58.2k|	utf8Pos = utf8In + 1;	// We've absorbed the first byte.
  545|   120k|	for ( --bytesNeeded; bytesNeeded > 0; --bytesNeeded, ++utf8Pos ) {
  ------------------
  |  Branch (545:23): [True: 62.5k, False: 58.2k]
  ------------------
  546|  62.5k|		inUnit = *utf8Pos;
  547|  62.5k|		if ( (inUnit & UTF8Unit(0xC0)) != UTF8Unit(0x80) ) UC_Throw ( "Invalid UTF-8 data byte", kXMPErr_BadParam );
  ------------------
  |  |   18|     19|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (547:8): [True: 19, False: 62.5k]
  ------------------
  548|  62.5k|		cp = (cp << 6) | (inUnit & 0x3F);
  549|  62.5k|	}
  550|       |	
  551|  58.2k|	if ( cp >= 0xD800 ) {	// Skip the next comparisons most of the time.
  ------------------
  |  Branch (551:7): [True: 966, False: 57.3k]
  ------------------
  552|    966|		if ( (0xD800 <= cp) && (cp <= 0xDFFF) ) UC_Throw ( "Bad UTF-8 - surrogate code point", kXMPErr_BadParam );
  ------------------
  |  |   18|      2|	#define UC_Throw(msg,id)  throw XMP_Error ( id, msg )
  ------------------
  |  Branch (552:8): [True: 966, False: 0]
  |  Branch (552:26): [True: 2, False: 964]
  ------------------
  553|    964|		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: 962]
  ------------------
  554|    964|	}
  555|       |	
  556|  58.2k|	*cpOut = cp;	// ! Don't put after Done, don't write if no input.
  557|       |	
  558|  58.2k|Done:	
  559|  58.2k|	*utf8Read = unitCount;
  560|  58.2k|	return;
  561|       |	
  562|  58.2k|}	// CodePoint_from_UTF8_Multi

XMPCore_Impl.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  1.05M|{
   88|       |
   89|  1.05M|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  1.05M|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  1.05M|	const XMP_Uns8 * namePos   = nameStart;
   92|  1.05M|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  1.05M|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 1.05M]
  ------------------
   97|       |
   98|  1.05M|	cp = *namePos;
   99|  1.05M|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 1.05M, False: 1.18k]
  ------------------
  100|  1.05M|		++namePos;
  101|  1.05M|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 1.05M]
  ------------------
  102|  1.05M|	} else {
  103|  1.18k|		cp = GetCodePoint ( &namePos );
  104|  1.18k|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 1.18k]
  ------------------
  105|  1.18k|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  96.8M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 95.8M, False: 1.05M]
  ------------------
  110|  95.8M|		cp = *namePos;
  111|  95.8M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 95.8M, False: 25.2k]
  ------------------
  112|  95.8M|			++namePos;
  113|  95.8M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 561k, False: 95.2M]
  |  Branch (113:38): [True: 0, False: 561k]
  ------------------
  114|  95.8M|		} else {
  115|  25.2k|			cp = GetCodePoint ( &namePos );
  116|  25.2k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 12.4k, False: 12.7k]
  |  Branch (116:41): [True: 0, False: 12.4k]
  ------------------
  117|  25.2k|		}
  118|  95.8M|	}
  119|       |
  120|  1.05M|	return;
  121|       |
  122|  1.05M|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|  96.8M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  96.8M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 63.5M, False: 33.3M]
  |  Branch (33:23): [True: 63.5M, False: 0]
  |  Branch (33:40): [True: 32.7M, False: 561k]
  |  Branch (33:55): [True: 32.2M, False: 522k]
  |  Branch (33:71): [True: 522k, False: 561k]
  ------------------
   34|   561k|	return false;
   35|  96.8M|}
XMPCore_Impl.cpp:_ZL12GetCodePointPPKh:
   19|  26.4k|{
   20|  26.4k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  26.4k|	XMP_Uns32 cp;
   22|  26.4k|	size_t u8Len;
   23|  26.4k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  26.4k|	*utf8Str_io = u8Ptr + u8Len;
   25|  26.4k|	return cp;
   26|  26.4k|}
XMPCore_Impl.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  26.4k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  26.4k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 15.4k, False: 11.0k]
  |  Branch (43:24): [True: 535, False: 14.9k]
  |  Branch (43:43): [True: 14.9k, False: 11.0k]
  |  Branch (43:59): [True: 4.45k, False: 10.4k]
  ------------------
   44|  21.4k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 10.4k, False: 11.0k]
  |  Branch (44:24): [True: 5.12k, False: 5.32k]
  |  Branch (44:43): [True: 3.85k, False: 12.4k]
  |  Branch (44:60): [True: 0, False: 3.85k]
  ------------------
   45|       |
   46|  16.3k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 3.85k, False: 12.4k]
  |  Branch (46:25): [True: 3.52k, False: 331]
  |  Branch (46:46): [True: 331, False: 12.4k]
  |  Branch (46:64): [True: 0, False: 331]
  ------------------
   47|  12.8k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 331, False: 12.4k]
  |  Branch (47:26): [True: 0, False: 331]
  |  Branch (47:46): [True: 331, False: 12.4k]
  |  Branch (47:64): [True: 0, False: 331]
  ------------------
   48|  12.8k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 331, False: 12.4k]
  |  Branch (48:26): [True: 331, False: 0]
  |  Branch (48:46): [True: 0, False: 12.4k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  12.4k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 12.4k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 12.4k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  12.4k|	return false;
   52|       |
   53|  12.4k|}
XMPCore_Impl.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   561k|{
   59|       |	// ASCII following characters for an XML name.
   60|   561k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 408k, False: 152k]
  |  Branch (60:23): [True: 408k, False: 0]
  |  Branch (60:39): [True: 56.8k, False: 95.2k]
  |  Branch (60:54): [True: 95.2k, False: 0]
  ------------------
   61|      0|	return false;
   62|   561k|}
XMPCore_Impl.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  12.4k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  12.4k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 11.0k, False: 1.46k]
  |  Branch (69:24): [True: 1.46k, False: 0]
  |  Branch (69:41): [True: 1.46k, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  12.4k|}
XMPMeta-GetSet.cpp:_ZL12GetCodePointPPKh:
   19|  12.6k|{
   20|  12.6k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  12.6k|	XMP_Uns32 cp;
   22|  12.6k|	size_t u8Len;
   23|  12.6k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  12.6k|	*utf8Str_io = u8Ptr + u8Len;
   25|  12.6k|	return cp;
   26|  12.6k|}
XMPMeta.cpp:_ZL19VerifySimpleXMLNamePKcS0_:
   87|  49.0k|{
   88|       |
   89|  49.0k|	const XMP_Uns8 * nameStart = (const XMP_Uns8 *) _nameStart;
   90|  49.0k|	const XMP_Uns8 * nameEnd   = (const XMP_Uns8 *) _nameEnd;
   91|  49.0k|	const XMP_Uns8 * namePos   = nameStart;
   92|  49.0k|	XMP_Uns32 cp;
   93|       |	
   94|       |	// The first character is more restricted.
   95|       |	
   96|  49.0k|	if ( nameStart >= nameEnd ) XMP_Throw ( "Empty XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (96:7): [True: 0, False: 49.0k]
  ------------------
   97|       |
   98|  49.0k|	cp = *namePos;
   99|  49.0k|	if ( cp < 0x80 ) {
  ------------------
  |  Branch (99:7): [True: 48.4k, False: 653]
  ------------------
  100|  48.4k|		++namePos;
  101|  48.4k|		if ( ! IsStartChar_ASCII(cp) ) goto NameError;
  ------------------
  |  Branch (101:8): [True: 0, False: 48.4k]
  ------------------
  102|  48.4k|	} else {
  103|    653|		cp = GetCodePoint ( &namePos );
  104|    653|		if ( ! IsStartChar_NonASCII(cp) ) goto NameError;
  ------------------
  |  Branch (104:8): [True: 0, False: 653]
  ------------------
  105|    653|	}
  106|       |
  107|       |	// Check the rest of the name.
  108|       |	
  109|  15.3M|	while ( namePos < nameEnd ) {
  ------------------
  |  Branch (109:10): [True: 15.3M, False: 49.0k]
  ------------------
  110|  15.3M|		cp = *namePos;
  111|  15.3M|		if ( cp < 0x80 ) {
  ------------------
  |  Branch (111:8): [True: 15.3M, False: 18.5k]
  ------------------
  112|  15.3M|			++namePos;
  113|  15.3M|			if ( (! IsStartChar_ASCII(cp)) && (! IsOtherChar_ASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (113:9): [True: 126k, False: 15.1M]
  |  Branch (113:38): [True: 0, False: 126k]
  ------------------
  114|  15.3M|		} else {
  115|  18.5k|			cp = GetCodePoint ( &namePos );
  116|  18.5k|			if ( (! IsStartChar_NonASCII(cp)) && (! IsOtherChar_NonASCII(cp)) ) goto NameError;
  ------------------
  |  Branch (116:9): [True: 11.2k, False: 7.31k]
  |  Branch (116:41): [True: 0, False: 11.2k]
  ------------------
  117|  18.5k|		}
  118|  15.3M|	}
  119|       |
  120|  49.0k|	return;
  121|       |
  122|  49.0k|NameError:
  123|      0|	XMP_Throw ( "Bad XML name", kXMPErr_BadXPath );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  124|       |	
  125|      0|}	// VerifySimpleXMLName
XMPMeta.cpp:_ZL17IsStartChar_ASCIIj:
   31|  15.3M|{
   32|       |	// ASCII starting characters for an XML name.
   33|  15.3M|	if ( (('a' <= cp) && (cp <= 'z')) || (('A' <= cp) && (cp <= 'Z')) || (cp == '_') ) return true;
  ------------------
  |  Branch (33:8): [True: 14.4M, False: 854k]
  |  Branch (33:23): [True: 14.4M, False: 0]
  |  Branch (33:40): [True: 728k, False: 126k]
  |  Branch (33:55): [True: 633k, False: 94.9k]
  |  Branch (33:71): [True: 94.9k, False: 126k]
  ------------------
   34|   126k|	return false;
   35|  15.3M|}
XMPMeta.cpp:_ZL12GetCodePointPPKh:
   19|  19.1k|{
   20|  19.1k|	const XMP_Uns8 * u8Ptr = *utf8Str_io;
   21|  19.1k|	XMP_Uns32 cp;
   22|  19.1k|	size_t u8Len;
   23|  19.1k|	CodePoint_from_UTF8 ( u8Ptr, 4, &cp, &u8Len );	// Throws an exception for errors.
   24|  19.1k|	*utf8Str_io = u8Ptr + u8Len;
   25|  19.1k|	return cp;
   26|  19.1k|}
XMPMeta.cpp:_ZL20IsStartChar_NonASCIIj:
   40|  19.1k|{
   41|       |	// Non-ASCII starting characters for an XML name.
   42|       |	
   43|  19.1k|	if ( ((0xC0 <= cp) && (cp <= 0xD6))  || ((0xD8 <= cp) && (cp <= 0xF6)) ) return true;
  ------------------
  |  Branch (43:8): [True: 8.94k, False: 10.2k]
  |  Branch (43:24): [True: 491, False: 8.44k]
  |  Branch (43:43): [True: 8.44k, False: 10.2k]
  |  Branch (43:59): [True: 407, False: 8.04k]
  ------------------
   44|  18.2k|	if ( ((0xF8 <= cp) && (cp <= 0x2FF)) || ((0x370 <= cp) && (cp <= 0x37D)) ) return true;
  ------------------
  |  Branch (44:8): [True: 8.04k, False: 10.2k]
  |  Branch (44:24): [True: 4.08k, False: 3.95k]
  |  Branch (44:43): [True: 2.98k, False: 11.2k]
  |  Branch (44:60): [True: 0, False: 2.98k]
  ------------------
   45|       |
   46|  14.2k|	if ( ((0x37F <= cp) && (cp <= 0x1FFF))  || ((0x200C <= cp) && (cp <= 0x200D)) ) return true;
  ------------------
  |  Branch (46:8): [True: 2.98k, False: 11.2k]
  |  Branch (46:25): [True: 2.44k, False: 536]
  |  Branch (46:46): [True: 536, False: 11.2k]
  |  Branch (46:64): [True: 0, False: 536]
  ------------------
   47|  11.7k|	if ( ((0x2070 <= cp) && (cp <= 0x218F)) || ((0x2C00 <= cp) && (cp <= 0x2FEF)) ) return true;
  ------------------
  |  Branch (47:8): [True: 536, False: 11.2k]
  |  Branch (47:26): [True: 0, False: 536]
  |  Branch (47:46): [True: 536, False: 11.2k]
  |  Branch (47:64): [True: 0, False: 536]
  ------------------
   48|  11.7k|	if ( ((0x3001 <= cp) && (cp <= 0xD7FF)) || ((0xF900 <= cp) && (cp <= 0xFDCF)) ) return true;
  ------------------
  |  Branch (48:8): [True: 536, False: 11.2k]
  |  Branch (48:26): [True: 536, False: 0]
  |  Branch (48:46): [True: 0, False: 11.2k]
  |  Branch (48:64): [True: 0, False: 0]
  ------------------
   49|  11.2k|	if ( ((0xFDF0 <= cp) && (cp <= 0xFFFD)) || ((0x10000 <= cp) && (cp <= 0xEFFFF)) ) return true;
  ------------------
  |  Branch (49:8): [True: 0, False: 11.2k]
  |  Branch (49:26): [True: 0, False: 0]
  |  Branch (49:46): [True: 0, False: 11.2k]
  |  Branch (49:65): [True: 0, False: 0]
  ------------------
   50|       |
   51|  11.2k|	return false;
   52|       |
   53|  11.2k|}
XMPMeta.cpp:_ZL17IsOtherChar_ASCIIj:
   58|   126k|{
   59|       |	// ASCII following characters for an XML name.
   60|   126k|	if ( (('0' <= cp) && (cp <= '9')) || (cp == '-') || (cp == '.') ) return true;
  ------------------
  |  Branch (60:8): [True: 70.1k, False: 56.3k]
  |  Branch (60:23): [True: 70.1k, False: 0]
  |  Branch (60:39): [True: 30.3k, False: 26.0k]
  |  Branch (60:54): [True: 26.0k, False: 0]
  ------------------
   61|      0|	return false;
   62|   126k|}
XMPMeta.cpp:_ZL20IsOtherChar_NonASCIIj:
   67|  11.2k|{
   68|       |	// Non-ASCII following characters for an XML name.
   69|  11.2k|	if ( (cp == 0xB7) || ((0x300 <= cp) && (cp <= 0x36F))  || ((0x203F <= cp) && (cp <= 0x2040)) ) return true;
  ------------------
  |  Branch (69:7): [True: 10.2k, False: 975]
  |  Branch (69:24): [True: 975, False: 0]
  |  Branch (69:41): [True: 975, False: 0]
  |  Branch (69:61): [True: 0, False: 0]
  |  Branch (69:79): [True: 0, False: 0]
  ------------------
   70|      0|	return false;
   71|  11.2k|}

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

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

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

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

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

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

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

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

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

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

_ZNK7XMPMeta17SerializeToBufferEPPKcPjjjS1_S1_i:
 1170|  5.00k|{
 1171|  5.00k|	XMP_Assert ( (rdfString != 0) && (rdfSize != 0) && (newline != 0) && (indentStr != 0) );
  ------------------
  |  |  142|  5.00k|	#define XMP_Assert(c)	((void) 0)
  ------------------
 1172|       |
 1173|       |	// Fix up some default parameters.
 1174|       |	
 1175|  5.00k|	enum { kDefaultPad = 2048 };
 1176|  5.00k|	size_t unicodeUnitSize = 1;
 1177|  5.00k|	XMP_OptionBits charEncoding = options & kXMP_EncodingMask;
 1178|       |
 1179|  5.00k|	if ( charEncoding != kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1179:7): [True: 0, False: 5.00k]
  ------------------
 1180|      0|		if ( options & _XMP_UTF16_Bit ) {
  ------------------
  |  Branch (1180:8): [True: 0, False: 0]
  ------------------
 1181|      0|			if ( options & _XMP_UTF32_Bit ) XMP_Throw ( "Can't use both _XMP_UTF16_Bit and _XMP_UTF32_Bit", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1181:9): [True: 0, False: 0]
  ------------------
 1182|      0|			unicodeUnitSize = 2;
 1183|      0|		} else if ( options & _XMP_UTF32_Bit ) {
  ------------------
  |  Branch (1183:15): [True: 0, False: 0]
  ------------------
 1184|      0|			unicodeUnitSize = 4;
 1185|      0|		} else {
 1186|      0|			XMP_Throw ( "Can't use _XMP_LittleEndian_Bit by itself", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1187|      0|		}
 1188|      0|	}
 1189|       |	
 1190|  5.00k|	if ( options & kXMP_OmitAllFormatting ) {
  ------------------
  |  Branch (1190:7): [True: 28, False: 4.97k]
  ------------------
 1191|     28|		newline = " ";	// ! Yes, a space for "newline". This ensures token separation.
 1192|     28|		indentStr = "";
 1193|  4.97k|	} else {
 1194|  4.97k|		if ( *newline == 0 ) newline = "\xA";	// Linefeed
  ------------------
  |  Branch (1194:8): [True: 4.97k, False: 0]
  ------------------
 1195|  4.97k|		if ( *indentStr == 0 ) {
  ------------------
  |  Branch (1195:8): [True: 4.97k, False: 0]
  ------------------
 1196|  4.97k|			indentStr = " ";
 1197|  4.97k|			if ( ! (options & kXMP_UseCompactFormat) ) indentStr  = "   ";
  ------------------
  |  Branch (1197:9): [True: 0, False: 4.97k]
  ------------------
 1198|  4.97k|		}
 1199|  4.97k|	}
 1200|       |	
 1201|  5.00k|	if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1201:7): [True: 0, False: 5.00k]
  ------------------
 1202|      0|		if ( options & (kXMP_OmitPacketWrapper | kXMP_IncludeThumbnailPad) ) {
  ------------------
  |  Branch (1202:8): [True: 0, False: 0]
  ------------------
 1203|      0|			XMP_Throw ( "Inconsistent options for exact size serialize", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1204|      0|		}
 1205|      0|		if ( (padding & (unicodeUnitSize-1)) != 0 ) {
  ------------------
  |  Branch (1205:8): [True: 0, False: 0]
  ------------------
 1206|      0|			XMP_Throw ( "Exact size must be a multiple of the Unicode element", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1207|      0|		}
 1208|  5.00k|	} else if ( options & kXMP_ReadOnlyPacket ) {
  ------------------
  |  Branch (1208:14): [True: 0, False: 5.00k]
  ------------------
 1209|      0|		if ( options & (kXMP_OmitPacketWrapper | kXMP_IncludeThumbnailPad) ) {
  ------------------
  |  Branch (1209:8): [True: 0, False: 0]
  ------------------
 1210|      0|			XMP_Throw ( "Inconsistent options for read-only packet", kXMPErr_BadOptions );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
 1211|      0|		}
 1212|      0|		padding = 0;
 1213|  5.00k|	} else if ( options & kXMP_OmitPacketWrapper ) {
  ------------------
  |  Branch (1213:14): [True: 1.73k, False: 3.27k]
  ------------------
 1214|  1.73k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1214:8): [True: 0, False: 1.73k]
  ------------------
 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.73k|		padding = 0;
 1218|  3.27k|	} else {
 1219|  3.27k|		if ( padding == 0 ) padding = kDefaultPad * unicodeUnitSize;
  ------------------
  |  Branch (1219:8): [True: 3.27k, False: 0]
  ------------------
 1220|  3.27k|		if ( options & kXMP_IncludeThumbnailPad ) {
  ------------------
  |  Branch (1220:8): [True: 0, False: 3.27k]
  ------------------
 1221|      0|			if ( ! this->DoesPropertyExist ( kXMP_NS_XMP, "Thumbnails" ) ) padding += (10000 * unicodeUnitSize);	// *** Need a better estimate.
  ------------------
  |  Branch (1221:9): [True: 0, False: 0]
  ------------------
 1222|      0|		}
 1223|  3.27k|	}
 1224|       |
 1225|       |	// Serialize as UTF-8, then convert to UTF-16 or UTF-32 if necessary, and assemble with the padding and tail.
 1226|       |	
 1227|  5.00k|	std::string tailStr;
 1228|       |
 1229|  5.00k|	SerializeAsRDF ( *this, *sOutputStr, tailStr, options, newline, indentStr, baseIndent );
 1230|  5.00k|	if ( charEncoding == kXMP_EncodeUTF8 ) {
  ------------------
  |  Branch (1230:7): [True: 5.00k, False: 0]
  ------------------
 1231|       |
 1232|  5.00k|		if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1232:8): [True: 0, False: 5.00k]
  ------------------
 1233|      0|			size_t minSize = sOutputStr->size() + tailStr.size();
 1234|      0|			if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1234:9): [True: 0, False: 0]
  ------------------
 1235|      0|			padding -= minSize;	// Now the actual amount of padding to add.
 1236|      0|		}
 1237|       |		
 1238|  5.00k|		size_t newlineLen = strlen ( newline );
 1239|       |	
 1240|  5.00k|		if ( padding < newlineLen ) {
  ------------------
  |  Branch (1240:8): [True: 1.73k, False: 3.27k]
  ------------------
 1241|  1.73k|			sOutputStr->append ( padding, ' ' );
 1242|  3.27k|		} else {
 1243|  3.27k|			padding -= newlineLen;	// Write this newline last.
 1244|  68.6k|			while ( padding >= (100 + newlineLen) ) {
  ------------------
  |  Branch (1244:12): [True: 65.4k, False: 3.27k]
  ------------------
 1245|  65.4k|				sOutputStr->append ( 100, ' ' );
 1246|  65.4k|				*sOutputStr += newline;
 1247|  65.4k|				padding -= (100 + newlineLen);
 1248|  65.4k|			}
 1249|  3.27k|			sOutputStr->append ( padding, ' ' );
 1250|  3.27k|			*sOutputStr += newline;
 1251|  3.27k|		}
 1252|       |
 1253|  5.00k|		*sOutputStr += tailStr;
 1254|       |	
 1255|  5.00k|	} else {
 1256|       |	
 1257|       |		// Need to convert the encoding. Swap the UTF-8 into a local string and convert back. Assemble everything.
 1258|       |		
 1259|      0|		XMP_VarString utf8Str, newlineStr;
 1260|      0|		bool bigEndian = ((charEncoding & _XMP_LittleEndian_Bit) == 0);
 1261|       |		
 1262|      0|		if ( charEncoding & _XMP_UTF16_Bit ) {
  ------------------
  |  Branch (1262:8): [True: 0, False: 0]
  ------------------
 1263|       |
 1264|      0|			std::string padStr ( "  " );  padStr[0] = 0;	// Assume big endian.
 1265|       |			
 1266|      0|			utf8Str.swap ( *sOutputStr );
 1267|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), sOutputStr, bigEndian );
 1268|      0|			utf8Str.swap ( tailStr );
 1269|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &tailStr, bigEndian );
 1270|       |
 1271|      0|			if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1271:9): [True: 0, False: 0]
  ------------------
 1272|      0|				size_t minSize = sOutputStr->size() + tailStr.size();
 1273|      0|				if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1273:10): [True: 0, False: 0]
  ------------------
 1274|      0|				padding -= minSize;	// Now the actual amount of padding to add (in bytes).
 1275|      0|			}
 1276|       |
 1277|      0|			utf8Str.assign ( newline );
 1278|      0|			ToUTF16 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &newlineStr, bigEndian );
 1279|      0|			size_t newlineLen = newlineStr.size();
 1280|       |	
 1281|      0|			if ( padding < newlineLen ) {
  ------------------
  |  Branch (1281:9): [True: 0, False: 0]
  ------------------
 1282|      0|				for ( int i = padding/2; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1282:30): [True: 0, False: 0]
  ------------------
 1283|      0|			} else {
 1284|      0|				padding -= newlineLen;	// Write this newline last.
 1285|      0|				while ( padding >= (200 + newlineLen) ) {
  ------------------
  |  Branch (1285:13): [True: 0, False: 0]
  ------------------
 1286|      0|					for ( int i = 100; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1286:25): [True: 0, False: 0]
  ------------------
 1287|      0|					*sOutputStr += newlineStr;
 1288|      0|					padding -= (200 + newlineLen);
 1289|      0|				}
 1290|      0|				for ( int i = padding/2; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1290:30): [True: 0, False: 0]
  ------------------
 1291|      0|				*sOutputStr += newlineStr;
 1292|      0|			}
 1293|       |
 1294|      0|			*sOutputStr += tailStr;
 1295|       |
 1296|      0|		} else {
 1297|       |
 1298|      0|			std::string padStr ( "    " );  padStr[0] = padStr[1] = padStr[2] = 0;	// Assume big endian.
 1299|       |//			UTF8_to_UTF32_Proc Converter = UTF8_to_UTF32BE;
 1300|       |
 1301|      0|			if ( charEncoding & _XMP_LittleEndian_Bit ) {
  ------------------
  |  Branch (1301:9): [True: 0, False: 0]
  ------------------
 1302|      0|				padStr[0] = ' '; padStr[1] = padStr[2] = padStr[3] = 0;
 1303|       |//				Converter = UTF8_to_UTF32LE;
 1304|      0|			}
 1305|       |			
 1306|      0|			utf8Str.swap ( *sOutputStr );
 1307|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), sOutputStr, bigEndian );
 1308|      0|			utf8Str.swap ( tailStr );
 1309|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &tailStr, bigEndian );
 1310|       |
 1311|      0|			if ( options & kXMP_ExactPacketLength ) {
  ------------------
  |  Branch (1311:9): [True: 0, False: 0]
  ------------------
 1312|      0|				size_t minSize = sOutputStr->size() + tailStr.size();
 1313|      0|				if ( minSize > padding ) XMP_Throw ( "Can't fit into specified packet size", kXMPErr_BadSerialize );
  ------------------
  |  |  199|      0|#define XMP_Throw(msg,id)	{ AnnounceThrow ( msg ); throw XMP_Error ( id, msg ); }
  ------------------
  |  Branch (1313:10): [True: 0, False: 0]
  ------------------
 1314|      0|				padding -= minSize;	// Now the actual amount of padding to add (in bytes).
 1315|      0|			}
 1316|       |
 1317|      0|			utf8Str.assign ( newline );
 1318|      0|			ToUTF32 ( (UTF8Unit*)utf8Str.c_str(), utf8Str.size(), &newlineStr, bigEndian );
 1319|      0|			size_t newlineLen = newlineStr.size();
 1320|       |	
 1321|      0|			if ( padding < newlineLen ) {
  ------------------
  |  Branch (1321:9): [True: 0, False: 0]
  ------------------
 1322|      0|				for ( int i = padding/4; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1322:30): [True: 0, False: 0]
  ------------------
 1323|      0|			} else {
 1324|      0|				padding -= newlineLen;	// Write this newline last.
 1325|      0|				while ( padding >= (400 + newlineLen) ) {
  ------------------
  |  Branch (1325:13): [True: 0, False: 0]
  ------------------
 1326|      0|					for ( int i = 100; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1326:25): [True: 0, False: 0]
  ------------------
 1327|      0|					*sOutputStr += newlineStr;
 1328|      0|					padding -= (400 + newlineLen);
 1329|      0|				}
 1330|      0|				for ( int i = padding/4; i > 0; --i ) *sOutputStr += padStr;
  ------------------
  |  Branch (1330:30): [True: 0, False: 0]
  ------------------
 1331|      0|				*sOutputStr += newlineStr;
 1332|      0|			}
 1333|       |
 1334|      0|			*sOutputStr += tailStr;
 1335|       |
 1336|      0|		}
 1337|       |	
 1338|      0|	}
 1339|       |
 1340|       |	// Return the finished string.
 1341|       |	
 1342|  5.00k|	*rdfString = sOutputStr->c_str();
 1343|  5.00k|	*rdfSize   = sOutputStr->size();
 1344|       |
 1345|  5.00k|}	// SerializeToBuffer
XMPMeta-Serialize.cpp:_ZL14SerializeAsRDFRK7XMPMetaRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_jPKcSB_i:
 1063|  5.00k|{
 1064|  5.00k|	const size_t treeNameLen = xmpObj.tree.name.size();
 1065|  5.00k|	const size_t indentLen   = strlen ( indentStr );
 1066|       |
 1067|       |	// First estimate the worst case space and reserve room in the output string. This optimization
 1068|       |	// avoids reallocating and copying the output as it grows. The initial count does not look at
 1069|       |	// the values of properties, so it does not account for character entities, e.g. &#xA; for newline.
 1070|       |	// Since there can be a lot of these in things like the base 64 encoding of a large thumbnail,
 1071|       |	// inflate the count by 1/4 (easy to do) to accommodate.
 1072|       |	
 1073|       |	// *** Need to include estimate for alias comments.
 1074|       |	
 1075|  5.00k|	size_t outputLen = 2 * (strlen(kPacketHeader) + strlen(kRDF_XMPMetaStart) + strlen(kRDF_RDFStart) + 3*baseIndent*indentLen);
 1076|       |	
 1077|  17.7k|	for ( size_t schemaNum = 0, schemaLim = xmpObj.tree.children.size(); schemaNum < schemaLim; ++schemaNum ) {
  ------------------
  |  Branch (1077:71): [True: 12.7k, False: 5.00k]
  ------------------
 1078|  12.7k|		const XMP_Node * currSchema = xmpObj.tree.children[schemaNum];
 1079|  12.7k|		outputLen += 2*(baseIndent+2)*indentLen + strlen(kRDF_SchemaStart) + treeNameLen + strlen(kRDF_SchemaEnd) + 2;
 1080|  12.7k|		outputLen += EstimateRDFSize ( currSchema, baseIndent+2, indentLen );
 1081|  12.7k|	}
 1082|       |	
 1083|  5.00k|	outputLen += (outputLen >> 2);	// Inflate by 1/4, an empirical fudge factor.
 1084|       |	
 1085|       |	// Now generate the RDF into the head string as UTF-8.
 1086|       |	
 1087|  5.00k|	XMP_Index level;
 1088|       |	
 1089|  5.00k|	headStr.erase();
 1090|  5.00k|	headStr.reserve ( outputLen );
 1091|       |	
 1092|       |	// Write the packet header PI.
 1093|  5.00k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1093:7): [True: 3.27k, False: 1.73k]
  ------------------
 1094|  3.27k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1094:29): [True: 0, False: 3.27k]
  ------------------
 1095|  3.27k|		headStr += kPacketHeader;
 1096|  3.27k|		headStr += newline;
 1097|  3.27k|	}
 1098|       |
 1099|       |	// Write the xmpmeta element's start tag.
 1100|  5.00k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1100:7): [True: 5.00k, False: 0]
  ------------------
 1101|  5.00k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1101:29): [True: 0, False: 5.00k]
  ------------------
 1102|  5.00k|		headStr += kRDF_XMPMetaStart;
 1103|  5.00k|		headStr += kXMPCore_VersionMessage "\">";
  ------------------
  |  |  134|  5.00k|	#define kXMPCore_VersionMessage	kXMPCoreName " " XMP_API_VERSION_STRING
  |  |  ------------------
  |  |  |  |  133|  5.00k|	#define kXMPCoreName "XMP Core"
  |  |  ------------------
  ------------------
 1104|  5.00k|		headStr += newline;
 1105|  5.00k|	}
 1106|       |
 1107|       |	// Write the rdf:RDF start tag.
 1108|  10.0k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1108:30): [True: 5.00k, False: 5.00k]
  ------------------
 1109|  5.00k|	headStr += kRDF_RDFStart;
 1110|  5.00k|	headStr += newline;
 1111|       |	
 1112|       |	// Write all of the properties.
 1113|  5.00k|	if ( options & kXMP_UseCompactFormat ) {
  ------------------
  |  Branch (1113:7): [True: 5.00k, False: 0]
  ------------------
 1114|  5.00k|		SerializeCompactRDFSchemas ( xmpObj.tree, headStr, newline, indentStr, baseIndent );
 1115|  5.00k|	} 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|  10.0k|	for ( level = baseIndent+1; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1132:30): [True: 5.00k, False: 5.00k]
  ------------------
 1133|  5.00k|	headStr += kRDF_RDFEnd;
 1134|  5.00k|	headStr += newline;
 1135|       |
 1136|       |	// Write the xmpmeta end tag.
 1137|  5.00k|	if ( ! (options & kXMP_OmitXMPMetaElement) ) {
  ------------------
  |  Branch (1137:7): [True: 5.00k, False: 0]
  ------------------
 1138|  5.00k|		for ( level = baseIndent; level > 0; --level ) headStr += indentStr;
  ------------------
  |  Branch (1138:29): [True: 0, False: 5.00k]
  ------------------
 1139|  5.00k|		headStr += kRDF_XMPMetaEnd;
 1140|  5.00k|		headStr += newline;
 1141|  5.00k|	}
 1142|       |	
 1143|       |	// Write the packet trailer PI into the tail string as UTF-8.
 1144|  5.00k|	tailStr.erase();
 1145|  5.00k|	if ( ! (options & kXMP_OmitPacketWrapper) ) {
  ------------------
  |  Branch (1145:7): [True: 3.27k, False: 1.73k]
  ------------------
 1146|  3.27k|		tailStr.reserve ( strlen(kPacketTrailer) + (strlen(indentStr) * baseIndent) );
 1147|  3.27k|		for ( level = baseIndent; level > 0; --level ) tailStr += indentStr;
  ------------------
  |  Branch (1147:29): [True: 0, False: 3.27k]
  ------------------
 1148|  3.27k|		tailStr += kPacketTrailer;
 1149|  3.27k|		if ( options & kXMP_ReadOnlyPacket ) tailStr[tailStr.size()-4] = 'r';
  ------------------
  |  Branch (1149:8): [True: 0, False: 3.27k]
  ------------------
 1150|  3.27k|	}
 1151|       |	
 1152|       |	// ! This assert is just a performance check, to see if the reserve was enough.
 1153|       |	// *** XMP_Assert ( headStr.size() <= outputLen );
 1154|       |	// *** Don't use an assert. Think of some way to track this without risk of aborting the client.
 1155|       |	
 1156|  5.00k|}	// SerializeAsRDF
XMPMeta-Serialize.cpp:_ZL15EstimateRDFSizePK8XMP_Nodeim:
   83|   168k|{
   84|   168k|	size_t outputLen = 2 * (indent*indentLen + currNode->name.size() + 4);	// The property element tags.
   85|       |	
   86|   168k|	if ( ! currNode->qualifiers.empty() ) {
  ------------------
  |  Branch (86:7): [True: 13.2k, False: 155k]
  ------------------
   87|       |		// This node has qualifiers, assume it is written using rdf:value and estimate the qualifiers.
   88|       |
   89|  13.2k|		indent += 2;	// Everything else is indented inside the rdf:Description element.
   90|  13.2k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
   91|  13.2k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_ValueStart) + 2);		// The rdf:value tags.
   92|       |
   93|  74.3k|		for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (93:68): [True: 61.1k, False: 13.2k]
  ------------------
   94|  61.1k|			const XMP_Node * currQual = currNode->qualifiers[qualNum];
   95|  61.1k|			outputLen += EstimateRDFSize ( currQual, indent, indentLen );
   96|  61.1k|		}
   97|       |
   98|  13.2k|	}
   99|       |	
  100|   168k|	if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (100:7): [True: 9.38k, False: 159k]
  ------------------
  101|  9.38k|		indent += 1;
  102|  9.38k|		outputLen += 2 * (indent*indentLen + strlen(kRDF_StructStart) + 2);	// The rdf:Description tags.
  103|   159k|	} else if ( currNode->options & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (103:14): [True: 4.32k, False: 154k]
  ------------------
  104|  4.32k|		indent += 2;
  105|  4.32k|		outputLen += 2 * ((indent-1)*indentLen + strlen(kRDF_BagStart) + 2);		// The rdf:Bag/Seq/Alt tags.
  106|  4.32k|		outputLen += 2 * currNode->children.size() * (strlen(kRDF_ItemStart) + 2);	// The rdf:li tags, indent counted in children.
  107|   154k|	} else if ( ! (currNode->options & kXMP_SchemaNode) ) {
  ------------------
  |  Branch (107:14): [True: 142k, False: 12.7k]
  ------------------
  108|   142k|		outputLen += currNode->value.size();	// This is a leaf value node.
  109|   142k|	}
  110|       |
  111|   263k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (111:67): [True: 94.6k, False: 168k]
  ------------------
  112|  94.6k|		const XMP_Node * currChild = currNode->children[childNum];
  113|  94.6k|		outputLen += EstimateRDFSize ( currChild, indent+1, indentLen );
  114|  94.6k|	}
  115|       |
  116|   168k|	return outputLen;
  117|       |	
  118|   168k|}	// EstimateRDFSize
XMPMeta-Serialize.cpp:_ZL26SerializeCompactRDFSchemasRK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  978|  5.00k|{
  979|  5.00k|	XMP_Index level;
  980|  5.00k|	size_t schema, schemaLim;
  981|       |	
  982|       |	// Begin the rdf:Description start tag.
  983|  15.0k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (983:30): [True: 10.0k, False: 5.00k]
  ------------------
  984|  5.00k|	outputStr += kRDF_SchemaStart;
  985|  5.00k|	outputStr += '"';
  986|  5.00k|	outputStr += xmpTree.name;
  987|  5.00k|	outputStr += '"';
  988|       |	
  989|       |	// Write all necessary xmlns attributes.
  990|       |	
  991|  5.00k|	size_t totalLen = 8;	// Start at 8 for "xml:rdf:".
  992|  5.00k|	XMP_cStringMapPos currPos = sNamespacePrefixToURIMap->begin();
  993|  5.00k|	XMP_cStringMapPos endPos  = sNamespacePrefixToURIMap->end();
  994|  2.18M|	for ( ; currPos != endPos; ++currPos ) totalLen += currPos->first.size();
  ------------------
  |  Branch (994:10): [True: 2.18M, False: 5.00k]
  ------------------
  995|       |
  996|  5.00k|	XMP_VarString usedNS;
  997|  5.00k|	usedNS.reserve ( totalLen );
  998|  5.00k|	usedNS = "xml:rdf:";
  999|       |
 1000|  17.7k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1000:57): [True: 12.7k, False: 5.00k]
  ------------------
 1001|  12.7k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1002|  12.7k|		DeclareUsedNamespaces ( currSchema, usedNS, outputStr, newline, indentStr, baseIndent+4 );
 1003|  12.7k|	}
 1004|       |	
 1005|       |	// Write the top level "attrProps" and close the rdf:Description start tag.
 1006|  5.00k|	bool allAreAttrs = true;
 1007|  17.7k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1007:57): [True: 12.7k, False: 5.00k]
  ------------------
 1008|  12.7k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1009|  12.7k|		allAreAttrs &= SerializeCompactRDFAttrProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1010|  12.7k|	}
 1011|  5.00k|	if ( ! allAreAttrs ) {
  ------------------
  |  Branch (1011:7): [True: 1.81k, False: 3.18k]
  ------------------
 1012|  1.81k|		outputStr += ">";
 1013|  1.81k|		outputStr += newline;
 1014|  3.18k|	} else {
 1015|  3.18k|		outputStr += "/>";
 1016|  3.18k|		outputStr += newline;
 1017|  3.18k|		return;	// ! Done if all properties in all schema are written as attributes.
 1018|  3.18k|	}
 1019|       |
 1020|       |	// Write the remaining properties for each schema.
 1021|  6.74k|	for ( schema = 0, schemaLim = xmpTree.children.size(); schema != schemaLim; ++schema ) {
  ------------------
  |  Branch (1021:57): [True: 4.92k, False: 1.81k]
  ------------------
 1022|  4.92k|		const XMP_Node * currSchema = xmpTree.children[schema];
 1023|  4.92k|		SerializeCompactRDFElemProps ( currSchema, outputStr, newline, indentStr, baseIndent+3 );
 1024|  4.92k|	}
 1025|       |	
 1026|       |	// Write the rdf:Description end tag.
 1027|       |	// *** Elide the end tag if everything (all props in all schema) is an attr.
 1028|  5.44k|	for ( level = baseIndent+2; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (1028:30): [True: 3.63k, False: 1.81k]
  ------------------
 1029|  1.81k|	outputStr += kRDF_SchemaEnd;
 1030|  1.81k|	outputStr += newline;
 1031|       |
 1032|  1.81k|}	// SerializeCompactRDFSchemas
XMPMeta-Serialize.cpp:_ZL21DeclareUsedNamespacesPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_PKcSB_i:
  196|   168k|{
  197|       |
  198|   168k|	if ( currNode->options & kXMP_SchemaNode ) {
  ------------------
  |  Branch (198:7): [True: 12.7k, False: 155k]
  ------------------
  199|       |		// The schema node name is the URI, the value is the prefix.
  200|  12.7k|		DeclareOneNamespace ( currNode->value, currNode->name, usedNS, outputStr, newline, indentStr, indent );
  201|   155k|	} else if ( currNode->options & kXMP_PropValueIsStruct ) {
  ------------------
  |  Branch (201:14): [True: 9.38k, False: 146k]
  ------------------
  202|  43.5k|		for ( size_t fieldNum = 0, fieldLim = currNode->children.size(); fieldNum < fieldLim; ++fieldNum ) {
  ------------------
  |  Branch (202:68): [True: 34.1k, False: 9.38k]
  ------------------
  203|  34.1k|			const XMP_Node * currField = currNode->children[fieldNum];
  204|  34.1k|			DeclareElemNamespace ( currField->name, usedNS, outputStr, newline, indentStr, indent );
  205|  34.1k|		}
  206|  9.38k|	}
  207|       |
  208|   263k|	for ( size_t childNum = 0, childLim = currNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (208:67): [True: 94.6k, False: 168k]
  ------------------
  209|  94.6k|		const XMP_Node * currChild = currNode->children[childNum];
  210|  94.6k|		DeclareUsedNamespaces ( currChild, usedNS, outputStr, newline, indentStr, indent );
  211|  94.6k|	}
  212|       |
  213|   229k|	for ( size_t qualNum = 0, qualLim = currNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (213:67): [True: 61.1k, False: 168k]
  ------------------
  214|  61.1k|		const XMP_Node * currQual = currNode->qualifiers[qualNum];
  215|  61.1k|		DeclareElemNamespace ( currQual->name, usedNS, outputStr, newline, indentStr, indent );
  216|  61.1k|		DeclareUsedNamespaces ( currQual, usedNS, outputStr, newline, indentStr, indent );
  217|  61.1k|	}
  218|       |	
  219|   168k|}	// DeclareUsedNamespaces
XMPMeta-Serialize.cpp:_ZL19DeclareOneNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_RS5_S8_PKcSA_i:
  133|   108k|{
  134|   108k|	XMP_VarString boundedPrefix = ":";
  135|   108k|	boundedPrefix += nsPrefix;
  136|   108k|	size_t nsPos = usedNS.find ( boundedPrefix );
  137|       |
  138|   108k|	if ( nsPos == XMP_VarString::npos ) {
  ------------------
  |  Branch (138:7): [True: 10.4k, False: 97.5k]
  ------------------
  139|       |		
  140|  10.4k|		outputStr += newline;
  141|  52.3k|		for ( ; indent > 0; --indent ) outputStr += indentStr;
  ------------------
  |  Branch (141:11): [True: 41.8k, False: 10.4k]
  ------------------
  142|  10.4k|		outputStr += "xmlns:";
  143|  10.4k|		outputStr += nsPrefix;
  144|  10.4k|		if (outputStr[outputStr.size ( ) - 1] == ':')
  ------------------
  |  Branch (144:7): [True: 10.4k, False: 0]
  ------------------
  145|  10.4k|			outputStr[outputStr.size ( ) - 1] = '=';	// Change the colon to =.
  146|      0|		else
  147|      0|			outputStr += '=';
  148|  10.4k|		outputStr += '"';
  149|  10.4k|		outputStr += nsURI;
  150|  10.4k|		outputStr += '"';
  151|       |
  152|  10.4k|		usedNS += nsPrefix;
  153|       |
  154|  10.4k|	}
  155|       |
  156|   108k|}	// DeclareOneNamespace
XMPMeta-Serialize.cpp:_ZL20DeclareElemNamespaceRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_S8_PKcSA_i:
  170|  95.2k|{
  171|  95.2k|	size_t colonPos = elemName.find ( ':' );
  172|       |
  173|  95.2k|	if ( colonPos != XMP_VarString::npos ) {
  ------------------
  |  Branch (173:7): [True: 95.2k, False: 0]
  ------------------
  174|  95.2k|		XMP_VarString nsPrefix ( elemName.substr ( 0, colonPos+1 ) );
  175|  95.2k|		XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( nsPrefix );
  176|  95.2k|		XMP_Enforce ( prefixPos != sNamespacePrefixToURIMap->end() );
  ------------------
  |  |  148|  95.2k|		if ( ! (c) ) {																				\
  |  |  ------------------
  |  |  |  Branch (148:8): [True: 0, False: 95.2k]
  |  |  ------------------
  |  |  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|  95.2k|		DeclareOneNamespace ( nsPrefix, prefixPos->second, usedNS, outputStr, newline, indentStr, indent );
  178|  95.2k|	}
  179|       |
  180|  95.2k|}	// DeclareElemNamespace
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFAttrPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  687|  21.8k|{
  688|  21.8k|	size_t prop, propLim;
  689|  21.8k|	bool allAreAttrs = true;
  690|       |
  691|  77.9k|	for ( prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (691:57): [True: 56.0k, False: 21.8k]
  ------------------
  692|       |
  693|  56.0k|		const XMP_Node * currProp = parentNode->children[prop];
  694|  56.0k|		if ( ! CanBeRDFAttrProp ( currProp ) ) {
  ------------------
  |  Branch (694:8): [True: 4.78k, False: 51.2k]
  ------------------
  695|  4.78k|			allAreAttrs = false;
  696|  4.78k|			continue;
  697|  4.78k|		}
  698|       |		
  699|  51.2k|		outputStr += newline;
  700|   302k|		for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (700:35): [True: 251k, False: 51.2k]
  ------------------
  701|  51.2k|		outputStr += currProp->name;
  702|  51.2k|		outputStr += "=\"";
  703|  51.2k|		AppendNodeValue ( outputStr, currProp->value, kForAttribute );
  704|  51.2k|		outputStr += '"';
  705|       |
  706|  51.2k|	}
  707|       |	
  708|  21.8k|	return allAreAttrs;
  709|       |
  710|  21.8k|}	// SerializeCompactRDFAttrProps
XMPMeta-Serialize.cpp:_ZL16CanBeRDFAttrPropPK8XMP_Node:
  346|   142k|{
  347|       |	
  348|   142k|	if ( propNode->name[0] == '[' ) return false;
  ------------------
  |  Branch (348:7): [True: 38.0k, False: 104k]
  ------------------
  349|   104k|	if ( ! propNode->qualifiers.empty() ) return false;
  ------------------
  |  Branch (349:7): [True: 392, False: 103k]
  ------------------
  350|   103k|	if ( propNode->options & kXMP_PropValueIsURI ) return false;
  ------------------
  |  Branch (350:7): [True: 0, False: 103k]
  ------------------
  351|   103k|	if ( propNode->options & kXMP_PropCompositeMask ) return false;
  ------------------
  |  Branch (351:7): [True: 9.45k, False: 94.5k]
  ------------------
  352|       |	
  353|  94.5k|	return true;
  354|       |	
  355|   103k|}	// CanBeRDFAttrProp
XMPMeta-Serialize.cpp:_ZL15AppendNodeValueRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_b:
  286|   141k|{
  287|       |
  288|   141k|	unsigned char * runStart = (unsigned char *) value.c_str();
  289|   141k|	unsigned char * runLimit  = runStart + value.size();
  290|   141k|	unsigned char * runEnd;
  291|   141k|	unsigned char   ch=0;
  292|       |	
  293|  3.83M|	while ( runStart < runLimit ) {
  ------------------
  |  Branch (293:10): [True: 3.68M, False: 141k]
  ------------------
  294|       |	
  295|  18.9M|		for ( runEnd = runStart; runEnd < runLimit; ++runEnd ) {
  ------------------
  |  Branch (295:28): [True: 18.8M, False: 132k]
  ------------------
  296|  18.8M|			ch = *runEnd;
  297|  18.8M|			if ( forAttribute && (ch == '"') ) break;
  ------------------
  |  Branch (297:9): [True: 17.2M, False: 1.57M]
  |  Branch (297:25): [True: 1.27M, False: 16.0M]
  ------------------
  298|  17.5M|			if ( (ch < 0x20) || (ch == '&') || (ch == '<') || (ch == '>') ) break;
  ------------------
  |  Branch (298:9): [True: 1.90M, False: 15.6M]
  |  Branch (298:24): [True: 441, False: 15.6M]
  |  Branch (298:39): [True: 472, False: 15.6M]
  |  Branch (298:54): [True: 381k, False: 15.2M]
  ------------------
  299|  17.5M|		}
  300|       |		
  301|  3.68M|		outputStr.append ( (char *) runStart, (runEnd - runStart) );
  302|       |		
  303|  3.68M|		if ( runEnd < runLimit ) {
  ------------------
  |  Branch (303:8): [True: 3.55M, False: 132k]
  ------------------
  304|       |
  305|  3.55M|			if ( ch < 0x20 ) {
  ------------------
  |  Branch (305:9): [True: 1.90M, False: 1.65M]
  ------------------
  306|       |			
  307|  1.90M|				XMP_Assert ( (ch == kTab) || (ch == kLF) || (ch == kCR) );
  ------------------
  |  |  142|  1.90M|	#define XMP_Assert(c)	((void) 0)
  ------------------
  308|       |
  309|  1.90M|				char hexBuf[16];
  310|  1.90M|				memcpy ( hexBuf, "&#xn;", 5 );
  311|  1.90M|				hexBuf[3] = kHexDigits[ch&0xF];
  ------------------
  |  |   94|  1.90M|#define kHexDigits "0123456789ABCDEF"
  ------------------
  312|  1.90M|				outputStr.append ( hexBuf, 5 );
  313|       |
  314|  1.90M|			} else {
  315|       |
  316|  1.65M|				if ( ch == '"' ) {
  ------------------
  |  Branch (316:10): [True: 1.27M, False: 382k]
  ------------------
  317|  1.27M|					outputStr += "&quot;";
  318|  1.27M|				} else if ( ch == '<' ) {
  ------------------
  |  Branch (318:17): [True: 472, False: 381k]
  ------------------
  319|    472|					outputStr += "&lt;";
  320|   381k|				} else if ( ch == '>' ) {
  ------------------
  |  Branch (320:17): [True: 381k, False: 441]
  ------------------
  321|   381k|					outputStr += "&gt;";
  322|   381k|				} else {
  323|    441|					XMP_Assert ( ch == '&' );
  ------------------
  |  |  142|    441|	#define XMP_Assert(c)	((void) 0)
  ------------------
  324|    441|					outputStr += "&amp;";
  325|    441|				}
  326|       |
  327|  1.65M|			}
  328|       |
  329|  3.55M|			++runEnd;
  330|       |
  331|  3.55M|		}
  332|       |		
  333|  3.68M|		runStart = runEnd;
  334|       |	
  335|  3.68M|	}
  336|       |
  337|   141k|}	// AppendNodeValue
XMPMeta-Serialize.cpp:_ZL28SerializeCompactRDFElemPropsPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_i:
  758|  9.35k|{
  759|  9.35k|	XMP_Index level;
  760|       |
  761|  61.9k|	for ( size_t prop = 0, propLim = parentNode->children.size(); prop != propLim; ++prop ) {
  ------------------
  |  Branch (761:64): [True: 52.6k, False: 9.35k]
  ------------------
  762|       |
  763|  52.6k|		const XMP_Node * propNode = parentNode->children[prop];
  764|  52.6k|		if ( CanBeRDFAttrProp ( propNode ) ) continue;
  ------------------
  |  Branch (764:8): [True: 9.74k, False: 42.9k]
  ------------------
  765|       |
  766|  42.9k|		bool emitEndTag = true;
  767|  42.9k|		bool indentEndTag = true;
  768|       |
  769|  42.9k|		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|  42.9k|		XMP_StringPtr elemName = propNode->name.c_str();
  777|  42.9k|		if ( *elemName == '[' ) elemName = "rdf:li";
  ------------------
  |  Branch (777:8): [True: 38.0k, False: 4.88k]
  ------------------
  778|       |
  779|   248k|		for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (779:25): [True: 205k, False: 42.9k]
  ------------------
  780|  42.9k|		outputStr += '<';
  781|  42.9k|		outputStr += elemName;
  782|       |
  783|  42.9k|		#define isCompact	false
  784|  42.9k|		bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  783|  42.9k|		#define isCompact	false
  ------------------
  785|  42.9k|		bool hasRDFResourceQual   = false;
  786|       |
  787|   103k|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (787:68): [True: 61.0k, False: 42.9k]
  ------------------
  788|  61.0k|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  789|  61.0k|			if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (789:9): [True: 50.0k, False: 10.9k]
  ------------------
  790|  50.0k|				hasGeneralQualifiers = true;
  791|  50.0k|			} else {
  792|  10.9k|				if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (792:10): [True: 0, False: 10.9k]
  ------------------
  793|  10.9k|				outputStr += ' ';
  794|  10.9k|				outputStr += currQual->name;
  795|  10.9k|				outputStr += "=\"";
  796|  10.9k|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  797|  10.9k|				outputStr += '"';
  798|  10.9k|			}
  799|  61.0k|		}
  800|       |		
  801|       |		// --------------------------------------------------------
  802|       |		// Process the property according to the standard patterns.
  803|       |	
  804|  42.9k|		if ( hasGeneralQualifiers ) {
  ------------------
  |  Branch (804:8): [True: 2.25k, False: 40.6k]
  ------------------
  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|  2.25k|			outputStr += " rdf:parseType=\"Resource\">";
  815|  2.25k|			outputStr += newline;
  816|       |
  817|  2.25k|			SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  818|       |		
  819|  2.25k|			size_t qualNum = 0;
  820|  2.25k|			size_t qualLim = propNode->qualifiers.size();
  821|  2.25k|			if ( propNode->options & kXMP_PropHasLang ) ++qualNum;
  ------------------
  |  Branch (821:9): [True: 26, False: 2.23k]
  ------------------
  822|       |			
  823|  52.3k|			for ( ; qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (823:12): [True: 50.0k, False: 2.25k]
  ------------------
  824|  50.0k|				const XMP_Node * currQual = propNode->qualifiers[qualNum];
  825|  50.0k|				SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  826|  50.0k|			}
  827|       |			
  828|  40.6k|		} else {
  829|       |
  830|       |			// --------------------------------------------------------------------
  831|       |			// This node has only attribute qualifiers. Emit as a property element.
  832|       |			
  833|  40.6k|			if ( propForm == 0 ) {
  ------------------
  |  Branch (833:9): [True: 27.1k, False: 13.4k]
  ------------------
  834|       |			
  835|       |				// --------------------------
  836|       |				// This is a simple property.
  837|       |				
  838|  27.1k|				if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (838:10): [True: 0, False: 27.1k]
  ------------------
  839|      0|					outputStr += " rdf:resource=\"";
  840|      0|					AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  841|      0|					outputStr += "\"/>";
  842|      0|					outputStr += newline;
  843|      0|					emitEndTag = false;
  844|  27.1k|				} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (844:17): [True: 151, False: 26.9k]
  ------------------
  845|    151|					outputStr += "/>";
  846|    151|					outputStr += newline;
  847|    151|					emitEndTag = false;
  848|  26.9k|				} else {
  849|  26.9k|					outputStr += '>';
  850|  26.9k|					AppendNodeValue ( outputStr, propNode->value, kForElement );
  851|  26.9k|					indentEndTag = false;
  852|  26.9k|				}
  853|       |				
  854|  27.1k|			} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (854:16): [True: 4.25k, False: 9.24k]
  ------------------
  855|       |
  856|       |				// -----------------
  857|       |				// This is an array.
  858|       |				
  859|  4.25k|				outputStr += '>';
  860|  4.25k|				outputStr += newline;
  861|  4.25k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  862|       |			
  863|  4.25k|				if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (863:10): [True: 0, False: 4.25k]
  ------------------
  864|  4.25k|				SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+2 );
  865|       |
  866|  4.25k|				EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  867|       |
  868|  9.24k|			} else {
  869|       |
  870|       |				// ----------------------
  871|       |				// This must be a struct.
  872|       |				
  873|  9.24k|				XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|  9.24k|	#define XMP_Assert(c)	((void) 0)
  ------------------
  874|       |
  875|  9.24k|				bool hasAttrFields = false;
  876|  9.24k|				bool hasElemFields = false;
  877|       |			
  878|  9.24k|				size_t field, fieldLim;
  879|  42.8k|				for ( field = 0, fieldLim = propNode->children.size(); field != fieldLim; ++field ) {
  ------------------
  |  Branch (879:60): [True: 33.7k, False: 9.16k]
  ------------------
  880|  33.7k|					XMP_Node * currField = propNode->children[field];
  881|  33.7k|					if ( CanBeRDFAttrProp ( currField ) ) {
  ------------------
  |  Branch (881:11): [True: 33.5k, False: 176]
  ------------------
  882|  33.5k|						hasAttrFields = true;
  883|  33.5k|						if ( hasElemFields ) break;	// No sense looking further.
  ------------------
  |  Branch (883:12): [True: 0, False: 33.5k]
  ------------------
  884|  33.5k|					} else {
  885|    176|						hasElemFields = true;
  886|    176|						if ( hasAttrFields ) break;	// No sense looking further.
  ------------------
  |  Branch (886:12): [True: 75, False: 101]
  ------------------
  887|    176|					}
  888|  33.7k|				}
  889|       |				
  890|  9.24k|				if ( hasRDFResourceQual && hasElemFields ) {
  ------------------
  |  Branch (890:10): [True: 0, False: 9.24k]
  |  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|  9.24k|				if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (894:10): [True: 7, False: 9.23k]
  ------------------
  895|       |				
  896|       |					// Catch an empty struct as a special case. The case below would emit an empty
  897|       |					// XML element, which gets reparsed as a simple property with an empty value.
  898|      7|					outputStr += " rdf:parseType=\"Resource\"/>";
  899|      7|					outputStr += newline;
  900|      7|					emitEndTag = false;
  901|       |				
  902|  9.23k|				} else if ( ! hasElemFields ) {
  ------------------
  |  Branch (902:17): [True: 9.05k, False: 176]
  ------------------
  903|       |
  904|       |					// All fields can be attributes, use the emptyPropertyElt form.
  905|  9.05k|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+1 );
  906|  9.05k|					outputStr += "/>";
  907|  9.05k|					outputStr += newline;
  908|  9.05k|					emitEndTag = false;
  909|       |
  910|  9.05k|				} else if ( ! hasAttrFields ) {
  ------------------
  |  Branch (910:17): [True: 101, False: 75]
  ------------------
  911|       |				
  912|       |					// All fields must be elements, use the parseTypeResourcePropertyElt form.
  913|    101|					outputStr += " rdf:parseType=\"Resource\">";
  914|    101|					outputStr += newline;
  915|    101|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  916|       |				
  917|    101|				} else {
  918|       |				
  919|       |					// Have a mix of attributes and elements, use an inner rdf:Description.
  920|     75|					outputStr += '>';
  921|     75|					outputStr += newline;
  922|    468|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (922:30): [True: 393, False: 75]
  ------------------
  923|     75|					outputStr += "<rdf:Description";
  924|     75|					SerializeCompactRDFAttrProps ( propNode, outputStr, newline, indentStr, indent+2 );
  925|     75|					outputStr += ">";
  926|     75|					outputStr += newline;
  927|     75|					SerializeCompactRDFElemProps ( propNode, outputStr, newline, indentStr, indent+1 );
  928|    468|					for ( level = indent+1; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (928:30): [True: 393, False: 75]
  ------------------
  929|     75|					outputStr += kRDF_StructEnd;
  930|     75|					outputStr += newline;
  931|       |
  932|     75|				}
  933|       |
  934|  9.24k|			}
  935|       |
  936|  40.6k|		}
  937|       |		
  938|       |		// ----------------------------------
  939|       |		// Emit the property element end tag.
  940|       |		
  941|  42.9k|		if ( emitEndTag ) {
  ------------------
  |  Branch (941:8): [True: 33.6k, False: 9.21k]
  ------------------
  942|  33.6k|			if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (942:9): [True: 6.68k, False: 26.9k]
  |  Branch (942:46): [True: 26.9k, False: 6.68k]
  ------------------
  943|  33.6k|			outputStr += "</";
  944|  33.6k|			outputStr += elemName;
  945|  33.6k|			outputStr += '>';
  946|  33.6k|			outputStr += newline;
  947|  33.6k|		}
  948|       |
  949|  42.9k|	}
  950|       |	
  951|  9.35k|}	// SerializeCompactRDFElemProps
XMPMeta-Serialize.cpp:_ZL18IsRDFAttrQualifierNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  366|   111k|{
  367|       |
  368|   613k|	for ( size_t i = 0; *sAttrQualifiers[i] != 0; ++i ) {
  ------------------
  |  Branch (368:22): [True: 513k, False: 100k]
  ------------------
  369|   513k|		if ( qualName == sAttrQualifiers[i] ) return true;
  ------------------
  |  Branch (369:8): [True: 10.9k, False: 502k]
  ------------------
  370|   513k|	}
  371|       |
  372|   100k|	return false;
  373|       |	
  374|   111k|}	// IsRDFAttrQualifier
XMPMeta-Serialize.cpp:_ZL26SerializePrettyRDFPropertyPK8XMP_NodeRNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcSB_ib:
  415|  52.9k|{
  416|  52.9k|	XMP_Index level;
  417|  52.9k|	bool emitEndTag   = true;
  418|  52.9k|	bool indentEndTag = true;
  419|       |
  420|  52.9k|	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|  52.9k|	XMP_StringPtr elemName = propNode->name.c_str();
  426|  52.9k|	if ( emitAsRDFValue ) {
  ------------------
  |  Branch (426:7): [True: 2.29k, False: 50.6k]
  ------------------
  427|  2.29k|		elemName= "rdf:value";
  428|  50.6k|	} else if ( *elemName == '[' ) {
  ------------------
  |  Branch (428:14): [True: 127, False: 50.5k]
  ------------------
  429|    127|		elemName = "rdf:li";
  430|    127|	}
  431|       |
  432|   370k|	for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (432:24): [True: 317k, False: 52.9k]
  ------------------
  433|  52.9k|	outputStr += '<';
  434|  52.9k|	outputStr += elemName;
  435|       |	
  436|  52.9k|	#define isCompact	false
  437|  52.9k|	bool hasGeneralQualifiers = isCompact;	// Might also become true later.
  ------------------
  |  |  436|  52.9k|	#define isCompact	false
  ------------------
  438|  52.9k|	bool hasRDFResourceQual   = false;
  439|       |	
  440|   103k|	for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (440:67): [True: 50.3k, False: 52.9k]
  ------------------
  441|  50.3k|		const XMP_Node * currQual = propNode->qualifiers[qualNum];
  442|  50.3k|		if ( ! IsRDFAttrQualifier ( currQual->name ) ) {
  ------------------
  |  Branch (442:8): [True: 50.3k, False: 37]
  ------------------
  443|  50.3k|			hasGeneralQualifiers = true;
  444|  50.3k|		} else {
  445|     37|			if ( currQual->name == "rdf:resource" ) hasRDFResourceQual = true;
  ------------------
  |  Branch (445:9): [True: 0, False: 37]
  ------------------
  446|     37|			if ( ! emitAsRDFValue ) {
  ------------------
  |  Branch (446:9): [True: 9, False: 28]
  ------------------
  447|      9|				outputStr += ' ';
  448|      9|				outputStr += currQual->name;
  449|      9|				outputStr += "=\"";
  450|      9|				AppendNodeValue ( outputStr, currQual->value, kForAttribute );
  451|      9|				outputStr += '"';
  452|      9|			}
  453|     37|		}
  454|  50.3k|	}
  455|       |	
  456|       |	// --------------------------------------------------------
  457|       |	// Process the property according to the standard patterns.
  458|       |	
  459|  52.9k|	if ( hasGeneralQualifiers && (! emitAsRDFValue) ) {
  ------------------
  |  Branch (459:7): [True: 2.33k, False: 50.6k]
  |  Branch (459:31): [True: 38, False: 2.29k]
  ------------------
  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|     38|		if ( hasRDFResourceQual ) {
  ------------------
  |  Branch (465:8): [True: 0, False: 38]
  ------------------
  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|     38|		outputStr += " rdf:parseType=\"Resource\">";
  470|     38|		outputStr += newline;
  471|       |
  472|     38|		SerializePrettyRDFProperty ( propNode, outputStr, newline, indentStr, indent+1, true );
  473|       |		
  474|    161|		for ( size_t qualNum = 0, qualLim = propNode->qualifiers.size(); qualNum < qualLim; ++qualNum ) {
  ------------------
  |  Branch (474:68): [True: 123, False: 38]
  ------------------
  475|    123|			const XMP_Node * currQual = propNode->qualifiers[qualNum];
  476|    123|			if ( IsRDFAttrQualifier ( currQual->name ) ) continue;
  ------------------
  |  Branch (476:9): [True: 2, False: 121]
  ------------------
  477|    121|			SerializePrettyRDFProperty ( currQual, outputStr, newline, indentStr, indent+1 );
  478|    121|		}
  479|       |		
  480|  52.9k|	} else {
  481|       |
  482|       |		// --------------------------------------------------------------------
  483|       |		// This node has no general qualifiers. Emit using an unqualified form.
  484|       |		
  485|  52.9k|		if ( propForm == 0 ) {
  ------------------
  |  Branch (485:8): [True: 52.7k, False: 213]
  ------------------
  486|       |		
  487|       |			// --------------------------
  488|       |			// This is a simple property.
  489|       |			
  490|  52.7k|			if ( propNode->options & kXMP_PropValueIsURI ) {
  ------------------
  |  Branch (490:9): [True: 0, False: 52.7k]
  ------------------
  491|      0|				outputStr += " rdf:resource=\"";
  492|      0|				AppendNodeValue ( outputStr, propNode->value, kForAttribute );
  493|      0|				outputStr += "\"/>";
  494|      0|				outputStr += newline;
  495|      0|				emitEndTag = false;
  496|  52.7k|			} else if ( propNode->value.empty() ) {
  ------------------
  |  Branch (496:16): [True: 46, False: 52.6k]
  ------------------
  497|     46|				outputStr += "/>";
  498|     46|				outputStr += newline;
  499|     46|				emitEndTag = false;
  500|  52.6k|			} else {
  501|  52.6k|				outputStr += '>';
  502|  52.6k|				AppendNodeValue ( outputStr, propNode->value, kForElement );
  503|  52.6k|				indentEndTag = false;
  504|  52.6k|			}
  505|       |			
  506|  52.7k|		} else if ( propForm & kXMP_PropValueIsArray ) {
  ------------------
  |  Branch (506:15): [True: 67, False: 146]
  ------------------
  507|       |		
  508|       |			// This is an array.
  509|     67|			outputStr += '>';
  510|     67|			outputStr += newline;
  511|     67|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsStartTag );
  512|     67|			if ( XMP_ArrayIsAltText(propNode->options) ) NormalizeLangArray ( (XMP_Node*)propNode );
  ------------------
  |  Branch (512:9): [True: 0, False: 67]
  ------------------
  513|    194|			for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (513:69): [True: 127, False: 67]
  ------------------
  514|    127|				const XMP_Node * currChild = propNode->children[childNum];
  515|    127|				SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+2 );
  516|    127|			}
  517|     67|			EmitRDFArrayTag ( propForm, outputStr, newline, indentStr, indent+1, propNode->children.size(), kIsEndTag );
  518|       |		
  519|       |		
  520|    146|		} else if ( ! hasRDFResourceQual ) {
  ------------------
  |  Branch (520:15): [True: 146, False: 0]
  ------------------
  521|       |		
  522|       |			// This is a "normal" struct, use the rdf:parseType="Resource" form.
  523|    146|			XMP_Assert ( propForm & kXMP_PropValueIsStruct );
  ------------------
  |  |  142|    146|	#define XMP_Assert(c)	((void) 0)
  ------------------
  524|    146|			if ( propNode->children.size() == 0 ) {
  ------------------
  |  Branch (524:9): [True: 24, False: 122]
  ------------------
  525|     24|				outputStr += " rdf:parseType=\"Resource\"/>";
  526|     24|				outputStr += newline;
  527|     24|				emitEndTag = false;
  528|    122|			} else {
  529|    122|				outputStr += " rdf:parseType=\"Resource\">";
  530|    122|				outputStr += newline;
  531|    477|				for ( size_t childNum = 0, childLim = propNode->children.size(); childNum < childLim; ++childNum ) {
  ------------------
  |  Branch (531:70): [True: 355, False: 122]
  ------------------
  532|    355|					const XMP_Node * currChild = propNode->children[childNum];
  533|    355|					SerializePrettyRDFProperty ( currChild, outputStr, newline, indentStr, indent+1 );
  534|    355|				}
  535|    122|			}
  536|       |		
  537|    146|		} 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|  52.9k|	}
  561|       |	
  562|       |	// ----------------------------------
  563|       |	// Emit the property element end tag.
  564|       |	
  565|  52.9k|	if ( emitEndTag ) {
  ------------------
  |  Branch (565:7): [True: 52.8k, False: 70]
  ------------------
  566|  52.8k|		if ( indentEndTag ) for ( level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (566:8): [True: 227, False: 52.6k]
  |  Branch (566:45): [True: 1.16k, False: 227]
  ------------------
  567|  52.8k|		outputStr += "</";
  568|  52.8k|		outputStr += elemName;
  569|  52.8k|		outputStr += '>';
  570|  52.8k|		outputStr += newline;
  571|  52.8k|	}
  572|       |	
  573|  52.9k|}	// SerializePrettyRDFProperty
XMPMeta-Serialize.cpp:_ZL15EmitRDFArrayTagjRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKcS8_iib:
  240|  8.64k|{
  241|  8.64k|	if ( (! isStartTag) && (arraySize == 0) ) return;
  ------------------
  |  Branch (241:7): [True: 4.32k, False: 4.32k]
  |  Branch (241:25): [True: 1.23k, False: 3.08k]
  ------------------
  242|       |	
  243|  40.1k|	for ( XMP_Index level = indent; level > 0; --level ) outputStr += indentStr;
  ------------------
  |  Branch (243:34): [True: 32.7k, False: 7.40k]
  ------------------
  244|  7.40k|	if ( isStartTag ) {
  ------------------
  |  Branch (244:7): [True: 4.32k, False: 3.08k]
  ------------------
  245|  4.32k|		outputStr += "<rdf:";
  246|  4.32k|	} else {
  247|  3.08k|		outputStr += "</rdf:";
  248|  3.08k|	}
  249|       |
  250|  7.40k|	if ( arrayForm & kXMP_PropArrayIsAlternate ) {
  ------------------
  |  Branch (250:7): [True: 2.59k, False: 4.81k]
  ------------------
  251|  2.59k|		outputStr += "Alt";
  252|  4.81k|	} else if ( arrayForm & kXMP_PropArrayIsOrdered ) {
  ------------------
  |  Branch (252:14): [True: 4.40k, False: 410]
  ------------------
  253|  4.40k|		outputStr += "Seq";
  254|  4.40k|	} else {
  255|    410|		outputStr += "Bag";
  256|    410|	}
  257|       |	
  258|  7.40k|	if ( isStartTag && (arraySize == 0) ) outputStr += '/';
  ------------------
  |  Branch (258:7): [True: 4.32k, False: 3.08k]
  |  Branch (258:21): [True: 1.23k, False: 3.08k]
  ------------------
  259|  7.40k|	outputStr += '>';
  260|  7.40k|	outputStr += newline;
  261|       |
  262|  7.40k|}	// EmitRDFArrayTag

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

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

